wxformbuilder-3.1.59/0000755000175000017500000000000011143440661014754 5ustar rrmulderrrmulderwxformbuilder-3.1.59/src/0000755000175000017500000000000011143440027015537 5ustar rrmulderrrmulderwxformbuilder-3.1.59/sdk/0000755000175000017500000000000011143440026015530 5ustar rrmulderrrmulderwxformbuilder-3.1.59/wxfbTest/0000755000175000017500000000000011143440026016555 5ustar rrmulderrrmulderwxformbuilder-3.1.59/output/0000755000175000017500000000000011143440026016307 5ustar rrmulderrrmulderwxformbuilder-3.1.59/install/0000755000175000017500000000000011143440026016415 5ustar rrmulderrrmulderwxformbuilder-3.1.59/plugins/0000755000175000017500000000000011143440026016430 5ustar rrmulderrrmulderwxformbuilder-3.1.59/src/rad/0000755000175000017500000000000011143440026016304 5ustar rrmulderrrmulderwxformbuilder-3.1.59/src/model/0000755000175000017500000000000011143440026016636 5ustar rrmulderrrmulderwxformbuilder-3.1.59/src/dbg_stack_trace/0000755000175000017500000000000011143440027020636 5ustar rrmulderrrmulderwxformbuilder-3.1.59/src/codegen/0000755000175000017500000000000011143440027017143 5ustar rrmulderrrmulderwxformbuilder-3.1.59/src/boost/0000755000175000017500000000000011143440027016665 5ustar rrmulderrrmulderwxformbuilder-3.1.59/src/utils/0000755000175000017500000000000011143440027016677 5ustar rrmulderrrmulderwxformbuilder-3.1.59/src/controls/0000755000175000017500000000000011143440026017401 5ustar rrmulderrrmulderwxformbuilder-3.1.59/src/md5/0000755000175000017500000000000011143440026016223 5ustar rrmulderrrmulderwxformbuilder-3.1.59/sdk/tinyxml/0000755000175000017500000000000011143440026017234 5ustar rrmulderrrmulderwxformbuilder-3.1.59/sdk/plugin_interface/0000755000175000017500000000000011143440026021046 5ustar rrmulderrrmulderwxformbuilder-3.1.59/output/resources/0000755000175000017500000000000011143440026020321 5ustar rrmulderrrmulderwxformbuilder-3.1.59/output/xml/0000755000175000017500000000000011143440026017107 5ustar rrmulderrrmulderwxformbuilder-3.1.59/output/plugins/0000755000175000017500000000000011143440026017770 5ustar rrmulderrrmulderwxformbuilder-3.1.59/install/macosx/0000755000175000017500000000000011143440026017707 5ustar rrmulderrrmulderwxformbuilder-3.1.59/install/linux/0000755000175000017500000000000011143440026017554 5ustar rrmulderrrmulderwxformbuilder-3.1.59/install/windows/0000755000175000017500000000000011143440026020107 5ustar rrmulderrrmulderwxformbuilder-3.1.59/plugins/additional/0000755000175000017500000000000011143440026020540 5ustar rrmulderrrmulderwxformbuilder-3.1.59/plugins/common/0000755000175000017500000000000011143440026017720 5ustar rrmulderrrmulderwxformbuilder-3.1.59/plugins/layout/0000755000175000017500000000000011143440026017745 5ustar rrmulderrrmulderwxformbuilder-3.1.59/plugins/wxAdditions/0000755000175000017500000000000011143440026020725 5ustar rrmulderrrmulderwxformbuilder-3.1.59/plugins/containers/0000755000175000017500000000000011143440026020575 5ustar rrmulderrrmulderwxformbuilder-3.1.59/src/rad/dataobject/0000755000175000017500000000000011143440026020404 5ustar rrmulderrrmulderwxformbuilder-3.1.59/src/rad/geninheritclass/0000755000175000017500000000000011143440026021466 5ustar rrmulderrrmulderwxformbuilder-3.1.59/src/rad/inspector/0000755000175000017500000000000011143440026020312 5ustar rrmulderrrmulderwxformbuilder-3.1.59/src/rad/objecttree/0000755000175000017500000000000011143440026020432 5ustar rrmulderrrmulderwxformbuilder-3.1.59/src/rad/xrcpanel/0000755000175000017500000000000011143440026020120 5ustar rrmulderrrmulderwxformbuilder-3.1.59/src/rad/xrcpreview/0000755000175000017500000000000011143440026020502 5ustar rrmulderrrmulderwxformbuilder-3.1.59/src/rad/cpppanel/0000755000175000017500000000000011143440026020106 5ustar rrmulderrrmulderwxformbuilder-3.1.59/src/rad/codeeditor/0000755000175000017500000000000011143440026020425 5ustar rrmulderrrmulderwxformbuilder-3.1.59/src/rad/designer/0000755000175000017500000000000011143440026020104 5ustar rrmulderrrmulderwxformbuilder-3.1.59/src/boost/detail/0000755000175000017500000000000011143440027020127 5ustar rrmulderrrmulderwxformbuilder-3.1.59/src/boost/config/0000755000175000017500000000000011143440027020132 5ustar rrmulderrrmulderwxformbuilder-3.1.59/src/controls/src/0000755000175000017500000000000011143440027020171 5ustar rrmulderrrmulderwxformbuilder-3.1.59/src/controls/include/0000755000175000017500000000000011143440026021024 5ustar rrmulderrrmulderwxformbuilder-3.1.59/src/controls/build/0000755000175000017500000000000011143440026020500 5ustar rrmulderrrmulderwxformbuilder-3.1.59/output/resources/icons/0000755000175000017500000000000011143440026021434 5ustar rrmulderrrmulderwxformbuilder-3.1.59/output/plugins/additional/0000755000175000017500000000000011143440026022100 5ustar rrmulderrrmulderwxformbuilder-3.1.59/output/plugins/common/0000755000175000017500000000000011143440026021260 5ustar rrmulderrrmulderwxformbuilder-3.1.59/output/plugins/layout/0000755000175000017500000000000011143440026021305 5ustar rrmulderrrmulderwxformbuilder-3.1.59/output/plugins/containers/0000755000175000017500000000000011143440026022135 5ustar rrmulderrrmulderwxformbuilder-3.1.59/install/linux/data/0000755000175000017500000000000011143440026020465 5ustar rrmulderrrmulderwxformbuilder-3.1.59/install/linux/debian/0000755000175000017500000000000011143440026020776 5ustar rrmulderrrmulderwxformbuilder-3.1.59/install/windows/support/0000755000175000017500000000000011143440026021623 5ustar rrmulderrrmulderwxformbuilder-3.1.59/src/boost/config/platform/0000755000175000017500000000000011143440027021756 5ustar rrmulderrrmulderwxformbuilder-3.1.59/src/boost/config/abi/0000755000175000017500000000000011143440027020665 5ustar rrmulderrrmulderwxformbuilder-3.1.59/src/boost/config/compiler/0000755000175000017500000000000011143440027021744 5ustar rrmulderrrmulderwxformbuilder-3.1.59/src/boost/config/stdlib/0000755000175000017500000000000011143440027021413 5ustar rrmulderrrmulderwxformbuilder-3.1.59/src/controls/src/propgrid/0000755000175000017500000000000011143440027022017 5ustar rrmulderrrmulderwxformbuilder-3.1.59/src/controls/src/wxFlatNotebook/0000755000175000017500000000000011143440027023137 5ustar rrmulderrrmulderwxformbuilder-3.1.59/src/controls/src/wxScintilla/0000755000175000017500000000000011143440026022471 5ustar rrmulderrrmulderwxformbuilder-3.1.59/src/controls/include/wx/0000755000175000017500000000000011143440026021462 5ustar rrmulderrrmulderwxformbuilder-3.1.59/src/controls/build/propgrid/0000755000175000017500000000000011143440026022326 5ustar rrmulderrrmulderwxformbuilder-3.1.59/src/controls/build/wxFlatNotebook/0000755000175000017500000000000011143440026023446 5ustar rrmulderrrmulderwxformbuilder-3.1.59/src/controls/build/wxScintilla/0000755000175000017500000000000011143440026023001 5ustar rrmulderrrmulderwxformbuilder-3.1.59/output/plugins/additional/icons/0000755000175000017500000000000011143440026023213 5ustar rrmulderrrmulderwxformbuilder-3.1.59/output/plugins/additional/xml/0000755000175000017500000000000011143440026022700 5ustar rrmulderrrmulderwxformbuilder-3.1.59/output/plugins/common/icons/0000755000175000017500000000000011143440026022373 5ustar rrmulderrrmulderwxformbuilder-3.1.59/output/plugins/common/xml/0000755000175000017500000000000011143440026022060 5ustar rrmulderrrmulderwxformbuilder-3.1.59/output/plugins/layout/icons/0000755000175000017500000000000011143440026022420 5ustar rrmulderrrmulderwxformbuilder-3.1.59/output/plugins/layout/xml/0000755000175000017500000000000011143440026022105 5ustar rrmulderrrmulderwxformbuilder-3.1.59/output/plugins/containers/icons/0000755000175000017500000000000011143440026023250 5ustar rrmulderrrmulderwxformbuilder-3.1.59/output/plugins/containers/xml/0000755000175000017500000000000011143440026022735 5ustar rrmulderrrmulderwxformbuilder-3.1.59/install/linux/data/gnome/0000755000175000017500000000000011143440026021572 5ustar rrmulderrrmulderwxformbuilder-3.1.59/src/controls/src/wxScintilla/scintilla/0000755000175000017500000000000011143440026024453 5ustar rrmulderrrmulderwxformbuilder-3.1.59/src/controls/include/wx/propgrid/0000755000175000017500000000000011143440026023310 5ustar rrmulderrrmulderwxformbuilder-3.1.59/src/controls/include/wx/wxFlatNotebook/0000755000175000017500000000000011143440026024430 5ustar rrmulderrrmulderwxformbuilder-3.1.59/src/controls/include/wx/wxScintilla/0000755000175000017500000000000011143440026023763 5ustar rrmulderrrmulderwxformbuilder-3.1.59/install/linux/data/gnome/usr/0000755000175000017500000000000011143440026022403 5ustar rrmulderrrmulderwxformbuilder-3.1.59/src/controls/src/wxScintilla/scintilla/src/0000755000175000017500000000000011143440026025242 5ustar rrmulderrrmulderwxformbuilder-3.1.59/src/controls/src/wxScintilla/scintilla/include/0000755000175000017500000000000011143440026026076 5ustar rrmulderrrmulderwxformbuilder-3.1.59/install/linux/data/gnome/usr/share/0000755000175000017500000000000011143440026023505 5ustar rrmulderrrmulderwxformbuilder-3.1.59/install/linux/data/gnome/usr/share/icons/0000755000175000017500000000000011143440026024620 5ustar rrmulderrrmulderwxformbuilder-3.1.59/install/linux/data/gnome/usr/share/pixmaps/0000755000175000017500000000000011143440026025166 5ustar rrmulderrrmulderwxformbuilder-3.1.59/install/linux/data/gnome/usr/share/applications/0000755000175000017500000000000011143440026026173 5ustar rrmulderrrmulderwxformbuilder-3.1.59/install/linux/data/gnome/usr/share/icons/gnome/0000755000175000017500000000000011143440026025725 5ustar rrmulderrrmulderwxformbuilder-3.1.59/install/linux/data/gnome/usr/share/icons/gnome/48x48/0000755000175000017500000000000011143440026026524 5ustar rrmulderrrmulderwxformbuilder-3.1.59/install/linux/data/gnome/usr/share/icons/gnome/48x48/mimetypes/0000755000175000017500000000000011143440026030540 5ustar rrmulderrrmulderwxformbuilder-3.1.59/COPYING0000644000175000017500000004311011143440026016001 0ustar rrmulderrrmulder GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. wxformbuilder-3.1.59/premake.lua0000644000175000017500000000436011143440026017101 0ustar rrmulderrrmulderproject.name = "wxFormBuilder" if ( windows ) then project.bindir = "output" else project.bindir = "output/lib/wxformbuilder" end -- Configureations. All I am doing is reordering them so that -- it defaults to a Release build. project.configs = { "Release", "Debug" } -- Add packages here. dopackage( "src/controls/build/propgrid" ) dopackage( "src/controls/build/wxFlatNotebook" ) dopackage( "src/controls/build/wxScintilla" ) dopackage( "sdk/plugin_interface" ) dopackage( "sdk/tinyxml/ticpp.lua" ) dopackage( "plugins/additional" ) dopackage( "plugins/common" ) dopackage( "plugins/containers" ) dopackage( "plugins/layout" ) dopackage( "plugins/wxAdditions" ) -- do this package last, so the post build step actually happens at the end of all the building dopackage( "src" ) -- Pre-build file creation steps function CreateShareReadme( filename ) local text = "This directory and the symlink it contains were created automatically by premake\n" .. "to facilitate execution of wxFormBuilder prior to installation on Unix platforms.\n" .. "On Unix, wxFormBuilder expects to be executed from a directory named \"output\",\n" .. "which is next to a directory named \"share\". The \"share\" directory should have a\n" .. "subdirectory named \"wxformbuilder\", which contains the configuration files." if ( not os.fileexists( filename ) ) then local fo = io.open( filename, "w" ) fo:write( text ) fo:close() end end function CreateSymlink( pathToLink, symLink ) os.execute( "ln -s -f -n " .. pathToLink .. " " .. symLink ) end if ( not windows ) then addoption( "skip-symlink", "Do not create the symlink output/share/wxformbuilder" ) if ( not options["skip-symlink"] ) then print( "Running pre-build file creation steps..." ) -- Create a 'share' directory. -- HACK: make sure the warning isn't shown on the console. os.execute( "mkdir output/share >/dev/null 2>/dev/null" ) CreateShareReadme( "output/share/README.txt" ) CreateSymlink( "../../output", "output/share/wxformbuilder" ) end end if ( linux ) then addoption("install", "Copy the application to the specified path") function doinstall(cmd, arg) if (not arg) then error("You must specify an install location") end os.execute( "install/linux/wxfb_export.sh " .. arg ) end end wxformbuilder-3.1.59/Makefile0000644000175000017500000000542311143440573016422 0ustar rrmulderrrmulder# Makefile autogenerated by premake # Don't edit this file! Instead edit `premake.lua` then rerun `make` # Options: # CONFIG=[Release|Debug] ifndef CONFIG CONFIG=Release endif export CONFIG .PHONY: all clean wxPropGrid wxFlatNotebook wxScintilla plugin-interface TiCPP additional-components-plugin common-components-plugin containers-components-plugin layout-components-plugin wxadditions-mini-plugin wxFormBuilder all: wxPropGrid wxFlatNotebook wxScintilla plugin-interface TiCPP additional-components-plugin common-components-plugin containers-components-plugin layout-components-plugin wxadditions-mini-plugin wxFormBuilder wxPropGrid: @echo ==== Building wxPropGrid ==== @$(MAKE) --no-print-directory -C src/controls/build/propgrid wxFlatNotebook: @echo ==== Building wxFlatNotebook ==== @$(MAKE) --no-print-directory -C src/controls/build/wxFlatNotebook wxScintilla: @echo ==== Building wxScintilla ==== @$(MAKE) --no-print-directory -C src/controls/build/wxScintilla plugin-interface: TiCPP @echo ==== Building plugin-interface ==== @$(MAKE) --no-print-directory -C sdk/plugin_interface TiCPP: @echo ==== Building TiCPP ==== @$(MAKE) --no-print-directory -C sdk/tinyxml additional-components-plugin: plugin-interface TiCPP @echo ==== Building additional-components-plugin ==== @$(MAKE) --no-print-directory -C plugins/additional common-components-plugin: plugin-interface TiCPP @echo ==== Building common-components-plugin ==== @$(MAKE) --no-print-directory -C plugins/common containers-components-plugin: plugin-interface TiCPP @echo ==== Building containers-components-plugin ==== @$(MAKE) --no-print-directory -C plugins/containers layout-components-plugin: plugin-interface TiCPP @echo ==== Building layout-components-plugin ==== @$(MAKE) --no-print-directory -C plugins/layout wxadditions-mini-plugin: wxFlatNotebook wxPropGrid wxScintilla plugin-interface TiCPP @echo ==== Building wxadditions-mini-plugin ==== @$(MAKE) --no-print-directory -C plugins/wxAdditions wxFormBuilder: wxFlatNotebook wxPropGrid wxScintilla TiCPP plugin-interface @echo ==== Building wxFormBuilder ==== @$(MAKE) --no-print-directory -C src clean: @$(MAKE) --no-print-directory -C src/controls/build/propgrid clean @$(MAKE) --no-print-directory -C src/controls/build/wxFlatNotebook clean @$(MAKE) --no-print-directory -C src/controls/build/wxScintilla clean @$(MAKE) --no-print-directory -C sdk/plugin_interface clean @$(MAKE) --no-print-directory -C sdk/tinyxml clean @$(MAKE) --no-print-directory -C plugins/additional clean @$(MAKE) --no-print-directory -C plugins/common clean @$(MAKE) --no-print-directory -C plugins/containers clean @$(MAKE) --no-print-directory -C plugins/layout clean @$(MAKE) --no-print-directory -C plugins/wxAdditions clean @$(MAKE) --no-print-directory -C src clean wxformbuilder-3.1.59/README.txt0000644000175000017500000000400711143440026016446 0ustar rrmulderrrmulderwxFormBuilder ------------- Introduction: wxFormBuilder aims to be an application that as well as enabling visual development and generating the corresponding code, allow the inclusion of non-graphical components, as well as providing facilities for extending the set of widgets easily via plugins, like other applications such as qt-designer. Use Premake, for your platform, to generate the build files of your choice. REMEMBER: The way you get new additions and updates to the build files you need to run Premake. This is means that it is good practice to run Premake before starting to build or develop wxFormBuilder. Build Steps: - There are included batch/sh script that you can run to just simplify running and creating the build files. Just run it to create the necessary build files. You can skip the next step if you use those. * Files: Windows: create_build_files.bat Linux: create_build_files.sh - To create the needed build files type: * Code::Blocks Projects and workspace: Windows: sdk\premake\premake-win32.exe --target cb-gcc --with-wx-shared [--unicode] Linux: sdk/premake/premake-linux --target cb-gcc --with-wx-shared [--unicode] * GNU makefiles: Windows: sdk\premake\premake-win32.exe --target gnu --with-wx-shared [--unicode] Linux: sdk/premake/premake-linux --target gnu --with-wx-shared [--unicode] - For Code::Blocks, use the generated wxFormBuilder.workspace to build wxFormBuilder. - For GNU makefiles type: (Assumes you have properly setup your system to build with gcc or MinGW) * Release: make CONFIG=Release * Debug: make Includes: - wxFormBuilder - wxFormBuilder SDK - wxFormBuilder 3rd Party Controls Notes: - Code::Blocks is a free cross-platform IDE and it can be found here: http://codeblocks.org - Premake can be found here: http://premake.sourceforge.net - Subversion is a great free cross-platform version control manager. It can be found here: http://subversion.tigris.org Enjoy, The wxFormBuilder Teamwxformbuilder-3.1.59/src/wxFormBuilder.rc0000644000175000017500000000302011143440027020651 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// // set this to 1 if you don't want to use manifest resource (manifest resource // is needed to enable visual styles on Windows XP - see docs/msw/winxp.txt // for more information) //#if (_MSC_VER >= 1400) // VC8+ // #define wxUSE_NO_MANIFEST 1 //#else // #define wxUSE_NO_MANIFEST 0 //#endif #include "wx/msw/wx.rc" //wxBITMAP_STD_COLOURS BITMAP "wx/msw/colours.bmp" A ICON MOVEABLE PURE LOADONCALL DISCARDABLE "wxFormBuilder.ico" wxformbuilder-3.1.59/src/pch.h0000644000175000017500000000252611143440027016467 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #ifndef PCH_H #define PCH_H #if ( !defined(WX_PRECOMP) ) #define WX_PRECOMP #endif // basic wxWidgets headers #include #ifndef WX_PRECOMP #include #endif // #include other rarely changing headers here #endif // PCH_H wxformbuilder-3.1.59/src/premake.lua0000644000175000017500000002542411143440027017675 0ustar rrmulderrrmulder--***************************************************************************** --* Author: RJP Computing --* Date: 12/15/2006 --* Version: 1.00-beta --* Copyright (C) 2006 RJP Computing --* --* This program is free software; you can redistribute it and/or --* modify it under the terms of the GNU General Public License --* as published by the Free Software Foundation; either version 2 --* of the License, or (at your option) any later version. --* --* This program is distributed in the hope that it will be useful, --* but WITHOUT ANY WARRANTY; without even the implied warranty of --* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --* GNU General Public License for more details. --* --* You should have received a copy of the GNU General Public License --* along with this program; if not, write to the Free Software --* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --* --* NOTES: --* - use the '/' slash for all paths. --***************************************************************************** -- wxWidgets version local wx_ver = "28" --******* Initial Setup ************ --* Most of the setting are set here. --********************************** -- Set the name of your package. package.name = "wxFormBuilder" -- Set this if you want a different name for your target than the package's name. local targetName = "" if ( not windows ) then -- All lowercase binary names are normal in linux targetName = "wxformbuilder" end -- Set the kind of package you want to create. -- Options: exe | winexe | lib | dll package.kind = "winexe" -- Set the files to include. package.files = { matchrecursive( "*.cpp", "*.hpp", "*.h", "*.cc", "*.hh", "*.rc" ) } -- Set the files to exclude. package.excludes = { matchrecursive( "controls/*.cpp", "controls/*.h" ) } -- Set the include paths. package.includepaths = { "controls/include", "boost", "../src", "../sdk/tinyxml", "../sdk/plugin_interface" } if ( windows ) then package.libpaths = { "../output", "../sdk/lib" } else package.libpaths = { "../output/lib/wxformbuilder", "../sdk/lib" } end -- Set the libraries it links to. package.links = { "wxFlatNotebook", "wxPropGrid", "wxScintilla", "TiCPP", "plugin-interface" } -- Add libraries and build options for stack trace in MinGW if ( windows and ( (string.find( target or "", ".*-gcc" )) or (target == "gnu") ) ) then table.insert( package.links, { "bfd", "iberty", "psapi", "imagehlp" } ) table.insert( package.buildoptions, "-gstabs" ) end -- Set the packages dependancies. NOT implimented in the official Premake build for Code::Blocks package.depends = { "additional-components-plugin", "common-components-plugin", "containers-components-plugin", "layout-components-plugin", "wxadditions-mini-plugin" } -- Set the pre-compiled header package.pchheader = "pch.h" -- Setup the output directory options. -- Note: Use 'libdir' for "lib" kind only. if ( windows ) then package.bindir = "../output" else package.bindir = "../output/bin" end --package.libdir = "../../lib" -- Set the defines. package.defines = { "WXUSINGDLL_FNB", "TIXML_USE_TICPP", "NO_GCC_PRAGMA", "SCI_NAMESPACE" } -- Load the shlibs from the 'lib/wxformbuilder' subdirectory. if ( macosx ) then table.insert( package.linkoptions, "-Wl,-L../output/lib/wxformbuilder" ) elseif ( not windows ) then addoption("rpath", "Specify the rpath for the compiled binary") if ( options["rpath"] ) then -- need to upgrade premake before this works -- table.insert( package.linkoptions, "-Wl,-rpath," .. options[rpath] ) table.insert( package.linkoptions, "-Wl,-rpath,/usr/lib/wxformbuilder" ) else if ( target == "cb-gcc" ) then table.insert( package.linkoptions, "-Wl,-rpath,$``ORIGIN/../lib/wxformbuilder" ) else table.insert( package.linkoptions, "-Wl,-rpath,$$``ORIGIN/../lib/wxformbuilder" ) end end end --------------------------- DO NOT EDIT BELOW ---------------------------------- --******* GENAERAL SETUP ********** --* Settings that are not dependant --* on the operating system. --********************************* -- Package options addoption( "unicode", "Use the Unicode character set" ) addoption( "with-wx-shared", "Link against wxWidgets as a shared library" ) if ( not windows ) then addoption( "disable-wx-debug", "Compile against a wxWidgets library without debugging" ) end -- Common setup package.language = "c++" -- Set object output directory. if ( options["unicode"] ) then package.config["Debug"].objdir = ".objsud" package.config["Release"].objdir = ".objsu" else package.config["Debug"].objdir = ".objsd" package.config["Release"].objdir = ".objs" end -- Set debug flags if ( options["disable-wx-debug"] and ( not windows ) ) then debug_option = "--debug=no" debug_macro = { "NDEBUG", "__WXFB_DEBUG__" } else debug_option = "--debug=yes" debug_macro = { "DEBUG", "_DEBUG", "__WXDEBUG__", "__WXFB_DEBUG__"} end -- Set the default targetName if none is specified. if ( string.len( targetName ) == 0 ) then targetName = package.name end -- Set the targets. package.config["Release"].target = targetName package.config["Debug"].target = targetName.."d" -- Set the build options. package.buildflags = { "extra-warnings" } package.config["Release"].buildflags = { "optimize-speed" } -- Don't strip symbols in MinGW, need them for stack trace if ( not ( windows and ( (string.find( target or "", ".*-gcc" )) or (target == "gnu") ) ) ) then table.insert( package.config["Release"].buildflags, "no-symbols" ) end if ( options["unicode"] ) then table.insert( package.buildflags, "unicode" ) end if ( string.find( target or "", ".*-gcc" ) or target == "gnu" ) then table.insert( package.config["Debug"].buildoptions, "-O0" ) table.insert( package.config["Release"].buildoptions, "-fno-strict-aliasing" ) end -- Set the defines. if ( options["with-wx-shared"] ) then table.insert( package.defines, "WXUSINGDLL" ) end if ( options["unicode"] ) then table.insert( package.defines, { "UNICODE", "_UNICODE" } ) end table.insert( package.defines, "__WX__" ) table.insert( package.config["Debug"].defines, debug_macro ) table.insert( package.config["Release"].defines, "NDEBUG" ) if ( OS == "windows" ) then --******* WINDOWS SETUP *********** --* Settings that are Windows specific. --********************************* -- Set wxWidgets include paths if ( target == "cb-gcc" ) then table.insert( package.includepaths, "$(#WX.include)" ) else table.insert( package.includepaths, "$(WXWIN)/include" ) end -- Set the correct 'setup.h' include path. if ( options["with-wx-shared"] ) then if ( options["unicode"] ) then if ( target == "cb-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(#WX.lib)/gcc_dll/mswud" ) table.insert( package.config["Release"].includepaths, "$(#WX.lib)/gcc_dll/mswu" ) elseif ( target == "gnu" or target == "cl-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/gcc_dll/mswud" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/gcc_dll/mswu" ) else table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/vc_dll/mswud" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/vc_dll/mswu" ) end else if ( target == "cb-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(#WX.lib)/gcc_dll/mswd" ) table.insert( package.config["Release"].includepaths, "$(#WX.lib)/gcc_dll/msw" ) elseif ( target == "gnu" or target == "cl-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/gcc_dll/mswd" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/gcc_dll/msw" ) else table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/vc_dll/mswd" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/vc_dll/msw" ) end end else if ( options["unicode"] ) then if ( target == "cb-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(#WX.lib)/gcc_lib/mswud" ) table.insert( package.config["Release"].includepaths, "$(#WX.lib)/gcc_lib/mswu" ) elseif ( target == "gnu" or target == "cl-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/gcc_lib/mswud" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/gcc_lib/mswu" ) else table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/vc_lib/mswud" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/vc_lib/mswu" ) end else if ( target == "cb-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(#WX.lib)/gcc_lib/mswd" ) table.insert( package.config["Release"].includepaths, "$(#WX.lib)/gcc_lib/msw" ) elseif ( target == "gnu" or target == "cl-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/gcc_lib/mswd" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/gcc_lib/msw" ) else table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/vc_lib/mswd" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/vc_lib/msw" ) end end end -- Set the linker options. if ( options["with-wx-shared"] ) then if ( target == "cb-gcc" ) then table.insert( package.libpaths, "$(#WX.lib)/gcc_dll" ) elseif ( target == "gnu" or target == "cl-gcc" ) then table.insert( package.libpaths, "$(WXWIN)/lib/gcc_dll" ) else table.insert( package.libpaths, "$(WXWIN)/lib/vc_dll" ) end else if ( target == "cb-gcc" ) then table.insert( package.libpaths, "$(#WX.lib)/gcc_lib" ) elseif ( target == "gnu" or target == "cl-gcc" ) then table.insert( package.libpaths, "$(WXWIN)/lib/gcc_lib" ) else table.insert( package.libpaths, "$(WXWIN)/lib/vc_lib" ) end end -- Set wxWidgets libraries to link. if ( options["unicode"] ) then table.insert( package.config["Release"].links, "wxmsw"..wx_ver.."u" ) table.insert( package.config["Debug"].links, "wxmsw"..wx_ver.."ud" ) else table.insert( package.config["Release"].links, "wxmsw"..wx_ver ) table.insert( package.config["Debug"].links, "wxmsw"..wx_ver.."d" ) end -- Set the Windows defines. table.insert( package.defines, { "__WXMSW__", "WIN32", "_WINDOWS" } ) else --******* LINUX SETUP ************* --* Settings that are Linux specific. --********************************* -- Ignore resource files in Linux. table.insert( package.excludes, matchrecursive( "*.rc" ) ) -- Set wxWidgets build options. table.insert( package.config["Debug"].buildoptions, "`wx-config "..debug_option.." --cflags`" ) table.insert( package.config["Release"].buildoptions, "`wx-config --debug=no --cflags`" ) -- Set the wxWidgets link options. table.insert( package.config["Debug"].linkoptions, "`wx-config "..debug_option.." --libs`" ) table.insert( package.config["Release"].linkoptions, "`wx-config --libs`" ) end if ( macosx ) then package.postbuildcommands = { "../install/macosx/postbuild.sh" } end wxformbuilder-3.1.59/src/wxFormBuilder.ico0000644000175000017500000005355611143440027021042 0ustar rrmulderrrmulder@@ (B6  ^B hS(@ ?40%0%1$-17%7%7%.: 2#0%0%1$0?8$0%0%1$< H7%0%0%4"71$0%0%7%<&< &:#5?4D32ʘ2ʙ2ə333(32ʘ2ʘ2ʘ2/ ?3g2Ș2ʘ2ʘ2ʙ38. 32ɘ2ʘ2ʙ2ə322ʘ2ʘ2ʙ3ƙ4?4"22ʘ2ʘ2ʘ2ʘ2ʘ2ʙ3ƙ231H?3 2E r)s+e"7412yC p-y4s082`2Q3Q{;x8I363r@ v9ʃFf-54~3ر[$͈MǀFH3x1>2ǀLђ]ђ^ғ_ғ`ҔaϏ]M^,> 33(72Ҽg"GI֐?G2p33]SYYK38 ?2B ԑLi̅C:35t8riW 323w=ŅxV 2z4?2緁՟՟Ǔ뾊Ҡܪԣ٠oQ23287́2ߞFݛEݛFZ30*5u0UTZm,3˗/84Laid)4Mktl26223w=ŅxV 2z4?2緁՟R GHO͌ZӢܬ|F2j2I֐;֐=\Ԏ>q*7ݙ3x:֑EЉ?d%ߢTҍE60:053պh+g`g,ؘVtҏO43gU3w=ŅxV 2z4?2緁՟~223g38ђaܬޯk93. ?3[ݚB~18l&Ј:<2ԥD R_!B ԐFܜPJ2y?3^:˄Cmlqݡ^M333w=ŅxV 2z4?2緁՟~22732rAק߰N30228u)ߝDi#3OܙFF 3e$ژJK6~9Ye&3?2Lepol03*3w=ŅxV 23@3@3@3@4:/4?2緁՟~33c3;3O4ʇV۫ܭh623 2d<ԋ7ޛCT2C ӌ=^3ˀ8Ј>>2k*[|884'.!4ܹf*jpq}?61>3w=Ņ}b+2222222n4?2緁՟麅:323`.ݭ㲂F2p* 3MߜBܘA<26v.̂7QؕGr-43QXڙOB 3h52Rߤ]kؘUgmf,2Λ1.3w=ŅƆ}ߨmnoqޥmS24?2緁՟ӝ踄ߪv{꾋֤‘ǁPA3. 6!2νi!ߜBӊ834D2Ķ`ݜJڗFߠNY31\<U\Q2: 3{9ԓNmьK<i.shD23 3w=ŅƆ~noprަnT24?2緁՟ҜݧsӖb٠mئL52/ 2B6υ3ߜBq'3̗0%2yF ۙHPܜK>3l4:3ҍF_t32͗3c7s5i_I3ڞ;ЍMuҏP? 3q33w=Ņ~j3? ? ? ? ? 63w4?2緁՟踃= :<G嶃ȗm;5ߘ223C ̀0ԋ7T23 5>55דC}52332OՒNۜVg+6ؚ282NחWݡae,42F3w=ŅxV 22K2K2K2K1C/4?2緁՟~23O193ƽq>ݬǗS!236A C 73x/ 2?D >238 4;EC 33:FE82e3(5ܢCG@ 434w=ŅxW 34'4'4'4'4'14?2緁՟~22G/+3½r?ݬ֦tC2231a1a1a2Z8 4,2_1a2_6*51\1a1a2k2i1a1a1a4I$1.2_1a1a1a453w=Ņ}j2;::::834M2緁՟黅? 26O涄ݬҢh733w=ŅƆvۡfۡgܢhܤjܤkȂK;2[2緁՟ћyۤpߪw꽋۩ݬ㰀B3l3ӹg/ݣfޥhޥiަkߧlߨnߩoqˆO;2[2ՙcz{}~~|ܦt~L= 2. """"""""""""""""""""3:A A A A ABBB= 53@2٠@ CCCCA< 53ј2/*q3282828282828282828288$?1$2728282827224'2/3, $$ $ # " ! !   6!O!P OMLKIHFEDBA? > < ;976431-= $S%V#T"R!QONLKIHGEDBA ? > <:97643't&U&W%V$T$T QONLKIHFECBA ? > ;:8764+ )====================<'  )W(Y,[Z~g8d"RONLKIHGEDBA ? > <:976-n` !*X*ZDoPv)X PONLKIHFEDBA ? = ;:87.m^"+Z,\jRx,Z"R QONLKJHGEDBA ? = <:9/'"-[-]mSz-\#S"R QONLKIHFEDB@ > = ;:0?#.\/_nU{/]%U#S"R QONLKIHGEDB@ > = ;1M#0^0`oV|0_&W%U#S"R QONLKIHGEDB@ > =3NU>$1_1apW}2`(X&V%U#S"R PONLKIHFEDB@ > 4NfV $3a3cqY3b)Z(X&V%U$T"R QONLKIHGEDA@ 5NV$%4b5drZ5c+[)Y(X&V%U#S!RP P+Y/\%SIHFECA 6NV$%6c7fs[7e-]+\)Z(X(X8dRw~Vz#RGED8NV$&7e8gt\8f.^-],]?jep5`GE:NV$*Al;iv]Y9A]s||||||||||||||zZ&5mqynjihfedbuzfwĂŅݺԧƋuromkhfdaMpqrqqqqqqqqqqqqqqqqqo5$4hkkt|ledca`^]\rzfyŅljըǍwtromkifdFhl|ihhhhhhhhhhhhhhhhhf2+aedba`^]\[YXV~U}pzf{Ljȋ֪ɏzwtrpmkhf?^as_^^^^^^^^^^^^^^^^^\- Pr_^][ZXWVT~S|R{PyNxnzf}ȊɎ׫ʑ|ywtromki9TXkUTTTTTTTTTTTTTTTTTR(U7SEiFjEhDgBfAd?d?c>a<`;_:_bqfɌː׭˓~|ywtromk2JMbKJJJJJJJJJJJJJJJJJH# ek5Ifˏ̒د͕~|ywtrom*??dyO??????????????????=1XruuuuuuuuuuuG,fƒ͔̑ڰ͗ă€~{ywtro%66:GE96666666666666666665efąΔϗڲΚņă€~|y|ʼn̘ű++++++++++++++++++++++++*efŇϖЙ۳ЛLjŅă€Ã֫͘޽ !!!!!!!!!!!!!!!!!!!!!!!! efnjјқܵѝɋɎ̕է޺߾ܽ  kefӦڭդ޹ת֨۴߾߽޻ݺܹ׹jefڵ޻޺ݹܸ۶۵ڴ׳ϴȵöõµkvA[NNNNNNNNNNNNL:!efٳ߻޹ݸܷܵڴڲٱد׮֬֫ԪԨӧҥ͝ۑ?ekefٱ߻ߺݸݶܵ۴ڲٰد׭֬ժթԧӦҥѣС˙ې>ekefٯ߸ݷݵ۳۲ٰٯ׭׬֩ըԦӥңѢРϞΝɔۏeeffffffffffffffffffffffgch  0pp?p00??( @ 83r3w1.. 3q3x2733w3w28U2f3x2d2d3x3J283w3x3x4o3<3co'͂5;4Nm+ԐF<2@ ҎJR3|y<{?4PۡdF3ިr|ߪw}ɅT? ?<֐<ш9P6ӎBוJ[02Af)ڛV`'iFϜ: X!K2ƐƀKBV#Ǘΐ]5H6Pш7Ji%D z4b#}82Q6ЌJoc)50X!Iŗ/ / 52ƐuA452}߫zݩx2_4Dm$q(8y0f%\JڙO;*> ڛWgt73OX!ÃEq9q9> 2Ɛٟls?͋Y縇_,13ӊ6[2jw0ޞLB ǚ6VOښ5w|=ЌKFgT/ X!ÄɄJw@w@? 2Ɛ֛hm9ܦtzH4z8˹c?Ɯ1Kd"23c`#K;n0F̘2AX!c*4X!H̘19197%2ƐuA4?U"֥Q0%4122#50. *0/23234132#415&Y!ÃEn7o9K3Ɛ؞io:ݧuϟHCs:sv?L2s>zFzGr?Lҙ45I  *5666673 661/3 L"QNLIFC@ =:74&'W4a9dPLIGDA >:71Y˙˞˞˞˞˞˞˞˞˞˞̄+Zk&UOLJGDA =:3] .]n)X"ROLIGD@ =6̡ 1`p,\%U"ROLIGD@ 9̧!^ 4cr/_(X%U"RO$SKGC ;̧Mt 7et3b+\=hk`M?̧MtW~[|Yx-w*q*j)eo o AMt}iLnjea\XSOMt?I/~ywuq>vz{pkfa\PMt 3jmsplign={̕ٲ}okfaPNx\mwwwwwwwmfija_\Yl=զݸÃtpkfQSnccccccccb?[RxPuMsJqHnElg;ąת޻ƈytokQB[OOOOOOOONSlj٭Ȍ~ytoR1Eg?;;;;;;;;:fʎ۱ˑăȎԨj&&&&&&&&&&&&fў޶ҟԦݸ߽ӽ. uf޺ݸ۵ڲհͰˮȩ; /''''''fߺ޸ܴڱخ֫ԨӥѢ͛| f f޶ܲگ׫ըӤѡϝ͚ɓ{f eݲ޳ۮ٪֦Ӣџϛ̗ʓƌyq fyݱܭ٩ץԡҝϘ̕ɐǍňnl cgqrrrrqqqqp o gd3"0G0@(  @K  u /+YLF@:0\<OOOOO(7{$TLG@8d@:*Z"RNG>dS<+CMvsjYJ%/E+A)?ΒZ۴ÃtNhEEEE*T߻͖ѡϹjٰܶҫ̥~7fݴتӣϜɓzى4e`\WRޘGmAH0wxformbuilder-3.1.59/src/splashscreen.cpp0000644000175000017500000001025711143440026020741 0ustar rrmulderrrmulder/* cbSplashScreen.cpp * * READ THE HEADER FILE COMMENT FOR A DESCRIPTION. * * Author: Ceniza * * Copyright (C) 2006 Ceniza * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "splashscreen.h" #include #include #include namespace { int cbSplashScreen_timer_id = wxNewId(); } void cbSplashScreen::DoPaint(wxDC &dc) { static const wxString release(wxT("svn")); static const wxString revision( wxT("3.0.47") ); #ifdef __WXMSW__ //dc.SetClippingRegion(r); #endif dc.DrawBitmap(m_label, 0, 0, false); wxFont largeFont(16, wxSWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD); wxFont smallFont(9, wxSWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD); wxCoord a, b, c, d; dc.GetTextExtent(release, &a, &b, 0, 0, &largeFont); dc.GetTextExtent(revision, &c, &d, 0, 0, &smallFont); a >>= 1; c >>=1; // int y = 180 - ((b + d + 8)>>1); dc.SetFont(largeFont); //dc.DrawText(release, 92 - a, y); dc.SetFont(smallFont); //dc.DrawText(revision, 92 - c, y + b); } void cbSplashScreen::OnPaint(wxPaintEvent &) { // an obscure statement in the wxWidgets book says to // allocate the DC even if you don't paint to avoid // a paint loop. //pecan 2006/04/3 wxPaintDC paint_dc(this); DoPaint(paint_dc); } void cbSplashScreen::OnEraseBackground(wxEraseEvent &event) { wxDC *dc = event.GetDC(); if (dc) { DoPaint(*dc); // why not? :) } } void cbSplashScreen::OnTimer(wxTimerEvent &) { Close(true); } void cbSplashScreen::OnCloseWindow(wxCloseEvent &) { m_timer.Stop(); this->Destroy(); } void cbSplashScreen::OnChar(wxKeyEvent &) { Close(true); } void cbSplashScreen::OnMouseEvent(wxMouseEvent &event) { if (event.LeftDown() || event.RightDown()) { Close(true); } } cbSplashScreen::cbSplashScreen(wxBitmap &label, long timeout, wxWindow *parent, wxWindowID id, long style) : wxFrame(parent, id, wxEmptyString, wxPoint(0, 0), wxSize(100, 100), style), m_timer(this, cbSplashScreen_timer_id)//, r(0, 0, 181, 181) { //r.Union(50, 35, 181, 181); //r.Union(166, 13, 181, 181); //r.Union(259, 29, 181, 181); int w = label.GetWidth(); int h = label.GetHeight(); SetClientSize(w, h); CentreOnScreen(); wxScreenDC screen_dc; wxMemoryDC label_dc; #ifndef __WXMAC__ int x = GetPosition().x; int y = GetPosition().y; #endif m_label.Create(w, h); label_dc.SelectObject(m_label); #ifndef __WXMAC__ label_dc.Blit(0, 0, w, h, &screen_dc, x, y); #else label_dc.SetBackground(*wxWHITE_BRUSH); label_dc.Clear(); #endif label_dc.DrawBitmap(label, 0, 0, true); label_dc.SelectObject(wxNullBitmap); //SetShape(r); Show(true); SetThemeEnabled(false); // seems to be useful by description SetBackgroundStyle(wxBG_STYLE_CUSTOM); // the trick for GTK+ (notice it's after Show()) #if ( defined( __WXMAC__ ) || defined( __WXMSW__ ) ) Update(); #else wxYieldIfNeeded(); #endif if (timeout != -1) { m_timer.Start(timeout, true); } } cbSplashScreen::~cbSplashScreen() { m_timer.Stop(); } BEGIN_EVENT_TABLE(cbSplashScreen, wxFrame) EVT_PAINT(cbSplashScreen::OnPaint) EVT_TIMER(cbSplashScreen_timer_id, cbSplashScreen::OnTimer) EVT_ERASE_BACKGROUND(cbSplashScreen::OnEraseBackground) EVT_CLOSE(cbSplashScreen::OnCloseWindow) EVT_CHAR(cbSplashScreen::OnChar) EVT_MOUSE_EVENTS(cbSplashScreen::OnMouseEvent) END_EVENT_TABLE() wxformbuilder-3.1.59/src/Makefile0000644000175000017500000002452111143440026017202 0ustar rrmulderrrmulder# C++ Shared Library Makefile autogenerated by premake # Don't edit this file! Instead edit `premake.lua` then rerun `make` ifndef CONFIG CONFIG=Release endif ifeq ($(CONFIG),Release) BINDIR := ../output/bin LIBDIR := .. OBJDIR := .objsu OUTDIR := ../output/bin CPPFLAGS := -MMD -D "WXUSINGDLL_FNB" -D "TIXML_USE_TICPP" -D "NO_GCC_PRAGMA" -D "SCI_NAMESPACE" -D "WXUSINGDLL" -D "UNICODE" -D "_UNICODE" -D "__WX__" -D "NDEBUG" -I "controls/include" -I "boost" -I "../src" -I "../sdk/tinyxml" -I "../sdk/plugin_interface" CFLAGS += $(CPPFLAGS) $(TARGET_ARCH) -O3 -Wall -fno-strict-aliasing `wx-config --debug=no --cflags` CXXFLAGS := $(CFLAGS) LDFLAGS += -L$(BINDIR) -L$(LIBDIR) -mwindows -s -Wl,-rpath,/usr/lib/wxformbuilder `wx-config --libs` -L"../output/lib/wxformbuilder" -L"../sdk/lib" -lwx_gtk2u_flatnotebook-2.8_wxfb -lwx_gtk2u_propgrid-2.8_wxfb -lwx_gtk2u_scintilla-2.8_wxfb -lticpp -lfbPluginInterface LDDEPS := ../output/lib/wxformbuilder/libwx_gtk2u_flatnotebook-2.8_wxfb.so ../output/lib/wxformbuilder/libwx_gtk2u_propgrid-2.8_wxfb.so ../output/lib/wxformbuilder/libwx_gtk2u_scintilla-2.8_wxfb.so ../sdk/lib/libticpp.a ../sdk/lib/libfbPluginInterface.a RESFLAGS := -D "WXUSINGDLL_FNB" -D "TIXML_USE_TICPP" -D "NO_GCC_PRAGMA" -D "SCI_NAMESPACE" -D "WXUSINGDLL" -D "UNICODE" -D "_UNICODE" -D "__WX__" -D "NDEBUG" -I "controls/include" -I "boost" -I "../src" -I "../sdk/tinyxml" -I "../sdk/plugin_interface" TARGET := wxformbuilder BLDCMD = $(CXX) -o $(OUTDIR)/$(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(TARGET_ARCH) endif ifeq ($(CONFIG),Debug) BINDIR := ../output/bin LIBDIR := .. OBJDIR := .objsud OUTDIR := ../output/bin CPPFLAGS := -MMD -D "WXUSINGDLL_FNB" -D "TIXML_USE_TICPP" -D "NO_GCC_PRAGMA" -D "SCI_NAMESPACE" -D "WXUSINGDLL" -D "UNICODE" -D "_UNICODE" -D "__WX__" -D "NDEBUG" -D "__WXFB_DEBUG__" -I "controls/include" -I "boost" -I "../src" -I "../sdk/tinyxml" -I "../sdk/plugin_interface" CFLAGS += $(CPPFLAGS) $(TARGET_ARCH) -g -Wall -O0 `wx-config --debug=no --cflags` CXXFLAGS := $(CFLAGS) LDFLAGS += -L$(BINDIR) -L$(LIBDIR) -mwindows -Wl,-rpath,/usr/lib/wxformbuilder `wx-config --debug=no --libs` -L"../output/lib/wxformbuilder" -L"../sdk/lib" -lwx_gtk2u_flatnotebook-2.8_wxfb -lwx_gtk2u_propgrid-2.8_wxfb -lwx_gtk2u_scintilla-2.8_wxfb -lticppd -lfbPluginInterfaced LDDEPS := ../output/lib/wxformbuilder/libwx_gtk2u_flatnotebook-2.8_wxfb.so ../output/lib/wxformbuilder/libwx_gtk2u_propgrid-2.8_wxfb.so ../output/lib/wxformbuilder/libwx_gtk2u_scintilla-2.8_wxfb.so ../sdk/lib/libticppd.a ../sdk/lib/libfbPluginInterfaced.a RESFLAGS := -D "WXUSINGDLL_FNB" -D "TIXML_USE_TICPP" -D "NO_GCC_PRAGMA" -D "SCI_NAMESPACE" -D "WXUSINGDLL" -D "UNICODE" -D "_UNICODE" -D "__WX__" -D "NDEBUG" -D "__WXFB_DEBUG__" -I "controls/include" -I "boost" -I "../src" -I "../sdk/tinyxml" -I "../sdk/plugin_interface" TARGET := wxformbuilderd BLDCMD = $(CXX) -o $(OUTDIR)/$(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(TARGET_ARCH) endif OBJECTS := \ $(OBJDIR)/maingui.o \ $(OBJDIR)/splashscreen.o \ $(OBJDIR)/database.o \ $(OBJDIR)/xrcfilter.o \ $(OBJDIR)/objectbase.o \ $(OBJDIR)/types.o \ $(OBJDIR)/title.o \ $(OBJDIR)/palette.o \ $(OBJDIR)/genericpanel.o \ $(OBJDIR)/wxfbmanager.o \ $(OBJDIR)/bitmaps.o \ $(OBJDIR)/about.o \ $(OBJDIR)/cmdproc.o \ $(OBJDIR)/wxfbevent.o \ $(OBJDIR)/customkeys.o \ $(OBJDIR)/mainframe.o \ $(OBJDIR)/menueditor.o \ $(OBJDIR)/appdata.o \ $(OBJDIR)/xrcpreview.o \ $(OBJDIR)/xrcpanel.o \ $(OBJDIR)/objecttree.o \ $(OBJDIR)/objinspect.o \ $(OBJDIR)/geninhertclass_gui.o \ $(OBJDIR)/geninhertclass.o \ $(OBJDIR)/dataobject.o \ $(OBJDIR)/visualobj.o \ $(OBJDIR)/visualeditor.o \ $(OBJDIR)/menubar.o \ $(OBJDIR)/resizablepanel.o \ $(OBJDIR)/innerframe.o \ $(OBJDIR)/codeeditor.o \ $(OBJDIR)/cpppanel.o \ $(OBJDIR)/annoyingdialog.o \ $(OBJDIR)/debug.o \ $(OBJDIR)/encodingutils.o \ $(OBJDIR)/stringutils.o \ $(OBJDIR)/wxfbipc.o \ $(OBJDIR)/typeconv.o \ $(OBJDIR)/xrccg.o \ $(OBJDIR)/codegen.o \ $(OBJDIR)/cppcg.o \ $(OBJDIR)/codewriter.o \ $(OBJDIR)/stack.o \ $(OBJDIR)/md5.o \ MKDIR_TYPE := msdos CMD := $(subst \,\\,$(ComSpec)$(COMSPEC)) ifeq (,$(CMD)) MKDIR_TYPE := posix endif ifeq (/bin/sh.exe,$(SHELL)) MKDIR_TYPE := posix endif ifeq ($(MKDIR_TYPE),posix) CMD_MKBINDIR := mkdir -p $(BINDIR) CMD_MKLIBDIR := mkdir -p $(LIBDIR) CMD_MKOUTDIR := mkdir -p $(OUTDIR) CMD_MKOBJDIR := mkdir -p $(OBJDIR) else CMD_MKBINDIR := $(CMD) /c if not exist $(subst /,\\,$(BINDIR)) mkdir $(subst /,\\,$(BINDIR)) CMD_MKLIBDIR := $(CMD) /c if not exist $(subst /,\\,$(LIBDIR)) mkdir $(subst /,\\,$(LIBDIR)) CMD_MKOUTDIR := $(CMD) /c if not exist $(subst /,\\,$(OUTDIR)) mkdir $(subst /,\\,$(OUTDIR)) CMD_MKOBJDIR := $(CMD) /c if not exist $(subst /,\\,$(OBJDIR)) mkdir $(subst /,\\,$(OBJDIR)) endif .PHONY: clean $(OUTDIR)/$(TARGET): $(OBJECTS) $(LDDEPS) $(RESOURCES) @echo Linking wxFormBuilder -@$(CMD_MKBINDIR) -@$(CMD_MKLIBDIR) -@$(CMD_MKOUTDIR) @$(BLDCMD) clean: @echo Cleaning wxFormBuilder ifeq ($(MKDIR_TYPE),posix) -@rm -f $(OUTDIR)/$(TARGET) -@rm -rf $(OBJDIR) else -@if exist $(subst /,\,$(OUTDIR)/$(TARGET)) del /q $(subst /,\,$(OUTDIR)/$(TARGET)) -@if exist $(subst /,\,$(OBJDIR)) del /q $(subst /,\,$(OBJDIR)) -@if exist $(subst /,\,$(OBJDIR)) rmdir /s /q $(subst /,\,$(OBJDIR)) endif $(OBJDIR)/maingui.o: maingui.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/splashscreen.o: splashscreen.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/database.o: model/database.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/xrcfilter.o: model/xrcfilter.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/objectbase.o: model/objectbase.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/types.o: model/types.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/title.o: rad/title.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/palette.o: rad/palette.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/genericpanel.o: rad/genericpanel.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/wxfbmanager.o: rad/wxfbmanager.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/bitmaps.o: rad/bitmaps.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/about.o: rad/about.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/cmdproc.o: rad/cmdproc.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/wxfbevent.o: rad/wxfbevent.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/customkeys.o: rad/customkeys.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/mainframe.o: rad/mainframe.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/menueditor.o: rad/menueditor.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/appdata.o: rad/appdata.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/xrcpreview.o: rad/xrcpreview/xrcpreview.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/xrcpanel.o: rad/xrcpanel/xrcpanel.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/objecttree.o: rad/objecttree/objecttree.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/objinspect.o: rad/inspector/objinspect.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/geninhertclass_gui.o: rad/geninheritclass/geninhertclass_gui.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/geninhertclass.o: rad/geninheritclass/geninhertclass.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/dataobject.o: rad/dataobject/dataobject.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/visualobj.o: rad/designer/visualobj.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/visualeditor.o: rad/designer/visualeditor.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/menubar.o: rad/designer/menubar.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/resizablepanel.o: rad/designer/resizablepanel.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/innerframe.o: rad/designer/innerframe.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/codeeditor.o: rad/codeeditor/codeeditor.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/cpppanel.o: rad/cpppanel/cpppanel.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/annoyingdialog.o: utils/annoyingdialog.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/debug.o: utils/debug.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/encodingutils.o: utils/encodingutils.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/stringutils.o: utils/stringutils.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/wxfbipc.o: utils/wxfbipc.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/typeconv.o: utils/typeconv.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/xrccg.o: codegen/xrccg.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/codegen.o: codegen/codegen.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/cppcg.o: codegen/cppcg.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/codewriter.o: codegen/codewriter.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/stack.o: dbg_stack_trace/stack.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/md5.o: md5/md5.cc -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -include $(OBJECTS:%.o=%.d) wxformbuilder-3.1.59/src/wxFormBuilder_Banner.pdn0000644000175000017500000045666711143440026022347 0ustar rrmulderrrmulderPDN3Ɇ NPaintDotNet.Data, Version=3.0.2525.34974, Culture=neutral, PublicKeyToken=null ISystem, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089PaintDotNet.Documentlayerswidthheight userMetaData savedWithtagdisposedPaintDotNet.LayerList2System.Collections.Specialized.NameValueCollectionSystem.Version    PaintDotNet.LayerListparentArrayList+_itemsArrayList+_sizeArrayList+_versionPaintDotNet.Document  )2System.Collections.Specialized.NameValueCollectionReadOnly HashProviderComparerCountKeysValuesVersion2System.Collections.CaseInsensitiveHashCodeProvider*System.Collections.CaseInsensitiveComparer  FSystem.Version_Major_Minor_Build _Revision       2System.Collections.CaseInsensitiveHashCodeProviderm_textSystem.Globalization.TextInfo  *System.Collections.CaseInsensitiveComparer m_compareInfo System.Globalization.CompareInfo   $exif.tag4 $exif.tag5 $exif.tag6 $exif.tag7      DPdnLib, Version=3.0.2525.34973, Culture=neutral, PublicKeyToken=null PaintDotNet.BitmapLayerdisposed propertiessurface Layer+width Layer+heightLayer+propertiesLayer+disposed-PaintDotNet.BitmapLayer+BitmapLayerPropertiesPaintDotNet.Surface!PaintDotNet.Layer+LayerProperties    ! " # $ % & ' ( ) * +System.Globalization.TextInfom_listSeparator m_isReadOnlycustomCultureName m_nDataItemm_useUserOverride m_win32LangID   System.Globalization.CompareInfo win32LCIDculturem_name,System.Collections.ArrayList_items_size_version - . / 0-PaintDotNet.BitmapLayer+BitmapLayerPropertiesblendOp&PaintDotNet.UserBlendOps+NormalBlendOp 1PaintDotNet.Surfacescan0widthheightstridedisposedPaintDotNet.MemoryBlock 2@!PaintDotNet.Layer+LayerPropertiesname userMetaDatavisible isBackgroundopacity2System.Collections.Specialized.NameValueCollection3 Background 4  5! 6@"7Border 8# 9$ :@%;Swoosh <& =' >@(?logo @) A* B@+CText D-E@.F//G70H71&PaintDotNet.UserBlendOps+NormalBlendOp2PaintDotNet.MemoryBlocklength64 bitmapWidth bitmapHeight hasParentdeferred 4 I J K L51628 M N O P91:2< I J S T=1>2@ U V W XA1B2D U V [ \I ]J ^KLM _N `OPSTU aV bWX[\]  ^ ,_  ` ,a  b , 8`I%&/m{JJt`$ؐ@iG#)*eVe]f@흼{{;N'?\fdlJɞ!?~|?"=?z~GϏ=?z~GϏ=?z~GϏ=?z~G GϏ=?z~GϏ=?z~GϏ=?z~GϏ=?z~GϏ=?z~GϏ=?z~GϏ=?z~GϏ=~4=?z~GϏ=?z~GϏ=?z~GϏ=?z~ϏFGϏ=?z~GϏ=?z~GϏ=?z~GϏ=?z~~GϏ=?z~GϏ=?z~GϏ=?z~GϏ??=?z~GϏ=?z~GϏ=?z~GϏ=?z~G#GϏ=?z~GϏ=?z~GϏ=?z~GϏ=?zh?z~GϏ=?z~GϏ=?z~GϏ=?z~GGϏ=?z~GϏ=?z~GϏ=?z~GϏ=?z~GϏ=?z~GϏ=?z~GϏ=?z~GϏ=~4=?z~GϏ=?z~GϏ=?z~GϏ=?z~ϏFGϏ=?z~GϏ=?z~GϏ=?z~GϏ=?z~~GϏ=?z~GϏ=?z~GϏ=?z~GϏ??=?z~GϏ=?z~GϏ=?z~GϏ=?z~G#GϏ=?z~GϏ=?z~GϏ=?z~GϏ=?zh?z~GϏ=?z~GϏ=?z~GϏ=?z~GGϏ=?z~GϏ=?z~GϏ=?z~GϏ=?z~GϏ=?z~GϏ=?z~GϏ=?z~GϏ=~4=?z~GϏ=?z~GϏ=?z~GϏ=?z~ϏFGϏ=?z~GϏ=?z~GϏ=?z~GϏ=?z~~GϏ=?z~GϏ=?z~GϏ=?z~GϏ??=?z~GϏ=?z~GϏ=?z~GϏ=?z~G#GϏ=?z~GϏ=?z~GϏ=?z~GϏ=?zh?z~GϏ=?z~GϏ=?z~GϏ=z `I%&/m{JJt`$ؐ@iG#)*eVe]f@흼{{;N'?\fdlJɞ!?~|?"~_?EGؑ۴GُGGGG:8Go???Ǐ?u#?~?_??????Ǐ?u#?~?_??G?~?_???Ǐ?u#?~??Ǐ?u#?~?_???Ǐ?GǏ?u#?~?_???Ǐ?QǏ?u#?~?_???Ǐ?wd?~GُGGGG:Gd?~GC#?~?_???Ǐ?u#?~G]Gd?~GُGGGG:Ə?#?~?_???Ǐ?u#?~?_???Ǐ?u#?~_~?_???Ǐ?u#?~?~?_???Ǐ?u#?~?!ѻ?#?~?_???Ǐ?u#?h_???Ǐ?u#?~?_??%???Ǐ?u#?~?_???7a?nϏ?~?_???Ǐ?u#?~߿Ə?Gd?~GُGGGG:4G.#?~?_???Ǐ?u#\G?7#?~?_???Ǐ?u#|Ǐ?u#?~?_???Ǐ~?_???Ǐ?u#?~?~?_???Ǐ?u#?~?}~?_???Ǐ?u4vGGo+ _Ac`I%&/m{JJt`$ؐ@iG#)*eVe]f@흼{{;N'?\fdlJɞ!?~|?"~=o/~_Mu;; IQI)7 %{ߡ߱9%ߵwDIۑߍ7{??1??M?{yNO__$ߛ}_y#نOSL//|ԟJ"|{ͥ+;Wwq?>x67*џ]qێӟ]}ہwm[{mwwww##;vw#ߍG`#?g='[b;Î|1vvķ!O;b~v~;xc+-aOo;7|nlJ_Ʒ!;Ɔ7vF^{d;Ǐyُl}a~m"m;;#;]"];?NDw#?dO7[l|"?[ۏ߷][o?&oc3wilDžumۉ6c_-?߆}iw3~|v7?>>?׌=zmo;-ƎV֝Ν.x{w'O"ߎnߋ~0Á6c2 |C;ml l).~?i~w;2=?[ߍ}1_v;ҵ%gges>3C`>3Ww?wuu?8g7*ҟ-b_GX1{mooooooGGqw"$FG ?g=< ?6cGw_olƖdwc?vd_x7Hv|g싱wmac#}Nܷ?ÜVn˟ n=~?~;39֝Α.x{w'O"nߋDp6c? |6ۭ6ďGo>yێ_olwoI r ̆o~o0؊ZVkC0ؖFolM޷?bۓއgX^g~q[ہƝw2vw[F[wvw;F;wtF?F/?dmu;#O{!][y{ߍgߍ~όM06B]N|؉Uwؒm=~}N?76}3:779~7v÷=;'oG7E??a Ooن^7 -[bwߞ|W{.&M1}_olIc7&{c߷!k+g ;nϵbRڅk]1Fyӟ?oڇ?6÷!=;'oG7E??p x':7lņ ؔ7ےo$][blܷIwo؏[o'M{[QJߵ!nt?_{n'o~nlr[J?:aߨP={z}ovaa;߶߾߱߹%ߵwDIۑߍ{ߏFg=< ?_߷-_n+]ݏG|{bl l ~l̷3cCO؍tsߦ,W_>0.\+m9?]{ߛx-b߷o;c3~LooooowGqw"vG ?d6_l>~7}o.&0eߵ%?lGmم߷!̷ Ygw߷osZv\Oo?#G3ZFeqcƝ֝Α.x{w'O:ߎnߋ~"a O: b/_ `O?&ucS`3~'g[|ߛsZ[{igl+|f쉱9zH?gW7o-Q0uvwvw[v[wvw;F;wtv?ٍvhٍofo3?~@={vGwn|یng6 v|9 yvķO /o;gS=on~/xN|g _}~ok6&泫bl#~?oooooooowGqw}'o7؎_C(~s_{/~=>}{qO˭d>~|J=g؏!}vH^=ofϞ}N:7l׆q?M1csĻ#Ɔ仝æ|ߞې_xL?}Qa1wݷ Yg;?nog#wkܴnσ=b_W#ѵ.(~oߋom>YR#.}61/aG0>l}? ̀0_ml6̀}Fvw;baӿ;ّߏlC>oC?~6cOgc'b rbNt?ُ]A[ӷ'#՟~~]Lbl lGccKcCEocCMY;Gv֟4/>EYR7m6vžQycv;M;;[wvw www߷~۷~!cݶ'>}.qGؐV;]y7c!6䁵~DmX1ێX{mr{R'~W'd#n| }BpNԆ'd)} 6Yc}KɎnߦΆ|hHn6^ FO߷c/>l1\޽)&)bCoGM[]s;7B۷!Ko[07H;xwm~6;!;uXafav{;76w ?ߕl_mOOV8c9XǤ+?϶v,"vG~Tws쑽!;].{I1GG?lĮ@lQRC[l/>#[C،_{Pg?c쉵h>{jŒ[Ow%ٌŷ|vo c?s[ {OcC?;{ftqWn! !ߌm 1$ݏC߿;c;&oG7F9,0;aow _76߆۱]l1d7m_t&ہXn076 c7~gIlӿ0%=>bRnQw/'-c9"]|t뷨 #9na/IR1ڦ6c]]k?sO}k7OOOf4ߗGl3{Ccz3amF{D}c1] ؋َ)ubupbuso ؎j{}~/bQn/l;~{`a/69u,c:?v߷gC#y,}non(&T:;{oc?߆~9-\+ ϻؕuپܨdxǯ: ;;M;ͽ֝(~oc;~_@w|PJ98~tF;v>&=M}.{!)E;#k?svk;難PqOl}SlŧuĶSdOؐ_nkh}&bLvc43/ی3{a{/n_/<ebC^\:MmߵC ُ/_O16'a?L b?#ٍ 1a?.ig0q5}gƖNNFcQ߷7ُ߰olmOc~kg;} HO?&َ'/6û.٣}G)}ā="d/n\=<3Aݸ:86=n\>= OSE؍Oϩ3k?֟>Ψh>cav_ =g?'~Aq K7/l/"_yI6K)'(y%ین|z6N}gu?sM17 ٔbc-}o|O7ۑ76{ ؐB03 ml+ 1ɾ_2xہSk?~{ZKXGD:wfQWE;?Nw'.[a/wwHo?ێ{8&?`~\g~>ڎǟ߿x@?o!Kd3Sb;'=fڎwSSؐd7ߋ;b;C}_6_m^z'h^^ͨ/i^Om{/>{/o7l;ņ"Cv׿oo)?l~>)~Lόؑa,bl ُmݷ#;nη)]avό}bݨV}[a6J㒨ڏeöc1o~w ;Wch]hw%{(7I~Lzlیw}h1Ñڏ=v_rvv_}v>'"Hb;~=?s|D}qD ¶=6Sk7wϬxw9s_mߦΨߋGw-}mKsk;__Æhd[^Z{{Iۍ+،j6-6 ێ'_O¯6doo_χ$gͻ/]?cWo숱:{;mlG ) =+i,3؏_7vk>l?`C=vn|ېa;~vO~G߁߁t;b;~_@߅C+.9v~W#ߝtNݣIB:[OEl3>!؎_|t'{.}&SzOl_{}yH=nyO?>  d7~ߓ~yLힰT{??gv$ggl3`;~E4yNABm! W?A%}m?lHsf4}Wk/77E6C~mE yGl-o ې6%fWnIb_'&B68؏X,bb?۷3;2scW|эE`KF=6$loM%]S~#Hb?†Nw~ggd/~-1'=~]_Hzc׏w؋OzM:|LzUlxz.<١b;:K|?Ol#KTOv?ٌcz؏'b3~ }vJ0ܧl7~ɓSz6C/9?&"vgEm^b3~_wd/f߃=_Xal5% ݣ _ yEv>x#ؐonjC`;?}eOن"BII~mEߒwV[$ƟdS^|=>=7x[b?plʐ076$M<2d?X}ۂnnlooG~Q&M6bǿ߆d[ ;߿#v\a7~G?N:w'N;ً;l?~ɝ'WG7/y2"|b9ӽ} v!~?@?`=QrXcг#mx{?1u>O~AF'SO/_z"%d/`3~l?~ɓ/f}%g~O}Iv%_{g5}{!6 _l}$c7؏ݯhߛZkG]d?~oj])?I.)oߛmnd/ǰ'cS`O8hS^o)x6d;n)-1v:_):mJ?o?."?&]~.RE>_㳵 7_cnj7>I ?bߒcoMoK?;%~{=!ߑٌn3S?8]Io81/>ߝt/d[_|t$ُ>?n ?}GCO{BO:|C?;o`Og7gߡfA//^K/=yI?'Fּb{74'oȶ|g_Y{q86'i+!]1ߥu7ٖZ{0o}xO }w!ہ}Ȟ?EC_}v>oؓ_(vE6oZ)ƾl^;y>ڏlJF }Ɔ!xؑÏCcOy?M< ߾c3qoK|;o`3|FcڏMk?~s[ߚ[V vO{Qd/~9C~'w%)ߕGt"ٌ;/$=1ɉ?b?;#~LC=/vwv8̀CSS?#l?`3}{w'=ڍ?zBOg;O)sHۏ?:߿Mv|C~/m؍w/oϿ }?%k+؎?>~6<+_rL/=~d7wߛf{)+-6!?w6>O=l? wwg/0ߗV,GloS~Q4E??]kScl_c#dM ̛ߎa?076(&G,x}֍IďM|~ȗd//߃L~OėO ^?l;/Mڏ?;ϩ͗ g?^/C^?Em߰0?C4mGOy]%OKv~{}>4Ͽۋ#=!#By!{/ =>ێWO:6Ds\asx̞&ҵ7ٔI}ؓ76ؑ~ֵfؐn76E06؆!aF{|,[o_J[5qyےI{M#߉~'ߕG~n;?E:VlB{m6}>&}ڏ?yC'n|!/vGLvQ>#ߓmO<ϞZG|{~⌾ڎ وlC )Ԇlٍ?O5ې?+r؎?'b7g~]k??E|?E%Km/=GߗK6e{!G߷ 6>l?؆ !6ٔߟm_X_md+~_kS#&$mǿ9Hɦ!?]oG޵!،z9-vэ9|[ېm>6d}ceu5bMk?X~U7~ߔ7#Y-{[>mIH#ۓ8g=I'Τ~Jyqҧ;ċ_HxEz[[،?jR]|~G!?$sH?"Xd;<: mǫߓ9c aCȗb;~m/C~/ڏ?~^`G/O/~'5}ڍ?kڐ7D߯$Ͽ+wn ?ؐ?)~}9r=l;gǿg~=>g{Z!߰מh;ca6G61%ؐ{֦ cWmbo*&ykooC~Ύ؏ϚxwmoWbgx c;`S`|oyb?>0ێG!oDIN~cZMHsoN [߿%woCB?'=&1/};NHk;)/?"wvݭ#_~_!=qvQ.]9S_ߧ0czL9>&7'}v,)}ُWo 3{d3^^l;7_?'^X_/؎?WDWb;/V#a!Þlwߛ~ww~Ȧ|߿/̾?_~O?ZcQr}%O~ ߟ~PQFLmHF>KFqOOB{Cl Gs\nvfb\$[w7,OCv߷'!~"&1Ɔ6ŷs'l{7elkCμ翿Qc߈|ߔMI~3ߜdXg%مߚw~[c.1ێ/G3ߙBwJ:wRҳ#In{^B!_ȶyO)؋Sl?؟Gm؟>ޡu#٘ԞlO~Fmda'?%XO^1_%{b3~nѯ_8߿_/__xMEJ|v˟v7}{軟{Aÿ_| ?;?~~~?ms߿ڏߟmS?l/}'_$s68#2'_{d{dsgSc؏؋=?dOS]ǞK"kS5x6%[|M$C&B7}c?c= 1#l lwabcCg]cX[ns~x?߈o̶Hs;% S[VgÞ~{U# HO?/ qF:=~q;Emo>!<"[-''|oO?ޣ;ʶ1{ہ~~Ob7>?) })~*?+6ϨEIl3X}KOc޼a7^7ѯ2;O> G}Ɇ|bߗ}GGs*~ߟlٓ~=Ll)l*dvdJ 9?d;f?8G3>^$:^Ȏs-9)ƾ8d-(NO<$A~]wd;bc?01 ~G{k7_yc76m&0y)KiumJ6nT~cIBr&)/=vaK~ky-ߖH~ѯGң3߅}w!a;؟t~#{ }/1ǟn7%~.}KOó~C}??#GbC~=c{#v}":}%?].}I?~~a6ߧ?+؍?'&?e#g4Sk?S|F# ?'ȉWryC^ '~<σ[{wQs> {rA?srCb6qYrc+jL_wďG>ʮL~6b/7| OSN ?c{wmo[6waQ+_7*>_;~ߐ7oHr(oL2w)ێ?K;7%ߚloC!YbO~Tm~?6O~Of|Lc|~M?m"1ێlm=>O}9'y@;d7vɿc`{P߿'}{cj{"f~O OöC } }IKl}&O}E$ߛfq76߿/.c?w~dd'ԳS_ #</r_ݜxm9ŜlrvAqʅA~x ,wl~?{:ɖlO_?.=`[q=19. e②Wg}魻G~#s?ld:12|aoc[|ې э5 +}k?n{%^>Qہғߐ 1ߔtoJ׿9ߜ~J'5;ےI@n/W?w%>H"ݬS;?Gs)+z~S{LOv)}HSG١Ɵ6=}~D8I'S}F}mǟO; 'l7k^şϿWڎ. ؏?~}f ?{~OBl{Y#clƛ)ۍ?ͭ~=ً?˅؏//n/ԆZߵ!$Ս{h#91Hߐl-JrVwsҩ%ߒto߆oߎm'#3z~>%+1ǟ:qw'.'1٢~m>POg^ʶOgc\b؎?==c?mٍS>yF`1{9%}%%hIj+6OKv_mjS?ی?~I}})/m{g;?#[23ݜm9~N?v [q~3 Q˂lOȗb//wIÞ yK/eoKی?قotI6d' ;ێ_E/&{2%&r\54H~_#FnFbt&)&dSbg}{ec;~;iwYC6·| 1 c[ӏ;Vwѳ!7*>cwW]ۏC~7$}>>)?~ߌ?-d OGGNwf`C~O?]?a3~tFw!ێ?=;yq>ϝ3qA?ߣ?2O39̋G}'ۑ?>{O=OfiSo3cmǟ6BOvOO_^S'o&}E?>ݠgߥًl~??N^7g3g;9d?؟,?6yc~i#ovoQ޲G_.(ǵߗ_Tl;K~gŶyE_ ^O_zR?s$;W!Hl/=~qwYs4E;Ixgcķ)Cc7=?1ؑG퉱!&.l2oC]cC|?0m*/ǍG됞I/$>o@2AqNHƤo~cNIߊ!}۩Iw؍?wjZg?Nwc[?[|D;wwgO }@(8g5L_|?vg^'S9f\3/~/_/ %}?}&vO!|s'vM?ێ?n)O? '?3-?9~.9؍?{siAs?M?H[w](O.Kѯ[ OTdO/bEv6b=߿H쇱!g!gG5ِ_<]J~>8MlO~IުMq1qk$|Ϯ!Fb[]}޵)ƮY^ol؎X uvc+0zk% Yݜ#7*=AӿIkmm$xeǼ 1ҹ!ߐtoHz7oB:7!H:g^oMooGw wNLߑw,~WzOKg/UPm{D߉`QG}b?>՟CPӏ`qDcs>)}Fd7a?E}%M qkk+lǟq]6O-?=ߏ~~d?'y&v3L)69~?a7_̜{A9~i'~`'|黷b?~lOقm?{/wwW?'+_U~"+_D߯l/5~{>i߿6~!-ٓmGгHCCmD[6帊 LNf'Ɔ U#Zڔ^#*bOl&1?>tc?1#ݜ#Ɩtcn,6ؑ?o;|alG/xwk^u_! {/~ ߔoJ7_[هVGwv#߉~翀BRs?Nm[~W_Dgb,~%xsb]jc{@pgNَ)O~B?NV?SmO ٌ9g K+k;̋WWb3.^3/~OݸGَߗlȆߧ~?LƟ>3D?erAf)lO4ٕ[XKh S+??ɮ"_U cǼi~ѯl-{-R\ҲC/}I~ 6~^o~!/R{RݨlJ-؞nLrץ #k$&^Lr5MCc슱I&ߞtccG#fCvkS 17d?y+JC[ ۏ?mF_zc_؊ߐ+oD7!oyA㷥~;wd.`?~g= }Pߕ~_&QnԞw~^EBB?V1&x;.ϫQ}j)>;](Oȳ'}wB?生gٌ(w__?A?_i~n~odC߇~)ߧ~d[~E.68 lJa.vcSڴfIDƟ,Kg~_fI߯\'|}%6?b/؟kg?k#?5ך^]%ٖ+a؋?;dWB|M_d{" l؏_$6 QLKr\6&y[#xgݿI/ړMc:1?ڢw~vXbb?16ŷ!M$n01׎6$KnTy8ΧI6_"uKc1?ƶ/l/ſ)/oAqoAV&]N6m'ۓGEd3ߙL},+/?"X?.o~!{>"BDLj6KeԻw`ṞGg~>v8"{c>;`|IC~ᄁސR]~ZlƟߣ_)6*O~ {"v,2}"/ N=;mKV-{`!_+3ی?%Ed?V?~j oKv{IɆw?߇{_}l +|?~#rMk_d?Q^zGۋ? ~׋I[U|{""y-f)5쉍GȎ_#uwnF#bXdɛGvmm&aލCX>1տXķ~ !v?[_:_3.> Hdҗ!߈_+~oN6$[+~oK?z]؏߁㎿L6w.+q_f/l ٦6ddl?fm_Gߣ;؎_~d~J_?>}}6w)}~Av~ -ۍ "iӊ?lƟ6E~~ ٔV?~ɿߚ}|G?v;)dC'!l37`'3A/~@/f{ ؔ?;{'鬙9pͤqG eb#Id]]GqkqۘdSѵ7|>aC#noC?06?fCm1qoClqax~75>g;گȯM]l'_d+~[k0n%~/ſ%ٓߒ-Il?mߎ;w?_@ve?H%Fm>%W-;vD~ggz_lۏCIo} ~'ш ' /O3g;~ѷEml;~I[ٌWk ^-6)w߇Y| ?>'FMfLn#d/ f1~~3/%ϸXK|I~_?}F^ϚmZْ[fk)El?~+?f!6+kwm {bG~{7?C6ᅯ_ !KK_Bg?싟!'׵(ΦD퉷f"/DI9_W$[wwk&1#5S,j uug?Aɞ&&ucB+;wmH7.1 ?YK}~MoZ??W:d(%7?7[[[q/yPm96s/wݞ>d7nEߓ>ڎdKN)}99Mvm؏///zIfA_v|~߇dg~~?l7ٍń~ONO_so)&){Vl3/{-\5~I?/~gWwd?k?dK~13O/f'}m/R/S ُ_/xd{!oȆ{GlC~)!?/K(ٞ >=ڔ?퉟ڰfM95vDm%֞1Iې$|En}l 7َn<Ȯ|]a&2泌I׆bb c?讉|~Kg??V!qg??FNMΈ++o)ɾ)FߑW߉l/?( _KwWR;[j?F6ُ1ُs>ۥw}b;~H 9d;v\=D}6_O%/l^/h^Q7loȾ.}{&!ߏ~ߟleN19^]I/K?mE__Dvg-_a3̋+55?mf~b?C(?C/R0?P~-)'N?l3?R?~d? =vُ?Dk&alߵ'Ifh 5? ܚIqI|]r\o7lȄrY]qyߗbbr)D>vm!?!NV,?fC~b;rkѿk__;_?۟TK_Gd?~#~5oC1oK؏d[~JĶ%d;ߝ_3l7/./ǧC+C_A?OSO{b?M?/_|{x؎K'k_ؾa!Ij{}nߧ? jHl3[*9}A.UmƟW/vfE?++-[S-kk~d+WgnY_LCg^ ?C/)ِ_ʿiSAdM&;&)?!d?P!{Je0!( ?lOd3wlر'D?9u5NˏI~}$Gd]]rY[ A?]|և$~>= c?1ìk#ƆtHצbφ&7*;Nk&qǿwiw)!3~˟ oKiGoK.;?b?w؎_>qɆ;11-%scd?v}ާ8>Cv}F?bg?={ǻg3vw،}%+k;OQߣ_FlfL~ sA}A/v◒~Ă~_K! ?w {!6Yɮ\d;wZlO_? {V鳟__JRmƟq? 'َ?~(Fw!3~a?p'~'[~~ ScncW0 ߦ|߷%Ɔ5?.$n6؋Es^mW_{_;}?~7$[?7?7#[B-(-w;ߚloM؎Ɇ_@W_d>? wCA/dہ_![ w?Cl_> _K߇cڎ )~ݸ6}Nw>~~K޽l+jW?Iwf߇>)!K؎EvJd _d7~_Z I/~nT~ِ_D{Co^&q)~a35?_Bg ^!d?(#?6OdOG?#ɖQClIȖdGHv?lɿ'ۏ?lE#Ն"G#(GDCL$y׋G9>m85ӺX9ُ v .1 !Êُڕo">vmv$268dwcktc|֋;oT?G`/~_~_=oՏۣ?S+^8=cI%Ov gb7{//~am_zdK^Ooc?Kd?f%G̀/?/ٌ?~f~N~ 2 ٌɶ l_^l/v;}_K~v[ N_/9 ?LC?? CnadS68#~?~M"GO1d?hO?l c4#?GC.'W4ۏ= Sz1kOL\ǯu?u1c??F?~s~ۏw9d;ߚrXڏߞ~O'w ْ߅lD*㏄(>d'>;_BB6f~ޥ];l;~~|J~HgdSl ~Jq)ۍ~>߿㹵ϼ~o~el_I~5?EOm)6?=3TGv/OR/;٘l ٌoȖ^//bkڍ?鳟?6ϫ~ K'ٌ?~X?w=CS?lN6G-#v?6ϼ?ZMc?zNG?8OO㏓gSS?lG8!}'O{ُ?(cՆg|LjIP{"6vDlК乂5^'1=y5w.<.uo[1%a?b~?e} [btڏo*&vA!X$m&]2~vDůݷ?b; v____R SN${"v3~ooS;;ҺD6wf7+ߝ~㏂"-l?Q`;?lG'w؍S-3y.sGڔl3w _U^a3䪥k%3dW~1K'd?-C~??\H?lC'{X'?a?,ٍ?~?O?OO?g2vI  ٓ?lN?a?)~)dWTN?YmTOxO2)dCdOOI?؎2َ?H ؐ?:q Af丞c$j?lN/yv %Z!~:~ ڐߏb@=A[͸v~tm׍In/GЇE{cCLLb}(cCؐnڏ_?z~ߐloLO )ّ'ߜs;~K+Z }j?vǟ;S.wXwD⎿OOE_lL%vHm؏#=~Okc~??=!!/鳟A_ݐ$ّߛW߇lK?Ag2}Bks ٌ4|K_ϊ>_O%f%Wk;5َ/f_kid/?L!Ja/#1d;XG'ǓHdG?)S?BȟB6S?ʟ?_idKϠ:ْ?-O'?uNBg~i?TO%idCTGw~OϟB2ۓ?~;c?:X?ٴf"$~L?#~<ؐU'E61ِ?mX sڐ_Xeُ:1atڔM&~|&mHv,c7~?Gȼc6 )nT? -_=_Hv+oLvC??7HߖZ췧wAǟOd7R#q[l'['w]Ac_lH+{P߃~?Of"s/ ݠ6Ȇ/??/l?ĆO~?'|7ŷ'=G~_c5G-_1f[DG|ņ<'؏_9X َ4Y=Zx ss퇟ǪK! &j 2d;ul׵~|H>槱][aeF <_3> ۏ_G!_luտ=~~!#?.J?WA(v_mۏ?[d3Fl?]}{}EO~?dW^<&ql$n ev)?I?wɖ>OWYW!lٕgCdOhGe_ڏ?/!>6b5e!dC~\.:9, b?&d;|bSsY⑘M~ َM6eȮэC0&?1?w}~-o~?FǏcOOf政-hɿѳoOlD?gZ..v osOnƘOvO!ASNO~ zo{P,rLB?%BoC㹵~ M^Q<|EߥoVv@1GF1Ȅs_\ioZ+lEE{MBlm_^1' B~?~#feQ4ْ?Ol5~?IOݟJSَ?O?,]&ُ?~9!;?d#?_@/_~EKȦd?Kl?gRlR!_/#!3_dC%)ّLed?RK_jӦ؏_L6/SjC`O\ۓL5?Is\.G4c(G#5/0a!d? dqșڐņ!]/"WjCJ僷d? /\/~Dl[!b6v$l?G[n>ˏEoY16$7 V|7ۏ_?鿡M-[QoKyߞHk!3]'qJk )"wYbwY#d?̻dGv)۟JC)ncƟpD~!ocCߋ7_//~&;Bvϯ~v>/lN#~aSSZ[؍j5lt~@?@?CO~)/C~a?>'ي_,،gxHISTݟN3&b\ݟC%A?_dS" /l2)/r9ُOꯤU?wW+WoJ B?YW+ϸɆOg9ُ{edKRZ2?Kv%%d3b_hm's5%7'{;T!Ț/qț?410{A/!~\xO/5i<VBy5Q+#acbѮ-)&G~.mi|oCcoC]ێX>gek|{XL_?P߅_M-/'߁lَwK~Wg8ّߝwC~!wȆ|B?6!wɆ%Clۏ?S؏?؎?=)8ǟS^ ٌ?ڏvkon 4]>??1_gd;sF?}_?lJm/!\ /f?F?f+~M+~ɟ6/?~S矢6O% _?gk؊?W<_KB+/ /K_E$!ڿ5W ~_Eɞ5I/k_5M~_35"5쯒TOO gOor\?ڐ?S?ڐ?GX!ِ?Bl CCՆhr Ԇt:ؐ%-7~wܷrO~Fl?77cs9~k0oKoO=߄?.+8%;ٓɖ|LǝK?im{b;')xO(9dC>mdK$l+9? .SِO،?~ Nvs?_ߪX+/~\wصڎ/N6G?WA4'$ڌ?~Ȗ?W/?~?//!/31}?_-+doj'5꯵:#_F6ߤɶMo[W-d?^9SMdCl&o gEzqN:?mQ Bvd ?kb[ؖP<_6/5cG|Y}d7G?_~qQS!v\ ?~~_Tdv#;l{G?@%H}gۍ#^j7ȶIdSdb3?O g,$+?//nҿ_J_ /+אMגM1=7M7f%ېxM?/V+ ٓP-[A￝ouwEvS< ;OmUmdKV ُ9q7z 7^?mhO?/k&y-!.YjCtAȆd߆Q cė4ُ?þ#~a?C~H㗒?ғkk-ُ!ab!QZabَI~|!&mG7ebn&Cy|Mf ſ#?K?~+ZCm~l7w$;߅ߕJk_i PNّO(Q 2l؏=O|@l#d;'Swis)go_xI?~$]> @R\S~~^ )'lFvV7 ;7?Z+%/Af?#5G ?~)6)O!?OCLjg?&;!.ϧ-_L%/e_N+%W kȖ)~k_K6K:_Lo$B7Ͽl%W(ې?v%ۿw;؆_P]%Iy˿~dG..!'d?!i~m7?$l l'/OjjGhO2"!ُ?ߋCMqȟNbS)'Q'dG~Bmȗ!"{\DXƆD/>"rTKz {dC~_G8?9ٌf71 Iv^݀E#kMnu/f0ab3$،?Ka"}'O؍?~_:gLMsK g P؍~e+Ww Voo[[ɆmolAKdCWɖ]⓿-ulM1Mv~_] gCVA]?;~d7zV6['Q9"lCgC>%A6َ?c3:ِ??^d;Ď?Ǔ(p "qIb C?0#ϐُw=~qHM8Got'u/?~L:rȆv6gbflX$\ُxc_&_o/Od?~{ahww5ȏSS>cZsV_E=`;/ڡ5 σb;>"{;l;id7/dK$W?I?E?_OȞLVPN;{㏭ lɆn\kZogwHvیv,@1 'SğJ!I˟E ޟC? _H?"_G_Jegj/=-z#{}7#ٖlDLUB;Fov+NWҿ]dOn[S~~`{C^%/OdK/Ȏ}dK~#?)6) gGsC?7ُwz;='^+$_E 8K~jC!6qWڐ?!?alkX.eB!~bcr)1!+c-dCC~u [!ō}rY~lmgݔӂsY~,b?{77ꯏ;Yہu_~oo?~k[?.~f1pE ۴Mw.%rlȃ !ْC!߃~:'dGNϟ9ْ3AC69 CKk;?ŷ KW'dsJnjdK%Enkُw)?tF:?ǐmc?~#DO'4G?~&٦?~nKy7ٍ?/v/%K9_E?*㯦 Ͽ~ D[3鳿~;;軿kE_=dпO{ɶ} N+GvK~-?Ȟ?/A7AA#?D.AI!t?(~q#zNvdFod7vzُ_6OJO}r_B/ul_qȟG6b^gPO'j'q,G4qK\?;8َ?@HCȓ_Ld?ޑ5C"YߗVd?%݂Dž 3ۏd?&Lc'ٔxk1msY>M>(ߔߔm_d?~K/mvvl;##k [j?v+hc=?{ߓm8w3_Xw?AM6 _K6>W}@$#23dG.h}b7?"KcM_ `I4}P v㏧'dS?gRg?~s:s/61K)9WϿp'Ͽ7ϿN?FC}oc@S_?il??D?1?J (4(ٕW#}GȦd[Q'0/G0ٓ/G?Jl?Bq?L_?B^QM?Lv_#0ُG?sngG&w~md?V o)@Ć~ َOؐed?Іِ?!\+!?AgC0c@.!~\kXd?(Yj /;^6d ]m;6ٍMaߍCb,eumFk؏M_~vooow7ߙL ِߕJws[SُOh׍Ȏ.G9{ܧJH!ِCg}F??A!ǔ:)s?ηv|{mg_=w?I9ߛO6oS?۟9#ۑ !'^ 'onq ݸ㏅ %?#E??~?CQ?N' ?I}oi&<)?Cxsgn查3Dl?'#_G3OMPO]'/''{-;/dK1IِmȟW?Nq?Nq?FGɎcr[ϼGڑG!A6dw;LE A׊ jm_Hϧ8!g@ qȫ?lȟ6O$'Ն1dChؐ3CP&8߿/!!vd?ן]hWHc% ֋A\8^ 2$c̆ َϺg/ogwLil%1{*Y}|7%-{GڏߎmǿOl;~Z7OɆ|k_H+kG?׌)!Kc??1َ#{퇱sb;?؎7vd;?ͷst`A-\%鿊t/ lwIbK/APF?lvo,O"BS?M6?O'~)r__Mck@co8o?NM{ɶ??J'g<#DI??_wU? Uo&_׿Ex'oӘMۿA47}Wɮdc/MW222ٔO?ʿl?O?Kq SQP%)/yO-ɎS%?I6䟠؄_?dO !#$;Oq!)ȆS/$_ԿWj_Co"=7 V.C{#O-'D "_}_ߟwOϟsLK鿠__8KNcOOɾ'DhHF;d_]oM7ȞٔɿJ_%{/=('"ْlɿKϑ=!rϒg4% %&[O)%)gCd??ؑ?mwؐDo ֎ߧ5ې?{dCȎcC(lCĆI_d;8?ّ 6䏢IW"qx5/=~1ُُKlHK"ُ%ُ_!I7Mَw&!aa~{)oFoG1g'ZO~|D6wc?~rW#c;=?bGdC#b?vv|؎~!ϡ~Eg$_mǟ=;4g;?lǟJvO}K/~f5˟[?[??Xy"2OlƟvoS%|/"8r_A௦qcZ=i3o#'&:1?A$z3DlBv_%6ѿgl_|?͠g=._K_l~7ςVgg#{M%Ns]O)ɶGdS=K6ߢ׿E7i {dSUO)˔ɞ ?G_dC! V;O';v8DlHiӿȟ:~d?6AVbȟ !Ά8/?h 8Ϡ<֟Fy,_d?K6v6?c 8?!c-؆?1Ȝb?5b?̞lIxd(َڏϺv memZa;{sf{6//ߞrW+˿W ُC;>_>! ˘.Oy,_)ّdGRِ߃t{;!t3_: }ۍ %H"K);#}陌?nc;Jlǟvo/RD!?JGcK?|?g>/"_J%鯡7V"]!?c?d9K?WO6go-?b؎]ڌ_mًԳ ?l+l+kߍoS=ş?Ggj?'?vv_F_h.G"{S??GǴ=>;dKߤ|׿N_#{blȿH?O?Gy-;gȆ4I8eEaEaE!dCOU;d'ُȟ&!! ُXڐ␿_6// Av͟C6RSņ|ilȟq؏?ڐ8ُ?Tc?Kd?~ ?_^"&8Ĭ)):A ~v ~cd;Bc6kCfэ96ݘ77ooOowo?7?~G̶WA$o_`;>շ~v=l_u@9؎#'߷&u&qǟtϟ~EMf9/ߏ:ƌAeNcc*1'|G _B?H;I,.v$dJ ҁ6/ŤSRqU4ב(76N!}Q?E_GJ_?_fe [!?mB /T{c'{k vgڊm؍h ?awi– _Ne_A/8|C6忢M俠?B???#{-w(o7Ȏ:ْlɿLv_$;/9!?cv} SُCb'ې?ڐّd?Ȏ_EGlȟqlȟM9?Sm!_idCT.C?l6A`G yB6zy,5u_~p {ُ o~4\c?~~LI'NCHvle\>$o;Ǧxoc;_[߉=~yTJGwvK/PwBc]߶Kh}lȃPbGC{H;fed?>tE"_KҭH`;~vfFctKA-َ^i5S~1ۍO%/d;?~C(v㏠(\O ?'O\ӟAןG/_DKI_Kh;$Z]Dh +% ߔf %:Ɵ6?W9YܓI?<c#l<:4_R+oSWd_JyH(=ٓlFlH? [/w(o-K mkdG%#?Oِ?vd(H܆d;.No#Avُ@1ؐ?ؐ6/% 4~yd?E &ُ??lǟ&{q|ؐ?R␧Kd?`A~)!Xm;A~\rblHc Ɔ6Vv>Ȧؓ|C؍툱!߷#njSjs߿Vd?~GZ9oB+ِiw' iُ;w ?Y=El?@mcҁb;ѿ؎)6_vO^{Ͷ ~؎ϓsO ΞϜt騂~3J޵Wnv LCF?pAvOh ']'?SH?s ?t_@ 2*_Mkh] w-?J4ڏ/jr KZ8QnH(kLSg??9tO?'?Ϥ39fe{ ߴf[m';O";'jN1JL [Pl_-)z@1ɿO1ɿGvR;Sn_'[l "dKܥiuE`GN!+ُ7 Ȇd7jq_A/'S rX!dC^†S(~8䏣u?M$Gp! bC~!屌 iņoȆ"!Kj bǜ_7؏)a䳺vdSq|沌 1}o6*c;U_v'mV~d;KǷv9g6=yl}W?Ak~ҁُc SIْ/~hA vW+)ڎ? }-v.~4麒$W~ESƟFvOfiR`j?;?Q? ?OdN&?p _Ech|3w ?Lt'$3?柣 l7ѿ c3ugamY ] OhFsL?&Z??%O~IsK^[[t-5??ῧ{~?M<-_F2'2 ~J\?WO?6W7 ;W%3ْlC$[-idGE-$*$ ّArZ c!af7$;ȎmjGƎk~d?*/UzqȟKy?lȟ!ِ?ِh.K!d?N!?T3b?_S 5c+qBmۏϽcusYCoKς ܷ!Ɩ|pWoWRm~d?~{=wwG qZ)1WOh|?w.ِ=?lblg/_F1_WȎ|E:'"==G:'g(vYd;CןyI?H^~.qgRR>w0NpIcI'ٌ?O*N&!=+h篣8oqdN?H4@fvsl7$ ^] 'fEd3lؿK/i i!?&IWǤ+Sҕ)rS^s/??G״f@kktO?!5??K_G#o+?WlͯoEߝ_߬?>??UFv??#;oSLo-)&An_5?׋E ~#|V׆d?ב !;b㐿_*qk!ُ?ǟK<j'~qA4ِ?lNDzllǺe"+1HI1[?1M G7&|؎Mq |c˜pLJ䫺F7 sk=~W+=wVۑ9؏I؎-b؎oݧd?ǣ>#}#ғǤv'?'Jq_\⎿K҅b;荵_{G9Sҍ9‟& {Q;5}gbFK?Hg#d;?~4!v$O%4^ًHդkFV7$DT?a/"Wk/f_M‡=޿d/?%R|ES}}}ҁ!~1tJ?_)ϯ%wɻtw#ŗ_` Wz+_J_E6~ٜ_EjiocO?^7 -O?ίc}$@dK7￰(&(&?1ɟx䭿.blEO֎~ɿߡ6o'Av{ؐ~ lC\W:_.6_B6ȫ??C/,cS?;k?Q#Ć~R/k/wi }rW{wۧl;&I VM_tkґIG~E.ߛtC}=1a9%RX%@vϼ? z&{_#$ 8"'4${gR$]גiO 074~?FSO:?v mdS6_UſN$M׿I&o)GL]u>وtO~O?$}nc) ?l_3~:qKG~#[ql_r[l_+/lݯ&~5_MvqOI1ɶhbV?>~*?ٯ?N%ߐ-ϙoc#uv|VEY.ud?WB_C6WُLm_!ُ?Gmȟt!.ȆjCQd?H|NC`Cfq_Oؐ_6#/dq !_d? CdZ~ d?Xcx:J!Av3C=%d?~E_/2XUʹW)7I/[m?؍>+o_Ka3Cmln{l?n; aߊ07v/j^67"?%Mx3mٖ?g[E?S-8q2%&ȖN투ÆbkC&bsYd?&gCjclCW)ُXǟOǟK!g {d?Tg?Mq<ِ?OX.'<ֻCW1ِka#rEGK+n)؏|V̎ 岌ؔ˺mL2d?>vlI>@_?ovUowwww9o?s;"am{b;}Zm~~F=SZ+o9Nc;^77?E>ߏr6)sg;\Ed?)n}3/ BC٧??pȦu>+h -ي~؏D窰>ٍ_OG*_RS<E_$e22ִًUʽwug:&`3o[W~!valَ8W~:k_{~?K؏ݯl_lƕկXjg?`7~CϫK%V_ϮgWwvuNRr<_hvY'1?/H魱b]W5 c%~Wvl_@' 9 Ȇd?d"ُ?Oؐ?m(~ bjC/</d/ b&1!|MM!Gd0cS.$Hx7ÜoًX_oOowZo}g6ُw# )ǿhW{/Nۏv ңOI>#m{t󗤣$=ێ/.َ߇m?|3S9 ?M/v$ߟn}bK{Ƕ  K %x8GR4'P2?b?I_FՔfm['m~RO'ki_R,ی/ /ͿH_\ԿLb|T?ߴ,9rcg?urسm~_;Wb7v/5߷ lFlG~DmGǟ9~K?jSMMզ/ G #~%įP?ӻ# hP_.ߢ1֎ysZ?$HXc!{g]ؐ@9ّ7E~/!S _`mϢ?C 5c(G#5 C|F6XbCL qlH1A~H R =i?fGnCHצtmv>k[v !7L{M;c!~v{{O{/ ]9icrW?#ZKcmǿ9َlu؎8"zL: ҧS=>'qF5/v$C}IRmA-IzW_L?`A/C6?K'.*?tKz//%[אi,;Ŀw;~s WEgOnl3%Y??_?_H_/Cug?v`g;Za/u/~g;_Bvg{~8bg7YW//ZǯanX7{0OOb9Qbؔ+o]HKl?Ȟj+i;!?)&G`:_k$G^:yAk#dCܷ!?CL>!?ד ~y:_6#^%dCBC<. 6ِ?ËCO?Vmcad?P0  !A~ &eb%ُbd?~ۏrYݘCYb؏Ϻ)]j@alo~[o_?d?~gGb;w# _alǿOُ}_= C!vs1^3َ؎l/~|IE:5ِ7_K؎)\l_llǂtJmFC/d'~FOF1I}d382Ci#ןC/"{W]ki ÿwSN9A98b7q$'p bּY۟?Oz_k0g;?_ea퇱g;?Ta;?wlrClj??vc?`;olۏ_,vb;q {a~~%Wnm_}}sWأk;ϜB`?Q$E4???hn_i723q;YA<5l?iںrƆ8ķ!5ُzq_H68;C Z Ӭ OɆ<%Dl3I6'H(cP rMʋA~$bQns׎lt>n!lCC;vXa nEܑjɿv==ZَGǤc'ұ'cO?6n}Nk^~$!=k;4#1%1~.8l/6 }~"qMۍ/${P??tFh'b/_Kou/] Z;Z?(1l8F "4' )/OOS˟RA67wek?`;Ckc?`;0l_~Ulj;ڏggk;_ov_am߷K+1]{aDžq.G[ cI?&W_Ms\*_oW9؎`~_\ZkoGOrZg`C̚oC7GkĆ)KɆš !6َ?Cdz?ǟҧ"ُ?K6D!!dC䗐 jC4i~4d?j/l֒b ]"7|o*b6ŷ'Y 竒kCW-Dwu߅c?w?v*ُ[d?Fd?( o{϶_{ȶ_Zxʶ?7{&⎿_{ߏ?c/vlk?d#.IWcSb+~KPH돦>8HO!gn.قp+N4w~A*9n?J}?C?IggfӴOS~؎ Ü`ko_8W!b7??g!톳g;?/~v̯_7/o7~^u&M殆b3r?=IpO3W=wNtUD_EsќJ_JO!/O%?_3Fr/Ҙ9k'_GaY_5KYdC~aG8_A/l_@693)iO# Ɇ (ې?b?J<؏ɆKR^߿lH9,BcؐoloGb1Gnk;nmltc?oooWG=~G_m}7nc_ͷK]{d??)ێ8OmuDxJs_}؎o)o7|ɶ뾢S"}ҿj;)مsوK~`۱&޽WM Jv㏢O$'3(v%_EouUlwg;>^oon?vkn(~8O?M?߷ϳpWwa7{s}k???dvَϭڏ _*0C˜ k?v_m aGtCmG~Bqc÷3?mR~5-_=Dc_4OBvkZ#>x)Z!;2GoZ_=!ڐMmDsY4!dG^jC1!g ?;qȟ@6{6 ِ?<nW,~T^ ҵClF.gv ?bWݜo3~[c]q=~?cɿ ~؏OiirW 9"{L ێo'}E $;ڟl?WLl_.%_&+jjߒ5%?rcG?tB8ӟO_L$\Fo%6 :n?L?Jxkg_GYk?`;#ek??_ul_~ȶCl_~b;l:9WAd7@H:WRg;_++~ɯ[3*/vvCOڏYُG??mBj]*W~cBLǿD_Nsa=oxFxĬy?[?泌 ! ÿK?_1{yٞ 8B1ȟ$,C4ُ?X<46䗊 wy1Hh?/ )Ɇ% ;)edv)7ُݸ)g?w÷f}YI;߿_?SNb߃"-]h.;#qc;u<3ҿGOȧ?%twHg[S!^߈㻤Ӹg9d7m?Wnʆlť/! ?è??iM%ﯡ\L8mǿy1^؍fda5Q53oqZ:lۏ?c?`;Pl?pc7}?ck?`;0/C`/ngc?`; b7l?~ɯbb72~`߷=]Emg?n]Obj; O7K~%+￰4U}L_NWA3 _d-'Wazn qϿ{ ?C[m;ڣug?l}~<&]|D:e;ſُnh /H?I6&]/k??)م sATI_w+FKK^AI:~$_6ٍƿ&  ol?wO?g'?l#ocIvپ # !k;b;?lvoȑW&̶Cvێj;׋=vx{)OW/+ϯ1rb_FeDh_?Nj{WD?Zi5vYfk߮6o␿ck=WI._I/S ȆyjC,Z3Ćx6 rǒ Ɇ!d? !E;bC$iɆ4d?~ K/i#-M>+ߴ)um>kȆ.bf~?gW1 (H)]][d?ƴK+َ'َ}gOHG>~Jv_.~Iv#]>َߟF9Gl7"";8/`b/?AQOßJ6!\_ o=7@vWQxv%?S_ǟSAvv)ocYk?`;j; !c;?ߴ#mg?`;b;~vu,l&vkk;dK>?`?yy~H◊+7%n >ZۏHl؏??//BFDD/E7j? v/7%Y 6gY_ME 7O?˿b_Nymr:ȟA^ S~d?x ُ?ZbG}y 11P ~\:e`?\ -o~.+o. vlIvܔdC`?oYw?mѵb_{SE[1؏=?Qsh!?"q$})Nd;^gW7d?`7(َ.#=Mv㯾sA؎oڍ'~h5n2ٍl_gMo_N&^e?oSAڍO0؎`W0l_G~?f!w#s)vF3_ja?Wvo]c~ڇڎ䮆bxO3{8э=pO~9_N_F2!<[4h?GD{/)ْ_dmQUF"8"[ې|!!&ُ?b?Ymȟ@6'ǒ (Al!JwM6l;AȆ\ i%j?~ÏCL,Xd?6岆lev V~lYxvPJPp!w# i|cs]=i}=vgv{^>&3=ſ9K˯vPo}q__7'5d'g;ߴ&Ik l7'|Rk Z#gNIpnwSf/ۍOVk;ڏ鏅퇱:Gn8h ~ڏO~nkp؍&:UwC^b7?ٍ??~w`;Cm7>ڏb؏̭}\э=Ol'}_)?n?xG#G@=#D?lJ;ؑ k#4D"h=ڐ mGdCdCT!CdZ8E$lem_D6/?b?b?lȟ6G< 6dy,!;~| C␟ ِ_D1oC泺MX.˷%C,˺iM!?c;~{8ge؎~տJb_?lѺ'lt/]ZlǿJ_<Һg~Bv>(P@;5"}7;ٍuNԮ$!;jz%}lf?W?b?ßF'WZ]'f7lJa7+NZa7v[퇳?Ql'c;/nn`~Ml~b;?0Cb#=۱~c~lZY]]G{ǟڱ.U!#=B&<G:oȎDh_NOi?D>ٛ/`]O6^[(ڐ86/ϵ6g~?b?ų!<!ُ?Fbcmb!ֆ5cvd(;dGrY~> 6cSL_vtc*ߏ9|ہ؏()b?bDcL;d?hcPw(wuıǿO&).xA㕍;`;{ߏOv#g nA1ƒ_ѺIM]%X>  و?l_B1_Av Fed;co[)W_Soxv߳ڏOѵp'[V/oEk?`;b;?_w/o]k?`;~qb;??v,ٌ?Fll??0Pb>|ُp1᭟__\m{}DlLJ䮢G~ d?Cmg?cwGv`3-K7Mk,+MWDh_} 9]?#ߥ*X$'糌 _l?ȗ.qk!j?NC~ɓ?gC>w"ُ?GS G dWc/<ۭKAdCjA|"\ܔ2P.cKb62d7xv9+o`7~//c=rw]Z7؎ScZ7=Hwso㧔z&Blk?Iam'{m<ٍ ov׊kH_v !~'4ٯmǿOUj;($v{foڿ쿝lnmc??vClۏ?َO~Id7D~ v-¿!C[7b;vM.la_G7# 2_?bg?~e~՞??xgccS=v8tpb?BLvqo5 4KI/v bG4ۏߥ0?I:Eou6/˷#|֦\V7յ%7nrS,2o|;ursj=~Ow$/{iqHG;?m(o^d?^ ߐ /gF6bBl7ſo) Sv/x?7?SVy_F3?򯑸!.lH6oxoɿoo?o%[?v؎OOloa7vvb;?Ɵ(C[ b;؎OC؎O~n~H_yA6ُ9 ~˭_A~UЯCu&>ZMG~{d;ԁOw؏?b?o(pc?L?vl߉=؟+j_% zD]smgDl ّw B}_wͿN4g)imȟSڐB lx6y,Z y (38 yO/8 Kj3bC1Xd(ېeb&1gm9vww㗑bxWbS|ƶgNHw?%9礷_ |tC6{d?$0_gd+).`/=؎kAWd7~ `7H  v_am:`;uvKHimo?o%{=alXolg?`;b;?I!ofvD˟??b;?vClY!³bC۱g?ǎ_CYh?ُ?W:d??~d?n\V+vO{ߏaaOOv+{W/_9?'DQP6?P; 2"(|L!z6%g߿O8D9?ِ!a%d?~bp "9b)M,c?Lbb߷!\ \Vv nsZYWn7BZ?7{nNk~c=?Wc=v(wu/n)ُd? /Bg ސIMَdFK/4-K/"sv"ٍ?Sf_BdRYYv㯥ZS=Ksf]wi7`7Baln#b?vm?/)b; !ǟ$o`7?#~m9ُڏ/;qo>wva|1`?v ؏{tP؏߿k?bc?Cl=Lb;÷&/=_??SّhMO ?&;B_GdKCڐݿCsozи `Sl_F6blȟC6":ِGُ?rXݲ A S )bA`C.n"2Hwķ#Ɩl7ِn</gvlҺ{olrW}g#)}J6!ߗlw؍ J//gE0ٍ?lğD}ٴN"?v5v ;Fwd7~C;4 ]$oSa7vُ?ٳ !_bbC⯡ 1; I#~৳AvA1̳jbg?~g?~__kzأg?n=~ɿh?6WaV1!#=%o+{ہѯ~'~)k'?&D C#yߦ-3,)???xMz-qb?lk!:5g3ن{R Bqȃ?I1l ?C1/&Ncal,&eeX> cnlE?ge 9;{ܡ'd?_9~I_ޑ=# ٌ?~/w^AkvK_K1__O;L;!6؎;m!ǟڏOOuǟ*oSE?l۟"oSuj;?A!~ ?:1_ybg?Ćُc?~Яǯ؏ݳ=nk?|5N!OU۱9~!g;{Ǔ]Y1`?z bB8yȎT?$jG};CF}W/<rk!&!ؐ?O1K1ِ?lC(~RA~Fcc}&jBVaGb6dS.#C!mBlHl-ďGn_07wR s??~vlKc{mbߢ_%/>vQ yI7(W?Q^jJ؎i?X!tMi-'Q?9w_j?__K1_O1_vo?ofalۏ?]wb;~ivv?gǟ*oSUnOwQ_6S6j?؏Ջ=vǠoأg; ~8GOh?1SN?"GDhKE!?xW; YS428 z=oe]5:!&Iy?mHy,!ͽ?JcȆ`!\xG1-!?Dz䲌"Y#ς ~dC;7_[?6Cqێ>؎ǔ=~˟R\ߋ³ىvC}?生S.v"Z;$Gm(v+!欜v_C9z?lCL.3Ng?=w~iv~ُ б.XxClbC/=!6ڏ?u%PW_ُ_!/wóó=6]cc?`;?\bҳaO]m0lG~lyv7CZim? DG`-bu_"3Dh6YWO8)ؐ?Cc?lȟDl6䏠P blȕ e!&1ÏE6`CrY1ҍGvcsv s w{ O=[ُc[)3=~/_xI r-}'{(FRsXAXWnQk)yd;|=b;+c/kkvLg;?o-3vgrI؎Og~v?vCm_lc?Ć8!6!~Mn{Ovڏ?Ć؏G{Ɔv0[Cv/#!i<?ſO>ÿGB6wdGZ4_*ۑ?DWZ=4޿Cտ 5u!j?Y Aџ&6gChAAP!A@A~ ُ_LZcVe~kG2vd~tWvNj;|sȺw~p~|ʱ_=I?!tW_7ߛُ{cocٗo3}N4_=XSnkۏ㎿g;䯢5bb,ڎMCmgnbC3Cwb;?;\ڎ~v;UǟY!1ȿ7oCؐ??g?c6p/^W=!6ُ޳bCُ_?A=0÷=÷{ڏ[j?؏;=B_9lG~ly+?l? }iDh=.ǿKm_WihMqOt;i,_'/h]K#k!bC\OO<֟H?b?c!ZÆ@X]~5q˂-(;ҵ_'鮅DAH~؎Գn۱EbO(߿١c>QA_{Bߦ?'lK?!}>`;}Jfd3)GdRRgpʉdL. :/d*Z#okkhasz!φ_lg?Slgl?lwb;b;?;Yǿڐ?_!~6يdzΆc?D׆H_xCl8v?U!~r~ُ_W[brC%{؏b.A}~q7筌p+=k?c?/:&Aُ?K?}x=ӿGw.%;мh-IG_4O2Ю?7 ɆP. 6_ yH(92 "8AHC'0 TcP v#2qM,B!a?brYƎlY#~~9P1cvŧd?:$ۿ''<\lwH't:c;G?}9~Ad3*7 d;?lIO!B_/ێl?W__C_=َ?Ɵ-&wٰv6g;~oo?L ~8bsXdCBڐObC?!~d?k??GGCGgُOvBl_E'؏~H w?=nm?l-7{_[ :ێ]ǛJmٱ.h;~H?տGxD3.]Ck#&;o[Ҝ_aC!YWF8Ӻ:/5z,!ِ?ǟJ1lȟ@1KWwr@ B6w! 5Ɇt툟2v$2HwC9M ?c7<э9@MESqmr?'ןَ_}=l;+ ?I?Ky؎gL-l[5&/%;G?UmǟK#o{/v1?U?UϟKv?n??vَ~v!ǟ)3Ygvǿ!~m'$!˟HĆp;c?!~Dg?~W~w=?ZWKҳʳ:AnR񳒻أ"GtO=~;~o;}э=Kj?ڏM? lgOZ_6ّ";o _Q1^WG}ou?˿XXO =?c)dCh-dؐ?m ِ?b_Bk rL> 6؏M6_ 1qHvZb␮@S~ao F{)ء}=xH(=~)/6fo?Iޔ}(};Ovc¶gޒ%~@p`ǒS(/giܡ9+g;/___Akg;nϟln?vCl9b;~vv]?wYڏ퇱!ǟ/uk?UZ~ OlAԆ7q?g?  q?%y㿰e_7bbc?8v~A?oo?b[ڏ[|G}ڎn'|OOݼU7^to;ބ؎bvc0؎?9ُ/]!m6f;.-d;"!_`0ً?ҟŶ?7?7al__B__ _S_A*?`7vGvu~=w9d;l?)Cmgb?v8lY md7Pbbeg?Ć8[2 1Okp_xg?[~ُ_/{~̯Ta//cv~ܘZf;ǦCm؎G70~tm\1h;d;va~woMg&"&˿As W _K.)^W~7J.aCHX 2ُ?Ac?/E6dg(-!7|!n CblE\ۏY6{ob=#]ſwLt=َlǿv3>|Eߛ)?md&d3im+k?C?w [yl;{؎m_¶[ Z#+wǟw0vnb;~9~vXgsQǿHw6oSʿ!~~I6rc?1lI#k???c?8ѵ!g?k??WR/W_b_3cbw?%K@zkڇz/=L^vنl=̺?mK9Fm؏?u7o?f;~aa쇱o/m˿Ec7i]$z4Ͽy!O6d/l?Cl߮q_˹,?q6ϐ #ak&0v?~]=~>~< qHg{PyB3gv{Ox')'{){Olǿ8#QPlBEَ?lƟ?cy/boc ue?e *!j?Ɵ/| a?\ϟv=?.Cml??쇳!~ 1ڐ?_g?6oug?ĆXAaC] 6D_Gd7#~ !6ُClLĆ+~&?WMl/W=WO;~/nvîyqK{}[ɮHe_r+H N~%H'*忊~_MjYImO/ k#mF111[+Q;y_)1Hvcc;Bѵ{[alJv?&o`0؎? 77?{_'Ӝk4?*ӿBs/?g!D!__M2CB<֟H1G1M1I1F1~w! zȇ`C06粺6䲌 ZZw=c?ǔ}{_xJz;_P^%ٍWd#w9߿ێ_ROSQyGv"{GտG5(/F_ x! u%K/]b;/$pwmȟُ?؎b;?؏6ُld7qb'mbCmd/Ć  ey+H/ +I7J~F*W_Y_M$R?F[:krT>`;÷j?;-'+!=̚؏0%q }{y+a&o[aߠ~_'{]5_WiȆ,%??Gm.B8Et1c ZhAp/ҷ!f=}sY%~|\%euc?svlGj;{QqOc_=d;)tF9o~%[)od{+W GO#[؎/_vb; 퇱_`wߟ!avt퇳!~ Qals0 ۏ?C8U,<ci vȆ8A(ApA`! ?e !~.˷!&[O!50|O?|tAp`I%&/m{JJt`$ؐ@iG#)*eVe]f@흼{{;N'?\fdlJɞ!?~|?"5~GGGGGGGG????sG=??Ə?}mGGϏsG܆o~G>G=?zmGGϏs1??z~t͏?=6|?_5s?k%W\?~lk||#|n7?_y_"WE??_n͏?5~7?b܃c?ߗ1珹;?,#-z7[?_:֎ &qzn7__xH?1FW_E?WݿU_//߿__ __yK?g߿?e̟//O/-Aֆ}@?܆o~Gnu:?~ӿ?~No~uwZ ȆJ!6_'Ed?Ȇ+dCe!ҟ&g eܟNOOIL6"? ZoG͏?۟&5v?j?;_oo!7_φ[% dC !_dCW!_ ~yd?/8Y dφdC$oL +~_ ?g/~/??~=ٯ6Ɔ bC⏿_"W+ِ_K_%ڐ_/d?\!6ِ?_Ȇ/̟JՆq76;8<G?_fG{ᅴِw 8_Md?# _K+!&l_Il_F/U߿_ )_/y?WmȟE6BDOIO7_s\Oh?(~?_/ICW+oo"A6&oPWW+Ԇ/ rf?g?g !E4! ِ?Ǐ?/'wg!?? U&6[~ wWW!+ېmr!َ/K!/P s 3ُGG]ې_ _!ۏ_d?v;+ُooudCW 8WՆdCĎ/dG/ "vlkGu#? lz?D'j?#?HÆmdCV!#o Bv$;6UdCĎ2# 6D/ɎdGϳvُۚG^Oh?f(5~d?/YÿlECȯ$+]oQ7W=S߿\/WȆ/%7ۑ/R;GG'0َLl~j?Wُÿ[mI6og;_v_v%;W߿_/dK#˿Ɇwd?~Gy?'~d?Ȏ/ - {_IvW EĎfڑ_o k_v"W_Ǐ?/Ƿ;lO aCWJ;_d?W; %;_ݿȯ`;_Nv=#5dG+~#? b&O~SFk lۑdG~%ّ_=lGW#jKݿlGؒ_oſٿEO-?OM?˫_}o;׺HsGj7~@9/??/ߓxQ;9;dK%n#ِww?7o37rM߾Xs5~o?/g߿_39O>c7W?MkؒXlɯA%@Y[?vפZ?GGߞU͏?~ϰSo/S$ dKdG~dCԖ-3_/߿_߿o;CsFOXC@; ؐp#> ?/ivwXU?o+nm!A/b9~GŞG=}oB6w?oAWWr//?ywk?/W n$>G?k;~ _3w߿_+_iq~??'߿Ɏc%_ϲvd;~_'*WW?َߝl˼gDd;~?ُߝv~ mGo?~?'[ہ!i__fq.m?3?/6َmۿZJ_'۱gd?{od?~lW?U8p܆o~G?t ?{ϟ>Kk??ڎ_Nosi'ُ_?iEwU?^[|>َ_lo_>َ_e~'۱z'_+wӷ/{͏?7ٿϡY!O߿;_d?߹W߇d3v|FJ?َ_/8O?x'q[dC~W#?=Mxe;b?'_O m;{d?)8&{qL'(ᅯGoWwd;~?3ϟ ?ߟ/YߧoO/I߿3/ce1o?ǽoimCgd;wJvG_'qx'q?ywV~WGGy+/d??\?A_߯~|_/_^S~q/Y~?G9/'VX{xIv'}Q>K///{d?^~Ǐ?~G{`;~;=c;ߏaOȖ|lO-}`'Ğ|E+%oȖΞ\6~/im~Gwُyo_?7"7]%[]]Md; _Oio=َ d;˼~|OOd?~G`?^}'3%SDIG=![ΞdOGȞ>w@)jOמk;'_o/ߒ_wv~J3ُ?.v~r/gw~~w~d?~G`?H 9ٓ䏖O('ٓ~=ٓ\9?c?rOW[ ?c{ێo~GN#U?Ko>Go"ۑ ?ZqOOGGwy~|]S{Avd'?ܿ>cOɞdKf)ٔ?l'еg??ڎ9?A_MV?$;a~]/jd?JW__HɆW??#7:O_DSz'oɎ4 {rvl%6g?G+1ُ?oUQv3miOh(hV4}d79?rO~ َOGd?O~?3؏fpggW?/_7_H?E_Q$N16-ٓV2'{GR~?K?L𗼷/~";߁lEdOb" / r??Wd?ُGog/oGho?/5(-(ퟦq ~gS?I ٓ?r~?_U/JZ#oua&k29d~#][v0}r/xOǚlP_Ǐ7x;?/?_远|jQ,LU.ɦtgW)5ٓ??3kZ+;q7ڎOUs_~/d?+y_s?ُ&wƏǏ7xRҳ [ŲOkvO_w=HK)N%?Gvϒ3ɶM~?Y_S?WCmǯX~U~~mǯA:}l?H__ o??#ۿ1ۿ\5?oO_K/? )GCqή?Wm ٔ?Ogv>?W̜~_=أk;~%v3,3~?i[;o??#;ٿ 5M{G=Uȿ_FXKd]_HlLs\l??gvgO:2k;~ >-Mv4_? +ڝӻ ٟK5B0w_ٱټ ?3؏SS:3?_,9?S\Ge? lJ rk{َZlWlǿ-m?H.1d;M#?]~^n_wVSu_ ڎ_k=~WvʏǏ7_d?ُ ߮v{䴮GI׭}ԿُGmǯu~ߛ+\[Knxn7?#㷿~~/{9kg?B0/ϛ͏?Çy~vd?|$;~Nlǽy9gF<6|?<EϹuuc?FG{˟#dlơ蹑g~GoGb;,َvv orP~3?7ٿ=߿O߿Nw<_߁?_'/o{/o{/oM/o߿у ?__o߿:_5#'kk${mG\=ވ܆o~G-NIW߽g5~?ugMmkڧo|kza=G?Gk|ZǟkdC?/џkAig5?w8џ6|? )wG>M< آ ɏ{3_;/ڟ_~#nDg ??o//?߿_/gs+?Wk~wo_/տW__3W؎5͏?>|g~+!m;uGb?/;?-y~?K/~_~KݍHmG~_s"3o~_ס~I-;"ے$/W`*5_w~?ußf؄/=ώ؏M_MoҼ/IW_u;6|?M? muޯ=ӎȦY{Ʒ=8._ޯϮ7]Wnя~hƯE8g(܆o~GqtoW;ZЃM[Ew~Plaa_osaa`ǿ'Gu=1YO?_^k/ ;~?F__?ڟ576/7܆o~G=?kf )u;/OWYgF&?{~7?7 m?M/آ?Ϲk젿?{?/o|Fjj`? O?Iǿg೿cb?)܆o~G]BG~=hGv'o'ٗ~/{q[ү#n{'}ڏh#~?} o/~Xn߷f_m/}s퍡g?ӿ~Xv{_ُxͼ_YW'o'܆o~G6.#k?_*s?ُkm5vҡ)k?翕_7~;?VG#o]ڏ15_~ʟ{ʟWT{pzWoߖc?G}_ϣ\܏;k?mGg!۾[V?~x ۏ}d0~k>ۏ/IGhrGQw?u/}m~3+W__O1/3?ܟO?ru|+ //W߿+_l?~ſo✽_㟡5߹C6|?y{}Y E_'T_/߂#໿XOA,c?g/a>u8Ek ]w\_zA//Eł[ُ/|w_͕?ǿ.K~;og ?l=叺o ~ݳ~=璯º|gy[ ~ đ~ئ?e]ۏoۿ=_m_{ 6vӳ_췎w?oտWD~dC?݆o~G_|d?$З_ob?g[A/~?kMocixo}?ُf` &{?b??yS_կk+?&//_췤|_g\xsGz>ڏO84~? #]~_zۏOu{?=7uh{~Y;}bĞǿߘ>Ww~_ ?;ޯ1}n7??[ϟ>_NGl?_uO`Sֵq?+7ہwiK~?0/}WOI~`)ƦF`5,|o9E`?gb3~n6|?>wX7gh ۏ5_cgZǿgW{z??/g9__5?;W_y+~wߑ>wQ;f{Οkt>G͇tv~!/:Y7ߙ?cqFkdy?atE~_ wl?ֽ~߰Ϲk< ؏z?AoWR AV7v ُx%kw)h}k:g?Ư~ѥ;/>zW|of/џ?'vڏ-Mx8ُ_oEO+?/oCkk_d?s<G@h_ ٲ؏.6joj9ex_#Oo+~'u%7F3A/FƆϪͿ߿+_?;;͏?CGЁw/W{m#ox/p}Ibдk>5~='^={wu~c*Ӟ^⳿7=Oo~wZw@tJS]~mohc~Rc'?Oj<$coƎ6|?A=_oOkُiK ?[Xs'lzG?wC} 75O_v܆o~~?x_w!]zE]_t$م߳VSݶ3LbmI۞M Eޯs-~_z061wM~y6sg͏?=6|?GO ?}n7??z~t͏h?GϏsG܆o~G>G=?zmGGϏs7G8GϏsG=??Ə?܆7~GGGG??????H2`I%&/m{JJt`$ؐ@iG#)*eVe]f@흼{{;N'?\fdlJɞ!?~|?"5~GGGG GϏ=?zn~GϏ~8=?z~~GϏ~GϏ~GϏ~GϏ~>?GϏ=_}~d?~Gy~d?~Gy~d?~Gy~d?~Gy~d?~|w~GϏ~GϏ~GϏ~GϏ~h?z~|GGϏ=?z~|GGϏ=?z~|GGϏ=?z~|GGϏ=?z~|GGϏ>?G#GϏ=?z#GϏ=?z#GϏ=?z#GϏ=?z#GϏGGϏ=_GϏ=_GϏ=_GϏ=_GϏ|GGϏ=?z~|GGϏ=?z~|GGϏ=?z~|GGϏ=?z~|GGϏ=?z~~>:ُ=?z~uُ=?z~uُ=?z~uُ=?z~uُ=?z~ukq#?z~ϏǏ=?z~:ϏǏ=?z~><_~_+/_%voLOץُ=??FK:~@:V$Pl_44H_+~?_kBG:ߝ/ Ws3{Oߖ[_C l͍ztF!Ǻ}u@7k {C>/~Bk. %; )w_m' =mC3OG/!>;'bG G ?_~ vb?8?rG8|>??oQv۵m[i߃C]ůq\oGGσ|+"!p|F7_ g_Cbؐo4/Q}d?bn2a9ͯ!x~ w݈c!0??~YKOԟ@_Ok#\ރ=?OW?OW?O?O??_b?5$ɯ!~o01C_~W!~h.o޼s?5w-$w|??z~?H/5d#H-Gķ Y#M OfĿ/?ud?€,R5WCې}o)߁t?mOoE?uGm>7+jE]!rrO^,و}o&¸~wHWsCs1;voF#א9-ba!E揤A_?a?Y =_JۦoN?趋b.?Kl64ȕQ<=,`s/ks[v{]7אXw#Foaئsˇo1F_=?ߥn;<w~ ߹W?>OZoΧ;$K=G-1w5$gg_CsO?5vܡ<_;_{Îz4|@?߹G>Oޡ_~}KҿWԎٳRߠs]GװqDiotwg؏rmkA5ćb ж#)|>_snޯq==* G_Cvlο+@yM 95Ŀƍ#Z'$~~kNߥmxאXt{2?҅_h'sɞ??H18kH K3wϊ<ɿM6'A_a~kn;kgwm/ſ~Pqw I-7=_MX'x?O$X6M=א5,y|3q"XCn;_5:Ŀm?L5o[oa/^=rvMo6^ҳא55_#oL}/NyVC~/rң=ſ 5$VIZObrD_€Nxk=iK{SzR`*~F Ы߉c߶]~;!k%fm~Pw 5d=sW?>_CbtW~G`0??z~|#/ ́뿆+GYO5$^n 3ʑtkYIZ?C94;?#kG8—~ з?gz(\ѯ!6%?":؛EF6^m?G~^KIݶJMێW/5$IZ'ϺC1ۯԵcאn O)^zAo itx?O7\AXL׵dz&_O3 Sc{kF.LЛ?2~15O5n??zn1_K!;k'7wrVNOl@G>' Y~D<A!>kHػd~5l:寀,Bo5G^| w#ckZ+[mϯ!z>rZ51!覿?sҶmmOpc ĮGgAg`ͤNڀ(ÃpZ/>|~?Obǰ!K!ߑ1{kx{א GߚtLϯC=ߢ3_Cb@]eqo t!:o5d?I-~~q,P=X<=lŸD"tj3b?*;h<I?n;w&Vnkd`վ$m_ Φg2 #~ YsA 3~Ƀx<;}o+ˤKWm_|~?#oK_C֒¿ .lfPC~[<_~~f?_gs5$?}v{{'/)M0gK)_ 9>;;w#o?{+}#}mCd'wzy^C~A?%bqFAɿ۰W~;Z[H[KǤG{O@ o|+Rcֿoҿ/!~'8֯!_+?E>eYOO4ؓwAGwCGQr{'kڿPF֯!y6إ_k}׸Y`?'}?=^;tw5~ ?hi״&`WA of9 uvM.0c_K_Ch{~oUU4!5]p6Ɯ?(obkT ҟ?E=G[O@?O~9_׿CALx/wۯ+??§{;-_po[טoi7a< /wg ? 7733xp1??z>I!2~C5D|F~ q#ɯ!2Y~ !_ClW_Cd p?5dr'*5Dn. {~!avP!lk6cM_婡r !cN y#p;s|w љ# !S7_C_I+?_k.\6_CƶEk|z/5f:6{:rkyi`sw }@OgO3 .~|Lh'2?U1k!stxoGG<};==~ ѯ[;+k~ O;65!ԋ_C95Ğ t/5}wG=6k!Wcu~ wc̠AkN~ 7^:_CM~ +?2 yпM|?s|__C_蚏fßzAG?z_Ck^ͯ!sא75@S ?:_B^@|v)5dן⛀2?p[[yk0_Cb^ŸKf~k?5;m~5D_C_C|oCA@6 k  Y__Þ5^_Cd '795:2B}zأrk8=; [~ɯ!ɗ %0_א~_C>gpc~ ym?5D@M?wƷkoz,ٯ!.Cۗt375$0o֟׷p^ߧi[mgf1?pvc?/`'!|O~e p~_ClQwc@{~75`aGF /;x3|אaGgm;~LsGL8o#躻~7I d~=mok 5D_C9ٯ!Z@]? xL9!3@3{Z6fk=M!ݯ!g~[OџW36^_h~_Ck_6174c>?5d쐟'75s>4w~5w#{ ~ izJM;_y }gm '.lo?{~ y38ӯ!r  ~ ' Ox}oF7&ڴFwQt5ޥ;xM?o}|H; f-.C|ok#h a4f޿8GϏ=_GϏo>?X~GϏ~GϏ~GϏ~GϏ~GϏ|=?z~GGϏ=?z~|GGϏ=?z~|GGϏ=?z~|GGϏ=?z~|@?z~'~GϏ~GϏ~GϏ~GϏ~?z~z~d?~Gy~d?~Gy~d?~Gy~d?~Gy~d?~\>?GϏ>??z~?GϏ=_GϏ=_GϏ=_GϏ=_GϏ~GϏ~GϏ~GϏ~GϏ?`wxformbuilder-3.1.59/src/maingui.h0000644000175000017500000000311111143440026017334 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #ifndef __MAINGUI__ #define __MAINGUI__ #include class MainFrame; class MyApp : public wxApp { private: wxLog * m_old_log; wxLogWindow * m_log; MainFrame *m_frame; public: bool OnInit(); #if wxUSE_ON_FATAL_EXCEPTION && wxUSE_STACKWALKER void OnFatalException(); #endif int OnRun(); int OnExit(); ~MyApp(); #ifdef __WXMAC__ wxString m_mac_file_name; void MacOpenFile(const wxString &fileName); #endif }; DECLARE_APP(MyApp) #endif //__MAINGUI__ wxformbuilder-3.1.59/src/Splash.pdn0000644000175000017500000065560411143440026017513 0ustar rrmulderrrmulderPDN30 NPaintDotNet.Data, Version=3.0.2548.23481, Culture=neutral, PublicKeyToken=null ISystem, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089PaintDotNet.Documentlayerswidthheight userMetaData savedWithtagdisposedPaintDotNet.LayerList2System.Collections.Specialized.NameValueCollectionSystem.Version A   PaintDotNet.LayerListparentArrayList+_itemsArrayList+_sizeArrayList+_versionPaintDotNet.Document  2System.Collections.Specialized.NameValueCollectionReadOnly HashProviderComparerCountKeysValuesVersion2System.Collections.CaseInsensitiveHashCodeProvider*System.Collections.CaseInsensitiveComparer  TSystem.Version_Major_Minor_Build _Revision [     2System.Collections.CaseInsensitiveHashCodeProviderm_textSystem.Globalization.TextInfo  *System.Collections.CaseInsensitiveComparer m_compareInfo System.Globalization.CompareInfo   $exif.tag4 $exif.tag5 $exif.tag6 $exif.tag7      DPdnLib, Version=3.0.2548.23481, Culture=neutral, PublicKeyToken=null PaintDotNet.BitmapLayerdisposed propertiessurface Layer+width Layer+heightLayer+propertiesLayer+disposed-PaintDotNet.BitmapLayer+BitmapLayerPropertiesPaintDotNet.Surface!PaintDotNet.Layer+LayerProperties  A   A ! " #A $ % &A 'System.Globalization.TextInfom_listSeparator m_isReadOnlycustomCultureName m_nDataItemm_useUserOverride m_win32LangID   System.Globalization.CompareInfo win32LCIDculturem_name(System.Collections.ArrayList_items_size_version ) * + ,-PaintDotNet.BitmapLayer+BitmapLayerPropertiesblendOp&PaintDotNet.UserBlendOps+NormalBlendOp -PaintDotNet.Surfacescan0widthheightstridedisposedPaintDotNet.MemoryBlock .A!PaintDotNet.Layer+LayerPropertiesname userMetaDatavisible isBackgroundopacity2System.Collections.Specialized.NameValueCollection/ BackGround 0 1  2A!3 ScreenShot 4x" 5# 6A$7Text 8% 9& :A';Name <)=@*>/+?7,@7-&PaintDotNet.UserBlendOps+NormalBlendOp.PaintDotNet.MemoryBlocklength64 bitmapWidth bitmapHeight hasParentdeferred  A0 C D1-2. A4 E F G H5-6. A8 K L9-:. A< O PCDE QF RGHKLOPQ  R ( `I%&/m{JJt`$ؐ@iG#)*eVe]f@흼{{;N'?\fdlJɞ!?~|?"=?z~GϏ=?z~GϏ=?z~GϏ=?z~G GϏ=?z~GϏ=?z~GϏ=?z~GϏ=?z~GϏ=?z~GϏ=?z~GϏ=?z~GϏ=~4=?z~GϏ=?z~GϏ=?z~GϏ=?z~ϏFGϏ=?z~GϏ=?z~GϏ=?z~GϏ=?z~~GϏ=?z~GϏ=?z~GϏ=?z~GϏ??=?z~GϏ=?z~GϏ=?z~GϏ=?z~G#GϏ=?z~GϏ=?z~GϏ=?z~GϏ=?zh?z~GϏ=?z~GϏ=?z~GϏ=?z~GGϏ=?z~GϏ=?z~GϏ=?z~GϏ=?z~GϏ=?z~GϏ=?z~GϏ=?z~GϏ=~4=?z~GϏ=?z~GϏ=?z~GϏ=?z~ϏFGϏ=?z~GϏ=?z~GϏ=?z~GϏ=?z~~GϏ=?z~GϏ=?z~GϏ=?z~GϏ??=?z~GϏ=?z~GϏ=?z~GϏ=?z~G#GϏ=?z~GϏ=?z~GϏ=?z~GϏ=?zh?z~GϏ=?z~GϏ=?z~GϏ=?z~GGϏ=?z~GϏ=?z~GϏ=?z~GϏ=?z~GϏ=?z~GϏ=?z~GϏ=?z~GϏ=~4=?z~GϏ=?z~GϏ=?z~GϏ=?z~ϏFGϏ=?z~GϏ=?z~GϏ=?z~GϏ=?z~~GϏ=?z~GϏ=?z~GϏ=?z~GϏ??=?z~GϏ=?z~GϏ=?z~GϏ=?z~G#GϏ=?z~GϏ=?z~GϏ=?z~GϏ=?zh?z~GϏ=?z~GϏ=?z~GϏ=?z~GGϏ=?z~GϏ=?z~GϏ=?z~GϏ=?z~GϏ=?z~GϏ=?z~GϏ=?z~GϏ=~4=?z~GϏ=?z~GϏ=?z~GϏ=?z~ϏFGϏ=?z~GϏ=?z~GϏ=?z~GϏ=?z~~GϏ=?z~GϏ=?z~GϏ=?z~GϏ??=?z~GϏ=?z~GϏ=?z~GϏ=?z~G#GϏ=?z~GϏ=?z~GϏ=?z~GϏ=?zh?z~GϏ=?z~GϏ=?z~GϏ=?z~GGϏ=?z~GϏ=?z~GϏ=?z~GϏ=?z~GϏ=?z~GϏ=?z~GϏ=?z~GϏ=~4=?z~GϏ=?z~GϏ=?z~GϏ=?z~ϏFGϏ=?z~GϏ=?z~GϏ=?z~GϏ=?z~~GϏ=?z~GϏ=?z~GϏ=?z~GϏ??=?z~GϏ=?z~GϏ=?z~GϏ=?z~G#GϏ=?z~GϏ=?z~GϏ=?z~GϏ=?zh?z~GϏ=?z~GϏ=?z~GϏ=?z~GGϏ=?z~GϏ=?z~GϏ=?z~GϏ=?z~GϏ=?z~GϏ=?z~GϏ=?z~GϏ=~4=?z~GϏ=?z~GϏ=?z~GϏ=?z~ϏFGϏ=?z~GϏ=?z~GϏ=?z~GϏ=?z~~GϏ=?z~GϏ=?z~GϏ=?z~GϏ??=?z~GϏ=?z~GϏ=?z~GϏ=?z~G#GϏ=?z~GϏ=?z~GϏ=?z~GϏ=?zh?z~GϏ=?z~GϏ=?z~GϏ=?z~GGϏ=?z~GϏ=?z~GϏ=?z~GϏ=?z~GϏ=?z~GϏ=?z~GϏ=?z~GϏ=~4=?z~GϏ=?z~GϏ=?z~GϏ=?z~ϏFGϏ=?z~GϏ=?z~GϏ=?z~GϏ=?z~~GϏ=?z~GϏ=?z~GϏ=?z~GϏ??=?z~GϏ=?z~GϏ=?z~GϏ=?z~G#GϏ=?z~GϏ=?z~GϏ=?z~GϏ=?zh?z~GϏ=?z~GϏ=?z~GϏ=?z~GGϏ=?z~GϏ=?z~GϏ=?z~GϏ=?z~GϏ=?z~GϏ=?z~GϏ=?z~GϏ=~4=?z~GϏ=?z~GϏ=?z~GϏ=?z~ϏFGϏ=?z~GϏ=?z~GϏ=?z~GϏ=?z~~GϏ=?z~GϏ=?z~GϏ=?z~GϏ??=?z~GϏ=?z~GϏ=?z~GϏ=?z~G#GϏ=?z~GϏ=?z~GϏ=?z~GϏ=?zh?z~GϏ=?z~GϏ=?z~GϏ=?z~GGϏ=?z~GϏ=?z~GϏ=?z~GϏ=?z~GϏ=?z~GϏ=?z~GϏ=?z~GϏ=~4=?z~GϏ=?z~GϏ=?z~GϏ=?z~ϏFGϏ=?z~GϏ=?z~GϏ=?z~GϏ=?z~~GϏ=?z~GϏ=?z~GϏ=?z~GϏ??=?z~GϏ=?z~GϏ=?z~GϏ=?z~G#GϏ=?z~GϏ=?z~GϏ=?z~GϏ=?zh?z~GϏ=?z~GϏ=?z~GϏ=?z~GGϏ=?z~GϏ=?z~GϏ=?z~GϏ=?z~GϏ=?z~GϏ=?z~GϏ=?z~GϏ=~4=?z~GϏ=?z~GϏ=?z~GϏ=?z~ϏFGϏ=?z~GϏ=?z~GϏ=?z~GϏ=?z~~GϏ=?z~GϏ=?z~GϏ=?z~GϏ??=?z~GϏ=?z~GϏ=?z~GϏ=?z~G#GϏ=?z~GϏ={>~ _`I%&/m{JJt`$ؐ@iG#)*eVe]f@흼{{;N'?\fdlJɞ!?~|?"g?O?o߿_W_kʿ?=_? ?ο___+%'/ 7:W/=??ooKaw߿W q4G7O\e_<_9s?⿘ o>?w_Wo_w5'ڿ6ͿFcow>OwY$yO$'7/_|?cEoϔ__;֟g=CW?6?0_μ!&#?Xog6@.og?dom_:'??߿_/}/O?|0'_9~]Hߚ='IkZo}~)ʍrb$tB6_W'okoFW3_΄[_7S_g2 ?OӍm/U[wu/ƿm?4i.`዁o0_~u |yEA>|7]9(m_N~ʲ _tĜ܆o~L D_߿g_U '9?c?OK?#1}[{ llLdM (_׳o엳-?r-o/o+Ga}W?)lл }_g_c?Ss7 a ;ml?*:v xs7-òccKhkMwAFŸ'0mp!F ٸ |mn_7vY5Wݏ'E?oۿ~[~jC=5?=O0? =`ol9>/(ɟǐW[(75-7'`[rWɖY?[} ?'%[?Y_>?HOܦ߿ookv>'?trȹ^"fSC\ތ/hj8[/Kc?F1N!?0^s+= /n_Wn.KyijGǏF;DƱ y`OS@wo=z.7lĐx0#x௡= l0_8}[lt3?O؇[nl=@_KeϹ*[oj;??e_??/u_۫?;{kso7.6m忂?s?M+=SWl96zS'_?m]\gOwmO|_myэ__dѿ/ [_=z;y:CvZ=37OS-?/}(=C63XSkg_?>l@L{{ a/?Q_q!?1OSTǺz~ml3aMl8s#Ft䣠CG?ϱ4yvsx |M>g|l>~EQyu;qd?Ügo3 +[{/ d6c7Ǻ:b{yIO~?_o'/OS}ߥuֱ?QS.# m_5wl?/bMBο;A [[Gh|fbGGz7[ƼC cL6sw3Ƃ5o3$M2 y=d 1csꈿ v~77A@FG=ǺOmS4@KWЍ/;x?$z(w>>_sUZg$B>#E w ;ֿmcyy{7+ѿ׿g?~lj7-lB~6r>Ō#pG{޵hwC>zw(ddC_u?g?Oo?ؖ/Wi [+z0lx???O/$[?7ݿw?w߹ٷ$"y3E r-pcwS)&ɿH}ſD~߳_/m;'1U^6-z5Ǹ>ߠb8| o[ 6}V7|w>r W0񰙧oy=?$?2!G\A'.7wSG^r vc?[GVtC쾯/mw_%[ƿB:ԏs5MDCsɿo9^lb\O?}_e&vs_E'?8}~kltmc5۴&~F_9!&ن?O_ ㆞B i]=ȽWEUCEwww'FZ6 9GCg 緁޿?g>=^ŋwߠS1{7C(0ʿ_ssh }$ŽɰsO=CwĴ/#{+~"g?,?cgx<>֌֡-tC ^wv&/.|)g# 'Bn~7xn z?~/}iiB޿ꩿo;rĸ0f>JȻ#m:7: ~;ï7ucW m/y~K?mŏ_a_~_.~?_o_?} bWg+WHwC3$S f?ODwg,Y@BmzOſɿ8qOO#- sXoK__;ֿq# m.)s ]|>C!_ѿƿ??xggنr{^}}RP|Q_o޿?(Z3?ʿg57G vk7E?Guj֟ XˀX$cs< ݇B<z!|3 {# Ÿsw3V':&ZրہX'܆nva ʡ7/9S/ѓ'G?͛ouk~O_G6Gma8wdıec |j?uܿ{ƛ ">gh?/ؗ!|+eο/ٿ?Ka.5?'o/?w____O~S|_'w%e)X? mK(wWOpw?kߔN:1S-nNݰο?Wњ3GO=m_FXcM?}u֟kx?^,'~_"%]P}ֿBG8?O3٪ys|?Gkh%q?17ט1"'ϐkGNq6|;- M`-3 ] t}h~48`wa&\??Ec ?woO_FE?C4H/C1x_W_ۿgX'ȥCX3m<H~~"7u~m@쏜C>%ʑSGX+Qlcm?_w}8~ :ÿC?Oٵoyl+@d_\d[OuOuYW_$]ϥ?d._??O{(O0dkտgރ~߂qC'2ZGlܡS]JM{g?u3 F8?pF O>7--1'? Ccc.?α)bL?ꏺQMch>Ebf?9i-cO _yuy|[f ?[c?)>|G90D_oǺ}߯s翆~KM>3숝7ؼ?|g&x9zG\se_9 /R<>s? r~~_?1o_Aqŋ{~^%|i1x!Eql7r9v1k*K?u$K?OZx蟣8Dɣ-#AFS^~wMÛ;_:q[O/OyzA|7t>`z?8?r/oOK__7G)< _?_3'/_=OE=T?Z?cf_|bS_D???w|$^_OO_&[ Fm?lb kXE|86z:3aǑ@|9)<|wC{|%~G,|A?_~Co?u;-ƾoGVoCoȩ_!O;/#W Ѻh}o?|$CkbnEh:4m`ߦM#/Q>kXw/"4[;X~uM?4jK51'~Y$_YW)OInZ/'L>IQ#OZ9rKw,|67!0S;MNr4_Hf188rw&--G_m?/J?? 9/ [ǰ-o?z0?rJ{S_z.?_kykO?{~{)/l8rQ_S~χ$#i7ʹDcu=5ۼ a~@>?y?;b@_NoDc_?[ {g~`mv#grտ㿲? 71_My_/ otYWGՑ{I/cMq g)e`;ֿMз c>si*V7-6:1Gʩ[Dw /7XoyL,mp;gЁM]ʻo3kY~[ ~?_E+?2ݐ#6 E[={߿? e_k,/K7?6oo5?6mKN?ԱF1yW~yoZ|D"ZBWA'ɰ==|=G'O/E6vy  !Dއ|88[8ȉʿ>r 2ŭ>N~CL|>_>=Xʑ/O?h= ڍ&Ϲ Sȩc 'ȩ9uk }k~'Y69u/}KO<D';]1[^67/nM_Y_'QwyMKK_/hMo/8o+15~/|{B< ]ݶ]/g~oX?Q! ]O_:)؈y6>,x6 6u7- ?q_Ky?SdC޿1/e?v6&{;ֿ4/}Ol}6F LvvX :u9l2lLAq#^5޺=wmnl$ ;͉ 4|~_ _cӜ_?lk4a\6oS;9~@K"Mcbq?nr??lAsϐO3k_F1?}?A~yߎ77;??(/9^OEoM/??oܒOShd8*vWU1^.O>|6?_?G9o&;V?Og66Gmy˗=w7 _5o䣯EpL1%t)#a1rпasB/"|¦=}#?S?s?m&8yXذɴ/+LOE|Q\|_§17&7a='u25ŗG;4?_dO??- 5e+6Ro"99毕:?p̎`ozL,zco`>7dɎr?v (!zݟPğ~=a;/6FVs[8`w,qZút*.39'1M¯?#Q>?G^_f_oe bzx'$S.G@~c)7+aMN&X?Mw_ȷ{O/CW[?t?0Lx_Uos_>2Y:u~ooO;?5؀߿o߿Ưki}Q |WQ/r}~_׽H#8 䆑/)_3<4huz?E9k?7M?c{(o €~mc#F>aߦ79w[X1/5\cЫ@1|1ߤ#i?v??O~pN\N@N_fGMbqS7ɩ1G|Q}?3?E7= _ҟe݃Ǝ?6_/|o3ޟ%WXiM/ O$^ !yy><1ޯk;Ǐ8ӧOwݢz9%ZE[PgK9_a`kK#7kf>r,ks67X~:,G9_ϡ"moLN6ϩo?!_ȏ??hw_DzA<=o5EпEOS%]t[4/5?(/t?}_wUk?S? |M!{noJOR~o#B]_+ʿ3?nc/?^R}YSѣΝ;of;/|sSG\9<_doH~/Q?u2>z0z7?)Uwo'ݵo䲡󐿁M4,`ͻSk)$9s>X;s<&sߘS/(oŸ!=w?Wg]]d#/HW''/-!_Nٿ"?o/Xo%]p~S??kM>?}?/\Dw[{wm_q_Kq=T?g?{_߿G?ᅯb~&{?k?޿v#|R7M_EDmug}vq؏߿)gfz>C1̿G6]F~~];ҿ/eNHO|;x@S|?Os;οk&D>L6-?saȭ5gȷ~is9]͋da#: C$Êc?m )&g7-ӄJmK37=&sߚS ω/pw￐_%C4')p_?c￝lmWi~_I_W%J|{3^\{?I:/&?s//MoQ~_'8t}_#˶&Z<בaGCiʵ~MGQ7ڀ}F}]XS-O/^V)]_|ix<@6s bE8<ȃs(>A ϛ7o_u9/PGǔ/l4l˿+;>[ov\'? i>}oH;`<ڿ>WI/ooq^לS sS:?B6gߤs/q&nbqS[,~'d3iZ.ogF??????Nwo߿LsS݃[d?;O?/Gw&ɞO߿_[{?o ?2l=P? z[sznc~o6ꫯxvooߔbqk??vq7W|7Cau`O'k͟OmkÞ#o&wAkXAmw bu Flޔ3xL lkͤw;l>~+ M:ry'l?Gvpσ,ZXnA9HNbb;ֿg)r&19ucbyy/ﷴ?'_{_pn>?9}__3v?;/{;s\ڿʿ#ʿF6?fn32v4߿/g?(6pdQg7?{>O߿3U翠`!ț!Xxc8 h?OkWq̄<.'O8f#?5лЗ?_&-V =;W3/w?so3z0`aOa;ywc9\;mswȽw>0wk9~O$ #?b]珠uOc?dGc9"ֿo;&ցo(rN_ao՜?kN_-_(~7=&Xϩ57g3`=̱v{q_K~7O:̿BvOb~7 $ϓwOg_/W;WW^y(O;<ݿ__B?G$ mg[O0_'i_?Ko7ſr߽/?|[/ [ֿG7w?f}:sa~/2gA&){ݿ??w߿?W__/տ_;_ۃvvvOg7~N7lt~GN~_Okx`ߑ};C?: 1<|K$ڻ?ڿs?soSbW7~N_/%ou޿/=?7=?}?žןgqE_K/Hv~A~Ot+},_FcWq1o?߯W?oǮ/yί5>&節(C? ?{>Exg=8y#yј??/E ao߿o߿s駟߿pv~|؃,6H/b'ԎodO3?=G???OA~eA^7cz7~3_3)wʹx<t7@ 9C~?jNo']]921S._ͩlSO''6{".??OʿOֿO?S~忡?ByX?4;dQ|AkZ?3)WQ~O9F??߈?zɿ?ߝm<7> |NoFz#7ɇke3NXGH~6m={@ru9|ϧ1Le ަG־yBaɈ#>ǺxA~.֗~.tmomοMoR[v?_"Yks??Ua}S+9?2 ƚ_/nbq?~s G/?h=/"]'ocWޅ?I1ϯ#s/?G<<1 bbW<·_W?+MoG`_KԦ_/%_;ov<ל wl?F{? 0_!_Q^&'1̍aog)߆D_ ߦ6ߥgϞ~GG*ﷴf7MH-uߏ篦u?6;.OcϟRn_l?_'v+: 9A15A9ֿb?zW}q>g{~Y_' Ew?/?w_Gw~c?=59Zk?(o/=E _''o_G)ߡ?{$A4C^oo_wݿG5ckoUm=۴]G?8b/n?s?3`-ҿ/lG*#ƃ֋}!~i~!?O_qG|z[_K|{h-6kZ.` ڿP=y?5M/ I_+Vw=G1 ?^_KO6cbq?nb[9)w~؜%A?B/y?AvgOU-k7>)?#i}/_G??׶I/EoZwClEf?n+V~B}rWZٿ?O_~~4oCb?z6V=VgSLaws(nFwde؆:lAs_a?IsٿLq<ڠ6O\"#>_ls`Zo/ =w E5»o<7h[ ӟ#gњsZz6ovo?&^ߟ_Sij5=?_lb*_ğs{?wd乛S7s?Ɵ/Қ?Dy ~?Sw#L_'I^O[GKH)Oӧw (.^> ְ~+??d;nῥ5a߿?ٶm6_y o{{Fk 7h?X_ß8wÿ7'z6_j~_CwO31'7WW.?Kv6 d$Fyl#6tv`cv;:>"6 &w/| :>>vgmߓ~ɣߞ7?!^y1>o d'Is&rN_{_wg_ޞֿ"_?Φ[SO]?O,y4w+k3Wq8/_G?q/P7 ^cVbG?b+?_ٟ_ ?Ӄ㙓D,vB9r7m#o?<=/oth|?_)WGIw_?W ?8%o1E5?0o3g_?^o^G"GvEk(_Wpn 8y}8__g@/zr}_ ~YRkGQ:EX?ȅ٬G})`Oose'?aO#&7(ϐ ;[MB;E4?C^?|n?39Gv/)Z߿75~ Z[i-' 7ڏ=?WNMr{ᅰd+o&_A,ͩ=_mO1_^G7}_߿dy~~_pw_~r,M~)f_~6 bnN?o})w??{к?Ou/QϤ\_>7~>Xќ?w5.d:R:(  _j֖s/oʿOѿ/"3-(V~bniwq{yn# {WX?g~fpLv63??1WGM٫oC}r;ʿ%7Y?)-z6z+);('?Qly?l@yu!xf}(> gnp8rA\^x?~so߿߿o߇4g3n_W,=ѣ@wC(__?;__/Wiſn?]__ RNeogO7w&;?V;ߟ?_'Fog_PɆO~ܿg{h oF^3Gn[I9#Iz=w~ȵ>Zs1_C=~@n#~_/?lR?s_+`?''}?o>k7%;;4/~dWߗ¿y8/{GO&_r,'S^,Uol SqZpgOC/ˢ9ź/~x@kO?$B_s?v6O#G~/)(6lwq6_R#y63 ^s+{ggo߿owޥuv ރ=?zw]~u ۴_L?lt 9N_]aa?r`?{'WK;z>)}/__AoPl{#?>=='ߗr8)7dy _ٿg?x=/? K^~.|CMgwGᅮ%cMO4^3g}~Go[s_߿"[IU=?z~|Cr[9{^/7gtҟNvWbr/?opc_Eq?>~k}H9~ eGobUߦXO*/7[?KП?ş Z/66{`W~#~gFoSv5__y___~cAU}o[o}[h4d=?z[/O?gЛ||̺?7kﴖ~|NӔtFTHN[Mco?oo!T?0߿-??HR?cz_~1g__,%llL:6|?7gY]_W?F_^Raoo ¿տYV}oovlUuAĹ{~__77 KI'woW{/bZ/ʹ;?|~_7#;?~o/{ލcڿ?O7_Οml֏__~{X?c?m{M9/m~ƿ1AFoWU)ʟ±|>?a]?GGݨc/ɿW?o-'M>~*_7o/CG[Cvx#_><ֿ/7_5??F݅mww^6oJ6+/ p~to7Dk[[[|t?x|| a7=?z~l ܘ eٿ_/zM_>}ƿw˟+߿;ӟ3W}56;}ooxLro}J&;ʿȷ_wo蘡kH]MY?΋4r)Wߑoن-W߿=_1ٔ__ha/#ӣ)0'?_{>o'guE?hs~oXD|O~ܻw'cl#?۟)kkr9k |/gο2Zx[SWK%EQ ÿ3?co{ogowooo'G^߿{nO?ՍG7g[ֿu%3xy!->???OXٳgW]5?o}ƟW9l__@N?Oc ;=ֿ'ߡS}mWODkOoK_O/W_n7ww7/ow?y#Z7Mc]GDw~@/!o7MϦ>oϐ;-Gl>}xx_7oްsyyv ˲=} oGGm_x-6OO1Ϳ<oKW??>_.c_{[[~}'_Kݟ;gƿ{=y_W9z7_{? w,19wɓ/<ȣAnfF#>::+|\::> [c3c|['_w܃_ڟ???ohƿ}@6g3[Ɇ77#/8ÿ/?O纍L?0_E_C??As\}M`- 6ȡOFy7r_'e7GwĈcr_2X'c/ ?OS9oyYo5 o_+_ol?K~/?xm8bmoWG3F./w_G;o/`} 62??~c??4#AľoN>}( ^ǚlmhH=}_F55&b??FcMO4lM=?O/K8. ?ス=έ_94 뷙#uU]οQ}_L|X߿W _QGdmu?_W9Ч&?oMGLuq:o?'t?36r?0O3%D.~;<?n#?Oqg?\9~/?`OOOoîAᦶx_c_ug_ |/KxrCС~sn|?Onos_ui3LCF~grX=s_O?'?طM[ğ?O~p|\(Fh?{GOs_:?O/yWk?[_'G_jaef> X '~w#뙏c`a?O`t_¿/Ac?3#7q?C/Ÿ?@#-AoHW_^OnG=+8(Sc?#oG?t(b_7?'/oiloooK/nOu||^_ އ7Qž?O97ރ <wrx=x!O{x<܍6c3> >!YL ~꧘N?zfotmxG? ru?ʡ?Ko[<3Ј+#'#oubҟ: v!ねƃ<&/?#865pLއ9xL>iCAّEce?GkZV {X oWCKc?nk7q;+~ů?e$Zֳr<KҿĹ78_jxֺcl:5à W;􏾑Bn6OOoG$Iٻm.y#0co/@A9~C?Goq5ul63 vv|S r  ȓ3?m; `}~;rF9^_K~>ҏ>o>@ +d'I]^:n 3m, _!?r'ruu6hϏ~12+ʿ}f|;8Xx80Vx/{`7ς1y3zmxGrCnl6x䍝iulb{_&ƿo߀{n#_owQǀ?3?'WƇ8G^C=~vvvOŃ\3wc/;xυc֬L~ ~4lϿsdKπo{9EK tEoϒ`*_&__.ٛtw-?-?w??K???_: 1꯾~)0MoE9ş?)miI@Ob-^kA_t³X,xm[uBz;|[#ncWX#?s7ݦ7Z1XW5:*Ta?+AbnY⵿?Opw/R=/w=|;{h%.ۿoooH__o@?Ocan|?ַﳳ3֓?c[n7M8?=~SJf@Aoc?ȡc>CGn"17G{o[k9;H_ͤ7} ] {?r_5kOU ?Q^~so֭??zޯ:ίc᜜L޿ֿo߻w 'Opy位Ï>ß:|Ÿ:xzsc٬濅 F_W\ho匡?_GۼMo"sd57_}|B?q;lGzz/ "6(c~xfu$abo_ _W'_A[?s@,6C/'?#C~wo Tv\5-{S4 r?{^_:9 ,// GC/K^_'rtg:>s eX#htֱ|u?$Cǚ r5a#{zYo] _Ws gu`_?5b7H| \/Ϳ??G\?'_kaӆGGgGͿ_%X!7`"/ O[|.ĉĠi76 GPamr#'h/{agW: |x|aΐ,N8___E__gO4}AN%[`]'#Cڿ}7!{fAL}yqqzk-KnU7,?`_YVGq/|d` r3~g~g￉,"7 [Eo "k~3ނNi zqyϦ1_/ꗱ_U??G 5sg?,_Æ=Oct59a }qKozKv`sͫ8?=b9H qm`u#'c3vo? kblEb kI).MMJ˿NM{K//!-?s(gRJ$?omyuWO"Zb=1Kʿ俱~5ҿ,o=zE_x:-_z {'*Fo?fyW.ě_7X{E# =\sy+?;#ƹQ_+??kտ__ӿO3Q8.>C q4l=Ւ-m '8'pLwߐMo?vW/w&Wb Ol}8~a F-%|I 7.+0G$"o#7gRrc|v` ~>?LɁ@!5lџgi{-&'LG+7?SdnvdC|[?D4 "o P[ߒu_oVރ/w9p0f̿;<>>w#mFk9e<<4p}{XK=G{2p<6GϏzуyVQ١k}a~/eh=a//O_+/-/տ_)#^h^Z->GE?Oma ˿˿l_Q?߿[TK__Gl㡇.ŠΟ?OB8vbo7)nS#׎[?_߿oS)ߔ_)_ =M PLNu;1xV4:|GoF~/ H||m^/>۽޼ycG?xbs9X??zJqFC_W 'g7G9+aۇl91??c_G]fm~6x?Zw9g/P.%ĽX;_篣?-9; e_#BNĬ_/ k/`Nʿ//b&}di}O -ys'{ &~ ҿ/_0GϏoݤ7?O}`#!X[V@1{Dk_Ew?{??Oq _7ɧz?6rb;]߿?7០qq7!a蟣'ĽcF7S܆|]dKaS)c؛7(g7-A{+|{S/ ￐V|?b?9?Ich?y7qW^탵{zEa߈aǑG~_5_u>R Go?z~l>GݤgNZs?_o/}7aA_!8o {a?OO1dcZQ]o2߯߹s< ln?w߿ۿ߿&?3~zr~<ÁF1;5mv|  4B{?Gk؈`ߐO_׉&(wkE{:>`Wa9wL~:$zD9ᅨr{{!ޔ7 ?s?(ͱ7?r6oG&omЏ{!slO;ֿ-_ۃHP$?O|HIp? oZ7 Ӛ'|vZ8j~;NF}#=;tW_G_?k????[;dZ" w~~7M7X@7= 8olx濙mN5~_?]~_?& ~6??c|~f{}~%#ICt?/UN?[/SPl_uF:c?A1=D6/?qs -ug{_$Fok:r/":dG,ʁi]O$[mco7cü7v>>lmWio)ĿDIoGooȡƞoc;_G?_W\%r_/‚>;߿o kaasEG.I_~篢>(_|x?'ٞʟʟc}?ux{"?o?WK//b' ^+?Zml?b8G^l'b;oxaC{æ?kX'Z9.tZ O7.%ESD/(oNs9{#~XO)/Nlɛ7ɛI{v߮"; ;|{y~io>o|o~rn֟gG7ox}@5f/9/n! ;/ǚMk񫣰`SٿG_n$/_r\o; #Hv?ݻw_7;FbOy֏c4o'?T?gU_5dj#gN/4S,w _C;RN9m{#?'u|b޿k/?We{{S347546y?OQ~s?Kʿi}Vÿg/'~ƺm*> 0-?z~Mk?{ )_G}CUsJ ~Sr~^gi-z>XDNGZMoÿOſRNb;< r4l<(#io~7aa?gK~/ϥpgg ik8 9S?S o?M%F_/ __?E_'O('X[a#g)me}b?ٗ)W??r._%_D?m?ypdʏ {ys{yo`?"/vwكntf?}<#F;)><;woR:7)7%{? ^wscu__?߿oK9$z"FN6л钿t?3lȳB__}G{#C$#pbwɵ7¿//(pb!DND$d9={z |'][#hkד=?Ac_;2$+wH(cr)6_E1 R"?\D15?lysyvv+!nܐ톞w7ݿ??ǖGoWc79oZ8 A7n`_?_O1ҍɟ&'y?ܨy'_ro޼/E///OOO-t/SI "#F{Vk__k:bu# _#Z/p&$?[bhm 2zޤ{Z{H.=_9Zh#k)oWE{{n??S,rPGjysx7oc_γݿkͶrn7o+/??1?g#n#/~W6xdӇ/M_'to[</I+;_s|یuMV͓): Ŏm}ׯן:{^m=|3ƞ_gϺo8~~W(} +ZH-5_u;ڿbok%|?戣$)?onb?VboΛ.o(ol9?ove{oK#w5?7?W??^?(?;C&nl~mzog1X]~%hq;iYo[kݿ 7~#'e=?٦vvS(X,;ο޿N}_KZ xocG@_?OCRo+*/bs?bo [IgۼG;̛Gy7 -l/_r^;hw#4y/wg???{o~_*[m@6zml{ſ/?_8las?aZyLϻwr/A_hGo_Wռ9ywp^owp_m'#G{/oտ)Z_qN!w1Od9hH??}m__%_PM?? [y?~Gw7o(ovk gg_ol7bc?տo/ɿO???0wo7b?_6_'_By>??>3XCmHmxwieٳg}o@#>R^9{?(~>}Զb?~?۶e^4r~ػZ֯e_Kҿ|5Pu]c?z̾&[||#?OFok:O=-1RY7:ʱCy?˛7??ʛ7Qmowl݀?Z5c/mow??Gon~+W"Woƛl~wu~_|aGo@kXc v}qoۜzďgu/9l6l=[jϿUćosރ?A ٻ_siG?z~|S~^77 K1?Ϥ90?O9%ּ)om?ݱv*u_{_oA?g}l?9p'> /_c) z:?O߿x6/c{m9(&~B??z~|bZ7_E爽7omGl&WCv_örc/絞o/O??jտ8W=O}k{7o߾'~~_F?=xCz?rXGG??rGvմ.׷$ķmvj_Fvֺ oV_?o%O~:|S>i׷zV'[ujHncۻwa>o?9o l/ nsݿmjl݈[7?k~/^gM?ǿ /?'OWk?l;[ŏlGl=r=;w_WllF?aӧg?s-M7_X;?eݿFۍ/g???_cv =ߪ__Udvc&_GKCO%)K[O?H6mw?;?Kll'l>?zv7?{_[ 3~O%??c߃΅^ƶ? yl?ÁOWmұ+vﷴX6?_ oWQ/X~̗?/'?0;?x/[g???+ q_?g7O$=gh1f_x?O۶y}u,X_w_9ݻ^~~?;;#mocGvc;foѿ/??ޝ'K??~`whodn?~+wC)wK^,'~ U(5~Mmߍ .q:??wY/..?9a[W_;w߯_#'x~7lm?+>fAcevul l7ֺ7no?';oC/O|?@?wwa*dzϑvG]XK/?w?ſoܨ~_NE_ ~]gYb?`3oz}cۡxJ_~c//ſ???"p]}lO/7 C^{~qg&GO5ȯm7MGߐ{Pvojl7ʷ_?_g˟X?{owkOvֳbW߀W;_.OO/]o3_giw^oҋ~H߿ʿ޿ѓbk>WA=w]'OK?೧OO_?Gss\Ͱ ߿o߿߿oqnmgui_A?xW}rr ɿkڿ7Mÿ#??M$zp~ŗ?y?v?dgݿl_N?χ~?_/?O?3/=?oEf[omߎ#["[ol_3[;w?}9O/oSnd_o򿺱}`׾o$yo>f_:7 73GԶ #?* ~aXޟwʟp;mȯ5a _珢F?!18_o& ƿ>cѳ>Q7?َ?_;xS']}7o-zl;dwm=s[׶7?l?|WK/c3oK{_WndcnM h7Űd?{$roo@Voe/S>/>݃m~G.&xCW9onwXxd}?ir7~3 v} xG|~||lnco//>azؔߝr#O`;_7zra/}C}^;oP .?cb M77}?[=~ [ol7e=;[7;)??ɿO/_+?/>;߈?'~a(^%S[o߿oߝ\:oȶk'_r?9}Kҿ;=ůb{ =hK/8??Ym8l5pEq<;<*@n"?zy_ʿ/?y?%= l}Ag֋a{Vןpc3_K_{?'W+uoPJ 7%o J%n+$doο߻ʏw⟈ ^"x wy?{)[v>b0dplsflkQKco+G_?onS?֯?y(hcb}N嗼F}}Wl1?@^_WU?z`)7-wd"ywo u7 7 o~'q=_I9s?O6+ol?6?/O1w'GA?I?w /#o}ٳӧ7>oKNX??kZc7=#VS#)ҟu_kXzcf덝mF[i?E1ŋ/[~_,O%?Wy?w/3???R, 7~BWō;3?SP{SE)oOtā?>_Z)'Y&?iƿ_e엑}-~?<[G|öOz&g_q??ٿ_ݨZw_7_Wg'G{o;o[oo:c%A^nlfGG _WRCPZi8W\<ڟ֟gYyH\?O7o_BkVmb热?>???WwOGvGm__Ll]Ӱװ۰>q?D'g6_^o~$9vwɯ'I,o AoFG5l1?3__E'$x?Ww]v;a<G_[yʟ]_|ևG<{O:??O/{[ &mccڤߧv! Ik}r`?&m߳/77֘ο^t:/lcx/_:hg}ppgWUG$+uo߾eXƯkywY{o[kif[=_֓_mzq?c~O/oK7~d?RS<E1A2fψCZ)w5?88r#nGw=q\~w%/OK/)R7!W^QW߿ _ ro?_%[+ d_Wo[k?oH?ܹoq=>o GL;(DgrƟ'QnOh_;? [/vR?Wo~y/=o3dF?t baĈ##VF,6)XGqűupձ>3><>c?g_CsK>Cy/Iveg EN_Gc_k/r-ϟ޽o<>xb'I0՜?wCgſ/?'9πw0_= `U' NyMWmWd~}{~Ϛ.wo[WōGn5 k&ֆ:Xlɏ`~ _yj-ed{_{_|_Fvo}MV?OIﷷX7<OO1|Y,?Oɏo|^|?O?O7GwU'?g%|o?=/^?ٿo# ?&{ ܍a9& ;{?pχ_WtlI|S?)>G7%{`A.ۉK?Üӆ\uwsxx??yEXG}ޯ߿oq[~9o;/ zfێ?c7y #_78~ ?Ocȕ66r߿򻰝3σX?uukat< Uؚ[=}?O?o@[ƿo2/^?#7y޿?F[Kؖ?_ٳ恭C>-_y]İXE }>99@ ;1AlC7a+_W1<~߭ЃCՈ<<7w]'a=߁3ƃ4#WݻwyOCpOu/o=qqmmdGMߚXd&ƚH1ƿO2zn-tɏ?^GOkWMpb_dlմf?X69hĹ&S?KҿWGɹ/ l>x9֪MXc5ɟ/ @o6bڏ/o'#mokgF>?Hy۴Muc׫CqMvv76|?OgdM?XZ<#|gߴӢ1wŔW#ozG5 ]os 7̉/o7us\ߤ|3uJq*Lyk3ŰɰͰ~ [MmX?c(?}Km7o`|wtoߔ?FS+ *j{5o߲W}m)=G?Oz͹\챶_:NqD~?O3???oߏ=ywwxKۿFp͍)?&Em{gc\_ }sO3LuI6з71l?O|krrFx |?Co$O9f?!nu,o| ~'Iҍc/~2?|ӿOE/+?OS=_W_7OϑWGh?#_WbhSM t/IG5}GcyƗ翂l17?O9t? ֹ7/#]#~i 6$?m|?3?x<N#8}2' GXkG)70`%HGa>+dDD. ks>O=w7k;ֿnE:׿KLr\4֙~p,fի~iooК< ߿߿oz_ߴy?37M?:<' =ϟ?t_<ϾGlCPֿoʿd _8|۰ `} I_Cw?OawG9Kҿ 8ϐDnߴM_WJ? )_+/O3??1K=lywbʗIŴ7237!y>Go1 Ɉ#`_oG#Y@| ͚X3@~9`0q?>(H.gbLc쿛3b% +I}amGwت7 _5>?ü~f֥}M|_{_Yq"'⟰_ Z?$OG<?=[m>Ǝ U_l{=n٠~o >"p]?|8 >˿I?q3֨#w_׹cc_N1ݏ~կ?7 OO߂ `-ksuut_?O4&[w+~2h1O9|_B$b쿝׮c|(~c{毽m_?g) ?k6ԟ?~*ho>2~~jps׾_#H #x>>~A.6 |!yַ xMNȡb< c k?sEC5ϠOSԍ{W_)?k^C)[Q/ϐ [.o16ܛb/%Ʀ|ԯQG721?+??\4KZ ;g߰bW/+/N>bѿ/K/^pl}/?;[[[7M8rs爗r8%x70 OOv:ַ .KwY/bm ݋Xڑ~??m~:h߾fmχﰞ_m{o +?!{9[c5 16ab rGϏrM<-_(ymаӏ=Iҟ=-?( n=~y5 D_k/5n5)?sᅥ"/;oF>->>-Z{5q'm?Cy0>hG;딯gb;hؔ4)"1?bl]Gwăy;!=P{O->G\ж/Y?_A<s4m̃x+ ιIҟı9<8lJ9-y}|_gl Snn'F;S?J9_}țw`<['a9&^ᅨֶ?Fk9AM~g?ò?MnW"?~;?nN?;v ?;kտoژoWwi?6bN껼~~G7w_/ W9`bw_7M5=x~ ,b?#nڿ/0EckrL9l6b{(Nu_~=$ 0ؿ=?z~|!&nlWWO_Yx~$I`h_ oȝ(Gt/_伿1hMG>k61G{ֿ>dG GϏoo/OC=7_װ.(ˍk͏=i`!sG婰6M_#no~~ۏ?=_5??_WiֿoZsCo:.{iz_5޿Gp_P??z_qc<GϏ1?#oL̎C?h?z~0rl {οڿ??1w]G_5_6o&e/sL9q|]#OS_w??#EhSԍmn _ϯU$oz޾_e7?y.&XrP_; +_7ֿ9៣5<]jf-s'G;qsd__x? cQ 7odO~? _wwr۷y~iVv||_17?w3׃u:G?}C㵨?wh_%ZwFlx;NZ{kY#?Dk8_hֽ͚aKKncϿo7|͏_^_]]7`]~_#_? ???O??O??m{2`~_|_7?Oy}0& g/_y_FysK >1?GvG[Y?mʗd[W?/3Ǝ7r:G<墟>}qg'm _Ly?O7wk 1yh߰!A߃<8<yp7֙u?˚߅5ѭYͼfr̍o0OeC _5Fg끟Ѷ3_Dco__rb%@_=_7owwurڈck_?}?Cs?C9)Һ֩{ʷ䪾zS[x+{k~r%~77??yK˟?|SS?şk? -~߂cc#.'ȿfwxy8#rttda[.//{8{@/~ߌs} Ưk>~/%?D1:࿟$ ςㇿGc?mUU?CgA +g͟' m_e7kOvao[ވߏp i?׈awL֬^G5kMwݴfifM9yu/6p~}<1od_?_(_?BJ //)l}Wlbalg~o{q^w?~~߁矣9q[_~c( {<zzQy=#} > 6|Xǃ{'CbGOʟ'n_Wxz<#o돞ypK|9#+s?5F֬NZn]G!__$__A{VK!7G&\w5v`1֝K >eo>~_wq>?O_ 4_WVCΟ'o7߿yM7 ˛tl7l=)q'{I i#^͚??EO?2Бwiy,m?e=1!1簹^`bdm5m8'daa?g__:mx;ro ߻H/_Go[f_˄Iߠ_w| y_<ϟ?xekc~_"}0c?9FkX0"gȿ#I路7m5rkg*?eֿ/`rgRLd}m[O$M<8ڿR>Xd5_&Z;r<r)75GGԒY#.Ol og!'4ao}0ӾqJXr5cx.#Oӿ߿o?߃'/>??/C7~|I?$]=PlOOf OD^d?Qyn$8'2k_͚2Gy_ |_-} '/nK~cjiΣJL4ߔro'M/9g&o?gO?vO6W/??7_zOMW_߿]ksq$X#\?moc S_s?r}g~r߼F_9vsrC'F;?*t#mG;m$/99F?Ǿ"l7 ϯտ6?z~l=r'1ԍ?~uTV AFe; {*ט%ObXߎ $(}͏=?[o}qQ1YE6rsd3;aMLsk9S綹o`?is}S?6>%9s؏X gwh_*2mGmL_ibcbƠ5|+cn?羱͹oiZQG__WnlGkZV g2hEw91v./}r?'~կʿ?Oů_7so ֿ>ÇM\Cc՘Zr} רQ??/6?z~LMc?Ϲ_\\??Ѷ5:/w߿WOShw~@?޿UدmLM9Fcj}\́"rs>f/o/_>1? O(?^?C??OXGm?<$_Qŋ_|m>OsΝ@?揺g~ILV^~]gcƏs9ur6r}c澿&?s~o?ޯaCw[kKο) Hw}zz?{mߡxg_WUw4_ƿ=_c9h&o޼ONN-o?OK6yw{|tVrWe9?F[ [d3&>b֘rr?)xv#_ omc;?_oSSI'ƿ'~ߏoꁭW߿ovckjkkm~߆~8իW?~cAO?G}~~ ~/}Dvg~g?,d}c??_ Ÿc?ƹ}<{r_9ŬփXɓ'_s/߉6,XDvo?4o%G|uy:{<x̷}~%ō ('?7loo;G+Ɇmz ~֓?W]5lرyG#?*=suu?5갏_N bd2ڟ1}WlWoDc_-ߒ0+f,_h? .dOnGDlo (coJ>_doo2HJ#-~a?}l_Iq.Z4IJ_\7!tXugv6{^s-G<~bQXF,h>GL8w~7S_w¿/pF\Y@5~ }?~>bzo[syy?/qb}+ʿ{ /ßoXG8ls{6ZѰ&kibOm6Z8O_ O_z筩}\2s[>_oK?xS2;#K롰&/ll(ֿo r ܹ߿)'GLaہ?#|' }v?za 8'o_v3_WOOp?`ҁmߠuu?_KX,x{6o;w޵r!XWx`#br\K('F[R^/G66w6GmomҮoF> ? ZPHۓ߿?/KWe?I+w?s9"[ֿ5r&El ; yǏgx`l`;g;?|c@y `??={9~_uGס#5 _V:o[Vq&9zme"ȧ?~ y6FWlgWm)Dž_s6'v2SHAM.?SIFg~wI{<>hur9grѦ z>gX7@l6| <Fkz:oW5q_ieߦO䍶o_~hg 6q666=GlmkѰXYW+?˗/?mr?O7/7W/(G`]%F_?OTZdo?za}~F[j]r'ߨFG6S z/?oe_tZͶW_zؖl@yrymdFj=dF^nFG.`&`Z4l4֢dG]?'aS c]oʡa Wo‡']GO~ߋ߱2П' im?=F_OCb?7[MnUk Fc-GwCK_i#76?%Ey5??ɶGϏsttDK@'??O7W7l%_";2+v όOfg;w6ynm_Wb[go3G;=Wcc9%D+?(}@?hiiQfcGmM'|տ/ [ֿ'O-W܍aa?ȳX`߲#\"F[?F[6+]?#w'ޟ_1M9ΟqG_EgGl3?}6:GG%N'^kڿf鵃Wilo/Oz?F[/3zPVSZ68q:hK>肵?ה20@k?dk^{6oњٿk/Ks?COoC}?靿FAWvx_uʏD/ OC?kþ/^߫WgC~}ANyZٿ3?k~o+9_?E /f*{?oq~Wh(&ȓ#G.=_??/ thcC^qHz~Gz Lk`> ʿ/"g'xrqw7__W_װ?}?B~?&X+*|~{ _G_߼Ǎ}+??'hm_wHgD#zm_Ń7u1@Gpc;?#@x}>#<πx~w~^_r~''?[_G7_Wmٟilgßh۶:N ;ܷ/2}!?9y3˱/?{?sa?×FL_?>wi7 /mw]m7MH1_KrU7u=7r8W{?lߑm+W^CyQtm?7~o?_R}?/^k\u_K~ Y?'-fO4loz%f~/A7MSL ?h4bEq/ǟ' "4lg}_{X|`0?f}g{kZ:zo&m+9?u~w?Zk_NMk\&.8yoo35__gæ? _3ʥWO?>NGx)>}'O8oOOmmo3_s?bկ 5I`n%3L#?;x8|{{<1V??wS'/+?|>ٱm'/ΰmx?G>??u ~/rqY-꿦|.GOR^ռ6.bkΤ K=[ƿcjoq)kyO@?|$ֻH_9^~d[K_MEOG`gw)v c){~B//_qW^qN2W_|.l1W_|>qo/LS?|Y~s/ cM6:<{m'b|ݚ'a -~ ygWHwo?WWW_e{ǃX`~߀g=Ə:<~b=wy~w޽}Nr*3l>58s $_Q>=?z~6Bvz;/p7ȟ_o#9Hf$)_+x~7s܋ZW#?s;zF3}lI/m\r#/xgY kXIl@מ:KOco z8mt# ^,k kSk9wFl֜]stq?NW ֜W ޿G9ұ6?=?z~|xE<1E/{x/j~~~zo4+3$?_Ū$۰x>X.cwm/_g~gd>814IaarZoXk ^~Ws OmGQmǏF^? O?pLw'o\sƚ!֜iʉ#WHf_~ה?__2ˏ=?z>쁿?SL}`䨰w_/WjMo߿7xSY~=1ĺGm&]ƚ;C>#ry_~?w77%wopPNc?{ލ=sحrџoޟrǷ?# )Wd߿k lF_)_?GͿm&yGϏ=;oտE!_{O]V?Rn6ϟ@?w?Ѻ_}ş5EgOg'H9o7~ٍRol0֚Ə=?z~ȍm~?_o/_n|o?⏰ohkZ~ů2 :g;xMk`?揾?޿oo?ވߏ=?z~qϯU6xW?7/→[= 7m?~?.3og聭46nX~ &'73Ű (}{ƿoQeYڿ}v,m[UUֿo߿;>|ha]'Ib?ɟIx/4Zǃ1wgm:w6='䍶'W3dhw=?z~㞿o[nlW?޿?_?+_?d\/W?gռ;mync~{؞b_87[}zzvOST?۷o-m3E>䷶;~eg&IQ:ίc?ϭ[)_իr<<޿Xo΁#?駟7?w7ql5yL~66 rX</^X__W엘>ᣘ>c8s>o6Es[-w6>|wКml/sQ;?Z7GϏ=?zoֿWߊ~vk?/ѿo?g(_/_S/d6֮?O8~/w?o_߈?w 9/ 8[>C}y=|_w07 QčWEWԎ`?(GϏ=?zn3/_c?_פ_ţ]WK?oÿͿ `/*ݏ7 C{8)GQ';m[Um|C?rC nGx_fۍWV ڿ_-z#n?z~=acbDm??K?3O_{5}hq_$?/?_?7}8?s/ 9cU丑Oc]>y/E|>%,ʀ_%9m˱ɻ=|' kʿ?F[TĎ7'#GϏ=?zn_+8('Jm:!_gAgC{o߿7'Q?fo?/?β(=c|;7.#~7m_po~{֯]̟31E9./ ?n߿Wr[F~GϏ7=_o_IY֟7o_m߈ߏ=?z~Þ+?Ci/sO/A[Gߐ0d޿=?z~Gχ=gҟ'9_@⟸E_w_+?oA[7}GϏ=?z>c?ctc??iҿ_5j?![_GϏ=~~c_WY-S?iʿWDm?߈ߏ=?z~Þjnmim_?w?wA[̍GϏ=?z>N?#ʿBOh/Q[S~`޿p#~?z~GϏ{~'~3(F[-eEmomo[/+7GϏ=?z~kow)nl?3'imm/e/KԖ;濵?z~GϏ/'?O?O7;A[odοs#~?z~GϏ{#'F;W?-[?nGϏ=?z~aO ?F[C_9hh?=?z~Gχ=o[6{Om?#A[[F[O_ōGϏ=?z>u_7wGhw6ooGϏ=?z~aϯz ;ֿ?F[/GԎο#?~GϏ=?O7_v?_v#~?z~GϏ{~w luʿ4h?h.?GϏ=?z~h?#oοFmտF~GϏ=_W> l_Q77m_7Gm7GϏ=?z~4_Gh-x#~?z~GϏ{_z/K?cns>f?hƿ}~=?z~?~/?coGgm_WU7GϏ=?z~K?F[_Ѡ//|+dGϏo[ݻwIUWE_mr?z~Gea)'`???Ohhֿo=?GϏ=?z~3???O?O6?mC9MGϏ=?z~|1S???O7//_+eԎ3h޿=?z~Gχ=?3?_mm;KO/o_ר-gv7#~?z~GϏ{o67O䍶+W_s>d??ߏ=?z~~,6_WSOSkA[?àO'F~GϏ=y_?O?OS7o_yԖο8h#ZgF~GϏ=|?ҟiڟm/eQ[[g_oGϏ=?z~aÇ S?Ͷ;_%jh_==?z~>(?Ǒ7A[F[ooƍGϏ=?z>]~%?l?}_?sԖd7_WwnGϏ=?z~ao ޿?F[_9ho_?=?z~Gχ=ί6;m?#A[~z?'7Q?z~7 ~q~gտ޿oo?O_܈ߏ=?z~ÞMlQ;?;F[Oc7͍GϏ=?z>I4_*_WԎ?GϏ=?z~loo6mK?/ˍGeߏ= l_Q7?vo?W8GϏ=?z_ٳU_Fο9hF[wFGϏ=_~u`/?_oވߏ=?z~ÞgE'q썶?W__l7݈ߏ=7=?GϏ=?z6?o߾/ Oo;cv?O7nGϏ=?z~a7Mwoh/|܍OA[__gF[UGϏ=?z>Kҿ?h??᏿_v?O+GϏ=?z~|''lΟgEf_n?#~/ k???Oh_+v?oGϏ=?z~|/毱w3 F[堭Oof;ֿF~GϏ=,;kd/?ow]7GϏ=?z~GQk_?O?OhůQ[wݠoF~#s~_?O?OlC/GϏ=?z~|szz{d ?(do/Q[Ӻ??OGϏ=?z~|sppWem?OS' im-/_޿ y?GϏ=?z~|'6OO;W_%jh}%?#~?z~ GϏ}~wl?C1<=_6hh_=?z~Gχ=o6Ocm?}_?sԖڿ~#~?z~GϏ{~_lwG7_A[~WwF~GϏ=؏X`οo?S?W ܜF~=~l7ͷ?O߿WߥMg?GϏ=?z~|k`o?ꏸK?1hh?=?z~Gq`?_w'oFGϏ=_><< l_dm˃?qGaG??<_Gh_6_nGϏ=?z~77o6KOcoo o?7{_oGϏ=?z~?'q̍??oOhFGϏ=_./ 7?_uԎ?z~ѳw?z~|7 ;7'܍OCcv/?OӍoGϏ=?z~|S#k??᏿~)?lwe/KԖ{ֿ=h?(O߈ߏ=?z~|{~4=i`?揾6nGϏ=?z~aϯk ?F[+_onʿ/݈ߏ=?z~x M`I%&/m{JJt`$ؐ@iG#)*eVe]f@흼{{;N'?\fdlJɞ!?~|?"5~GGGGGGGG????????Ï????????Ï????????Ï????????Ï????????Ï????????Ï????????Ï????????Ï????????Ï????????Ï????????Ï????????Ï????????Ï????????Ï????????Ï????????Ï????????Ï????????Ï????????Ï????????Ï????????Ï????????Ï????????Ï???o=?z~=_=?z~=[GϏ=?zsGϏ=?zsGϏ=?zsGϏ=?zss=?z~=_=?z~=_=?z~=_=?z~=_G6kGϏ=?z~6kGϏ=?z~6kGϏ=?z~6ka=?GϏ=?z~ṍGϏ=GϏ=GϏ==?z~v?z~GϏv?z~GϏv?z~GϏv?z??z~mlGϏ=?z~qmlGϏ=?z~qmlGϏ=?z~qmlg=?z~sGϏ=?zsGϏ=?zsGϏ=?zs#,v?z~GϏv?z~GϏv?z~GϏv?z~~>?=?z~ğGϏ=?z~GϏ=?z~GϏ=?z~GϏo=?z~幍GϏ=GϏ=GϏ=#~sv?z~GϏv?z~GϏv?z~GϏv?z~|x~4=?z~GϏ=GϏ=GϏ=ϏmlGϏ=?z~qmlGϏ=?z~qmlGϏ=?z~qmlGϏG6+GϏ=?z~GϏ=?z~ncC=?z~GO G#?_=?z~Ɔ?z~GϏsGϏ=?zmlWGϏ=}~Gϧ66+GϏ=?z~GϏ=?z~ncC=?z~GO ?{;ѿ߳?xgG?NMnz}?yre{!ɿz~|D_V_&??pg =9};4d'mhlw{k-~|9~g4Gޡ/A_7n""ҟ o}{?G~̼-ѯphk=?C2>n}> N2>dj`/odkx??J>5T wǿn??: o}w1O:!\߲ Cosy3?B[>#'ݧ9c;ߋ}>ӿHsa1}\ȒWo[n[o΃}?m.YFc7aw飿Mb?k-7#9W>/hqo7N޳pY}O~ oX23"vgţcuq 'M]~ow~v79[o >bp;}M=Ïo[ w->]~5ߛ\??y8Gf%}|ɯ\G$O'?14zyOa(ПMsȃܕ?utŷ?/髷/AWGoIdoktrK !qO%OmGJ}QRK-v~ -M_~g~ l065> Op._м`.hGD>[DGsiLÏgشе KuLoJ5 ~dc)ۓm0v@1x~54鯃Pwx;0Ϋ/}O_F~ u?{{_ Wאy>C^U_<A?pOT08ŀ= ]k2I|{ӟ~{oϟ C.}_vf={]؅P؟_5/|=4'_[ridkxys΁oFgȥ#BNA_c,'?G ƞ񫉗wO>?M92L?u4Rޣ|ڿO_CV?oX  5TnHG@V/`{яޥ_uMw_giGs~ONCw-WoDZ0y9grpCǿFޛ|_Aޯ!:7*'>.i )R5Mmd?"_Ͽ)?tB\|~"_C?kn~MqA:yu??frw~;{s~G75Oe`3zE_'<;/!z1nG_kHl]~:// ɣzKC&臘?Mv칡P`rA:c\h Ct|9é}e/c. ?G>45:*~~ %|g@{ԗKK_ΟG ?V: B|9|A9hɾ2ǻ9&x'/mY~q{9˜c6gg_Cm}w;կ2IGwع1CYKsƆQ7?O|_5d7C;ī6?>}|X!}wm%5tM<ƾ3)>EF'{)}gvo'lL7ه ?9h [? #g5 ϳ~{–>u;lOtկ!=7I#>hk W$:7 1?i<xaʞ'I]OCsҏ_c\XZwyG_E6Ako~Z|אx׿i6dϣϖh?] ~AmKAZ|G̊83k hS vK ֿiC1|NGըW3֑۝{賿0=-6hN?F ůzO1=(OB4?04B ?3~ }'C:>a>{7~7}|_KϿtN}o5)R|?ϟoο_E&[TG{w~%[&79 _S~7xkr5?zƆ_A <뫐%b||ѓKV%G.(0Ȧ?_hboQv?clߧO! ^='?ooWߑг =')17!qoCqWZoS23>%{h>,g^kM;_LE-xG lDӘOm`gx> ~ m3H` s?QM733l > ^l{.[Osvא52O"?`|{[;~!|+wC/W1w!po1whm*kȼst_aߠ+xxrG{?KYKg4n{&?ǴߑO_Q?5_Cֶ~<_}LJ2!Oeroǯ!7zr{ٜG#^Uӯ!qnAgl=١?_#3گsnۿgr_CmEl_C|?C!q`Gkn~1 +m w=9>5Ďאߔ|hmb~cM_(ahlO<0ݮ}ҝ['EJjd6:oGbWI{{ s~ํ Cr<>&Isw-^w77ө}=kD_#FN7~};кو8vMĿTwא8"]1 gxq3ŞMe+8}CL_5T֓>ІlwǸv?F6ogoM>.fmD_6>|XnY؇vpOkSl/R?ֹ8H yC5~;5a =O1 ߅Ļ_fl=p26y~ -]㷩s[o7¼?Ř/36ӘL?Fg{f5>\?ɘׯ4ۿBۿz0I_;A# Eg ' K~og(}6 < O?6~אAtocWC(?@/S~?0l3}vawnMcϼy;߃q0:M\O5$>ÐGnw5~⹍ c ֯!5D g?_[O@a[Q` sÑEXumt>9'ןZ`| Ïk͌m?V/S?}owϱ1?uo]+d=ʋ}, @"8>G}{>xElDm4| o)5G_Co89mj罍'y~p) ;ÿd`wocs˶?F{o?1>IG|NvѿdD c?~uvҴk|u8zm>? /kH7zOσGǘsKnhEɏM:b1Ooۀ>Ws=b35oجא'=>IW o;n; 3QOw k^hO" E?ӭs翦XQ7 =A56'x>Gn<~7/ǫv\sJ'C ~q;[7fFG gDtqG9jw/w;=ݐZgo@KA-ӯ1'>w1[Dk ~ov{S5d}-[X"?wF}7? y,c^&AA.ߚ"p!'oA,zs~H2σ>ȏGx0Iwm~}[OsDr)qf_{fe5~⹍  ys#ik5d okoO~ ݐA!>bCG>1C?5$|5f?V߿5DNO \?1ѯ~_CbІ'+GאJEί!}}A5$v!w m_Cү!~ 0.o ?!7|(/hc_Cp} ߟ?7 Gß?|?}n!-5Wӯok܁_`~ Gk}7hmcm[= b1fLf@Md1_C |¾@_L }5||gdџ#4mA?pr^6X_o5DtZKa;~7~ uxkV֓_CpF፟5os|; -#m`~_Cl> F{tЃ>_CL,;_Jh|}o[F <~ m}kW1&{@&>6G`C 6>_Cp@x>_ClSc-~ x \;9ӟs =:П11w\`~_m?<_Û`0O|= s3 =4c2S1}~~ ~v^k=ڙg;#3&',LNSGw~GkH5D^nxdg~ L<_zZs5tw~h/809v#N1kȚl&Gϓ66+\GϏ=?5[ Y5$GϏ5$_rm?z~?X!v?z~GϏv?z~GϏv?z~GϏv?z~чmlGϏ=?z~qmlGϏ=?z~qmlGϏ=?z~qmlGϏ=?z~|av?z~GϏv?z~GϏv?z~GϏv?z~G6n_=?z~=_=?z~=_=?z~=_=?z~i????????G????????1????????1????????1????????1????????1???????z~GϏv|~4=?z~uGϏ=?z~GϏ=?z~GϏ=?z~GϏZGϟ6kGϏ=?z~6kGϏ=?z~6kGϏ=?z~6k~㏞=?z~GϏ=GϏ=GϏ=~{nc;=?z~G{nc;=?z~G{nc;=?z~G{nc;=?zϏG6kGϏ=?z~6kGϏ=?z~6kGϏ=?z~6kg=?z~鹍GϏ=GϏ=GϏ=#|v?z~GϏv?z~GϏv?z~GϏv?z~|~4=?z~mlGϏ=?z~qmlGϏ=?z~qmlGϏ=?z~qmlGϏo=?zv?z~GϏv?z~GϏv?z~GϏv?z~#~>_=?z~=_=?z~=_=?z~=_=?z~~=?폞=GϏ=?z~GϏ=?z~GϏ=?z~GϏ=?z>ѻ?zv?z~GϏv?z~GϏv?z~GϏv?z~G~nc;=?z~G{nc;=?z~G{nc;=?z~G{nc;=?z~y6kGϏ=?z~6kGϏ=?z~6kGϏ=?z~6kGϏ=~mlGϏ=?z~qmlGϏ=?z~qmlGϏ=?z~qmlGϏ=?z~6kGϏ=?z~6kGϏ=?z~6kGϏ=?z~6kGϏ=y~4nc;=?z~G{nc;=?z~G{nc;=?z~G{nc;=?z~gmlGϏ=?z~qmlGϏ=?z~qmlGϏ=?z~qmlGϏ=?z~/sGϏ=?zsGϏ=?zsHS??d5"?K93oARJO(?'`oOBpo w5n}ww5Z_#mswom;{೉׿S-;߽MGϏ={&#?_W jk߯!ooSokWCwC?5g!{{D_w5n97b6?5d~o]~ov?5i?FFh_GϏ=zO~A}~ ?_ClO~\] kAo8 ~-_EmRIZkHl_v?5'_ m8~ _v5ħX!v}dCE?ƛm??џ_o94~<$ Q5$}5$7~ u/5:O]ǿۈa%kNo5$ޢMk1 NFMĐgcS; Ie_i!tO ~ 6!k 5א5 kH^5P:=7g\M/`oA !p=ckOc 3hn?wgݯ!`د!k"ѣ |?<_C?;]kH^o#mlGϏ<~ 4?k-йW; ]kkл9Cޯ/n}~ !ym~ ǡsz6'bw_bnt~!65D׿5O~ ɏ{eW _0_Clp ٰCt?Bٯ!!9[~#c6~2אqh`k\;_C7o˯!Mӥtm=l.qBHaPZͿŧkȼGpsO)L'~ /6kGg? +~אq򧿆غאsom~ [5d}5$f\A/.lgx`a?~!1)ݯ}}k<['ů!fk~ ?0[6k8ɿ= ! }[^bM5o~ ~ V_GOgk# 2{5d0&m_06K Az8kZko6u_CK )o#ͯ1GϏ=y?a_b_Cּo6;݉8_Crayma?C5\ܼ;9?k.~k zo@ߏ w5NPn{!O5կ!6q!1`|kk Y-~ [O>ki~ɯ!RzkȘ ??&?47 ;`ù=k~ӯ! .ȯ!k5x'|o> ?45BlBW ¾5$_CL5n#FfmlGϏ<Ư!5$J~ ~BѿHM߅-q{716q5Smk2__ ^~ ѯ!> –kHl}&`O_g[ί!~kxA׿אz_Cbא19vƅ_C]mn.awaRm)\~@s#p)z5@i[ אk~ Pů!k }ذאz`{y~N诣I oH[9!>ŧF33~ 5±}kݿkHlcx?o5ƽ6kGg0abWás_Cא<אא5d~ ѽ9!x#p3}0_Cֈ[ 5Ď~ؼN!11_kȘ_C k=Gs@1ޯ!8b_C #t?'_O~ YOmzk8akH~t_gkп_C}ㄝ3h0 Xn>L?g/p;B}[[;Hk-2;#!/5ngYGϏ=zaK_C_Cl߬ؒ_C__Cb7ķ~ۿF̯!k!yj-f%!~lyk8/?ߗRK~ n'!`KS{wkȺ=ށw5O5ξ5Ğ|k85?˷ahǷsgȯ!6/5dmc(ۿOֿ_C^'˿6K9 61[! ~93~ 6|E~ ]k# mlGϏO=?k !65$_C?y_>.׿Xak~_Cl!8lZ_C-ڠא8/~ 7=!65VGiG=5]~ ݯ!q}v~ k6ރ !6կѷ@tאd?P]Cli;>5$=}^_C xc^!8տ0'<!\xy^˯!8_ígO?c|א^\'hyC5$Z ~ۿDɟk/ G__:aky׸G~_css _CltO!~A]ͻ_Ců!{ !z7WXikb׎o=!0a~!+k/lpb@O~ _CƉmxw翆Z V;<ٯ!;Bp~l~ _C!_C~ &ɯ!Sop5Oop'LRatX?;~ Y!}|iKW!cOݦ5&7zvs[qkMMz`kqwN@OkH_i6Ϳ!}/5g͂8Norot8l/5vڡ[ڠ-y<anj~g?#x;sq0]~.lt$֏y /@[]~\ӯKאnw}C[<7ss=?z~=_=?z~=_=?z~=_=?z~=_G6kGϏ=?z~Ӏ `I%&/m{JJt`$ؐ@iG#)*eVe]f@흼{{;N'?\fdlJɞ!?~|?"5~GGGGGGGG????????Ï????????Ï????????Ï????????Ï????????Ï????????Ï????????Ï????????Ï????????Ï????????Ï????????Ï????????Ï????????Ï????????Ï????????Ï????????Ï????????Ï????????Ï????????Ï????????Ï????????Ï????????GϏ=?z~fݟGϏ=?z6v?z~GϏo湍=?z~G6v?z~GϏo湍=?z~yncw.GϏ=?z~fݟGϏ=?zkc=?z~yncw.GϏ=?z~fݟGϏ=?z6v?z~GϏo湍wGϏ=ss=?z~G7\GϏ=?z~S~?{N??pP??d_f?DC+?}N~ݯёoHUy#췡>.F\~oYOѳ sQ?{Yg+_{~oI(__G ٯ4mxkMlܟ3_;J75o~_>"~[wW[9?>iInM0~ cө.ߧyzo_\?1o{ncw.}=$|㳳g~O|'~_N ߞA?z~xٿ#6w_>;/7=~6}?~_?ֿf_J0Wאy}-<{SX?~'V_FߏJC ='#/wg;ӓ{ޏ_E9!aĬ1h5?{_;;_whhNoOҫ;Voi$KWo$oφg>?H?fI_C֯! fn6v?z O>_B:IB^IjwZ|^@w~_!%?Bʯ!5dMw5d5~$}^&d~o ]?jG߾|?oc^{+O|ףE $/S/ggdw:s7I~^LBgZ</(bgEgGoS~ߠYEGG3ƿq\}?{O_km?|f }N~-_'>s/~MX_['ߓ~?~Ft=~ѯ=G/m$o os@/w7oڻoyoT~෢]wh J(G_=x#/ ={̫'k߂b߅~_?L8nߛS'}m Q_%oW]ozѻ)_@03ky!q~_Nio)/+zzGۛW/(nM?_Myz7ww~]~_u]~w~_lkOZׯI;V>E]?".o5kWB78oyooh}%W7$o:RG?O?"wwqf?}>xWS~<M a_CN!T_C~ZG 1ےn{2\?.I ]~ss}f;S饧C6$%Qg~Kc7?9݈~̽>ķ.D8lE?v/HoC~G;}o=.fN4?0g!'>M~O[rKoIp6򈙟>ߐpgsHC݂pyA4_fg{Ec7?=M}4o1O O+A3'|2[omeǯ~=߆xqS>r?Fuy߼vٳ_/'gקSn[/$\:Ud+~(WۗzA\m8%Y?%\㞼/:4g=Ms֝.Z[umwNnM{Cnx OHV3^7 ӻ?ϓ?ߑ5A^id/o_ClL~_=('\S;!\C~L2{WG?&?U?;2' CA_Cb]~7 K~~O}zliO6~E#! ,gꋇٷw[xK~Nsh^Guȼ%t9Nz7yY?߇ǚo%}h|h~MA+߄9_ 7%( v/ߙvN!8?@~?xwQϒO G?L?&c&[}hMM!]̞w~5D_C{kZoXC&AH|o} [?Az'|FchwG+7<\|G~ ;@"O?~o{'!{$ _Fs9c'pK7_u [߇`okjWs^C!*!t&<~ ~P1s}h޶UG wbU~75!kt6?|y)A/7%Erg-ĺPaaצc/!}ߑ-_>[f'n*o?'{_o[(y/ OP_Am ~/?&_#C6U?@z/I?)H>y hL#Hr\o ?yƿ?~??xo_F㝟"w(OAw=x`J:ϡӤcMߑ_G0~]w[!{P%+ȹĿbFY Քe5<[M绿_E">6ߥ_N>A޿j_C coEhvR>o|?Lԏg?"\@ )|5:5z^3 s<+$#D;_p#<'jҺ-uؓ@>乍>JsQ<\}^CL 7-5&~{X3:7l{n{>ف'oƏݏi O%7oOw@EߢtmAm'>IQtnߖruM"&\w)/SNWאޏ˺v{sODVmcdS(C^":+^_~_k]!yhKs{(Dˆ Y!EE3NvܤKId3Q*z#^oox5wiOтODH0IoW{R"Kͯ!675DGdG/n'WQO!{?S7$_7߿oE7:ٌC4u'_yo$~ ߉[߆+?xh|ۿo{>Vv7Kʋ @y-xאNlww _E6ӳEZK'^|_$ xvn~5l޿K?nj˺;/B>y_B>_E>?D#.-?~CkQů!~دkxOO7'bbhͯ^)Iȏ1ywqm'WP5DokSR#97@_]OO 4? 佉W~5x$Kz;o__cZ=n/) E$_̷w?|!t9ۦ<IՔՔ?)? O?)_W#k?o9"<>%ecҭ x^?|/~Z毱kAkk}ܿBNwCM6?&?V g ٱ߇V/ƼWOpc_N)-QFOBz%zC9K4F/X~o3Nx'mhDkOO57W/'eݏLtw5B(IWDzW!w~Dz_Ct9 y5׿f鯛A8J蹨M"A9\L1|vw (~wo=m?p~KIί!>/͈c;w^&_&zlA_I{U6y?q_oLҾ| 1OGb?IdBIIkؿw_{SJ2(oOO/xMse<;#w__ÿE1x1u6<G>Mߓ=ޠԯ:)zMwh9_~?߉o5ҡo/O{oBL>s 9=x#$1܀sO94oX_kH|x~ncw.ml=od&zOs%/~hSy_uL9q_5'M3G/ O2R,M ?PiI qߣ5Ŀ_ErFV?㗑;_JS6>HoE|1̈́N?iW~~-=Sn/Cdgm'm;ߡ<Eѿ;ͯ!>6|߁lo!/qMcaw|x/&qҭu[OOO{75D?Cǔ$oon6'?;]!C:-*wR%;-xxpcNCl?EWӻ"__K7Ů7_:/-kޠgC/?F>F8!v02^!q4g)g[O>6H/#WlU/(@/~_+G-/=_Ij7ZI#~A)(ſ< ;^H$Ɯ/o'?;o:|(O{_@M -|_Nv5سra5* ;iU;)#]GPƼǿ6?Cg ݿ g[ۘtɿ@kyjd&?i4GA?8Sn Ö?*[ ݘ&?RN9_Fr^{x"3:QǤ'F=Fc_i _#Qufk|;6(6cE>ُt?D^JG수 y߃!okO;@6/$7%o^H'XkF}.иW~Bv__ _ӿ?폢E/a&\w+~9a՜J$__#_#אx??mh5o =h)j_D6"zӔG79D~q ؿKGopLR,\[[Rd6C9WIu/јgeCu/ݘOO# ֯"_A}ی17>#W?5 */"~oк_O?y ._ !69UžO[Kqz=ww1U_Mk 8ZsN~kZh7?'7)_Np_#E/m0&/?c1=L˖KK`-}>eg ZcC>V7 ?{bWT_<ߖH~BsAN:z5$Sv;_?6_{_F<+C@O?x{O?+(X!ֿB:ٔ(M&Yof{kCg Y97??G#o+MM)Қ@ O6AؘDO !בWoa-闑uᐽ?W9G"O~G-ϝ$;IH7h_Fv \_S?)N_f~M!]gm/%|_[bivބ{j~~ 1?Eq{Ә/l ه|_<? 190/5$05d okȚzncw.M#d~m(g~U7~kkLF3bjvbAo?n?&9֮9gaO;g6~pA{HO{!7N2 Gϱ-?iWa1GnZwp@E0rW ]'##dbmyŻ #{O~o>!F|@ ?7nϯw[?PW ǻW䧦7;`Ix*}tow4_&/O~;,'q#Wctē'z~ iI#ۛ-ē4>ţ_~мy0C)h[&}5=灿nfw~_F}ܔacx|z/78'~İEI ~$F_)~ͲqJ?k5ݟC6?l30&ٽl/#+mF;+~7%>?('/'=b22B a?b1=bW^>W_n!gﯤuoۍ-4|_OKH9ķӴfLNwmOgo/4z//|{w&46d M']qM4AuW~5wx꿅rS߃o{rx(+oߔ{ `@GӜ߿0Ø7D~ܿK|1'mOq;A5 ZeC q?&{+~72\7k'$1$#M0~%olI6n4mwyP^?#&W~M8+}}_œۜ9\:|M#B1|B2bmO9jeI| 7g7oAǯud6|9lwo_Ssv?5D8/$אl==4OlG?|?ct||H)_OhW9ȺJv!_ kkHLn_Lh1G:!ow[ߚds m 7~)/ͺ1Ϲ/'鯢kw5kO5l?EZOωjSdsו/_If'~yMIۯ5EM4OI7D1wr?x߃w)G|xѿ5ւ9lM0())&Y>0HdowƸ['_!p㺿οb_M*N7/_]~?:~ol=_O>N:yc<.'濧ΰ1?ۊ_VO/ ~G';'nz?c2kGa7k\Ƈ0?~rxdѯ \~!s~ǚO5BXi- t[o<dp|7kאx]zץ_kH罭'Qd<_Msln2 ħX_6P$'~U?[X{o`s~:kO[7s7(?g?%~ gM?EJӿMsM2>~di_٣.wIFU E z4oqG1yn?IXEw7/7$Jq:b&p@&krH-75|.# h7WcޯzZG@Nw?Op>ry!Z)v?~΃ 9_+hV@>ͯ&WOcgd+cA6zl7_$vm > Ҙ;br,_NxadLk\o`_\Dy_Yg.dpiMo4GW_WL{skHU?+CJߣnzrx~~7҃3w- ِNy?([S"_qw_cv9C~_Ivϣ\_M#[};oOz W7zא|¿H-/$/Ѝ?S~_I5_zl?#{nX WB`ELt񀎠y=M6'?1hmGʣss ocs?~5_Lc?f{M}_n '#J?}rgj}Os)?)dyo/ k?U_Z55D3Gȯ!?翆#J-5ݟs=ݦۯ!&]אI'YסX<|W}|짱i+LW>w[O=[M$ۿ y|coo)5do[E'Hݸf'}H=ml$s[kHn>ϿDi %]+n5a:A|~h7oF8Wɯ9gHq/;~EH6WoGk֐y/ƿOWI_7FDi,b\_8}_Qf<__^=V/;[_5vU?BH&ugZC_K~{L޺ߓxMײW 7D_y dkD9lwE}|uF#Wf`Hs?mn=`??S,F[OWSW` NyGශ} O[>2a7O7;owI/ߕ2?~ri_!I[k,Gy42zc_Clcu?1-A㿆&_mo?m'~ ~كu_+Hߞ375\'$;7R:y~Mkbu%?5įUiۿޞ}RW4N?@N~4_˜aaack|iOOso7K(gFKiC>M1aNZ(en>ek;bG/uIi~qqO_IoNz $|'Ow_[[VJB~_~%a)'R'nr*%V~H6GEߐwí_?#x68&.3 5*b_M9vYK?OD p~x'h;5Ql| )ֿq? }D|xO==xȹku/W/k/Vs̑/>_M ??5$b_Cbk_>_#N=_Nz>m`_RN~7{p`9⭿xo2?QHf9WoM<_bkE GԳo"nO]xq|?ͿkȺ?EG W\ οJ~q=|dWn./Cl|oBt<&:d2{L_9Crчb_NaHc1t߲;ų.4N~ůг?N)oo̽{qklY_~[^8cȿrSN*) uyW>a6o='ɱ=!wmwn凈{,Jl˯D&Ѽ;~8mc{ on o8rd}jϘ?)o(Fў!|~Ws?tFz%ࣶd7~,IdKʽ{Ր_L|52Bh]ϻN@ސrMMp(?/PAo݆+IW=ֿ(\y3[zďtr8|>/NNN4_WR\~??>n]{qvz b,H?ߧG,;k\}cch1#C @@hkL׈4 OOw[6N5֓-./S!IO|o{? уm0II 'oEM _;Oncw.zj_Ilkz&7o~򿧔#η&xx$Mvi |dgaJ>ZZx-޷Ϗ?0 $?N~7!ҷ6~ ~$- χ}@,-_|W<4;ݿ17 8O_N(OqL5i9^1 ~Duw//z8"Om#R?X$_W܄7Gcp1kאy濆:7dss}6gOoNMj|;?dG3y~%),߿%OdE^H~mwo(./( E\^?/)6Qd | [OnȯbL__Eb_CW)'ǿ;S/ RL{]:?o?&Q+h}!zOFOX }f7Q_ߢ߰ m?#m~?p7c0Co+Lznz>9'M:뷴&u3YAE~gocٝ$+G('5_xm:.?ϴ?>&ܰ$7p Ww%Ǿ|i, >M1/.o+HwߒPJ6 W u_;oA/ino5NbOG ~ ^[x[;1q?^~xhmW1_-?B+Hq&?O([/=7ņO+)O+~M/?60㤜@qr0ٓkw~Wwo"yhW=F & M˻r) D4G&hoijps_o;;=%oޏ+]o $;rZu!_7?n+D ~կ];w滏Cٯ"\s/3DȦ!C4W:o46(kHN5d5$kH|[_Cyc6vR>S_ꗑL4my|ֈH3oھИ> ~>gׯ' wOx+#9gl;~i _գѯ@ޚo t?Bd%z/p_ҧW}#5$ԯ!koGѯ! M~ YJ?=s?3'yk)&w(ot=η`IrMGI~ |?3#Wb<@_E !`_\Ꮴ_H-3aJo+ŢWt_h4 r !(obb_߳Zv{g!? c^f]6w9WmW>WM=oSźT[~O/w~۟W.oY[Ooʇo[JZ5ӌWGloFl u|wtS{gC'G+-$ƿ?ODgGk7Ӯ%~g))gMeʹ?~rB:#ia]|~7m#̓*|L~KܿN<߂H6~Ր_xGZ/#=?Q?vǿiK?IEs5_ <-%=|pX~  -?~ ݯ!:5~<ݟC6Ny|d%_Ow2Wk5={ēIk %^oIg3-$ӿWQ̿E1ȿWId_$?x_wM?|d>MɎwy//.+++_E:#ּL?ʗd{?MkHD Ư oJzC/å@>)f_Wx .6cwmffgQ߻xvZ`}J_Nv!? D>Js +MOg<9t,p1w54G%_O2_K|7?wQO1Quo[^_~N>0>'+c@q_һ)?Ǡ{t4<9"1Owc?|Ư"ijw_Oo2 r7oN?)nwDz~3NsG==biDE_ g /'edÚHs;%,q1gxth>ƾ+$ocI>?L}D@eQnNrI/ۿ/C,_1~):1y~ K^m'[3OVx2u#ko?B/NW`?(^^ z~Z2Z͑79א5$ޯb5Dyo?=o+O{/'_5KO؃:&2 hz'1-eQbBs6'X#jvKYNE?~ ƀ9cmN&'o>#D0}-Ϩ?#IG?Ig?Guo`*D_A>_:hLkۻk@C!7F?C,@qdJj!1{ _:7|A_I5_C~;8?~ 1O ǿϥ!|~15>]?uNjkN/5d5$gokHv5zcFaίk_a >;YtZLx55d_Ct_Ak!3w4א]-')?5d-/5אo`I~ OŸx}<0]02ο?o5w9x5o5w_͟W!՟kH.O'kɾ=s'WNBc`W?E{~ w[!<wiR8xw(6s4@S6kZ5"Dh_n06MhXFwK/5D@_5 sGގ>?ѧ%d_5?"!5D`@_Ja#א {=5$itssx@ߒ-95D+9'd z ~ >;~ hXxR>ߌWߟk? /<_C?~j>5_Cl5>U :W '~ _Crq{?m_Cִƿ k^ѿkHկ!zE1?5FƯ!?lO5Do؊zkHů!4LH˿ٯ! ^{8@5d ^fl?տ1?kΘ[_0.F9c }5g!'!  k x p٦wSߐ9K ?Y_Cr߿אy' ?D/N/9,b>_Ѫ;~/( o5D@60~ hw0vgȯ!WDMbt ¸_CWi_CtwN/~ ӟkȘF'alC7dG+&w^8sdt|k\W>5V~ w֯!z p_Ch9>O~ k__Cr<೿IK~ { -_?3g՟40_Cx:0@;g25wpfW Oœ/O?ֿ؎?i5$7|95iկO~ ?ѿn/?~ /s5ү!t7CΠ~“=C?kM;%/g9~ x!F|fhş7"/ bWГ!s/5N̯!tc0| C]_ChB?'^A5.AWGok^~o칍<ۏ_C& 7'27ۯ!z 2א> !M9#<;_Cw~ I'ī ++pA_C/5D_Cxw DpkX_Ctk F_Cxr_Cl>  8w770V_Ckv!k߯!A {Я! ] 1!s X!bR":k ǃ9~ k]א\h1A'կ!4 сɀ ׯ!~ 3>X0&xb̘{-aſtկ!4E2ˌp?!v׿%b_)x@Uck!~_CBd5D^_5BSW;ڿk_CWѻ_C xw~ _߫?A?b|D_ M?ݹC?kx'~ / O5_@i1vC_5? Mӯ!{kȼ<C>5dހd |1b!Oi_9?>:  i􍹘 ?h_Ct~ u#~ 1k[|ssx@_אokH<_Cx_CreO5D6臯9E z5&@=>5f}kn#ί!8O~ e!wk>,CЯ!m ! { :5Oko<2>L9_C a܀h;:o5A_אאxZ@ga|ݿ_Cz5DGH}tޯ!s` 5DF1&!m5;"!<[_C|Ω ;c_C}/ů!osy}1|>LJ^ax;կ!;~ CK?7_忆-)ƅ15$zk!wGϯ!g~ 9x~_C[_k!>_㻿~ %x65DN^_^WA+'Wd Ż'~Xƒȯ!}b1b>5~~,  _k=1~_;>_CBɯ!ǿk7 2V'G b0O]~1B/5_)xh !stk<!~okH5/6vvk}-~ 7m߷ [/  S!|?oݟˠ+"Gepw~_Cp_Cl|Y 9&\;+/5Ķ?kOZ alk3F?x>85?06   a m} 8_k-1?N?7Gi[/ p1.ۿiאk܁ {ïS0!s |ɯ!G?~?p_C|& ^B{`!Kh'3!t b>1/o~܃!4]~_Ch~ 'vk aͼ4A^k2"/v~{"g7s^33>`A_Cѯ!4A~9zkn}~ ?Ǐ_/m56א |95\rZ1GO~ _;ן~>5B9~?5D կ!8&خDC~+g +5D^w,~1ԟ ~oο p ~Bc>~_ykmϭ_Ch{n=265D/ٯ! zv/Ass}{[27 ڀN &5@(z`t8/~G= g[_?0gM}ځF4X+#/~ ѕ!myĜƻ/{2_Cc@_o3'ހ,~BkHL{?= _^Yo|ZV-.MzoCCs7ok=~S?~?>{"S? ]}k>et75D&_C#~b~_Cx 8T?6W}_IkX c-~}#s7xk_/Zmt~ 1!< ᥭ_Cs@kfO_o2Xݯ]q_b 9»k1oj]\ktC>~?~8_폷+ٯ! t<4`/, ~ g?>dtf9|'/6Sɯrm. @K \Ǐy%0Vhw&t,hz&hy=0_? v  l5o?V0gW ހbH?EaW#/~ WЕt3~y= K|5bz7 n`~~ %ӿ~8;@S.75Vx73>1f`N_caG N p.=y1obyu}:}Z[]^1oh .h@c73G; ? ~01πڿƇzncw. ?)h >|AAwk\E?w ~~okoi]]k-?| >`~ fhcϋOo/1q1tӠKnIV .?v.ߘyߥGw6sԥ˳;+o3|>.ua6) 0~_m݇etDLևԕook1)7FY;ct60ͳi:قM<̜ot?3xtӦo?te$F!Sp6]0uic>>/7ߕ}yѦ>?Y~|9x OW>V``!XClzxoMt4o?,Ms|sy[bOb8}776mi> >&pz7M۟6vc̻K$F?3o5Y]? ]Xb {;6.<V3g(:/W7 &T?2Mv羫n>ouy`h6üߕM{f7iHnK.?iC #include #include #include class cbSplashScreen : public wxFrame { private: wxBitmap m_label; wxTimer m_timer; wxRegion r; public: // A value of -1 for timeout makes it stay forever (you need to close it manually) #ifdef __WXMAC__ cbSplashScreen(wxBitmap &label, long timeout, wxWindow *parent, wxWindowID id, long style = wxSTAY_ON_TOP | wxNO_BORDER | wxFRAME_TOOL_WINDOW); #else cbSplashScreen(wxBitmap &label, long timeout, wxWindow *parent, wxWindowID id, long style = wxSTAY_ON_TOP | wxNO_BORDER | wxFRAME_NO_TASKBAR | wxFRAME_SHAPED); #endif ~cbSplashScreen(); private: void DoPaint(wxDC &dc); void OnPaint(wxPaintEvent &); void OnEraseBackground(wxEraseEvent &); void OnTimer(wxTimerEvent &); void OnCloseWindow(wxCloseEvent &); void OnChar(wxKeyEvent &); void OnMouseEvent(wxMouseEvent &event); DECLARE_EVENT_TABLE() }; #endif // CBSPLASH_SCREEN_H wxformbuilder-3.1.59/src/maingui.cpp0000644000175000017500000002766011143440026017706 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #include "splashscreen.h" #include "rad/mainframe.h" #include "rad/appdata.h" #include #include #include #include #include #include #include #include #include #include #include "utils/wxfbexception.h" #include #include "maingui.h" #include "utils/debug.h" #include "utils/typeconv.h" #include "model/objectbase.h" // Abnormal Termination Handling #if wxUSE_ON_FATAL_EXCEPTION && wxUSE_STACKWALKER #include #include #elif defined(_WIN32) && defined(__MINGW32__) #include "dbg_stack_trace/stack.hpp" #include #include EXCEPTION_DISPOSITION StructuredExceptionHandler( struct _EXCEPTION_RECORD *ExceptionRecord, void * EstablisherFrame, struct _CONTEXT *ContextRecord, void * DispatcherContext ); #endif void LogStack(); static const wxCmdLineEntryDesc s_cmdLineDesc[] = { { wxCMD_LINE_SWITCH, wxT("g"), wxT("generate"), wxT("Generate code from passed file.") }, { wxCMD_LINE_OPTION, wxT("l"), wxT("language"), wxT("Override the code_generation property from the passed file and generate the passed languages. Separate multiple languages with commas.") }, { wxCMD_LINE_SWITCH, wxT("h"), wxT("help"), wxT("Show this help message."), wxCMD_LINE_VAL_STRING, wxCMD_LINE_OPTION_HELP }, { wxCMD_LINE_PARAM, NULL, NULL, wxT("File to open."), wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL }, { wxCMD_LINE_NONE } }; IMPLEMENT_APP( MyApp ) int MyApp::OnRun() { // Abnormal Termination Handling #if wxUSE_ON_FATAL_EXCEPTION && wxUSE_STACKWALKER ::wxHandleFatalExceptions( true ); #elif defined(_WIN32) && defined(__MINGW32__) // Structured Exception handlers are stored in a linked list at FS:[0] // THIS MUST BE A LOCAL VARIABLE - windows won't use an object outside of the thread's stack frame EXCEPTION_REGISTRATION ex; ex.handler = StructuredExceptionHandler; asm volatile ("movl %%fs:0, %0" : "=r" (ex.prev)); asm volatile ("movl %0, %%fs:0" : : "r" (&ex)); #endif // Using a space so the initial 'w' will not be capitalized in wxLogGUI dialogs wxApp::SetAppName( wxT( " wxFormBuilder" ) ); // Creating the wxConfig manually so there will be no space // The old config (if any) is returned, delete it delete wxConfigBase::Set( new wxConfig( wxT("wxFormBuilder") ) ); // Get the data directory wxStandardPathsBase& stdPaths = wxStandardPaths::Get(); wxString dataDir = stdPaths.GetDataDir(); dataDir.Replace( GetAppName().c_str(), wxT("wxformbuilder") ); // Log to stderr while working on the command line delete wxLog::SetActiveTarget( new wxLogStderr ); // Message output to the same as the log target delete wxMessageOutput::Set( new wxMessageOutputLog ); // Parse command line wxCmdLineParser parser( s_cmdLineDesc, argc, argv ); if ( 0 != parser.Parse() ) { return 1; } // Get project to load wxString projectToLoad = wxEmptyString; if ( parser.GetParamCount() > 0 ) { projectToLoad = parser.GetParam(); } bool justGenerate = false; wxString language; bool hasLanguage = parser.Found( wxT("l"), &language ); if ( parser.Found( wxT("g") ) ) { if ( projectToLoad.empty() ) { wxLogError( _("You must pass a path to a project file. Nothing to generate.") ); return 2; } if ( hasLanguage ) { if ( language.empty() ) { wxLogError( _("Empty language option. Nothing generated.") ); return 3; } language.Replace( wxT(","), wxT("|"), true ); } // generate code justGenerate = true; } else { delete wxLog::SetActiveTarget( new wxLogGui ); } // Create singleton AppData - wait to initialize until sure that this is not the second // instance of a project file. AppDataCreate( dataDir ); // Make passed project name absolute try { if ( !projectToLoad.empty() ) { wxFileName projectPath( projectToLoad ); if ( !projectPath.IsOk() ) { THROW_WXFBEX( wxT("This path is invalid: ") << projectToLoad ); } if ( !projectPath.IsAbsolute() ) { if ( !projectPath.MakeAbsolute() ) { THROW_WXFBEX( wxT("Could not make path absolute: ") << projectToLoad ); } } projectToLoad = projectPath.GetFullPath(); } } catch ( wxFBException& ex ) { wxLogError( ex.what() ); } // If the project is already loaded in another instance, switch to that instance and quit if ( !projectToLoad.empty() && !justGenerate ) { if ( ::wxFileExists( projectToLoad ) ) { if ( !AppData()->VerifySingleInstance( projectToLoad ) ) { return 4; } } } // Init handlers wxInitAllImageHandlers(); wxXmlResource::Get()->InitAllHandlers(); // Init AppData try { AppDataInit(); } catch( wxFBException& ex ) { wxLogError( _("Error loading application: %s\nwxFormBuilder cannot continue."), ex.what() ); wxLog::FlushActive(); return 5; } wxSystemOptions::SetOption( wxT( "msw.remap" ), 0 ); wxSystemOptions::SetOption( wxT( "msw.staticbox.optimized-paint" ), 0 ); m_frame = NULL; #ifndef __WXFB_DEBUG__ wxBitmap bitmap; std::auto_ptr< cbSplashScreen > splash; if ( !justGenerate ) { if ( bitmap.LoadFile( dataDir + wxFILE_SEP_PATH + wxT( "resources" ) + wxFILE_SEP_PATH + wxT( "splash.png" ), wxBITMAP_TYPE_PNG ) ) { splash = std::auto_ptr< cbSplashScreen >( new cbSplashScreen( bitmap, -1, 0, wxNewId() ) ); } } #endif wxYield(); // Read size and position from config file wxConfigBase *config = wxConfigBase::Get(); config->SetPath( wxT("/mainframe") ); int x, y, w, h; x = y = w = h = -1; config->Read( wxT( "PosX" ), &x ); config->Read( wxT( "PosY" ), &y ); config->Read( wxT( "SizeW" ), &w ); config->Read( wxT( "SizeH" ), &h ); long style = config->Read( wxT("style"), wxFB_WIDE_GUI ); if ( style != wxFB_CLASSIC_GUI ) { style = wxFB_WIDE_GUI; } config->SetPath( wxT("/") ); m_frame = new MainFrame( NULL ,-1, (int)style, wxPoint( x, y ), wxSize( w, h ) ); if ( !justGenerate ) { m_frame->Show( TRUE ); SetTopWindow( m_frame ); #ifndef __WXFB_DEBUG__ // turn off the splash screen delete splash.release(); #endif #ifdef __WXFB_DEBUG__ wxLogWindow* log = dynamic_cast< wxLogWindow* >( AppData()->GetDebugLogTarget() ); if ( log ) { m_frame->AddChild( log->GetFrame() ); } #endif //__WXFB_DEBUG__ } // This is not necessary for wxFB to work. However, Windows sets the Current Working Directory // to the directory from which a .fbp file was opened, if opened from Windows Explorer. // This puts an unneccessary lock on the directory. // This changes the CWD to the already locked app directory as a workaround #ifdef __WXMSW__ ::wxSetWorkingDirectory( dataDir ); #endif if ( !projectToLoad.empty() ) { if ( AppData()->LoadProject( projectToLoad, !justGenerate ) ) { if ( justGenerate ) { if ( hasLanguage ) { PObjectBase project = AppData()->GetProjectData(); PProperty codeGen = project->GetProperty( _("code_generation") ); if ( codeGen ) { codeGen->SetValue( language ); } } AppData()->GenerateCode( false ); return 0; } else { m_frame->InsertRecentProject( projectToLoad ); return wxApp::OnRun(); } } else { wxLogError( wxT("Unable to load project: %s"), projectToLoad.c_str() ); } } if ( justGenerate ) { return 6; } AppData()->NewProject(); #ifdef __WXMAC__ // document to open on startup if(!m_mac_file_name.IsEmpty()) { if ( AppData()->LoadProject( m_mac_file_name ) ) m_frame->InsertRecentProject( m_mac_file_name ); } #endif return wxApp::OnRun(); } bool MyApp::OnInit() { // Initialization is done in OnRun, so MinGW SEH works for all code (it needs a local variable, OnInit is called before OnRun) return true; } int MyApp::OnExit() { MacroDictionary::Destroy(); wxFlatNotebook::CleanUp(); AppDataDestroy(); if( !wxTheClipboard->IsOpened() ) { if ( !wxTheClipboard->Open() ) { return wxApp::OnExit(); } } // Allow clipboard data to persist after close wxTheClipboard->Flush(); wxTheClipboard->Close(); return wxApp::OnExit(); } MyApp::~MyApp() { } #ifdef __WXMAC__ void MyApp::MacOpenFile(const wxString &fileName) { if(m_frame == NULL) m_mac_file_name = fileName; else { if(!m_frame->SaveWarning()) return; if ( AppData()->LoadProject( fileName ) ) m_frame->InsertRecentProject( fileName ); } } #endif #if wxUSE_ON_FATAL_EXCEPTION && wxUSE_STACKWALKER class StackLogger : public wxStackWalker { protected: void OnStackFrame( const wxStackFrame& frame ) { // Build param string wxString params; size_t paramCount = frame.GetParamCount(); if ( paramCount > 0 ) { params << wxT("( "); for ( size_t i = 0; i < paramCount; ++i ) { wxString type, name, value; if ( frame.GetParam( i, &type, &name, &value) ) { params << type << wxT(" ") << name << wxT(" = ") << value << wxT(", "); } } params << wxT(")"); } wxString source; if ( frame.HasSourceLocation() ) { source.Printf( wxT("%s@%i"), frame.GetFileName().c_str(), frame.GetLine() ); } wxLogError( wxT("%03i %i %s %s %s %s"), frame.GetLevel(), frame.GetAddress(), frame.GetModule().c_str(), frame.GetName().c_str(), params.c_str(), source.c_str() ); } }; void MyApp::OnFatalException() { LogStack(); } #elif defined(_WIN32) && defined(__MINGW32__) static _CONTEXT* context = 0; EXCEPTION_DISPOSITION StructuredExceptionHandler( struct _EXCEPTION_RECORD *ExceptionRecord, void * EstablisherFrame, struct _CONTEXT *ContextRecord, void * DispatcherContext ) { context = ContextRecord; LogStack(); return ExceptionContinueSearch; } class StackLogger { public: void WalkFromException() { try { std::stringstream output; dbg::stack s( 0, context ); dbg::stack::const_iterator frame; for ( frame = s.begin(); frame != s.end(); ++frame ) { output << *frame; wxLogError( wxString( output.str().c_str(), *wxConvCurrent ) ); output.str( "" ); } } catch ( std::exception& ex ) { wxLogError( wxString( ex.what(), *wxConvCurrent ) ); } } }; #endif #if (wxUSE_ON_FATAL_EXCEPTION && wxUSE_STACKWALKER) || (defined(_WIN32) && defined(__MINGW32__)) class LoggingStackWalker : public StackLogger { public: LoggingStackWalker() : StackLogger() { wxLog::Suspend(); } ~LoggingStackWalker() { wxLogError( wxT("A Fatal Error Occurred. Click Details for a backtrace.") ); wxLog::Resume(); wxLog* logger = wxLog::GetActiveTarget(); if ( 0 != logger ) { logger->Flush(); } exit(1); } }; void LogStack() { LoggingStackWalker walker; walker.WalkFromException(); } #endif wxformbuilder-3.1.59/sdk/premake.lua0000644000175000017500000000262011143440026017657 0ustar rrmulderrrmulder--****************************************************************************08 --* Author: RJP Computing --* Date: 2/9/2008 --* Version: 1.00-beta --* Copyright (C) 2008 RJP Computing --* --* This program is free software; you can redistribute it and/or --* modify it under the terms of the GNU General Public License --* as published by the Free Software Foundation; either version 2 --* of the License, or (at your option) any later version. --* --* This program is distributed in the hope that it will be useful, --* but WITHOUT ANY WARRANTY; without even the implied warranty of --* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --* GNU General Public License for more details. --* --* You should have received a copy of the GNU General Public License --* along with this program; if not, write to the Free Software --* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --* --* NOTES: --* - use the '/' slash for all paths. --***************************************************************************** project.name = "wxFormBuilder SDK" -- Add sdk projects here. (This needs to match the directory name not the package name.) dopackage( "plugin_interface" ) dopackage( "tinyxml" ) -- Add options here. addoption( "dynamic-runtime", "Use the dynamicly loadable version of the runtime." ) addoption( "unicode", "Use the Unicode character set" ) wxformbuilder-3.1.59/sdk/README.TXT0000644000175000017500000000423011143440026017065 0ustar rrmulderrrmulderwxFormBuilder Plugin SDK ------------------------ Introduction: The wxFormBuilder SDK makes it simple to create plug-ins for wxFormBuilder. It is a set of needed libraries that every plug-in must use to be considered a wxFormBuilder plug-in. The SDK uses a simple but effective build tool called Premake. You use premake to build makefiles, Visual Studio 7.1/2005 projects, and Code::Blocks projects. Now makefile and Code::Blocks are the supported types that the wxFormBuilder team tests and uses, so your mileage may vary with the other build types. Build File Creation: To create the needed build files navigate to the 'sdk' directory and type one of the following commands: - Code::Blocks Projects and workspace: Windows: premake\premake-win32 --target cb-gcc --with-wx-shared [--unicode] Linux: premake/premake-linux --target cb-gcc --with-wx-shared [--unicode] - GNU makefile: Windows: premake\premake-win32 --target gnu --with-wx-shared [--unicode] Linux: premake/premake-linux --target gnu --with-wx-shared [--unicode] Build Steps: - For Code::Blocks, use the generated .workspace to build the SDK. - For GNU makefiles type: (Assumes you have properly setup your system to build with gcc or MinGW) * Release: make CONFIG=Release * Debug: make Includes: 1. plugin_interface wxFormBuilder has a plug-in interface and every plug-in shares this as a dependancy. It builds to a static library and should be included in any and all plug-ins. 2. Tinyxml++ 2.4.2 (TiCPP) wxFormBuilder uses TinyXML++ for writing and reading xml. You can find TinyXML++ on http://code.google.com/p/ticpp/ 3. Premake The build file generator. It is precompiled for Windows, Linux, and Mac. Notes: - Code::Blocks is a free cross-platform IDE and it can be found here: http://codeblocks.org - Premake can be found here: http://premake.sourceforge.net - Subversion is a great free cross-platform version control manager. It can be found here: http://subversion.tigris.org - TinyXML++ (TiCPP) is a great small xml parser. It can be found here: http://code.google.com/p/ticpp/ Enjoy, The wxFormBuilder Teamwxformbuilder-3.1.59/wxfbTest/wxfbTest_GUI.h0000644000175000017500000000575711143440026021256 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // C++ code generated with wxFormBuilder (version May 4 2007) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! /////////////////////////////////////////////////////////////////////////// #ifndef __wxfbTest_GUI__ #define __wxfbTest_GUI__ #include #include #include #include #include #include #include #include #include #include #include /////////////////////////////////////////////////////////////////////////// #define ID_DEFAULT wxID_ANY // Default #define ID_EXIT 1000 #define ID_ABOUT 1001 /////////////////////////////////////////////////////////////////////////////// /// Class MainFrame /////////////////////////////////////////////////////////////////////////////// class MainFrame : public wxFrame { private: protected: wxMenuBar* m_menubar1; wxMenu* file; wxMenu* help; wxStatusBar* m_statusBar1; wxToolBar* m_toolBar1; public: MainFrame( wxWindow* parent, int id = ID_DEFAULT, wxString title = wxT("wxFormBuilder Test App"), wxPoint pos = wxDefaultPosition, wxSize size = wxSize( 500,300 ), int style = wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL ); }; /////////////////////////////////////////////////////////////////////////////// /// Class MainPanel /////////////////////////////////////////////////////////////////////////////// class MainPanel : public wxPanel { private: protected: wxButton* m_button1; wxBitmapButton* m_bpButton1; wxTextCtrl* m_textCtrl1; wxStaticText* m_staticText1; wxCheckBox* m_checkBox1; wxComboBox* m_comboBox1; wxListBox* m_listBox1; wxRadioBox* m_radioBox1; wxGrid* m_grid1; wxStaticBitmap* m_bitmap1; wxStaticText* m_staticText; wxStaticLine* m_staticline1; wxButton* m_button; wxListCtrl* m_listCtrl; wxChoice* m_choice1; wxSlider* m_slider1; wxCheckListBox* m_checkList1; public: MainPanel( wxWindow* parent, int id = ID_DEFAULT, wxPoint pos = wxDefaultPosition, wxSize size = wxSize( 800,600 ), int style = wxTAB_TRAVERSAL ); }; #endif //__wxfbTest_GUI__ wxformbuilder-3.1.59/wxfbTest/event_GUI.cpp0000644000175000017500000004520411143440026021113 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // C++ code generated with wxFormBuilder (version Sep 5 2007) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! /////////////////////////////////////////////////////////////////////////// #include "event_GUI.h" /////////////////////////////////////////////////////////////////////////// MainFrame::MainFrame( wxWindow* parent, int id, wxString title, wxPoint pos, wxSize size, int style ) : wxFrame( parent, id, title, pos, size, style ) { this->SetSizeHints( wxDefaultSize, wxDefaultSize ); m_menubar1 = new wxMenuBar( 0 ); m_fileMenu = new wxMenu(); wxMenuItem* fileOpenMenuItem = new wxMenuItem( m_fileMenu, ID_FILE_OPEN, wxString( wxT("&Open") ) , wxEmptyString, wxITEM_NORMAL ); m_fileMenu->Append( fileOpenMenuItem ); wxMenuItem* fileSaveMenuItem = new wxMenuItem( m_fileMenu, ID_FILE_SAVE, wxString( wxT("&Save") ) , wxEmptyString, wxITEM_NORMAL ); m_fileMenu->Append( fileSaveMenuItem ); m_fileMenu->AppendSeparator(); wxMenuItem* fileExitMenuItem = new wxMenuItem( m_fileMenu, ID_FILE_EXIT, wxString( wxT("E&xit") ) , wxEmptyString, wxITEM_NORMAL ); m_fileMenu->Append( fileExitMenuItem ); m_menubar1->Append( m_fileMenu, wxT("&File") ); m_helpMenu = new wxMenu(); wxMenuItem* helpAboutMenuItem = new wxMenuItem( m_helpMenu, ID_HELP_ABOUT_MENU_ITEM, wxString( wxT("&About") ) , wxEmptyString, wxITEM_NORMAL ); m_helpMenu->Append( helpAboutMenuItem ); m_menubar1->Append( m_helpMenu, wxT("Help") ); this->SetMenuBar( m_menubar1 ); m_toolBar1 = this->CreateToolBar( wxTB_FLAT|wxTB_HORIZONTAL|wxTB_TEXT, ID_TOOLBAR ); m_toolBar1->AddTool( ID_OPEN_TOOL, wxT("Open"), wxNullBitmap, wxNullBitmap, wxITEM_NORMAL, wxEmptyString, wxEmptyString ); m_toolBar1->AddTool( ID_SAVE_TOOL, wxT("Save"), wxNullBitmap, wxNullBitmap, wxITEM_NORMAL, wxEmptyString, wxEmptyString ); m_toolBar1->AddSeparator(); m_toolBar1->AddTool( ID_ABOUT_TOOL, wxT("About"), wxNullBitmap, wxNullBitmap, wxITEM_NORMAL, wxEmptyString, wxEmptyString ); m_toolBar1->Realize(); // Connect Events this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( MainFrame::OnClose ) ); this->Connect( wxEVT_SIZE, wxSizeEventHandler( MainFrame::OnSize ) ); this->Connect( fileOpenMenuItem->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnFileOpen ) ); this->Connect( fileSaveMenuItem->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnFileSave ) ); this->Connect( fileExitMenuItem->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnFileExit ) ); this->Connect( ID_OPEN_TOOL, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnOpenSelected )); this->Connect( ID_OPEN_TOOL, wxEVT_COMMAND_TOOL_ENTER, wxCommandEventHandler( MainFrame::OnOpenEntered ) ); this->Connect( ID_ABOUT_TOOL, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler( MainFrame::OnAboutClicked ) ); this->Connect( ID_ABOUT_TOOL, wxEVT_COMMAND_TOOL_RCLICKED, wxCommandEventHandler( MainFrame::OnAboutRClick ) ); } CommonPanel::CommonPanel( wxWindow* parent, int id, wxPoint pos, wxSize size, int style ) : wxPanel( parent, id, pos, size, style ) { wxFlexGridSizer* fgSizer1; fgSizer1 = new wxFlexGridSizer( 2, 2, 0, 0 ); fgSizer1->SetFlexibleDirection( wxBOTH ); fgSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_NONE ); m_button1 = new wxButton( this, ID_BUTTON, wxT("MyButton"), wxDefaultPosition, wxDefaultSize, 0 ); fgSizer1->Add( m_button1, 0, wxALL, 5 ); m_bpButton1 = new wxBitmapButton( this, ID_BITMAP_BUTTON, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW ); fgSizer1->Add( m_bpButton1, 0, wxALL, 5 ); m_textCtrl1 = new wxTextCtrl( this, ID_TEXTCTRL, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); fgSizer1->Add( m_textCtrl1, 0, wxALL, 5 ); m_comboBox1 = new wxComboBox( this, ID_COMBOBOX, wxT("Combo!"), wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); fgSizer1->Add( m_comboBox1, 0, wxALL, 5 ); wxArrayString m_choice1Choices; m_choice1 = new wxChoice( this, ID_CHOICE, wxDefaultPosition, wxDefaultSize, m_choice1Choices, 0 ); fgSizer1->Add( m_choice1, 0, wxALL, 5 ); m_listBox1 = new wxListBox( this, ID_LISTBOX, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); fgSizer1->Add( m_listBox1, 0, wxALL, 5 ); m_listCtrl1 = new wxListCtrl( this, ID_LIST_CTRL, wxDefaultPosition, wxDefaultSize, wxLC_ICON ); fgSizer1->Add( m_listCtrl1, 0, wxALL, 5 ); m_checkBox1 = new wxCheckBox( this, ID_CHECKBOX, wxT("Check Me!"), wxDefaultPosition, wxDefaultSize, 0 ); fgSizer1->Add( m_checkBox1, 0, wxALL, 5 ); wxString m_radioBox1Choices[] = { wxT("Radio Button") }; int m_radioBox1NChoices = sizeof( m_radioBox1Choices ) / sizeof( wxString ); m_radioBox1 = new wxRadioBox( this, ID_RADIOBOX, wxT("wxRadioBox"), wxDefaultPosition, wxDefaultSize, m_radioBox1NChoices, m_radioBox1Choices, 1, wxRA_SPECIFY_COLS ); m_radioBox1->SetSelection( 0 ); fgSizer1->Add( m_radioBox1, 0, wxALL, 5 ); m_slider1 = new wxSlider( this, ID_SLIDER, 50, 0, 100, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL ); fgSizer1->Add( m_slider1, 0, wxALL, 5 ); m_grid1 = new wxGrid( this, ID_GRID, wxDefaultPosition, wxDefaultSize, 0 ); // Grid m_grid1->CreateGrid( 2, 2 ); m_grid1->EnableEditing( true ); m_grid1->EnableGridLines( true ); m_grid1->EnableDragGridSize( false ); m_grid1->SetMargins( 0, 0 ); // Columns m_grid1->EnableDragColMove( false ); m_grid1->EnableDragColSize( true ); m_grid1->SetColLabelSize( 30 ); m_grid1->SetColLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE ); // Rows m_grid1->EnableDragRowSize( true ); m_grid1->SetRowLabelSize( 80 ); m_grid1->SetRowLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE ); // Label Appearance // Cell Defaults m_grid1->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP ); fgSizer1->Add( m_grid1, 0, wxALL, 5 ); this->SetSizer( fgSizer1 ); this->Layout(); // Connect Events m_button1->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CommonPanel::OnClick ), NULL, this ); m_bpButton1->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CommonPanel::OnClickBitmap ), NULL, this ); m_textCtrl1->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( CommonPanel::OnText ), NULL, this ); m_textCtrl1->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( CommonPanel::OnTextEnter ), NULL, this ); m_textCtrl1->Connect( wxEVT_COMMAND_TEXT_MAXLEN, wxCommandEventHandler( CommonPanel::OnTextMaxLen ), NULL, this ); m_textCtrl1->Connect( wxEVT_COMMAND_TEXT_URL, wxTextUrlEventHandler( CommonPanel::OnTextURL ), NULL, this ); m_comboBox1->Connect( wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler( CommonPanel::OnCombobox ), NULL, this ); m_comboBox1->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( CommonPanel::OnComboText ), NULL, this ); m_comboBox1->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( CommonPanel::OnComboTextEnter ), NULL, this ); m_choice1->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( CommonPanel::OnChoice ), NULL, this ); m_listBox1->Connect( wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler( CommonPanel::OnListBox ), NULL, this ); m_listBox1->Connect( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, wxCommandEventHandler( CommonPanel::OnListBoxDClick ), NULL, this ); m_listCtrl1->Connect( wxEVT_COMMAND_LIST_COL_CLICK, wxListEventHandler( CommonPanel::OnListColClick ), NULL, this ); m_listCtrl1->Connect( wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS, wxListEventHandler( CommonPanel::OnListDeleteAllItems ), NULL, this ); m_checkBox1->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( CommonPanel::OnCheckBox ), NULL, this ); m_radioBox1->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( CommonPanel::OnRadioBox ), NULL, this ); m_slider1->Connect( wxEVT_SCROLL_TOP, wxScrollEventHandler( CommonPanel::OnCommandScroll ), NULL, this ); m_slider1->Connect( wxEVT_SCROLL_BOTTOM, wxScrollEventHandler( CommonPanel::OnCommandScroll ), NULL, this ); m_slider1->Connect( wxEVT_SCROLL_LINEUP, wxScrollEventHandler( CommonPanel::OnCommandScroll ), NULL, this ); m_slider1->Connect( wxEVT_SCROLL_LINEDOWN, wxScrollEventHandler( CommonPanel::OnCommandScroll ), NULL, this ); m_slider1->Connect( wxEVT_SCROLL_PAGEUP, wxScrollEventHandler( CommonPanel::OnCommandScroll ), NULL, this ); m_slider1->Connect( wxEVT_SCROLL_PAGEDOWN, wxScrollEventHandler( CommonPanel::OnCommandScroll ), NULL, this ); m_slider1->Connect( wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler( CommonPanel::OnCommandScroll ), NULL, this ); m_slider1->Connect( wxEVT_SCROLL_THUMBRELEASE, wxScrollEventHandler( CommonPanel::OnCommandScroll ), NULL, this ); m_slider1->Connect( wxEVT_SCROLL_CHANGED, wxScrollEventHandler( CommonPanel::OnCommandScroll ), NULL, this ); m_slider1->Connect( wxEVT_SCROLL_BOTTOM, wxScrollEventHandler( CommonPanel::OnCommandScrollBottom ), NULL, this ); m_slider1->Connect( wxEVT_SCROLL_CHANGED, wxScrollEventHandler( CommonPanel::OnCommandScrollChanged ), NULL, this ); m_slider1->Connect( wxEVT_SCROLL_TOP, wxScrollEventHandler( CommonPanel::OnScroll ), NULL, this ); m_slider1->Connect( wxEVT_SCROLL_BOTTOM, wxScrollEventHandler( CommonPanel::OnScroll ), NULL, this ); m_slider1->Connect( wxEVT_SCROLL_LINEUP, wxScrollEventHandler( CommonPanel::OnScroll ), NULL, this ); m_slider1->Connect( wxEVT_SCROLL_LINEDOWN, wxScrollEventHandler( CommonPanel::OnScroll ), NULL, this ); m_slider1->Connect( wxEVT_SCROLL_PAGEUP, wxScrollEventHandler( CommonPanel::OnScroll ), NULL, this ); m_slider1->Connect( wxEVT_SCROLL_PAGEDOWN, wxScrollEventHandler( CommonPanel::OnScroll ), NULL, this ); m_slider1->Connect( wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler( CommonPanel::OnScroll ), NULL, this ); m_slider1->Connect( wxEVT_SCROLL_THUMBRELEASE, wxScrollEventHandler( CommonPanel::OnScroll ), NULL, this ); m_slider1->Connect( wxEVT_SCROLL_CHANGED, wxScrollEventHandler( CommonPanel::OnScroll ), NULL, this ); m_slider1->Connect( wxEVT_SCROLL_CHANGED, wxScrollEventHandler( CommonPanel::OnScrollChanged ), NULL, this ); m_grid1->Connect( wxEVT_GRID_CELL_LEFT_CLICK, wxGridEventHandler( CommonPanel::OnGridCellClick ), NULL, this ); m_grid1->Connect( wxEVT_GRID_CELL_LEFT_DCLICK, wxGridEventHandler( CommonPanel::OnGridCellDClick ), NULL, this ); m_grid1->Connect( wxEVT_GRID_CELL_CHANGE, wxGridEventHandler( CommonPanel::OnGridCellChanged ), NULL, this ); m_grid1->Connect( wxEVT_GRID_CELL_RIGHT_CLICK, wxGridEventHandler( CommonPanel::OnGridCellRightClick ), NULL, this ); m_grid1->Connect( wxEVT_GRID_CELL_RIGHT_DCLICK, wxGridEventHandler( CommonPanel::OnGridCellRightDClick ), NULL, this ); m_grid1->Connect( wxEVT_GRID_EDITOR_CREATED, wxGridEditorCreatedEventHandler( CommonPanel::OnGridEditorCreated ), NULL, this ); m_grid1->Connect( wxEVT_GRID_EDITOR_HIDDEN, wxGridEventHandler( CommonPanel::OnGridEditorHidden ), NULL, this ); m_grid1->Connect( wxEVT_GRID_LABEL_RIGHT_CLICK, wxGridEventHandler( CommonPanel::OnGridLabelRightClick ), NULL, this ); m_grid1->Connect( wxEVT_GRID_LABEL_RIGHT_DCLICK, wxGridEventHandler( CommonPanel::OnGridLabelRightDClick ), NULL, this ); m_grid1->Connect( wxEVT_GRID_ROW_SIZE, wxGridSizeEventHandler( CommonPanel::OnGridRowSize ), NULL, this ); m_grid1->Connect( wxEVT_GRID_COL_SIZE, wxGridSizeEventHandler( CommonPanel::OnGridColSize ), NULL, this ); m_grid1->Connect( wxEVT_GRID_EDITOR_SHOWN, wxGridEventHandler( CommonPanel::OnGridEditorShown ), NULL, this ); m_grid1->Connect( wxEVT_GRID_LABEL_LEFT_CLICK, wxGridEventHandler( CommonPanel::OnGridLabelClick ), NULL, this ); m_grid1->Connect( wxEVT_GRID_LABEL_LEFT_DCLICK, wxGridEventHandler( CommonPanel::OnGridLabelDClick ), NULL, this ); m_grid1->Connect( wxEVT_GRID_RANGE_SELECT, wxGridRangeSelectEventHandler( CommonPanel::OnGridRangeSelect ), NULL, this ); m_grid1->Connect( wxEVT_GRID_SELECT_CELL, wxGridEventHandler( CommonPanel::OnGridCellSelected ), NULL, this ); } AdditionalPanel::AdditionalPanel( wxWindow* parent, int id, wxPoint pos, wxSize size, int style ) : wxPanel( parent, id, pos, size, style ) { wxFlexGridSizer* fgSizer2; fgSizer2 = new wxFlexGridSizer( 2, 2, 0, 0 ); fgSizer2->SetFlexibleDirection( wxBOTH ); fgSizer2->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_NONE ); m_calendar1 = new wxCalendarCtrl( this, wxID_ANY, wxDefaultDateTime, wxDefaultPosition, wxDefaultSize, wxCAL_SHOW_HOLIDAYS); fgSizer2->Add( m_calendar1, 1, wxALL|wxEXPAND, 5 ); m_datePicker1 = new wxDatePickerCtrl( this, wxID_ANY, wxDefaultDateTime, wxDefaultPosition, wxDefaultSize, wxDP_DEFAULT); fgSizer2->Add( m_datePicker1, 1, wxALL, 5 ); m_htmlWin1 = new wxHtmlWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHW_SCROLLBAR_AUTO); fgSizer2->Add( m_htmlWin1, 1, wxALL|wxEXPAND, 5 ); m_treeCtrl1 = new wxTreeCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTR_DEFAULT_STYLE); fgSizer2->Add( m_treeCtrl1, 1, wxALL|wxEXPAND, 5 ); m_radioBtn1 = new wxRadioButton( this, wxID_ANY, wxT("RadioBtn"), wxDefaultPosition, wxDefaultSize, 0); fgSizer2->Add( m_radioBtn1, 0, wxALL, 5 ); m_toggleBtn1 = new wxToggleButton( this, wxID_ANY, wxT("Toggle me!"), wxDefaultPosition, wxDefaultSize, 0 ); fgSizer2->Add( m_toggleBtn1, 1, wxALL|wxEXPAND, 5 ); m_scrollBar1 = new wxScrollBar( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSB_HORIZONTAL); fgSizer2->Add( m_scrollBar1, 0, wxALL, 5 ); m_spinCtrl1 = new wxSpinCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 10, 0); fgSizer2->Add( m_spinCtrl1, 0, wxALL, 5 ); m_spinBtn1 = new wxSpinButton( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0); fgSizer2->Add( m_spinBtn1, 0, wxALL, 5 ); m_splitter1 = new wxSplitterWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_3D); m_splitter1->Connect( wxEVT_IDLE, wxIdleEventHandler( AdditionalPanel::m_splitter1OnIdle ), NULL, this ); m_panel5 = new wxPanel( m_splitter1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); wxBoxSizer* bSizer1; bSizer1 = new wxBoxSizer( wxVERTICAL ); m_button4 = new wxButton( m_panel5, wxID_ANY, wxT("MyButton"), wxDefaultPosition, wxDefaultSize, 0 ); bSizer1->Add( m_button4, 0, wxALL, 5 ); m_panel5->SetSizer( bSizer1 ); m_panel5->Layout(); bSizer1->Fit( m_panel5 ); m_panel6 = new wxPanel( m_splitter1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); wxBoxSizer* bSizer2; bSizer2 = new wxBoxSizer( wxVERTICAL ); m_button3 = new wxButton( m_panel6, wxID_ANY, wxT("MyButton"), wxDefaultPosition, wxDefaultSize, 0 ); bSizer2->Add( m_button3, 0, wxALL, 5 ); m_panel6->SetSizer( bSizer2 ); m_panel6->Layout(); bSizer2->Fit( m_panel6 ); m_splitter1->SplitVertically( m_panel5, m_panel6, 85 ); fgSizer2->Add( m_splitter1, 1, wxEXPAND, 5 ); wxString m_checkList1Choices[] = { wxT("1"), wxT("2"), wxT("3") }; int m_checkList1NChoices = sizeof( m_checkList1Choices ) / sizeof( wxString ); m_checkList1 = new wxCheckListBox( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_checkList1NChoices, m_checkList1Choices, 0 ); fgSizer2->Add( m_checkList1, 0, wxALL|wxEXPAND, 5 ); m_notebook1 = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); m_panel7 = new wxPanel( m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); m_notebook1->AddPage( m_panel7, wxT("a page"), true ); m_panel8 = new wxPanel( m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); m_notebook1->AddPage( m_panel8, wxT("a page"), false ); m_panel9 = new wxPanel( m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); m_notebook1->AddPage( m_panel9, wxT("a page"), false ); fgSizer2->Add( m_notebook1, 1, wxEXPAND | wxALL, 5 ); m_listbook1 = new wxListbook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLB_DEFAULT ); m_panel2 = new wxPanel( m_listbook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); wxBoxSizer* bSizer4; bSizer4 = new wxBoxSizer( wxVERTICAL ); m_textCtrl2 = new wxTextCtrl( m_panel2, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); bSizer4->Add( m_textCtrl2, 0, wxALL|wxEXPAND, 5 ); m_panel2->SetSizer( bSizer4 ); m_panel2->Layout(); bSizer4->Fit( m_panel2 ); m_listbook1->AddPage( m_panel2, wxT("a page"), false ); #ifndef __WXGTK__ // Small icon style not supported in GTK wxListView* m_listbook1ListView = m_listbook1->GetListView(); long m_listbook1Flags = m_listbook1ListView->GetWindowStyleFlag(); m_listbook1Flags = ( m_listbook1Flags & ~wxLC_ICON ) | wxLC_SMALL_ICON; m_listbook1ListView->SetWindowStyleFlag( m_listbook1Flags ); #endif fgSizer2->Add( m_listbook1, 1, wxEXPAND | wxALL, 5 ); m_choicebook1 = new wxChoicebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxCHB_DEFAULT ); m_panel3 = new wxPanel( m_choicebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); wxBoxSizer* bSizer3; bSizer3 = new wxBoxSizer( wxVERTICAL ); m_listBox2 = new wxListBox( m_panel3, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); bSizer3->Add( m_listBox2, 0, wxALL, 5 ); m_panel3->SetSizer( bSizer3 ); m_panel3->Layout(); bSizer3->Fit( m_panel3 ); m_choicebook1->AddPage( m_panel3, wxT("a page"), false ); fgSizer2->Add( m_choicebook1, 1, wxEXPAND | wxALL, 5 ); m_staticText1 = new wxStaticText( this, wxID_ANY, wxT("MyLabel"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText1->Wrap( -1 ); fgSizer2->Add( m_staticText1, 0, wxALL, 5 ); m_scrolledWindow2 = new wxScrolledWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxVSCROLL ); m_scrolledWindow2->SetScrollRate( 5, 5 ); fgSizer2->Add( m_scrolledWindow2, 1, wxEXPAND | wxALL, 5 ); this->SetSizer( fgSizer2 ); this->Layout(); // Connect Events m_checkList1->Connect( wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler( AdditionalPanel::OnCheckListBox ), NULL, this ); m_checkList1->Connect( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, wxCommandEventHandler( AdditionalPanel::OnCheckListBoxDClick ), NULL, this ); m_checkList1->Connect( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, wxCommandEventHandler( AdditionalPanel::OnCheckListBoxToggle ), NULL, this ); } wxformbuilder-3.1.59/wxfbTest/wxfbTest-unix.cbp0000644000175000017500000000652311143440026022040 0ustar rrmulderrrmulder wxformbuilder-3.1.59/wxfbTest/wxfbTest.fbp0000644000175000017500000015244311143440026021065 0ustar rrmulderrrmulder C++|XRC UTF-8 wxfbTest_GUI 1000 0 MyProject1 . wx/wxprec.h 1 0 0 1 0 ID_DEFAULT MainFrame 500,300 wxDEFAULT_FRAME_STYLE wxFormBuilder Test App wxTAB_TRAVERSAL 1 1 0 ID_DEFAULT MyMenuBar m_menubar1 protected wxMB_DOCKABLE &File file protected 0 1 Exit the Application ID_EXIT wxITEM_NORMAL E&xit exit Alt+F4 &Help help protected 0 1 About This Application . . . ID_ABOUT wxITEM_NORMAL &About about F1 1 1 0 ID_DEFAULT m_statusBar1 protected wxST_SIZEGRIP 1 0 ID_DEFAULT m_toolBar1 protected wxTB_HORIZONTAL ../bin/resources/icons/copy.xpm; Load From File ID_DEFAULT wxITEM_NORMAL tool m_tool1 ../bin/resources/icons/cut.xpm; Load From File ID_DEFAULT wxITEM_NORMAL tool m_tool2 1 0 ID_DEFAULT MainPanel 800,600 wxTAB_TRAVERSAL bSizer1 wxVERTICAL none 5 wxEXPAND 0 bSizer2 wxHORIZONTAL none 5 wxALL 0 1 0 ID_DEFAULT MyButton m_button1 protected 5 wxALL 0 ../bin/resources/icons/balign.xpm; Load From File 1 0 ID_DEFAULT m_bpButton1 protected wxBU_AUTODRAW 5 wxALL|wxALIGN_CENTER_VERTICAL 1 1 0 ID_DEFAULT m_textCtrl1 protected 5 wxALL|wxALIGN_CENTER_VERTICAL 0 1 0 ID_DEFAULT Unicode Test: Максим Емельянов m_staticText1 protected 5 wxALL|wxALIGN_CENTER_VERTICAL 0 0 1 0 ID_DEFAULT Check Me! m_checkBox1 protected 5 wxALL|wxALIGN_CENTER_VERTICAL 0 1 0 ID_DEFAULT m_comboBox1 protected Combo! 5 wxALL|wxEXPAND 0 Static Box Sizer sbSizer1 wxHORIZONTAL none 5 wxALL|wxEXPAND 0 'Test1' 'Test2' 1 0 ID_DEFAULT m_listBox1 protected 5 wxALL|wxEXPAND 0 'Test1' 'Test2' 1 0 ID_DEFAULT wxRadioBox 1 m_radioBox1 protected wxRA_SPECIFY_COLS 5 wxALL 1 5 1 0 ID_DEFAULT m_grid1 protected 5 5 wxEXPAND 1 2 0 gSizer1 none 2 0 5 wxALL|wxEXPAND 1 ../bin/resources/splash.png; Load From File 1 0 ID_DEFAULT m_bitmap1 protected 100,20 5 wxEXPAND 1 bSizer wxVERTICAL none 5 wxALL 0 1 0 ID_DEFAULT Static Line m_staticText protected 5 wxALL|wxEXPAND 0 1 0 ID_DEFAULT m_staticline1 protected wxLI_HORIZONTAL 5 wxALL|wxEXPAND 1 1 0 ID_DEFAULT Expanding Button m_button protected 5 wxALL|wxEXPAND 0 1 0 ID_DEFAULT m_listCtrl protected wxLC_REPORT 5 wxALL|wxEXPAND 0 'Test1' 'Test2' 1 0 ID_DEFAULT m_choice1 protected 5 wxALL|wxEXPAND 0 1 0 ID_DEFAULT 100 0 m_slider1 protected wxSL_HORIZONTAL 50 5 wxALL|wxEXPAND 1 'a' 'b' 'g' 'c' 1 0 ID_DEFAULT m_checkList1 protected wxLB_ALWAYS_SB|wxLB_SORT wxformbuilder-3.1.59/wxfbTest/wxFBEvents.cbp0000644000175000017500000000747611143440026021314 0ustar rrmulderrrmulder wxformbuilder-3.1.59/wxfbTest/wxfbTest_GUI.cpp0000644000175000017500000001544211143440026021601 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // C++ code generated with wxFormBuilder (version May 4 2007) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! /////////////////////////////////////////////////////////////////////////// #ifdef WX_PRECOMP #include "wx/wxprec.h" #ifdef __BORLANDC__ #pragma hdrstop #endif //__BORLANDC__ #else #include #endif //WX_PRECOMP #include "wxfbTest_GUI.h" #include "../bin/resources/icons/balign.xpm" #include "../bin/resources/icons/copy.xpm" #include "../bin/resources/icons/cut.xpm" /////////////////////////////////////////////////////////////////////////// MainFrame::MainFrame( wxWindow* parent, int id, wxString title, wxPoint pos, wxSize size, int style ) : wxFrame( parent, id, title, pos, size, style ) { this->SetSizeHints( wxDefaultSize, wxDefaultSize ); m_menubar1 = new wxMenuBar( wxMB_DOCKABLE ); file = new wxMenu(); wxMenuItem* exit = new wxMenuItem( file, ID_EXIT, wxString( wxT("E&xit") ) + wxT('\t') + wxT("Alt+F4"), wxT("Exit the Application"), wxITEM_NORMAL ); file->Append( exit ); m_menubar1->Append( file, wxT("&File") ); help = new wxMenu(); wxMenuItem* about = new wxMenuItem( help, ID_ABOUT, wxString( wxT("&About") ) + wxT('\t') + wxT("F1"), wxT("About This Application . . ."), wxITEM_NORMAL ); help->Append( about ); m_menubar1->Append( help, wxT("&Help") ); this->SetMenuBar( m_menubar1 ); m_statusBar1 = this->CreateStatusBar( 1, wxST_SIZEGRIP, ID_DEFAULT ); m_toolBar1 = this->CreateToolBar( wxTB_HORIZONTAL, ID_DEFAULT ); m_toolBar1->AddTool( ID_DEFAULT, wxT("tool"), wxBitmap( copy_xpm ), wxNullBitmap, wxITEM_NORMAL, wxEmptyString, wxEmptyString ); m_toolBar1->AddTool( ID_DEFAULT, wxT("tool"), wxBitmap( cut_xpm ), wxNullBitmap, wxITEM_NORMAL, wxEmptyString, wxEmptyString ); m_toolBar1->Realize(); } MainPanel::MainPanel( wxWindow* parent, int id, wxPoint pos, wxSize size, int style ) : wxPanel( parent, id, pos, size, style ) { wxBoxSizer* bSizer1; bSizer1 = new wxBoxSizer( wxVERTICAL ); wxBoxSizer* bSizer2; bSizer2 = new wxBoxSizer( wxHORIZONTAL ); m_button1 = new wxButton( this, ID_DEFAULT, wxT("MyButton"), wxDefaultPosition, wxDefaultSize, 0 ); bSizer2->Add( m_button1, 0, wxALL, 5 ); m_bpButton1 = new wxBitmapButton( this, ID_DEFAULT, wxBitmap( balign_xpm ), wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW ); bSizer2->Add( m_bpButton1, 0, wxALL, 5 ); m_textCtrl1 = new wxTextCtrl( this, ID_DEFAULT, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); bSizer2->Add( m_textCtrl1, 1, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); m_staticText1 = new wxStaticText( this, ID_DEFAULT, wxT("Unicode Test: Максим Емельянов"), wxDefaultPosition, wxDefaultSize, 0 ); bSizer2->Add( m_staticText1, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); m_checkBox1 = new wxCheckBox( this, ID_DEFAULT, wxT("Check Me!"), wxDefaultPosition, wxDefaultSize, 0 ); bSizer2->Add( m_checkBox1, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); m_comboBox1 = new wxComboBox( this, ID_DEFAULT, wxT("Combo!"), wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); bSizer2->Add( m_comboBox1, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); bSizer1->Add( bSizer2, 0, wxEXPAND, 5 ); wxStaticBoxSizer* sbSizer1; sbSizer1 = new wxStaticBoxSizer( new wxStaticBox( this, -1, wxT("Static Box Sizer") ), wxHORIZONTAL ); m_listBox1 = new wxListBox( this, ID_DEFAULT, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); m_listBox1->Append( wxT("Test1") ); m_listBox1->Append( wxT("Test2") ); sbSizer1->Add( m_listBox1, 0, wxALL|wxEXPAND, 5 ); wxString m_radioBox1Choices[] = { wxT("Test1"), wxT("Test2") }; int m_radioBox1NChoices = sizeof( m_radioBox1Choices ) / sizeof( wxString ); m_radioBox1 = new wxRadioBox( this, ID_DEFAULT, wxT("wxRadioBox"), wxDefaultPosition, wxDefaultSize, m_radioBox1NChoices, m_radioBox1Choices, 1, wxRA_SPECIFY_COLS ); sbSizer1->Add( m_radioBox1, 0, wxALL|wxEXPAND, 5 ); m_grid1 = new wxGrid( this, ID_DEFAULT, wxDefaultPosition, wxDefaultSize, 0 ); m_grid1->CreateGrid( 5, 5 ); sbSizer1->Add( m_grid1, 1, wxALL, 5 ); bSizer1->Add( sbSizer1, 0, wxALL|wxEXPAND, 5 ); wxGridSizer* gSizer1; gSizer1 = new wxGridSizer( 2, 2, 0, 0 ); m_bitmap1 = new wxStaticBitmap( this, ID_DEFAULT, wxBitmap( wxT("../bin/resources/splash.png"), wxBITMAP_TYPE_ANY ), wxDefaultPosition, wxSize( 100,20 ), 0 ); gSizer1->Add( m_bitmap1, 1, wxALL|wxEXPAND, 5 ); wxBoxSizer* bSizer; bSizer = new wxBoxSizer( wxVERTICAL ); m_staticText = new wxStaticText( this, ID_DEFAULT, wxT("Static Line"), wxDefaultPosition, wxDefaultSize, 0 ); bSizer->Add( m_staticText, 0, wxALL, 5 ); m_staticline1 = new wxStaticLine( this, ID_DEFAULT, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); bSizer->Add( m_staticline1, 0, wxALL|wxEXPAND, 5 ); m_button = new wxButton( this, ID_DEFAULT, wxT("Expanding Button"), wxDefaultPosition, wxDefaultSize, 0 ); bSizer->Add( m_button, 1, wxALL|wxEXPAND, 5 ); gSizer1->Add( bSizer, 1, wxEXPAND, 5 ); m_listCtrl = new wxListCtrl( this, ID_DEFAULT, wxDefaultPosition, wxDefaultSize, wxLC_REPORT ); gSizer1->Add( m_listCtrl, 0, wxALL|wxEXPAND, 5 ); wxString m_choice1Choices[] = { wxT("Test1"), wxT("Test2") }; int m_choice1NChoices = sizeof( m_choice1Choices ) / sizeof( wxString ); m_choice1 = new wxChoice( this, ID_DEFAULT, wxDefaultPosition, wxDefaultSize, m_choice1NChoices, m_choice1Choices, 0 ); gSizer1->Add( m_choice1, 0, wxALL|wxEXPAND, 5 ); m_slider1 = new wxSlider( this, ID_DEFAULT, 50, 0, 100, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL ); gSizer1->Add( m_slider1, 0, wxALL|wxEXPAND, 5 ); wxString m_checkList1Choices[] = { wxT("a"), wxT("b"), wxT("g"), wxT("c") }; int m_checkList1NChoices = sizeof( m_checkList1Choices ) / sizeof( wxString ); m_checkList1 = new wxCheckListBox( this, ID_DEFAULT, wxDefaultPosition, wxDefaultSize, m_checkList1NChoices, m_checkList1Choices, wxLB_ALWAYS_SB|wxLB_SORT ); gSizer1->Add( m_checkList1, 1, wxALL|wxEXPAND, 5 ); bSizer1->Add( gSizer1, 1, wxEXPAND, 5 ); this->SetSizer( bSizer1 ); this->Layout(); } wxformbuilder-3.1.59/wxfbTest/wxFBEventCommonPanel.h0000644000175000017500000000273511143440026022736 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // RJP Computing - rjpcomputing@gmail.com // /////////////////////////////////////////////////////////////////////////////// #ifndef __wxFBEventCommonPanel__ #define __wxFBEventCommonPanel__ /** @file Subclass of CommonPanel, which is generated by wxFormBuilder. @todo Add your event handlers directly to this file. */ #include "event_GUI.h" /** Implementing CommonPanel */ class wxFBEventCommonPanel : public CommonPanel { public: /** Constructor */ wxFBEventCommonPanel( wxWindow* parent ); }; #endif // __wxFBEventCommonPanel__ wxformbuilder-3.1.59/wxfbTest/event_GUI.h0000644000175000017500000002111611143440026020554 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // // C++ code generated with wxFormBuilder (version Sep 5 2007) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! /////////////////////////////////////////////////////////////////////////// #ifndef __event_GUI__ #define __event_GUI__ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include /////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// /// Class MainFrame /////////////////////////////////////////////////////////////////////////////// class MainFrame : public wxFrame { private: protected: enum { ID_FILE_OPEN = 1000, ID_FILE_SAVE, ID_FILE_EXIT, ID_HELP_ABOUT_MENU_ITEM, ID_TOOLBAR, ID_OPEN_TOOL, ID_SAVE_TOOL, ID_ABOUT_TOOL, }; wxMenuBar* m_menubar1; wxMenu* m_fileMenu; wxMenu* m_helpMenu; wxToolBar* m_toolBar1; // Virtual event handlers, overide them in your derived class virtual void OnClose( wxCloseEvent& event ){ event.Skip(); } virtual void OnSize( wxSizeEvent& event ){ event.Skip(); } virtual void OnFileOpen( wxCommandEvent& event ){ event.Skip(); } virtual void OnFileSave( wxCommandEvent& event ){ event.Skip(); } virtual void OnFileExit( wxCommandEvent& event ){ event.Skip(); } virtual void OnOpenSelected( wxCommandEvent& event ){ event.Skip(); } virtual void OnOpenEntered( wxCommandEvent& event ){ event.Skip(); } virtual void OnAboutClicked( wxCommandEvent& event ){ event.Skip(); } virtual void OnAboutRClick( wxCommandEvent& event ){ event.Skip(); } public: MainFrame( wxWindow* parent, int id = wxID_ANY, wxString title = wxEmptyString, wxPoint pos = wxDefaultPosition, wxSize size = wxSize( 500,300 ), int style = wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL ); }; /////////////////////////////////////////////////////////////////////////////// /// Class CommonPanel /////////////////////////////////////////////////////////////////////////////// class CommonPanel : public wxPanel { private: protected: enum { ID_DEFAULT = wxID_ANY, // Default ID_BUTTON = 1000, ID_BITMAP_BUTTON, ID_TEXTCTRL, ID_COMBOBOX, ID_CHOICE, ID_LISTBOX, ID_LIST_CTRL, ID_CHECKBOX, ID_RADIOBOX, ID_SLIDER, ID_GRID, }; wxButton* m_button1; wxBitmapButton* m_bpButton1; wxTextCtrl* m_textCtrl1; wxComboBox* m_comboBox1; wxChoice* m_choice1; wxListBox* m_listBox1; wxListCtrl* m_listCtrl1; wxCheckBox* m_checkBox1; wxRadioBox* m_radioBox1; wxSlider* m_slider1; wxGrid* m_grid1; // Virtual event handlers, overide them in your derived class virtual void OnClick( wxCommandEvent& event ){ event.Skip(); } virtual void OnClickBitmap( wxCommandEvent& event ){ event.Skip(); } virtual void OnText( wxCommandEvent& event ){ event.Skip(); } virtual void OnTextEnter( wxCommandEvent& event ){ event.Skip(); } virtual void OnTextMaxLen( wxCommandEvent& event ){ event.Skip(); } virtual void OnTextURL( wxTextUrlEvent& event ){ event.Skip(); } virtual void OnCombobox( wxCommandEvent& event ){ event.Skip(); } virtual void OnComboText( wxCommandEvent& event ){ event.Skip(); } virtual void OnComboTextEnter( wxCommandEvent& event ){ event.Skip(); } virtual void OnChoice( wxCommandEvent& event ){ event.Skip(); } virtual void OnListBox( wxCommandEvent& event ){ event.Skip(); } virtual void OnListBoxDClick( wxCommandEvent& event ){ event.Skip(); } virtual void OnListColClick( wxListEvent& event ){ event.Skip(); } virtual void OnListDeleteAllItems( wxListEvent& event ){ event.Skip(); } virtual void OnCheckBox( wxCommandEvent& event ){ event.Skip(); } virtual void OnRadioBox( wxCommandEvent& event ){ event.Skip(); } virtual void OnCommandScroll( wxScrollEvent& event ){ event.Skip(); } virtual void OnCommandScrollBottom( wxScrollEvent& event ){ event.Skip(); } virtual void OnCommandScrollChanged( wxScrollEvent& event ){ event.Skip(); } virtual void OnScroll( wxScrollEvent& event ){ event.Skip(); } virtual void OnScrollChanged( wxScrollEvent& event ){ event.Skip(); } virtual void OnGridCellClick( wxGridEvent& event ){ event.Skip(); } virtual void OnGridCellDClick( wxGridEvent& event ){ event.Skip(); } virtual void OnGridCellChanged( wxGridEvent& event ){ event.Skip(); } virtual void OnGridCellRightClick( wxGridEvent& event ){ event.Skip(); } virtual void OnGridCellRightDClick( wxGridEvent& event ){ event.Skip(); } virtual void OnGridEditorCreated( wxGridEditorCreatedEvent& event ){ event.Skip(); } virtual void OnGridEditorHidden( wxGridEvent& event ){ event.Skip(); } virtual void OnGridLabelRightClick( wxGridEvent& event ){ event.Skip(); } virtual void OnGridLabelRightDClick( wxGridEvent& event ){ event.Skip(); } virtual void OnGridRowSize( wxGridSizeEvent& event ){ event.Skip(); } virtual void OnGridColSize( wxGridSizeEvent& event ){ event.Skip(); } virtual void OnGridEditorShown( wxGridEvent& event ){ event.Skip(); } virtual void OnGridLabelClick( wxGridEvent& event ){ event.Skip(); } virtual void OnGridLabelDClick( wxGridEvent& event ){ event.Skip(); } virtual void OnGridRangeSelect( wxGridRangeSelectEvent& event ){ event.Skip(); } virtual void OnGridCellSelected( wxGridEvent& event ){ event.Skip(); } public: CommonPanel( wxWindow* parent, int id = ID_DEFAULT, wxPoint pos = wxDefaultPosition, wxSize size = wxSize( 420,382 ), int style = wxTAB_TRAVERSAL ); }; /////////////////////////////////////////////////////////////////////////////// /// Class AdditionalPanel /////////////////////////////////////////////////////////////////////////////// class AdditionalPanel : public wxPanel { private: protected: wxCalendarCtrl* m_calendar1; wxDatePickerCtrl* m_datePicker1; wxHtmlWindow* m_htmlWin1; wxTreeCtrl* m_treeCtrl1; wxRadioButton* m_radioBtn1; wxToggleButton* m_toggleBtn1; wxScrollBar* m_scrollBar1; wxSpinCtrl* m_spinCtrl1; wxSpinButton* m_spinBtn1; wxSplitterWindow* m_splitter1; wxPanel* m_panel5; wxButton* m_button4; wxPanel* m_panel6; wxButton* m_button3; wxCheckListBox* m_checkList1; wxNotebook* m_notebook1; wxPanel* m_panel7; wxPanel* m_panel8; wxPanel* m_panel9; wxListbook* m_listbook1; wxPanel* m_panel2; wxTextCtrl* m_textCtrl2; wxChoicebook* m_choicebook1; wxPanel* m_panel3; wxListBox* m_listBox2; wxStaticText* m_staticText1; wxScrolledWindow* m_scrolledWindow2; // Virtual event handlers, overide them in your derived class virtual void OnCheckListBox( wxCommandEvent& event ){ event.Skip(); } virtual void OnCheckListBoxDClick( wxCommandEvent& event ){ event.Skip(); } virtual void OnCheckListBoxToggle( wxCommandEvent& event ){ event.Skip(); } public: AdditionalPanel( wxWindow* parent, int id = wxID_ANY, wxPoint pos = wxDefaultPosition, wxSize size = wxSize( 447,514 ), int style = wxTAB_TRAVERSAL ); void m_splitter1OnIdle( wxIdleEvent& ) { m_splitter1->SetSashPosition( 85 ); m_splitter1->Disconnect( wxEVT_IDLE, wxIdleEventHandler( AdditionalPanel::m_splitter1OnIdle ), NULL, this ); } }; #endif //__event_GUI__ wxformbuilder-3.1.59/wxfbTest/wxFBEventAdditionalPanel.h0000644000175000017500000000277511143440026023562 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // RJP Computing - rjpcomputing@gmail.com // /////////////////////////////////////////////////////////////////////////////// #ifndef __wxFBEventAdditionalPanel__ #define __wxFBEventAdditionalPanel__ /** @file Subclass of AdditionalPanel, which is generated by wxFormBuilder. @todo Add your event handlers directly to this file. */ #include "event_GUI.h" /** Implementing AdditionalPanel */ class wxFBEventAdditionalPanel : public AdditionalPanel { public: /** Constructor */ wxFBEventAdditionalPanel( wxWindow* parent ); }; #endif // __wxFBEventAdditionalPanel__ wxformbuilder-3.1.59/wxfbTest/wxFBEventCommonPanel.cpp0000644000175000017500000000226411143440026023266 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // RJP Computing - rjpcomputing@gmail.com // /////////////////////////////////////////////////////////////////////////////// #include "wxFBEventCommonPanel.h" wxFBEventCommonPanel::wxFBEventCommonPanel( wxWindow* parent ) : CommonPanel( parent ) { } wxformbuilder-3.1.59/wxfbTest/wxFBEventsApp.cpp0000644000175000017500000000266011143440026021761 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // RJP Computing - rjpcomputing@gmail.com // /////////////////////////////////////////////////////////////////////////////// #ifdef WX_PRECOMP #include "wx_pch.h" #endif #ifdef __BORLANDC__ #pragma hdrstop #endif //__BORLANDC__ #include "wxFBEventsApp.h" #include "wxFBEventMainFrame.h" IMPLEMENT_APP( wxFBEventsApp ); bool wxFBEventsApp::OnInit() { //::wxInitAllImageHandlers(); wxFBEventMainFrame* frame = new wxFBEventMainFrame( 0L ); // frame->SetIcon( wxICON( aaaa ) ); // To Set App Icon frame->Show(); return true; } wxformbuilder-3.1.59/wxfbTest/main.h0000644000175000017500000000252111143440026017652 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // RJP Computing - rjpcomputing@gmail.com // Ryan Mulder - rjmyst3@gmail.com // /////////////////////////////////////////////////////////////////////////////// #ifndef MAIN_H #define MAIN_H #include "app.h" #include "wxfbTest_GUI.h" class MyFrame: public MainFrame { public: MyFrame(); ~MyFrame(); private: void OnQuit(wxCommandEvent& event); void OnAbout(wxCommandEvent& event); DECLARE_EVENT_TABLE(); }; #endif // MAIN_H wxformbuilder-3.1.59/wxfbTest/wxfbTest.rc0000644000175000017500000000215211143440026020711 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // RJP Computing - rjpcomputing@gmail.com // /////////////////////////////////////////////////////////////////////////////// #include "wx/msw/wx.rc" A ICON MOVEABLE PURE LOADONCALL DISCARDABLE "wxfbTest.ico" wxformbuilder-3.1.59/wxfbTest/wxfbEvent.fbp0000644000175000017500000032623411143440026021230 0ustar rrmulderrrmulder C++|XRC UTF-8 connect event_GUI 1000 none 0 wxFBEvent . 1 1 0 1 0 wxID_ANY MainFrame 500,300 wxDEFAULT_FRAME_STYLE wxTAB_TRAVERSAL 1 OnClose OnSize 1 0 wxID_ANY MyMenuBar m_menubar1 protected &File m_fileMenu protected 0 1 ID_FILE_OPEN wxITEM_NORMAL &Open fileOpenMenuItem OnFileOpen 0 1 ID_FILE_SAVE wxITEM_NORMAL &Save fileSaveMenuItem OnFileSave 0 1 ID_FILE_EXIT wxITEM_NORMAL E&xit fileExitMenuItem OnFileExit Help m_helpMenu protected 0 1 ID_HELP_ABOUT_MENU_ITEM wxITEM_NORMAL &About helpAboutMenuItem 1 0 ID_TOOLBAR m_toolBar1 1 protected 5 wxTB_FLAT|wxTB_HORIZONTAL|wxTB_TEXT ID_OPEN_TOOL wxITEM_NORMAL Open m_openTool OnOpenSelected OnOpenEntered ID_SAVE_TOOL wxITEM_NORMAL Save m_saveTool ID_ABOUT_TOOL wxITEM_NORMAL About m_aboutTool OnAboutClicked OnAboutRClick 1 0 ID_DEFAULT CommonPanel 420,382 wxTAB_TRAVERSAL 2 wxBOTH 0 fgSizer1 wxFLEX_GROWMODE_NONE none 2 0 5 wxALL 0 0 1 0 ID_BUTTON MyButton m_button1 protected OnClick 5 wxALL 0 0 1 0 ID_BITMAP_BUTTON MyButton m_bpButton1 protected wxBU_AUTODRAW OnClickBitmap 5 wxALL 0 1 0 ID_TEXTCTRL 0 m_textCtrl1 protected OnText OnTextEnter OnTextMaxLen OnTextURL 5 wxALL 0 1 0 ID_COMBOBOX m_comboBox1 protected Combo! OnCombobox OnComboText OnComboTextEnter 5 wxALL 0 1 0 ID_CHOICE m_choice1 protected OnChoice 5 wxALL 0 1 0 ID_LISTBOX m_listBox1 protected OnListBox OnListBoxDClick 5 wxALL 0 1 0 ID_LIST_CTRL m_listCtrl1 protected wxLC_ICON OnListColClick OnListDeleteAllItems 5 wxALL 0 0 1 0 ID_CHECKBOX Check Me! m_checkBox1 protected OnCheckBox 5 wxALL 0 'Radio Button' 1 0 ID_RADIOBOX wxRadioBox 1 m_radioBox1 protected 0 wxRA_SPECIFY_COLS OnRadioBox 5 wxALL 0 1 0 ID_SLIDER 100 0 m_slider1 protected wxSL_HORIZONTAL 50 OnCommandScroll OnCommandScrollBottom OnCommandScrollChanged OnScroll OnScrollChanged 5 wxALL 0 0 0 wxALIGN_LEFT wxALIGN_TOP wxALIGN_CENTRE 30 wxALIGN_CENTRE 2 0 1 0 1 1 1 1 0 ID_GRID 0 0 m_grid1 protected wxALIGN_CENTRE 80 wxALIGN_CENTRE 2 OnGridCellClick OnGridCellDClick OnGridCellChanged OnGridCellRightClick OnGridCellRightDClick OnGridEditorCreated OnGridEditorHidden OnGridLabelRightClick OnGridLabelRightDClick OnGridRowSize OnGridColSize OnGridEditorShown OnGridLabelClick OnGridLabelDClick OnGridRangeSelect OnGridCellSelected 1 0 wxID_ANY AdditionalPanel 447,514 wxTAB_TRAVERSAL 2 wxBOTH 0 fgSizer2 wxFLEX_GROWMODE_NONE none 2 0 5 wxALL|wxEXPAND 1 1 0 wxID_ANY m_calendar1 protected wxCAL_SHOW_HOLIDAYS 5 wxALL 1 1 0 wxID_ANY m_datePicker1 protected wxDP_DEFAULT 5 wxALL|wxEXPAND 1 1 0 wxID_ANY m_htmlWin1 protected wxHW_SCROLLBAR_AUTO 5 wxALL|wxEXPAND 1 1 0 wxID_ANY m_treeCtrl1 protected wxTR_DEFAULT_STYLE 5 wxALL 0 1 0 wxID_ANY RadioBtn m_radioBtn1 protected 0 5 wxALL|wxEXPAND 1 1 0 wxID_ANY Toggle me! m_toggleBtn1 protected 0 5 wxALL 0 1 0 wxID_ANY m_scrollBar1 1 protected 100 wxSB_HORIZONTAL 1 0 5 wxALL 0 1 0 wxID_ANY 0 10 0 m_spinCtrl1 protected wxSP_ARROW_KEYS 5 wxALL 0 1 0 wxID_ANY m_spinBtn1 protected 5 wxEXPAND 1 1 0 wxID_ANY 0 m_splitter1 protected 0.0 85 -1 wxSPLIT_VERTICAL wxSP_3D 1 0 wxID_ANY m_panel5 protected wxTAB_TRAVERSAL bSizer1 wxVERTICAL none 5 wxALL 0 0 1 0 wxID_ANY MyButton m_button4 protected 1 0 wxID_ANY m_panel6 protected wxTAB_TRAVERSAL bSizer2 wxVERTICAL none 5 wxALL 0 0 1 0 wxID_ANY MyButton m_button3 protected 5 wxALL|wxEXPAND 0 '1' '2' '3' 1 0 wxID_ANY m_checkList1 protected OnCheckListBox OnCheckListBoxDClick OnCheckListBoxToggle 5 wxEXPAND | wxALL 1 1 0 wxID_ANY m_notebook1 protected a page 1 1 0 wxID_ANY m_panel7 protected wxTAB_TRAVERSAL a page 0 1 0 wxID_ANY m_panel8 protected wxTAB_TRAVERSAL a page 0 1 0 wxID_ANY m_panel9 protected wxTAB_TRAVERSAL 5 wxEXPAND | wxALL 1 1 0 wxID_ANY m_listbook1 protected wxLB_DEFAULT a page 0 1 0 wxID_ANY m_panel2 protected wxTAB_TRAVERSAL bSizer4 wxVERTICAL none 5 wxALL|wxEXPAND 0 1 0 wxID_ANY 0 m_textCtrl2 protected 5 wxEXPAND | wxALL 1 1 0 wxID_ANY m_choicebook1 protected wxCHB_DEFAULT a page 0 1 0 wxID_ANY m_panel3 protected wxTAB_TRAVERSAL bSizer3 wxVERTICAL none 5 wxALL 0 1 0 wxID_ANY m_listBox2 protected 5 wxALL 0 1 0 wxID_ANY MyLabel m_staticText1 protected -1 5 wxEXPAND | wxALL 1 1 0 wxID_ANY m_scrolledWindow2 protected 5 5 wxHSCROLL|wxVSCROLL wxformbuilder-3.1.59/wxfbTest/wxFBEventsApp.h0000644000175000017500000000252411143440026021425 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // RJP Computing - rjpcomputing@gmail.com // /////////////////////////////////////////////////////////////////////////////// #ifndef WXFBEVENTSAPP_H #define WXFBEVENTSAPP_H #include #ifdef __BORLANDC__ #pragma hdrstop #endif #ifndef WX_PRECOMP #include #endif class wxFBEventsApp : public wxApp { public: virtual bool OnInit(); }; #endif // wxFBEventsAPP_H wxformbuilder-3.1.59/wxfbTest/main.cpp0000644000175000017500000000401111143440026020201 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // RJP Computing - rjpcomputing@gmail.com // Ryan Mulder - rjmyst3@gmail.com // /////////////////////////////////////////////////////////////////////////////// #include "main.h" #include //helper functions enum wxbuildinfoformat { short_f, long_f }; wxString wxbuildinfo(wxbuildinfoformat format) { wxString wxbuild(wxVERSION_STRING); if (format == long_f ) { #if defined(__WXMSW__) wxbuild << _T("-Windows"); #elif defined(__UNIX__) wxbuild << _T("-Linux"); #endif #if wxUSE_UNICODE wxbuild << _T("-unicode build"); #else wxbuild << _T("-ANSI build"); #endif // wxUSE_UNICODE } return wxbuild; } BEGIN_EVENT_TABLE(MyFrame, wxFrame) EVT_MENU(ID_EXIT, MyFrame::OnQuit) EVT_MENU(ID_ABOUT, MyFrame::OnAbout) END_EVENT_TABLE() MyFrame::MyFrame() : MainFrame( NULL, wxID_ANY ) { ::wxInitAllImageHandlers(); new MainPanel( this ); } MyFrame::~MyFrame() { } void MyFrame::OnQuit(wxCommandEvent& event) { Close(); } void MyFrame::OnAbout(wxCommandEvent& event) { wxString msg = wxbuildinfo(long_f); wxMessageBox(msg, _("Welcome to...")); } wxformbuilder-3.1.59/wxfbTest/wxfbTest.ico0000644000175000017500000000206611143440026021063 0ustar rrmulderrrmulder &(( @ DDDD DDDD DDD DDD DDD DDD DDDDDDD@DDDD@DDDD@DDDDD@DDDDD@(   D@D@D@DDDDwxformbuilder-3.1.59/wxfbTest/wxfbTest.cbp0000644000175000017500000001306311143440026021054 0ustar rrmulderrrmulder wxformbuilder-3.1.59/wxfbTest/wxFBEventAdditionalPanel.cpp0000644000175000017500000000230411143440026024101 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // RJP Computing - rjpcomputing@gmail.com // /////////////////////////////////////////////////////////////////////////////// #include "wxFBEventAdditionalPanel.h" wxFBEventAdditionalPanel::wxFBEventAdditionalPanel( wxWindow* parent ) : AdditionalPanel( parent ) { } wxformbuilder-3.1.59/wxfbTest/wx_pch.h0000644000175000017500000000271311143440026020221 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // RJP Computing - rjpcomputing@gmail.com // Ryan Mulder - rjmyst3@gmail.com // /////////////////////////////////////////////////////////////////////////////// #ifndef WX_PCH_H_INCLUDED #define WX_PCH_H_INCLUDED #if ( defined(USE_PCH) && !defined(WX_PRECOMP) ) #define WX_PRECOMP #endif // USE_PCH // basic wxWidgets headers #include #ifdef __BORLANDC__ #pragma hdrstop #endif #ifndef WX_PRECOMP #include #endif #ifdef USE_PCH // put here all your rarely-changing header files #endif // USE_PCH #endif // WX_PCH_H_INCLUDED wxformbuilder-3.1.59/wxfbTest/app.h0000644000175000017500000000244511143440026017513 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // RJP Computing - rjpcomputing@gmail.com // Ryan Mulder - rjmyst3@gmail.com // /////////////////////////////////////////////////////////////////////////////// #ifndef APP_H #define APP_H #include #ifdef __BORLANDC__ #pragma hdrstop #endif #ifndef WX_PRECOMP #include #endif class MyApp : public wxApp { public: virtual bool OnInit(); }; #endif // APP_H wxformbuilder-3.1.59/wxfbTest/wxFBEventMainFrame.cpp0000644000175000017500000000244611143440026022717 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // RJP Computing - rjpcomputing@gmail.com // /////////////////////////////////////////////////////////////////////////////// #include "wxFBEventMainFrame.h" #include "wxFBEventAdditionalPanel.h" wxFBEventMainFrame::wxFBEventMainFrame( wxWindow* parent ) : MainFrame( parent ) { // Change the panel you want to show here. new wxFBEventAdditionalPanel( this ); } wxformbuilder-3.1.59/wxfbTest/wxFBEventMainFrame.h0000644000175000017500000000271611143440026022364 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // RJP Computing - rjpcomputing@gmail.com // ///////////////////////////////////////////////////////////////////////////////s #ifndef __wxFBEventMainFrame__ #define __wxFBEventMainFrame__ /** @file Subclass of MainFrame, which is generated by wxFormBuilder. @todo Add your event handlers directly to this file. */ #include "event_GUI.h" /** Implementing MainFrame */ class wxFBEventMainFrame : public MainFrame { public: /** Constructor */ wxFBEventMainFrame( wxWindow* parent ); }; #endif // __wxFBEventMainFrame__ wxformbuilder-3.1.59/wxfbTest/app.cpp0000644000175000017500000000231611143440026020043 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // RJP Computing - rjpcomputing@gmail.com // Ryan Mulder - rjmyst3@gmail.com // /////////////////////////////////////////////////////////////////////////////// #include "app.h" #include "main.h" IMPLEMENT_APP(MyApp); bool MyApp::OnInit() { MyFrame* frame = new MyFrame(); frame->Show(); return true; } wxformbuilder-3.1.59/output/Changelog.txt0000644000175000017500000010655311143440026020751 0ustar rrmulderrrmulder wxFormBuilder ChangeLog ******************************************************************************** 02/06/2009 Version 3.01.59 (Beta) * FS#367 - Project-Properties: encoding is ignored. Fixed ANSII file generation - Loaden * FS#357 - wxFB overrides file without confirmation from user. - hykwok * FS#215 - Abstract or normal class generation. - c16 * FS#394 - Separator reference not accessible through generated C++ code - pmendl * FS#379 - Un/escaped some property values in XRC - malcom 08/04/2008 Version 3.01.58 (Beta) + Added validator support. 04/15/2008 Version 3.00.57 * FS#349 - "RC8 menu editor still generate incorect menu item code" * FS#345 - "Crash on Mac OS X when loading plugins" * Fixed crash on close when showing a propgrid from the wxAdditions plugin in the Designer window. * FS#351 - "Can't edit choises if the '\' is used" 03/18/2008 Version 3.00.56 (RC8) * Added #include to header file when using internationalization. * Custom control now inherits from wxWindow, to provide common properties. * FS#336 - "Incorrect ScrollBar Disconnection" * FS#310 - "FB should not try to disconnect event handlers in dialog/frame's destructor." This is now optional, see the "disconnect_events" property of the Project object. * FS#337 - "Incorrect Vertical Toolbar Rendering" * FS#328 - "Unknown style flag wxTE_BESTWRAP for wxTextCtrl" Removed the flag, it is the default, and #define'd to 0x0000, so it was pointless anyway. * FS#339 - "wx/icon.h not included when using resource icons in wxToolBar" ^ Removed the two project-level XRC properties, "bitmaps" and "icons". These never worked properly, and wxFB is not the right place to enter that information, a standalone XRC file written with any text-editor would be much better. This was prompted by, and caused the closure of, these issues: FS#340 - "bitmap resources are unnamed, preventing use of wxXmlResource::Get()->LoadBitmap()" FS#329 - "XRC Properties - Follow on" * FS#324 - "[wxMac] Buttons on the component palette have a black background" 02/18/2008 Version 3.00.55 (RC7) * FS#319 - "Problems with Non-ASCII characters" * FS#318 - "wxChoice window_name not generated" * FS#314 - "wxListBox + Clicking on wxLC_VIRTUAL causes infinite loop" * FS#317 - "wxFB 3.0 RC6 doesn't show wxStaticBitmap when added (? is shown)" 02/01/2008 Version 3.00.54 (RC6) * FS#308 - Bugs in non-interactive (-g) mode Note: stderr is not normally available on Windows for GUI apps. If -g is used, all logging goes to stderr and debug output. Either start the process with a pipe for stderr (most IDEs will do this for you), or use a Debug Viewer to watch the output. * FS#311 - wxFB 3.0 RC5 still generating incorrect wxMenu(item) code 01/15/2008 Version 3.00.53 (RC5) * Fixed missing C++ code generation for menu separators and menu item bitmaps. * FS#290 - "Toolbarseparator leads to crash if the Bitmapsize differs from default." ^ Improved refresh of selection inside a scrolled window. * Fixed crash on xrc generation for empty bitmap properties. * FS#295 - "SashGravity not exported in XRC" * FS#297 - "wxColourPicker not selectable on form" * FS#298 - "wxFontPickerCtrl not selectable on form" * FS#299 - "wxFilePickerCtrl not selectable on form" * FS#300 - "wxDirPickerCtrl not selectable on form" * FS#301 - "wxToggleButton value property not updated" * Fixed C++ generation of the wxToggleButton "value" property * FS#302 - "wxSpinCtrl initial property not updating" * FS#294 - "wxRadioBox not selectable on form" 12/17/2007 Version 3.00.52 (RC4-1) * Fixed application closing when double clicking on an .fpb file in Windows. * FS#288 - [OS X] Splash screen is truncated * FS#287 - Made wxFormBuilder compile on systems where wxStackWalker is not present * FS#289 - [OS X] Perform file associations on mac 12/14/2007 Version 3.00.51 (RC4) ^ No longer creating a temporary file on disk for the XRC Preview. * FS#247 - "Invalid macro generated by wxFB." * FS#248 - "Property choices of wxChoice: Strings with single quotes are truncated" This forced incrementing the .fbp version to 1.9 * FS#249 - "Paste From Clipboard requires Administrator privileges on Vista" * FS#252 - "OnSize event bug in RC3 for wxPanel." * FS#250 - "Image File Browser default filter should be "All Image Files"" * FS#251 - "UNC paths for images are not supported." * FS#254 - "code duplicating." + FS#257 - "wxStaticBox inside a wxStaticBoxSizer lacks an id" * FS#261 - "wxMenuItem has no 'permission' property" * FS#265 - "wxID_PREFERENCES should not be redefined" * FS#269 - "[OS X] menu items shown at wrong place in menu bar" (patch from Auria) * FS#263 - "Frame not resized correctly in designer when menubar/toolbar/statusbar present" * FS#267 - "[OS X] radio button groups cause crash" * FS#276 - "Creation of two event handlers with different protoypes" (patch from Joel Low) * FS#279 - "missing Append() for wxMenuItem" (patch from denk_mal) * FS#262 - "Centering of Frame/Dialog incorrect when frame/dialog size not pre-defined" * FS#258 - "wxRadioButton enabled value not respected" (patch from Joel Low) * FS#256 - "Gererating Inherited class in different folder output malformed code" * FS#268 - "[OS X] crashes upon termination" (patch from Auria) * FS#277 - "crash on using icon/bitmap resource" * FS#266 - "loading toolbar images from resource" * FS#259 - "Toolbar tools' icon code does not respect toolbar size" * FS#282 - "empty clipboard after closing wxformbuilder" * FS#285 - "Whitespace event handler causes bad code" * FS#283 - "possiblity to set the selection of a wxChoice" + Added stack trace dialog on fatal error. 09/27/2007 Version 3.00.50 (RC3) * FS#234 - "wxFrame name parameter not available." * Property values are no longer trimmed for whitespace when projects are loaded. * FS#235 - "Events don't (always) get attached to the proper object." ^ Common Events are now shared by all controls. * Now clearing the dirty flag when all changes are undone. * Cleaned up the selection of objects on undo/redo. * FS#236 - "include path for XPM Data incorrect." ^ All paths are now generated with '/' as a separator. * Secondary bitmaps of wxBitmapButton are now only generated to XRC if they are used. * The "select" property of notebook pages now corresponds to "selected" in XRC. * Improved XRC import: - Sizers are inserted if necessary and possible. - Properties are now imported correctly where they used to fail in rare cases. - New and informative warnings if an object cannot be imported. * FS#57 - "Can't add toolbar to non-frame containers." * FS#238 - "Crash on Negative Number to growable* properties." ^ Auto sash positioning can now be disabled by setting /mainframe/AutoSash=0 in the config. ^ Enabled live pane update when dragging sashes. * FS#239 - "button.h not included when adding StdDialogButtonSizer." * On Windows, Ctrl+C did not copy text from code editor when an object was not selected. * FS#241 - " not included in generated header." * Removed minimum size from code windows so the tabs and scrollbars no longer disappear as the window is shrinking. * FS#242 - "wxFB does not respect current working directory." ^ FS#246 - "Header file should be written to disk only if changed." 09/06/2007 Version 3.00.49 (RC2) * wxStdDialogButtonSizer events now Connect() to the button, instead of the parent. * Fixed "default" property for wxButton and wxBitmapButton. * Fixed missing bitmap properties on wxBitmapButton. * Applied patch from Ho Yin Kwok to check if the clipboard is open before opening it. * Fixed hang if opened with a project of an older version. * Fixed the find dialog only working one time. * Fixed FS#230 - "Repainting issue with border drawn by wxFormBuilder" * The value of the "precompiled_header" property should now be the exact code to be generated at the top of the source file to support precompiled headers. For example, to include wxprec.h, the value of this property should be: #include This forced a project version uprev to 1.8. This closes FS#232 - "Precompiled headers with Visual C++ 2005". * Removed #include from the generated header. 08/21/2007 Version 3.00.48 (RC1) + FS#227 - "Custom control class name" + Added wxGenericDirCtrl + FS#173 - "Generate event handler stubs in Tools/Generate Inherited Class" 08/16/2007 Version 3.00.47 (Beta 3) + FS#223 - "missing wxTextCtrl style" + FS#222 - "Add an annoying dialog to the XRC Preview." ^ FS#116 - "Having property editor remember its expanded property groups." ^ FS#218 - "Having file dialogs remember their type-selection, e.g. *.png or *.bmp" ^ Added "All image files" to the file type filter for the file browser for bitmap properties. * Switch to Code::Blocks splashscreen class to fix linux transparency. This resolves FS#224 - "Splashscreen problem in Linux". * FS#225 - "Current Radio Button selection not saved to fbp or generated in code." 07/27/2007 Version 3.00.46 (Beta 3) + Added "column_sizes" and "row_sizes" properties to wxGrid. Resizing the columns/rows by dragging is the easiest way to use these. + Added events to wxStdDialogButtonSizer. + Added wxAuiNotebook. + FS#214 - "Create icon for wxAuiNotebook". ^ Reorganized wxGrid properties. * Fixed FS#199 - "tooltips lost on XRC import" * Fixed import of "enabled", "hidden", and "subclass" properties. * Fixed "FS#208 - Error in generated OnUpdateUI event handler registration code." * Fixed "Edit->Paste Object From Clipboard" was not enabled until the next selection. * Fixed FS#216 - "missing header file for wxDatePickerCtrl" * Properties with floating-point values will be saved and generated using the decimal point, but user entry will use the separator ('.' or ',') according to the locale settings. This closes "FS#203 - sashgravity -> float". + Added "FS#211 - Optimized code/xrc generation in preview editors" ^ Massive font update. Default values for font properties are now allowed and encouraged. The "underline" and "family" subproperties are now recognized. Fixed FS#205 - "wxStaticText If you bold a font and then remove the bold, the size shows up wrong" Watch for bugs. ^ Applied patch from ChrisBorgolte which removes the need for wx2.6 compatiblity mode. -wxTHICK_FRAME and wxNO_3D styles have been removed from wxDialog. The project conversion wizard will take appropriate action. ^ Updated images in sample text in wxRichTextCtrl. This resolves FS#221. 06/13/2007 Version 3.00.45 (Beta 3) * Fixed FS#198 - "Wrong place of the ID in a wxHyperlinkCtrl." + Added support for context-sensitive help. To Use: Set the Project's "help_provider" property to one of the help providers listed. Set the "context_help" wxWindow property on any widget. wxMSW: Use the wxDIALOG_EX_CONTEXTHELP extra style on the dialog or frame. Others: Add a wxContextHelpButton by using wxStdDialogButtonSizer. ^ Updated the about dialog to include more details about the people involved in the project. 06-06-2007 Version 3.00.44 (Beta 3) * Fixed FS#193 - "Missing wxTE_PROCESS_ENTER in style of wxComboBox." * Fixed FS#178 - "crash using toolbar" * Fixed sizeritem properties updating in property grid when modified via toolbar. + Added FS#179 - "OnPaint for wxPanel." + Added wxStaticText::Wrap(). + Implemented FS#192 - "Add support for dynamic event handling via Connect() methods." Connect() is now the default implementation of event handling. See the "event_generation" property of the Project object. + Added CustomControl - This allows the user to generate arbitrary code for a control which is not yet fully supported by wxFormBuilder. ^ Updated a bunch of icons. This completes the new theme in wxFormBuilder. + Added wxHyperlinkCtrl. 05-29-2007 Version 3.00.43 (Beta 3) ^ Updated to wxFlatNotebook 2.2 - building with wx2.6.x is no longer supported. All notebooks can now be configured by right-clicking in empty area of tab bar. * Fixed FS#190 - "annoying warning with wxTR_HIDE_ROOT in wxTreeCtrl" + Implemented FS#185 - "Allowing access to wxStdDialogButtonSizer buttons." + Added many more properties to wxGrid. This includes FS#191 - "Editing wxGrid column properties in the designer." * Fixed xrc import of sizeritem, stringlist properties, and wxStdDialogButtonSizer. This was a regresssion in version 3.00.40. 05-21-2007 Version 3.00.42 (Beta 3) + Added Right-Click -> "Close Preview" to XRC Previews. Also much improved the effect of the ESC key in GTK. + Added wxRichTextCtrl 05-11-2007 Version 3.00.41 (Beta 3) * Fixed FS#176 - "Dialog/Frame preview always displays all close/minimize/maximize buttons" Could probably still use some tweaking for the proper behavior in GTK. * Fixed FS#179 - "OnPaint for wxPanel" Moved the OnPaint and OnBackgroundErase events to the common events. * Fixed the wildly inefficient code for choosing the platform's EOL character. Significantly improves code generation (to file) time for larger projects. 05-04-2007 Version 3.00.40 (Beta 3) + Implemented FS#53 - "Copy/Paste between instances of wxFB" See "Copy Object To Clipboard" and "Paste Object from Clipboard" in the "Edit" menu. Note: You can copy an object from wxFB and paste it as xml wherever you can paste text. + Implemented FS#129 - "Controling control alignment from the keyboard." + Implemented FS#135 - "Disabling the delete (Ctrl+D) option in the project's popup menu." ^ Replaced all code using TiXml classes with ticpp classes. WARNING: Although this has been tested, it could cause unforseen bugs. Please report all strangeness. 04-30-2007 Version 3.00.39 (Beta 3) + Implemented FS#110 - "Drag & dropping objects in the Object Tree window." Holding CTRL down will copy the object instead of moving it. + Implemented FS#10 - "add support for sizers as member variables" * Fixed code generation for wxChoice, wxRadioBox, and wxCheckListBox for when the "choices" property is empty. 04-18-2007 Version 3.00.38 (Beta 3) ^ Updated the program icon. * Fixed FS#169 "About dialog box fails to open web browser for home page URL" * Fixed FS#171 "Wrong string literal macro in generated headers for internationalized code generation" * Fixed FS#165 "focus in wxNotebook always switches to the first panel after adding a widget/layout to another panel" * Fixed FS#166 "Adding three tabs to tab control throws an error." * Fixed FS#172 "Event list for wxListCtrl shows "OnListCasheHint" instead of "OnListCacheHint"" * Fixed crash when closing the Find dialog with the Cancel button. * Fixed FS#167 ""Object Properties" splitter position not remembered" 03-27-2007 Version 3.00.37 (Beta 3) + Added mouse events to common events. + Added wxEVT_ERASE_BACKGROUND to wxTopLevelWindow events. 03-26-2007 Version 3.00.36 (Beta 3) * Fixed FS#99 "changes from menu editor remove all handlers." ^ Added a warning for unsupported properties. ^ Moved all container controls to a new containers plug-in. ^ Moved wxGrid to the "Additional" tab. ^ Moved wxRadioButton to the "Common" tab. ^ Moved wxPanel to the new "Containers" tab. ^ Updated most of the "Additional" tabs icons. ^ Reorganized the "Additional" tab. + Added style wxLC_NO_SORT_HEADER to wxListCtrl. + Added XRC support to wxFlatNotebook. + Added wxFontPickerCtrl. + Added wxFilePickerCtrl. + Added wxDirPickerCtrl. + Added OnIconize to wxTopLevelWindow events. 03-19-2007 Version 3.00.35 (Beta 3) + Added wxColourPickerCtrl using source provided by vaius. 03-15-2007 Version 3.00.34 (Beta 3) + Added extra_style property to xrc. This resolves FS#163. * Updated propgrid, which fixed FS#162 "Changing font point size in properties panel causes font size to become huge." ^ Changed font size for xrc editor in gtk to match cpp editors. ^ Editors no longer move horizontal scrollbar when generating. ^ Added a mini wxFormBuilder used controls plug-in. It is disabled until a user downloads the wxAdditions plug-in from the website. (http://wxformbuilder.org/?page_id=30) ^ Now using wxWidgets v2.8.2. 03-09-2007 Version 3.00.33 (Beta 3) + Implemented FS#156 "Ability to wrap generated code in namespace(s)" using patch supplied by kramar. + Implemented FS#157 "Ability to decorate the generated class with dll export" using patch supplied by kramar. + Implemented FS#160 "Support for namespaces for subclass forward declarations" using patch supplied by kramar. * Fixed FS#161 "Tag of items in wxCheckListBox." ^ Moved declaration of menus and submenus to header file. 03-07-2007 Version 3.00.32 (Beta 3) ^ New way to save propgrid values when using menu or toolbar items. Cleaner and cross-platform. 03-06-2007 Version 3.00.31 (Beta 3) * Fixed FS#149 "Double question whether you want to save a project on exit." * Fixed FS#148 "Different generated C++ and XRC file names for unnamed projects." * Fixed FS#154 "Crash when adding a sizer." * Fixed FS#147 "Accepting new property values when clicking on a menu/toolbar item." ^ Implemented FS#138 "Select the 'next' control after deleting a control." 03-05-2007 Version 3.00.30 (Beta 3) ^ Implemented FS#130 "Support for searching through XRC or C++ code." 03-04-2007 Version 3.00.29 (Beta 3) + FS#146 "Displaying keyboard shortcuts in toolbar tooltip windows." + New keyboard shortcut for 'New Project' Ctrl+N. ^ Updated the keyboard shortcut for 'Save As' from "F3" to "Ctrl-Shift+S". ^ Updated the keyboard shortcut for 'Open' from "F2" to "Ctrl+O". 03-03-2007 Version 3.00.28 (Beta 3) * Fixed FS#143 "Silent code generation failure in case of an invalid project path." This was a regression in Version 3.00.27. * Fixed FS#118 "Code not regenerated on property changes." * Fixed FS#119 "Generating files should not force the code display control to scroll back to the top." * Code in the visible panel is now regenerated on object removal and creation, project load, new project and event handler modification. * Fixed FS#144 - "Incorrectly generated C++ code when precompiled_header property was empty." 03-02-2007 Version 3.00.27 (Beta 3) ^ Implemented FS#142 "set wxStaticlines default value to wxEXPAND" ^ Implemented FS#140 "Better code generation selection implementation." Always generate code to the visible panel. Added -l (language) command line option to specify languages to generate when generating from command line. Separate multiple languages with commas. 03-01-2007 Version 3.00.26 (Beta 3) * Fixed FS#136 "Panel size doesn't change properly when 'size' is set to -1" * Fixed FS#137 "Allow -1 for the 'size' property if the minimum/maximum size is set." * Fixed FS#113 "Error when undoing cutting controls." * Fixed FS#97 "Menu items in XRC preview window involve wxFB functionality" ^ Implemented FS#117 "ESC should close the XRC preview form." Note: This will never work on wxGTK because it does not set key events to frames or dialogs. 02-28-2007 Version 3.00.25 (Beta 3) * Fixed FS#100 "Problem with the relative path of XPM" * Fixed FS#126 "Splitter window control without a panel does not get redrawn correctly." * Fixed FS#132 "Splitter window control moves its sash unexpectedly at design time." * Fixed spacer not displaying properly in most sizers. This was a regression in build 3.00.23. * Fixed FS#133 "Error when moving between designer/C++/XRC tabs." This was a regression in build 3.00.24. ^ Now connecting an event handler to idle events for splitter windows to reliably set the initial sash position. 02-27-2007 Version 3.00.24 (Beta 3) * Fixed FS#131 "Folder not getting released after saving a project into it." * Fixed FS#114 "Not being able to cut non-top-level sizers and paste them as top-level sizers." * Fixed FS#124 "Option to create a sizer around a control does not work on top-level sizers." * Fixed FS#104 "Editing XRC/C++ files should be disallowed completely or allowed to affect GUI properties." * Fixed FS#127 "Change 'new' label to 'new project'." * Fixed FS#125 "Buggy cut/paste of panels from splitter window controls." 02-26-2007 Version 3.00.23 (Beta 3) + Added wxGridBagSizer. This closes FS#58. Cannot use wxGBS as the first sizer in a form until the object model improves. ^ Spacer now uses sizeritem, instead of being standalone. This forced a project version uprev to 1.6 ^ Converted all wxLogDebug to Debug::Print so __WXFB_DEBUG__ is used to determine whether or not to log. ^ Improved precompiled header support. NOTE: You must now define WX_PRECOMP when compiling to use a precompiled header. 02-23-2007 Version 3.00.22 (Beta 3) + Added most of the higher level events for wxTopLevelWindows and wxWindow. ^ Updated the event layout and used event inhertitance to get common events throughout the controls. 02-22-2007 Version 3.00.21 (Beta 3) + Added the 'Additional' controls events. * Prevent event handler duplication when there are different event handlers with the same function (but it doesn't check that the event class is the same). * Fixed FS#98 - Non-existing files are removed from the recent files list. + Added wxEVT_UPDATE_UI event to all controls (if it has a sense). 02-18-2007 Version 3.00.20 (Beta 3) * Fixed FS#93 "wxGrid -> Object type unknown in XRC." * Fixed FS#94 "Typo in code generation which includes ." * Fixed FS#96 "No XRC for wxStdDialogButtonSizer." * Added wxRadioBox label to XRC output. ^ "View:XRC Window" now only generates the form that it will display. 02-12-2007 Version 3.00.19 (Beta 3) * Fixed FS#89 "wxSpinCtrl cannot have negative min/max value." * Fixed FS#90 "Can't change the source of a bitmap." * Fixed FS#91 "ID's that start with 'wx' are not properly generated." * MainFrame is updated when a property is changed, even if the object doesn't match with the selected object (i.e. sizeritem obj). ^ wxFrame title bar color now using ActiveCaption. 02-01-2007 Version 3.00.18 (Beta 3) * Undo command of MoveHierarchy (move left) now restores the position of the object. * Fixed FS#86 "Object-tree context-menu "Copy" command has no effect" + Implemented FS#6 "icons and bitmaps support" + Implemented FS#87 "Run as command-line compiler" 01-19-2007 Version 3.00.17 (Beta 2) * Fixed bug where dragging on created dialog statusbar was resizing the main application window. * Fixed FS#85 "required wx/imagelist.h for wxListbook using image files." with help from akira. * Fixed the "relative_path" and "internationalize" properties for code generated from the inner template of a macro. This resolves FS#83 and FS#84. ^ Changed generation of "minimum_size" and "maximum_size" for wxFrame and wxDialog to using SetSizeHints. + Added new 'Generate Inherited Class' dialog. + Added menu events. + Added Toolbar tool events. 01-11-2007 Version 3.00.16 (Beta 2) * Improved tolerance of wxBitmap properties to old project files. This resolves FS#78. + Added "kind" property to tools and added "tooltip" and "statusbar" properties to the generated XRC. This resovles FS#79 "Toggle buttons on toolbar." ^ Updated the splash screen again. 01-09-2007 Version 3.00.15 (Beta 2) + Added new splash screen. * Fixed a focus bug that crashed when adding a sizer in certain container widgets. 01-04-2007 Version 3.00.14 (Beta 2) + Added all known events to the common tab. + Added descriptions of the subproperties for bitmap properties + Added support for using the non-default editors in the property grid. Just add 'editor="Name"' to your xml element for the property. + Added a warning about the removal of the "user_headers" property during the project import process. + The selection border can be drawn even when it extends beyond the edge of the inner content panel. + Catching left clicks on the title bar of innerframe in order to select it. + Added wxSL_BOTH style flag to wxSlider. + Added encoding check for all loaded xml files. The means that the xml files must have a declaration, and the encoding must be UTF-8. If it is not, wxFB will offer to convert the file, from a user chosen original encoding. This resolves FS#69. + Add the .fbp extension when saving if none is chosen. (this is really only an linux issue) + Added a shortcut to the "XRC Window" menu item. + Added property to skip frame's main sizer generation in certain cases for xrc code * Now using ints instead of uints for min, max, and val on wxSlider. * Now remembering right splitter size in classic gui. * Fixed wxSlider XRC generation for the minValue and maxValue properties. * Status bar now stays on the bottom of the frame even when the sizer is empty. - Removed SetVendorName, it just added a level to the hierarchy in the windows registry. ^ Single Instance Stuff: Prefixed lockfiles with '.' so they are hidden. Switched using "localhost" to "127.0.0.1", "localhost" was not working for me. Added a status bar message in the second instance when the first instance is brought to the front. Moved single instance stuff to wxfbipc.cpp/h. ^ General innerframe rendering updates. 12-22-2006 Version 3.00.13 (Beta 2) * Now generating all empty strings as wxEmptyString. This resolves FS#52. * wxRadioBox can now use internationalization on its label, too. This resolves FS#50. * Generation of Microsoft BOM on UTF-8 files is now disabled on platforms other than WXMSW. This resolves FS#46. * Fixed crash when editing the value of a wxTextCtrl in the designer, under certain conditions. This resolves FS#45. 12-8-2006 Version 3.00.12 (Beta 2) * Fixed problems with paths including non-English characters. wxFB can now be installed to such paths, as well as open/save projects, generate code, and import xrc files. This resolves FS#49. * Now only allowing one choice for non_flexible_grow_mode and for flexible_direction on wxFlexGridSizer. This resolves FS#56. 12-4-2006 Version 3.00.11 (Beta 2) * Now generating user_headers include statements above the generated header include. This resolves FS#55. * Fixed FS#51 "notebook-like objects errors while they are included into each other" * Fixed FS#59 "wxCheckListBox: incorrect class name in XRC" * Fixed FS#62 "Sub-Classing top level items doesn't work." This was a big change. The subclass property is now a parent property with two children: name and header. The name is the subclass name, and header is the header to include so that the subclass is defined while building. The header is placed into the correct generated file depending on whether a form or control is being subclassed. This removes most of the purposed of the "user_headers" property, so it has been removed. A "precompiled_header" property was added, with default value of "wx/wxprec.h". This fix necessitated the creation of a "parent" property type, of which "subclass" is the only example. More information on parent properties will soon be added to the wiki. 11-15-2006 Version 3.00.10 (Beta 2) * Fixed FS#63 "Size/minimum-size is not working." * Fixed FS#60 "wxFlexGridSizer vgap/hgap if empty they get generated empty." This was actually a bug with most numerical properties. Added a "uint" property type to solve this. Most numerical properties are now unsigned integers, so the property grid will not let it remain blank, and negative numbers are not accepted. This approach is good because it is clear to the user what will happen when the code is generated. * Fixed FS#66 "Adding common controls to toolbar." * Fixed FS#65 "Unfriendly object tree." * Implemented FS#68 "Smart enable/disable of toolbar items." This was already mostly done. Just needed to enable/disable the appropriate alignment buttons for wxBoxSizer and wxStaticBoxSizer. 10-30-2006 Version 3.00.09 (Beta 2) * Fixed moving left, right, and into a new wxBoxSizer for spacers. * Fixed FS#72 "When editing a property in the property grid, it is lost when you click away." * Fixed FS#73 "Toolbar tools not selecting the object in the object tree." * Fixed FS#71 "wxSplitter window sashpos not being set." 10-27-2006 Version 3.00.08 (Beta 2) * ID_DEFAULT is no longer defined when not used. * Ids beginning with "wxID_" are no longer defined, this is to avoid redefining wxWidgets special identifiers. * Ids for forms now use the "id" property instead of being hardcoded to -1. * Fixed wxSlider XRC generation for the minValue and maxValue properties. 10-26-2006 Version 3.00.07 (Beta 2) ^ wxID_ANY is now the default id. ^ Object tree now saves its state. ^ Object tree now also scrolls horizontally when selecting an object. ^ Added class name and line to error message for unknown classes when importing xrc. ^ Improved both C++ and XRC code generation for wxSplitterWindow. 10-25-2006 Version 3.00.06 (Beta 2) ^ Implemented FS#26 "Chronological id creation." + Added support for using wxSplitterWindow with only one child. + Added min_pane_size and sashsize properties to wxSplitterWindow. + Added maximum size property to wxWindow properties. 10-20-2006 Version 3.00.05 (Beta 2) + Implemented FS#48 "Improve error notification when a plugin is missing." If widgets are missing, the project will not load at all. + Added a boolean "xrc_skip_sizer" property to Frame. The default is value is true. When true, the main sizer of the frame will not be generated in XRC, if the sizer only has one child. This is a workaround for a wx bug that ignores the "size" property of the frame if it has a sizer. This resolves FS#74. + Added encoding check for all loaded xml files. 10-13-2006 Version 3.00.04 (Beta 1) * Fixed visual editor for subpanels. * Fixed circular subclassing. This resolves FS#32. * Fixed Alt-Tab icon. This resolves FS#34. ^ Now limiting to a single instance of wxFB per project file. The resolves FS#31. 10-08-2006 Version 3.00.03 (Beta 1) * Fixed wxWindow settings code generation. 10-07-2006 Version 3.00.02 (Beta 1) * Fixed generation bugs in submenu and wxCheckList (now wxCheckListBox) These were caused by subclass in version 2.00.75. This closes FS#20. * Changed title of save dialog box from "Open Project" to "Save Project" This closes FS#18. * Fixed xrc generation of static bitmap using patch supplied by henrique. This closes FS#16 * Added subclassing on forms. This closes FS#21. * Fixed C++ output of value property for wxGauge. + Added center property for wxDialog and wxFrame. This closes FS#17. + Individual directories for each plug-in. + Toolbar separators. This closes FS#11. + Possibility to group plugin components with toolbar separators. ^ Premake script for sdk projects. ^ Renamed contrib to wxAddition plug-in. ^ Palette now remembers tab order. ^ Major ripup/redesign of the plugin interface. ~ Plugin directory out of src. ~ wxAdditions plug-in to the wxAdditions repository. 09-13-2006 Version 2.00.75 + Added subclass and user_headers properties. This closes FS#5. 09-07-2006 Version 2.00.74 * Fixed behaviour of wxSize and wxPoint properties when NumLock was on (and possibly others). 08-28-2006 Version 2.00.73 ^ File size for wxAdditions in the wxFormBuilder installer. * Fixed behaviour of wxSizer::Fit(). This fixes FS#9 08-25-2006 Version 2.00.72 + Replaced wxPlot with wxPlotCtrl ^ Made checkbox the default for boolean properties. * Fixed xrc generation for bitmap properties (bug FS#4) ^ Automatic linking to wxAdditions is now done through a header distributed with wxAddtions, this is now independent of the version of wxWidgets. - Removed project option for wxWidgets Version. 08-18-2006 Version 2.00.71 + Added a new project option for wxWidgets Version. Currently it can be 2.7+ and 2.6+. + Added support for wxWidgets v2.7.0 for code generation. 08-15-2006 Version 2.00.70 * Fixed the background colour of wxPanel. * Fixed bitmap behavior on menu items. + Added wxScintilla shortcuts (Ctrl-C, Ctrl-V, Ctrl-X). + Added "Default" in the wxPropertyGrid colour selector (some controls don't have the BtnFace colour by default). + Added the properties checked and style to wxCheckBox. ^ Set the default background color of wxFlatNotebook to ButtonFace. ^ Updated wxFB's URL in the generated C++ code. 08-03-2006 Version 2.00.69 * Fixed bug where the first page of listbook, choicebook, and flatnotebook was always selected on refresh. 08-01-2006 Version 2.00.68 * Updated the executable in the installer. Opps ;-). 08-01-2006 Version 2.00.67 ^ Updated icons to look a bit more modern. + Option to make Microsoft BOM for UTF-8 files added to project settings. 07-27-2006 Version 2.00.66 * Fix XRC styles importation. 07-27-2006 Version 2.00.65 ^ Made it so the unique names are created with numbers instead of '_'. 07-26-2006 Version 2.00.64 ^ Made the wxAdditions installer do better checks to determine if the user has wxWidgets installed before deciding where the default directory will be. ~ Moved the download location for wxAdditions to a sourceforge hosted server. 07-25-2006 Version 2.00.63 ^ Fixed a spelling mistake in the installer. 07-25-2006 Version 2.00.62 ^ Added a description in the installer about wxAdditions. 07-24-2006 Version 2.00.61 ^ Installer to dynamically download wxAdditions. ^ wxPropgrid v1.2 07-21-2006 Version 2.00.60 * Fixed Unicode support. * Fixed style not working in a frame and dialog. ^ Code generation for wxRadioBox and wxChoice improved. 07-14-2006 Version 2.00.59 + Added wxScintilla control to contrib. ^ Installer Maintenance release. 07-14-2006 Version 2.00.58 * Fixed Unicode xrc output bug. + Replaced common icons with new look. + Project Conversion supported. 07-06-2006 Version 2.00.57 * Fixed wxMenuBar 'style' property. + Added the move right/left to the right-click menu. 06-28-2006 Version 2.00.56 * Fixed handling of default values for inherited properties. 06-27-2006 Version 2.00.55 + Added refresh call to object inspector panel. + Added code generation for the extra_style property. * Stopped combining bitlists with the same name. * Fixed wxPropertyGridManager disappearing-toolbar bug. (Linux) 06-22-2006 Version 2.00.54 + This changelog is in the installer. * UTF-8 file generation occurrs by default in the unicode build. * Changed the xrc to xml conversions to use the wxConvCurrent conversion. 06-21-2006 Version 2.00.53 + Support for wxScrolledWindow. + Can now set images on wxNotebook and wxFlatNotebook tabs. + Can now set images on wxListbook. + Control IDs can now be generated as an enumeration instead of a list of #defines. + Now supports internationalization. + Can now set the encoding on XRC files. + Now building in Unicode for better Cross-Platform support. + Now supports flexible_direction and non_flexible_grow_mode on wxFlexGridSizer. + Now supports Sort style on wxComboBox. * Message box titles now begin with a lowercase w. - Strange empty lines in generated code. 06-05-2006 Version 2.00.52 + Support for wxListbook. + Support for wxChoicebook. + Added help in the GUI for all properties. 05-17-2006 Version 2.00.51 + Can now use images from windows .rc files for all image properties. 02-10-2006 Version 1.10 - 2.00.50 + Support for wxPlotWindow. + Support for wxPropertyGrid. + Support for wxPropertyGridManager. + Support for wxFlatNotebook. + Support for awxLed. + Support for wxStaticBoxSizer. + Icons to wxFlatnotebook tabs. + Folding to scintilla control. + Line numbers to scintilla control. + Minimum size property to wxWindow. + Code is genereted in the GUI when switching to the notebook page, without requiring a click of the "Code Generation" button. ^ Toolbar icons. ^ Interface now using wxFlatNotebook. ^ Now using the latest propgrid source. ^ Interface now using propgrid manager. ^ Interface now using wxScintilla. ^ Change wxColor property to show a list of system colors. ^ All icons can now be customized from the xml files ^ Change "option" to "proportion" on sizeritems. ^ Switch to tabs for indentation. * Background color issues in the palette. - Typedefs for easier understanding _______________________________________________________________ Legend: + = Addition, * = Bug Fix, - = Removed, ~ = Move, ^ = Updated wxformbuilder-3.1.59/output/license.txt0000644000175000017500000004433411143440026020502 0ustar rrmulderrrmulderwxFormBuilder - A Visual Dialog Editor for wxWidgets. Copyright (C) 2005 Jos Antonio Hurtado This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. ---------------------------------------------------------------- GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. wxformbuilder-3.1.59/plugins/premake.lua0000644000175000017500000000044011143440026020555 0ustar rrmulderrrmulderproject.name = "wxFormBuilder Plugins" -- Add packages here. dopackage( "additional" ) dopackage( "common" ) dopackage( "containers" ) dopackage( "layout" ) dopackage( "wxAdditions" ) -- Add dependency packages here. dopackage( "../sdk/plugin_interface" ) dopackage( "../sdk/tinyxml" ) wxformbuilder-3.1.59/src/rad/wxfbevent.h0000644000175000017500000001165711143440026020477 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #ifndef __WXFBEVENT__ #define __WXFBEVENT__ #include #include "utils/wxfbdefs.h" class wxFBEvent : public wxEvent { private: wxString m_string; public: wxFBEvent( wxEventType commandType = wxEVT_NULL ); wxFBEvent( const wxFBEvent& event ); virtual ~wxFBEvent(); wxString GetEventName(); void SetString( const wxString& newString ); wxString GetString(); // required for sending with wxPostEvent() wxEvent* Clone() const; }; class wxFBPropertyEvent : public wxFBEvent { public: wxFBPropertyEvent(wxEventType commandType, PProperty property); wxFBPropertyEvent( const wxFBPropertyEvent& event ); wxEvent* Clone() const; PProperty GetFBProperty() { return m_property; } private: PProperty m_property; }; class wxFBEventHandlerEvent : public wxFBEvent { public: wxFBEventHandlerEvent (wxEventType commandType, PEvent event); wxFBEventHandlerEvent( const wxFBEventHandlerEvent& event ); wxEvent* Clone() const; PEvent GetFBEventHandler() { return m_event; } private: PEvent m_event; }; class wxFBObjectEvent : public wxFBEvent { public: wxFBObjectEvent(wxEventType commandType, PObjectBase object); wxFBObjectEvent( const wxFBObjectEvent& event ); wxEvent* Clone() const; PObjectBase GetFBObject() { return m_object; } private: PObjectBase m_object; }; typedef void (wxEvtHandler::*wxFBEventFunction) (wxFBEvent&); typedef void (wxEvtHandler::*wxFBPropertyEventFunction)(wxFBPropertyEvent&); typedef void (wxEvtHandler::*wxFBObjectEventFunction) (wxFBObjectEvent&); typedef void (wxEvtHandler::*wxFBEventHandlerEventFunction) (wxFBEventHandlerEvent&); #define wxFBEventHandler(fn) \ (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxFBEventFunction, &fn) #define wxFBPropertyEventHandler(fn) \ (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxFBPropertyEventFunction, &fn) #define wxFBObjectEventHandler(fn) \ (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxFBObjectEventFunction, &fn) #define wxFBEventEventHandler(fn) \ (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxFBEventHandlerEventFunction, &fn) BEGIN_DECLARE_EVENT_TYPES() DECLARE_LOCAL_EVENT_TYPE( wxEVT_FB_PROJECT_LOADED, -1 ) DECLARE_LOCAL_EVENT_TYPE( wxEVT_FB_PROJECT_SAVED, -1 ) DECLARE_LOCAL_EVENT_TYPE( wxEVT_FB_OBJECT_EXPANDED, -1 ) DECLARE_LOCAL_EVENT_TYPE( wxEVT_FB_OBJECT_SELECTED, -1 ) DECLARE_LOCAL_EVENT_TYPE( wxEVT_FB_OBJECT_CREATED, -1 ) DECLARE_LOCAL_EVENT_TYPE( wxEVT_FB_OBJECT_REMOVED, -1 ) DECLARE_LOCAL_EVENT_TYPE( wxEVT_FB_PROPERTY_MODIFIED, -1 ) DECLARE_LOCAL_EVENT_TYPE( wxEVT_FB_PROJECT_REFRESH, -1 ) DECLARE_LOCAL_EVENT_TYPE( wxEVT_FB_CODE_GENERATION, -1 ) DECLARE_LOCAL_EVENT_TYPE( wxEVT_FB_EVENT_HANDLER_MODIFIED, -1 ) END_DECLARE_EVENT_TYPES() #define EVT_FB_PROJECT_LOADED(fn) \ wx__DECLARE_EVT0(wxEVT_FB_PROJECT_LOADED,wxFBEventHandler(fn)) #define EVT_FB_PROJECT_SAVED(fn) \ wx__DECLARE_EVT0(wxEVT_FB_PROJECT_SAVED,wxFBEventHandler(fn)) #define EVT_FB_OBJECT_EXPANDED(fn) \ wx__DECLARE_EVT0(wxEVT_FB_OBJECT_EXPANDED,wxFBObjectEventHandler(fn)) #define EVT_FB_OBJECT_SELECTED(fn) \ wx__DECLARE_EVT0(wxEVT_FB_OBJECT_SELECTED,wxFBObjectEventHandler(fn)) #define EVT_FB_OBJECT_CREATED(fn) \ wx__DECLARE_EVT0(wxEVT_FB_OBJECT_CREATED,wxFBObjectEventHandler(fn)) #define EVT_FB_OBJECT_REMOVED(fn) \ wx__DECLARE_EVT0(wxEVT_FB_OBJECT_REMOVED,wxFBObjectEventHandler(fn)) #define EVT_FB_PROPERTY_MODIFIED(fn) \ wx__DECLARE_EVT0(wxEVT_FB_PROPERTY_MODIFIED,wxFBPropertyEventHandler(fn)) #define EVT_FB_EVENT_HANDLER_MODIFIED(fn) \ wx__DECLARE_EVT0(wxEVT_FB_EVENT_HANDLER_MODIFIED,wxFBEventEventHandler(fn)) #define EVT_FB_PROJECT_REFRESH(fn) \ wx__DECLARE_EVT0(wxEVT_FB_PROJECT_REFRESH,wxFBEventHandler(fn)) #define EVT_FB_CODE_GENERATION(fn) \ wx__DECLARE_EVT0(wxEVT_FB_CODE_GENERATION,wxFBEventHandler(fn)) #endif // __WXFBEVENT__ wxformbuilder-3.1.59/src/rad/appdata.cpp0000644000175000017500000017442111143440026020433 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #include "appdata.h" #include "bitmaps.h" #include "wxfbevent.h" #include "wxfbmanager.h" #include "model/objectbase.h" #include "utils/typeconv.h" #include "utils/debug.h" #include "utils/stringutils.h" #include "utils/wxfbipc.h" #include "utils/wxfbexception.h" #include "codegen/cppcg.h" #include "codegen/xrccg.h" #include "codegen/codewriter.h" #include "rad/xrcpreview/xrcpreview.h" #include "rad/dataobject/dataobject.h" #include #include #include #include #include #include #include #include #include using namespace TypeConv; /////////////////////////////////////////////////////////////////////////////// // Comandos /////////////////////////////////////////////////////////////////////////////// /** Command for expanding an object in the object tree */ class ExpandObjectCmd : public Command { private: PObjectBase m_object; bool m_expand; protected: void DoExecute(); void DoRestore(); public: ExpandObjectCmd( PObjectBase object, bool expand ); }; /** * Comando para insertar un objeto en el árbol. */ class InsertObjectCmd : public Command { private: ApplicationData *m_data; PObjectBase m_parent; PObjectBase m_object; int m_pos; PObjectBase m_oldSelected; protected: void DoExecute(); void DoRestore(); public: InsertObjectCmd( ApplicationData *data, PObjectBase object, PObjectBase parent, int pos = -1 ); }; /** * Comando para borrar un objeto. */ class RemoveObjectCmd : public Command { private: ApplicationData *m_data; PObjectBase m_parent; PObjectBase m_object; int m_oldPos; PObjectBase m_oldSelected; protected: void DoExecute(); void DoRestore(); public: RemoveObjectCmd( ApplicationData *data, PObjectBase object ); }; /** * Comando para modificar una propiedad. */ class ModifyPropertyCmd : public Command { private: PProperty m_property; wxString m_oldValue, m_newValue; protected: void DoExecute(); void DoRestore(); public: ModifyPropertyCmd( PProperty prop, wxString value ); }; /** * Command for modifying an event */ class ModifyEventHandlerCmd : public Command { private: PEvent m_event; wxString m_oldValue, m_newValue; protected: void DoExecute(); void DoRestore(); public: ModifyEventHandlerCmd( PEvent event, wxString value ); }; /** * Comando para mover de posición un objeto. */ class ShiftChildCmd : public Command { private: PObjectBase m_object; int m_oldPos, m_newPos; protected: void DoExecute(); void DoRestore(); public: ShiftChildCmd( PObjectBase object, int pos ); }; /** * CutObjectCmd ademas de eliminar el objeto del árbol se asegura * de eliminar la referencia "clipboard" deshacer el cambio. */ class CutObjectCmd : public Command { private: // necesario para consultar/modificar el objeto "clipboard" ApplicationData *m_data; //PObjectBase m_clipboard; PObjectBase m_parent; PObjectBase m_object; int m_oldPos; PObjectBase m_oldSelected; protected: void DoExecute(); void DoRestore(); public: CutObjectCmd( ApplicationData *data, PObjectBase object ); }; /** * Cambia el padre. */ class ReparentObjectCmd : public Command { private: PObjectBase m_sizeritem; PObjectBase m_sizer; PObjectBase m_oldSizer; int m_oldPosition; protected: void DoExecute(); void DoRestore(); public: ReparentObjectCmd ( PObjectBase sizeritem, PObjectBase sizer ); }; /////////////////////////////////////////////////////////////////////////////// // Implementación de los Comandos /////////////////////////////////////////////////////////////////////////////// ExpandObjectCmd::ExpandObjectCmd( PObjectBase object, bool expand ) : m_object( object ), m_expand( expand ) { } void ExpandObjectCmd::DoExecute() { m_object->SetExpanded( m_expand ); } void ExpandObjectCmd::DoRestore() { m_object->SetExpanded( !m_expand ); } InsertObjectCmd::InsertObjectCmd( ApplicationData *data, PObjectBase object, PObjectBase parent, int pos ) : m_data( data ), m_parent( parent ), m_object( object ), m_pos( pos ) { m_oldSelected = data->GetSelectedObject(); } void InsertObjectCmd::DoExecute() { m_parent->AddChild( m_object ); m_object->SetParent( m_parent ); if ( m_pos >= 0 ) m_parent->ChangeChildPosition( m_object, m_pos ); PObjectBase obj = m_object; while ( obj && obj->GetObjectInfo()->GetObjectType()->IsItem() ) { if ( obj->GetChildCount() > 0 ) obj = obj->GetChild( 0 ); else return; } m_data->SelectObject( obj, false, false ); } void InsertObjectCmd::DoRestore() { m_parent->RemoveChild( m_object ); m_object->SetParent( PObjectBase() ); m_data->SelectObject( m_oldSelected ); } //----------------------------------------------------------------------------- RemoveObjectCmd::RemoveObjectCmd( ApplicationData *data, PObjectBase object ) { m_data = data; m_object = object; m_parent = object->GetParent(); m_oldPos = m_parent->GetChildPosition( object ); m_oldSelected = data->GetSelectedObject(); } void RemoveObjectCmd::DoExecute() { m_parent->RemoveChild( m_object ); m_object->SetParent( PObjectBase() ); m_data->DetermineObjectToSelect( m_parent, m_oldPos ); } void RemoveObjectCmd::DoRestore() { m_parent->AddChild( m_object ); m_object->SetParent( m_parent ); // restauramos la posición m_parent->ChangeChildPosition( m_object, m_oldPos ); m_data->SelectObject( m_oldSelected, true, false ); } //----------------------------------------------------------------------------- ModifyPropertyCmd::ModifyPropertyCmd( PProperty prop, wxString value ) : m_property( prop ), m_newValue( value ) { m_oldValue = prop->GetValue(); } void ModifyPropertyCmd::DoExecute() { m_property->SetValue( m_newValue ); } void ModifyPropertyCmd::DoRestore() { m_property->SetValue( m_oldValue ); } //----------------------------------------------------------------------------- ModifyEventHandlerCmd::ModifyEventHandlerCmd( PEvent event, wxString value ) : m_event( event ), m_newValue( value ) { m_oldValue = event->GetValue(); } void ModifyEventHandlerCmd::DoExecute() { m_event->SetValue( m_newValue ); } void ModifyEventHandlerCmd::DoRestore() { m_event->SetValue( m_oldValue ); } //----------------------------------------------------------------------------- ShiftChildCmd::ShiftChildCmd( PObjectBase object, int pos ) { m_object = object; PObjectBase parent = object->GetParent(); assert( parent ); m_oldPos = parent->GetChildPosition( object ); m_newPos = pos; } void ShiftChildCmd::DoExecute() { if ( m_oldPos != m_newPos ) { PObjectBase parent ( m_object->GetParent() ); parent->ChangeChildPosition( m_object, m_newPos ); } } void ShiftChildCmd::DoRestore() { if ( m_oldPos != m_newPos ) { PObjectBase parent ( m_object->GetParent() ); parent->ChangeChildPosition( m_object, m_oldPos ); } } //----------------------------------------------------------------------------- CutObjectCmd::CutObjectCmd( ApplicationData *data, PObjectBase object ) { m_data = data; m_object = object; m_parent = object->GetParent(); m_oldPos = m_parent->GetChildPosition( object ); m_oldSelected = data->GetSelectedObject(); } void CutObjectCmd::DoExecute() { // guardamos el clipboard ??? //m_clipboard = m_data->GetClipboardObject(); m_data->SetClipboardObject( m_object ); m_parent->RemoveChild( m_object ); m_object->SetParent( PObjectBase() ); m_data->DetermineObjectToSelect( m_parent, m_oldPos ); } void CutObjectCmd::DoRestore() { // reubicamos el objeto donde estaba m_parent->AddChild( m_object ); m_object->SetParent( m_parent ); m_parent->ChangeChildPosition( m_object, m_oldPos ); // restauramos el clipboard //m_data->SetClipboardObject(m_clipboard); m_data->SetClipboardObject( PObjectBase() ); m_data->SelectObject( m_oldSelected, true, false ); } //----------------------------------------------------------------------------- ReparentObjectCmd ::ReparentObjectCmd ( PObjectBase sizeritem, PObjectBase sizer ) { m_sizeritem = sizeritem; m_sizer = sizer; m_oldSizer = m_sizeritem->GetParent(); m_oldPosition = m_oldSizer->GetChildPosition(sizeritem); } void ReparentObjectCmd::DoExecute() { m_oldSizer->RemoveChild( m_sizeritem ); m_sizeritem->SetParent( m_sizer ); m_sizer->AddChild( m_sizeritem ); } void ReparentObjectCmd::DoRestore() { m_sizer->RemoveChild( m_sizeritem ); m_sizeritem->SetParent( m_oldSizer ); m_oldSizer->AddChild( m_sizeritem ); m_oldSizer->ChangeChildPosition( m_sizeritem, m_oldPosition); } /////////////////////////////////////////////////////////////////////////////// // ApplicationData /////////////////////////////////////////////////////////////////////////////// ApplicationData* ApplicationData::s_instance = NULL; ApplicationData* ApplicationData::Get( const wxString &rootdir ) { if ( !s_instance ) s_instance = new ApplicationData( rootdir ); return s_instance; } void ApplicationData::Destroy() { if ( s_instance ) delete s_instance; s_instance = NULL; } void ApplicationData::Initialize() { ApplicationData* appData = ApplicationData::Get(); appData->LoadApp(); } ApplicationData::ApplicationData( const wxString &rootdir ) : m_rootDir( rootdir ), m_modFlag( false ), m_objDb( new ObjectDatabase() ), m_manager( new wxFBManager ), m_ipc( new wxFBIPC ), m_fbpVerMajor( 1 ), m_fbpVerMinor( 9 ) { #ifdef __WXFB_DEBUG__ wxLog* log = wxLog::SetActiveTarget( NULL ); m_debugLogTarget = new wxLogWindow( NULL, wxT( "Logging" ) ); wxLog::SetActiveTarget( log ); #endif m_objDb->SetXmlPath( m_rootDir + wxFILE_SEP_PATH + wxT( "xml" ) + wxFILE_SEP_PATH ) ; m_objDb->SetIconPath( m_rootDir + wxFILE_SEP_PATH + wxT( "resources" ) + wxFILE_SEP_PATH + wxT( "icons" ) + wxFILE_SEP_PATH ); m_objDb->SetPluginPath( m_rootDir + wxFILE_SEP_PATH + wxT( "plugins" ) + wxFILE_SEP_PATH ) ; // Support loading files from memory // Used to load the XRC preview, but could be useful elsewhere wxFileSystem::AddHandler( new wxMemoryFSHandler ); // Support for loading files from archives wxFileSystem::AddHandler( new wxArchiveFSHandler ); wxFileSystem::AddHandler( new wxFilterFSHandler ); } ApplicationData::~ApplicationData() { #ifdef __WXFB_DEBUG__ delete m_debugLogTarget; m_debugLogTarget = 0; #endif } void ApplicationData::LoadApp() { wxString bitmapPath = m_objDb->GetXmlPath() + wxT( "icons.xml" ); AppBitmaps::LoadBitmaps( bitmapPath, m_objDb->GetIconPath() ); m_objDb->LoadObjectTypes(); m_objDb->LoadPlugins( m_manager ); } PwxFBManager ApplicationData::GetManager() { return m_manager; } PObjectBase ApplicationData::GetSelectedObject() { return m_selObj; } PObjectBase ApplicationData::GetSelectedForm() { if ( m_selObj->GetObjectTypeName() == wxT( "form" ) ) return m_selObj; else return m_selObj->FindNearAncestor( wxT( "form" ) ); } PObjectBase ApplicationData::GetProjectData() { return m_project; } void ApplicationData::BuildNameSet( PObjectBase obj, PObjectBase top, std::set< wxString >& name_set ) { if ( obj != top ) { PProperty nameProp = top->GetProperty( wxT( "name" ) ); if ( nameProp ) name_set.insert( nameProp->GetValue() ); } for ( unsigned int i = 0; i < top->GetChildCount(); i++ ) BuildNameSet( obj, top->GetChild( i ), name_set ); } void ApplicationData::ResolveNameConflict( PObjectBase obj ) { while ( obj && obj->GetObjectInfo()->GetObjectType()->IsItem() ) { if ( obj->GetChildCount() > 0 ) obj = obj->GetChild( 0 ); else return; } PProperty nameProp = obj->GetProperty( wxT( "name" ) ); if ( !nameProp ) return; // Save the original name for use later. wxString originalName = nameProp->GetValue(); // el nombre no puede estar repetido dentro del mismo form PObjectBase top = obj->FindNearAncestor( wxT( "form" ) ); if ( !top ) top = m_project; // el objeto es un form. // construimos el conjunto de nombres std::set name_set; BuildNameSet( obj, top, name_set ); // comprobamos si hay conflicto std::set::iterator it = name_set.find( originalName ); int i = 0; wxString name = originalName; // The name that gets incremented. while ( it != name_set.end() ) { i++; name = wxString::Format( wxT( "%s%i" ), originalName.c_str(), i ); it = name_set.find( name ); } nameProp->SetValue( name ); } void ApplicationData::ResolveSubtreeNameConflicts( PObjectBase obj, PObjectBase topObj ) { if ( !topObj ) { topObj = obj->FindNearAncestor( wxT( "form" ) ); if ( !topObj ) topObj = m_project; // object is the project } // Ignore item objects while ( obj && obj->GetObjectInfo()->GetObjectType()->IsItem() ) { if ( obj->GetChildCount() > 0 ) obj = obj->GetChild( 0 ); else return; // error } // Resolve a possible name conflict ResolveNameConflict( obj ); // Recurse through all children for ( unsigned int i = 0 ; i < obj->GetChildCount() ; i++ ) ResolveSubtreeNameConflicts( obj->GetChild( i ), topObj ); } int ApplicationData::CalcPositionOfInsertion( PObjectBase selected, PObjectBase parent ) { int pos = -1; if ( parent && selected ) { PObjectBase parentSelected = selected->GetParent(); while ( parentSelected && parentSelected != parent ) { selected = parentSelected; parentSelected = selected->GetParent(); } if ( parentSelected && parentSelected == parent ) pos = parent->GetChildPosition( selected ) + 1; } return pos; } void ApplicationData::RemoveEmptyItems( PObjectBase obj ) { if ( !obj->GetObjectInfo()->GetObjectType()->IsItem() ) { bool emptyItem = true; // esto es un algoritmo ineficiente pero "seguro" con los índices while ( emptyItem ) { emptyItem = false; for ( unsigned int i = 0; !emptyItem && i < obj->GetChildCount(); i++ ) { PObjectBase child = obj->GetChild( i ); if ( child->GetObjectInfo()->GetObjectType()->IsItem() && child->GetChildCount() == 0 ) { obj->RemoveChild( child ); // borramos el item child->SetParent( PObjectBase() ); emptyItem = true; // volvemos a recorrer wxString msg; msg.Printf( wxT( "Empty item removed under %s" ), obj->GetPropertyAsString( wxT( "name" ) ).c_str() ); wxLogWarning( msg ); } } } } for ( unsigned int i = 0; i < obj->GetChildCount() ; i++ ) RemoveEmptyItems( obj->GetChild( i ) ); } PObjectBase ApplicationData::SearchSizerInto( PObjectBase obj ) { PObjectBase theSizer; if ( obj->GetObjectInfo()->IsSubclassOf( wxT("sizer") ) ) theSizer = obj; else { for ( unsigned int i = 0; !theSizer && i < obj->GetChildCount(); i++ ) theSizer = SearchSizerInto( obj->GetChild( i ) ); } return theSizer; } /////////////////////////////////////////////////////////////////////////////// void ApplicationData::ExpandObject( PObjectBase obj, bool expand ) { PCommand command( new ExpandObjectCmd( obj, expand ) ); Execute( command ); NotifyObjectExpanded( obj ); } bool ApplicationData::SelectObject( PObjectBase obj, bool force /*= false*/, bool notify /*= true */ ) { if ( ( obj == m_selObj ) && !force ) { return false; } m_selObj = obj; if ( notify ) { NotifyObjectSelected( obj ); } return true; } void ApplicationData::CreateObject( wxString name ) { try { Debug::Print( wxT( "[ApplicationData::CreateObject] New %s" ), name.c_str() ); PObjectBase old_selected = GetSelectedObject(); PObjectBase parent = old_selected; PObjectBase obj; if ( parent ) { bool created = false; // Para que sea más práctico, si el objeto no se puede crear debajo // del objeto seleccionado vamos a intentarlo en el padre del seleccionado // y seguiremos subiendo hasta que ya no podamos crear el objeto. while ( parent && !created ) { // además, el objeto se insertará a continuación del objeto seleccionado obj = m_objDb->CreateObject( _STDSTR( name ), parent ); if ( obj ) { int pos = CalcPositionOfInsertion( GetSelectedObject(), parent ); PCommand command( new InsertObjectCmd( this, obj, parent, pos ) ); Execute( command ); //m_cmdProc.Execute(command); created = true; ResolveNameConflict( obj ); } else { // lo vamos a seguir intentando con el padre, pero cuidado, el padre // no puede ser un item! parent = parent->GetParent(); while ( parent && parent->GetObjectInfo()->GetObjectType()->IsItem() ) parent = parent->GetParent(); } } } NotifyObjectCreated( obj ); // Seleccionamos el objeto, si este es un item entonces se selecciona // el objeto contenido. ¿Tiene sentido tener un item debajo de un item? while ( obj && obj->GetObjectInfo()->GetObjectType()->IsItem() ) obj = ( obj->GetChildCount() > 0 ? obj->GetChild( 0 ) : PObjectBase() ); if ( obj ) { SelectObject( obj, true, true ); } else { SelectObject( old_selected, true, true ); } } catch ( wxFBException& ex ) { wxLogError( ex.what() ); } } void ApplicationData::RemoveObject( PObjectBase obj ) { DoRemoveObject( obj, false ); } void ApplicationData::CutObject( PObjectBase obj ) { DoRemoveObject( obj, true ); } void ApplicationData::DoRemoveObject( PObjectBase obj, bool cutObject ) { // Note: // When removing an object it is important that the "item" objects // are not left behind PObjectBase parent = obj->GetParent(); if ( parent ) { // Get the top item while ( parent && parent->GetObjectInfo()->GetObjectType()->IsItem() ) { obj = parent; parent = obj->GetParent(); } if ( cutObject ) { m_copyOnPaste = false; PCommand command( new CutObjectCmd( this, obj ) ); Execute( command ); } else { PCommand command( new RemoveObjectCmd( this, obj ) ); Execute( command ); } NotifyObjectRemoved( obj ); SelectObject( GetSelectedObject(), true, true ); } else { if ( obj->GetObjectTypeName() != wxT( "project" ) ) assert( false ); } CheckProjectTree( m_project ); } void ApplicationData::DetermineObjectToSelect( PObjectBase parent, unsigned int pos ) { // get position of next control or last control PObjectBase objToSelect; unsigned int count = parent->GetChildCount(); if ( 0 == count ) { objToSelect = parent; } else { pos = ( pos < count ? pos : count - 1 ); objToSelect = parent->GetChild( pos ); } while ( objToSelect && objToSelect->GetObjectInfo()->GetObjectType()->IsItem() ) { objToSelect = objToSelect->GetChild( 0 ); } SelectObject( objToSelect ); } void ApplicationData::CopyObjectToClipboard( PObjectBase obj ) { // Write some text to the clipboard // Do not call Open() when the clipboard is opened if( !wxTheClipboard->IsOpened() ) { if ( !wxTheClipboard->Open() ) { return; } } // This data objects are held by the clipboard, // so do not delete them in the app. wxTheClipboard->SetData( new wxFBDataObject( obj ) ); wxTheClipboard->Close(); } bool ApplicationData::PasteObjectFromClipboard( PObjectBase parent ) { // Do not call Open() when the clipboard is opened if( !wxTheClipboard->IsOpened() ) { if ( !wxTheClipboard->Open() ) { return false; } } if ( wxTheClipboard->IsSupported( wxFBDataObjectFormat ) ) { wxFBDataObject data; if ( wxTheClipboard->GetData( data ) ) { PObjectBase obj = data.GetObj(); if ( obj ) { wxTheClipboard->Close(); return PasteObject( parent, obj ); } } } wxTheClipboard->Close(); return false; } bool ApplicationData::CanPasteObjectFromClipboard() { // Do not call Open() when the clipboard is opened if( !wxTheClipboard->IsOpened() ) { if ( !wxTheClipboard->Open() ) { return false; } } bool canPaste = wxTheClipboard->IsSupported( wxFBDataObjectFormat ); wxTheClipboard->Close(); return canPaste; } void ApplicationData::CopyObject( PObjectBase obj ) { m_copyOnPaste = true; // Make a copy of the object on the clipboard, otherwise // modifications to the object after the copy will also // be made on the clipboard. m_clipboard = m_objDb->CopyObject( obj ); CheckProjectTree( m_project ); } bool ApplicationData::PasteObject( PObjectBase parent, PObjectBase objToPaste ) { try { PObjectBase clipboard; if ( objToPaste ) { clipboard = objToPaste; } else if ( m_clipboard ) { if ( m_copyOnPaste ) { clipboard = m_objDb->CopyObject( m_clipboard ); } else { clipboard = m_clipboard; } } if ( !clipboard ) { return false; } // Remove parent/child relationship from clipboard object PObjectBase clipParent = clipboard->GetParent(); if ( clipParent ) { clipParent->RemoveChild( clipboard ); clipboard->SetParent( PObjectBase() ); } // Vamos a hacer un pequeño truco, intentaremos crear un objeto nuevo // del mismo tipo que el guardado en m_clipboard debajo de parent. // El objeto devuelto quizá no sea de la misma clase que m_clipboard debido // a que esté incluido dentro de un "item". // Por tanto, si el objeto devuelto es no-nulo, entonces vamos a descender // en el arbol hasta que el objeto sea de la misma clase que m_clipboard, // momento en que cambiaremos dicho objeto por m_clipboard. // // Ejemplo: // // m_clipboard :: wxButton // parent :: wxBoxSizer // // obj = CreateObject(m_clipboard->GetObjectInfo()->GetClassName(), parent) // // obj :: sizeritem // / // wxButton <- Cambiamos este por m_clipboard PObjectBase old_parent = parent; PObjectBase obj = m_objDb->CreateObject( _STDSTR( clipboard->GetObjectInfo()->GetClassName() ), parent ); // If the object is already contained in an item, we may need to get the object out of the first // item before pasting if ( !obj ) { PObjectBase tempItem = clipboard; while ( tempItem->GetObjectInfo()->GetObjectType()->IsItem() ) { tempItem = tempItem->GetChild( 0 ); if ( !tempItem ) { break; } obj = m_objDb->CreateObject( _STDSTR( tempItem->GetObjectInfo()->GetClassName() ), parent ); if ( obj ) { clipboard = tempItem; break; } } } int pos = -1; if ( !obj ) { // si no se ha podido crear el objeto vamos a intentar crearlo colgado // del padre de "parent" y además vamos a insertarlo en la posición // siguiente a "parent" PObjectBase selected = parent; parent = selected->GetParent(); while ( parent && parent->GetObjectInfo()->GetObjectType()->IsItem() ) { selected = parent; parent = selected->GetParent(); } if ( parent ) { obj = m_objDb->CreateObject( _STDSTR( clipboard->GetObjectInfo()->GetClassName() ), parent ); if ( obj ) { pos = CalcPositionOfInsertion( selected, parent ); } } } if ( !obj ) { return false; } PObjectBase aux = obj; while ( aux && aux->GetObjectInfo() != clipboard->GetObjectInfo() ) aux = ( aux->GetChildCount() > 0 ? aux->GetChild( 0 ) : PObjectBase() ); if ( aux && aux != obj ) { // sustituimos aux por clipboard PObjectBase auxParent = aux->GetParent(); auxParent->RemoveChild( aux ); aux->SetParent( PObjectBase() ); auxParent->AddChild( clipboard ); clipboard->SetParent( auxParent ); } else obj = clipboard; // y finalmente insertamos en el arbol PCommand command( new InsertObjectCmd( this, obj, parent, pos ) ); Execute( command ); if ( !m_copyOnPaste ) m_clipboard.reset(); ResolveSubtreeNameConflicts( obj ); NotifyProjectRefresh(); // vamos a mantener seleccionado el nuevo objeto creado // pero hay que tener en cuenta que es muy probable que el objeto creado // sea un "item" while ( obj && obj->GetObjectInfo()->GetObjectType()->IsItem() ) { assert( obj->GetChildCount() > 0 ); obj = obj->GetChild( 0 ); } SelectObject( obj, true, true ); CheckProjectTree( m_project ); } catch ( wxFBException& ex ) { wxLogError( ex.what() ); return false; } return true; } void ApplicationData::InsertObject( PObjectBase obj, PObjectBase parent ) { // FIXME! comprobar obj se puede colgar de parent // if (parent->GetObjectInfo()->GetObjectType()->FindChildType( // obj->GetObjectInfo()->GetObjectType())) // { PCommand command( new InsertObjectCmd( this, obj, parent ) ); Execute( command ); //m_cmdProc.Execute(command); NotifyProjectRefresh(); // } } void ApplicationData::MergeProject( PObjectBase project ) { // FIXME! comprobar obj se puede colgar de parent for ( unsigned int i = 0; i < project->GetChildCount(); i++ ) { //m_project->AddChild(project->GetChild(i)); //project->GetChild(i)->SetParent(m_project); PObjectBase child = project->GetChild( i ); RemoveEmptyItems( child ); InsertObject( child, m_project ); } // Merge bitmaps and icons properties PObjectBase thisProject = GetProjectData(); PProperty prop = thisProject->GetProperty( _("bitmaps") ); if ( prop ) { wxString value = prop->GetValue(); value.Trim(); value << wxT(" ") << project->GetPropertyAsString( _("bitmaps") ); prop->SetValue( value ); } prop = thisProject->GetProperty( _("icons") ); if ( prop ) { wxString value = prop->GetValue(); value.Trim(); value << wxT(" ") << project->GetPropertyAsString( _("icons") ); prop->SetValue( value ); } NotifyProjectRefresh(); } void ApplicationData::ModifyProperty( PProperty prop, wxString str ) { PObjectBase object = prop->GetObject(); if ( str != prop->GetValue() ) { PCommand command( new ModifyPropertyCmd( prop, str ) ); Execute( command ); //m_cmdProc.Execute(command); NotifyPropertyModified( prop ); } } void ApplicationData::ModifyEventHandler( PEvent evt, wxString value ) { PObjectBase object = evt->GetObject(); if ( value != evt->GetValue() ) { PCommand command( new ModifyEventHandlerCmd( evt, value ) ); Execute( command ); //m_cmdProc.Execute(command); NotifyEventHandlerModified( evt ); } } void ApplicationData::SaveProject( const wxString& filename ) { // Make sure this file is not already open if ( !m_ipc->VerifySingleInstance( filename, false ) ) { if ( wxYES == wxMessageBox( wxT( "You cannot save over a file that is currently open in another instance.\nWould you like to switch to that instance?" ), wxT( "Open in Another Instance" ), wxICON_QUESTION | wxYES_NO, wxTheApp->GetTopWindow() ) ) { m_ipc->VerifySingleInstance( filename, true ); } return; } try { ticpp::Document doc; m_project->Serialize( &doc ); doc.SaveFile( std::string( filename.mb_str( wxConvFile ) ) ); m_projectFile = filename; SetProjectPath( ::wxPathOnly( filename ) ); m_modFlag = false; m_cmdProc.SetSavePoint(); NotifyProjectSaved(); } catch ( ticpp::Exception& ex ) { wxString message = _WXSTR( ex.m_details ); if ( message.empty() ) { message = wxString( ex.m_details.c_str(), wxConvFile ); } THROW_WXFBEX( message ) } } bool ApplicationData::LoadProject( const wxString &file, bool checkSingleInstance ) { Debug::Print( wxT( "LOADING" ) ); if ( !wxFileName::FileExists( file ) ) { wxLogError( wxT( "This file does not exist: %s" ), file.c_str() ); return false; } if ( checkSingleInstance ) { if ( !m_ipc->VerifySingleInstance( file ) ) { return false; } } try { ticpp::Document doc; XMLUtils::LoadXMLFile( doc, false, file ); ticpp::Element* root = doc.FirstChildElement(); m_objDb->ResetObjectCounters(); int fbpVerMajor = 0; int fbpVerMinor = 0; if ( root->Value() != std::string( "object" ) ) { try { ticpp::Element* fileVersion = root->FirstChildElement( "FileVersion" ); fileVersion->GetAttributeOrDefault( "major", &fbpVerMajor, 0 ); fileVersion->GetAttributeOrDefault( "minor", &fbpVerMinor, 0 ); } catch( ticpp::Exception& ) { } } bool older = false; bool newer = false; if ( m_fbpVerMajor == fbpVerMajor ) { older = ( fbpVerMinor < m_fbpVerMinor ); newer = ( fbpVerMinor > m_fbpVerMinor ); } else { older = ( fbpVerMajor < m_fbpVerMajor ); newer = ( fbpVerMajor > m_fbpVerMajor ); } if ( newer ) { wxMessageBox( wxT( "This project file is newer than this version of wxFormBuilder.\n" ) wxT( "It cannot be opened.\n\n" ) wxT( "Please download an updated version from http://www.wxFormBuilder.org" ), _( "New Version" ), wxICON_ERROR ); return false; } if ( older ) { if ( wxYES == wxMessageBox( wxT( "This project file is not of the current version.\n" ) wxT( "Would you to attempt automatic conversion?\n\n" ) wxT( "NOTE: This will modify your project file on disk!" ), _( "Old Version" ), wxYES_NO ) ) { // we make a backup of the project ::wxCopyFile( file, file + wxT( ".bak" ) ); if ( !ConvertProject( file, fbpVerMajor, fbpVerMinor ) ) { wxLogError( wxT( "Unable to convert project" ) ); return false; } XMLUtils::LoadXMLFile( doc, false, file ); root = doc.FirstChildElement(); } else { return false; } } ticpp::Element* object = root->FirstChildElement( "object" ); PObjectBase proj; try { proj = m_objDb->CreateObject( object ); } catch ( wxFBException& ex ) { wxLogError( ex.what() ); return false; } if ( proj && proj->GetObjectTypeName() == wxT( "project" ) ) { PObjectBase old_proj = m_project; m_project = proj; m_selObj = m_project; m_modFlag = false; m_cmdProc.Reset(); m_projectFile = file; SetProjectPath( ::wxPathOnly( file ) ); NotifyProjectLoaded(); NotifyProjectRefresh(); } } catch( ticpp::Exception& ex ) { wxLogError( _WXSTR( ex.m_details ) ); return false; } return true; } bool ApplicationData::ConvertProject( const wxString& path, int fileMajor, int fileMinor ) { try { ticpp::Document doc; XMLUtils::LoadXMLFile( doc, false, path ); ticpp::Element* root = doc.FirstChildElement(); if ( root->Value() == std::string( "object" ) ) { ConvertProjectProperties( root, path, fileMajor, fileMinor ); ConvertObject( root, fileMajor, fileMinor ); // Create a clone of now-converted object tree, so it can be linked // underneath the root element std::auto_ptr< ticpp::Node > objectTree = root->Clone(); // Clear the document to add the declatation and the root element doc.Clear(); // Add the declaration doc.LinkEndChild( new ticpp::Declaration( "1.0", "UTF-8", "yes" ) ); // Add the root element, with file version ticpp::Element* newRoot = new ticpp::Element( "wxFormBuilder_Project" ); ticpp::Element* fileVersion = new ticpp::Element( "FileVersion" ); fileVersion->SetAttribute( "major", m_fbpVerMajor ); fileVersion->SetAttribute( "minor", m_fbpVerMinor ); newRoot->LinkEndChild( fileVersion ); // Add the object tree newRoot->LinkEndChild( objectTree.release() ); doc.LinkEndChild( newRoot ); } else { // Handle project separately because it only occurs once ticpp::Element* project = root->FirstChildElement( "object" ); ConvertProjectProperties( project, path, fileMajor, fileMinor ); ConvertObject( project, fileMajor, fileMinor ); ticpp::Element* fileVersion = root->FirstChildElement( "FileVersion" ); fileVersion->SetAttribute( "major", m_fbpVerMajor ); fileVersion->SetAttribute( "minor", m_fbpVerMinor ); } doc.SaveFile(); } catch ( ticpp::Exception& ex ) { wxLogError( _WXSTR( ex.m_details ) ); return false; } return true; } void ApplicationData::ConvertProjectProperties( ticpp::Element* project, const wxString& path, int fileMajor, int fileMinor ) { // Ensure that this is the "project" element std::string objClass; project->GetAttribute( "class", &objClass ); if ( objClass != "Project" ) { return; } // Reusable sets for finding properties std::set< std::string > oldProps; std::set< ticpp::Element* > newProps; if ( fileMajor < 1 || ( 1 == fileMajor && fileMinor < 5 ) ) { // Find the user_headers property oldProps.insert( "user_headers" ); GetPropertiesToConvert( project, oldProps, &newProps ); std::string user_headers; if ( !newProps.empty() ) { user_headers = ( *newProps.begin() )->GetText( false ); project->RemoveChild( *newProps.begin() ); } if ( !user_headers.empty() ) { wxString msg = _( "The \"user_headers\" property has been removed.\n" ); msg += _( "Its purpose was to provide a place to include precompiled headers or\n" ); msg += _( "headers for subclasses.\n" ); msg += _( "There is now a \"precompiled_header\" property and a \"header\" subitem\n" ); msg += _( "on the subclass property.\n\n" ); msg += _( "Would you like the current value of the \"user_headers\" property to be saved\n" ); msg += _( "to a file so that you can distribute the headers among the \"precompiled_header\"\n" ); msg += _( "and \"subclass\" properties\?" ); if ( wxYES == wxMessageBox( msg, _( "The \"user_headers\" property has been removed" ), wxICON_QUESTION | wxYES_NO | wxYES_DEFAULT, wxTheApp->GetTopWindow() ) ) { wxString name; wxFileName::SplitPath( path, NULL, NULL, &name, NULL ); wxFileDialog dialog( wxTheApp->GetTopWindow(), _( "Save \"user_headers\"" ), ::wxPathOnly( path ), name + wxT( "_user_headers.txt" ), wxT( "All files (*.*)|*.*" ), wxFD_SAVE ); if ( dialog.ShowModal() == wxID_OK ) { wxString wxuser_headers = _WXSTR( user_headers ); wxString filename = dialog.GetPath(); bool success = false; wxFFile output( filename, wxT( "w" ) ); if ( output.IsOpened() ) { if ( output.Write( wxuser_headers ) ) { output.Close(); success = true; } } if ( !success ) { wxLogError( _( "Unable to open %s for writing.\nUser Headers:\n%s" ), filename.c_str(), wxuser_headers.c_str() ); } } } } } // The pch property is now the exact code to be generated, not just the header filename // The goal of this conversion block is to determine which of two possible pch blocks to use // The pch block that wxFB generated changed in version 1.6 if ( fileMajor < 1 || ( 1 == fileMajor && fileMinor < 8 ) ) { oldProps.clear(); newProps.clear(); oldProps.insert( "precompiled_header" ); GetPropertiesToConvert( project, oldProps, &newProps ); if ( !newProps.empty() ) { std::string pch = ( *newProps.begin() )->GetText( false ); if ( !pch.empty() ) { if ( fileMajor < 1 || ( 1 == fileMajor && fileMinor < 6 ) ) { // use the older block ( *newProps.begin() )->SetText( "#include \"" + pch + "\"" "\n" "\n#ifdef __BORLANDC__" "\n#pragma hdrstop" "\n#endif //__BORLANDC__" "\n" "\n#ifndef WX_PRECOMP" "\n#include " "\n#endif //WX_PRECOMP" ); } else { // use the newer block ( *newProps.begin() )->SetText( "#ifdef WX_PRECOMP" "\n" "\n#include \"" + pch + "\"" "\n" "\n#ifdef __BORLANDC__" "\n#pragma hdrstop" "\n#endif //__BORLANDC__" "\n" "\n#else" "\n#include " "\n#endif //WX_PRECOMP" ); } } } } // The format of string list properties changed in version 1.9 if ( fileMajor < 1 || ( 1 == fileMajor && fileMinor < 9 ) ) { oldProps.clear(); newProps.clear(); oldProps.insert( "namespace" ); oldProps.insert( "bitmaps" ); oldProps.insert( "icons" ); GetPropertiesToConvert( project, oldProps, &newProps ); std::set< ticpp::Element* >::iterator prop; for ( prop = newProps.begin(); prop != newProps.end(); ++prop ) { std::string value = ( *prop )->GetText( false ); if ( !value.empty() ) { wxArrayString array = TypeConv::OldStringToArrayString( _WXSTR( value ) ); ( *prop )->SetText( _STDSTR( TypeConv::ArrayStringToString( array ) ) ); } } } } void ApplicationData::ConvertObject( ticpp::Element* parent, int fileMajor, int fileMinor ) { ticpp::Iterator< ticpp::Element > object( "object" ); for ( object = parent->FirstChildElement( "object", false ); object != object.end(); ++object ) { ConvertObject( object.Get(), fileMajor, fileMinor ); } // Reusable sets to find properties with std::set< std::string > oldProps; std::set< ticpp::Element* > newProps; std::set< ticpp::Element* >::iterator newProp; // Get the class of the object std::string objClass; parent->GetAttribute( "class", &objClass ); /* The changes below will convert an unversioned file to version 1.3 */ if ( fileMajor < 1 || ( 1 == fileMajor && fileMinor < 3 ) ) { // The property 'option' became 'proportion' if ( objClass == "sizeritem" || objClass == "spacer" ) { oldProps.clear(); oldProps.insert( "option" ); GetPropertiesToConvert( parent, oldProps, &newProps ); if ( !newProps.empty() ) { // One in, one out ( *newProps.begin() )->SetAttribute( "name", "proportion" ); } } // The 'style' property used to have both wxWindow styles and the styles of the specific controls // now it only has the styles of the specfic controls, and wxWindow styles are saved in window_style // This also applies to 'extra_style', which was once combined with 'style'. // And they were named 'WindowStyle' and one point, too... std::set< wxString > windowStyles; windowStyles.insert( wxT( "wxSIMPLE_BORDER" ) ); windowStyles.insert( wxT( "wxDOUBLE_BORDER" ) ); windowStyles.insert( wxT( "wxSUNKEN_BORDER" ) ); windowStyles.insert( wxT( "wxRAISED_BORDER" ) ); windowStyles.insert( wxT( "wxSTATIC_BORDER" ) ); windowStyles.insert( wxT( "wxNO_BORDER" ) ); windowStyles.insert( wxT( "wxTRANSPARENT_WINDOW" ) ); windowStyles.insert( wxT( "wxTAB_TRAVERSAL" ) ); windowStyles.insert( wxT( "wxWANTS_CHARS" ) ); windowStyles.insert( wxT( "wxVSCROLL" ) ); windowStyles.insert( wxT( "wxHSCROLL" ) ); windowStyles.insert( wxT( "wxALWAYS_SHOW_SB" ) ); windowStyles.insert( wxT( "wxCLIP_CHILDREN" ) ); windowStyles.insert( wxT( "wxFULL_REPAINT_ON_RESIZE" ) ); // Transfer the window styles oldProps.clear(); oldProps.insert( "style" ); oldProps.insert( "WindowStyle" ); GetPropertiesToConvert( parent, oldProps, &newProps ); for ( newProp = newProps.begin(); newProp != newProps.end(); ++newProp ) { TransferOptionList( *newProp, &windowStyles, "window_style" ); } std::set< wxString > extraWindowStyles; extraWindowStyles.insert( wxT( "wxWS_EX_VALIDATE_RECURSIVELY" ) ); extraWindowStyles.insert( wxT( "wxWS_EX_BLOCK_EVENTS" ) ); extraWindowStyles.insert( wxT( "wxWS_EX_TRANSIENT" ) ); extraWindowStyles.insert( wxT( "wxWS_EX_PROCESS_IDLE" ) ); extraWindowStyles.insert( wxT( "wxWS_EX_PROCESS_UI_UPDATES" ) ); // Transfer the window extra styles oldProps.clear(); oldProps.insert( "style" ); oldProps.insert( "extra_style" ); oldProps.insert( "WindowStyle" ); GetPropertiesToConvert( parent, oldProps, &newProps ); for ( newProp = newProps.begin(); newProp != newProps.end(); ++newProp ) { TransferOptionList( *newProp, &extraWindowStyles, "window_extra_style" ); } } /* The file is now at at least version 1.3 */ if ( fileMajor < 1 || ( 1 == fileMajor && fileMinor < 4 ) ) { if ( objClass == "wxCheckList" ) { // The class we once named "wxCheckList" really represented a "wxCheckListBox", now that we use the #class macro in // code generation, it generates the wrong code parent->SetAttribute( "class", "wxCheckListBox" ); } } /* The file is now at at least version 1.4 */ if ( fileMajor < 1 || ( 1 == fileMajor && fileMinor < 6 ) ) { if ( objClass == "spacer" ) { // spacer used to be represented by its own class, it is now under a sizeritem like everything else. // no need to check for a wxGridBagSizer, because it was introduced at the same time. // the goal is to change the class to sizeritem, then create a spacer child, then move "width" and "height" to the spacer parent->SetAttribute( "class", "sizeritem" ); ticpp::Element spacer( "object" ); spacer.SetAttribute( "class", "spacer" ); oldProps.clear(); oldProps.insert( "width" ); GetPropertiesToConvert( parent, oldProps, &newProps ); if ( !newProps.empty() ) { // One in, one out ticpp::Element* width = *newProps.begin(); spacer.LinkEndChild( width->Clone().release() ); parent->RemoveChild( width ); } oldProps.clear(); oldProps.insert( "height" ); GetPropertiesToConvert( parent, oldProps, &newProps ); if ( !newProps.empty() ) { // One in, one out ticpp::Element* height = *newProps.begin(); spacer.LinkEndChild( height->Clone().release() ); parent->RemoveChild( height ); } parent->LinkEndChild( &spacer ); } } /* The file is now at at least version 1.6 */ // Version 1.7 now stores all font properties. // The font property conversion is automatic because it is just an extension of the old values. if ( fileMajor < 1 || ( 1 == fileMajor && fileMinor < 7 ) ) { // Remove deprecated 2.6 things // wxDialog styles wxTHICK_FRAME and wxNO_3D if ( objClass == "Dialog" ) { oldProps.clear(); oldProps.insert( "style" ); GetPropertiesToConvert( parent, oldProps, &newProps ); if ( !newProps.empty() ) { ticpp::Element* style = *newProps.begin(); wxString styles = _WXSTR( style->GetText( false ) ); if ( !styles.empty() ) { if ( TypeConv::FlagSet( wxT("wxTHICK_FRAME"), styles ) ) { styles = TypeConv::ClearFlag( wxT("wxTHICK_FRAME"), styles ); styles = TypeConv::SetFlag( wxT("wxRESIZE_BORDER"), styles ); } styles = TypeConv::ClearFlag( wxT("wxNO_3D"), styles ); style->SetText( _STDSTR( styles ) ); } } } } /* The file is now at at least version 1.7 */ // The update to 1.8 only affected project properties // See ConvertProjectProperties /* The file is now at at least version 1.8 */ // stringlist properties are stored in a different format as of version 1.9 if ( fileMajor < 1 || ( 1 == fileMajor && fileMinor < 9 ) ) { oldProps.clear(); newProps.clear(); if ( objClass == "wxComboBox" || objClass == "wxChoice" || objClass == "wxListBox" || objClass == "wxRadioBox" || objClass == "wxCheckListBox" ) { oldProps.insert( "choices" ); } else if ( objClass == "wxGrid" ) { oldProps.insert( "col_label_values" ); oldProps.insert( "row_label_values" ); } if ( !oldProps.empty() ) { GetPropertiesToConvert( parent, oldProps, &newProps ); std::set< ticpp::Element* >::iterator prop; for ( prop = newProps.begin(); prop != newProps.end(); ++prop ) { std::string value = ( *prop )->GetText( false ); if ( !value.empty() ) { wxArrayString array = TypeConv::OldStringToArrayString( _WXSTR( value ) ); ( *prop )->SetText( _STDSTR( TypeConv::ArrayStringToString( array ) ) ); } } } } /* The file is now at at least version 1.9 */ } void ApplicationData::GetPropertiesToConvert( ticpp::Node* parent, const std::set< std::string >& names, std::set< ticpp::Element* >* properties ) { // Clear result set properties->clear(); ticpp::Iterator< ticpp::Element > prop( "property" ); for ( prop = parent->FirstChildElement( "property", false ); prop != prop.end(); ++prop ) { std::string name; prop->GetAttribute( "name", &name ); if ( names.find( name ) != names.end() ) { properties->insert( prop.Get() ); } } } void ApplicationData::TransferOptionList( ticpp::Element* prop, std::set< wxString >* options, const std::string& newPropName ) { wxString value = _WXSTR( prop->GetText( false ) ); std::set< wxString > transfer; std::set< wxString > keep; // Sort options - if in the 'options' set, they should be transferred to a property named 'newPropName' // otherwise, they should stay wxStringTokenizer tkz( value, wxT( "|" ), wxTOKEN_RET_EMPTY_ALL ); while ( tkz.HasMoreTokens() ) { wxString option = tkz.GetNextToken(); option.Trim( false ); option.Trim( true ); if ( options->find( option ) != options->end() ) { // Needs to be transferred transfer.insert( option ); } else { // Should be kept keep.insert( option ); } } // Reusable sets to find properties with std::set< std::string > oldProps; std::set< ticpp::Element* > newProps; // If there are any to transfer, add to the target property, or make a new one ticpp::Node* parent = prop->Parent(); if ( !transfer.empty() ) { // Check for the target property ticpp::Element* newProp; wxString newOptionList; oldProps.clear(); oldProps.insert( newPropName ); GetPropertiesToConvert( parent, oldProps, &newProps ); if ( !newProps.empty() ) { newProp = *newProps.begin(); newOptionList << wxT( "|" ) << _WXSTR( newProp->GetText( false ) ); } else { newProp = new ticpp::Element( "property" ); newProp->SetAttribute( "name", newPropName ); } std::set< wxString >::iterator option; for ( option = transfer.begin(); option != transfer.end(); ++option ) { newOptionList << wxT( "|" ) << *option; } newProp->SetText( _STDSTR( newOptionList.substr( 1 ) ) ); if ( newProps.empty() ) { parent->InsertBeforeChild( prop, *newProp ); delete newProp; } } // Set the value of the property to whatever is left if ( keep.empty() ) { parent->RemoveChild( prop ); } else { std::set< wxString >::iterator option; wxString newOptionList; for ( option = keep.begin(); option != keep.end(); ++option ) { newOptionList << wxT( "|" ) << *option; } prop->SetText( _STDSTR( newOptionList.substr( 1 ) ) ); } } void ApplicationData::NewProject() { m_project = m_objDb->CreateObject( "Project" ); m_selObj = m_project; m_modFlag = false; m_cmdProc.Reset(); m_projectFile = wxT( "" ); SetProjectPath( wxT( "" ) ); m_ipc->Reset(); NotifyProjectRefresh(); } void ApplicationData::GenerateCode( bool panelOnly ) { NotifyCodeGeneration( panelOnly ); } void ApplicationData::GenerateInheritedClass( PObjectBase form, wxString className, wxString path, wxString file ) { try { PObjectBase project = GetProjectData(); if ( !project ) { wxLogWarning( _("No Project?!") ); return; } if ( !::wxDirExists( path ) ) { wxLogWarning( _("Invalid Path: %s"), path.c_str() ); return; } PObjectBase obj = m_objDb->CreateObject( "UserClasses", PObjectBase() ); PProperty baseNameProp = obj->GetProperty( wxT( "basename" ) ); PProperty nameProp = obj->GetProperty( wxT( "name" ) ); PProperty fileProp = obj->GetProperty( wxT( "file" ) ); PProperty genfileProp = obj->GetProperty( wxT( "gen_file" ) ); PProperty typeProp = obj->GetProperty( wxT( "type" ) ); if ( !( baseNameProp && nameProp && fileProp && typeProp && genfileProp ) ) { wxLogWarning( wxT("Missing Property") ); return; } wxFileName inherFile( file ); if ( !inherFile.MakeAbsolute( path ) ) { wxLogWarning( _("Unable to make \"%s\" absolute to \"%s\""), file.c_str(), path.c_str() ); return; } const wxString& genFileValue = project->GetPropertyAsString( _("file") ); wxFileName genFile( genFileValue ); if ( !genFile.MakeAbsolute( path ) ) { wxLogWarning( _("Unable to make \"%s\" absolute to \"%s\""), genFileValue.c_str(), path.c_str() ); return; } const wxString& genFileFullPath = genFile.GetFullPath(); if ( !genFile.MakeRelativeTo( inherFile.GetPath( wxPATH_GET_VOLUME ) ) ) { wxLogWarning( _("Unable to make \"%s\" relative to \"%s\""), genFileFullPath.c_str(), inherFile.GetPath( wxPATH_GET_VOLUME ).c_str() ); return; } baseNameProp->SetValue( form->GetPropertyAsString( _("name") ) ); nameProp->SetValue( className ); fileProp->SetValue( inherFile.GetName() ); genfileProp->SetValue( genFile.GetFullPath() ); typeProp->SetValue( form->GetClassName() ); CppCodeGenerator codegen; // Determine if Microsoft BOM should be used bool useMicrosoftBOM = false; PProperty pUseMicrosoftBOM = project->GetProperty( _("use_microsoft_bom") ); if ( pUseMicrosoftBOM ) { useMicrosoftBOM = ( pUseMicrosoftBOM->GetValueAsInteger() != 0 ); } // Determine if Utf8 or Ansi is to be created bool useUtf8 = false; PProperty pUseUtf8 = project->GetProperty( _("encoding") ); if ( pUseUtf8 ) { useUtf8 = ( pUseUtf8->GetValueAsString() != wxT("ANSI") ); } const wxString& fullPath = inherFile.GetFullPath(); PCodeWriter h_cw( new FileCodeWriter( fullPath + wxT(".h"), useMicrosoftBOM, useUtf8 ) ); PCodeWriter cpp_cw( new FileCodeWriter( fullPath + wxT(".cpp"), useMicrosoftBOM, useUtf8 ) ); codegen.SetHeaderWriter( h_cw ); codegen.SetSourceWriter( cpp_cw ); codegen.GenerateInheritedClass( obj, form ); wxLogStatus( wxT( "Class generated at \'%s\'." ), path.c_str() ); } catch( wxFBException& ex ) { wxLogError( ex.what() ); } } void ApplicationData::MovePosition( PObjectBase obj, bool right, unsigned int num ) { PObjectBase noItemObj = obj; PObjectBase parent = obj->GetParent(); if ( parent ) { // Si el objeto está incluido dentro de un item hay que desplazar // el item while ( parent && parent->GetObjectInfo()->GetObjectType()->IsItem() ) { obj = parent; parent = obj->GetParent(); } unsigned int pos = parent->GetChildPosition( obj ); // nos aseguramos de que los límites son correctos unsigned int children_count = parent->GetChildCount(); if ( ( right && num + pos < children_count ) || !right && ( num <= pos ) ) { pos = ( right ? pos + num : pos - num ); PCommand command( new ShiftChildCmd( obj, pos ) ); Execute( command ); //m_cmdProc.Execute(command); NotifyProjectRefresh(); SelectObject( noItemObj, true ); } } } void ApplicationData::MoveHierarchy( PObjectBase obj, bool up ) { PObjectBase sizeritem = obj->GetParent(); if ( !( sizeritem && sizeritem->GetObjectInfo()->IsSubclassOf( wxT("sizeritembase") ) ) ) { return; } PObjectBase nextSizer = sizeritem->GetParent(); // points to the object's sizer if ( nextSizer ) { if ( up ) { do { nextSizer = nextSizer->GetParent(); } while ( nextSizer && !nextSizer->GetObjectInfo()->IsSubclassOf( wxT("sizer") ) ); if ( nextSizer && nextSizer->GetObjectInfo()->IsSubclassOf( wxT("sizer") ) ) { PCommand cmdReparent( new ReparentObjectCmd( sizeritem, nextSizer ) ); Execute( cmdReparent ); NotifyProjectRefresh(); SelectObject( obj, true ); } } else { // object will be move to the top sizer of the next sibling object // subtree. unsigned int pos = nextSizer->GetChildPosition( sizeritem ) + 1; if ( pos < nextSizer->GetChildCount() ) { nextSizer = SearchSizerInto( nextSizer->GetChild( pos ) ); if ( nextSizer ) { PCommand cmdReparent( new ReparentObjectCmd( sizeritem, nextSizer ) ); Execute( cmdReparent ); NotifyProjectRefresh(); SelectObject( obj, true ); } } } } } void ApplicationData::Undo() { m_cmdProc.Undo(); m_modFlag = !m_cmdProc.IsAtSavePoint(); NotifyProjectRefresh(); CheckProjectTree( m_project ); NotifyObjectSelected( GetSelectedObject() ); } void ApplicationData::Redo() { m_cmdProc.Redo(); m_modFlag = !m_cmdProc.IsAtSavePoint(); NotifyProjectRefresh(); CheckProjectTree( m_project ); NotifyObjectSelected( GetSelectedObject() ); } void ApplicationData::ToggleExpandLayout( PObjectBase obj ) { if ( !obj ) { return; } PObjectBase parent = obj->GetParent(); if ( !parent ) { return; } if ( !parent->GetObjectInfo()->IsSubclassOf( wxT("sizeritembase") ) ) { return; } PProperty propFlag = parent->GetProperty( wxT("flag") ); if( !propFlag ) { return; } wxString value; wxString currentValue = propFlag->GetValueAsString(); value = ( TypeConv::FlagSet( wxT("wxEXPAND"), currentValue ) ? TypeConv::ClearFlag( wxT("wxEXPAND"), currentValue ) : TypeConv::SetFlag( wxT("wxEXPAND"), currentValue ) ); ModifyProperty( propFlag, value ); } void ApplicationData::ToggleStretchLayout( PObjectBase obj ) { if ( !obj ) { return; } PObjectBase parent = obj->GetParent(); if ( !parent ) { return; } if ( parent->GetObjectTypeName() != wxT("sizeritem") ) { return; } PProperty proportion = parent->GetProperty( wxT("proportion") ); if ( !proportion ) { return; } wxString value = ( proportion->GetValue() != wxT("0") ? wxT( "0" ) : wxT( "1" ) ); ModifyProperty( proportion, value ); } void ApplicationData::CheckProjectTree( PObjectBase obj ) { assert( obj ); for ( unsigned int i = 0; i < obj->GetChildCount(); i++ ) { PObjectBase child = obj->GetChild( i ); if ( child->GetParent() != obj ) wxLogError( wxString::Format( wxT( "Parent of object \'%s\' is wrong!" ), child->GetPropertyAsString( wxT( "name" ) ).c_str() ) ); CheckProjectTree( child ); } } bool ApplicationData::GetLayoutSettings( PObjectBase obj, int *flag, int *option, int *border, int* orient ) { if ( !obj ) { return false; } PObjectBase parent = obj->GetParent(); if ( !parent ) { return false; } if ( parent->GetObjectInfo()->IsSubclassOf( wxT("sizeritembase") ) ) { PProperty propOption = parent->GetProperty( wxT("proportion") ); if ( propOption ) { *option = propOption->GetValueAsInteger(); } *flag = parent->GetPropertyAsInteger( wxT("flag") ); *border = parent->GetPropertyAsInteger( wxT("border") ); PObjectBase sizer = parent->GetParent(); if ( sizer ) { wxString parentName = sizer->GetClassName(); if ( wxT("wxBoxSizer") == parentName || wxT("wxStaticBoxSizer") == parentName ) { PProperty propOrient = sizer->GetProperty( wxT("orient") ); if ( propOrient ) { *orient = propOrient->GetValueAsInteger(); } } } return true; } return false; } void ApplicationData::ChangeAlignment ( PObjectBase obj, int align, bool vertical ) { if ( !obj ) { return; } PObjectBase parent = obj->GetParent(); if ( !parent ) { return; } if ( !parent->GetObjectInfo()->IsSubclassOf( wxT("sizeritembase") ) ) { return; } PProperty propFlag = parent->GetProperty( wxT( "flag" ) ); if ( !propFlag ) { return; } wxString value = propFlag->GetValueAsString(); // Primero borramos los flags de la configuración previa, para así // evitar conflictos de alineaciones. if ( vertical ) { value = TypeConv::ClearFlag( wxT( "wxALIGN_TOP" ), value ); value = TypeConv::ClearFlag( wxT( "wxALIGN_BOTTOM" ), value ); value = TypeConv::ClearFlag( wxT( "wxALIGN_CENTER_VERTICAL" ), value ); } else { value = TypeConv::ClearFlag( wxT( "wxALIGN_LEFT" ), value ); value = TypeConv::ClearFlag( wxT( "wxALIGN_RIGHT" ), value ); value = TypeConv::ClearFlag( wxT( "wxALIGN_CENTER_HORIZONTAL" ), value ); } wxString alignStr; switch ( align ) { case wxALIGN_RIGHT: alignStr = wxT( "wxALIGN_RIGHT" ); break; case wxALIGN_CENTER_HORIZONTAL: alignStr = wxT( "wxALIGN_CENTER_HORIZONTAL" ); break; case wxALIGN_BOTTOM: alignStr = wxT( "wxALIGN_BOTTOM" ); break; case wxALIGN_CENTER_VERTICAL: alignStr = wxT( "wxALIGN_CENTER_VERTICAL" ); break; } value = TypeConv::SetFlag( alignStr, value ); ModifyProperty( propFlag, value ); } void ApplicationData::ToggleBorderFlag( PObjectBase obj, int border ) { if ( !obj ) { return; } PObjectBase parent = obj->GetParent(); if ( !parent ) { return; } if ( !parent->GetObjectInfo()->IsSubclassOf( wxT("sizeritembase") ) ) { return; } PProperty propFlag = parent->GetProperty( wxT( "flag" ) ); if ( !propFlag ) { return; } wxString value = propFlag->GetValueAsString(); value = TypeConv::ClearFlag( wxT( "wxALL" ), value ); value = TypeConv::ClearFlag( wxT( "wxTOP" ), value ); value = TypeConv::ClearFlag( wxT( "wxBOTTOM" ), value ); value = TypeConv::ClearFlag( wxT( "wxRIGHT" ), value ); value = TypeConv::ClearFlag( wxT( "wxLEFT" ), value ); int intVal = propFlag->GetValueAsInteger(); intVal ^= border; if ( ( intVal & wxALL ) == wxALL ) value = TypeConv::SetFlag( wxT( "wxALL" ), value ); else { if ( ( intVal & wxTOP ) != 0 ) value = TypeConv::SetFlag( wxT( "wxTOP" ), value ); if ( ( intVal & wxBOTTOM ) != 0 ) value = TypeConv::SetFlag( wxT( "wxBOTTOM" ), value ); if ( ( intVal & wxRIGHT ) != 0 ) value = TypeConv::SetFlag( wxT( "wxRIGHT" ), value ); if ( ( intVal & wxLEFT ) != 0 ) value = TypeConv::SetFlag( wxT( "wxLEFT" ), value ); } ModifyProperty( propFlag, value ); } void ApplicationData::CreateBoxSizerWithObject( PObjectBase obj ) { PObjectBase parent = obj->GetParent(); if ( !parent ) { return; } PObjectBase grandParent = parent->GetParent(); if ( !grandParent ) { return; } int childPos = -1; if ( parent->GetObjectInfo()->IsSubclassOf( wxT("sizeritembase") ) ) { childPos = (int)grandParent->GetChildPosition( parent ); parent = grandParent; } // Must first cut the old object in case it is the only allowable object PObjectBase clipboard = m_clipboard; CutObject( obj ); // Create the wxBoxSizer PObjectBase newSizer = m_objDb->CreateObject( "wxBoxSizer", parent ); if ( newSizer ) { PCommand cmd( new InsertObjectCmd( this, newSizer, parent, childPos ) ); Execute( cmd ); if ( newSizer->GetObjectTypeName() == wxT("sizeritem") ) newSizer = newSizer->GetChild( 0 ); PasteObject( newSizer ); m_clipboard = clipboard; //NotifyProjectRefresh(); } else { Undo(); m_clipboard = clipboard; } } void ApplicationData::ShowXrcPreview() { PObjectBase form = GetSelectedForm(); if ( form == NULL ) { wxMessageBox( wxT( "Please select a form and try again." ), wxT( "No Form Selected" ), wxICON_ERROR ); return; } XRCPreview::Show( form, GetProjectPath() ); } bool ApplicationData::CanPasteObject() { PObjectBase obj = GetSelectedObject(); if ( obj && obj->GetObjectTypeName() != wxT( "project" ) ) return ( m_clipboard != NULL ); return false; } bool ApplicationData::CanCopyObject() { PObjectBase obj = GetSelectedObject(); if ( obj && obj->GetObjectTypeName() != wxT( "project" ) ) return true; return false; } bool ApplicationData::IsModified() { return m_modFlag; } void ApplicationData::Execute( PCommand cmd ) { m_modFlag = true; m_cmdProc.Execute( cmd ); } ////////////////////////////////////////////////////////////////////////////// void ApplicationData::AddHandler( wxEvtHandler* handler ) { m_handlers.push_back( handler ); } void ApplicationData::RemoveHandler( wxEvtHandler* handler ) { for ( HandlerVector::iterator it = m_handlers.begin(); it != m_handlers.end(); ++it ) { if ( *it == handler ) { m_handlers.erase( it ); break; } } } void ApplicationData::NotifyEvent( wxFBEvent& event ) { static int count = 0; if ( count == 0 ) { count++; Debug::Print( wxT( "event: %s" ), event.GetEventName().c_str() ); std::vector< wxEvtHandler* >::iterator handler; for ( handler = m_handlers.begin(); handler != m_handlers.end(); handler++ ) ( *handler )->ProcessEvent( event ); count--; } else { Debug::Print( wxT( "Pending event: %s" ), event.GetEventName().c_str() ); std::vector< wxEvtHandler* >::iterator handler; for ( handler = m_handlers.begin(); handler != m_handlers.end(); handler++ ) ( *handler )->AddPendingEvent( event ); } } void ApplicationData::NotifyProjectLoaded() { wxFBEvent event( wxEVT_FB_PROJECT_LOADED ); NotifyEvent( event ); } void ApplicationData::NotifyProjectSaved() { wxFBEvent event( wxEVT_FB_PROJECT_SAVED ); NotifyEvent( event ); } void ApplicationData::NotifyObjectExpanded( PObjectBase obj ) { wxFBObjectEvent event( wxEVT_FB_OBJECT_EXPANDED, obj ); NotifyEvent( event ); } void ApplicationData::NotifyObjectSelected( PObjectBase obj ) { wxFBObjectEvent event( wxEVT_FB_OBJECT_SELECTED, obj ); NotifyEvent( event ); } void ApplicationData::NotifyObjectCreated( PObjectBase obj ) { wxFBObjectEvent event( wxEVT_FB_OBJECT_CREATED, obj ); NotifyEvent( event ); } void ApplicationData::NotifyObjectRemoved( PObjectBase obj ) { wxFBObjectEvent event( wxEVT_FB_OBJECT_REMOVED, obj ); NotifyEvent( event ); } void ApplicationData::NotifyPropertyModified( PProperty prop ) { wxFBPropertyEvent event( wxEVT_FB_PROPERTY_MODIFIED, prop ); NotifyEvent( event ); } void ApplicationData::NotifyEventHandlerModified( PEvent evtHandler ) { wxFBEventHandlerEvent event( wxEVT_FB_EVENT_HANDLER_MODIFIED, evtHandler ); NotifyEvent( event ); } void ApplicationData::NotifyCodeGeneration( bool panelOnly ) { wxFBEvent event( wxEVT_FB_CODE_GENERATION ); // Using the previously unused Id field in the event to carry a boolean event.SetId( ( panelOnly ? 1 : 0 ) ); NotifyEvent( event ); } void ApplicationData::NotifyProjectRefresh() { wxFBEvent event( wxEVT_FB_PROJECT_REFRESH ); NotifyEvent( event ); } bool ApplicationData::VerifySingleInstance( const wxString& file, bool switchTo ) { return m_ipc->VerifySingleInstance( file, switchTo ); } wxString ApplicationData::GetOutputPath() { PObjectBase project = GetProjectData(); wxFileName path; // Get the output path PProperty ppath = project->GetProperty( wxT( "path" ) ); if ( ppath ) { wxString pathEntry = ppath->GetValue(); if ( pathEntry.empty() ) { THROW_WXFBEX( wxT( "You must set the \"path\" property of the project to a valid path for output files" ) ); } path = wxFileName::DirName( pathEntry ); if ( !path.IsAbsolute() ) { wxString projectPath = AppData()->GetProjectPath(); if ( projectPath.empty() ) { THROW_WXFBEX( wxT( "You must save the project when using a relative path for output files" ) ); } path.SetCwd( projectPath ); path.MakeAbsolute(); } } if ( !path.DirExists() ) { THROW_WXFBEX( wxT( "Invalid Path: " ) << path.GetPath() << wxT( "\nYou must set the \"path\" property of the project to a valid path for output files" ) ); } return path.GetPath( wxPATH_GET_VOLUME | wxPATH_GET_SEPARATOR ); } wxformbuilder-3.1.59/src/rad/menueditor.cpp0000644000175000017500000005451111143440026021171 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #include "menueditor.h" #include "model/objectbase.h" #define ID_DEFAULT -1 // Default #define ID_ADDMENUITEM 1000 #define ID_ADDSEPARATOR 1001 #define ID_MENUDOWN 1002 #define ID_MENULEFT 1003 #define ID_MENURIGHT 1004 #define ID_MENUUP 1005 #define ID_REMOVEMENUITEM 1006 #define ID_LABEL 1007 #define ID_MODIFYMENUITEM 1008 #define IDENTATION 4 BEGIN_EVENT_TABLE(MenuEditor, wxDialog) EVT_BUTTON(ID_ADDMENUITEM, MenuEditor::OnAddMenuItem) EVT_BUTTON(ID_ADDSEPARATOR, MenuEditor::OnAddSeparator) EVT_BUTTON(ID_MODIFYMENUITEM, MenuEditor::OnModifyMenuItem) EVT_BUTTON(ID_REMOVEMENUITEM, MenuEditor::OnRemoveMenuItem) EVT_BUTTON(ID_MENUDOWN, MenuEditor::OnMenuDown) EVT_BUTTON(ID_MENULEFT, MenuEditor::OnMenuLeft) EVT_BUTTON(ID_MENURIGHT, MenuEditor::OnMenuRight) EVT_BUTTON(ID_MENUUP, MenuEditor::OnMenuUp) EVT_UPDATE_UI_RANGE(ID_MENUDOWN, ID_MENUUP, MenuEditor::OnUpdateMovers) EVT_TEXT_ENTER(-1, MenuEditor::OnEnter) EVT_TEXT(ID_LABEL, MenuEditor::OnLabelChanged) EVT_LIST_ITEM_ACTIVATED(-1, MenuEditor::OnItemActivated) END_EVENT_TABLE() MenuEditor::MenuEditor(wxWindow *parent, int id) : wxDialog(parent,id,wxT("Menu Editor"),wxDefaultPosition,wxDefaultSize) { wxBoxSizer *mainSizer; mainSizer = new wxBoxSizer(wxVERTICAL); wxBoxSizer *sizerTop; sizerTop = new wxBoxSizer(wxHORIZONTAL); m_menuList = new wxListCtrl(this,ID_DEFAULT,wxDefaultPosition,wxDefaultSize,wxLC_REPORT | wxLC_SINGLE_SEL | wxSTATIC_BORDER); m_menuList->InsertColumn(0, wxT("Label"), wxLIST_FORMAT_LEFT, 150); m_menuList->InsertColumn(1, wxT("Shortcut"), wxLIST_FORMAT_LEFT, 80); m_menuList->InsertColumn(2, wxT("Id"), wxLIST_FORMAT_LEFT, 80); m_menuList->InsertColumn(3, wxT("Name"), wxLIST_FORMAT_LEFT, 50); m_menuList->InsertColumn(4, wxT("Help String"), wxLIST_FORMAT_LEFT, 150); m_menuList->InsertColumn(5, wxT("Kind"), wxLIST_FORMAT_LEFT, 120); int width = 0; for ( int i = 0; i < m_menuList->GetColumnCount(); ++i ) { width += m_menuList->GetColumnWidth( i ); } m_menuList->SetMinSize( wxSize( width, -1 ) ); sizerTop->Add(m_menuList, 1, wxALL|wxEXPAND, 5); wxStaticBoxSizer *sizer1; sizer1 = new wxStaticBoxSizer(new wxStaticBox(this, -1, wxT("Menu item")), wxVERTICAL); wxFlexGridSizer *sizer11; sizer11 = new wxFlexGridSizer(4,2,0,0); sizer11->AddGrowableCol(1); wxStaticText *m_stLabel; m_stLabel = new wxStaticText(this,ID_DEFAULT,wxT("Label"),wxDefaultPosition,wxDefaultSize,0); sizer11->Add(m_stLabel, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5); m_tcLabel = new wxTextCtrl(this,ID_LABEL,wxT(""),wxDefaultPosition,wxDefaultSize,wxTE_PROCESS_ENTER); sizer11->Add(m_tcLabel, 0, wxALL | wxEXPAND, 5); wxStaticText *m_stShortcut; m_stShortcut = new wxStaticText(this,ID_DEFAULT,wxT("Shortcut"),wxDefaultPosition,wxDefaultSize,0); sizer11->Add(m_stShortcut, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5); m_tcShortcut = new wxTextCtrl(this,ID_LABEL,wxT(""),wxDefaultPosition,wxDefaultSize,wxTE_PROCESS_ENTER); sizer11->Add(m_tcShortcut, 0, wxALL | wxEXPAND, 5); wxStaticText *m_stId; m_stId = new wxStaticText(this,ID_DEFAULT,wxT("Id"),wxDefaultPosition,wxDefaultSize,0); sizer11->Add(m_stId, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5); m_tcId = new wxTextCtrl(this,ID_DEFAULT,wxT(""),wxDefaultPosition,wxDefaultSize,wxTE_PROCESS_ENTER); sizer11->Add(m_tcId, 0, wxALL | wxEXPAND, 5); wxStaticText *m_stName; m_stName = new wxStaticText(this,ID_DEFAULT,wxT("Name"),wxDefaultPosition,wxDefaultSize,0); sizer11->Add(m_stName, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5); m_tcName = new wxTextCtrl(this,ID_DEFAULT,wxT(""),wxDefaultPosition,wxDefaultSize,wxTE_PROCESS_ENTER); sizer11->Add(m_tcName, 0, wxALL | wxEXPAND, 5); wxStaticText *m_stHelpString; m_stHelpString = new wxStaticText(this,ID_DEFAULT,wxT("Help String"),wxDefaultPosition,wxDefaultSize,0); sizer11->Add(m_stHelpString, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5); m_tcHelpString = new wxTextCtrl(this,ID_DEFAULT,wxT(""),wxDefaultPosition,wxDefaultSize,wxTE_PROCESS_ENTER); sizer11->Add(m_tcHelpString, 0, wxALL | wxEXPAND, 5); sizer1->Add(sizer11, 0, wxALL | wxEXPAND, 0); wxString choices[] = {wxT("Normal"), wxT("Check"), wxT("Radio")}; m_rbItemKind = new wxRadioBox(this, -1, wxT("Kind"), wxDefaultPosition, wxDefaultSize, 3, choices, 1, wxRA_SPECIFY_ROWS); sizer1->Add(m_rbItemKind, 0, wxALL | wxEXPAND, 5); wxBoxSizer *sizer4; sizer4 = new wxBoxSizer(wxHORIZONTAL); wxButton *m_bAdd; m_bAdd = new wxButton(this,ID_ADDMENUITEM,wxT("&Add"),wxDefaultPosition,wxDefaultSize,0); sizer4->Add(m_bAdd, 1, wxALL, 5); wxButton *m_bModify; m_bModify = new wxButton(this,ID_MODIFYMENUITEM,wxT("&Modify"),wxDefaultPosition,wxDefaultSize,0); sizer4->Add(m_bModify, 1, wxALL, 5); wxButton *m_bRemove; m_bRemove = new wxButton(this,ID_REMOVEMENUITEM,wxT("&Remove"),wxDefaultPosition,wxDefaultSize,0); sizer4->Add(m_bRemove, 1, wxALL, 5); sizer1->Add(sizer4, 0, wxEXPAND, 5); wxButton *m_bAddSep; m_bAddSep = new wxButton(this,ID_ADDSEPARATOR,wxT("Add &Separator"),wxDefaultPosition,wxDefaultSize,0); sizer1->Add(m_bAddSep, 0, wxALL|wxEXPAND, 5); sizerTop->Add(sizer1, 0, wxALL | wxEXPAND, 5); mainSizer->Add(sizerTop, 1, wxEXPAND, 5); wxBoxSizer *sizerMoveButtons; sizerMoveButtons = new wxBoxSizer(wxHORIZONTAL); wxButton *m_bUp; m_bUp = new wxButton(this,ID_MENUUP,wxT("&Up"),wxDefaultPosition,wxDefaultSize,0); sizerMoveButtons->Add(m_bUp, 0, wxALL, 5); wxButton *m_bDown; m_bDown = new wxButton(this,ID_MENUDOWN,wxT("&Down"),wxDefaultPosition,wxDefaultSize,0); sizerMoveButtons->Add(m_bDown, 0, wxALL, 5); wxButton *m_bLeft; m_bLeft = new wxButton(this,ID_MENULEFT,wxT("<"),wxDefaultPosition,wxDefaultSize,0); sizerMoveButtons->Add(m_bLeft, 0, wxALL, 5); wxButton *m_bRight; m_bRight = new wxButton(this,ID_MENURIGHT,wxT(">"),wxDefaultPosition,wxDefaultSize,0); sizerMoveButtons->Add(m_bRight, 0, wxALL, 5); wxStdDialogButtonSizer* sizerOkCancel = new wxStdDialogButtonSizer(); sizerOkCancel->AddButton( new wxButton( this, wxID_OK ) ); sizerOkCancel->AddButton( new wxButton( this, wxID_CANCEL ) ); sizerOkCancel->Realize(); sizerMoveButtons->Add(sizerOkCancel, 1, wxALL, 5); mainSizer->Add(sizerMoveButtons, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5); this->SetSizer(mainSizer); mainSizer->SetSizeHints( this ); this->SetAutoLayout(true); this->Layout(); //SetClientSize(560, 368); CenterOnScreen(); } void MenuEditor::AddChild(long& n, int ident, PObjectBase obj) { for (unsigned int i = 0; i < obj->GetChildCount(); i++) { PObjectBase childObj = obj->GetChild(i); if (childObj->GetClassName() == wxT("wxMenuItem") ) { InsertItem(n++, wxString(wxChar(' '), ident * IDENTATION) + childObj->GetPropertyAsString(wxT("label")), childObj->GetPropertyAsString(wxT("shortcut")), childObj->GetPropertyAsString(wxT("id")), childObj->GetPropertyAsString(wxT("name")), childObj->GetPropertyAsString(wxT("help")), childObj->GetPropertyAsString(wxT("kind")), childObj); } else if (childObj->GetClassName() == wxT("separator") ) { InsertItem(n++, wxString(wxChar(' '), ident * IDENTATION) + wxT("---"), wxT(""), wxT(""), wxT(""), wxT(""), wxT(""), childObj); } else { InsertItem(n++, wxString(wxChar(' '), ident * IDENTATION) + childObj->GetPropertyAsString(wxT("label")), wxT(""), childObj->GetPropertyAsString(wxT("id")), childObj->GetPropertyAsString(wxT("name")), childObj->GetPropertyAsString(wxT("help")), wxT(""), childObj); AddChild(n, ident + 1, childObj); } } } void MenuEditor::Populate(PObjectBase obj) { assert(obj && obj->GetClassName() == wxT("wxMenuBar") ); long n = 0; AddChild(n, 0, obj); } bool MenuEditor::HasChildren(long n) { if (n == m_menuList->GetItemCount() - 1) return false; else return GetItemIdentation(n + 1) > GetItemIdentation(n); } PObjectBase MenuEditor::GetMenu(long& n, PObjectDatabase base, bool isSubMenu) { // Get item from list control wxString label, shortcut, id, name, help, kind; PObjectBase menu; GetItem(n, label, shortcut, id, name, help, kind, &menu); bool createNew = true; if ( menu ) { createNew = ( menu->GetClassName() != (isSubMenu ? wxT("submenu") : wxT("wxMenu")) ); } // preserve original menu if the object types match // this preserves properties that are not exposed in the menu editor - like C++ scope if ( createNew ) { PObjectInfo info = base->GetObjectInfo(isSubMenu ? wxT("submenu") : wxT("wxMenu") ); menu = base->NewObject(info); } label.Trim(true); label.Trim(false); menu->GetProperty( wxT("label") )->SetValue(label); menu->GetProperty( wxT("name") )->SetValue(name); int ident = GetItemIdentation(n); n++; while (n < m_menuList->GetItemCount() && GetItemIdentation(n) > ident) { PObjectBase menuitem; GetItem(n, label, shortcut, id, name, help, kind, &menuitem); createNew = true; label.Trim(true); label.Trim(false); if (label == wxT("---")) { if ( menuitem ) { createNew = ( menuitem->GetClassName() != wxT("separator") ); } if ( createNew ) { PObjectInfo info = base->GetObjectInfo( wxT("separator") ); menuitem = base->NewObject(info); } menu->AddChild(menuitem); menuitem->SetParent(menu); n++; } else if (HasChildren(n)) { PObjectBase child = GetMenu(n, base); menu->AddChild(child); child->SetParent(menu); } else { if ( menuitem ) { createNew = ( menuitem->GetClassName() != wxT("wxMenuItem") ); } if ( createNew ) { PObjectInfo info = base->GetObjectInfo( wxT("wxMenuItem") ); menuitem = base->NewObject(info); } menuitem->GetProperty( wxT("label") )->SetValue(label); menuitem->GetProperty( wxT("shortcut") )->SetValue(shortcut); menuitem->GetProperty( wxT("name") )->SetValue(name); menuitem->GetProperty( wxT("help") )->SetValue(help); menuitem->GetProperty( wxT("id") )->SetValue(id); menuitem->GetProperty( wxT("kind") )->SetValue(kind); menu->AddChild(menuitem); menuitem->SetParent(menu); n++; } } return menu; } PObjectBase MenuEditor::GetMenubar(PObjectDatabase base) { // Disconnect all parent/child relationships in original objects for ( std::vector< WPObjectBase >::iterator it = m_originalItems.begin(); it != m_originalItems.end(); ++it ) { PObjectBase obj = it->lock(); if ( obj ) { obj->RemoveAllChildren(); obj->SetParent( PObjectBase() ); } } PObjectInfo info = base->GetObjectInfo( wxT("wxMenuBar" )); PObjectBase menubar = base->NewObject(info); long n = 0; while (n < m_menuList->GetItemCount()) { PObjectBase child = GetMenu(n, base, false); menubar->AddChild(child); child->SetParent(menubar); } return menubar; } long MenuEditor::GetSelectedItem() { return m_menuList->GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); } int MenuEditor::GetItemIdentation(long n) { wxString label = m_menuList->GetItemText(n); size_t curIdent = 0; while (curIdent < label.Len() && label[curIdent] == wxChar(' ')) curIdent++; curIdent /= IDENTATION; return (int)curIdent; } long MenuEditor::InsertItem(long n, const wxString& label, const wxString& shortcut, const wxString& id, const wxString& name, const wxString& helpString, const wxString& kind, PObjectBase obj) { long index = m_menuList->InsertItem(n, label); m_menuList->SetItem(index, 1, shortcut); m_menuList->SetItem(index, 2, id); m_menuList->SetItem(index, 3, name); m_menuList->SetItem(index, 4, helpString); m_menuList->SetItem(index, 5, kind); // Prevent loss of data not exposed by menu editor. For Example: bitmaps, events, etc. if ( obj ) { m_originalItems.push_back( obj ); m_menuList->SetItemData( index, m_originalItems.size() - 1 ); } else { m_menuList->SetItemData( index, -1 ); } return index; } void MenuEditor::AddItem(const wxString& label, const wxString& shortcut, const wxString& id, const wxString& name, const wxString &help, const wxString &kind) { int sel = GetSelectedItem(); int identation = 0; if (sel >= 0) identation = GetItemIdentation(sel); wxString labelAux = label; labelAux.Trim(true); labelAux.Trim(false); if (sel < 0) sel = m_menuList->GetItemCount() - 1; labelAux = wxString(wxChar(' '), identation * IDENTATION) + labelAux; long index = InsertItem(sel + 1, labelAux, shortcut, id, name, help, kind); m_menuList->SetItemState(index, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED); } void MenuEditor::GetItem(long n, wxString& label, wxString& shortcut, wxString& id, wxString& name, wxString& help, wxString& kind, PObjectBase* obj ) { label = m_menuList->GetItemText(n); wxListItem item; item.m_itemId = n; item.m_col = 1; item.m_mask = wxLIST_MASK_TEXT; m_menuList->GetItem(item); shortcut = item.GetText(); item.m_col++; m_menuList->GetItem(item); id = item.GetText(); if ( id.empty() ) { id = wxT("wxID_ANY"); } item.m_col++; m_menuList->GetItem(item); name = item.GetText(); item.m_col++; m_menuList->GetItem(item); help = item.GetText(); item.m_col++; m_menuList->GetItem(item); kind = item.GetText(); if ( kind.empty() ) { kind = wxT("wxITEM_NORMAL"); } if ( NULL != obj ) { int origIndex = m_menuList->GetItemData( item ); if ( origIndex >= 0 && origIndex < (int)m_originalItems.size() ) { *obj = m_originalItems[ origIndex ].lock(); } } } void MenuEditor::AddNewItem() { wxString kind; switch (m_rbItemKind->GetSelection()) { case 0: kind = wxT("wxITEM_NORMAL"); break; case 1: kind = wxT("wxITEM_CHECK"); break; case 2: kind = wxT("wxITEM_RADIO"); break; } AddItem(m_tcLabel->GetValue(), m_tcShortcut->GetValue(), m_tcId->GetValue(), m_tcName->GetValue(), m_tcHelpString->GetValue(), kind); m_tcLabel->SetValue(wxT("")); m_tcShortcut->SetValue(wxT("")); m_tcId->SetValue(wxT("")); m_tcName->SetValue(wxT("")); m_tcHelpString->SetValue(wxT("")); m_rbItemKind->SetSelection(0); m_tcLabel->SetFocus(); } void MenuEditor::OnAddMenuItem(wxCommandEvent& ) { AddNewItem(); } void MenuEditor::OnAddSeparator(wxCommandEvent& ) { AddItem(wxT("---"), wxT(""), wxT(""), wxT(""), wxT(""), wxT("")); } void MenuEditor::OnModifyMenuItem(wxCommandEvent& ) { long index = GetSelectedItem(); int identation = GetItemIdentation(index); wxString kind; switch (m_rbItemKind->GetSelection()) { case 0: kind = wxT("wxITEM_NORMAL"); break; case 1: kind = wxT("wxITEM_CHECK"); break; case 2: kind = wxT("wxITEM_RADIO"); break; } m_menuList->SetItem(index, 0, wxString(wxChar(' '), identation * IDENTATION) + m_tcLabel->GetValue()); m_menuList->SetItem(index, 1, m_tcShortcut->GetValue()); m_menuList->SetItem(index, 2, m_tcId->GetValue()); m_menuList->SetItem(index, 3, m_tcName->GetValue()); m_menuList->SetItem(index, 4, m_tcHelpString->GetValue()); m_menuList->SetItem(index, 5, kind); } void MenuEditor::OnRemoveMenuItem(wxCommandEvent& ) { long sel = GetSelectedItem(); if (sel < m_menuList->GetItemCount() - 1) { int curIdent = GetItemIdentation(sel); int nextIdent = GetItemIdentation(sel + 1); if (nextIdent > curIdent) { int res = wxMessageBox( wxT("The children of the selected item will be eliminated too. Are you sure you want to continue?"), wxT("wxFormBuilder"), wxYES_NO); if (res == wxYES) { long item = sel + 1; while (item < m_menuList->GetItemCount() && GetItemIdentation(item) > curIdent) m_menuList->DeleteItem(item); m_menuList->DeleteItem(sel); } }else m_menuList->DeleteItem(sel); }else m_menuList->DeleteItem(sel); } void MenuEditor::OnMenuLeft(wxCommandEvent& ) { int sel = GetSelectedItem(); int curIdent = GetItemIdentation(sel) - 1; int childIdent = sel < m_menuList->GetItemCount() - 1 ? GetItemIdentation(sel + 1) : -1; if (curIdent < 0 || (childIdent != -1 && abs(curIdent - childIdent) > 1)) return; wxString label = m_menuList->GetItemText(sel); label.Trim(true); label.Trim(false); label = wxString(wxChar(' '), curIdent * IDENTATION) + label; m_menuList->SetItemText(sel, label); } void MenuEditor::OnMenuRight(wxCommandEvent& ) { int sel = GetSelectedItem(); int curIdent = GetItemIdentation(sel) + 1; int parentIdent = sel > 0 ? GetItemIdentation(sel - 1) : -1; if (parentIdent == -1 || abs(curIdent - parentIdent) > 1) return; wxString label = m_menuList->GetItemText(sel); label.Trim(true); label.Trim(false); label = wxString(wxChar(' '), curIdent * IDENTATION) + label; m_menuList->SetItemText(sel, label); } void MenuEditor::OnMenuUp(wxCommandEvent& ) { long sel = GetSelectedItem(); long prev = sel - 1; int prevIdent = GetItemIdentation(prev); int curIdent = GetItemIdentation(sel); if (prevIdent < curIdent) return; while (prevIdent > curIdent) prevIdent = GetItemIdentation(--prev); PObjectBase obj; wxString label, shortcut, id, name, help, kind; GetItem(sel, label, shortcut, id, name, help, kind, &obj); m_menuList->DeleteItem(sel); long newSel = InsertItem(prev, label, shortcut, id, name, help, kind, obj); sel++; prev++; if (sel < m_menuList->GetItemCount()) { long childIdent = GetItemIdentation(sel); while (sel < m_menuList->GetItemCount() && childIdent > curIdent) { PObjectBase childObj; GetItem(sel, label, shortcut, id, name, help, kind, &childObj); m_menuList->DeleteItem(sel); InsertItem(prev, label, shortcut, id, name, help, kind, childObj); sel++; prev++; if (sel < m_menuList->GetItemCount()) childIdent = GetItemIdentation(sel); } } m_menuList->SetItemState(newSel, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED); } long MenuEditor::GetEndIndex(long n) { long res = n; int ident = GetItemIdentation(n); res++; if (res >= m_menuList->GetItemCount()) return n; while (GetItemIdentation(res) > ident) res++; return res - 1; } void MenuEditor::OnMenuDown(wxCommandEvent& ) { long sel = GetSelectedItem(); int selIdent = GetItemIdentation(sel); long selAux = sel + 1; while (GetItemIdentation(selAux) > selIdent) selAux++; if (GetItemIdentation(selAux) < selIdent) return; long endIndex = GetEndIndex(selAux) + 1; wxString label, shortcut, id, name, help, kind; PObjectBase obj; GetItem(sel, label, shortcut, id, name, help, kind, &obj); m_menuList->DeleteItem(sel); endIndex--; long first = InsertItem(endIndex, label, shortcut, id, name, help, kind, obj); while (GetItemIdentation(sel) > selIdent) { PObjectBase childObj; GetItem(sel, label, shortcut, id, name, help, kind, &childObj); m_menuList->DeleteItem(sel); InsertItem(endIndex, label, shortcut, id, name, help, kind, childObj); first--; } m_menuList->SetItemState(first, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED); } void MenuEditor::OnEnter(wxCommandEvent& ) { AddNewItem(); } void MenuEditor::OnLabelChanged(wxCommandEvent& ) { wxString label = m_tcLabel->GetValue(); wxString id, name; bool nextUpper = false; if (!label.IsEmpty()) id = wxT("ID_"); int tabPos = label.Find(wxT("\\t")); if (tabPos >= 0) label = label.Left(tabPos); for (size_t i = 0; i < label.Len(); i++) { if (isalnum(label[i])) { name += (nextUpper ? toupper(label[i]) : tolower(label[i])); nextUpper = false; id += toupper(label[i]); } else if (label[i] == wxChar(' ')) { nextUpper = true; id += wxT("_"); } } if (name.Len() > 0 && isdigit(name[0])) name = wxT("n") + name; m_tcId->SetValue(id); m_tcName->SetValue(name); } void MenuEditor::OnUpdateMovers(wxUpdateUIEvent& e) { switch (e.GetId()) { case ID_MENUUP: e.Enable(GetSelectedItem() > 0); break; case ID_MENUDOWN: e.Enable(GetSelectedItem() < m_menuList->GetItemCount() - 1); default: break; } } void MenuEditor::OnItemActivated(wxListEvent& e) { wxString label, shortcut, id, name, helpString, kind; GetItem(e.GetIndex(), label, shortcut, id, name, helpString, kind); label.Trim(true); label.Trim(false); m_tcLabel->SetValue(label); m_tcShortcut->SetValue(shortcut); m_tcId->SetValue(id); m_tcName->SetValue(name); m_tcHelpString->SetValue(helpString); if (kind == wxT("wxITEM_CHECK")) m_rbItemKind->SetSelection(1); else if (kind == wxT("wxITEM_RADIO")) m_rbItemKind->SetSelection(2); else m_rbItemKind->SetSelection(0); } wxformbuilder-3.1.59/src/rad/mainframe.cpp0000644000175000017500000015104511143440026020755 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #include "mainframe.h" #include "wx/config.h" #include "utils/debug.h" #include "utils/typeconv.h" #include "rad/title.h" #include "rad/bitmaps.h" #include "rad/cpppanel/cpppanel.h" #include "rad/xrcpanel/xrcpanel.h" #include "rad/geninheritclass/geninhertclass.h" #include "inspector/objinspect.h" #include "objecttree/objecttree.h" #include "palette.h" #include "rad/designer/visualeditor.h" #include "model/xrcfilter.h" #include "rad/about.h" #include "rad/wxfbevent.h" #include "wxfbmanager.h" #include "utils/wxfbexception.h" #include "utils/stringutils.h" #include "utils/wxfbdefs.h" #include #include #include "model/objectbase.h" #include #define ID_SAVE_PRJ 102 #define ID_OPEN_PRJ 103 #define ID_NEW_PRJ 104 #define ID_GENERATE_CODE 105 #define ID_IMPORT_XRC 106 #define ID_UNDO 107 #define ID_REDO 108 #define ID_SAVE_AS_PRJ 109 #define ID_CUT 110 #define ID_DELETE 111 #define ID_COPY 112 #define ID_PASTE 113 #define ID_EXPAND 114 #define ID_STRETCH 115 #define ID_MOVE_UP 116 #define ID_MOVE_DOWN 117 #define ID_RECENT_0 118 // Tienen que tener ids consecutivos #define ID_RECENT_1 119 // ID_RECENT_n+1 == ID_RECENT_n + 1 #define ID_RECENT_2 120 // #define ID_RECENT_3 121 // #define ID_RECENT_SEP 122 #define ID_ALIGN_LEFT 123 #define ID_ALIGN_CENTER_H 124 #define ID_ALIGN_RIGHT 125 #define ID_ALIGN_TOP 126 #define ID_ALIGN_CENTER_V 127 #define ID_ALIGN_BOTTOM 128 #define ID_BORDER_LEFT 129 #define ID_BORDER_RIGHT 130 #define ID_BORDER_TOP 131 #define ID_BORDER_BOTTOM 132 #define ID_EDITOR_FNB 133 #define ID_MOVE_LEFT 134 #define ID_MOVE_RIGHT 135 #define ID_PREVIEW_XRC 136 #define ID_GEN_INHERIT_CLS 137 // The preference dialog must use wxID_PREFERENCES for wxMAC //#define ID_SETTINGS_GLOBAL 138 // For the future preference dialogs #define ID_SETTINGS_PROJ 139 // For the future preference dialogs #define ID_FIND 142 #define ID_CLIPBOARD_COPY 143 #define ID_CLIPBOARD_PASTE 144 #define STATUS_FIELD_OBJECT 2 #define STATUS_FIELD_PATH 1 BEGIN_EVENT_TABLE( MainFrame, wxFrame ) EVT_MENU( ID_NEW_PRJ, MainFrame::OnNewProject ) EVT_MENU( ID_SAVE_PRJ, MainFrame::OnSaveProject ) EVT_MENU( ID_SAVE_AS_PRJ, MainFrame::OnSaveAsProject ) EVT_MENU( ID_OPEN_PRJ, MainFrame::OnOpenProject ) EVT_MENU( wxID_ABOUT, MainFrame::OnAbout ) EVT_MENU( wxID_EXIT, MainFrame::OnExit ) EVT_MENU( ID_IMPORT_XRC, MainFrame::OnImportXrc ) EVT_MENU( ID_GENERATE_CODE, MainFrame::OnGenerateCode ) EVT_MENU( ID_UNDO, MainFrame::OnUndo ) EVT_MENU( ID_REDO, MainFrame::OnRedo ) EVT_MENU( ID_DELETE, MainFrame::OnDelete ) EVT_MENU( ID_CUT, MainFrame::OnCut ) EVT_MENU( ID_COPY, MainFrame::OnCopy ) EVT_MENU( ID_PASTE, MainFrame::OnPaste ) EVT_MENU( ID_EXPAND, MainFrame::OnToggleExpand ) EVT_MENU( ID_STRETCH, MainFrame::OnToggleStretch ) EVT_MENU( ID_MOVE_UP, MainFrame::OnMoveUp ) EVT_MENU( ID_MOVE_DOWN, MainFrame::OnMoveDown ) EVT_MENU( ID_MOVE_LEFT, MainFrame::OnMoveLeft ) EVT_MENU( ID_MOVE_RIGHT, MainFrame::OnMoveRight ) EVT_MENU( ID_RECENT_0, MainFrame::OnOpenRecent ) EVT_MENU( ID_RECENT_1, MainFrame::OnOpenRecent ) EVT_MENU( ID_RECENT_2, MainFrame::OnOpenRecent ) EVT_MENU( ID_RECENT_3, MainFrame::OnOpenRecent ) EVT_MENU( ID_ALIGN_RIGHT, MainFrame::OnChangeAlignment ) EVT_MENU( ID_ALIGN_LEFT, MainFrame::OnChangeAlignment ) EVT_MENU( ID_ALIGN_CENTER_H, MainFrame::OnChangeAlignment ) EVT_MENU( ID_ALIGN_TOP, MainFrame::OnChangeAlignment ) EVT_MENU( ID_ALIGN_BOTTOM, MainFrame::OnChangeAlignment ) EVT_MENU( ID_ALIGN_CENTER_V, MainFrame::OnChangeAlignment ) EVT_MENU_RANGE( ID_BORDER_LEFT, ID_BORDER_BOTTOM, MainFrame::OnChangeBorder ) EVT_MENU( ID_PREVIEW_XRC, MainFrame::OnXrcPreview ) EVT_MENU( ID_GEN_INHERIT_CLS, MainFrame::OnGenInhertedClass ) EVT_MENU( ID_CLIPBOARD_COPY, MainFrame::OnClipboardCopy ) EVT_MENU( ID_CLIPBOARD_PASTE, MainFrame::OnClipboardPaste ) EVT_UPDATE_UI( ID_CLIPBOARD_PASTE, MainFrame::OnClipboardPasteUpdateUI ) EVT_CLOSE( MainFrame::OnClose ) EVT_FB_CODE_GENERATION( MainFrame::OnCodeGeneration ) EVT_FB_OBJECT_CREATED( MainFrame::OnObjectCreated ) EVT_FB_OBJECT_REMOVED( MainFrame::OnObjectRemoved ) EVT_FB_OBJECT_EXPANDED( MainFrame::OnObjectExpanded ) EVT_FB_OBJECT_SELECTED( MainFrame::OnObjectSelected ) EVT_FB_PROJECT_LOADED( MainFrame::OnProjectLoaded ) EVT_FB_PROJECT_REFRESH( MainFrame::OnProjectRefresh ) EVT_FB_PROJECT_SAVED( MainFrame::OnProjectSaved ) EVT_FB_PROPERTY_MODIFIED( MainFrame::OnPropertyModified ) EVT_FB_EVENT_HANDLER_MODIFIED( MainFrame::OnEventHandlerModified ) EVT_MENU( ID_FIND, MainFrame::OnFindDialog ) EVT_FIND( wxID_ANY, MainFrame::OnFind ) EVT_FIND_NEXT( wxID_ANY, MainFrame::OnFind ) EVT_FIND_CLOSE( wxID_ANY, MainFrame::OnFindClose ) END_EVENT_TABLE() // Used to kill focus from propgrid when toolbar or menu items are clicked // This forces the propgrid to save the cell being edited class FocusKillerEvtHandler : public wxEvtHandler { public: void OnMenuEvent( wxCommandEvent& event ) { // Get window with focus wxWindow* windowWithFocus = wxWindow::FindFocus(); // Only send the event if the focus is on the propgrid while ( windowWithFocus != NULL ) { wxPropertyGrid* propgrid = wxDynamicCast( windowWithFocus, wxPropertyGrid ); if ( propgrid != NULL ) { wxFocusEvent focusEvent( wxEVT_KILL_FOCUS ); propgrid->ProcessEvent( focusEvent ); break; } windowWithFocus = windowWithFocus->GetParent(); } // Add the event to the mainframe's original handler // Add as pending so propgrid saves the property before the event is processed GetNextHandler()->AddPendingEvent( event ); } DECLARE_EVENT_TABLE() }; BEGIN_EVENT_TABLE( FocusKillerEvtHandler, wxEvtHandler ) EVT_MENU( wxID_ANY, FocusKillerEvtHandler::OnMenuEvent ) END_EVENT_TABLE() MainFrame::MainFrame( wxWindow *parent, int id, int style, wxPoint pos, wxSize size ) : wxFrame( parent, id, wxEmptyString, pos, size, wxDEFAULT_FRAME_STYLE ), m_leftSplitterWidth( 300 ), m_rightSplitterWidth( -300 ), m_style( style ), m_page_selection( 0 ), m_rightSplitter_sash_pos( 300 ), m_autoSash( true ), m_findData( wxFR_DOWN ), m_findDialog( NULL ) { // initialize the splitters, wxAUI doesn't use them m_leftSplitter = m_rightSplitter = NULL; ///////////////////////////////////////////////////////////////////////////// // Setup frame icons, title bar, status bar, menubar and toolbar ///////////////////////////////////////////////////////////////////////////// wxIconBundle bundle; wxIcon ico16; ico16.CopyFromBitmap( AppBitmaps::GetBitmap( wxT( "app16" ), 16 ) ); bundle.AddIcon( ico16 ); wxIcon ico32; ico32.CopyFromBitmap( AppBitmaps::GetBitmap( wxT( "app32" ), 32 ) ); bundle.AddIcon( ico32 ); SetIcons( bundle ); SetTitle( wxT( "wxFormBuilder" ) ); SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ) ); SetMenuBar( CreateFBMenuBar() ); CreateStatusBar( 3 ); SetStatusBarPane( 0 ); int widths[3] = { -1, -1, 300 }; SetStatusWidths( sizeof( widths ) / sizeof( int ), widths ); CreateFBToolBar(); ///////////////////////////////////////////////////////////////////////////// // Create the gui ///////////////////////////////////////////////////////////////////////////// /* // --- wxAUI version -- wxWindow *objectTree = CreateObjectTree(this); wxWindow *objectInspector = CreateObjectInspector(this); wxWindow *palette = CreateComponentPalette(this); wxWindow *designer = CreateDesignerWindow(this); m_mgr.SetFrame(this); m_mgr.AddPane(objectTree, wxPaneInfo().Name(wxT("tree")). Caption(wxT("Object Tree")). Left().Layer(1). BestSize(wxSize(300,400)). CloseButton(false)); m_mgr.AddPane(objectInspector, wxPaneInfo().Name(wxT("inspector")). Caption(wxT("Object Properties")). Right().BestSize(wxSize(300,400)). CloseButton(false)); m_mgr.AddPane(designer, wxPaneInfo().Name(wxT("editor")). Caption(wxT("Editor")). Center(). CloseButton(false)); m_mgr.AddPane(palette, wxPaneInfo().Name(wxT("palette")). Caption(wxT("Component Palette")). Top(). RightDockable(false). LeftDockable(false). CloseButton(false)); m_mgr.Update();*/ RestorePosition( wxT( "mainframe" ) ); Layout(); // Init. m_cpp and m_xrc first m_cpp = NULL; m_xrc = NULL; switch ( style ) { case wxFB_DOCKABLE_GUI: // TO-DO CreateWideGui(); break; case wxFB_CLASSIC_GUI: /* // --- Classic style Gui -- // // +------++-----------------------+ // | Obj. || Palette | // | Tree ++-----------------------+ // | || Editor | // |______|| | // |------|| | // | Obj. || | // | Insp.|| | // | || | // | || | // +------++-----------------------+ */ CreateClassicGui(); break; case wxFB_DEFAULT_GUI: case wxFB_WIDE_GUI: default: /* // --- Wide style Gui -- // // +------++-----------------------+ // | Obj. || Palette | // | Tree ++-------------++--------+ // | || Editor || Obj. | // | || || Insp. | // | || || | // | || || | // | || || | // | || || | // | || || | // +------++-------------++--------+ */ CreateWideGui(); } AppData()->AddHandler( this->GetEventHandler() ); wxTheApp->SetTopWindow( this ); m_focusKillEvtHandler = new FocusKillerEvtHandler; PushEventHandler( m_focusKillEvtHandler ); // So splitter windows can be restored correctly Connect( wxEVT_IDLE, wxIdleEventHandler( MainFrame::OnIdle ) ); // So we don't respond to a FlatNoteBookPageChanged event during construction m_notebook->Connect( wxEVT_COMMAND_FLATNOTEBOOK_PAGE_CHANGED, wxFlatNotebookEventHandler( MainFrame::OnFlatNotebookPageChanged ), 0, this ); }; MainFrame::~MainFrame() { m_notebook->Disconnect( wxEVT_COMMAND_FLATNOTEBOOK_PAGE_CHANGED, wxFlatNotebookEventHandler( MainFrame::OnFlatNotebookPageChanged ), 0, this ); #ifdef __WXMAC__ // work around problem on wxMac m_rightSplitter->GetWindow1()->GetSizer()->Detach(m_notebook); m_notebook->Destroy(); #endif /*m_mgr.UnInit();*/ // the focus killer event handler RemoveEventHandler( m_focusKillEvtHandler ); delete m_focusKillEvtHandler; AppData()->RemoveHandler( this->GetEventHandler() ); delete m_findDialog; } void MainFrame::RestorePosition( const wxString &name ) { m_currentDir = wxT( "./projects" ); wxConfigBase *config = wxConfigBase::Get(); config->SetPath( name ); bool maximized; config->Read( wxT( "IsMaximized" ), &maximized, true ); if ( maximized ) { Maximize( maximized ); } else { bool iconized; config->Read( wxT( "IsIconized" ), &iconized, false ); if ( iconized ) { Iconize( iconized ); } } config->Read( wxT( "LeftSplitterWidth" ), &m_leftSplitterWidth, 300 ); config->Read( wxT( "RightSplitterWidth" ), &m_rightSplitterWidth, -300 ); config->Read( wxT( "AutoSash" ), &m_autoSash, true ); config->Read( wxT( "CurrentDirectory" ), &m_currentDir ); config->Read( wxT( "RecentFile0" ), &m_recentProjects[0] ); config->Read( wxT( "RecentFile1" ), &m_recentProjects[1] ); config->Read( wxT( "RecentFile2" ), &m_recentProjects[2] ); config->Read( wxT( "RecentFile3" ), &m_recentProjects[3] ); config->SetPath( wxT( ".." ) ); UpdateRecentProjects(); } void MainFrame::SavePosition( const wxString &name ) { m_objInsp->SavePosition(); wxConfigBase *config = wxConfigBase::Get(); bool isIconized = IsIconized(); bool isMaximized = IsMaximized(); config->SetPath( name ); if ( !isMaximized ) { config->Write( wxT( "PosX" ), isIconized ? -1 : GetPosition().x ); config->Write( wxT( "PosY" ), isIconized ? -1 : GetPosition().y ); config->Write( wxT( "SizeW" ), isIconized ? -1 : GetSize().GetWidth() ); config->Write( wxT( "SizeH" ), isIconized ? -1 : GetSize().GetHeight() ); } config->Write( wxT( "IsMaximized" ), isMaximized ); config->Write( wxT( "IsIconized" ), isIconized ); config->Write( wxT( "CurrentDirectory" ), m_currentDir ); config->Write( wxT( "RecentFile0" ), m_recentProjects[0] ); config->Write( wxT( "RecentFile1" ), m_recentProjects[1] ); config->Write( wxT( "RecentFile2" ), m_recentProjects[2] ); config->Write( wxT( "RecentFile3" ), m_recentProjects[3] ); if ( m_leftSplitter ) { int leftSashWidth = m_leftSplitter->GetSashPosition(); config->Write( wxT( "LeftSplitterWidth" ), leftSashWidth ); } if ( m_rightSplitter ) { switch ( m_style ) { case wxFB_WIDE_GUI: { int rightSash = -1 * ( m_rightSplitter->GetSize().GetWidth() - m_rightSplitter->GetSashPosition() ); config->Write( wxT( "RightSplitterWidth" ), rightSash ); break; } case wxFB_CLASSIC_GUI: { int rightSash = -1 * ( m_rightSplitter->GetSize().GetHeight() - m_rightSplitter->GetSashPosition() ); config->Write( wxT( "RightSplitterWidth" ), rightSash ); break; } default: break; } } config->SetPath( wxT( ".." ) ); config->Write( wxT("/mainframe/editor/notebook_style"), m_notebook->GetWindowStyleFlag() ); } void MainFrame::OnSaveProject( wxCommandEvent &event ) { wxString filename = AppData()->GetProjectFileName(); if ( filename == wxT( "" ) ) OnSaveAsProject( event ); else { try { AppData()->SaveProject( filename ); InsertRecentProject( filename ); } catch ( wxFBException& ex ) { wxLogError( ex.what() ); } } } void MainFrame::OnSaveAsProject( wxCommandEvent & ) { wxFileDialog *dialog = new wxFileDialog( this, wxT( "Save Project" ), m_currentDir, wxT( "" ), wxT( "wxFormBuilder Project File (*.fbp)|*.fbp|All files (*.*)|*.*" ), wxFD_SAVE ); if ( dialog->ShowModal() == wxID_OK ) { m_currentDir = dialog->GetDirectory(); wxString filename = dialog->GetPath(); // Add the default extension if none was chosen wxFileName file( filename ); if ( !file.HasExt() ) { file.SetExt( wxT( "fbp" ) ); filename = file.GetFullPath(); } // Check the file whether exists or not if ( file.FileExists() == true ) { wxMessageDialog msg_box( this, wxT("The file already exists. Do you want to replace it?"), wxT("Overwrite the file"), wxYES_NO|wxICON_INFORMATION|wxNO_DEFAULT ); if( msg_box.ShowModal() == wxID_NO ) { dialog->Destroy(); return; } } try { AppData()->SaveProject( filename ); InsertRecentProject( filename ); } catch ( wxFBException& ex ) { wxLogError( ex.what() ); } }; dialog->Destroy(); } void MainFrame::OnOpenProject( wxCommandEvent &) { if ( !SaveWarning() ) return; wxFileDialog *dialog = new wxFileDialog( this, wxT( "Open Project" ), m_currentDir, wxT( "" ), wxT( "wxFormBuilder Project File (*.fbp)|*.fbp|All files (*.*)|*.*" ), wxFD_OPEN ); if ( dialog->ShowModal() == wxID_OK ) { m_currentDir = dialog->GetDirectory(); wxString filename = dialog->GetPath(); if ( AppData()->LoadProject( filename ) ) InsertRecentProject( filename ); }; dialog->Destroy(); } void MainFrame::OnOpenRecent( wxCommandEvent &event ) { if ( !SaveWarning() ) return; int i = event.GetId() - ID_RECENT_0; assert ( i >= 0 && i < 4 ); wxFileName filename( m_recentProjects[i] ); if(filename.FileExists()) { if ( AppData()->LoadProject( filename.GetFullPath() ) ) { m_currentDir = filename.GetPath(); InsertRecentProject( filename.GetFullPath() ); } } else { if(wxMessageBox(wxString::Format(wxT("The project file '%s' doesn't exist. Would you like to remove it from the recent files list?"), filename.GetName().GetData()), wxT("Open recent project"), wxICON_WARNING | wxYES_NO) == wxYES) { m_recentProjects[i] = wxT(""); UpdateRecentProjects(); } } } void MainFrame::OnImportXrc( wxCommandEvent &) { wxFileDialog *dialog = new wxFileDialog( this, wxT( "Import XRC file" ), m_currentDir, wxT( "example.xrc" ), wxT( "*.xrc" ), wxFD_OPEN ); if ( dialog->ShowModal() == wxID_OK ) { m_currentDir = dialog->GetDirectory(); try { ticpp::Document doc; XMLUtils::LoadXMLFile( doc, false, dialog->GetPath() ); XrcLoader xrc; xrc.SetObjectDatabase( AppData()->GetObjectDatabase() ); PObjectBase project = xrc.GetProject( &doc ); if ( project ) { AppData()->MergeProject( project ); } else { wxLogError( wxT( "Error while loading XRC" ) ); } } catch ( wxFBException& ex ) { wxLogError( _( "Error Loading XRC: %s" ), ex.what() ); } } dialog->Destroy(); } void MainFrame::OnNewProject( wxCommandEvent &) { if ( !SaveWarning() ) return; AppData()->NewProject(); } void MainFrame::OnGenerateCode( wxCommandEvent &) { AppData()->GenerateCode( false ); } void MainFrame::OnAbout( wxCommandEvent &) { AboutDialog *dlg = new AboutDialog( this ); dlg->ShowModal(); dlg->Destroy(); } void MainFrame::OnExit( wxCommandEvent &) { Close(); } void MainFrame::OnClose( wxCloseEvent &event ) { if ( !SaveWarning() ) return; SavePosition( wxT( "mainframe" ) ); m_rightSplitter->Disconnect( wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED, wxSplitterEventHandler( MainFrame::OnSplitterChanged ) ); event.Skip(); } void MainFrame::OnProjectLoaded( wxFBEvent& ) { GetStatusBar()->SetStatusText( wxT( "Project Loaded!" ) ); PObjectBase project = AppData()->GetProjectData(); if ( project ) { wxString objDetails = wxString::Format( wxT( "Name: %s | Class: %s" ), project->GetPropertyAsString( wxT( "name" ) ).c_str(), project->GetClassName().c_str() ); GetStatusBar()->SetStatusText( objDetails, STATUS_FIELD_OBJECT ); } UpdateFrame(); } void MainFrame::OnProjectSaved( wxFBEvent& ) { GetStatusBar()->SetStatusText( wxT( "Project Saved!" ) ); UpdateFrame(); } void MainFrame::OnObjectExpanded( wxFBObjectEvent& ) { UpdateFrame(); } void MainFrame::OnObjectSelected( wxFBObjectEvent& event ) { PObjectBase obj = event.GetFBObject(); Debug::Print( wxT("MainFrame::OnObjectSelected") ); // resize sash position if necessary if ( m_autoSash ) { wxSize panel_size; int sash_pos; if ( m_style != wxFB_CLASSIC_GUI ) { switch(m_page_selection) { case 1: // CPP panel break; case 2: // XRC panel break; default: if ( m_visualEdit != NULL ) { // If selected object is not a Frame or a Panel or a dialog, we won't // adjust the sash position if ( obj->GetObjectTypeName() == wxT("form") ) { sash_pos = m_rightSplitter->GetSashPosition(); panel_size = m_visualEdit->GetVirtualSize(); Debug::Print(wxT("MainFrame::OnObjectSelected > sash pos = %d"), sash_pos); Debug::Print(wxT("MainFrame::OnObjectSelected > virtual width = %d"), panel_size.GetWidth()); if ( panel_size.GetWidth() > sash_pos ) { //set the sash position Debug::Print(wxT("MainFrame::OnObjectSelected > set sash position")); m_rightSplitter_sash_pos = panel_size.GetWidth(); m_rightSplitter->SetSashPosition(m_rightSplitter_sash_pos); } } } break; } } } wxString name; PProperty prop( obj->GetProperty( wxT( "name" ) ) ); if ( prop ) name = prop->GetValueAsString(); else name = wxT( "\"Unknown\"" ); //GetStatusBar()->SetStatusText( wxT( "Object " ) + name + wxT( " Selected!" ) ); wxString objDetails = wxString::Format( wxT( "Name: %s | Class: %s" ), name.c_str(), obj->GetClassName().c_str() ); GetStatusBar()->SetStatusText( objDetails, STATUS_FIELD_OBJECT ); UpdateFrame(); } void MainFrame::OnObjectCreated( wxFBObjectEvent& event ) { wxString message; Debug::Print(wxT("MainFrame::OnObjectCreated")); if ( event.GetFBObject() ) { message.Printf( wxT( "Object '%s' of class '%s' created." ), event.GetFBObject()->GetPropertyAsString( wxT( "name" ) ).c_str(), event.GetFBObject()->GetClassName().c_str() ); } else message = wxT( "Impossible to create the object. Did you forget to add a sizer?" ); GetStatusBar()->SetStatusText( message ); UpdateFrame(); } void MainFrame::OnObjectRemoved( wxFBObjectEvent& event ) { wxString message; message.Printf( wxT( "Object '%s' removed." ), event.GetFBObject()->GetPropertyAsString( wxT( "name" ) ).c_str() ); GetStatusBar()->SetStatusText( message ); UpdateFrame(); } void MainFrame::OnPropertyModified( wxFBPropertyEvent& event ) { PProperty prop = event.GetFBProperty(); if ( prop ) { if ( prop->GetObject() == AppData()->GetSelectedObject() ) { if ( 0 == prop->GetName().CmpNoCase( wxT( "name" ) ) ) { wxString oldDetails = GetStatusBar()->GetStatusText( STATUS_FIELD_OBJECT ); wxString newDetails; size_t pipeIdx = oldDetails.find( wxT( "|" ) ); if ( pipeIdx != oldDetails.npos ) { newDetails.Printf( wxT( "Name: %s %s" ), prop->GetValueAsString().c_str(), oldDetails.substr( pipeIdx ).c_str() ); GetStatusBar()->SetStatusText( newDetails, STATUS_FIELD_OBJECT ); } } GetStatusBar()->SetStatusText( wxT( "Property Modified!" ) ); } // When you change the sizeritem properties, the object modified is not // the same that the selected object because is a sizeritem object. // It's necessary to update the frame for the toolbar buttons. UpdateFrame(); } } void MainFrame::OnEventHandlerModified( wxFBEventHandlerEvent& event ) { wxString message; message.Printf( wxT( "Event handler '%s' of object '%s' modified." ), event.GetFBEventHandler()->GetName().c_str(), event.GetFBEventHandler()->GetObject()->GetPropertyAsString( wxT( "name" ) ).c_str() ); GetStatusBar()->SetStatusText( message ); UpdateFrame(); } void MainFrame::OnCodeGeneration( wxFBEvent& event ) { // Using the previously unused Id field in the event to carry a boolean bool panelOnly = ( event.GetId() != 0 ); if ( panelOnly ) { GetStatusBar()->SetStatusText( wxT( "Code Generated!" ) ); } } void MainFrame::OnProjectRefresh( wxFBEvent& ) { PObjectBase project = AppData()->GetProjectData(); if ( project ) { wxString objDetails = wxString::Format( wxT( "Name: %s | Class: %s" ), project->GetPropertyAsString( wxT( "name" ) ).c_str(), project->GetClassName().c_str() ); GetStatusBar()->SetStatusText( objDetails, STATUS_FIELD_OBJECT ); } UpdateFrame(); } void MainFrame::OnUndo( wxCommandEvent &) { AppData()->Undo(); } void MainFrame::OnRedo( wxCommandEvent &) { AppData()->Redo(); } void MainFrame::UpdateLayoutTools() { int option = -1; int border = 0; int flag = 0; int orient = 0; bool gotLayoutSettings = AppData()->GetLayoutSettings( AppData()->GetSelectedObject(), &flag, &option, &border, &orient ); wxToolBar* toolbar = GetToolBar(); wxMenu* menuEdit = GetMenuBar()->GetMenu( GetMenuBar()->FindMenu( wxT( "Edit" ) ) ); // Enable the layout tools if there are layout settings, else disable the tools menuEdit->Enable( ID_EXPAND, gotLayoutSettings ); toolbar->EnableTool( ID_EXPAND, gotLayoutSettings ); menuEdit->Enable( ID_STRETCH, option >= 0 ); toolbar->EnableTool( ID_STRETCH, option >= 0 ); bool enableHorizontalTools = ( orient != wxHORIZONTAL ) && gotLayoutSettings; menuEdit->Enable( ID_ALIGN_LEFT, enableHorizontalTools ); toolbar->EnableTool( ID_ALIGN_LEFT, enableHorizontalTools ); menuEdit->Enable( ID_ALIGN_CENTER_H, enableHorizontalTools ); toolbar->EnableTool( ID_ALIGN_CENTER_H, enableHorizontalTools ); menuEdit->Enable( ID_ALIGN_RIGHT, enableHorizontalTools ); toolbar->EnableTool( ID_ALIGN_RIGHT, enableHorizontalTools ); bool enableVerticalTools = ( orient != wxVERTICAL ) && gotLayoutSettings; menuEdit->Enable( ID_ALIGN_TOP, enableVerticalTools ); toolbar->EnableTool( ID_ALIGN_TOP, enableVerticalTools ); menuEdit->Enable( ID_ALIGN_CENTER_V, enableVerticalTools ); toolbar->EnableTool( ID_ALIGN_CENTER_V, enableVerticalTools ); menuEdit->Enable( ID_ALIGN_BOTTOM, enableVerticalTools ); toolbar->EnableTool( ID_ALIGN_BOTTOM, enableVerticalTools ); toolbar->EnableTool( ID_BORDER_TOP, gotLayoutSettings ); toolbar->EnableTool( ID_BORDER_RIGHT, gotLayoutSettings ); toolbar->EnableTool( ID_BORDER_LEFT, gotLayoutSettings ); toolbar->EnableTool( ID_BORDER_BOTTOM, gotLayoutSettings ); // Toggle the toolbar buttons according to the properties, if there are layout settings toolbar->ToggleTool( ID_EXPAND, ( ( flag & wxEXPAND ) != 0 ) && gotLayoutSettings ); toolbar->ToggleTool( ID_STRETCH, ( option > 0 ) && gotLayoutSettings ); toolbar->ToggleTool( ID_ALIGN_LEFT, !( ( flag & ( wxALIGN_RIGHT | wxALIGN_CENTER_HORIZONTAL ) ) != 0 ) && enableHorizontalTools ); toolbar->ToggleTool( ID_ALIGN_CENTER_H, ( ( flag & wxALIGN_CENTER_HORIZONTAL ) != 0 ) && enableHorizontalTools ); toolbar->ToggleTool( ID_ALIGN_RIGHT, ( ( flag & wxALIGN_RIGHT ) != 0 ) && enableHorizontalTools ); toolbar->ToggleTool( ID_ALIGN_TOP, !( ( flag & ( wxALIGN_BOTTOM | wxALIGN_CENTER_VERTICAL ) ) != 0 ) && enableVerticalTools ); toolbar->ToggleTool( ID_ALIGN_CENTER_V, ( ( flag & wxALIGN_CENTER_VERTICAL ) != 0 ) && enableVerticalTools ); toolbar->ToggleTool( ID_ALIGN_BOTTOM, ( ( flag & wxALIGN_BOTTOM ) != 0 ) && enableVerticalTools ); toolbar->ToggleTool( ID_BORDER_TOP, ( ( flag & wxTOP ) != 0 ) && gotLayoutSettings ); toolbar->ToggleTool( ID_BORDER_RIGHT, ( ( flag & wxRIGHT ) != 0 ) && gotLayoutSettings ); toolbar->ToggleTool( ID_BORDER_LEFT, ( ( flag & wxLEFT ) != 0 ) && gotLayoutSettings ); toolbar->ToggleTool( ID_BORDER_BOTTOM, ( ( flag & wxBOTTOM ) != 0 ) && gotLayoutSettings ); } void MainFrame::UpdateFrame() { // Build the title wxString filename = AppData()->GetProjectFileName(); wxString file; if ( filename.empty() ) { file = wxT("untitled"); } else { wxFileName fn( filename ); file = fn.GetName(); } SetTitle( wxString::Format( wxT("%s%s - wxFormBuilder v3.1 - Beta"), AppData()->IsModified() ? wxT("*") : wxT(""), file.c_str() ) ); GetStatusBar()->SetStatusText( filename, STATUS_FIELD_PATH ); // Enable/Disable toolbar and menu entries wxMenu* menuEdit = GetMenuBar()->GetMenu( GetMenuBar()->FindMenu( wxT( "Edit" ) ) ); wxToolBar* toolbar = GetToolBar(); bool redo = AppData()->CanRedo(); menuEdit->Enable( ID_REDO, redo ); toolbar->EnableTool( ID_REDO, redo ); bool undo = AppData()->CanUndo(); menuEdit->Enable( ID_UNDO, undo ); toolbar->EnableTool( ID_UNDO, undo ); bool copy = AppData()->CanCopyObject(); bool isEditor = ( _("Designer") != m_notebook->GetPageText( m_notebook->GetSelection() ) ); menuEdit->Enable( ID_FIND, isEditor ); menuEdit->Enable( ID_CLIPBOARD_COPY, copy ); menuEdit->Enable( ID_COPY, copy || isEditor ); toolbar->EnableTool( ID_COPY, copy || isEditor ); menuEdit->Enable( ID_CUT, copy ); toolbar->EnableTool( ID_CUT, copy ); menuEdit->Enable( ID_DELETE, copy ); toolbar->EnableTool( ID_DELETE, copy ); menuEdit->Enable( ID_MOVE_UP, copy ); menuEdit->Enable( ID_MOVE_DOWN, copy ); menuEdit->Enable( ID_MOVE_LEFT, copy ); menuEdit->Enable( ID_MOVE_RIGHT, copy ); bool paste = AppData()->CanPasteObject(); menuEdit->Enable( ID_PASTE, paste ); toolbar->EnableTool( ID_PASTE, paste ); menuEdit->Enable( ID_CLIPBOARD_PASTE, AppData()->CanPasteObjectFromClipboard() ); UpdateLayoutTools(); } void MainFrame::UpdateRecentProjects() { int i, fi; wxMenu *menuFile = GetMenuBar()->GetMenu( GetMenuBar()->FindMenu( wxT( "File" ) ) ); // borramos los items del menu de los projectos recientes for ( i = 0 ; i < 4 ; i++ ) { if ( menuFile->FindItem( ID_RECENT_0 + i ) ) menuFile->Destroy( ID_RECENT_0 + i ); } wxMenuItem* mruSep = menuFile->FindItemByPosition( menuFile->GetMenuItemCount() - 1 ); if ( mruSep->IsSeparator() ) { menuFile->Destroy( mruSep ); } // remove empty filenames and 'compress' the rest fi = 0; for ( i = 0 ; i < 4 ; i++ ) { if(!m_recentProjects[i].IsEmpty()) m_recentProjects[fi++] = m_recentProjects[i]; } for ( i = fi ; i < 4 ; i++ ) m_recentProjects[i] = wxT(""); if ( !m_recentProjects[0].IsEmpty() ) { menuFile->AppendSeparator(); } // creamos los nuevos ficheros recientes for ( unsigned int i = 0 ; i < 4 && !m_recentProjects[i].IsEmpty() ; i++ ) menuFile->Append( ID_RECENT_0 + i, m_recentProjects[i], wxT( "" ) ); } void MainFrame::InsertRecentProject( const wxString &file ) { bool found = false; int i; for ( i = 0; i < 4 && !found; i++ ) found = ( file == m_recentProjects[i] ); if ( found ) // en i-1 está la posición encontrada (0 < i < 4) { // desplazamos desde 0 hasta i-1 una posición a la derecha for ( i = i - 1; i > 0; i-- ) m_recentProjects[i] = m_recentProjects[i-1]; } else if ( !found ) { for ( i = 3; i > 0; i-- ) m_recentProjects[i] = m_recentProjects[i-1]; } m_recentProjects[0] = file; UpdateRecentProjects(); } void MainFrame::OnCopy( wxCommandEvent &) { wxWindow *focusedWindow = wxWindow::FindFocus(); if ( focusedWindow != NULL && focusedWindow->IsKindOf( CLASSINFO( wxScintilla ) ) ) ( ( wxScintilla* )focusedWindow )->Copy(); else { AppData()->CopyObject( AppData()->GetSelectedObject() ); UpdateFrame(); } } void MainFrame::OnCut ( wxCommandEvent &) { wxWindow *focusedWindow = wxWindow::FindFocus(); if ( focusedWindow != NULL && focusedWindow->IsKindOf( CLASSINFO( wxScintilla ) ) ) ( ( wxScintilla* )focusedWindow )->Cut(); else { AppData()->CutObject( AppData()->GetSelectedObject() ); UpdateFrame(); } } void MainFrame::OnDelete ( wxCommandEvent &) { AppData()->RemoveObject( AppData()->GetSelectedObject() ); UpdateFrame(); } void MainFrame::OnPaste ( wxCommandEvent &) { wxWindow *focusedWindow = wxWindow::FindFocus(); if ( focusedWindow != NULL && focusedWindow->IsKindOf( CLASSINFO( wxScintilla ) ) ) ( ( wxScintilla* )focusedWindow )->Paste(); else { AppData()->PasteObject( AppData()->GetSelectedObject() ); UpdateFrame(); } } void MainFrame::OnClipboardCopy(wxCommandEvent& ) { AppData()->CopyObjectToClipboard( AppData()->GetSelectedObject() ); UpdateFrame(); } void MainFrame::OnClipboardPaste(wxCommandEvent& ) { AppData()->PasteObjectFromClipboard( AppData()->GetSelectedObject() ); UpdateFrame(); } void MainFrame::OnClipboardPasteUpdateUI( wxUpdateUIEvent& e ) { e.Enable( AppData()->CanPasteObjectFromClipboard() ); } void MainFrame::OnToggleExpand ( wxCommandEvent &) { AppData()->ToggleExpandLayout( AppData()->GetSelectedObject() ); } void MainFrame::OnToggleStretch ( wxCommandEvent &) { AppData()->ToggleStretchLayout( AppData()->GetSelectedObject() ); } void MainFrame::OnMoveUp ( wxCommandEvent &) { AppData()->MovePosition( AppData()->GetSelectedObject(), false, 1 ); } void MainFrame::OnMoveDown ( wxCommandEvent &) { AppData()->MovePosition( AppData()->GetSelectedObject(), true, 1 ); } void MainFrame::OnMoveLeft ( wxCommandEvent &) { AppData()->MoveHierarchy( AppData()->GetSelectedObject(), true ); } void MainFrame::OnMoveRight ( wxCommandEvent & ) { AppData()->MoveHierarchy( AppData()->GetSelectedObject(), false ); } void MainFrame::OnChangeAlignment ( wxCommandEvent &event ) { int align = 0; bool vertical = ( event.GetId() == ID_ALIGN_TOP || event.GetId() == ID_ALIGN_BOTTOM || event.GetId() == ID_ALIGN_CENTER_V ); switch ( event.GetId() ) { case ID_ALIGN_RIGHT: align = wxALIGN_RIGHT; break; case ID_ALIGN_CENTER_H: align = wxALIGN_CENTER_HORIZONTAL; break; case ID_ALIGN_BOTTOM: align = wxALIGN_BOTTOM; break; case ID_ALIGN_CENTER_V: align = wxALIGN_CENTER_VERTICAL; break; } AppData()->ChangeAlignment( AppData()->GetSelectedObject(), align, vertical ); UpdateLayoutTools(); } void MainFrame::OnChangeBorder( wxCommandEvent& e ) { int border; switch ( e.GetId() ) { case ID_BORDER_LEFT: border = wxLEFT; break; case ID_BORDER_RIGHT: border = wxRIGHT; break; case ID_BORDER_TOP: border = wxTOP; break; case ID_BORDER_BOTTOM: border = wxBOTTOM; break; default: border = 0; break; } AppData()->ToggleBorderFlag( AppData()->GetSelectedObject(), border ); UpdateLayoutTools(); } void MainFrame::OnXrcPreview( wxCommandEvent& WXUNUSED( e ) ) { AppData()->ShowXrcPreview(); /*wxPaneInfoArray& all_panes = m_mgr.GetAllPanes(); for ( int i = 0, count = all_panes.GetCount(); i < count; ++i ) { wxPaneInfo info = all_panes.Item( i ); }*/ } void MainFrame::OnGenInhertedClass( wxCommandEvent& WXUNUSED( e ) ) { wxString filePath; try { // Get the output path filePath = AppData()->GetOutputPath(); } catch ( wxFBException& ex ) { wxLogWarning( ex.what() ); return; } // Show the dialog PObjectBase project = AppData()->GetProjectData(); if ( project->IsNull( _("file") ) ) { wxLogWarning( _("You must set the \"file\" property of the project before generating inherited classes.") ); return; } GenInheritedClassDlg dlg( this, project ); if ( wxID_OK != dlg.ShowModal() ) { return; } std::vector< GenClassDetails > selectedForms; dlg.GetFormsSelected( &selectedForms ); for ( size_t i = 0; i < selectedForms.size(); ++i ) { const GenClassDetails& details = selectedForms[i]; // Create the class and files. AppData()->GenerateInheritedClass( details.m_form, details.m_className, filePath, details.m_fileName ); } } bool MainFrame::SaveWarning() { int result = wxYES; if ( AppData()->IsModified() ) { result = ::wxMessageBox( wxT( "Current project file has been modified...\n" ) wxT( "Do you want to save the changes?" ), wxT( "Save project" ), wxYES | wxNO | wxCANCEL, this ); if ( result == wxYES ) { wxCommandEvent dummy; OnSaveProject( dummy ); } } return ( result != wxCANCEL ); } void MainFrame::OnFlatNotebookPageChanged( wxFlatNotebookEvent& event ) { UpdateFrame(); if ( m_autoSash ) { m_page_selection = event.GetSelection(); Debug::Print(wxT("MainFrame::OnFlatNotebookPageChanged > selection = %d"), m_page_selection); wxSize panel_size; int sash_pos; if(m_style != wxFB_CLASSIC_GUI) { switch( m_page_selection ) { case 1: // CPP panel if( (m_cpp != NULL) && (m_rightSplitter != NULL) ) { panel_size = m_cpp->GetClientSize(); sash_pos = m_rightSplitter->GetSashPosition(); Debug::Print(wxT("MainFrame::OnFlatNotebookPageChanged > CPP panel: width = %d sash pos = %d"), panel_size.GetWidth(), sash_pos); if(panel_size.GetWidth() > sash_pos) { // set the sash position Debug::Print(wxT("MainFrame::OnFlatNotebookPageChanged > reset sash position")); m_rightSplitter->SetSashPosition(panel_size.GetWidth()); } } break; case 2: // XRC panel if((m_xrc != NULL) && (m_rightSplitter != NULL)) { panel_size = m_xrc->GetClientSize(); sash_pos = m_rightSplitter->GetSashPosition(); Debug::Print(wxT("MainFrame::OnFlatNotebookPageChanged > XRC panel: width = %d sash pos = %d"), panel_size.GetWidth(), sash_pos); if(panel_size.GetWidth() > sash_pos) { // set the sash position Debug::Print(wxT("MainFrame::OnFlatNotebookPageChanged > reset sash position")); m_rightSplitter->SetSashPosition(panel_size.GetWidth()); } } break; default: if(m_visualEdit != NULL) { sash_pos = m_rightSplitter->GetSashPosition(); if(m_rightSplitter_sash_pos < sash_pos) { //restore the sash position Debug::Print(wxT("MainFrame::OnFlatNotebookPageChanged > restore sash position")); m_rightSplitter->SetSashPosition(m_rightSplitter_sash_pos); } else { // update position m_rightSplitter_sash_pos = sash_pos; } } break; } } } AppData()->GenerateCode( true ); } void MainFrame::OnFindDialog( wxCommandEvent& ) { if ( NULL == m_findDialog ) { m_findDialog = new wxFindReplaceDialog( this, &m_findData, wxT("Find") ); m_findDialog->Centre( wxCENTRE_ON_SCREEN | wxBOTH ); } m_findDialog->Show( true ); } void MainFrame::OnFindClose( wxFindDialogEvent& ) { m_findDialog->Destroy(); m_findDialog = 0; } void MainFrame::OnFind( wxFindDialogEvent& event ) { for ( int page = 0; page < m_notebook->GetPageCount(); ++page ) { event.StopPropagation(); event.SetClientData( m_findDialog ); m_notebook->GetPage( page )->GetEventHandler()->ProcessEvent( event ); } } ///////////////////////////////////////////////////////////////////////////// wxMenuBar * MainFrame::CreateFBMenuBar() { wxMenu *menuFile = new wxMenu; menuFile->Append( ID_NEW_PRJ, wxT( "&New Project\tCtrl+N" ), wxT( "Create an empty project" ) ); menuFile->Append( ID_OPEN_PRJ, wxT( "&Open...\tCtrl+O" ), wxT( "Open a project" ) ); menuFile->Append( ID_SAVE_PRJ, wxT( "&Save\tCtrl+S" ), wxT( "Save current project" ) ); menuFile->Append( ID_SAVE_AS_PRJ, wxT( "Save &As...\tCtrl-Shift+S" ), wxT( "Save current project as..." ) ); menuFile->AppendSeparator(); menuFile->Append( ID_IMPORT_XRC, wxT( "&Import XRC..." ), wxT( "Import XRC file" ) ); menuFile->AppendSeparator(); menuFile->Append( ID_GENERATE_CODE, wxT( "&Generate Code\tF8" ), wxT( "Generate Code" ) ); menuFile->AppendSeparator(); menuFile->Append( wxID_EXIT, wxT( "E&xit\tAlt-F4" ), wxT( "Quit wxFormBuilder" ) ); wxMenu *menuEdit = new wxMenu; menuEdit->Append( ID_UNDO, wxT( "&Undo \tCtrl+Z" ), wxT( "Undo changes" ) ); menuEdit->Append( ID_REDO, wxT( "&Redo \tCtrl+Y" ), wxT( "Redo changes" ) ); menuEdit->AppendSeparator(); menuEdit->Append( ID_COPY, wxT( "&Copy \tCtrl+C" ), wxT( "Copy selected object" ) ); menuEdit->Append( ID_CUT, wxT( "Cut \tCtrl+X" ), wxT( "Cut selected object" ) ); menuEdit->Append( ID_PASTE, wxT( "&Paste \tCtrl+V" ), wxT( "Paste on selected object" ) ); menuEdit->Append( ID_DELETE, wxT( "&Delete \tCtrl+D" ), wxT( "Delete selected object" ) ); menuEdit->AppendSeparator(); menuEdit->Append( ID_CLIPBOARD_COPY, wxT("Copy Object To Clipboard\tCtrl+Shift+C"), wxT("Copy Object to Clipboard") ); menuEdit->Append( ID_CLIPBOARD_PASTE, wxT("Paste Object From Clipboard\tCtrl+Shift+V"), wxT("Paste Object from Clipboard") ); menuEdit->AppendSeparator(); menuEdit->Append( ID_EXPAND, wxT( "Toggle &Expand\tAlt+W" ), wxT( "Toggle wxEXPAND flag of sizeritem properties" ) ); menuEdit->Append( ID_STRETCH, wxT( "Toggle &Stretch\tAlt+S" ), wxT( "Toggle option property of sizeritem properties" ) ); menuEdit->Append( ID_MOVE_UP, wxT( "Move Up\tAlt+Up" ), wxT( "Move Up selected object" ) ); menuEdit->Append( ID_MOVE_DOWN, wxT( "Move Down\tAlt+Down" ), wxT( "Move Down selected object" ) ); menuEdit->Append( ID_MOVE_LEFT, wxT( "Move Left\tAlt+Left" ), wxT( "Move Left selected object" ) ); menuEdit->Append( ID_MOVE_RIGHT, wxT( "Move Right\tAlt+Right" ), wxT( "Move Right selected object" ) ); menuEdit->AppendSeparator(); menuEdit->Append( ID_FIND, wxT( "&Find\tCtrl+F" ), wxT( "Find text in the active code viewer" ) ); menuEdit->AppendSeparator(); menuEdit->Append( ID_ALIGN_LEFT, wxT( "&Align &Left\tAlt+Shift+Left" ), wxT( "Align item to the left" ) ); menuEdit->Append( ID_ALIGN_CENTER_H, wxT( "&Align Center &Horizontal\tAlt+Shift+H" ), wxT( "Align item to the center horizontally" ) ); menuEdit->Append( ID_ALIGN_RIGHT, wxT( "&Align &Right\tAlt+Shift+Right" ), wxT( "Align item to the right" ) ); menuEdit->Append( ID_ALIGN_TOP, wxT( "&Align &Top\tAlt+Shift+Up" ), wxT( "Align item to the top" ) ); menuEdit->Append( ID_ALIGN_CENTER_V, wxT( "&Align Center &Vertical\tAlt+Shift+V" ), wxT( "Align item to the center vertically" ) ); menuEdit->Append( ID_ALIGN_BOTTOM, wxT( "&Align &Bottom\tAlt+Shift+Down" ), wxT( "Align item to the bottom" ) ); wxMenu *menuView = new wxMenu; menuView->Append( ID_PREVIEW_XRC, wxT( "&XRC Window\tF5" ), wxT( "Show a preview of the XRC window" ) ); wxMenu *menuTools = new wxMenu; menuTools->Append( ID_GEN_INHERIT_CLS, wxT( "&Generate Inherited Class\tF6" ), wxT( "Creates the needed files and class for proper inheritance of your designed GUI" ) ); wxMenu *menuHelp = new wxMenu; menuHelp->Append( wxID_ABOUT, wxT( "&About...\tF1" ), wxT( "Show about dialog" ) ); // now append the freshly created menu to the menu bar... wxMenuBar *menuBar = new wxMenuBar(); menuBar->Append( menuFile, wxT( "&File" ) ); menuBar->Append( menuEdit, wxT( "&Edit" ) ); menuBar->Append( menuView, wxT( "&View" ) ); menuBar->Append( menuTools, wxT( "&Tools" ) ); menuBar->Append( menuHelp, wxT( "&Help" ) ); return menuBar; } wxToolBar * MainFrame::CreateFBToolBar() { wxToolBar* toolbar = CreateToolBar(); toolbar->SetToolBitmapSize( wxSize( TOOL_SIZE, TOOL_SIZE ) ); toolbar->AddTool( ID_NEW_PRJ, wxT( "New Project" ), AppBitmaps::GetBitmap( wxT( "new" ), TOOL_SIZE ), wxNullBitmap, wxITEM_NORMAL, wxT( "New Project (Ctrl+N)" ), wxT( "Start a new project." ) ); toolbar->AddTool( ID_OPEN_PRJ, wxT( "Open Project" ), AppBitmaps::GetBitmap( wxT( "open" ), TOOL_SIZE ), wxNullBitmap, wxITEM_NORMAL, wxT( "Open Project (Ctrl+O)" ), wxT( "Open an existing project." ) ); toolbar->AddTool( ID_SAVE_PRJ, wxT( "Save Project" ), AppBitmaps::GetBitmap( wxT( "save" ), TOOL_SIZE ), wxNullBitmap, wxITEM_NORMAL, wxT( "Save Project (Ctrl+S)" ), wxT( "Save the current project." ) ); toolbar->AddSeparator(); toolbar->AddTool( ID_UNDO, wxT( "Undo" ), AppBitmaps::GetBitmap( wxT( "undo" ), TOOL_SIZE ), wxNullBitmap, wxITEM_NORMAL, wxT( "Undo (Ctrl+Z)" ), wxT( "Undo the last action." ) ); toolbar->AddTool( ID_REDO, wxT( "Redo" ), AppBitmaps::GetBitmap( wxT( "redo" ), TOOL_SIZE ), wxNullBitmap, wxITEM_NORMAL, wxT( "Redo (Ctrl+Y)" ), wxT( "Redo the last action that was undone." ) ); toolbar->AddSeparator(); toolbar->AddTool( ID_CUT, wxT( "Cut" ), AppBitmaps::GetBitmap( wxT( "cut" ), TOOL_SIZE ), wxNullBitmap, wxITEM_NORMAL, wxT( "Cut (Ctrl+X)" ), wxT( "Remove the selected object and place it on the clipboard." ) ); toolbar->AddTool( ID_COPY, wxT( "Copy" ), AppBitmaps::GetBitmap( wxT( "copy" ), TOOL_SIZE ), wxNullBitmap, wxITEM_NORMAL, wxT( "Copy (Ctrl+C)" ), wxT( "Copy the selected object to the clipboard." ) ); toolbar->AddTool( ID_PASTE, wxT( "Paste" ), AppBitmaps::GetBitmap( wxT( "paste" ), TOOL_SIZE ), wxNullBitmap, wxITEM_NORMAL, wxT( "Paste (Ctrl+V)" ), wxT( "Insert an object from the clipboard." ) ); toolbar->AddTool( ID_DELETE, wxT( "Delete" ), AppBitmaps::GetBitmap( wxT( "delete" ), TOOL_SIZE ), wxNullBitmap, wxITEM_NORMAL, wxT( "Delete (Ctrl+D)" ), wxT( "Remove the selected object." ) ); toolbar->AddSeparator(); toolbar->AddTool( ID_GENERATE_CODE, wxT( "Generate Code" ), AppBitmaps::GetBitmap( wxT( "generate" ), TOOL_SIZE ), wxNullBitmap, wxITEM_NORMAL, wxT( "Generate Code (F8)" ), wxT( "Create code from the current project." ) ); toolbar->AddSeparator(); toolbar->AddTool( ID_ALIGN_LEFT, wxT( "" ), AppBitmaps::GetBitmap( wxT( "lalign" ), TOOL_SIZE ), wxNullBitmap, wxITEM_CHECK, wxT( "Align Left" ), wxT( "The item will be aligned to the left of the space alotted to it by the sizer." ) ); toolbar->AddTool( ID_ALIGN_CENTER_H, wxT( "" ), AppBitmaps::GetBitmap( wxT( "chalign" ), TOOL_SIZE ), wxNullBitmap, wxITEM_CHECK, wxT( "Align Center Horizontally" ), wxT( "The item will be centered horizontally in the space alotted to it by the sizer." ) ); toolbar->AddTool( ID_ALIGN_RIGHT, wxT( "" ), AppBitmaps::GetBitmap( wxT( "ralign" ), TOOL_SIZE ), wxNullBitmap, wxITEM_CHECK, wxT( "Align Right" ), wxT( "The item will be aligned to the right of the space alotted to it by the sizer." ) ); toolbar->AddSeparator(); toolbar->AddTool( ID_ALIGN_TOP, wxT( "" ), AppBitmaps::GetBitmap( wxT( "talign" ), TOOL_SIZE ), wxNullBitmap, wxITEM_CHECK, wxT( "Align Top" ), wxT( "The item will be aligned to the top of the space alotted to it by the sizer." ) ); toolbar->AddTool( ID_ALIGN_CENTER_V, wxT( "" ), AppBitmaps::GetBitmap( wxT( "cvalign" ), TOOL_SIZE ), wxNullBitmap, wxITEM_CHECK, wxT( "Align Center Vertically" ), wxT( "The item will be centered vertically within space alotted to it by the sizer." ) ); toolbar->AddTool( ID_ALIGN_BOTTOM, wxT( "" ), AppBitmaps::GetBitmap( wxT( "balign" ), TOOL_SIZE ), wxNullBitmap, wxITEM_CHECK, wxT( "Align Bottom" ), wxT( "The item will be aligned to the bottom of the space alotted to it by the sizer." ) ); toolbar->AddSeparator(); toolbar->AddTool( ID_EXPAND, wxT( "" ), AppBitmaps::GetBitmap( wxT( "expand" ), TOOL_SIZE ), wxNullBitmap, wxITEM_CHECK, wxT( "Expand (Alt+W)" ), wxT( "The item will be expanded to fill the space assigned to the item." ) ); toolbar->AddTool( ID_STRETCH, wxT( "" ), AppBitmaps::GetBitmap( wxT( "stretch" ), TOOL_SIZE ), wxNullBitmap, wxITEM_CHECK, wxT( "Stretch (Alt+S)" ), wxT( "The item will grow and shrink with the sizer." ) ); toolbar->AddSeparator(); toolbar->AddTool( ID_BORDER_LEFT, wxT( "" ), AppBitmaps::GetBitmap( wxT( "left" ), TOOL_SIZE ), wxNullBitmap, wxITEM_CHECK, wxT( "Left Border" ), wxT( "A border will be added on the left side of the item." ) ); toolbar->AddTool( ID_BORDER_RIGHT, wxT( "" ), AppBitmaps::GetBitmap( wxT( "right" ), TOOL_SIZE ), wxNullBitmap, wxITEM_CHECK, wxT( "Right Border" ), wxT( "A border will be added on the right side of the item." ) ); toolbar->AddTool( ID_BORDER_TOP, wxT( "" ), AppBitmaps::GetBitmap( wxT( "top" ), TOOL_SIZE ), wxNullBitmap, wxITEM_CHECK, wxT( "Top Border" ), wxT( "A border will be added on the top of the item." ) ); toolbar->AddTool( ID_BORDER_BOTTOM, wxT( "" ), AppBitmaps::GetBitmap( wxT( "bottom" ), TOOL_SIZE ), wxNullBitmap, wxITEM_CHECK, wxT( "Bottom Border" ), wxT( "A border will be added on the bottom of the item." ) ); toolbar->Realize(); return toolbar; } wxWindow * MainFrame::CreateDesignerWindow( wxWindow *parent ) { long nbStyle; wxConfigBase* config = wxConfigBase::Get(); config->Read( wxT("/mainframe/editor/notebook_style"), &nbStyle, wxFNB_BOTTOM | wxFNB_NO_X_BUTTON | wxFNB_NO_NAV_BUTTONS | wxFNB_NODRAG | wxFNB_FF2 | wxFNB_CUSTOM_DLG ); m_notebook = new wxFlatNotebook( parent, ID_EDITOR_FNB, wxDefaultPosition, wxDefaultSize, FNB_STYLE_OVERRIDES( nbStyle ) ); m_notebook->SetCustomizeOptions( wxFNB_CUSTOM_TAB_LOOK | wxFNB_CUSTOM_ORIENTATION | wxFNB_CUSTOM_LOCAL_DRAG ); // Set notebook icons m_icons.Add( AppBitmaps::GetBitmap( wxT( "designer" ), 16 ) ); m_icons.Add( AppBitmaps::GetBitmap( wxT( "c++" ), 16 ) ); m_icons.Add( AppBitmaps::GetBitmap( wxT( "xrc" ), 16 ) ); m_notebook->SetImageList( &m_icons ); m_visualEdit = new VisualEditor( m_notebook ); AppData()->GetManager()->SetVisualEditor( m_visualEdit ); m_notebook->AddPage( m_visualEdit, wxT( "Designer" ), false, 0 ); m_cpp = new CppPanel( m_notebook, -1 ); m_notebook->AddPage( m_cpp, wxT( "C++" ), false, 1 ); m_xrc = new XrcPanel( m_notebook, -1 ); m_notebook->AddPage( m_xrc, wxT( "XRC" ), false, 2 ); return m_notebook; } wxWindow * MainFrame::CreateComponentPalette ( wxWindow *parent ) { // la paleta de componentes, no es un observador propiamente dicho, ya // que no responde ante los eventos de la aplicación m_palette = new wxFbPalette( parent, -1 ); m_palette->Create(); m_palette->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_3DFACE ) ); return m_palette; } wxWindow * MainFrame::CreateObjectTree( wxWindow *parent ) { m_objTree = new ObjectTree( parent, -1 ); m_objTree->Create(); return m_objTree; } wxWindow * MainFrame::CreateObjectInspector( wxWindow *parent ) { //TO-DO: make object inspector style selectable. int style = ( m_style == wxFB_CLASSIC_GUI ? wxFB_OI_MULTIPAGE_STYLE : wxFB_OI_SINGLE_PAGE_STYLE ); m_objInsp = new ObjectInspector( parent, -1, style ); return m_objInsp; } void MainFrame::CreateWideGui() { // MainFrame only contains m_leftSplitter window m_leftSplitter = new wxSplitterWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_LIVE_UPDATE ); wxWindow *objectTree = Title::CreateTitle( CreateObjectTree( m_leftSplitter ), wxT( "Object Tree" ) ); // panel1 contains Palette and splitter2 (m_rightSplitter) wxPanel *panel1 = new wxPanel( m_leftSplitter, -1 ); wxWindow *palette = Title::CreateTitle( CreateComponentPalette( panel1 ), wxT( "Component Palette" ) ); m_rightSplitter = new wxSplitterWindow( panel1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_LIVE_UPDATE ); wxBoxSizer *panel1_sizer = new wxBoxSizer( wxVERTICAL ); panel1_sizer->Add( palette, 0, wxEXPAND ); panel1_sizer->Add( m_rightSplitter, 1, wxEXPAND ); panel1->SetSizer( panel1_sizer ); // splitter2 contains the editor and the object inspector wxWindow *designer = Title::CreateTitle( CreateDesignerWindow( m_rightSplitter ), wxT( "Editor" ) ); wxWindow *objectInspector = Title::CreateTitle( CreateObjectInspector( m_rightSplitter ), wxT( "Object Properties" ) ); m_leftSplitter->SplitVertically( objectTree, panel1, m_leftSplitterWidth ); // Need to update the left splitter so the right one is drawn correctly wxSizeEvent update( GetSize(), GetId() ); ProcessEvent( update ); m_leftSplitter->UpdateSize(); m_leftSplitter->SetMinimumPaneSize( 2 ); m_rightSplitter->SplitVertically( designer, objectInspector, m_rightSplitterWidth ); m_rightSplitter->SetSashGravity( 1 ); m_rightSplitter->SetMinimumPaneSize( 2 ); m_style = wxFB_WIDE_GUI; SetMinSize( wxSize( 700, 380 ) ); } void MainFrame::CreateClassicGui() { // Give ID to left splitter //m_leftSplitter = new wxSplitterWindow( this, -1, wxDefaultPosition, wxDefaultSize, wxSP_LIVE_UPDATE ); m_leftSplitter = new wxSplitterWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_LIVE_UPDATE ); m_rightSplitter = new wxSplitterWindow( m_leftSplitter, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_LIVE_UPDATE ); wxWindow *objectTree = Title::CreateTitle( CreateObjectTree( m_rightSplitter ), wxT( "Object Tree" ) ); wxWindow *objectInspector = Title::CreateTitle( CreateObjectInspector( m_rightSplitter ), wxT( "Object Properties" ) ); // panel1 contains palette and designer wxPanel *panel1 = new wxPanel( m_leftSplitter, -1 ); wxWindow *palette = Title::CreateTitle( CreateComponentPalette( panel1 ), wxT( "Component Palette" ) ); wxWindow *designer = Title::CreateTitle( CreateDesignerWindow( panel1 ), wxT( "Editor" ) ); wxBoxSizer *panel1_sizer = new wxBoxSizer( wxVERTICAL ); panel1_sizer->Add( palette, 0, wxEXPAND ); panel1_sizer->Add( designer, 1, wxEXPAND ); panel1->SetSizer( panel1_sizer ); m_leftSplitter->SplitVertically( m_rightSplitter, panel1, m_leftSplitterWidth ); // Need to update the left splitter so the right one is drawn correctly wxSizeEvent update( GetSize(), GetId() ); ProcessEvent( update ); m_leftSplitter->UpdateSize(); m_rightSplitter->SplitHorizontally( objectTree, objectInspector, m_rightSplitterWidth ); m_rightSplitter->SetMinimumPaneSize( 2 ); SetMinSize( wxSize( 700, 465 ) ); } void MainFrame::OnIdle( wxIdleEvent& ) { if ( m_leftSplitter ) { m_leftSplitter->SetSashPosition( m_leftSplitterWidth ); } if ( m_rightSplitter ) { m_rightSplitter->SetSashPosition( m_rightSplitterWidth ); } Disconnect( wxEVT_IDLE, wxIdleEventHandler( MainFrame::OnIdle ) ); if ( m_autoSash ) { // Init. m_rightSplitter_sash_pos m_rightSplitter_sash_pos = m_rightSplitter->GetSashPosition(); m_rightSplitter->Connect( wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED, wxSplitterEventHandler( MainFrame::OnSplitterChanged ) ); } } void MainFrame::OnSplitterChanged( wxSplitterEvent &event ) { Debug::Print(wxT("MainFrame::OnSplitterChanged > pos = %d"), event.GetSashPosition()); // update position m_rightSplitter_sash_pos = event.GetSashPosition(); } wxformbuilder-3.1.59/src/rad/customkeys.cpp0000644000175000017500000000504411143440026021221 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #include "customkeys.h" #include "utils/debug.h" #include "codegen/cppcg.h" #include "model/objectbase.h" #include BEGIN_EVENT_TABLE(CustomKeysEvtHandler,wxEvtHandler) EVT_CHAR(CustomKeysEvtHandler::OnKeyPress) END_EVENT_TABLE() void CustomKeysEvtHandler::OnKeyPress(wxKeyEvent &event) { Debug::Print( wxT("%d"),event.GetKeyCode()); if (event.GetKeyCode() == WXK_DELETE) AppData()->RemoveObject(AppData()->GetSelectedObject()); else if (event.GetKeyCode() == 'P') { ///// // prueba del parser ///// Debug::Print( wxT("#### Prueba del parser ####") ); PObjectBase obj = AppData()->GetSelectedObject(); PCodeInfo code_info = obj->GetObjectInfo()->GetCodeInfo( wxT("C++") ); Debug::Print( wxT("#### Plantillas ####") ); Debug::Print((wxChar *)(code_info->GetTemplate( wxT("construction") ).c_str())); Debug::Print((wxChar *)(code_info->GetTemplate( wxT("declaration") ).c_str())); Debug::Print( wxT("#### Código ####") ); { CppTemplateParser parser(obj,code_info->GetTemplate( wxT("construction") ), false, false, wxEmptyString ); Debug::Print((wxChar *)parser.ParseTemplate().c_str()); } { CppTemplateParser parser(obj,code_info->GetTemplate( wxT("declaration") ), false, false, wxEmptyString ); Debug::Print((wxChar *)parser.ParseTemplate().c_str()); } } else if (event.GetKeyCode() == 'C') { AppData()->GenerateCode(); } else event.Skip(); } wxformbuilder-3.1.59/src/rad/wxfbevent.cpp0000644000175000017500000000715211143440026021025 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #include "wxfbevent.h" #include "model/objectbase.h" DEFINE_EVENT_TYPE( wxEVT_FB_PROJECT_LOADED ) DEFINE_EVENT_TYPE( wxEVT_FB_PROJECT_SAVED ) DEFINE_EVENT_TYPE( wxEVT_FB_OBJECT_EXPANDED ) DEFINE_EVENT_TYPE( wxEVT_FB_OBJECT_SELECTED ) DEFINE_EVENT_TYPE( wxEVT_FB_OBJECT_CREATED ) DEFINE_EVENT_TYPE( wxEVT_FB_OBJECT_REMOVED ) DEFINE_EVENT_TYPE( wxEVT_FB_PROPERTY_MODIFIED ) DEFINE_EVENT_TYPE( wxEVT_FB_PROJECT_REFRESH ) DEFINE_EVENT_TYPE( wxEVT_FB_CODE_GENERATION ) DEFINE_EVENT_TYPE( wxEVT_FB_EVENT_HANDLER_MODIFIED ) wxFBEvent::wxFBEvent( wxEventType commandType ) : wxEvent( 0, commandType ) { //ctor } // required for sending with wxPostEvent() wxEvent* wxFBEvent::Clone() const { return new wxFBEvent( *this ); } wxFBEvent::wxFBEvent( const wxFBEvent& event ) : wxEvent( event ), m_string( event.m_string ) { } wxFBEvent::~wxFBEvent() { //dtor } #define CASE( EVENT ) \ if ( EVENT == m_eventType ) \ { \ return wxT( #EVENT ); \ } wxString wxFBEvent::GetEventName() { CASE( wxEVT_FB_PROJECT_LOADED ) CASE( wxEVT_FB_PROJECT_SAVED ) CASE( wxEVT_FB_OBJECT_EXPANDED ) CASE( wxEVT_FB_OBJECT_SELECTED ) CASE( wxEVT_FB_OBJECT_CREATED ) CASE( wxEVT_FB_OBJECT_REMOVED ) CASE( wxEVT_FB_PROPERTY_MODIFIED ) CASE( wxEVT_FB_EVENT_HANDLER_MODIFIED ) CASE( wxEVT_FB_PROJECT_REFRESH ) CASE( wxEVT_FB_CODE_GENERATION ) return wxT( "Unknown Type" ); } void wxFBEvent::SetString( const wxString& newString ) { m_string = newString; } wxString wxFBEvent::GetString() { return m_string; } wxFBPropertyEvent::wxFBPropertyEvent(wxEventType commandType, PProperty property) : wxFBEvent(commandType), m_property(property) { } wxFBPropertyEvent::wxFBPropertyEvent( const wxFBPropertyEvent& event ) : wxFBEvent( event ), m_property( event.m_property ) { } wxEvent* wxFBPropertyEvent::Clone() const { return new wxFBPropertyEvent( *this ); } wxFBObjectEvent::wxFBObjectEvent(wxEventType commandType, PObjectBase object) : wxFBEvent(commandType), m_object(object) { } wxFBObjectEvent::wxFBObjectEvent( const wxFBObjectEvent& event ) : wxFBEvent( event ), m_object( event.m_object ) { } wxEvent* wxFBObjectEvent::Clone() const { return new wxFBObjectEvent( *this ); } wxFBEventHandlerEvent::wxFBEventHandlerEvent(wxEventType commandType, PEvent event) : wxFBEvent(commandType), m_event(event) { } wxFBEventHandlerEvent::wxFBEventHandlerEvent( const wxFBEventHandlerEvent& event ) : wxFBEvent( event ), m_event( event.m_event ) { } wxEvent* wxFBEventHandlerEvent::Clone() const { return new wxFBEventHandlerEvent( *this ); } wxformbuilder-3.1.59/src/rad/title.h0000644000175000017500000000260511143440026017601 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #ifndef __TITLE__ #define __TITLE__ #include class Title : public wxPanel { private: // DECLARE_EVENT_TABLE() public: Title(wxWindow *parent,const wxString &title=wxT("No title")); static wxWindow* CreateTitle (wxWindow *inner, const wxString &title); }; #endif //__TITLE__ wxformbuilder-3.1.59/src/rad/about.h0000644000175000017500000000342111143440026017567 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #ifndef __about__ #define __about__ #include #include #include #include /** * Class AboutDialog */ class AboutDialog : public wxDialog { private: protected: wxStaticText *m_staticText2; wxStaticText *m_staticText3; wxStaticText *m_staticText6; wxStaticLine *window1; wxPanel *m_panel1; wxStaticText *m_staticText8; wxStaticText *m_staticText9; wxStaticText *m_staticText10; wxStaticLine *window2; wxButton *m_button1; DECLARE_EVENT_TABLE() public: AboutDialog(wxWindow *parent, int id = -1); void OnButtonEvent (wxCommandEvent &event); }; #endif //__about__ wxformbuilder-3.1.59/src/rad/cmdproc.cpp0000644000175000017500000000474411143440026020450 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #include "cmdproc.h" CommandProcessor::CommandProcessor() : m_savePoint( 0 ) { } void CommandProcessor::Execute(PCommand command) { command->Execute(); m_undoStack.push(command); while (!m_redoStack.empty()) m_redoStack.pop(); } void CommandProcessor::Undo() { if (!m_undoStack.empty()) { PCommand command = m_undoStack.top(); m_undoStack.pop(); command->Restore(); m_redoStack.push(command); } } void CommandProcessor::Redo() { if (!m_redoStack.empty()) { PCommand command = m_redoStack.top(); m_redoStack.pop(); command->Execute(); m_undoStack.push(command); } } void CommandProcessor::Reset() { while (!m_redoStack.empty()) m_redoStack.pop(); while (!m_undoStack.empty()) m_undoStack.pop(); m_savePoint = 0; } bool CommandProcessor::CanUndo() { return (!m_undoStack.empty()); } bool CommandProcessor::CanRedo() { return (!m_redoStack.empty()); } void CommandProcessor::SetSavePoint() { m_savePoint = m_undoStack.size(); } bool CommandProcessor::IsAtSavePoint() { return m_undoStack.size() == m_savePoint; } /////////////////////////////////////////////////////////////////////////////// Command::Command() { m_executed = false; } void Command::Execute() { if (!m_executed) { DoExecute(); m_executed = true; } } void Command::Restore() { if (m_executed) { DoRestore(); m_executed = false; } } wxformbuilder-3.1.59/src/rad/customkeys.h0000644000175000017500000000271011143440026020663 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #ifndef __KEYS_HANDLER__ #define __KEYS_HANDLER__ #include "wx/wx.h" // This class is not needed because shorcuts are made through acceletors // of the MainFrame menubar. class CustomKeysEvtHandler : public wxEvtHandler { private: CustomKeysEvtHandler() {} DECLARE_EVENT_TABLE() public: void OnKeyPress(wxKeyEvent &event); }; #endif //__KEYS_HANDLER__ wxformbuilder-3.1.59/src/rad/cmdproc.h0000644000175000017500000000371311143440026020110 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #ifndef __COMMAND_PROC__ #define __COMMAND_PROC__ #include #include class Command; typedef boost::shared_ptr PCommand; class CommandProcessor { private: typedef std::stack CommandStack; CommandStack m_undoStack; CommandStack m_redoStack; size_t m_savePoint; public: CommandProcessor(); void Execute(PCommand command); void Undo(); void Redo(); void Reset(); void SetSavePoint(); bool IsAtSavePoint(); bool CanUndo(); bool CanRedo(); }; class Command { private: bool m_executed; protected: /** * Ejecuta el comando. */ virtual void DoExecute() = 0; /** * Restaura el estado previo a la ejecución del comando. */ virtual void DoRestore() = 0; public: Command(); virtual ~Command() {}; void Execute(); void Restore(); }; #endif //__COMMAND_PROC__ wxformbuilder-3.1.59/src/rad/about.cpp0000644000175000017500000001236111143440026020125 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #include "about.h" #include #include #include #include "rad/appdata.h" #include #define ID_DEFAULT -1 // Default #define ID_OK 1000 BEGIN_EVENT_TABLE(AboutDialog,wxDialog) EVT_BUTTON(ID_OK,AboutDialog::OnButtonEvent) END_EVENT_TABLE() class HtmlWindow : public wxHtmlWindow { public: HtmlWindow(wxWindow *parent) : wxHtmlWindow(parent, -1, wxDefaultPosition, wxDefaultSize, wxHW_SCROLLBAR_NEVER | wxHW_NO_SELECTION | wxRAISED_BORDER) { } void LaunchBrowser(const wxString& url) { wxFileType *ft = wxTheMimeTypesManager->GetFileTypeFromExtension(wxT("html")); if (!ft) { wxLogError(wxT("Impossible to determine the file type for extension html.\nPlease edit your MIME types.")); return; } wxString cmd; bool ok = ft->GetOpenCommand(&cmd, wxFileType::MessageParameters(url, wxT(""))); delete ft; if (ok) wxExecute(cmd, wxEXEC_ASYNC); } void OnLinkClicked(const wxHtmlLinkInfo& link) { #if wxCHECK_VERSION( 2, 8, 0 ) ::wxLaunchDefaultBrowser( link.GetHref() ); #else LaunchBrowser(link.GetHref()); #endif } }; AboutDialog::AboutDialog(wxWindow *parent, int id) : wxDialog(parent,id,wxT("About..."),wxDefaultPosition,wxSize(485,470))//wxSize(308,248)) { #if 0 wxBoxSizer *sizer2; sizer2 = new wxBoxSizer(wxVERTICAL); m_staticText2 = new wxStaticText(this,ID_DEFAULT,wxT("wxFormBuilder"),wxDefaultPosition,wxDefaultSize,0); m_staticText2->SetFont(wxFont(12,74,90,92,false,wxT("Arial"))); sizer2->Add(m_staticText2, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5); m_staticText3 = new wxStaticText(this,ID_DEFAULT,wxT("a RAD tool for wxWidgets framework"),wxDefaultPosition,wxDefaultSize,0); sizer2->Add(m_staticText3, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5); m_staticText6 = new wxStaticText(this,ID_DEFAULT,wxT("(C) 2005 José Antonio Hurtado"),wxDefaultPosition,wxDefaultSize,0); sizer2->Add(m_staticText6, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5); window1 = new wxStaticLine(this,ID_DEFAULT,wxDefaultPosition,wxDefaultSize,wxLI_HORIZONTAL); sizer2->Add(window1, 0, wxALL|wxEXPAND, 5); m_panel1 = new wxPanel(this,ID_DEFAULT,wxDefaultPosition,wxDefaultSize,wxSUNKEN_BORDER|wxTAB_TRAVERSAL); wxBoxSizer *sizer3; sizer3 = new wxBoxSizer(wxVERTICAL); m_staticText8 = new wxStaticText(m_panel1,ID_DEFAULT,wxT("Developed by:"),wxDefaultPosition,wxDefaultSize,0); sizer3->Add(m_staticText8, 0, wxALL, 5); m_staticText9 = new wxStaticText(m_panel1,ID_DEFAULT,wxT("- José Antonio Hurtado"),wxDefaultPosition,wxDefaultSize,0); sizer3->Add(m_staticText9, 0, wxALL, 5); m_staticText10 = new wxStaticText(m_panel1,ID_DEFAULT,wxT("- Juan Antonio Ortega"),wxDefaultPosition,wxDefaultSize,0); sizer3->Add(m_staticText10, 0, wxALL, 5); m_panel1->SetSizer(sizer3); m_panel1->SetAutoLayout(true); m_panel1->Layout(); sizer2->Add(m_panel1, 1, wxALL|wxEXPAND, 5); window2 = new wxStaticLine(this,ID_DEFAULT,wxDefaultPosition,wxDefaultSize,wxLI_HORIZONTAL); sizer2->Add(window2, 0, wxALL|wxEXPAND, 5); m_button1 = new wxButton(this,ID_OK,wxT("&OK"),wxDefaultPosition,wxDefaultSize,0); sizer2->Add(m_button1, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5); this->SetSizer(sizer2); this->SetAutoLayout(true); this->Layout(); #endif wxBoxSizer *mainSizer = new wxBoxSizer(wxVERTICAL); wxHtmlWindow *htmlWin = new HtmlWindow(this); // I don't know where is the problem, but if you call SetBorders(b) with // 'b' between 0..6 it works, but if you use a bigger border, it doesn't fit // correctly. htmlWin->SetBorders(5); htmlWin->LoadFile(wxFileName(AppData()->GetApplicationPath() + wxFILE_SEP_PATH + wxT("resources/about.html"))); #ifdef __WXMAC__ // work around a wxMac bug htmlWin->SetSize(400, 600); #else htmlWin->SetSize(htmlWin->GetInternalRepresentation()->GetWidth(), htmlWin->GetInternalRepresentation()->GetHeight()); #endif mainSizer->Add(htmlWin, 1, wxEXPAND | wxALL, 5); mainSizer->Add(new wxButton(this, wxID_OK, wxT("OK")), 0, wxALIGN_CENTER | wxBOTTOM, 5); SetSizerAndFit(mainSizer); } void AboutDialog::OnButtonEvent (wxCommandEvent &) { Close(); } wxformbuilder-3.1.59/src/rad/bitmaps.cpp0000644000175000017500000000522611143440026020454 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #include "bitmaps.h" #include "tinyxml.h" #include #include #include "utils/typeconv.h" #include "utils/stringutils.h" #include "utils/wxfbexception.h" #include static std::map< wxString, wxBitmap > m_bitmaps; wxBitmap AppBitmaps::GetBitmap( wxString iconname, unsigned int size ) { std::map< wxString, wxBitmap >::iterator bitmap; bitmap = m_bitmaps.find( iconname ); wxBitmap bmp; if ( bitmap != m_bitmaps.end() ) { bmp = m_bitmaps[iconname]; } else { bmp = m_bitmaps[ wxT("unknown") ]; } if ( size != 0 ) { // rescale it to requested size if ( bmp.GetWidth() != (int)size || bmp.GetHeight() != (int)size ) { wxImage image = bmp.ConvertToImage(); bmp = wxBitmap( image.Scale(size, size) ); } } return bmp; } void AppBitmaps::LoadBitmaps( wxString filepath, wxString iconpath ) { try { m_bitmaps[ wxT("unknown") ] = wxBitmap( default_xpm ); ticpp::Document doc; XMLUtils::LoadXMLFile( doc, true, filepath ); ticpp::Element* root = doc.FirstChildElement( "icons" ); ticpp::Element* elem = root->FirstChildElement( "icon", false ); while ( elem ) { wxString name = _WXSTR( elem->GetAttribute("name") ); wxString file = _WXSTR( elem->GetAttribute("file") ); m_bitmaps[name] = wxBitmap( iconpath + file, wxBITMAP_TYPE_ANY ); elem = elem->NextSiblingElement( "icon", false ); } } catch ( ticpp::Exception& ex ) { wxLogError( _("Error loading images: %s"), _WXSTR( ex.m_details ).c_str() ); } catch ( wxFBException& ex ) { wxLogError( _("Error loading images: %s"), ex.what() ); } } wxformbuilder-3.1.59/src/rad/wxfbmanager.cpp0000644000175000017500000001142711143440026021316 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // Ryan Mulder - rjmyst3@gmail.com // /////////////////////////////////////////////////////////////////////////////// #include "wxfbmanager.h" #include "designer/visualeditor.h" #include "model/objectbase.h" #include "rad/appdata.h" #define CHECK_NULL( THING, THING_NAME, RETURN ) \ if ( !THING ) \ { \ wxLogError( _("%s is NULL! <%s,%i>"), THING_NAME, __TFILE__, __LINE__ ); \ return RETURN; \ } #define CHECK_VISUAL_EDITOR( RETURN ) \ CHECK_NULL( m_visualEdit, _("Visual Editor"), RETURN ) #define CHECK_WX_OBJECT( RETURN ) \ CHECK_NULL( wxobject, _("wxObject"), RETURN ) #define CHECK_OBJECT_BASE( RETURN ) \ CHECK_NULL( obj, _("ObjectBase"), RETURN ) // Classes to unset flags in VisualEditor during the destructor - this prevents // forgetting to unset the flag class FlagFlipper { private: VisualEditor* m_visualEditor; void (VisualEditor::*m_flagFunction)( bool ); public: FlagFlipper( VisualEditor* visualEdit, void (VisualEditor::*flagFunction)( bool ) ) : m_visualEditor( visualEdit ), m_flagFunction( flagFunction ) { ( m_visualEditor->*m_flagFunction )( true ); } ~FlagFlipper() { ( m_visualEditor->*m_flagFunction )( false ); } }; wxFBManager::wxFBManager() : m_visualEdit( NULL ) { } void wxFBManager::SetVisualEditor( VisualEditor* visualEdit ) { m_visualEdit = visualEdit; } IObject* wxFBManager::GetIObject( wxObject* wxobject ) { CHECK_VISUAL_EDITOR( NULL ) CHECK_WX_OBJECT( NULL ) PObjectBase obj = m_visualEdit->GetObjectBase( wxobject ); CHECK_OBJECT_BASE( NULL ) return obj.get(); } size_t wxFBManager::GetChildCount( wxObject* wxobject ) { CHECK_VISUAL_EDITOR( 0 ) CHECK_WX_OBJECT( 0 ) PObjectBase obj = m_visualEdit->GetObjectBase( wxobject ); CHECK_OBJECT_BASE( 0 ) return obj->GetChildCount(); } wxObject* wxFBManager::GetChild( wxObject* wxobject, size_t childIndex ) { CHECK_VISUAL_EDITOR( NULL ) CHECK_WX_OBJECT( NULL ) PObjectBase obj = m_visualEdit->GetObjectBase( wxobject ); CHECK_OBJECT_BASE( NULL ) if ( childIndex >= obj->GetChildCount() ) { return NULL; } return m_visualEdit->GetWxObject( obj->GetChild( childIndex ) ); } IObject* wxFBManager::GetIParent( wxObject* wxobject ) { CHECK_VISUAL_EDITOR( NULL ) CHECK_WX_OBJECT( NULL ) PObjectBase obj = m_visualEdit->GetObjectBase( wxobject ); CHECK_OBJECT_BASE( NULL ) return obj->GetParent().get(); } wxObject* wxFBManager::GetParent( wxObject* wxobject ) { CHECK_VISUAL_EDITOR( NULL ) CHECK_WX_OBJECT( NULL ) PObjectBase obj = m_visualEdit->GetObjectBase( wxobject ); CHECK_OBJECT_BASE( NULL ) return m_visualEdit->GetWxObject( obj->GetParent() ); } wxObject* wxFBManager::GetWxObject( PObjectBase obj ) { CHECK_OBJECT_BASE( NULL ) return m_visualEdit->GetWxObject( obj ); } void wxFBManager::ModifyProperty( wxObject* wxobject, wxString property, wxString value, bool allowUndo ) { CHECK_VISUAL_EDITOR() // Prevent modified event in visual editor - no need to redraw when the change is happening in the editor! FlagFlipper stopModifiedEvent( m_visualEdit, &VisualEditor::PreventOnModified ); CHECK_WX_OBJECT() PObjectBase obj = m_visualEdit->GetObjectBase( wxobject ); CHECK_OBJECT_BASE() PProperty prop = obj->GetProperty( property ); if ( !prop ) { wxLogError( _("%s has no property named %s"), obj->GetClassName().c_str(), property.c_str() ); return; } if ( allowUndo ) { AppData()->ModifyProperty( prop, value ); } else { prop->SetValue( value ); } } bool wxFBManager::SelectObject( wxObject* wxobject ) { CHECK_VISUAL_EDITOR( false ) // Prevent loop of selection events FlagFlipper stopSelectedEvent( m_visualEdit, &VisualEditor::PreventOnSelected ); CHECK_WX_OBJECT( false ) PObjectBase obj = m_visualEdit->GetObjectBase( wxobject ); CHECK_OBJECT_BASE( false ) return AppData()->SelectObject( obj ); } wxNoObject* wxFBManager::NewNoObject() { return new wxNoObject; } wxformbuilder-3.1.59/src/rad/bitmaps.h0000644000175000017500000000270411143440026020117 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #ifndef __WXFB__BITMAPS_H__ #define __WXFB__BITMAPS_H__ #define ICON_SIZE 22 #define TOOL_SIZE 22 #define SMALL_ICON_SIZE 14 #include "wx/wx.h" #include class AppBitmaps { public: static wxBitmap GetBitmap( wxString iconname, unsigned int size = 0 ); static void LoadBitmaps( wxString filepath, wxString iconpath ); }; #endif //__WXFB__BITMAPS_H__ wxformbuilder-3.1.59/src/rad/appdata.h0000644000175000017500000002524711143440026020101 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #ifndef __APP_DATA__ #define __APP_DATA__ #include "utils/wxfbdefs.h" #include "model/database.h" #include "rad/cmdproc.h" #include namespace ticpp { class Node; class Element; } class Property; class wxFBEvent; class wxFBManager; class wxFBIPC; #define AppData() (ApplicationData::Get()) #define AppDataCreate(path) (ApplicationData::Get(path)) #define AppDataInit() (ApplicationData::Initialize()) #define AppDataDestroy() (ApplicationData::Destroy()) // This class is a singleton class. class ApplicationData { private: static ApplicationData *s_instance; wxString m_rootDir; // directorio raíz (mismo que el ejecutable) bool m_modFlag; // flag de proyecto modificado PObjectDatabase m_objDb; // Base de datos de objetos PObjectBase m_project; // Proyecto PObjectBase m_selObj; // Objeto seleccionado PObjectBase m_clipboard; bool m_copyOnPaste; // flag que indica si hay que copiar el objeto al pegar // Procesador de comandos Undo/Redo CommandProcessor m_cmdProc; wxString m_projectFile; wxString m_projectPath; PwxFBManager m_manager; // Prevent more than one instance of a project boost::shared_ptr< wxFBIPC > m_ipc; typedef std::vector< wxEvtHandler* > HandlerVector; HandlerVector m_handlers; void NotifyEvent( wxFBEvent& event ); // Notifican a cada observador el evento correspondiente void NotifyProjectLoaded(); void NotifyProjectSaved(); void NotifyObjectExpanded( PObjectBase obj ); void NotifyObjectSelected( PObjectBase obj ); void NotifyObjectCreated( PObjectBase obj ); void NotifyObjectRemoved( PObjectBase obj ); void NotifyPropertyModified( PProperty prop ); void NotifyEventHandlerModified( PEvent evtHandler ); void NotifyProjectRefresh(); void NotifyCodeGeneration( bool panelOnly = false ); /** * Comprueba las referencias cruzadas de todos los nodos del árbol */ void CheckProjectTree( PObjectBase obj ); /** * Resuelve un posible conflicto de nombres. * @note el objeto a comprobar debe estar insertado en proyecto, por tanto * no es válida para arboles "flotantes". */ void ResolveNameConflict( PObjectBase obj ); /** * Rename all objects that have the same name than any object of a subtree. */ void ResolveSubtreeNameConflicts( PObjectBase obj, PObjectBase topObj = PObjectBase() ); /** * Rutina auxiliar de ResolveNameConflict */ void BuildNameSet( PObjectBase obj, PObjectBase top, std::set &name_set ); /** * Calcula la posición donde deberá ser insertado el objeto. * * Dado un objeto "padre" y un objeto "seleccionado", esta rutina calcula la * posición de inserción de un objeto debajo de "parent" de forma que el objeto * quede a continuación del objeto "seleccionado". * * El algoritmo consiste ir subiendo en el arbol desde el objeto "selected" * hasta encontrar un objeto cuyo padre sea el mismo que "parent" en cuyo * caso se toma la posición siguiente a ese objeto. * * @param parent objeto "padre" * @param selected objeto "seleccionado". * @return posición de insercción (-1 si no se puede insertar). */ int CalcPositionOfInsertion( PObjectBase selected, PObjectBase parent ); /** * Elimina aquellos items que no contengan hijos. * * Esta rutina se utiliza cuando el árbol que se carga de un fichero * no está bien formado, o la importación no ha sido correcta. */ void RemoveEmptyItems( PObjectBase obj ); /** * Eliminar un objeto. */ void DoRemoveObject( PObjectBase object, bool cutObject ); void Execute( PCommand cmd ); /** * Search a size in the hierarchy of an object */ PObjectBase SearchSizerInto( PObjectBase obj ); /** Convert the properties of the project element. Handle this separately because it does not repeat. @param project The project element. @param path The path to the project file. @param fileMajor The major revision of the file. @param fileMinor The minor revision of the file. */ void ConvertProjectProperties( ticpp::Element* project, const wxString& path, int fileMajor, int fileMinor ); /** Iterates through 'property' element children of @a parent. Saves all properties with a 'name' attribute matching one of @a names into @a properties @param parent Object element with child properties. @param names Set of property names to search for. @param properties Pointer to a set in which to store the result of the search. */ void GetPropertiesToConvert( ticpp::Node* parent, const std::set< std::string >& names, std::set< ticpp::Element* >* properties ); /** Transfers @a options from the text of @a prop to the text of @a newPropName, which will be created if it doesn't exist. @param prop Property containing the options to transfer. @param options Set of options to search for and transfer. @param newPropName Name of property to transfer to, will be created if non-existant. */ void TransferOptionList( ticpp::Element* prop, std::set< wxString >* options, const std::string& newPropName ); // hiden constructor ApplicationData( const wxString &rootdir = wxT( "." ) ); #ifdef __WXFB_DEBUG__ wxLog* m_debugLogTarget; #endif public: ~ApplicationData(); #ifdef __WXFB_DEBUG__ wxLog* GetDebugLogTarget(){ return m_debugLogTarget; } #endif static ApplicationData* Get( const wxString &rootdir = wxT( "." ) ); // Force the static AppData instance to Init() static void Initialize(); static void Destroy(); // Initialize application void LoadApp(); // Hold a pointer to the wxFBManager PwxFBManager GetManager(); // Procedures for register/unregister wxEvtHandlers to be notified of wxFBEvents void AddHandler( wxEvtHandler* handler ); void RemoveHandler( wxEvtHandler* handler ); // Operaciones sobre los datos bool LoadProject( const wxString &file, bool checkSingleInstance = true ); void SaveProject( const wxString &filename ); void NewProject(); /** Convert a project from an older version. @param path The path to the project file @param fileMajor The major revision of the file @param fileMinor The minor revision of the file @return true if successful, false otherwise */ bool ConvertProject( const wxString& path, int fileMajor, int fileMinor ); /** Recursive function used to convert the object tree in the project file to the latest version. @param object A pointer to the object element @param fileMajor The major revision of the file @param fileMinor The minor revision of the file */ void ConvertObject( ticpp::Element* object, int fileMajor, int fileMinor ); void ExpandObject( PObjectBase obj, bool expand ); void DetermineObjectToSelect( PObjectBase parent, unsigned int pos ); // Object will not be selected if it already is selected, unless force = true // Returns true if selection changed, false if already selected bool SelectObject( PObjectBase obj, bool force = false, bool notify = true ); void CreateObject( wxString name ); void RemoveObject( PObjectBase obj ); void CutObject( PObjectBase obj ); void CopyObject( PObjectBase obj ); bool PasteObject( PObjectBase parent, PObjectBase objToPaste = PObjectBase() ); void CopyObjectToClipboard( PObjectBase obj ); bool PasteObjectFromClipboard( PObjectBase parent ); void InsertObject( PObjectBase obj, PObjectBase parent ); void MergeProject( PObjectBase project ); void ModifyProperty( PProperty prop, wxString value ); void ModifyEventHandler( PEvent evt, wxString value ); void GenerateCode( bool projectOnly = false ); void GenerateInheritedClass( PObjectBase form, wxString className, wxString path, wxString file ); void MovePosition( PObjectBase, bool right, unsigned int num = 1 ); void MoveHierarchy( PObjectBase obj, bool up ); void Undo(); void Redo(); void ToggleExpandLayout( PObjectBase obj ); void ToggleStretchLayout( PObjectBase obj ); void ChangeAlignment ( PObjectBase obj, int align, bool vertical ); void ToggleBorderFlag( PObjectBase obj, int border ); void CreateBoxSizerWithObject( PObjectBase obj ); void ShowXrcPreview(); // Servicios para los observadores PObjectBase GetSelectedObject(); PObjectBase GetProjectData(); PObjectBase GetSelectedForm(); bool CanUndo() { return m_cmdProc.CanUndo(); } bool CanRedo() { return m_cmdProc.CanRedo(); } bool GetLayoutSettings( PObjectBase obj, int *flag, int *option, int *border, int* orient ); bool CanPasteObject(); bool CanPasteObjectFromClipboard(); bool CanCopyObject(); bool IsModified(); PObjectPackage GetPackage( unsigned int idx ) { return m_objDb->GetPackage( idx );} unsigned int GetPackageCount() { return m_objDb->GetPackageCount(); } PObjectDatabase GetObjectDatabase() { return m_objDb; } // Servicios específicos, no definidos en DataObservable void SetClipboardObject( PObjectBase obj ) { m_clipboard = obj; } PObjectBase GetClipboardObject() { return m_clipboard; } wxString GetProjectFileName() { return m_projectFile; } const int m_fbpVerMajor; const int m_fbpVerMinor; /** Path to the fbp file that is opened. */ const wxString &GetProjectPath() { return m_projectPath; }; /** Path where the files will be generated. */ wxString GetOutputPath(); void SetProjectPath( const wxString &path ) { m_projectPath = path; }; const wxString &GetApplicationPath() { return m_rootDir; }; void SetApplicationPath( const wxString &path ) { m_rootDir = path; }; // Allow a single instance check from outsid the AppData class bool VerifySingleInstance( const wxString& file, bool switchTo = true ); }; #endif //__APP_DATA__ wxformbuilder-3.1.59/src/rad/genericpanel.h0000644000175000017500000000254511143440026021117 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #ifndef __GENERIC_PANEL__ #define __GENERIC_PANEL__ #include "wx/wx.h" class GenericWindow : public wxPanel { private: DECLARE_EVENT_TABLE() public: GenericWindow(wxWindow *parent); void OnPaint(wxPaintEvent &event); }; #endif //__GENERIC_PANEL__ wxformbuilder-3.1.59/src/rad/genericpanel.cpp0000644000175000017500000000307211143440026021446 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #include "rad/genericpanel.h" BEGIN_EVENT_TABLE(GenericWindow,wxPanel) EVT_PAINT(GenericWindow::OnPaint) END_EVENT_TABLE() GenericWindow::GenericWindow(wxWindow *parent) : wxPanel (parent, -1,wxDefaultPosition,wxSize(30,30)) { } void GenericWindow::OnPaint(wxPaintEvent &) { wxPaintDC dc(this); wxSize size = GetSize(); dc.SetPen(*wxBLACK_PEN); for (int i=0;i //#include "wx/aui/aui.h" #include "wx/splitter.h" #include class wxFBEvent; class wxFBObjectEvent; class wxFBPropertyEvent; class wxFBEventHandlerEvent; class CppPanel; class XrcPanel; class ObjectTree; class ObjectInspector; class wxFbPalette; class VisualEditor; /** * wxFormBuilder GUI styles. */ enum { wxFB_DEFAULT_GUI, wxFB_DOCKABLE_GUI, wxFB_CLASSIC_GUI, wxFB_WIDE_GUI }; class MainFrame : public wxFrame { private: #ifdef __WXFB_DEBUG__ wxLog * m_old_log; wxLogWindow * m_log; #endif //__WXFB_DEBUG__ wxSplitterWindow *m_leftSplitter; wxSplitterWindow *m_rightSplitter; int m_leftSplitterWidth; int m_rightSplitterWidth; //wxFrameManager m_mgr; wxFlatNotebook *m_notebook; wxFlatNotebookImageList m_icons; wxFbPalette *m_palette; ObjectTree *m_objTree; ObjectInspector *m_objInsp; VisualEditor *m_visualEdit; CppPanel *m_cpp; XrcPanel *m_xrc; int m_style; // Save which page is selected int m_page_selection; // Save right splitter's sash position int m_rightSplitter_sash_pos; // Automatically update sash in splitter window base on user action bool m_autoSash; wxString m_currentDir; wxString m_recentProjects[4]; void UpdateFrame(); // Actualiza los projectos más recientes en el menu void UpdateRecentProjects(); void OnOpenRecent(wxCommandEvent &event); void UpdateLayoutTools(); // Used to correctly restore splitter position void OnIdle( wxIdleEvent& ); wxFindReplaceData m_findData; wxFindReplaceDialog* m_findDialog; // Used to force propgrid to save on lost focus wxEvtHandler* m_focusKillEvtHandler; DECLARE_EVENT_TABLE() public: MainFrame(wxWindow *parent, int id = -1, int style = wxFB_DEFAULT_GUI, wxPoint pos = wxDefaultPosition, wxSize size = wxSize( 1000, 800 ) ); ~MainFrame(); void RestorePosition(const wxString &name); void SavePosition(const wxString &name); void OnSaveProject(wxCommandEvent &event); void OnSaveAsProject(wxCommandEvent &event); void OnOpenProject(wxCommandEvent &event); void OnNewProject(wxCommandEvent &event); void OnGenerateCode(wxCommandEvent &event); void OnAbout(wxCommandEvent &event); void OnExit(wxCommandEvent &event); void OnClose(wxCloseEvent &event); void OnImportXrc(wxCommandEvent &event); void OnUndo(wxCommandEvent &event); void OnRedo(wxCommandEvent &event); void OnCopy (wxCommandEvent &event); void OnPaste (wxCommandEvent &event); void OnCut (wxCommandEvent &event); void OnDelete (wxCommandEvent &event); void OnClipboardCopy(wxCommandEvent& e); void OnClipboardPaste(wxCommandEvent& e); void OnClipboardPasteUpdateUI( wxUpdateUIEvent& e ); void OnToggleExpand (wxCommandEvent &event); void OnToggleStretch (wxCommandEvent &event); void OnMoveUp (wxCommandEvent &event); void OnMoveDown (wxCommandEvent &event); void OnMoveLeft (wxCommandEvent &event); void OnMoveRight (wxCommandEvent &event); void OnChangeAlignment (wxCommandEvent &event); void OnChangeBorder(wxCommandEvent& e); void OnXrcPreview(wxCommandEvent& e); void OnGenInhertedClass(wxCommandEvent& e); void OnFlatNotebookPageChanged( wxFlatNotebookEvent& event ); void OnProjectLoaded( wxFBEvent& event ); void OnProjectSaved( wxFBEvent& event ); void OnObjectExpanded( wxFBObjectEvent& event ); void OnObjectSelected( wxFBObjectEvent& event ); void OnObjectCreated( wxFBObjectEvent& event ); void OnObjectRemoved( wxFBObjectEvent& event ); void OnPropertyModified( wxFBPropertyEvent& event ); void OnEventHandlerModified( wxFBEventHandlerEvent& event ); void OnCodeGeneration( wxFBEvent& event ); void OnProjectRefresh( wxFBEvent& event ); void OnSplitterChanged( wxSplitterEvent &event ); void InsertRecentProject(const wxString &file); wxWindow *CreateComponentPalette (wxWindow *parent); wxWindow *CreateDesignerWindow (wxWindow *parent); wxWindow *CreateObjectTree (wxWindow *parent); wxWindow *CreateObjectInspector (wxWindow *parent); wxMenuBar *CreateFBMenuBar(); wxToolBar *CreateFBToolBar(); void CreateWideGui(); void CreateClassicGui(); void OnFindDialog( wxCommandEvent& event ); void OnFind( wxFindDialogEvent& event ); void OnFindClose( wxFindDialogEvent& event ); bool SaveWarning(); }; #endif //__MAIN_FRAME__ wxformbuilder-3.1.59/src/rad/wxfbmanager.h0000644000175000017500000000351511143440026020762 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // Ryan Mulder - rjmyst3@gmail.com // /////////////////////////////////////////////////////////////////////////////// #ifndef WXFBMANAGER #define WXFBMANAGER #include #include "utils/wxfbdefs.h" class VisualEditor; class ObjectBase; class wxFBManager : public IManager { private: VisualEditor* m_visualEdit; public: wxFBManager(); void SetVisualEditor( VisualEditor* visualEdit ); size_t GetChildCount( wxObject* wxobject ); wxObject* GetChild( wxObject* wxobject, size_t childIndex ); wxObject* GetParent( wxObject* wxobject ); IObject* GetIParent( wxObject* wxobject ); IObject* GetIObject( wxObject* wxobject ); wxObject* GetWxObject( PObjectBase obj ); wxNoObject* NewNoObject(); void ModifyProperty( wxObject* wxobject, wxString property, wxString value, bool allowUndo = true ); // Returns true if selection changed, false if already selected bool SelectObject( wxObject* wxobject ); }; #endif //WXFBMANAGER wxformbuilder-3.1.59/src/rad/menueditor.h0000644000175000017500000001263711143440026020641 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #ifndef __MENUEDITOR__ #define __MENUEDITOR__ #include #include #include #include #include "utils/wxfbdefs.h" #include "model/database.h" /** * Class MenuEditor */ class MenuEditor : public wxDialog { private: /** Devuelve el índice del elemento seleccionado en el wxListCtrl */ long GetSelectedItem(); /** Devuelve la profundidad del elemento "n" del wxListCtrl */ int GetItemIdentation(long n); /** Inserta en la posición "n" un elemento en el wxListCtrl. No añade sangría en el campo label. @param obj Pointer to the original object to be saved with SetItemData If the item is still an item when the dialog is closed, this is used to preserve data like bitmaps and events. */ long InsertItem(long n, const wxString& label, const wxString& shortcut, const wxString& id, const wxString& name, const wxString& helpString, const wxString& kind, PObjectBase obj = PObjectBase() ); /** Inserta debajo del elemento seleccionado (o en la última posición en caso de no haber selección) un nuevo elemento en el wxListCtrl. El campo label se sangra al mismo nivel que el elemento que le precede */ void AddItem(const wxString& label, const wxString& shortcut, const wxString& id, const wxString& name, const wxString &help, const wxString& kind); /** Determina el índice en el que acaba el menú que empieza en la posición "n" */ long GetEndIndex(long n); /** Devuelve los campos del wxListCtrl del elemento "n". El campo label lo devuelve con sangría @param obj Pointer to the original object to be retrieved with GetItemData If the item is still an item when the dialog is closed, this is used to preserve data like bitmaps and events. */ void GetItem(long n, wxString& label, wxString& shortcut, wxString& id, wxString& name, wxString& help, wxString& kind, PObjectBase* obj = NULL ); /** Inserta en la posición "n" del wxListCtrl, los hijos de "obj". El primer hijo de "obj" estará sangrado con el valor de "ident". En "n" se devuelve la siguiente posición libre del wxListCtrl tras hacer la inserción */ void AddChild(long& n, int ident, PObjectBase obj); /** Determina si el elemento "n" del wxListCtrl tiene submenús o por el contrario es un menuitem */ bool HasChildren(long n); /** Devuelve el ObjectBase correspondiente al menú que empieza en la posición "n" del wxListCtrl, así como todos los hijos de ese menú. En "n" devuelve la posición en el wxListCtrl del siguiente menú. isSubMenu debe ser true para los menús de primer nivel (aquellos que aparecerán en la barra de menús) y false para el resto (submenús dentro de los menús). */ PObjectBase GetMenu(long& n, PObjectDatabase base, bool isSubMenu = true); /** Toma los valores introducidos por el usuario en los campos e inserta el elemento en el wxListCtrl. Tras la inserción, vacía todos los campos y pone el foco en el campo "label". */ void AddNewItem(); protected: wxListCtrl *m_menuList; wxTextCtrl *m_tcId; wxTextCtrl *m_tcLabel; wxTextCtrl *m_tcName; wxTextCtrl *m_tcHelpString; wxTextCtrl *m_tcShortcut; wxRadioBox *m_rbItemKind; std::vector< WPObjectBase > m_originalItems; DECLARE_EVENT_TABLE() public: /** Constructor */ MenuEditor(wxWindow *parent, int id = -1); /** Rellena el wxListCtrl con los datos de "obj", que debe ser de tipo menubar */ void Populate(PObjectBase obj); /** Devuelve la jerarquía de ObjectBase correspondiente a la barra de menús que hay en el wxListCtrl. El objeto devuelto será, por tanto, de tipo wxMenuBar */ PObjectBase GetMenubar(PObjectDatabase base); /** Eventos de la interfaz de usuario */ void OnAddMenuItem(wxCommandEvent& e); void OnAddSeparator(wxCommandEvent& e); void OnModifyMenuItem(wxCommandEvent& e); void OnRemoveMenuItem(wxCommandEvent& e); void OnMenuDown(wxCommandEvent& e); void OnMenuLeft(wxCommandEvent& e); void OnMenuRight(wxCommandEvent& e); void OnMenuUp(wxCommandEvent& e); void OnEnter(wxCommandEvent& e); void OnLabelChanged(wxCommandEvent& e); void OnUpdateMovers(wxUpdateUIEvent& e); void OnItemActivated(wxListEvent& e); }; #endif //__menueditor__ wxformbuilder-3.1.59/src/rad/palette.cpp0000644000175000017500000001654111143440026020455 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #include "palette.h" #include "model/objectbase.h" #include "bitmaps.h" #include "utils/debug.h" #include "utils/wxfbdefs.h" #include "utils/typeconv.h" #include "rad/title.h" #include "wx/config.h" #include #ifdef __WXMAC__ #include #endif #define ID_PALETTE_BUTTON 999 #ifdef __WXGTK__ #if wxCHECK_VERSION( 2, 8, 0 ) #define DRAG_OPTION 0 #else #define DRAG_OPTION wxFNB_NODRAG #endif #else #define DRAG_OPTION 0 #endif wxWindowID wxFbPalette::nextId = wxID_HIGHEST + 1000; BEGIN_EVENT_TABLE( wxFbPalette, wxPanel ) #ifdef __WXMAC__ EVT_BUTTON( -1, wxFbPalette::OnButtonClick ) #else EVT_TOOL(-1, wxFbPalette::OnButtonClick) #endif EVT_SPIN_UP( -1, wxFbPalette::OnSpinUp ) EVT_SPIN_DOWN( -1, wxFbPalette::OnSpinDown ) END_EVENT_TABLE() wxFbPalette::wxFbPalette( wxWindow *parent, int id ) : wxPanel( parent, id ), m_notebook( NULL ) { } void wxFbPalette::PopulateToolbar( PObjectPackage pkg, wxToolBar *toolbar ) { unsigned int j = 0; while ( j < pkg->GetObjectCount() ) { PObjectInfo info = pkg->GetObjectInfo( j ); if ( info->IsStartOfGroup() ) { toolbar->AddSeparator(); } if ( NULL == info->GetComponent() ) { Debug::Print( _( "Missing Component for Class \"%s\" of Package \"%s\"." ), info->GetClassName().c_str(), pkg->GetPackageName().c_str() ); } else { wxString widget( info->GetClassName() ); wxBitmap icon = info->GetIconFile(); #ifdef __WXMAC__ wxBitmapButton* button = new wxBitmapButton( toolbar, nextId++, icon ); button->SetToolTip( widget ); toolbar->AddControl( button ); #else toolbar->AddTool(nextId++, widget, icon, widget); #endif toolbar->Realize(); } j++; } } void wxFbPalette::Create() { wxBoxSizer *top_sizer = new wxBoxSizer( wxVERTICAL ); long nbStyle; wxConfigBase* config = wxConfigBase::Get(); config->Read( wxT( "/palette/notebook_style" ), &nbStyle, wxFNB_NO_X_BUTTON | wxFNB_NO_NAV_BUTTONS | DRAG_OPTION | wxFNB_DROPDOWN_TABS_LIST | wxFNB_VC8 | wxFNB_CUSTOM_DLG ); m_notebook = new wxFlatNotebook( this, -1, wxDefaultPosition, wxDefaultSize, FNB_STYLE_OVERRIDES( nbStyle ) ); m_notebook->SetCustomizeOptions( wxFNB_CUSTOM_TAB_LOOK | wxFNB_CUSTOM_ORIENTATION | wxFNB_CUSTOM_LOCAL_DRAG ); unsigned int pkg_count = AppData()->GetPackageCount(); Debug::Print( wxT( "[Palette] Pages %d" ), pkg_count ); // Populate icon vector for ( unsigned int j = 0; j < pkg_count;j++ ) { PObjectPackage pkg = AppData()->GetPackage( j ); m_icons.Add( pkg->GetPackageIcon() ); } // Add icons to notebook m_notebook->SetImageList( &m_icons ); for ( unsigned int i = 0; i < pkg_count;i++ ) { PObjectPackage pkg = AppData()->GetPackage( i ); wxString pkg_name = pkg->GetPackageName(); wxPanel *panel = new wxPanel( m_notebook, -1 ); panel->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_3DFACE ) ); wxBoxSizer *sizer = new wxBoxSizer( wxHORIZONTAL ); wxPanel *tbPanel = new wxPanel( panel, -1 ); tbPanel->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_3DFACE ) ); wxBoxSizer *tbSizer = new wxBoxSizer( wxHORIZONTAL ); wxPanel *sbPanel = new wxPanel( panel, -1 ); sbPanel->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_3DFACE ) ); wxBoxSizer *sbSizer = new wxBoxSizer( wxHORIZONTAL ); wxToolBar *toolbar = new wxToolBar( tbPanel, -1, wxDefaultPosition, wxDefaultSize, wxTB_NODIVIDER | wxTB_FLAT ); toolbar->SetToolBitmapSize( wxSize( 22, 22 ) ); toolbar->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_3DFACE ) ); PopulateToolbar( pkg, toolbar ); m_tv.push_back( toolbar ); tbSizer->Add( toolbar, 1, wxEXPAND | wxALIGN_CENTER_VERTICAL ); tbPanel->SetSizer( tbSizer ); wxSpinButton *sb = new wxSpinButton( sbPanel, -1, wxDefaultPosition, wxDefaultSize, wxSP_HORIZONTAL ); sb->SetRange( 0, ( int )pkg->GetObjectCount() - 1 ); sb->SetValue( 0 ); m_posVector.push_back( 0 ); sbSizer->Add( sb, 0, wxEXPAND );//wxALL | wxALIGN_TOP, 0); sbPanel->SetSizer( sbSizer ); sizer->Add( tbPanel, 1, wxEXPAND, 0 ); sizer->Add( sbPanel, 0, wxEXPAND, 0 ); panel->SetAutoLayout( true ); panel->SetSizer( sizer ); sizer->Fit( panel ); sizer->SetSizeHints( panel ); m_notebook->AddPage( panel, pkg_name, false, i ); } //Title *title = new Title( this, wxT("Component Palette") ); //top_sizer->Add(title,0,wxEXPAND,0); top_sizer->Add( m_notebook, 1, wxEXPAND, 0 ); SetAutoLayout( true ); SetSizer( top_sizer ); top_sizer->Fit( this ); top_sizer->SetSizeHints( this ); } void wxFbPalette::OnSpinUp( wxSpinEvent& ) { int page = m_notebook->GetSelection(); PObjectPackage pkg = AppData()->GetPackage( page ); if (( int )pkg->GetObjectCount() - m_posVector[page] - 1 <= 0 ) return; m_posVector[page]++; wxToolBar *toolbar = m_tv[page]; toolbar->DeleteToolByPos( 0 ); toolbar->Realize(); } void wxFbPalette::OnSpinDown( wxSpinEvent& ) { int page = m_notebook->GetSelection(); if ( m_posVector[page] <= 0 ) return; m_posVector[page]--; wxToolBar *toolbar = m_tv[page]; PObjectPackage pkg = AppData()->GetPackage( page ); wxString widget( pkg->GetObjectInfo( m_posVector[page] )->GetClassName() ); wxBitmap icon = pkg->GetObjectInfo( m_posVector[page] )->GetIconFile(); #ifdef __WXMAC__ wxBitmapButton* button = new wxBitmapButton( toolbar, nextId++, icon ); button->SetToolTip( widget ); toolbar->InsertControl( 0, button ); #else toolbar->InsertTool( 0, nextId++, icon, wxNullBitmap, false, NULL, widget, widget ); #endif toolbar->Realize(); } void wxFbPalette::OnButtonClick( wxCommandEvent &event ) { #ifdef __WXMAC__ wxWindow* win = dynamic_cast< wxWindow* >( event.GetEventObject() ); if ( win != 0 ) { AppData()->CreateObject( win->GetToolTip()->GetTip() ); } #else for ( unsigned int i = 0; i < m_tv.size(); i++ ) { if ( m_tv[i]->FindById( event.GetId() ) ) { wxString name = m_tv[i]->GetToolShortHelp( event.GetId() ); AppData()->CreateObject( name ); return; } } #endif } wxFbPalette::~wxFbPalette() { wxConfigBase* config = wxConfigBase::Get(); wxString pages; for ( size_t i = 0; i < ( size_t )m_notebook->GetPageCount(); ++i ) { pages << m_notebook->GetPageText( i ) << wxT( "," ); } config->Write( wxT( "/palette/pageOrder" ), pages ); config->Write( wxT( "/palette/notebook_style" ), m_notebook->GetWindowStyleFlag() ); } wxformbuilder-3.1.59/src/rad/palette.h0000644000175000017500000000517011143440026020116 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #ifndef __PALETTE__ #define __PALETTE__ #include #include #include #include #include #include typedef std::vector ToolbarVector; class wxFbPalette : public wxPanel { private: ToolbarVector m_tv; wxFlatNotebook *m_notebook; static wxWindowID nextId; std::vector m_posVector; wxFlatNotebookImageList m_icons; void PopulateToolbar(PObjectPackage pkg, wxToolBar *toolbar); DECLARE_EVENT_TABLE() public: wxFbPalette(wxWindow *parent,int id); ~wxFbPalette(); /** * Crea la paleta, previamente se ha debido configurar el objeto * DataObservable. */ void Create(); void OnSpinUp(wxSpinEvent& e); void OnSpinDown(wxSpinEvent& e); void OnButtonClick(wxCommandEvent &event); }; /* class PaletteButton : public wxBitmapButton { private: wxString m_name; DECLARE_EVENT_TABLE() public: PaletteButton(wxWindow *parent, const wxBitmap &bitmap, wxString &name); void OnButtonClick(wxCommandEvent &event); }; */ /* class ToolPanel : public wxPanel, public DataObserver { protected: DECLARE_EVENT_TABLE() public: ToolPanel(wxWindow *parent, int id); void OnSaveFile(wxCommandEvent &event); }; */ /* class PaletteButtonEventHandler : public wxEvtHandler { private: wxString m_name; DECLARE_EVENT_TABLE() DataObservable *m_data; public: PaletteButtonEventHandler(wxString name, DataObservable *data); void OnButtonClick(wxCommandEvent &event); }; */ #endif //__PALETTE__ wxformbuilder-3.1.59/src/rad/title.cpp0000644000175000017500000000421311143440026020131 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #include "title.h" Title::Title(wxWindow *parent,const wxString &title) : wxPanel(parent,-1) { wxBoxSizer* sizer = new wxBoxSizer( wxVERTICAL ); wxStaticText *text = new wxStaticText(this,-1,title);//,wxDefaultPosition,wxDefaultSize,wxSIMPLE_BORDER); SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_ACTIVECAPTION ) ); text->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_ACTIVECAPTION ) ); text->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_CAPTIONTEXT ) ); text->SetFont(wxFont(8, wxSWISS, wxNORMAL, wxBOLD, 0, wxT(""))); sizer->Add(text,0,wxALL | wxEXPAND,2); SetSizer(sizer); Fit(); } wxWindow * Title::CreateTitle (wxWindow *inner, const wxString &title) { wxWindow *parent = inner->GetParent(); wxPanel *container = new wxPanel(parent, -1); Title *titleWin = new Title(container,title); inner->Reparent(container); wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL); sizer->Add(titleWin,0,wxEXPAND); sizer->Add(inner,1,wxEXPAND); container->SetSizer(sizer); return container; } wxformbuilder-3.1.59/src/model/types.h0000644000175000017500000001244511143440026020161 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #ifndef __TYPES__ #define __TYPES__ #include #include #include #include #include "wx/wx.h" class ObjectType; typedef boost::shared_ptr PObjectType; typedef boost::weak_ptr WPObjectType; /** * Representa el tipo de objeto. * * Los tipos de objetos son necesarios para controlar las restricciones de * ubicación de los objetos dentro del árbol. Dichas restricciones vendrán * establecidas en el fichero objtypes.xml, y en principio se pueden definir * tantos tipos de objetos como sean necesarios. * * Aunque el conjunto de tipos está pensado para que sea fácilmente modificable, * actualmente, en el código hay muchas dependencias con los nombres de tipos * concretos. Así que una modificación en el nombre de un tipo casi con toda * seguridad causará fallos en el funcionamiento de la aplicación. * * @todo hay que eliminar las dependencias en el código con los nombres de los * tipos. Para ello lo mejor será definir una serie de atributos asociados * al tipo. * Por ejemplo, los objetos que sean "items" (objetos ficticios * que añaden ciertas propiedades al objeto que contiene como puede ser * un sizeritem), no deben aparecer en el "object tree" y deben mostrar * las propiedades junto con las del objeto que contiene en el "object * inspector". En ese caso, tanto el "object tree" como el * "object inspector" consultarán al tipo si éste tiene el * atributo item a true. */ class ObjectType { public: ObjectType(wxString name, int id, bool hidden = false, bool item = false); int GetId() { return m_id; } wxString GetName() { return m_name; } //bool IsHidden() { return m_hidden; } bool IsItem() { return m_item; } /** * Añade el tipo de objeto a la lista de posibles hijos. */ void AddChildType(PObjectType type, int max = -1); /** * Busca si el tipo pasado como parámetros está entre sus posibles * hijos. * @return numero máximo de ocurrencias del objeto como hijo. * -1 = numero ilimitado, 0 = ninguna */ int FindChildType(int type_id); int FindChildType(PObjectType type); unsigned int GetChildTypeCount(); PObjectType GetChildType(unsigned int idx); private: /** * Registro con los tipos de los hijos posibles y el número máximo * de estos. * @note vamos a usar smart-pointers de tipo "weak" ya que puede haber muchas * referencias cruzadas. */ typedef std::map ChildTypeMap; int m_id; /**< identificador numérico del tipo de objeto */ wxString m_name; /**< cadena de texto asociado al tipo */ bool m_hidden; /**< indica si está oculto en el ObjectTree */ bool m_item; /**< indica si es un "item". Los objetos contenidos en * en un item, muestran las propiedades de éste junto * con las propias del objeto. */ ChildTypeMap m_childTypes; /**< registro de posibles hijos */ }; /** * Tipos de propiedades. */ typedef enum { PT_ERROR, PT_BOOL, PT_TEXT, PT_INT, PT_UINT, PT_BITLIST, PT_INTLIST, PT_UINTLIST, PT_OPTION, PT_MACRO, PT_WXSTRING, PT_WXPOINT, PT_WXSIZE, PT_WXFONT, PT_WXCOLOUR, PT_PATH, PT_BITMAP, PT_STRINGLIST, PT_FLOAT, PT_WXSTRING_I18N, PT_PARENT } PropertyType; /* typedef enum { W_NO_WIDGET, W_GENERIC, // para el caso de que nuestro widget no esté incluido W_BUTTON, W_COMBO_BOX, W_TEXT_CTRL, W_STATIC_TEXT, W_PANEL, W_BOX_SIZER, W_GRID_SIZER, W_FLEX_GRID_SIZER, W_CHECK_BOX, W_SPACER, W_SIZERITEM, W_GRID, W_STATIC_BITMAP //W_PLUGIN } WidgetType; */ /** * Lista de enteros. */ class IntList { private: typedef std::vector IntVector; IntVector m_ints; bool m_abs; public: IntList( bool absolute_value = false ) : m_abs( absolute_value ) { } IntList(wxString value, bool absolute_value = false ); unsigned int GetSize() { return (unsigned int)m_ints.size(); }; int GetValue(unsigned int idx) { return m_ints[idx]; }; void Add(int value); void DeleteList(); void SetList(wxString str); wxString ToString(); }; #endif // __TYPES__ wxformbuilder-3.1.59/src/model/types.cpp0000644000175000017500000000637211143440026020516 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #include "model/types.h" #include #include "utils/stringutils.h" #include "utils/debug.h" #include "utils/typeconv.h" #include ObjectType::ObjectType(wxString name, int id, bool hidden, bool item) { m_id = id; m_name = name; m_hidden = hidden; m_item = item; } void ObjectType::AddChildType(PObjectType type, int max) { assert(max != 0); m_childTypes.insert(ChildTypeMap::value_type(type,max)); } int ObjectType::FindChildType(int type_id) { int max = 0; ChildTypeMap::iterator it; for (it = m_childTypes.begin(); it != m_childTypes.end() && max == 0; it++) { PObjectType type(it->first); if (type && type_id == type->GetId()) max = it->second; } return max; } int ObjectType::FindChildType(PObjectType type) { int type_id = type->GetId(); return FindChildType(type_id); } unsigned int ObjectType::GetChildTypeCount() { return (unsigned int)m_childTypes.size(); } PObjectType ObjectType::GetChildType(unsigned int idx) { PObjectType result; assert (idx < GetChildTypeCount()); unsigned int i = 0; ChildTypeMap::iterator it = m_childTypes.begin(); while (i < idx && it != m_childTypes.end()) { i++; it++; } if (i == idx) result = PObjectType(it->first); return result; } /////////////////////////////////////////////////////////////////////////////// IntList::IntList(wxString value, bool absolute_value ) : m_abs( absolute_value ) { SetList(value); } void IntList::Add(int value) { m_ints.push_back( m_abs ? std::abs(value) : value ); } void IntList::DeleteList() { m_ints.erase(m_ints.begin(), m_ints.end()); } void IntList::SetList(wxString str) { DeleteList(); wxStringTokenizer tkz(str, wxT(",")); while (tkz.HasMoreTokens()) { long value; wxString token; token = tkz.GetNextToken(); token.Trim(true); token.Trim(false); if (token.ToLong(&value)) Add((int)value); } } wxString IntList::ToString() { wxString result; if (m_ints.size() > 0) { result = StringUtils::IntToStr(m_ints[0]); for (unsigned int i=1; i< m_ints.size() ; i++) result = result + wxT(",") + StringUtils::IntToStr(m_ints[i]); } return result; } wxformbuilder-3.1.59/src/model/objectbase.cpp0000644000175000017500000005132711143440026021453 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #include "objectbase.h" #include "wx/wx.h" #include "utils/debug.h" #include "utils/typeconv.h" #include "utils/stringutils.h" #include "rad/appdata.h" #include #include PropertyInfo::PropertyInfo(wxString name, PropertyType type, wxString def_value, wxString description, wxString customEditor, POptionList opt_list, const std::list< PropertyChild >& children ) { m_name = name; m_type = type; m_def_value = def_value; m_opt_list = opt_list; m_description = description; m_children = children; m_customEditor = customEditor; } PropertyInfo::~PropertyInfo() { } EventInfo::EventInfo(const wxString &name, const wxString &eventClass, const wxString &defValue, const wxString &description) : m_name(name), m_eventClass(eventClass), m_defaultValue(defValue), m_description(description) { } bool Property::IsDefaultValue() { return (m_info->GetDefaultValue() == m_value); } bool Property::IsNull() { switch ( m_info->GetType() ) { case PT_BITMAP: { wxString path; size_t semicolonIndex = m_value.find_first_of( wxT(";") ); if ( semicolonIndex != m_value.npos ) { path = m_value.substr( 0, semicolonIndex ); } else { path = m_value; } return path.empty(); } case PT_WXSIZE: { return ( wxDefaultSize == TypeConv::StringToSize( m_value ) ); } default: { return m_value.empty(); } } } void Property::SetDefaultValue() { m_value = m_info->GetDefaultValue(); } void Property::SetValue(const wxFontContainer &font) { m_value = TypeConv::FontToString( font ); } void Property::SetValue(const wxColour &colour) { m_value = TypeConv::ColourToString( colour ); } void Property::SetValue(const wxString &str, bool format) { m_value = (format ? TypeConv::TextToString(str) : str ); } void Property::SetValue(const wxPoint &point) { m_value = TypeConv::PointToString(point); } void Property::SetValue(const wxSize &size) { m_value = TypeConv::SizeToString(size); } void Property::SetValue(const int integer) { m_value = StringUtils::IntToStr(integer); } void Property::SetValue(const double val ) { m_value = TypeConv::FloatToString( val ); } wxFontContainer Property::GetValueAsFont() { return TypeConv::StringToFont( m_value ); } wxColour Property::GetValueAsColour() { return TypeConv::StringToColour(m_value); } wxPoint Property::GetValueAsPoint() { return TypeConv::StringToPoint(m_value); } wxSize Property::GetValueAsSize() { return TypeConv::StringToSize(m_value); } wxBitmap Property::GetValueAsBitmap() { return TypeConv::StringToBitmap( m_value ); } int Property::GetValueAsInteger() { int result = 0; switch (GetType()) { case PT_OPTION: case PT_MACRO: result = TypeConv::GetMacroValue(m_value); break; case PT_BITLIST: result = TypeConv::BitlistToInt(m_value); break; default: result = TypeConv::StringToInt(m_value); break; } return result; } wxString Property::GetValueAsString() { return m_value; } wxString Property::GetValueAsText() { return TypeConv::StringToText(m_value); } wxArrayString Property::GetValueAsArrayString() { return TypeConv::StringToArrayString(m_value); } double Property::GetValueAsFloat() { return TypeConv::StringToFloat(m_value); } void Property::SplitParentProperty( std::map< wxString, wxString >* children ) { children->clear(); if ( m_info->GetType() != PT_PARENT ) { return; } std::list< PropertyChild >* myChildren = m_info->GetChildren(); std::list< PropertyChild >::iterator it = myChildren->begin(); wxStringTokenizer tkz( m_value, wxT(";"), wxTOKEN_RET_EMPTY_ALL ); while ( tkz.HasMoreTokens() ) { if ( myChildren->end() == it ) { return; } wxString child = tkz.GetNextToken(); child.Trim( false ); child.Trim( true ); children->insert( std::map< wxString, wxString >::value_type( it->m_name, child ) ); it++; } } wxString Property::GetChildFromParent( const wxString& childName ) { std::map< wxString, wxString > children; SplitParentProperty( &children ); std::map< wxString, wxString >::iterator child; child = children.find( childName ); if ( children.end() == child ) { return wxEmptyString; } else { return child->second; } } /////////////////////////////////////////////////////////////////////////////// const int ObjectBase::INDENT = 2; ObjectBase::ObjectBase (wxString class_name) : m_expanded( true ) { m_class = class_name; Debug::Print(wxT("new ObjectBase")); } ObjectBase::~ObjectBase() { // remove the reference in the parent PObjectBase parent = m_parent.lock(); if (parent) { PObjectBase pobj(GetThis()); parent->RemoveChild(pobj); } Debug::Print(wxT("delete ObjectBase")); } wxString ObjectBase::GetIndentString(int indent) { int i; wxString s; for (i=0;isecond; //Debug::Print(wxT("[ObjectBase::GetProperty] Property %s not found!"),name.c_str()); // este aserto falla siempre que se crea un sizeritem // assert(false); return PProperty(); } PProperty ObjectBase::GetProperty (unsigned int idx) { assert (idx < m_properties.size()); PropertyMap::iterator it = m_properties.begin(); unsigned int i = 0; while (i < idx && it != m_properties.end()) { i++; it++; } if (it != m_properties.end()) return it->second; return PProperty(); } PEvent ObjectBase::GetEvent (wxString name) { EventMap::iterator it = m_events.find( name ); if ( it != m_events.end() ) return it->second; Debug::Print(wxT("[ObjectBase::GetEvent] Event %s not found!"),name.c_str()); return PEvent(); } PEvent ObjectBase::GetEvent (unsigned int idx) { assert (idx < m_events.size()); EventMap::iterator it = m_events.begin(); unsigned int i = 0; while (i < idx && it != m_events.end()) { i++; it++; } if (it != m_events.end()) return it->second; return PEvent(); } void ObjectBase::AddProperty (PProperty prop) { m_properties.insert( PropertyMap::value_type( prop->GetName(), prop ) ); } void ObjectBase::AddEvent(PEvent event) { m_events.insert( EventMap::value_type( event->GetName(), event ) ); } PObjectBase ObjectBase::FindNearAncestor(wxString type) { PObjectBase result; PObjectBase parent = GetParent(); if (parent) { if (parent->GetObjectTypeName() == type) result = parent; else result = parent->FindNearAncestor(type); } return result; } PObjectBase ObjectBase::FindNearAncestorByBaseClass(wxString type) { PObjectBase result; PObjectBase parent = GetParent(); if (parent) { if ( parent->GetObjectInfo()->IsSubclassOf( type ) ) result = parent; else result = parent->FindNearAncestorByBaseClass( type ); } return result; } bool ObjectBase::AddChild (PObjectBase obj) { bool result = false; if (ChildTypeOk(obj->GetObjectInfo()->GetObjectType())) //if (ChildTypeOk(obj->GetObjectTypeName())) { m_children.push_back(obj); result = true; } return result; } bool ObjectBase::AddChild (unsigned int idx, PObjectBase obj) { bool result = false; if (ChildTypeOk(obj->GetObjectInfo()->GetObjectType()) && idx <= m_children.size()) //if (ChildTypeOk(obj->GetObjectTypeName()) && idx <= m_children.size()) { m_children.insert(m_children.begin() + idx,obj); result = true; } return result; } bool ObjectBase::ChildTypeOk (PObjectType type) { // buscamos si puede haber objectos del tipo "type" como hijos // del actual objeto tipo. int nmax = GetObjectInfo()->GetObjectType()->FindChildType(type); if (nmax == 0) return false; if (nmax < 0) return true; // llegados aquí hay que comprobar el número de hijos del tipo pasado int count = 0; for (unsigned int i=0; i < GetChildCount() && count <= nmax; i++) { if (GetChild(i)->GetObjectInfo()->GetObjectType() == type) count++; } if (count > nmax) return false; return true; } PObjectBase ObjectBase::GetLayout() { PObjectBase result; if (GetParent() && GetParent()->GetObjectInfo()->IsSubclassOf( wxT("sizeritembase") )) result = GetParent(); return result; } void ObjectBase::RemoveChild (PObjectBase obj) { std::vector< PObjectBase >::iterator it = m_children.begin(); while (it != m_children.end() && *it != obj) it++; if (it != m_children.end()) m_children.erase(it); } void ObjectBase::RemoveChild (unsigned int idx) { assert (idx < m_children.size()); std::vector< PObjectBase >::iterator it = m_children.begin() + idx; m_children.erase(it); } PObjectBase ObjectBase::GetChild (unsigned int idx) { assert (idx < m_children.size()); return m_children[idx]; } int ObjectBase::Deep() { int deep = 0; PObjectBase obj(GetParent()); while (obj) { obj = obj->GetParent(); deep++; if (deep > 1000) assert(false); } return deep; } //void ObjectBase::PrintOut(ostream &s, int indent) //{ // wxString ind_str = GetIndentString(indent); // // s << ind_str << "[ " << GetClassName() << " ] " << GetObjectType() << endl; // map< wxString, PProperty >::const_iterator it_prop; // for (it_prop = m_properties.begin(); it_prop!= m_properties.end(); it_prop++) // { // s << ind_str << "property '" << it_prop->first << "' = '" << // it_prop->second->GetValue() << "'" << endl; // } // // vector< PObjectBase >::const_iterator it_ch; // for (it_ch = m_children.begin() ; it_ch != m_children.end(); it_ch++) // { // (*it_ch)->PrintOut(s,INDENT + indent); // } //} // //ostream& operator << (ostream &s, PObjectBase obj) //{ // obj->PrintOut(s,0); // return s; //} void ObjectBase::SerializeObject( ticpp::Element* serializedElement ) { ticpp::Element element( "object" ); element.SetAttribute( "class", _STDSTR( GetClassName() ) ); element.SetAttribute( "expanded", GetExpanded() ); for ( unsigned int i = 0; i < GetPropertyCount(); i++ ) { PProperty prop = GetProperty( i ); ticpp::Element prop_element( "property" ); prop_element.SetAttribute( "name", _STDSTR( prop->GetName() ) ); prop_element.SetText( _STDSTR( prop->GetValue() ) ); element.LinkEndChild( &prop_element ); } for ( unsigned int i = 0; i < GetEventCount(); i++ ) { PEvent event = GetEvent( i ); ticpp::Element event_element( "event" ); event_element.SetAttribute( "name", _STDSTR( event->GetName() ) ); event_element.SetText( _STDSTR( event->GetValue() ) ); element.LinkEndChild( &event_element ); } for ( unsigned int i = 0 ; i < GetChildCount(); i++ ) { PObjectBase child = GetChild( i ); ticpp::Element child_element; child->SerializeObject( &child_element ); element.LinkEndChild( &child_element ); } *serializedElement = element; } void ObjectBase::Serialize( ticpp::Document* serializedDocument ) { ticpp::Document document( "document" ); #if wxUSE_UNICODE ticpp::Declaration dec( "1.0", "UTF-8", "yes" ); #else ticpp::Declaration dec( "1.0", "ISO-8859-13", "yes" ); #endif document.LinkEndChild( &dec ); ticpp::Element root( "wxFormBuilder_Project" ); ticpp::Element fileVersion( "FileVersion" ); fileVersion.SetAttribute( "major", AppData()->m_fbpVerMajor ); fileVersion.SetAttribute( "minor", AppData()->m_fbpVerMinor ); root.LinkEndChild( &fileVersion ); ticpp::Element element; SerializeObject( &element ); root.LinkEndChild( &element ); document.LinkEndChild( &root ); *serializedDocument = document; } unsigned int ObjectBase::GetChildPosition(PObjectBase obj) { unsigned int pos = 0; while (pos < GetChildCount() && m_children[pos] != obj) pos++; return pos; } bool ObjectBase::ChangeChildPosition( PObjectBase obj, unsigned int pos) { unsigned int obj_pos = GetChildPosition(obj); if (obj_pos == GetChildCount() || pos >= GetChildCount()) return false; if (pos == obj_pos) return true; // Procesamos el cambio de posición RemoveChild(obj); AddChild(pos,obj); return true; } /////////////////////////////////////////////////////////////////////////////// bool ObjectBase::IsNull (const wxString& pname) { PProperty property = GetProperty( pname ); if (property) return property->IsNull(); else return true; } int ObjectBase::GetPropertyAsInteger (const wxString& pname) { PProperty property = GetProperty( pname ); if (property) return property->GetValueAsInteger(); else return 0; } wxFontContainer ObjectBase::GetPropertyAsFont(const wxString& pname) { PProperty property = GetProperty( pname ); if (property) return property->GetValueAsFont(); else return wxFontContainer(); } wxColour ObjectBase::GetPropertyAsColour (const wxString& pname) { PProperty property = GetProperty( pname ); if (property) return property->GetValueAsColour(); else return wxColour(); } wxString ObjectBase::GetPropertyAsString (const wxString& pname) { PProperty property = GetProperty( pname ); if (property) return property->GetValueAsString(); else return wxString(); } wxPoint ObjectBase::GetPropertyAsPoint (const wxString& pname) { PProperty property = GetProperty( pname ); if (property) return property->GetValueAsPoint(); else return wxPoint(); } wxSize ObjectBase::GetPropertyAsSize (const wxString& pname) { PProperty property = GetProperty( pname ); if (property) return property->GetValueAsSize(); else return wxDefaultSize; } wxBitmap ObjectBase::GetPropertyAsBitmap (const wxString& pname) { PProperty property = GetProperty( pname ); if (property) return property->GetValueAsBitmap(); else return wxBitmap(); } double ObjectBase::GetPropertyAsFloat( const wxString& pname ) { PProperty property = GetProperty( pname ); if (property) return property->GetValueAsFloat(); else return 0; } wxArrayInt ObjectBase::GetPropertyAsArrayInt(const wxString& pname) { wxArrayInt array; PProperty property = GetProperty( pname ); if (property) { IntList il( property->GetValue(), property->GetType() == PT_UINTLIST ); for (unsigned int i=0; i < il.GetSize() ; i++) array.Add(il.GetValue(i)); } return array; } wxArrayString ObjectBase::GetPropertyAsArrayString(const wxString& pname) { PProperty property = GetProperty( pname ); if (property) return property->GetValueAsArrayString(); else return wxArrayString(); } wxString ObjectBase::GetChildFromParentProperty( const wxString& parentName, const wxString& childName ) { PProperty property = GetProperty( parentName ); if (property) return property->GetChildFromParent( childName ); else return wxEmptyString; } /////////////////////////////////////////////////////////////////////////////// ObjectInfo::ObjectInfo(wxString class_name, PObjectType type, WPObjectPackage package, bool startGroup ) { m_class = class_name; m_type = type; m_numIns = 0; m_component = NULL; m_package = package; m_category = PPropertyCategory( new PropertyCategory( m_class ) ); m_startGroup = startGroup; } PObjectPackage ObjectInfo::GetPackage() { return m_package.lock(); } PPropertyInfo ObjectInfo::GetPropertyInfo(wxString name) { PPropertyInfo result; std::map< wxString, PPropertyInfo >::iterator it = m_properties.find(name); if (it != m_properties.end()) result = it->second; return result; } PPropertyInfo ObjectInfo::GetPropertyInfo(unsigned int idx) { PPropertyInfo result; assert (idx < m_properties.size()); std::map< wxString, PPropertyInfo >::iterator it = m_properties.begin(); unsigned int i = 0; while (i < idx && it != m_properties.end()) { i++; it++; } if (it != m_properties.end()) result = it->second; return result; } PEventInfo ObjectInfo::GetEventInfo(wxString name) { PEventInfo result; EventInfoMap::iterator it = m_events.find(name); if (it != m_events.end()) result = it->second; return result; } PEventInfo ObjectInfo::GetEventInfo(unsigned int idx) { PEventInfo result; assert (idx < m_events.size()); EventInfoMap::iterator it = m_events.begin(); unsigned int i = 0; while (i < idx && it != m_events.end()) { i++; it++; } if (it != m_events.end()) result = it->second; return result; } void ObjectInfo::AddPropertyInfo( PPropertyInfo prop ) { m_properties.insert( PropertyInfoMap::value_type(prop->GetName(), prop) ); } void ObjectInfo::AddEventInfo(PEventInfo evtInfo) { m_events.insert( EventInfoMap::value_type(evtInfo->GetName(), evtInfo) ); } void ObjectInfo::AddBaseClassDefaultPropertyValue( size_t baseIndex, const wxString& propertyName, const wxString& defaultValue ) { std::map< size_t, std::map< wxString, wxString > >::iterator baseClassMap = m_baseClassDefaultPropertyValues.find( baseIndex ); if ( baseClassMap != m_baseClassDefaultPropertyValues.end() ) { baseClassMap->second.insert( std::map< wxString, wxString >::value_type( propertyName, defaultValue ) ); } else { std::map< wxString, wxString > propertyDefaultValues; propertyDefaultValues[ propertyName ] = defaultValue; m_baseClassDefaultPropertyValues[ baseIndex ] = propertyDefaultValues; } } wxString ObjectInfo::GetBaseClassDefaultPropertyValue( size_t baseIndex, const wxString& propertyName ) { std::map< size_t, std::map< wxString, wxString > >::iterator baseClassMap = m_baseClassDefaultPropertyValues.find( baseIndex ); if ( baseClassMap != m_baseClassDefaultPropertyValues.end() ) { std::map< wxString, wxString >::iterator defaultValue = baseClassMap->second.find( propertyName ); if ( defaultValue != baseClassMap->second.end() ) { return defaultValue->second; } } return wxString(); } PObjectInfo ObjectInfo::GetBaseClass(unsigned int idx) { assert (idx < m_base.size()); return m_base[idx]; } unsigned int ObjectInfo::GetBaseClassCount() { return (unsigned int)m_base.size(); } bool ObjectInfo::IsSubclassOf(wxString classname) { bool found = false; if (GetClassName() == classname) found = true; else for (unsigned int i=0; !found && i < GetBaseClassCount() ; i++) { PObjectInfo base = GetBaseClass(i); found = base->IsSubclassOf(classname); } return found; } // //void ObjectInfo::PrintOut(ostream &s, int indent) //{ // wxString ind_str = ""; // for (int i=0;i::const_iterator it_prop; // for (it_prop = m_properties.begin(); it_prop!= m_properties.end(); it_prop++) // { // s << ind_str << "property '" << it_prop->first << "' type = '" << // it_prop->second->GetType() << "' with value = '" << // it_prop->second->GetDefaultValue() << "' by default" << endl; // } //} void ObjectInfo::AddCodeInfo(wxString lang, PCodeInfo codeinfo) { std::map< wxString, PCodeInfo >::iterator templates = m_codeTemp.find( lang ); if ( templates == m_codeTemp.end() ) { // First code info is a clean copy m_codeTemp[ lang ] = PCodeInfo( new CodeInfo( *codeinfo ) ); } else { // If code info already existed for the language, merge code info templates->second->Merge( codeinfo ); } } PCodeInfo ObjectInfo::GetCodeInfo(wxString lang) { PCodeInfo result; std::map< wxString, PCodeInfo >::iterator it = m_codeTemp.find(lang); if (it != m_codeTemp.end()) result = it->second; return result; } //ostream& operator << (ostream &s, PObjectInfo obj) //{ // obj->PrintOut(s,0); // return s; //} /////////////////////////////////////////////////////////////////////////////// wxString CodeInfo::GetTemplate(wxString name) { wxString result; TemplateMap::iterator it = m_templates.find(name); if (it != m_templates.end()) result = it->second; return result; } void CodeInfo::AddTemplate(wxString name, wxString _template) { m_templates.insert(TemplateMap::value_type(name,_template)); } void CodeInfo::Merge( PCodeInfo merger ) { TemplateMap::iterator mergerTemplate; for ( mergerTemplate = merger->m_templates.begin(); mergerTemplate != merger->m_templates.end(); ++mergerTemplate ) { std::pair< TemplateMap::iterator, bool > mine = m_templates.insert( TemplateMap::value_type( mergerTemplate->first, mergerTemplate->second ) ); if ( !mine.second ) { mine.first->second += mergerTemplate->second; } } } wxformbuilder-3.1.59/src/model/xrcfilter.cpp0000644000175000017500000001551611143440026021354 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #include "xrcfilter.h" #include "utils/typeconv.h" #include "utils/debug.h" #include #include #include #include #include "model/objectbase.h" #include PObjectBase XrcLoader::GetProject( ticpp::Document* xrcDoc ) { assert( m_objDb ); Debug::Print( wxT( "[XrcFilter::GetProject]" ) ); PObjectBase project( m_objDb->CreateObject( "Project" ) ); ticpp::Element *root = xrcDoc->FirstChildElement( "resource", false ); if ( !root ) { wxLogError( _( "Missing root element \"resource\"" ) ); return project; } ticpp::Element *element = root->FirstChildElement( "object", false ); while ( element ) { PObjectBase obj = GetObject( element, project ); element = element->NextSiblingElement( "object", false ); } return project; } PObjectBase XrcLoader::GetObject( ticpp::Element *xrcObj, PObjectBase parent ) { // First, create the object by the name, the modify the properties std::string className = xrcObj->GetAttribute( "class" ); if ( parent->GetObjectTypeName() == wxT( "project" ) ) { if ( className == "wxBitmap" ) { PProperty bitmapsProp = parent->GetProperty( _( "bitmaps" ) ); if ( bitmapsProp ) { wxString value = bitmapsProp->GetValue(); wxString text = _WXSTR( xrcObj->GetText() ); text.Replace( wxT( "\'" ), wxT( "\'\'" ), true ); value << wxT( "\'" ) << text << wxT( "\' " ); bitmapsProp->SetValue( value ); return PObjectBase(); } } if ( className == "wxIcon" ) { PProperty iconsProp = parent->GetProperty( _( "icons" ) ); if ( iconsProp ) { wxString value = iconsProp->GetValue(); wxString text = _WXSTR( xrcObj->GetText() ); text.Replace( wxT( "\'" ), wxT( "\'\'" ), true ); value << wxT( "\'" ) << text << wxT( "\' " ); iconsProp->SetValue( value ); return PObjectBase(); } } // Forms wxPanel, wxFrame, wxDialog are stored internally as Panel, Frame, and Dialog // to prevent conflicts with wxPanel as a container className = className.substr( 2, className.size() - 2 ); } // Well, this is not nice. wxMenu class name is ambiguous, so we'll get the // correct class by the context. If the parent of a wxMenu is another wxMenu // then the class name will be "submenu" else if ( className == "wxMenu" && ( parent->GetClassName() == wxT( "wxMenu" ) || parent->GetClassName() == wxT( "submenu" ) ) ) { className = "submenu"; } // "separator" is also ambiguous - could be a toolbar separator or a menu separator else if ( className == "separator" ) { if ( parent->GetClassName() == wxT( "wxToolBar" ) ) { className = "toolSeparator"; } } // replace "spacer" with "sizeritem" so it will be imported as a "sizeritem" // "sizeritem" is ambiguous - could also be a grid bag sizeritem else if ( className == "spacer" || className == "sizeritem" ) { if ( parent->GetClassName() == wxT( "wxGridBagSizer" ) ) { className = "gbsizeritem"; } else { className = "sizeritem"; } } PObjectBase object; PObjectInfo objInfo = m_objDb->GetObjectInfo( _WXSTR( className ) ); if ( objInfo ) { IComponent *comp = objInfo->GetComponent(); if ( !comp ) { wxLogError( _("No component found for class \"%s\", found on line %i."), _WXSTR( className ).c_str(), xrcObj->Row() ); } else { ticpp::Element *fbObj = comp->ImportFromXrc( xrcObj ); if ( !fbObj ) { wxLogError( _("ImportFromXrc returned NULL for class \"%s\", found on line %i."), _WXSTR( className ).c_str(), xrcObj->Row() ); } else { object = m_objDb->CreateObject( fbObj, parent ); if ( !object ) { // Unable to create the object and add it to the parent - probably needs a sizer PObjectBase newsizer = m_objDb->CreateObject( "wxBoxSizer", parent ); if ( newsizer ) { // It is possible the CreateObject returns an "item" containing the object, e.g. SizerItem or SplitterItem // If that is the case, reassign "object" to the actual object PObjectBase sizer = newsizer; if ( sizer->GetChildCount() > 0 ) { sizer = sizer->GetChild( 0 ); } if ( sizer ) { object = m_objDb->CreateObject( fbObj, sizer ); if ( object ) { parent->AddChild( newsizer ); newsizer->SetParent( parent ); } } } } if ( !object ) { wxLogError( wxT( "CreateObject failed for class \"%s\", with parent \"%s\", found on line %i" ), _WXSTR( className ).c_str(), parent->GetClassName().c_str(), xrcObj->Row() ); } else { // It is possible the CreateObject returns an "item" containing the object, e.g. SizerItem or SplitterItem // If that is the case, reassign "object" to the actual object if ( object && object->GetChildCount() > 0 ) object = object->GetChild( 0 ); if ( object ) { // Recursively import the children ticpp::Element *element = xrcObj->FirstChildElement( "object", false ); while ( element ) { GetObject( element, object ); element = element->NextSiblingElement( "object", false ); } } } } } } else { // Create a wxPanel to represent unknown classes object = m_objDb->CreateObject( "wxPanel", parent ); if ( object ) { parent->AddChild( object ); object->SetParent( parent ); wxLogError( wxT( "Unknown class \"%s\" found on line %i, replaced with a wxPanel" ), _WXSTR( className ).c_str(), xrcObj->Row() ); } else { wxString msg( wxString::Format( wxT( "Unknown class \"%s\" found on line %i, and could not replace with a wxPanel as child of \"%s:%s\"" ), _WXSTR( className ).c_str(), xrcObj->Row(), parent->GetPropertyAsString( wxT( "name" ) ).c_str(), parent->GetClassName().c_str() ) ); wxLogError( msg ); } } return object; } wxformbuilder-3.1.59/src/model/database.cpp0000644000175000017500000012353711143440026021121 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #include "objectbase.h" #include "database.h" #include "rad/bitmaps.h" #include "utils/stringutils.h" #include "utils/typeconv.h" #include "utils/debug.h" #include "utils/wxfbexception.h" #include "rad/appdata.h" #include #include #include #include #include #include #include #include //#define DEBUG_PRINT(x) cout << x #define OBJINFO_TAG "objectinfo" #define CODEGEN_TAG "codegen" #define TEMPLATE_TAG "template" #define NAME_TAG "name" #define DESCRIPTION_TAG "help" #define CUSTOM_EDITOR_TAG "editor" #define PROPERTY_TAG "property" #define CHILD_TAG "child" #define EVENT_TAG "event" #define EVENT_CLASS_TAG "class" #define CATEGORY_TAG "category" #define OBJECT_TAG "object" #define CLASS_TAG "class" #define PACKAGE_TAG "package" #define PKGDESC_TAG "desc" #define PRGLANG_TAG "language" #define ICON_TAG "icon" #define SMALL_ICON_TAG "smallIcon" #define EXPANDED_TAG "expanded" #ifdef __WXMAC__ #include #endif ObjectPackage::ObjectPackage(wxString name, wxString desc, wxBitmap icon) { m_name = name; m_desc = desc; m_icon = icon; } PObjectInfo ObjectPackage::GetObjectInfo(unsigned int idx) { assert (idx < m_objs.size()); return m_objs[idx]; } void ObjectPackage::AppendPackage( PObjectPackage package ) { m_objs.insert( m_objs.end(), package->m_objs.begin(), package->m_objs.end() ); } /////////////////////////////////////////////////////////////////////////////// ObjectDatabase::ObjectDatabase() { //InitObjectTypes(); // InitWidgetTypes(); InitPropertyTypes(); } ObjectDatabase::~ObjectDatabase() { for ( ComponentLibraryMap::iterator lib = m_componentLibs.begin(); lib != m_componentLibs.end(); ++lib ) { (*(lib->first))( lib->second ); } for ( LibraryVector::iterator lib = m_libs.begin(); lib != m_libs.end(); ++lib ) { #ifdef __WXFB_DEBUG__ // Only unload in release - can't get a good stack trace if the library is unloaded #ifdef __WXMAC__ dlclose( *lib ); #else (*lib)->Detach(); #endif #endif #ifndef __WXMAC__ delete *lib; #endif } } PObjectInfo ObjectDatabase::GetObjectInfo(wxString class_name) { PObjectInfo info; ObjectInfoMap::iterator it = m_objs.find( class_name ); if ( it != m_objs.end() ) { info = it->second; } return info; } PObjectPackage ObjectDatabase::GetPackage(unsigned int idx) { assert (idx < m_pkgs.size()); return m_pkgs[idx]; } /** * @todo La herencia de propiedades ha de ser de forma recursiva. */ PObjectBase ObjectDatabase::NewObject(PObjectInfo obj_info) { PObjectBase object; // Llagados aquí el objeto se crea seguro... object = PObjectBase(new ObjectBase(obj_info->GetClassName())); object->SetObjectTypeName(obj_info->GetObjectTypeName()); // *FIXME* object->SetObjectInfo(obj_info); PPropertyInfo prop_info; PEventInfo event_info; PObjectInfo class_info = obj_info; unsigned int base = 0; while (class_info) { unsigned int i; for (i = 0; i < class_info->GetPropertyCount(); i++) { prop_info = class_info->GetPropertyInfo(i); PProperty property(new Property(prop_info, object)); // Set the default value, either from the property info, or an override from this class wxString defaultValue = prop_info->GetDefaultValue(); if ( base > 0 ) { wxString defaultValueTemp = obj_info->GetBaseClassDefaultPropertyValue( base - 1, prop_info->GetName() ); if ( !defaultValueTemp.empty() ) { defaultValue = defaultValueTemp; } } property->SetValue( defaultValue ); // Las propiedades están implementadas con una estructura "map", // ello implica que no habrá propiedades duplicadas. // En otro caso habrá que asegurarse de que dicha propiedad // no existe. // Otra cosa importante, es que el orden en que se insertan // las propiedades, de abajo-arriba, esto permite que se pueda redefir // alguna propiedad. object->AddProperty (property); } for (i=0; i < class_info->GetEventCount(); i++) { event_info = class_info->GetEventInfo(i); PEvent event(new Event(event_info,object)); // notice that for event there isn't a default value on its creation // because there is not handler at the moment object->AddEvent(event); } class_info = ( base < obj_info->GetBaseClassCount() ? obj_info->GetBaseClass(base++) : PObjectInfo()); } // si el objeto tiene la propiedad name (reservada para el nombre del // objeto) le añadimos el contador para no repetir nombres. obj_info->IncrementInstanceCount(); unsigned int ins = obj_info->GetInstanceCount(); PProperty pname = object->GetProperty( wxT(NAME_TAG) ); if (pname) pname->SetValue(pname->GetValue() + StringUtils::IntToStr(ins)); return object; } int ObjectDatabase::CountChildrenWithSameType(PObjectBase parent,PObjectType type) { unsigned int count = 0; unsigned int numChildren = parent->GetChildCount(); for (unsigned int i=0; i < numChildren ; i++) { if (type == parent->GetChild(i)->GetObjectInfo()->GetObjectType()) count++; } return count; } /** * Crea una instancia de classname por debajo de parent. * La función realiza la comprobación de tipos para crear el objeto: * - Comprueba si el tipo es un tipo-hijo válido de "parent", en cuyo caso * se comprobará también que el número de hijos del mismo tipo no sobrepase el máximo definido. El objeto no se crea si supera el máximo permitido. * - Si el tipo-hijo no se encuentra entre los definidos para el tipo de * "parent" se intentará crearlo como hijo de alguno de los tipos hijos con el * flag item a "1". Para ello va recorriendo todos los tipos con flag item, * si no puede crear el objeto, bien por que el tipo no es válido o porque * sobrepasa el máximo permitido si intenta con el siguiente hasta que no queden * más. * * Nota: quizá sea conveniente que el método cree el objeto sin enlazarlo * en el árbol, para facilitar el undo-redo. */ PObjectBase ObjectDatabase::CreateObject( std::string classname, PObjectBase parent) { PObjectBase object; PObjectInfo objInfo = GetObjectInfo( _WXSTR(classname) ); if (!objInfo) { THROW_WXFBEX( wxT("Unknown Object Type: ") << _WXSTR(classname) << wxT("\n") wxT("The most likely causes are that this copy of wxFormBuilder is out of date, or that there is a plugin missing.\n") wxT("Please check at http://www.wxFormBuilder.org") << wxT("\n") ) } PObjectType objType = objInfo->GetObjectType(); if (parent) { // Comprobamos si el tipo es válido PObjectType parentType = parent->GetObjectInfo()->GetObjectType(); int max = parentType->FindChildType(objType); // FIXME! Esto es un parche para evitar crear los tipos menubar,statusbar y // toolbar en un form que no sea wxFrame. // Hay que modificar el conjunto de tipos para permitir tener varios tipos // de forms (como childType de project), pero hay mucho código no válido // para forms que no sean de tipo "form". Dicho de otra manera, hay // código que dependen del nombre del tipo, cosa que hay que evitar. if (parentType->GetName() == wxT("form") && parent->GetClassName() != wxT("Frame") && (objType->GetName() == wxT("statusbar") || objType->GetName() == wxT("menubar") || objType->GetName() == wxT("toolbar") )) return PObjectBase(); // tipo no válido if (max != 0) // tipo válido { bool create = true; // comprobamos el número de instancias if (max > 0 && CountChildrenWithSameType(parent, objType) >= max) create = false; if (create) object = NewObject(objInfo); } else // max == 0 { // el tipo no es válido, vamos a comprobar si podemos insertarlo // como hijo de un "item" bool created = false; for (unsigned int i=0; !created && i < parentType->GetChildTypeCount(); i++) { PObjectType childType = parentType->GetChildType(i); int max = childType->FindChildType(objType); if (childType->IsItem() && max != 0) { max = parentType->FindChildType(childType); // si el tipo es un item y además el tipo del objeto a crear // puede ser hijo del tipo del item vamos a intentar crear la // instancia del item para crear el objeto como hijo de este if (max < 0 || CountChildrenWithSameType(parent, childType) < max) { // No hay problemas para crear el item debajo de parent PObjectBase item = NewObject(GetObjectInfo(childType->GetName())); //PObjectBase obj = CreateObject(classname,item); PObjectBase obj = NewObject(objInfo); // la siguiente condición debe cumplirse siempre // ya que un item debe siempre contener a otro objeto if (obj) { // enlazamos item y obj item->AddChild(obj); obj->SetParent(item); // sizeritem es un tipo de objeto reservado, para que el uso sea // más práctico se asignan unos valores por defecto en función // del tipo de objeto creado if ( item->GetObjectInfo()->IsSubclassOf( wxT("sizeritembase") ) ) SetDefaultLayoutProperties(item); object = item; created = true; } else wxLogError(wxT("Review your definitions file (objtypes.xml)")); } } } } /////////////////////////////////////////////////////////////////////// // Nota: provisionalmente vamos a enlazar el objeto al padre pero // esto debería hacerse fuera para poder implementar el Undo-Redo /////////////////////////////////////////////////////////////////////// //if (object) //{ // parent->AddChild(object); // object->SetParent(parent); //} } else // parent == NULL; { object = NewObject(objInfo); } return object; } PObjectBase ObjectDatabase::CopyObject(PObjectBase obj) { assert(obj); PObjectInfo objInfo = obj->GetObjectInfo(); PObjectBase copyObj = NewObject(objInfo); // creamos la copia assert(copyObj); // copiamos las propiedades unsigned int i; unsigned int count = obj->GetPropertyCount(); for (i = 0; i < count; i++) { PProperty objProp = obj->GetProperty(i); assert(objProp); PProperty copyProp = copyObj->GetProperty(objProp->GetName()); assert(copyProp); wxString propValue = objProp->GetValue(); copyProp->SetValue(propValue); } // ...and the event handlers count = obj->GetEventCount(); for (i = 0; i < count; i++) { PEvent event = obj->GetEvent(i); PEvent copyEvent = copyObj->GetEvent(event->GetName()); copyEvent->SetValue(event->GetValue()); } // creamos recursivamente los hijos count = obj->GetChildCount(); for (i = 0; iGetChild(i)); copyObj->AddChild(childCopy); childCopy->SetParent(copyObj); } return copyObj; } void ObjectDatabase::SetDefaultLayoutProperties(PObjectBase sizeritem) { if ( !sizeritem->GetObjectInfo()->IsSubclassOf( wxT("sizeritembase") ) ) { Debug::Print( wxT("SetDefaultLayoutProperties expects a subclass of sizeritembase") ); return; } PObjectBase child = sizeritem->GetChild(0); PObjectInfo childInfo = child->GetObjectInfo(); wxString obj_type = child->GetObjectTypeName(); PProperty proportion = sizeritem->GetProperty( wxT("proportion") ); if ( childInfo->IsSubclassOf( wxT("sizer") ) || obj_type == wxT("splitter") || childInfo->GetClassName() == wxT("spacer") ) { if ( proportion ) { proportion->SetValue( wxT("1") ); } sizeritem->GetProperty( wxT("flag") )->SetValue( wxT("wxEXPAND") ); } else if ( childInfo->GetClassName() == wxT("wxStaticLine") ) { sizeritem->GetProperty( wxT("flag") )->SetValue( wxT("wxEXPAND | wxALL") ); } else if ( childInfo->GetClassName() == wxT("wxToolBar") ) { sizeritem->GetProperty( wxT("flag") )->SetValue( wxT("wxEXPAND") ); } else if ( obj_type == wxT("widget") || obj_type == wxT("statusbar") ) { if ( proportion ) { proportion->SetValue( wxT("0") ); } sizeritem->GetProperty( wxT("flag") )->SetValue( wxT("wxALL") ); } else if ( obj_type == wxT("notebook") || obj_type == wxT("flatnotebook") || obj_type == wxT("listbook") || obj_type == wxT("choicebook") || obj_type == wxT("auinotebook") || obj_type == wxT("treelistctrl") || obj_type == wxT("expanded_widget") || obj_type == wxT("container") ) { if ( proportion ) { proportion->SetValue( wxT("1") ); } sizeritem->GetProperty( wxT("flag") )->SetValue( wxT("wxEXPAND | wxALL") ); } } void ObjectDatabase::ResetObjectCounters() { ObjectInfoMap::iterator it; for (it = m_objs.begin() ; it != m_objs.end() ; it++) { it->second->ResetInstanceCount(); } } /////////////////////////////////////////////////////////////////////// PObjectBase ObjectDatabase::CreateObject( ticpp::Element* xml_obj, PObjectBase parent ) { try { std::string class_name; xml_obj->GetAttribute( CLASS_TAG, &class_name, false ); PObjectBase newobject = CreateObject( class_name, parent ); // It is possible the CreateObject returns an "item" containing the object, e.g. SizerItem or SplitterItem // If that is the case, reassign "object" to the actual object PObjectBase object = newobject; if ( object && object->GetChildCount() > 0 ) { object = object->GetChild( 0 ); } if ( object ) { // Get the state of expansion in the object tree bool expanded; xml_obj->GetAttributeOrDefault( EXPANDED_TAG, &expanded, true ); object->SetExpanded( expanded ); // Load the properties ticpp::Element* xml_prop = xml_obj->FirstChildElement( PROPERTY_TAG, false ); while ( xml_prop ) { std::string prop_name; xml_prop->GetAttribute( NAME_TAG, &prop_name, false ); PProperty prop = object->GetProperty( _WXSTR(prop_name) ); if ( prop ) // does the property exist { // load the value prop->SetValue( _WXSTR( xml_prop->GetText( false ) ) ); } else { std::string value = xml_prop->GetText( false ); if ( !value.empty() ) { wxLogError( wxT("The property named \"%s\" of class \"%s\" is not supported by this version of wxFormBuilder.\n") wxT("If your project file was just converted from an older version, then the conversion was not complete.\n") wxT("Otherwise, this project is from a newer version of wxFormBuilder.\n\n") wxT("The property's value is: %s\n") wxT("If you save this project, YOU WILL LOSE DATA"), _WXSTR(prop_name).c_str(), _WXSTR(class_name).c_str(), _WXSTR(value).c_str() ); } } xml_prop = xml_prop->NextSiblingElement( PROPERTY_TAG, false ); } // load the event handlers ticpp::Element* xml_event = xml_obj->FirstChildElement( EVENT_TAG, false ); while ( xml_event ) { std::string event_name; xml_event->GetAttribute( NAME_TAG, &event_name, false ); PEvent event = object->GetEvent( _WXSTR(event_name) ); if ( event ) { event->SetValue( _WXSTR( xml_event->GetText( false ) ) ); } xml_event = xml_event->NextSiblingElement( EVENT_TAG, false ); } if ( parent ) { // set up parent/child relationship parent->AddChild( newobject ); newobject->SetParent( parent ); } // create the children ticpp::Element* child = xml_obj->FirstChildElement( OBJECT_TAG, false ); while ( child ) { CreateObject( child, object ); child = child->NextSiblingElement( OBJECT_TAG, false ); } } return newobject; } catch( ticpp::Exception& ) { return PObjectBase(); } } ////////////////////////////// bool IncludeInPalette(wxString type) { return true; } void ObjectDatabase::LoadPlugins( PwxFBManager manager ) { // Load some default templates LoadCodeGen( m_xmlPath + wxT("properties.cppcode") ); LoadPackage( m_xmlPath + wxT("default.xml"), m_iconPath ); LoadCodeGen( m_xmlPath + wxT("default.cppcode") ); // Map to temporarily hold plugins. // Used to both set page order and to prevent two plugins with the same name. typedef std::map< wxString, PObjectPackage > PackageMap; PackageMap packages; // Open plugins directory for iteration if ( !wxDir::Exists( m_pluginPath ) ) { return; } wxDir pluginsDir( m_pluginPath ); if ( !pluginsDir.IsOpened() ) { return; } // Iterate through plugin directories and load the package from the xml subdirectory wxString pluginDirName; bool moreDirectories = pluginsDir.GetFirst( &pluginDirName, wxEmptyString, wxDIR_DIRS | wxDIR_HIDDEN ); while ( moreDirectories ) { // Iterate through .xml files in the xml directory wxString nextPluginPath = m_pluginPath + pluginDirName; wxString nextPluginXmlPath = nextPluginPath + wxFILE_SEP_PATH + wxT("xml"); wxString nextPluginIconPath = nextPluginPath + wxFILE_SEP_PATH + wxT("icons"); if ( wxDir::Exists( nextPluginPath ) ) { if ( wxDir::Exists( nextPluginXmlPath ) ) { wxDir pluginXmlDir( nextPluginXmlPath ); if ( pluginXmlDir.IsOpened() ) { std::map< wxString, PObjectPackage > packagesToSetup; wxString packageXmlFile; bool moreXmlFiles = pluginXmlDir.GetFirst( &packageXmlFile, wxT("*.xml"), wxDIR_FILES | wxDIR_HIDDEN ); while ( moreXmlFiles ) { try { wxFileName nextXmlFile( nextPluginXmlPath + wxFILE_SEP_PATH + packageXmlFile ); if ( !nextXmlFile.IsAbsolute() ) { nextXmlFile.MakeAbsolute(); } PObjectPackage package = LoadPackage( nextXmlFile.GetFullPath(), nextPluginIconPath ); if ( package ) { // Load all packages, then setup all packages // this allows multiple packages sharing one library packagesToSetup[ nextXmlFile.GetFullPath() ] = package; } } catch ( wxFBException& ex ) { wxLogError( ex.what() ); } moreXmlFiles = pluginXmlDir.GetNext( &packageXmlFile ); } std::map< wxString, PObjectPackage >::iterator packageIt; for ( packageIt = packagesToSetup.begin(); packageIt != packagesToSetup.end(); ++packageIt ) { // Setup the inheritance for base classes wxFileName fullNextPluginPath( nextPluginPath ); if ( !fullNextPluginPath.IsAbsolute() ) { fullNextPluginPath.MakeAbsolute(); } wxFileName xmlFileName( packageIt->first ); try { SetupPackage( xmlFileName.GetFullPath(), fullNextPluginPath.GetFullPath(), manager ); // Load the C++ code tempates xmlFileName.SetExt( wxT("cppcode") ); LoadCodeGen( xmlFileName.GetFullPath() ); std::pair< PackageMap::iterator, bool > addedPackage = packages.insert( PackageMap::value_type( packageIt->second->GetPackageName(), packageIt->second ) ); if ( !addedPackage.second ) { addedPackage.first->second->AppendPackage( packageIt->second ); Debug::Print( _("Merged plugins named \"%s\""), packageIt->second->GetPackageName().c_str() ); } } catch ( wxFBException& ex ) { wxLogError( ex.what() ); } } } } } moreDirectories = pluginsDir.GetNext( &pluginDirName ); } // Get previous plugin order wxConfigBase* config = wxConfigBase::Get(); wxString pages = config->Read( wxT("/palette/pageOrder"), wxT("Common,Additional,Containers,Menu/Toolbar,Layout,Forms,") ); // Add packages to the vector in the correct order wxStringTokenizer packageList( pages, wxT(",") ); while ( packageList.HasMoreTokens() ) { wxString packageName = packageList.GetNextToken(); PackageMap::iterator packageIt = packages.find( packageName ); if ( packages.end() == packageIt ) { // Plugin missing - move on continue; } m_pkgs.push_back( packageIt->second ); packages.erase( packageIt ); } // If any packages remain in the map, they are new plugins and must still be added for ( PackageMap::iterator packageIt = packages.begin(); packageIt != packages.end(); ++packageIt ) { m_pkgs.push_back( packageIt->second ); } } void ObjectDatabase::SetupPackage( const wxString& file, const wxString& path, PwxFBManager manager ) { #ifdef __WXMSW__ wxString libPath = path; #else wxStandardPathsBase& stdpaths = wxStandardPaths::Get(); wxString libPath = stdpaths.GetPluginsDir(); libPath.Replace( wxTheApp->GetAppName().c_str(), wxT("wxformbuilder") ); #endif try { ticpp::Document doc; XMLUtils::LoadXMLFile( doc, true, file ); ticpp::Element* root = doc.FirstChildElement( PACKAGE_TAG ); // get the library to import std::string lib; root->GetAttributeOrDefault( "lib", &lib, "" ); if ( !lib.empty() ) { // Allows plugin dependency dlls to be next to plugin dll in windows wxString workingDir = ::wxGetCwd(); wxFileName::SetCwd( libPath ); try { wxString fullLibPath = libPath + wxFILE_SEP_PATH + _WXSTR(lib); if ( m_importedLibraries.insert( fullLibPath ).second ) { ImportComponentLibrary( fullLibPath, manager ); } } catch ( ... ) { // Put Cwd back wxFileName::SetCwd( workingDir ); throw; } // Put Cwd back wxFileName::SetCwd( workingDir ); } ticpp::Element* elem_obj = root->FirstChildElement( OBJINFO_TAG, false ); while ( elem_obj ) { std::string class_name; elem_obj->GetAttribute( CLASS_TAG, &class_name ); PObjectInfo class_info = GetObjectInfo( _WXSTR(class_name) ); ticpp::Element* elem_base = elem_obj->FirstChildElement( "inherits", false ); while ( elem_base ) { std::string base_name; elem_base->GetAttribute( CLASS_TAG, &base_name ); // Add a reference to its base class PObjectInfo base_info = GetObjectInfo( _WXSTR(base_name) ); if ( class_info && base_info ) { size_t baseIndex = class_info->AddBaseClass( base_info ); std::string prop_name, value; ticpp::Element* inheritedProperty = elem_base->FirstChildElement( "property", false ); while( inheritedProperty ) { inheritedProperty->GetAttribute( NAME_TAG, &prop_name ); value = inheritedProperty->GetText(); class_info->AddBaseClassDefaultPropertyValue( baseIndex, _WXSTR(prop_name), _WXSTR(value) ); inheritedProperty = inheritedProperty->NextSiblingElement( "property", false ); } } elem_base = elem_base->NextSiblingElement( "inherits", false ); } // Add the "C++" base class, predefined for the components and widgets wxString typeName = class_info->GetObjectTypeName(); if ( HasCppProperties( typeName ) ) { PObjectInfo cpp_interface = GetObjectInfo( wxT("C++") ); if ( cpp_interface ) { size_t baseIndex = class_info->AddBaseClass( cpp_interface ); if ( typeName == wxT("sizer") || typeName == wxT("gbsizer") || typeName == wxT("menuitem") ) { class_info->AddBaseClassDefaultPropertyValue( baseIndex, _("permission"), _("none") ); } } } elem_obj = elem_obj->NextSiblingElement( OBJINFO_TAG, false ); } } catch ( ticpp::Exception& ex ) { THROW_WXFBEX( _WXSTR(ex.m_details) ); } } bool ObjectDatabase::HasCppProperties(wxString type) { return (type == wxT("notebook") || type == wxT("flatnotebook") || type == wxT("listbook") || type == wxT("choicebook") || type == wxT("auinotebook") || type == wxT("widget") || type == wxT("expanded_widget") || type == wxT("statusbar") || type == wxT("component") || type == wxT("container") || type == wxT("menubar") || type == wxT("menu") || type == wxT("menuitem") || type == wxT("submenu") || type == wxT("toolbar") || type == wxT("splitter") || type == wxT("sizer") || type == wxT("treelistctrl") || type == wxT("gbsizer") ); } void ObjectDatabase::LoadCodeGen( const wxString& file ) { try { ticpp::Document doc; XMLUtils::LoadXMLFile( doc, true, file ); // read the codegen element ticpp::Element* elem_codegen = doc.FirstChildElement("codegen"); std::string language; elem_codegen->GetAttribute( "language", &language ); wxString lang = _WXSTR(language); // read the templates ticpp::Element* elem_templates = elem_codegen->FirstChildElement( "templates", false ); while ( elem_templates ) { std::string prop_name; elem_templates->GetAttribute( "property", &prop_name, false ); bool hasProp = !prop_name.empty(); std::string class_name; elem_templates->GetAttribute( "class", &class_name, !hasProp ); PCodeInfo code_info( new CodeInfo() ); ticpp::Element* elem_template = elem_templates->FirstChildElement( "template", false ); while ( elem_template ) { std::string template_name; elem_template->GetAttribute( "name", &template_name ); std::string template_code = elem_template->GetText( false ); code_info->AddTemplate( _WXSTR(template_name), _WXSTR(template_code) ); elem_template = elem_template->NextSiblingElement( "template", false ); } if ( hasProp ) { // store code info for properties if ( !m_propertyTypeTemplates[ ParsePropertyType( _WXSTR(prop_name) ) ].insert( LangTemplateMap::value_type( lang, code_info ) ).second ) { wxLogError( _("Found second template definition for property \"%s\" for language \"%s\""), _WXSTR(prop_name).c_str(), lang.c_str() ); } } else { // store code info for objects PObjectInfo obj_info = GetObjectInfo( _WXSTR(class_name) ); if ( obj_info ) { obj_info->AddCodeInfo( lang, code_info ); } } elem_templates = elem_templates->NextSiblingElement( "templates", false ); } } catch( ticpp::Exception& ex ) { wxLogError( _WXSTR(ex.m_details) ); } catch( wxFBException& ex ) { wxLogError( ex.what() ); } } PObjectPackage ObjectDatabase::LoadPackage( const wxString& file, const wxString& iconPath ) { PObjectPackage package; try { ticpp::Document doc; XMLUtils::LoadXMLFile( doc, true, file ); ticpp::Element* root = doc.FirstChildElement( PACKAGE_TAG ); // Name Attribute std::string pkg_name; root->GetAttribute( NAME_TAG, &pkg_name ); // Description Attribute std::string pkg_desc; root->GetAttributeOrDefault( PKGDESC_TAG, &pkg_desc, "" ); // Icon Path Attribute std::string pkgIconName; root->GetAttributeOrDefault( ICON_TAG, &pkgIconName, "" ); wxString pkgIconPath = iconPath + wxFILE_SEP_PATH + _WXSTR(pkgIconName); wxBitmap pkg_icon; if ( !pkgIconName.empty() && wxFileName::FileExists( pkgIconPath ) ) { wxImage image( pkgIconPath, wxBITMAP_TYPE_ANY ); pkg_icon = wxBitmap( image.Scale( 16, 16 ) ); } else { pkg_icon = AppBitmaps::GetBitmap( wxT("unknown"), 16 ); } package = PObjectPackage ( new ObjectPackage( _WXSTR(pkg_name), _WXSTR(pkg_desc), pkg_icon ) ); ticpp::Element* elem_obj = root->FirstChildElement( OBJINFO_TAG, false ); while (elem_obj) { std::string class_name; elem_obj->GetAttribute( CLASS_TAG, &class_name ); std::string type; elem_obj->GetAttribute( "type", &type ); std::string icon; elem_obj->GetAttributeOrDefault( "icon", &icon, "" ); wxString iconFullPath = iconPath + wxFILE_SEP_PATH + _WXSTR(icon); std::string smallIcon; elem_obj->GetAttributeOrDefault( "smallIcon", &smallIcon, "" ); wxString smallIconFullPath = iconPath + wxFILE_SEP_PATH + _WXSTR(smallIcon); bool startGroup; elem_obj->GetAttributeOrDefault( "startgroup", &startGroup, false ); PObjectInfo obj_info( new ObjectInfo( _WXSTR(class_name), GetObjectType( _WXSTR(type) ), package, startGroup ) ); if ( !icon.empty() && wxFileName::FileExists( iconFullPath ) ) { wxImage img( iconFullPath, wxBITMAP_TYPE_ANY ); obj_info->SetIconFile( wxBitmap( img.Scale( ICON_SIZE, ICON_SIZE ) ) ); } else { obj_info->SetIconFile( AppBitmaps::GetBitmap( wxT("unknown"), ICON_SIZE ) ); } if ( !smallIcon.empty() && wxFileName::FileExists( smallIconFullPath ) ) { wxImage img( smallIconFullPath, wxBITMAP_TYPE_ANY ); obj_info->SetSmallIconFile( wxBitmap( img.Scale( SMALL_ICON_SIZE, SMALL_ICON_SIZE ) ) ); } else { wxImage img = obj_info->GetIconFile().ConvertToImage(); obj_info->SetSmallIconFile( wxBitmap( img.Scale( SMALL_ICON_SIZE, SMALL_ICON_SIZE ) ) ); } // Parse the Properties std::set< PropertyType > types; ParseProperties( elem_obj, obj_info, obj_info->GetCategory(), &types ); ParseEvents ( elem_obj, obj_info, obj_info->GetCategory() ); // Add the ObjectInfo to the map m_objs.insert(ObjectInfoMap::value_type( _WXSTR(class_name), obj_info ) ); // Add the object to the palette if ( ShowInPalette( obj_info->GetObjectTypeName() ) ) { package->Add( obj_info ); } elem_obj = elem_obj->NextSiblingElement( OBJINFO_TAG, false ); } } catch ( ticpp::Exception& ex ) { THROW_WXFBEX( _WXSTR(ex.m_details) ); } return package; } void ObjectDatabase::ParseProperties( ticpp::Element* elem_obj, PObjectInfo obj_info, PPropertyCategory category, std::set< PropertyType >* types ) { ticpp::Element* elem_category = elem_obj->FirstChildElement( CATEGORY_TAG, false ); while ( elem_category ) { // Category name attribute std::string cname; elem_category->GetAttribute( NAME_TAG, &cname ); PPropertyCategory new_cat( new PropertyCategory( _WXSTR( cname ) ) ); // Add category category->AddCategory( new_cat ); // Recurse ParseProperties( elem_category, obj_info, new_cat, types ); elem_category = elem_category->NextSiblingElement( CATEGORY_TAG, false ); } ticpp::Element* elem_prop = elem_obj->FirstChildElement( PROPERTY_TAG, false ); while ( elem_prop ) { // Property Name Attribute std::string pname; elem_prop->GetAttribute( NAME_TAG, &pname ); category->AddProperty( _WXSTR(pname) ); std::string description; elem_prop->GetAttributeOrDefault( DESCRIPTION_TAG, &description, "" ); std::string customEditor; elem_prop->GetAttributeOrDefault( CUSTOM_EDITOR_TAG, &customEditor, "" ); std::string prop_type; elem_prop->GetAttribute( "type", &prop_type ); PropertyType ptype; try { ptype = ParsePropertyType( _WXSTR( prop_type ) ); } catch( wxFBException& ex ) { wxLogError( wxT("Error: %s\nWhile parsing property \"%s\" of class \"%s\""), ex.what(), _WXSTR(pname).c_str(), obj_info->GetClassName().c_str() ); elem_prop = elem_prop->NextSiblingElement( PROPERTY_TAG, false ); continue; } // Get default value std::string def_value; try { ticpp::Node* lastChild = elem_prop->LastChild(); ticpp::Text* text = lastChild->ToText(); def_value = text->Value(); } catch( ticpp::Exception& ){} // if the property is a "bitlist" then parse all of the options POptionList opt_list; std::list< PropertyChild > children; if ( ptype == PT_BITLIST || ptype == PT_OPTION ) { opt_list = POptionList( new OptionList() ); ticpp::Element* elem_opt = elem_prop->FirstChildElement( "option", false ); while( elem_opt ) { std::string macro_name; elem_opt->GetAttribute( NAME_TAG, ¯o_name ); std::string macro_description; elem_opt->GetAttributeOrDefault( DESCRIPTION_TAG, ¯o_description, "" ); opt_list->AddOption( _WXSTR(macro_name), _WXSTR(macro_description) ); m_macroSet.insert( _WXSTR(macro_name) ); elem_opt = elem_opt->NextSiblingElement( "option", false ); } } else if ( ptype == PT_PARENT ) { // If the property is a parent, then get the children def_value.clear(); ticpp::Element* elem_child = elem_prop->FirstChildElement( "child", false ); while ( elem_child ) { PropertyChild child; std::string child_name; elem_child->GetAttribute( NAME_TAG, &child_name ); child.m_name = _WXSTR( child_name ); std::string child_description; elem_child->GetAttributeOrDefault( DESCRIPTION_TAG, &child_description, "" ); child.m_description = _WXSTR( child_description ); // Get default value try { ticpp::Node* lastChild = elem_child->LastChild(); ticpp::Text* text = lastChild->ToText(); child.m_defaultValue = _WXSTR( text->Value() ); // build parent default value if ( children.size() > 0 ) { def_value += "; "; } def_value += text->Value(); } catch( ticpp::Exception& ){} children.push_back( child ); elem_child = elem_child->NextSiblingElement( "child", false ); } } // create an instance of PropertyInfo PPropertyInfo prop_info( new PropertyInfo( _WXSTR(pname), ptype, _WXSTR(def_value), _WXSTR(description), _WXSTR(customEditor), opt_list, children ) ); // add the PropertyInfo to the property obj_info->AddPropertyInfo( prop_info ); // merge property code templates, once per property type if ( types->insert( ptype ).second ) { LangTemplateMap& propLangTemplates = m_propertyTypeTemplates[ ptype ]; LangTemplateMap::iterator lang; for ( lang = propLangTemplates.begin(); lang != propLangTemplates.end(); ++lang ) { if ( lang->second ) { obj_info->AddCodeInfo( lang->first, lang->second ); } } } elem_prop = elem_prop->NextSiblingElement( PROPERTY_TAG, false ); } } void ObjectDatabase::ParseEvents( ticpp::Element* elem_obj, PObjectInfo obj_info, PPropertyCategory category ) { ticpp::Element* elem_category = elem_obj->FirstChildElement( CATEGORY_TAG, false ); while ( elem_category ) { // Category name attribute std::string cname; elem_category->GetAttribute( NAME_TAG, &cname ); PPropertyCategory new_cat( new PropertyCategory( _WXSTR( cname ) ) ); // Add category category->AddCategory( new_cat ); // Recurse ParseEvents( elem_category, obj_info, new_cat ); elem_category = elem_category->NextSiblingElement( CATEGORY_TAG, false ); } ticpp::Element* elem_evt = elem_obj->FirstChildElement( EVENT_TAG, false ); while ( elem_evt ) { // Event Name Attribute std::string evt_name; elem_evt->GetAttribute( NAME_TAG, &evt_name ); category->AddEvent( _WXSTR(evt_name) ); // Event class std::string evt_class; elem_evt->GetAttributeOrDefault( EVENT_CLASS_TAG, &evt_class, "wxEvent" ); // Help string std::string description; elem_evt->GetAttributeOrDefault( DESCRIPTION_TAG, &description, "" ); // Get default value std::string def_value; try { ticpp::Node* lastChild = elem_evt->LastChild(); ticpp::Text* text = lastChild->ToText(); def_value = text->Value(); } catch( ticpp::Exception& ){} // create an instance of EventInfo PEventInfo evt_info( new EventInfo( _WXSTR(evt_name), _WXSTR(evt_class), _WXSTR(def_value), _WXSTR(description))); // add the EventInfo to the event obj_info->AddEventInfo(evt_info); elem_evt = elem_evt->NextSiblingElement( EVENT_TAG, false ); } } bool ObjectDatabase::ShowInPalette(wxString type) { return (type == wxT("form") || type == wxT("sizer") || type == wxT("gbsizer") || type == wxT("menu") || type == wxT("menuitem") || type == wxT("submenu") || type == wxT("tool") || type == wxT("notebook") || type == wxT("flatnotebook") || type == wxT("listbook") || type == wxT("choicebook") || type == wxT("auinotebook") || type == wxT("widget") || type == wxT("expanded_widget") || type == wxT("statusbar") || type == wxT("component") || type == wxT("container") || type == wxT("menubar") || type == wxT("treelistctrl") || type == wxT("treelistctrlcolumn") || type == wxT("toolbar") || type == wxT("splitter") ); } void ObjectDatabase::ImportComponentLibrary( wxString libfile, PwxFBManager manager ) { wxString path = libfile; // This will prevent loading debug libraries in release and vice versa // That used to cause crashes when trying to debug #ifdef __WXFB_DEBUG__ path += wxT("d"); #endif // Find the GetComponentLibrary function - all plugins must implement this typedef IComponentLibrary* (*PFGetComponentLibrary)( IManager* manager ); #ifdef __WXMAC__ path += wxT(".dylib"); // open the library void* handle = dlopen( path.mb_str(), RTLD_LAZY ); if ( !handle ) { wxString error = wxString( dlerror(), wxConvUTF8 ); THROW_WXFBEX( wxT("Error loading library ") << path << wxT(" ") << error ) } dlerror(); // reset errors // load the symbol PFGetComponentLibrary GetComponentLibrary = (PFGetComponentLibrary) dlsym(handle, "GetComponentLibrary"); PFFreeComponentLibrary FreeComponentLibrary = (PFFreeComponentLibrary) dlsym(handle, "FreeComponentLibrary"); const char *dlsym_error = dlerror(); if (dlsym_error) { wxString error = wxString( dlsym_error, wxConvUTF8 ); THROW_WXFBEX( path << wxT(" is not a valid component library: ") << error ) dlclose( handle ); } else { m_libs.push_back( handle ); } #else // Attempt to load the DLL wxDynamicLibrary* library = new wxDynamicLibrary( path ); if ( !library->IsLoaded() ) { THROW_WXFBEX( wxT("Error loading library ") << path ) } m_libs.push_back( library ); PFGetComponentLibrary GetComponentLibrary = (PFGetComponentLibrary)library->GetSymbol( wxT("GetComponentLibrary") ); PFFreeComponentLibrary FreeComponentLibrary = (PFFreeComponentLibrary)library->GetSymbol( wxT("FreeComponentLibrary") ); if ( !(GetComponentLibrary && FreeComponentLibrary) ) { THROW_WXFBEX( path << wxT(" is not a valid component library") ) } #endif Debug::Print( wxT("[Database::ImportComponentLibrary] Importing %s library"), path.c_str() ); // Get the component library IComponentLibrary* comp_lib = GetComponentLibrary( (IManager*)manager.get() ); // Store the function to free the library m_componentLibs[ FreeComponentLibrary ] = comp_lib; // Import all of the components for ( unsigned int i = 0; i < comp_lib->GetComponentCount(); i++ ) { wxString class_name = comp_lib->GetComponentName( i ); IComponent* comp = comp_lib->GetComponent( i ); // Look for the class in the data read from the .xml files PObjectInfo class_info = GetObjectInfo( class_name ); if ( class_info ) { class_info->SetComponent(comp); } else { Debug::Print( wxT("ObjectInfo for <%s> not found while loading library <%s>"), class_name.c_str(), path.c_str() ); } } // Add all of the macros in the library to the macro dictionary PMacroDictionary dic = MacroDictionary::GetInstance(); for ( unsigned int i = 0; i < comp_lib->GetMacroCount(); i++ ) { wxString name = comp_lib->GetMacroName( i ); int value = comp_lib->GetMacroValue( i ); dic->AddMacro( name, value ); m_macroSet.erase( name ); } } PropertyType ObjectDatabase::ParsePropertyType( wxString str ) { PropertyType result; PTMap::iterator it = m_propTypes.find(str); if (it != m_propTypes.end()) result = it->second; else { result = PT_ERROR; THROW_WXFBEX( wxString::Format( wxT("Unknown property type \"%s\""), str.c_str() ) ); } return result; } wxString ObjectDatabase::ParseObjectType( wxString str ) { return str; } #define PT(x,y) m_propTypes.insert(PTMap::value_type(x,y)) void ObjectDatabase::InitPropertyTypes() { PT( wxT("bool"), PT_BOOL ); PT( wxT("text"), PT_TEXT ); PT( wxT("int"), PT_INT ); PT( wxT("uint"), PT_UINT ); PT( wxT("bitlist"), PT_BITLIST ); PT( wxT("intlist"), PT_INTLIST ); PT( wxT("uintlist"), PT_UINTLIST ); PT( wxT("option"), PT_OPTION ); PT( wxT("macro"), PT_MACRO ); PT( wxT("path"), PT_PATH ); PT( wxT("wxString"), PT_WXSTRING ); PT( wxT("wxPoint"), PT_WXPOINT ); PT( wxT("wxSize"), PT_WXSIZE ); PT( wxT("wxFont"), PT_WXFONT ); PT( wxT("wxColour"), PT_WXCOLOUR ); PT( wxT("bitmap"), PT_BITMAP ); PT( wxT("wxString_i18n"),PT_WXSTRING_I18N); PT( wxT("stringlist"), PT_STRINGLIST ); PT( wxT("float"), PT_FLOAT ); PT( wxT("parent"), PT_PARENT ); } bool ObjectDatabase::LoadObjectTypes() { ticpp::Document doc; wxString xmlPath = m_xmlPath + wxT("objtypes.xml"); XMLUtils::LoadXMLFile( doc, true, xmlPath ); // First load the object types, then the children try { ticpp::Element* root = doc.FirstChildElement("definitions"); ticpp::Element* elem = root->FirstChildElement( "objtype" ); while ( elem ) { bool hidden; elem->GetAttributeOrDefault( "hidden", &hidden, false ); bool item; elem->GetAttributeOrDefault( "item", &item, false ); wxString name = _WXSTR( elem->GetAttribute("name") ); PObjectType objType( new ObjectType( name, (int)m_types.size(), hidden, item ) ); m_types.insert( ObjectTypeMap::value_type( name, objType ) ); elem = elem->NextSiblingElement( "objtype", false ); } // now load the children elem = root->FirstChildElement("objtype"); while (elem) { wxString name = _WXSTR( elem->GetAttribute("name") ); // get the objType PObjectType objType = GetObjectType( name ); ticpp::Element* child = elem->FirstChildElement( "childtype", false ); while ( child ) { int nmax = -1; // no limit child->GetAttributeOrDefault( "nmax", &nmax, -1 ); wxString childname = _WXSTR( child->GetAttribute("name") ); PObjectType childType = GetObjectType( childname ); if ( !childType ) { wxLogError( _("No Object Type found for \"%s\""), childname.c_str() ); continue; } objType->AddChildType( childType, nmax ); child = child->NextSiblingElement( "childtype", false ); } elem = elem->NextSiblingElement( "objtype", false ); } } catch( ticpp::Exception& ex ) { wxLogError( _WXSTR( ex.m_details ) ); return false; } return true; } PObjectType ObjectDatabase::GetObjectType(wxString name) { PObjectType type; ObjectTypeMap::iterator it = m_types.find(name); if (it != m_types.end()) type = it->second; return type; } wxformbuilder-3.1.59/src/model/database.h0000644000175000017500000002026211143440026020555 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #ifndef __OBJ_DATABASE__ #define __OBJ_DATABASE__ #include #include #include #include "model/types.h" #include "utils/wxfbdefs.h" class ObjectDatabase; class ObjectTypeDictionary; class PropertyCategory; typedef boost::shared_ptr PObjectDatabase; namespace ticpp { class Element; } /** * Paquete de clases de objetos. * Determinará la agrupación en la paleta de componentes. */ class ObjectPackage { private: wxString m_name; // nombre del paquete wxString m_desc; // breve descripción del paquete wxBitmap m_icon; // The icon for the notebook page // Vector con los objetos que están contenidos en el paquete std::vector< PObjectInfo > m_objs; public: /** * Constructor. */ ObjectPackage(wxString name, wxString desc, wxBitmap icon); /** * Incluye en el paquete la información de un objeto. */ void Add(PObjectInfo obj) { m_objs.push_back(obj); }; /** * Obtiene el nombre del paquete. */ wxString GetPackageName() { return m_name; } /** * Obtiene el texto que describe el paquete. */ wxString GetPackageDescription() { return m_desc; } /** * Get Package Icon */ wxBitmap GetPackageIcon() { return m_icon; } /** * Obtiene el número de objetos incluidos en el paquete. */ unsigned int GetObjectCount() { return (unsigned int)m_objs.size(); } /** * Obtiene la información de un objeto incluido en el paquete. */ PObjectInfo GetObjectInfo(unsigned int idx); /** If two xml files specify the same package name, then they merged to one package with this. This allows one package to be split across multiple xml files. */ void AppendPackage( PObjectPackage package ); }; class IComponentLibrary; /** * Base de datos de objetos. * Todos las informaciones de objetos importadas de los archivos XML, serán * almacenados por esta clase. */ class ObjectDatabase { public: static bool HasCppProperties(wxString type); private: typedef std::vector PackageVector; // Map the property type string to the property type number typedef std::map PTMap; typedef std::map ObjectTypeMap; #ifdef __WXMAC__ typedef std::vector< void * > LibraryVector; #else typedef std::vector< wxDynamicLibrary * > LibraryVector; #endif typedef void (*PFFreeComponentLibrary)( IComponentLibrary* lib ); typedef std::map< PFFreeComponentLibrary, IComponentLibrary * > ComponentLibraryMap; typedef std::set MacroSet; typedef std::map< wxString, PCodeInfo > LangTemplateMap; typedef std::map< PropertyType, LangTemplateMap > PTLangTemplateMap; wxString m_xmlPath; wxString m_iconPath; wxString m_pluginPath; std::map< wxString, PObjectInfo > m_objs; PackageVector m_pkgs; PTMap m_propTypes; LibraryVector m_libs; ComponentLibraryMap m_componentLibs; ObjectTypeMap m_types; // register object types // para comprobar que no se nos han quedado macros sin añadir en las // liberias de componentes, vamos a crear un conjunto con las macros // definidas en los XML, y al importar las librerías vamos a ir eliminando // dichas macros del conjunto, quedando al final las macros que faltan // por registrar en la librería. MacroSet m_macroSet; // used so libraries are only imported once, even if multiple libraries use them std::set< wxString > m_importedLibraries; PTLangTemplateMap m_propertyTypeTemplates; /** * Initialize the property type map. */ void InitPropertyTypes(); /** * Carga las plantillas de generación de código de un fichero * xml de código dado */ void LoadCodeGen( const wxString& file ); /** * Carga los objetos de un paquete con todas sus propiedades salvo * los objetos heredados */ PObjectPackage LoadPackage( const wxString& file, const wxString& iconPath = wxEmptyString ); void ParseProperties( ticpp::Element* elem_obj, PObjectInfo obj_info, PPropertyCategory category, std::set< PropertyType >* types ); void ParseEvents ( ticpp::Element* elem_obj, PObjectInfo obj_info, PPropertyCategory category ); /** * Importa una librería de componentes y lo asocia a cada clase. * @throw wxFBException If the library could not be imported. */ void ImportComponentLibrary( wxString libfile, PwxFBManager manager ); /** * Incluye la información heredada de los objetos de un paquete. * En la segunda pasada configura cada paquete con sus objetos base. */ void SetupPackage( const wxString& file, const wxString& path, PwxFBManager manager ); /** * Determina si el tipo de objeto hay que incluirlo en la paleta de * componentes. */ bool ShowInPalette(wxString type); // rutinas de conversión PropertyType ParsePropertyType (wxString str); wxString ParseObjectType (wxString str); PObjectType GetObjectType(wxString name); int CountChildrenWithSameType(PObjectBase parent,PObjectType type); void SetDefaultLayoutProperties(PObjectBase obj); public: ObjectDatabase(); ~ObjectDatabase(); PObjectBase NewObject(PObjectInfo obj_info); /** * Obtiene la información de un objeto a partir del nombre de la clase. */ PObjectInfo GetObjectInfo(wxString class_name); /** * Configura la ruta donde se encuentran los ficheros con la descripción. */ void SetXmlPath( const wxString& path ) { m_xmlPath = path; } /** * Configura la ruta donde se encuentran los iconos asociados a los objetos. */ void SetIconPath( const wxString& path) { m_iconPath = path; } void SetPluginPath( const wxString& path ) { m_pluginPath = path; } /** * Obtiene la ruta donde se encuentran los ficheros con la descripción de * objetos. */ wxString GetXmlPath() { return m_xmlPath; } wxString GetIconPath() { return m_iconPath; } wxString GetPluginPath() { return m_pluginPath; } /** * Carga las definiciones de tipos de objetos. */ bool LoadObjectTypes(); /** * Find and load plugins from the plugins directory */ void LoadPlugins( PwxFBManager manager ); /** * Fabrica de objetos. * A partir del nombre de la clase se crea una nueva instancia de un objeto. */ PObjectBase CreateObject( std::string class_name, PObjectBase parent = PObjectBase()); /** * Fábrica de objetos a partir de un objeto XML. * Este método se usará para cargar un proyecto almacenado. */ PObjectBase CreateObject( ticpp::Element* obj, PObjectBase parent = PObjectBase()); /** * Crea un objeto como copia de otro. */ PObjectBase CopyObject(PObjectBase obj); /** * Obtiene un paquete de objetos. */ PObjectPackage GetPackage(unsigned int idx); /** * Obtiene el número de paquetes registrados. */ unsigned int GetPackageCount() { return (unsigned int)m_pkgs.size(); } /** * Resetea los contadores que acompañan al nombre. * La propiedad "name" es una propiedad especial, reservada para el nombre * de la instancia del objeto. Cada clase de objeto tiene asociado un contador * para no duplicar nombre en la creación de nuevos objetos * (p.e. m_button1, m_button2 ...) */ void ResetObjectCounters(); }; #endif //__OBJ_DATABASE__ wxformbuilder-3.1.59/src/model/xrcfilter.h0000644000175000017500000000317211143440026021014 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #ifndef __XRC_FILTER__ #define __XRC_FILTER__ #include "utils/wxfbdefs.h" #include "model/database.h" #include /** * Filtro de importación de un fichero XRC. */ class XrcLoader { private: PObjectDatabase m_objDb; PObjectBase GetObject(ticpp::Element *xrcObj, PObjectBase parent); public: void SetObjectDatabase(PObjectDatabase db) { m_objDb = db; } /** * Dado un árbol XML en formato XRC, crea el arbol de objetos asociado. */ PObjectBase GetProject(ticpp::Document* xrcDoc); }; #endif //__XRC_FILTER__ wxformbuilder-3.1.59/src/model/objectbase.h0000644000175000017500000004542711143440026021124 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// // Atencion!!!!!! // ObjectBase::GetPropertyCount() != ObjectInfo::GetPropertyCount() // // En el primer caso devolverá el numero total de propiedades del objeto. // En el segundo caso sólo devolverá el número de propiedades definidas // para esa clase. #ifndef __OBJ__ #define __OBJ__ #include #include #include #include "types.h" #include "ticpp.h" #include "wx/wx.h" #include #include "utils/wxfbdefs.h" /////////////////////////////////////////////////////////////////////////////// class OptionList { private: std::map< wxString, wxString > m_options; public: void AddOption( wxString option, wxString description = wxString() ) { m_options[option] = description; } unsigned int GetOptionCount() { return (unsigned int)m_options.size(); } const std::map< wxString, wxString >& GetOptions() { return m_options; } }; /////////////////////////////////////////////////////////////////////////////// /** @internal Data Container for children of a Parent property */ class PropertyChild { public: wxString m_name; wxString m_defaultValue; wxString m_description; }; /////////////////////////////////////////////////////////////////////////////// class PropertyInfo { friend class Property; private: wxString m_name; PropertyType m_type; wxString m_def_value; POptionList m_opt_list; std::list< PropertyChild > m_children; // Only used for parent properties bool m_hidden; // Juan. Determina si la propiedad aparece o no en XRC wxString m_description; wxString m_customEditor; // an optional custom editor for the property grid public: PropertyInfo(wxString name, PropertyType type, wxString def_value, wxString description, wxString customEditor, POptionList opt_list, const std::list< PropertyChild >& children ); ~PropertyInfo(); wxString GetDefaultValue() { return m_def_value; } PropertyType GetType() { return m_type; } wxString GetName() { return m_name; } POptionList GetOptionList () { return m_opt_list; } std::list< PropertyChild >* GetChildren(){ return &m_children; } wxString GetDescription () { return m_description;} wxString GetCustomEditor() { return m_customEditor; } }; class EventInfo { private: wxString m_name; wxString m_eventClass; wxString m_defaultValue; wxString m_description; public: EventInfo(const wxString &name, const wxString &eventClass, const wxString &defValue, const wxString &description); wxString GetName() { return m_name; } wxString GetEventClassName() { return m_eventClass; } wxString GetDefaultValue() { return m_defaultValue; } wxString GetDescription() { return m_description; } }; /////////////////////////////////////////////////////////////////////////////// class Property { private: PPropertyInfo m_info; // pointer to its descriptor WPObjectBase m_object; // pointer to the owner object wxString m_value; public: Property(PPropertyInfo info, PObjectBase obj = PObjectBase()) { m_object = obj; m_info = info; } PObjectBase GetObject() { return m_object.lock(); } wxString GetName() { return m_info->GetName(); } wxString GetValue() { return m_value; } void SetValue( wxString& val ) { m_value = val; } void SetValue( const wxChar* val ) { m_value = val; } PPropertyInfo GetPropertyInfo() { return m_info; } PropertyType GetType() { return m_info->GetType(); } bool IsDefaultValue(); bool IsNull(); void SetDefaultValue(); void ChangeDefaultValue( const wxString& value ) { m_info->m_def_value = value; } //////////////////// void SetValue(const wxFontContainer &font); void SetValue(const wxColour &colour); void SetValue(const wxString &str, bool format = false); void SetValue(const wxPoint &point); void SetValue(const wxSize &size); void SetValue(const int integer); void SetValue(const double val ); wxFontContainer GetValueAsFont(); wxColour GetValueAsColour(); wxPoint GetValueAsPoint(); wxSize GetValueAsSize(); int GetValueAsInteger(); wxString GetValueAsString(); wxBitmap GetValueAsBitmap(); wxString GetValueAsText(); // sustituye los ('\n',...) por ("\\n",...) wxArrayString GetValueAsArrayString(); double GetValueAsFloat(); void SplitParentProperty( std::map< wxString, wxString >* children ); wxString GetChildFromParent( const wxString& childName ); }; class Event { private: PEventInfo m_info; // pointer to its descriptor WPObjectBase m_object; // pointer to the owner object wxString m_value; // handler function name public: Event (PEventInfo info, PObjectBase obj) : m_info(info), m_object(obj) {} void SetValue(const wxString &value) { m_value = value; } wxString GetValue() { return m_value; } wxString GetName() { return m_info->GetName(); } PObjectBase GetObject() { return m_object.lock(); } PEventInfo GetEventInfo() { return m_info; } }; class PropertyCategory { private: wxString m_name; std::vector< wxString > m_properties; std::vector< wxString > m_events; std::vector< PPropertyCategory > m_categories; public: PropertyCategory( wxString name ) : m_name( name ){} void AddProperty( wxString name ){ m_properties.push_back( name ); } void AddEvent( wxString name ){ m_events.push_back( name ); } void AddCategory( PPropertyCategory category ){ m_categories.push_back( category ); } wxString GetName(){ return m_name; } wxString GetPropertyName( size_t index ) { if ( index < m_properties.size() ) { return m_properties[ index ]; } else { return wxEmptyString; } } wxString GetEventName( size_t index ) { if ( index < m_events.size() ) { return m_events[ index ]; } else { return wxEmptyString; } } PPropertyCategory GetCategory( size_t index ) { if ( index < m_categories.size() ) { return m_categories[ index ]; } else { return PPropertyCategory(); } } size_t GetPropertyCount() { return m_properties.size(); } size_t GetEventCount() { return m_events.size(); } size_t GetCategoryCount() { return m_categories.size(); } }; /////////////////////////////////////////////////////////////////////////////// namespace ticpp { class Document; class Element; } class ObjectBase : public IObject, public boost::enable_shared_from_this { friend class wxFBDataObject; private: wxString m_class; // class name wxString m_type; // type of object WPObjectBase m_parent; // weak pointer, no reference loops please! ObjectBaseVector m_children; PropertyMap m_properties; EventMap m_events; PObjectInfo m_info; bool m_expanded; // is expanded in the object tree, allows for saving to file protected: // utilites for implementing the tree static const int INDENT; // size of indent wxString GetIndentString(int indent); // obtiene la cadena con el indentado ObjectBaseVector& GetChildren() { return m_children; }; PropertyMap& GetProperties() { return m_properties; }; // Crea un elemento del objeto void SerializeObject( ticpp::Element* serializedElement ); // devuelve el puntero "this" PObjectBase GetThis() { return shared_from_this(); } public: /// Constructor. ObjectBase (wxString class_name); /// Destructor. virtual ~ObjectBase(); /** Sets whether the object is expanded in the object tree or not. */ void SetExpanded( bool expanded ){ m_expanded = expanded; } /** Gets whether the object is expanded in the object tree or not. */ bool GetExpanded(){ return m_expanded; } /** * Obtiene el nombre del objeto. * * @note No confundir con la propiedad nombre que tienen algunos objetos. * Cada objeto tiene un nombre, el cual será el mismo que el usado * como clave en el registro de descriptores. */ wxString GetClassName () { return m_class; } /// Gets the parent object PObjectBase GetParent () { return m_parent.lock(); } /// Links the object to a parent void SetParent(PObjectBase parent) { m_parent = parent; } /** * Obtiene la propiedad identificada por el nombre. * * @note Notar que no existe el método SetProperty, ya que la modificación * se hace a través de la referencia. */ PProperty GetProperty (wxString name); PEvent GetEvent(wxString name); /** * Añade una propiedad al objeto. * * Este método será usado por el registro de descriptores para crear la * instancia del objeto. * Los objetos siempre se crearán a través del registro de descriptores. */ void AddProperty (PProperty value); void AddEvent(PEvent event); /** * Obtiene el número de propiedades del objeto. */ unsigned int GetPropertyCount() { return (unsigned int)m_properties.size(); } unsigned int GetEventCount() { return m_events.size(); } /** * Obtiene una propiedad del objeto. * @todo esta función deberá lanzar una excepción en caso de no encontrarse * dicha propiedad, así se simplifica el código al no tener que hacer * tantas comprobaciones. * Por ejemplo, el código sin excepciones sería algo así: * * @code * * PProperty plabel = obj->GetProperty("label"); * PProperty ppos = obj->GetProperty("pos"); * PProperty psize = obj->GetProperty("size"); * PProperty pstyle = obj->GetProperty("style"); * * if (plabel && ppos && psize && pstyle) * { * wxButton *button = new wxButton(parent,-1, * plabel->GetValueAsString(), * ppos->GetValueAsPoint(), * psize->GetValueAsSize(), * pstyle->GetValueAsInteger()); * } * else * { * // manejo del error * } * * @endcode * * y con excepciones: * * @code * * try * { * wxButton *button = new wxButton(parent,-1, * obj->GetProperty("label")->GetValueAsString(), * obj->GetProperty("pos")->GetValueAsPoint(), * obj->GetProperty("size")->GetValueAsSize(), * obj->GetProperty("style")->GetValueAsInteger()); * } * catch (...) * { * // manejo del error * } * * @endcode * */ PProperty GetProperty (unsigned int idx); // throws ...; PEvent GetEvent (unsigned int idx); // throws ...; /** * Devuelve el primer antecesor cuyo tipo coincida con el que se pasa * como parámetro. * * Será útil para encontrar el widget padre. */ PObjectBase FindNearAncestor(wxString type); PObjectBase FindNearAncestorByBaseClass(wxString type); /** * Obtiene el documento xml del arbol tomando como raíz el nodo actual. */ void Serialize( ticpp::Document* serializedDocument ); /** * Añade un hijo al objeto. * Esta función es virtual, debido a que puede variar el comportamiento * según el tipo de objeto. * * @return true si se añadió el hijo con éxito y false en caso contrario. */ virtual bool AddChild (PObjectBase); virtual bool AddChild (unsigned int idx, PObjectBase obj); /** * Devuelve la posicion del hijo o GetChildCount() en caso de no encontrarlo */ unsigned int GetChildPosition(PObjectBase obj); bool ChangeChildPosition(PObjectBase obj, unsigned int pos); /** * devuelve la posición entre sus hermanos */ /* unsigned int GetPosition(); bool ChangePosition(unsigned int pos);*/ /** * Elimina un hijo del objeto. */ void RemoveChild (PObjectBase obj); void RemoveChild (unsigned int idx); void RemoveAllChildren(){ m_children.clear(); } /** * Obtiene un hijo del objeto. */ PObjectBase GetChild (unsigned int idx); /** * Obtiene el número de hijos del objeto. */ unsigned int GetChildCount() { return (unsigned int)m_children.size(); } /** * Comprueba si el tipo de objeto pasado es válido como hijo del objeto. * Esta rutina es importante, ya que define las restricciónes de ubicación. */ //bool ChildTypeOk (wxString type); bool ChildTypeOk (PObjectType type); bool IsContainer() { return (GetObjectTypeName() == wxT("container") ); } PObjectBase GetLayout(); /** * Devuelve el tipo de objeto. * * Deberá ser redefinida en cada clase derivada. */ wxString GetObjectTypeName() { return m_type; } void SetObjectTypeName(wxString type) { m_type = type; } /** * Devuelve el descriptor del objeto. */ PObjectInfo GetObjectInfo() { return m_info; }; void SetObjectInfo(PObjectInfo info) { m_info = info; }; /** * Devuelve la profundidad del objeto en el arbol. */ int Deep(); /** * Imprime el arbol en un stream. */ //virtual void PrintOut(ostream &s, int indent); /** * Sobrecarga del operador inserción. */ friend std::ostream& operator << (std::ostream &s, PObjectBase obj); ///////////////////////// // Implementación de la interfaz IObject para su uso dentro de los // plugins bool IsNull (const wxString& pname); int GetPropertyAsInteger (const wxString& pname); wxFontContainer GetPropertyAsFont (const wxString& pname); wxColour GetPropertyAsColour (const wxString& pname); wxString GetPropertyAsString (const wxString& pname); wxPoint GetPropertyAsPoint (const wxString& pname); wxSize GetPropertyAsSize (const wxString& pname); wxBitmap GetPropertyAsBitmap (const wxString& pname); double GetPropertyAsFloat (const wxString& pname); wxArrayInt GetPropertyAsArrayInt (const wxString& pname); wxArrayString GetPropertyAsArrayString (const wxString& pname); wxString GetChildFromParentProperty( const wxString& parentName, const wxString& childName ); }; /////////////////////////////////////////////////////////////////////////////// /** * Clase que guarda un conjunto de plantillas de código. */ class CodeInfo { private: typedef std::map TemplateMap; TemplateMap m_templates; public: wxString GetTemplate(wxString name); void AddTemplate(wxString name, wxString _template); void Merge( PCodeInfo merger ); }; /////////////////////////////////////////////////////////////////////////////// /** * Información de objeto o MetaObjeto. */ class ObjectInfo { public: /** * Constructor. */ ObjectInfo(wxString class_name, PObjectType type, WPObjectPackage package, bool startGroup = false ); virtual ~ObjectInfo() {}; PPropertyCategory GetCategory(){ return m_category; } unsigned int GetPropertyCount() { return (unsigned int)m_properties.size(); } unsigned int GetEventCount() { return (unsigned int)m_events.size(); } /** * Obtiene el descriptor de la propiedad. */ PPropertyInfo GetPropertyInfo(wxString name); PPropertyInfo GetPropertyInfo(unsigned int idx); PEventInfo GetEventInfo(wxString name); PEventInfo GetEventInfo(unsigned int idx); /** * Añade un descriptor de propiedad al descriptor de objeto. */ void AddPropertyInfo(PPropertyInfo pinfo); /** * Adds a event descriptor. */ void AddEventInfo(PEventInfo evtInfo); /** * Add a default value for an inherited property. * @param baseIndex Index of base class returned from AddBaseClass. * @param propertyName Property of base class to assign a default value to. * @param defaultValue Default value of the inherited property. */ void AddBaseClassDefaultPropertyValue( size_t baseIndex, const wxString& propertyName, const wxString& defaultValue ); /** * Get a default value for an inherited property. * @param baseIndex Index of base class in the base class vector * @param propertName Name of the property to get the default value for * @return The default value for the property */ wxString GetBaseClassDefaultPropertyValue( size_t baseIndex, const wxString& propertyName ); /** * Devuelve el tipo de objeto, será util para que el constructor de objetos * sepa la clase derivada de ObjectBase que ha de crear a partir del * descriptor. */ wxString GetObjectTypeName() { return m_type->GetName(); } PObjectType GetObjectType() { return m_type; } wxString GetClassName () { return m_class; } /** * Imprime el descriptor en un stream. */ //virtual void PrintOut(ostream &s, int indent); /** * Sobrecarga del operador inserción. */ friend std::ostream& operator << (std::ostream &s, PObjectInfo obj); // nos serán utiles para generar el nombre del objeto unsigned int GetInstanceCount() { return m_numIns; } void IncrementInstanceCount() { m_numIns++; } void ResetInstanceCount() { m_numIns = 0; } /** * Añade la información de un objeto al conjunto de clases base. */ size_t AddBaseClass(PObjectInfo base) { m_base.push_back(base); return m_base.size() - 1; } /** * Comprueba si el tipo es derivado del que se pasa como parámetro. */ bool IsSubclassOf(wxString classname); PObjectInfo GetBaseClass(unsigned int idx); unsigned int GetBaseClassCount(); // void SetIconFile(wxBitmap icon) { m_icon = icon; }; wxBitmap GetIconFile() { return m_icon; } void SetSmallIconFile(wxBitmap icon) { m_smallIcon = icon; }; wxBitmap GetSmallIconFile() { return m_smallIcon; } void AddCodeInfo(wxString lang, PCodeInfo codeinfo); PCodeInfo GetCodeInfo(wxString lang); PObjectPackage GetPackage(); bool IsStartOfGroup() { return m_startGroup; } /** * Le asigna un componente a la clase. */ void SetComponent(IComponent *c) { m_component = c; }; IComponent* GetComponent() { return m_component; }; private: wxString m_class; // nombre de la clase (tipo de objeto) PObjectType m_type; // tipo del objeto WPObjectPackage m_package; // Package that the object comes from PPropertyCategory m_category; wxBitmap m_icon; wxBitmap m_smallIcon; // The icon for the property grid toolbar bool m_startGroup; // Place a separator in the palette toolbar just before this widget std::map< wxString, PCodeInfo > m_codeTemp; // plantillas de codigo K=language_name T=PCodeInfo unsigned int m_numIns; // número de instancias del objeto std::map< wxString, PPropertyInfo > m_properties; std::map< wxString, PEventInfo > m_events; std::vector< PObjectInfo > m_base; // base classes std::map< size_t, std::map< wxString, wxString > > m_baseClassDefaultPropertyValues; IComponent* m_component; // componente asociado a la clase los objetos del // designer }; #endif wxformbuilder-3.1.59/src/dbg_stack_trace/LICENSE_1_0.txt0000644000175000017500000000247211143440027023125 0ustar rrmulderrrmulderBoost Software License - Version 1.0 - August 17th, 2003 Permission is hereby granted, free of charge, to any person or organization obtaining a copy of the software and accompanying documentation covered by this license (the "Software") to use, reproduce, display, distribute, execute, and transmit the Software, and to prepare derivative works of the Software, and to permit third-parties to whom the Software is furnished to do so, all subject to the following: The copyright notices in the Software and this entire statement, including the above license grant, this restriction and the following disclaimer, must be included in all copies of the Software, in whole or in part, and all derivative works of the Software, unless such copies or derivative works are solely in the form of machine-executable object code generated by a source language processor. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. wxformbuilder-3.1.59/src/dbg_stack_trace/stack.hpp0000644000175000017500000000321011143440027022450 0ustar rrmulderrrmulder// Copyright 2007 Edd Dawson. // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #ifndef STACK_HPP_0022_01092007 #define STACK_HPP_0022_01092007 #include #include #include #include #if defined(_WIN32) #include #endif namespace dbg { class stack_error : public std::exception { public: stack_error(const std::string &what); ~stack_error() throw(); const char *what() const throw(); private: std::string what_; }; class stack_frame { public: stack_frame(const void *instruction, const std::string &function); const void *instruction() const; const std::string &function() const; private: const void *instruction_; std::string function_; }; std::ostream &operator<< (std::ostream &out, const stack_frame &frame); class stack { public: typedef std::list::size_type depth_type; typedef std::list::const_iterator const_iterator; stack(depth_type limit = 0); #if defined(_WIN32) stack(depth_type limit, CONTEXT* fromContext); #endif const_iterator begin() const; const_iterator end() const; depth_type depth() const; private: std::list frames_; }; } // close namespace dbg #endif // STACK_HPP_0022_01092007 wxformbuilder-3.1.59/src/dbg_stack_trace/stack.cpp0000644000175000017500000003130511143440027022451 0ustar rrmulderrrmulder// Copyright 2007 Edd Dawson. // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #include #include #include #include #include #include #include #include "stack.hpp" #if defined(_WIN32) #include #include // link against imagehlp.lib #if defined(__MINGW32__) #include // link against libbfd and libiberty #include // link against psapi #include #endif #elif defined(__GNUC__) #include #include #endif namespace { #if defined(__GNUC__) std::string demangle(const char *name) { int status = 0; char *d = 0; std::string ret = name; try { if ((d = abi::__cxa_demangle(name, 0, 0, &status))) ret = d; } catch(...) { } std::free(d); return ret; } #endif #if defined(_WIN32) class uncopyable { public: uncopyable() { } private: uncopyable(const uncopyable &); // remains undefined uncopyable &operator= (const uncopyable &); // remains undefined }; #if defined(__MINGW32__) class bfd_context : uncopyable { private: struct find_data { std::string func; asymbol **symbol_table; bfd_vma counter; }; public: bfd_context() : abfd_(0), sec_(0), symbol_table_(0) { char procname[MAX_PATH]; GetModuleFileNameExA(GetCurrentProcess(), NULL, procname, sizeof procname); bfd_init(); abfd_ = bfd_openr(procname, 0); if (!abfd_) throw dbg::stack_error("Failed to parse object data for the executable"); char **formats = 0; bool b1 = bfd_check_format(abfd_, bfd_object); bool b2 = bfd_check_format_matches(abfd_, bfd_object, &formats); bool b3 = bfd_get_file_flags(abfd_) & HAS_SYMS; if (!(b1 && b2 && b3)) { bfd_close(abfd_); free(formats); throw dbg::stack_error("Failed to parse object data for the executable"); } free(formats); // Load symbol table unsigned dummy = 0; if (bfd_read_minisymbols(abfd_, FALSE, (void **)&symbol_table_, &dummy) == 0 && bfd_read_minisymbols(abfd_, TRUE, (void **)&symbol_table_, &dummy) < 0) { free(symbol_table_); bfd_close(abfd_); throw dbg::stack_error("Failed to parse object data for the executable"); } } ~bfd_context() { free(symbol_table_); bfd_close(abfd_); } std::string get_function_name(DWORD offset) { find_data data; data.symbol_table = symbol_table_; data.counter = offset; bfd_map_over_sections(abfd_, &find_function_name_in_section, &data); return data.func; } private: static void find_function_name_in_section(bfd *abfd, asection *sec, void *opaque_data) { assert(sec); assert(opaque_data); find_data &data = *static_cast(opaque_data); if (!data.func.empty()) return; // already found it if (!(bfd_get_section_flags(abfd, sec) & SEC_ALLOC)) return; bfd_vma vma = bfd_get_section_vma(abfd, sec); if (data.counter < vma || vma + bfd_get_section_size(sec) <= data.counter) return; const char *func = 0; const char *file = 0; unsigned line = 0; if (bfd_find_nearest_line(abfd, sec, data.symbol_table, data.counter - vma, &file, &func, &line) && func) data.func = demangle(func); } private: bfd *abfd_; asection *sec_; asymbol **symbol_table_; }; #endif // __MINGW32__ class auto_cast_function_ptr { public: template explicit auto_cast_function_ptr(FuncPtr f) : fptr_(reinterpret_cast(f)) { } template operator FuncPtr() const { return reinterpret_cast(fptr_); } private: void (*fptr_)(void); }; class windows_dll : uncopyable { public: explicit windows_dll(const std::string &libname) : name_(libname), lib_(LoadLibraryA(name_.c_str())) { if (!lib_) throw dbg::stack_error("Failed to load dll " + name_); } ~windows_dll() { FreeLibrary(lib_); } const std::string &name() const { return name_; } auto_cast_function_ptr function(const std::string &func_name) const { FARPROC proc = GetProcAddress(lib_, func_name.c_str()); if (!proc) throw dbg::stack_error("failed to load function " + func_name + " from library " + name_); return auto_cast_function_ptr(proc); } private: std::string name_; HMODULE lib_; }; class symbol_context : uncopyable { public: symbol_context() { SymInitialize(GetCurrentProcess(), 0, true); } ~symbol_context() { SymCleanup(GetCurrentProcess()); } }; class mutex : uncopyable { public: mutex() { InitializeCriticalSection(&cs_); } ~mutex() { DeleteCriticalSection(&cs_); } void lock() { EnterCriticalSection(&cs_); } void unlock() { LeaveCriticalSection(&cs_); } private: CRITICAL_SECTION cs_; }; class scoped_lock : uncopyable { public: scoped_lock(mutex &m) : m_(m) { m_.lock(); } ~scoped_lock() { m_.unlock(); } private: mutex &m_; }; mutex fill_frames_mtx_; void fill_frames(std::list &frames, dbg::stack::depth_type limit, CONTEXT* fromContext = 0) { scoped_lock lk(fill_frames_mtx_); #if defined(__MINGW32__) static bfd_context bfdc; #endif symbol_context sc; STACKFRAME frame; std::memset(&frame, 0, sizeof frame); CONTEXT context; if ( 0 == fromContext ) { std::memset(&context, 0, sizeof(CONTEXT)); context.ContextFlags = CONTEXT_FULL; windows_dll kernel32("kernel32.dll"); void (WINAPI *RtlCaptureContext_) (CONTEXT*) = kernel32.function("RtlCaptureContext"); RtlCaptureContext_(&context); } else { context = *fromContext; } frame.AddrPC.Offset = context.Eip; frame.AddrPC.Mode = AddrModeFlat; frame.AddrStack.Offset = context.Esp; frame.AddrStack.Mode = AddrModeFlat; frame.AddrFrame.Offset = context.Ebp; frame.AddrFrame.Mode = AddrModeFlat; HANDLE process = GetCurrentProcess(); HANDLE thread = GetCurrentThread(); dbg::stack::depth_type skip = 0; bool has_limit = limit != 0; char symbol_buffer[sizeof(IMAGEHLP_SYMBOL) + 255]; char module_name_raw[MAX_PATH]; while(StackWalk(IMAGE_FILE_MACHINE_I386, process, thread, &frame, &context, 0, SymFunctionTableAccess, SymGetModuleBase, 0 )) { if (skip < 1) { ++skip; continue; } if (has_limit && limit-- == 0) break; IMAGEHLP_SYMBOL *symbol = reinterpret_cast(symbol_buffer); symbol->SizeOfStruct = (sizeof *symbol) + 255; symbol->MaxNameLength = 254; DWORD module_base = SymGetModuleBase(process, frame.AddrPC.Offset); std::string module_name = "[unknown module]"; if( module_base && GetModuleFileNameA(reinterpret_cast(module_base), module_name_raw, MAX_PATH)) module_name = module_name_raw; #if defined(__MINGW32__) std::string func = bfdc.get_function_name(frame.AddrPC.Offset); if (func.empty()) { DWORD displacement = 0; // dummy variable BOOL got_symbol = SymGetSymFromAddr(process, frame.AddrPC.Offset, &displacement, symbol); func = got_symbol ? symbol->Name : "[unknown function]"; } #else DWORD displacement = 0; // dummy variable BOOL got_symbol = SymGetSymFromAddr(process, frame.AddrPC.Offset, &displacement, symbol); std::string func = got_symbol ? symbol->Name : "[unknown function]"; #endif dbg::stack_frame f(reinterpret_cast(frame.AddrPC.Offset), func + " in " + module_name); frames.push_back(f); } } #elif defined(__GNUC__) #if defined(__i386__) void fill_frames(std::list &frames, dbg::stack::depth_type limit) { // Based on code found at: // http://www.tlug.org.za/wiki/index.php/Obtaining_a_stack_trace_in_C_upon_SIGSEGV Dl_info info; void **frame = static_cast(__builtin_frame_address(0)); void **bp = static_cast(*frame); void *ip = frame[1]; bool has_limit = limit != 0; dbg::stack::depth_type skip = 0; while(bp && ip && dladdr(ip, &info)) { if (skip < 1) ++skip; else { if (has_limit && limit-- == 0) break; frames.push_back(dbg::stack_frame(ip, demangle(info.dli_sname) + " in " + info.dli_fname)); if(info.dli_sname && !std::strcmp(info.dli_sname, "main")) break; } ip = bp[1]; bp = static_cast(bp[0]); } } #elif defined(__ppc__) void fill_frames(std::list &frames, dbg::stack::depth_type limit) { // Based on code found at: // http://www.informit.com/articles/article.aspx?p=606582&seqNum=4&rl=1 void *ip = __builtin_return_address(0); void **frame = static_cast(__builtin_frame_address(1)); bool has_limit = limit != 0; Dl_info info; do { if (has_limit && limit-- == 0) break; if (dladdr(ip, &info)) frames.push_back(dbg::stack_frame(ip, demangle(info.dli_sname) + " in " + info.dli_fname)); if (frame && (frame = static_cast(*frame))) ip = *(frame + 2); } while (frame && ip); } #else // GNU, but neither x86 or PPC //#error "Sorry but dbg::stack is not supported on this architecture" void fill_frames(std::list &, dbg::stack::depth_type ) { } #endif #else // Unsupported compiler //#error "Sorry but dbg::stack is not supported on this compiler" void fill_frames(std::list &, dbg::stack::depth_type ) { } #endif } namespace dbg { stack_error::stack_error(const std::string &what) : what_(what) { } stack_error::~stack_error() throw() { } const char *stack_error::what() const throw() { return what_.c_str(); } stack_frame::stack_frame(const void *instruction, const std::string &function) : instruction_(instruction), function_(function) { } const void *stack_frame::instruction() const { return instruction_; } const std::string &stack_frame::function() const { return function_; } std::ostream &operator<< (std::ostream &out, const stack_frame &frame) { return out << frame.instruction() << ": " << frame.function(); } #if defined(_WIN32) stack::stack(depth_type limit, CONTEXT* fromContext) { fill_frames(frames_, limit, fromContext); } #endif stack::stack(depth_type limit) { fill_frames(frames_, limit); } stack::const_iterator stack::begin() const { return frames_.begin(); } stack::const_iterator stack::end() const { return frames_.end(); } stack::depth_type stack::depth() const { return frames_.size(); } } // close namespace dbg wxformbuilder-3.1.59/src/codegen/codegen.h0000644000175000017500000001565511143440027020734 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// /** @file @author José Antonio Hurtado - joseantonio.hurtado@gmail.com @author Juan Antonio Ortega - jortegalalmolda@gmail.com */ #ifndef __CODEGEN__ #define __CODEGEN__ #include #include #include "utils/wxfbdefs.h" #include "model/types.h" /** * Template notes * * The preprocessor macros begin with the character '#'. * Example: #wxparent $name * * The object properties begin with the character '$'. * Example: $name * * The creation of a local variable begins with the character '%' * Example: int %var = $style; * * The '@' character is used to escape the special characters to treat them as text * Example: @# @$ @@ @% * */ /** * Preprocessor directives: * * - #wxparent $property * Used to get the property of the parent of the current object. * This directive is necessary to generate the parameter "wxWindow* parent" in the constructors of each widget. * Example: * $name = new wxButton( #wxparent $name, .... * * - #wxchild $property * Used to get a property of the first child of the current object. * Used by "sizeritem" in order to add a sizer object. * * - #ifnotnull $property @{ .... @} * Used to generate code as long as the property is not null * * - #foreach $property @{ ..... @} * Used to repeat code for each subproperty of $property, where $property is a comma delimited list. * The code is contained between '@{' and '@}'. The code will be generated as many times as there are subexpressions * in the value of the property. Within the brace, access to the subexpression is obtained with the #pred directive, and * access to index of the subexpression is obtained with #npred. * Example: * #foreach $growable_cols * @{ * $name->AddGrowableCol(#pred); * @} * * - #pred (see #foreach) * - #npred (see #foreach) * */ /** * Template Parser */ class TemplateParser { private: PObjectBase m_obj; wxStringInputStream m_in; wxString m_out; wxString m_pred; wxString m_npred; void ignore_whitespaces(); protected: typedef enum { TOK_ERROR, TOK_MACRO, TOK_TEXT, TOK_PROPERTY } Token; typedef enum { ID_ERROR, ID_WXPARENT, ID_PARENT, ID_FORM, ID_CHILD, ID_IFNOTNULL, ID_IFNULL, ID_FOREACH, ID_PREDEFINED, // predefined symbol '#pred' ID_PREDEFINED_INDEX, // #npred ID_NEWLINE, ID_IFEQUAL, ID_IFNOTEQUAL, ID_IFPARENTTYPEEQUAL, ID_APPEND, ID_CLASS } Ident; Ident SearchIdent(wxString ident); Ident ParseIdent(); wxString ParsePropertyName( wxString* child = NULL ); /** * This routine extracts the source code from a template enclosed between * the #begin and #end macros, having in mind that they can be nested */ wxString ExtractInnerTemplate(); /** * A literal value is an string enclosed between '"' (e.g. "xxx"), * The " character is represented with "". */ wxString ExtractLiteral(); /** * Look up for the following symbol from input and returns the token. * @return TOK_MACRO when it's followed by a command. * TOK_PROPERTY when it's followed by a property. * TOK_TEXT when it's followed by normal text. */ Token GetNextToken(); bool ParseInnerTemplate(); bool ParseWxParent(); bool ParseParent(); bool ParseForm(); bool ParseChild(); bool ParseForEach(); bool ParseIfNotNull(); bool ParseIfNull(); bool ParseNewLine(); bool ParseIfEqual(); bool ParseIfNotEqual(); bool ParseIfParentTypeEqual(); void ParseAppend(); void ParseClass(); PProperty GetProperty( wxString* childName = NULL ); PObjectBase GetWxParent(); PProperty GetRelatedProperty( PObjectBase relative ); /** * Parse a macro. */ bool ParseMacro(); /** * Parse a property. */ bool ParseProperty(); /** * Parse text. */ bool ParseText(); bool ParsePred(); bool ParseNPred(); public: TemplateParser( PObjectBase obj, wxString _template); TemplateParser( const TemplateParser & that, wxString _template ); /** * Returns the code for a property value in the language format. * @note use ValueToCode */ wxString PropertyToCode( PProperty property ); /** * This method creates a new parser with the same type that the object * calling such method. */ virtual PTemplateParser CreateParser( const TemplateParser* oldparser, wxString _template ) = 0; virtual ~TemplateParser() {}; /** * Returns the code for a "wxWindow *parent" root attribute' name. * In C++ it will be the "this" pointer, but in other languages it * could be named differently. */ virtual wxString RootWxParentToCode() = 0; /** * Generates the code from a property value. */ virtual wxString ValueToCode(PropertyType type, wxString value) = 0; /** * The "star" function for this class. Analyzes a template, returning the code. */ wxString ParseTemplate(); /** * Set the string for the #pred and #npred macros */ void SetPredefined( wxString pred, wxString npred ) { m_pred = pred; m_npred = npred; }; }; /** * Code Generator * * This class defines an interface to execute the code generation. * The algorithms to generate the code are similar from one language to another. * Examples: * * - In C++, we generate the class declarations and then its implementation, * besides the related #define and #include. * - In java, it has a similar syntax, but declaration and implementation are * together in the same file, and it's required one file per class. * - In XRC format (XML), it's a different way, it's more likely to the * data model from the application itself. * * Given that doesn't exist an "universal" algorithm for generating code, there * is no choice but to make a different implementation for each language. It's * possible to reuse the whole code templates system, although, simplifying a lot * the implementation task for a new language. */ class CodeGenerator { protected: public: /** * Virtual destructor. */ virtual ~CodeGenerator() {}; /** * Generate the code of the project */ virtual bool GenerateCode( PObjectBase project ) = 0; }; #endif //__CODEGEN__ wxformbuilder-3.1.59/src/codegen/codewriter.cpp0000644000175000017500000001230511143440027022017 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #include "codewriter.h" #include "md5/md5.hh" #include "utils/wxfbexception.h" #include "utils/typeconv.h" #include #include #include #include #include CodeWriter::CodeWriter() : m_indent( 0 ), m_cols( 0 ) { } CodeWriter::~CodeWriter() { } int CodeWriter::GetIndentSize() { return 1; } void CodeWriter::Indent() { m_indent += GetIndentSize(); } void CodeWriter::Unindent() { m_indent -= GetIndentSize(); if ( m_indent < 0 ) { m_indent = 0; } } void CodeWriter::WriteLn( wxString code ) { // It will not be allowed newlines (carry return) inside "code" // If there was anyone, then FixWrite gets the string and breaks it // in different lines, inserting them one after another using WriteLn if ( !StringOk( code ) ) { FixWrite( code ); } else { Write( code ); #if defined( __WXMSW__ ) Write( wxT("\r\n") ); #elif defined( __WXMAC__ ) Write( wxT("\r") ); #else Write( wxT("\n") ); #endif m_cols = 0; } } bool CodeWriter::StringOk( wxString s ) { return ( s.find( wxT("\n"), 0 ) == wxString::npos ); } void CodeWriter::FixWrite( wxString s ) { wxStringTokenizer tkz( s, wxT("\n"), wxTOKEN_RET_EMPTY_ALL ); while ( tkz.HasMoreTokens() ) { wxString line = tkz.GetNextToken(); line.Trim( false ); line.Trim( true ); WriteLn( line ); } } void CodeWriter::Write( wxString code ) { if ( m_cols == 0 ) { // Inserting indents for ( int i = 0; i < m_indent; i++ ) { DoWrite( wxT("\t") ); } m_cols = m_indent; } DoWrite( code ); } TCCodeWriter::TCCodeWriter() : m_tc( 0 ) { } TCCodeWriter::TCCodeWriter( wxScintilla* tc ) { SetTextCtrl( tc ); } void TCCodeWriter::SetTextCtrl( wxScintilla* tc ) { m_tc = tc; } void TCCodeWriter::DoWrite( wxString code ) { if ( m_tc ) m_tc->AddText( code ); } void TCCodeWriter::Clear() { if ( m_tc ) m_tc->ClearAll(); //*!* } StringCodeWriter::StringCodeWriter() { } void StringCodeWriter::DoWrite( wxString code ) { m_buffer += code; } void StringCodeWriter::Clear() { m_buffer.clear(); } wxString StringCodeWriter::GetString() { return m_buffer; } FileCodeWriter::FileCodeWriter( const wxString &file, bool useMicrosoftBOM, bool useUtf8 ) : m_filename( file ), m_useMicrosoftBOM( useMicrosoftBOM ), m_useUtf8( useUtf8 ) { Clear(); } FileCodeWriter::~FileCodeWriter() { WriteBuffer(); } void FileCodeWriter::WriteBuffer() { #ifdef __WXMSW__ unsigned char microsoftBOM[3] = { 0xEF, 0xBB, 0xBF }; #endif // Compare buffer with existing file (if any) to determine if // writing the file is necessary bool shouldWrite = true; std::ifstream file( m_filename.mb_str( wxConvFile ), std::ios::binary | std::ios::in ); std::string buf; if ( file ) { MD5 diskHash( file ); unsigned char* diskDigest = diskHash.raw_digest(); MD5 bufferHash; #ifdef __WXMSW__ if ( m_useMicrosoftBOM ) { bufferHash.update( microsoftBOM, 3 ); } #endif const std::string& data = m_useUtf8 ? _STDSTR( m_buffer ) : _ANSISTR( m_buffer ); if (!m_useUtf8) buf = data; bufferHash.update( reinterpret_cast< const unsigned char* >( data.c_str() ), data.size() ); bufferHash.finalize(); unsigned char* bufferDigest = bufferHash.raw_digest(); shouldWrite = ( 0 != std::memcmp( diskDigest, bufferDigest, 16 ) ); delete [] diskDigest; delete [] bufferDigest; } if ( shouldWrite ) { wxFile file; if ( !file.Create( m_filename, true ) ) { wxLogError( _("Unable to create file: %s"), m_filename.c_str() ); return; } #ifdef __WXMSW__ if ( m_useMicrosoftBOM ) { file.Write( microsoftBOM, 3 ); } #endif if (!m_useUtf8) file.Write( buf.c_str(), buf.length() ); else file.Write( m_buffer ); } } void FileCodeWriter::Clear() { StringCodeWriter::Clear(); if ( ::wxFileExists( m_filename ) ) { // check for write access to the target file if ( !wxFile::Access( m_filename, wxFile::write ) ) { THROW_WXFBEX( _("Unable to write file: ") << m_filename ); } } else { wxFile file; if ( !file.Create( m_filename, true ) ) { THROW_WXFBEX( _("Unable to create file: ") << m_filename ); } } } wxformbuilder-3.1.59/src/codegen/cppcg.cpp0000644000175000017500000015226311143440027020754 0ustar rrmulderrrmulder//////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #include "cppcg.h" #include "codewriter.h" #include "utils/typeconv.h" #include "utils/debug.h" #include "rad/appdata.h" #include "model/objectbase.h" #include "model/database.h" #include "utils/wxfbexception.h" #include #include #include #include CppTemplateParser::CppTemplateParser( PObjectBase obj, wxString _template, bool useI18N, bool useRelativePath, wxString basePath ) : TemplateParser(obj,_template), m_i18n( useI18N ), m_useRelativePath( useRelativePath ), m_basePath( basePath ) { if ( !wxFileName::DirExists( m_basePath ) ) { m_basePath.clear(); } } CppTemplateParser::CppTemplateParser( const CppTemplateParser & that, wxString _template ) : TemplateParser( that, _template ), m_i18n( that.m_i18n ), m_useRelativePath( that.m_useRelativePath ), m_basePath( that.m_basePath ) { } wxString CppTemplateParser::RootWxParentToCode() { return wxT("this"); } PTemplateParser CppTemplateParser::CreateParser( const TemplateParser* oldparser, wxString _template ) { const CppTemplateParser* cppOldParser = dynamic_cast< const CppTemplateParser* >( oldparser ); if ( cppOldParser != NULL ) { PTemplateParser newparser( new CppTemplateParser( *cppOldParser, _template ) ); return newparser; } return PTemplateParser(); } /** * Convert the value of the property to C++ code */ wxString CppTemplateParser::ValueToCode( PropertyType type, wxString value ) { wxString result; switch ( type ) { case PT_WXSTRING: { if ( value.empty() ) { result << wxT("wxEmptyString"); } else { result << wxT("wxT(\"") << CppCodeGenerator::ConvertCppString( value ) << wxT("\")"); } break; } case PT_WXSTRING_I18N: { if ( value.empty() ) { result << wxT("wxEmptyString"); } else { if ( m_i18n ) { result << wxT("_(\"") << CppCodeGenerator::ConvertCppString(value) << wxT("\")"); } else { result << wxT("wxT(\"") << CppCodeGenerator::ConvertCppString(value) << wxT("\")"); } } break; } case PT_MACRO: case PT_TEXT: case PT_OPTION: case PT_FLOAT: case PT_INT: case PT_UINT: { result = value; break; } case PT_BITLIST: { result = ( value.empty() ? wxT("0") : value ); break; } case PT_WXPOINT: { if ( value.empty() ) { result = wxT("wxDefaultPosition"); } else { result << wxT("wxPoint( ") << value << wxT(" )"); } break; } case PT_WXSIZE: { if ( value.empty() ) { result = wxT("wxDefaultSize"); } else { result << wxT("wxSize( ") << value << wxT(" )"); } break; } case PT_BOOL: { result = ( value == wxT("0") ? wxT("false") : wxT("true") ); break; } case PT_WXFONT: { if ( !value.empty() ) { wxFontContainer font = TypeConv::StringToFont( value ); int pointSize = font.GetPointSize(); wxString size = pointSize <= 0 ? wxT("wxNORMAL_FONT->GetPointSize()") : wxString::Format( wxT("%i"), pointSize ).c_str(); result = wxString::Format( wxT("wxFont( %s, %i, %i, %i, %s, %s )" ), size.c_str(), font.GetFamily(), font.GetStyle(), font.GetWeight(), ( font.GetUnderlined() ? wxT("true") : wxT("false") ), ( font.m_faceName.empty() ? wxT("wxEmptyString") : wxString::Format( wxT("wxT(\"%s\")"), font.m_faceName.c_str() ).c_str() ) ); } else { result = wxT("*wxNORMAL_FONT"); } break; } case PT_WXCOLOUR: { if ( !value.empty() ) { if ( value.find_first_of( wxT("wx") ) == 0 ) { // System Colour result << wxT("wxSystemSettings::GetColour( ") << value << wxT(" )"); } else { wxColour colour = TypeConv::StringToColour( value ); result = wxString::Format( wxT("wxColour( %i, %i, %i )"), colour.Red(), colour.Green(), colour.Blue() ); } } else { result = wxT("wxColour()"); } break; } case PT_BITMAP: { wxString path; wxString source; wxSize icoSize; TypeConv::ParseBitmapWithResource( value, &path, &source, &icoSize ); if ( path.empty() ) { // Empty path, generate Null Bitmap result = wxT("wxNullBitmap"); break; } if ( path.StartsWith( wxT("file:") ) ) { wxLogWarning( wxT("C++ code generation does not support using URLs for bitmap properties:\n%s"), path.c_str() ); result = wxT("wxNullBitmap"); break; } if ( source == wxT("Load From File") ) { wxString absPath; try { absPath = TypeConv::MakeAbsolutePath( path, AppData()->GetProjectPath() ); } catch( wxFBException& ex ) { wxLogError( ex.what() ); result = wxT( "wxNullBitmap" ); break; } wxString file = ( m_useRelativePath ? TypeConv::MakeRelativePath( absPath, m_basePath ) : absPath ); wxFileName bmpFileName( path ); if ( bmpFileName.GetExt().Upper() == wxT("XPM") ) { // If the bitmap is an XPM we will embed it in the code, otherwise it will be loaded from the file at run time. result << wxT("wxBitmap( ") << CppCodeGenerator::ConvertXpmName( path ) << wxT(" )"); } else { result << wxT("wxBitmap( wxT(\"") << CppCodeGenerator::ConvertCppString( file ) << wxT("\"), wxBITMAP_TYPE_ANY )"); } } else if ( source == wxT("Load From Resource") ) { result << wxT("wxBitmap( wxT(\"") << path << wxT("\"), wxBITMAP_TYPE_RESOURCE )"); } else if ( source == wxT("Load From Icon Resource") ) { if ( wxDefaultSize == icoSize ) { result << wxT("wxICON( ") << path << wxT(" )"); } else { result.Printf( wxT("wxIcon( wxT(\"%s\"), wxBITMAP_TYPE_ICO_RESOURCE, %i, %i )"), path.c_str(), icoSize.GetWidth(), icoSize.GetHeight() ); } } break; } case PT_STRINGLIST: { // Stringlists are generated like a sequence of wxString separated by ', '. wxArrayString array = TypeConv::StringToArrayString( value ); if ( array.Count() > 0 ) { result = ValueToCode( PT_WXSTRING_I18N, array[0] ); } for ( size_t i = 1; i < array.Count(); i++ ) { result << wxT(", ") << ValueToCode( PT_WXSTRING_I18N, array[i] ); } break; } default: break; } return result; } /////////////////////////////////////////////////////////////////////////////// CppCodeGenerator::CppCodeGenerator() { SetupPredefinedMacros(); m_useRelativePath = false; m_i18n = false; m_firstID = 1000; } wxString CppCodeGenerator::ConvertCppString( wxString text ) { wxString result; for ( size_t i = 0; i < text.length(); i++ ) { wxChar c = text[i]; switch ( c ) { case wxT('"'): result += wxT("\\\""); break; case wxT('\\'): result += wxT("\\\\"); break; case wxT('\t'): result += wxT("\\t"); break; case wxT('\n'): result += wxT("\\n"); break; case wxT('\r'): result += wxT("\\r"); break; default: result += c; break; } } return result; } wxString CppCodeGenerator::ConvertXpmName( const wxString& text ) { wxString name = text; // the name consists of extracting the name of the file (without the directory) // and replacing the character '.' by ' _ '. size_t last_slash = name.find_last_of( wxT("\\/") ); if ( last_slash != name.npos ) { name = name.substr( last_slash + 1 ); } name.replace( name.rfind( wxT(".") ), 1, wxT("_") ); return name; } void CppCodeGenerator::GenerateInheritedClass( PObjectBase userClasses, PObjectBase form ) { if (!userClasses) { wxLogError(wxT("There is no object to generate inherited class")); return; } if ( wxT("UserClasses") != userClasses->GetClassName() ) { wxLogError(wxT("This not a UserClasses object")); return; } wxString type = userClasses->GetPropertyAsString( wxT("type") ); // Start header file wxString code = GetCode( userClasses, wxT("guard_macro_open") ); m_header->WriteLn( code ); m_header->WriteLn( wxEmptyString ); code = GetCode( userClasses, wxT("header_comment") ); m_header->WriteLn( code ); m_header->WriteLn( wxEmptyString ); code = GetCode( userClasses, wxT("header_include") ); m_header->WriteLn( code ); m_header->WriteLn( wxEmptyString ); code = GetCode( userClasses, wxT("class_decl") ); m_header->WriteLn( code ); m_header->WriteLn( wxT("{") ); // Start source file code = GetCode( userClasses, wxT("source_include") ); m_source->WriteLn( code ); m_source->WriteLn( wxEmptyString ); code = GetCode( userClasses, type + wxT("_cons_def") ); m_source->WriteLn( code ); m_source->WriteLn( wxT("{") ); m_source->WriteLn( wxEmptyString ); m_source->WriteLn( wxT("}") ); // Do events in both files EventVector events; FindEventHandlers( form, events ); if ( events.size() > 0 ) { m_header->WriteLn( wxT("protected:") ); m_header->Indent(); code = GetCode( userClasses, wxT("event_handler_comment") ); m_header->WriteLn( code ); wxString className = userClasses->GetPropertyAsString( _("name") ); std::set generatedHandlers; for ( size_t i = 0; i < events.size(); i++ ) { PEvent event = events[i]; wxString prototype; if ( generatedHandlers.find( event->GetValue() ) == generatedHandlers.end() ) { prototype = wxString::Format( wxT("%s( %s& event )"), event->GetValue().c_str(), event->GetEventInfo()->GetEventClassName().c_str() ); m_header->WriteLn( wxString::Format( wxT("void %s;"), prototype.c_str() ) ); m_source->WriteLn(); m_source->WriteLn( wxString::Format( wxT("void %s::%s"), className.c_str(), prototype.c_str() ) ); m_source->WriteLn( wxT("{") ); m_source->Indent(); m_source->WriteLn( wxString::Format( wxT("// TODO: Implement %s"), event->GetValue().c_str() ) ); m_source->Unindent(); m_source->WriteLn( wxT("}") ); generatedHandlers.insert(event->GetValue()); } } m_header->WriteLn( wxEmptyString ); m_header->Unindent(); } // Finish header file m_header->WriteLn( wxT("public:") ); m_header->Indent(); code = GetCode( userClasses, type + wxT("_cons_decl") ); m_header->WriteLn( code ); m_header->Unindent(); m_header->WriteLn( wxT("};") ); m_header->WriteLn( wxEmptyString ); code = GetCode( userClasses, wxT("guard_macro_close") ); m_header->WriteLn( code ); } bool CppCodeGenerator::GenerateCode( PObjectBase project ) { if (!project) { wxLogError(wxT("There is no project to generate code")); return false; } bool useEnum = false; PProperty useEnumProperty = project->GetProperty( wxT("use_enum") ); if (useEnumProperty && useEnumProperty->GetValueAsInteger()) useEnum = true; m_i18n = false; PProperty i18nProperty = project->GetProperty( wxT("internationalize") ); if (i18nProperty && i18nProperty->GetValueAsInteger()) m_i18n = true; m_useConnect = !( _("table") == project->GetPropertyAsString( _("event_generation") ) ); m_disconnectEvents = ( project->GetPropertyAsInteger( _("disconnect_events") ) != 0 ); m_header->Clear(); m_source->Clear(); wxString code ( wxT("///////////////////////////////////////////////////////////////////////////\n") wxT("// C++ code generated with wxFormBuilder (version ") wxT(__DATE__) wxT(")\n") wxT("// http://www.wxformbuilder.org/\n") wxT("//\n") wxT("// PLEASE DO \"NOT\" EDIT THIS FILE!\n") wxT("///////////////////////////////////////////////////////////////////////////\n") ); m_header->WriteLn( code ); m_source->WriteLn( code ); PProperty propFile = project->GetProperty( wxT("file") ); if (!propFile) { wxLogError( wxT("Missing \"file\" property on Project Object") ); return false; } wxString file = propFile->GetValue(); if ( file.empty() ) { file = wxT("noname"); } wxString guardMacro; wxFileName::SplitPath( file, 0, &guardMacro, 0 ); guardMacro.Replace( wxT(" "), wxT("_") ); m_header->WriteLn( wxT("#ifndef __") + guardMacro + wxT("__") ); m_header->WriteLn( wxT("#define __") + guardMacro + wxT("__") ); m_header->WriteLn( wxT("") ); code = GetCode( project, wxT("header_preamble") ); if ( !code.empty() ) { m_header->WriteLn( code ); } // Generate the subclass sets std::set< wxString > subclasses; std::set< wxString > subclassSourceIncludes; std::vector< wxString > headerIncludes; GenSubclassSets( project, &subclasses, &subclassSourceIncludes, &headerIncludes ); // Write the forward declaration lines std::set< wxString >::iterator subclass_it; for ( subclass_it = subclasses.begin(); subclass_it != subclasses.end(); ++subclass_it ) { m_header->WriteLn( *subclass_it ); } if ( !subclasses.empty() ) { m_header->WriteLn( wxT("") ); } // Generating in the .h header file those include from components dependencies. std::set< wxString > templates; GenIncludes(project, &headerIncludes, &templates ); // Write the include lines std::vector::iterator include_it; for ( include_it = headerIncludes.begin(); include_it != headerIncludes.end(); ++include_it ) { m_header->WriteLn( *include_it ); } if ( !headerIncludes.empty() ) { m_header->WriteLn( wxT("") ); } // class decoration PProperty propClassDecoration = project->GetProperty( wxT("class_decoration") ); wxString classDecoration; if ( propClassDecoration ) { // get the decoration to be used by GenClassDeclaration std::map< wxString, wxString > children; propClassDecoration->SplitParentProperty( &children ); std::map< wxString, wxString >::iterator decoration; decoration = children.find( wxT("decoration") ); if ( decoration != children.end() ) { classDecoration = decoration->second; if ( !classDecoration.empty() ) { classDecoration += wxT( " " ); } } // Now get the header std::map< wxString, wxString >::iterator header; header = children.find( wxT("header") ); if ( header != children.end() ) { wxString headerVal = header->second; if ( !headerVal.empty() ) { wxString include = wxT("#include \"") + headerVal + wxT("\""); std::vector< wxString >::iterator findInclude = std::find( headerIncludes.begin(), headerIncludes.end(), include ); if ( findInclude == headerIncludes.end() ) { m_header->WriteLn( include ); m_header->WriteLn( wxEmptyString ); } } } } code = GetCode( project, wxT("header_epilogue") ); m_header->WriteLn( code ); m_header->WriteLn( wxEmptyString ); // Inserting in the .cpp source file the include corresponding to the // generated .h header file and the related xpm includes code = GetCode( project, wxT("cpp_preamble") ); if ( !code.empty() ) { m_source->WriteLn( code ); m_source->WriteLn( wxEmptyString ); } // Write include lines for subclasses for ( subclass_it = subclassSourceIncludes.begin(); subclass_it != subclassSourceIncludes.end(); ++subclass_it ) { m_source->WriteLn( *subclass_it ); } if ( !subclassSourceIncludes.empty() ) { m_source->WriteLn( wxEmptyString ); } // Generated header m_source->WriteLn( wxT("#include \"") + file + wxT(".h\"")); m_source->WriteLn( wxEmptyString ); GenXpmIncludes( project ); code = GetCode( project, wxT("cpp_epilogue") ); m_source->WriteLn( code ); // namespace PProperty propNamespace = project->GetProperty( wxT("namespace") ); wxArrayString namespaceArray; if ( propNamespace ) { namespaceArray = propNamespace->GetValueAsArrayString(); wxString usingNamespaceStr; for ( unsigned int i = 0; i < namespaceArray.Count(); ++i ) { m_header->WriteLn( wxT("namespace ") + namespaceArray[i] ); m_header->WriteLn( wxT("{") ); m_header->Indent(); if ( usingNamespaceStr.empty() ) { usingNamespaceStr = wxT("using namespace "); } else { usingNamespaceStr += wxT("::"); } usingNamespaceStr += namespaceArray[i]; } if ( namespaceArray.Count() && !usingNamespaceStr.empty() ) { usingNamespaceStr += wxT(";"); m_source->WriteLn( usingNamespaceStr ); } } // Generating "defines" for macros if ( !useEnum ) { GenDefines( project ); } wxString eventHandlerKind; wxString eventHandlerPrefix; wxString eventHandlerPostfix; PProperty eventHandlerKindProp = project->GetProperty( wxT("event_handler") ); if ( eventHandlerKindProp ) { eventHandlerKind = eventHandlerKindProp->GetValueAsString(); } if (0 == eventHandlerKind.compare( wxT("decl_pure_virtual") ) ) { eventHandlerPrefix = wxT("virtual "); eventHandlerPostfix = wxT(" = 0;"); } else if ( 0 == eventHandlerKind.compare( wxT("decl_virtual") ) ) { eventHandlerPrefix = wxT("virtual "); eventHandlerPostfix = wxT(";"); } else if ( 0 == eventHandlerKind.compare( wxT("decl") ) ) { eventHandlerPrefix = wxT(""); eventHandlerPostfix = wxT(";"); } else // Default: impl_virtual { eventHandlerPrefix = wxT("virtual "); eventHandlerPostfix = wxT(" { event.Skip(); }"); } for ( unsigned int i = 0; i < project->GetChildCount(); i++ ) { PObjectBase child = project->GetChild( i ); EventVector events; FindEventHandlers( child, events ); GenClassDeclaration( child, useEnum, classDecoration, events, eventHandlerPrefix, eventHandlerPostfix ); if ( !m_useConnect ) { GenEvents( child, events ); } GenConstructor( child, events ); GenDestructor( child, events ); } // namespace if ( namespaceArray.Count() > 0 ) { for ( size_t i = namespaceArray.Count(); i > 0; --i ) { m_header->Unindent(); m_header->WriteLn( wxT("} // namespace ") + namespaceArray[ i - 1 ] ); } m_header->WriteLn( wxEmptyString ); } m_header->WriteLn( wxT("#endif //__") + guardMacro + wxT("__") ); return true; } void CppCodeGenerator::GenEvents( PObjectBase class_obj, const EventVector &events, bool disconnect ) { if ( events.empty() ) { return; } PProperty propName = class_obj->GetProperty( wxT("name") ); if ( !propName ) { wxLogError(wxT("Missing \"name\" property on \"%s\" class. Review your XML object description"), class_obj->GetClassName().c_str()); return; } wxString class_name = propName->GetValue(); if ( class_name.empty() ) { wxLogError( wxT("Object name cannot be null") ); return; } wxString base_class; PProperty propSubclass = class_obj->GetProperty( wxT("subclass") ); if ( propSubclass ) { wxString subclass = propSubclass->GetChildFromParent( wxT("name") ); if ( !subclass.empty() ) { base_class = subclass; } } if ( base_class.empty() ) base_class = wxT("wx") + class_obj->GetClassName(); if ( events.size() > 0 ) { if ( !m_useConnect ) { m_source->WriteLn(); m_source->WriteLn( wxT("BEGIN_EVENT_TABLE( ") + class_name + wxT(", ") + base_class + wxT(" )") ); m_source->Indent(); } for ( size_t i = 0; i < events.size(); i++ ) { PEvent event = events[i]; wxString handlerName; if ( m_useConnect ) { handlerName.Printf( wxT("%sHandler( %s::%s )"), event->GetEventInfo()->GetEventClassName().c_str(), class_name.c_str(), event->GetValue().c_str() ); } else { handlerName.Printf( wxT("%s::_wxFB_%s"), class_name.c_str(), event->GetValue().c_str() ); } wxString templateName = wxString::Format( wxT("%s_%s"), m_useConnect ? wxT("connect") : wxT("entry"), event->GetName().c_str() ); PObjectBase obj = event->GetObject(); if ( !GenEventEntry( obj, obj->GetObjectInfo(), templateName, handlerName, disconnect ) ) { wxLogError( wxT("Missing \"evt_%s\" template for \"%s\" class. Review your XML object description"), templateName.c_str(), class_name.c_str() ); } } if ( !m_useConnect ) { m_source->Unindent(); m_source->WriteLn( wxT("END_EVENT_TABLE()") ); } } } bool CppCodeGenerator::GenEventEntry( PObjectBase obj, PObjectInfo obj_info, const wxString& templateName, const wxString& handlerName, bool disconnect ) { wxString _template; PCodeInfo code_info = obj_info->GetCodeInfo( wxT("C++") ); if ( code_info ) { _template = code_info->GetTemplate( wxString::Format( wxT("evt_%s%s"), disconnect ? wxT("dis") : wxT(""), templateName.c_str() ) ); if ( disconnect && _template.empty() ) { _template = code_info->GetTemplate( wxT("evt_") + templateName ); _template.Replace( wxT("Connect"), wxT("Disconnect"), true ); } if ( !_template.empty() ) { _template.Replace( wxT("#handler"), handlerName.c_str() ); // Ugly patch! CppTemplateParser parser( obj, _template, m_i18n, m_useRelativePath, m_basePath ); m_source->WriteLn( parser.ParseTemplate() ); return true; } } for ( unsigned int i = 0; i < obj_info->GetBaseClassCount(); i++ ) { PObjectInfo base_info = obj_info->GetBaseClass( i ); if ( GenEventEntry( obj, base_info, templateName, handlerName, disconnect ) ) { return true; } } return false; } void CppCodeGenerator::GenPrivateEventHandlers( const EventVector& events ) { if ( events.size() > 0 ) { m_header->WriteLn( wxEmptyString ); m_header->WriteLn( wxT("// Private event handlers") ); std::set generatedHandlers; for ( size_t i = 0; i < events.size(); i++ ) { PEvent event = events[i]; wxString aux; if (generatedHandlers.find(event->GetValue()) == generatedHandlers.end()) { aux = wxT("void _wxFB_") + event->GetValue() + wxT("( ") + event->GetEventInfo()->GetEventClassName() + wxT("& event ){ ") + event->GetValue() + wxT("( event ); }"); m_header->WriteLn( aux ); generatedHandlers.insert(event->GetValue()); } } m_header->WriteLn( wxEmptyString ); } } void CppCodeGenerator::GenVirtualEventHandlers( const EventVector& events, const wxString& eventHandlerPrefix, const wxString& eventHandlerPostfix ) { if ( events.size() > 0 ) { // There are problems if we create "pure" virtual handlers, because some // events could be triggered in the constructor in which virtual methods are // execute properly. // So we create a default handler which will skip the event. m_header->WriteLn( wxEmptyString ); m_header->WriteLn( wxT("// Virtual event handlers, overide them in your derived class") ); std::set generatedHandlers; for ( size_t i = 0; i < events.size(); i++ ) { PEvent event = events[i]; wxString aux = eventHandlerPrefix + wxT("void ") + event->GetValue() + wxT("( ") + event->GetEventInfo()->GetEventClassName() + wxT("& event )") + eventHandlerPostfix; if (generatedHandlers.find(aux) == generatedHandlers.end()) { m_header->WriteLn(aux); generatedHandlers.insert(aux); } } m_header->WriteLn( wxEmptyString ); } } void CppCodeGenerator::GenAttributeDeclaration(PObjectBase obj, Permission perm) { wxString typeName = obj->GetObjectTypeName(); if ( ObjectDatabase::HasCppProperties( typeName ) ) { wxString perm_str = obj->GetProperty( wxT("permission") )->GetValue(); if ((perm == P_PUBLIC && perm_str == wxT("public") ) || (perm == P_PROTECTED && perm_str == wxT("protected") ) || (perm == P_PRIVATE && perm_str == wxT("private") ) ) { // Generate the declaration wxString code = GetCode( obj, wxT("declaration") ); m_header->WriteLn(code); } } // Generate recursively the rest of the attributes for (unsigned int i = 0; i < obj->GetChildCount() ; i++) { PObjectBase child = obj->GetChild(i); GenAttributeDeclaration(child,perm); } } void CppCodeGenerator::GenValidatorVariables( PObjectBase obj) { GenValVarsBase(obj->GetObjectInfo(), obj); // Proceeding recursively with the children for (unsigned int i = 0; i < obj->GetChildCount() ; i++) { PObjectBase child = obj->GetChild(i); GenValidatorVariables(child); } } void CppCodeGenerator::GenValVarsBase( PObjectInfo info, PObjectBase obj) { wxString _template; PCodeInfo code_info = info->GetCodeInfo( wxT("C++") ); if ( !code_info ) { return; } _template = code_info->GetTemplate( wxT("valvar_declaration") ); if ( !_template.empty() ) { CppTemplateParser parser( obj, _template, m_i18n, m_useRelativePath, m_basePath ); wxString code = parser.ParseTemplate(); if ( !code.empty() ) { m_header->WriteLn(code); } } // Proceeding recursively with the base classes for (unsigned int i=0; i< info->GetBaseClassCount(); i++) { PObjectInfo base_info = info->GetBaseClass(i); GenValVarsBase(base_info, obj); } } void CppCodeGenerator::GetGenEventHandlers( PObjectBase obj ) { PCodeInfo code_info = obj->GetObjectInfo()->GetCodeInfo( wxT("C++") ); if ( code_info ) { wxString _template = code_info->GetTemplate( wxT("generated_event_handlers") ); if ( !_template.empty() ) { CppTemplateParser parser( obj, _template, m_i18n, m_useRelativePath, m_basePath ); wxString code = parser.ParseTemplate(); if ( !code.empty() ) { m_header->WriteLn(code); } } } for (unsigned int i = 0; i < obj->GetChildCount() ; i++) { PObjectBase child = obj->GetChild(i); GetGenEventHandlers(child); } } wxString CppCodeGenerator::GetCode(PObjectBase obj, wxString name) { wxString _template; PCodeInfo code_info = obj->GetObjectInfo()->GetCodeInfo( wxT("C++") ); if (!code_info) { wxString msg( wxString::Format( wxT("Missing \"%s\" template for \"%s\" class. Review your XML object description"), name.c_str(), obj->GetClassName().c_str() ) ); wxLogError(msg); return wxT(""); } _template = code_info->GetTemplate(name); CppTemplateParser parser( obj, _template, m_i18n, m_useRelativePath, m_basePath ); wxString code = parser.ParseTemplate(); return code; } void CppCodeGenerator::GenClassDeclaration(PObjectBase class_obj, bool use_enum, const wxString& classDecoration, const EventVector &events, const wxString& eventHandlerPrefix, const wxString& eventHandlerPostfix) { PProperty propName = class_obj->GetProperty( wxT("name") ); if ( !propName ) { wxLogError(wxT("Missing \"name\" property on \"%s\" class. Review your XML object description"), class_obj->GetClassName().c_str()); return; } wxString class_name = propName->GetValue(); if ( class_name.empty() ) { wxLogError( wxT("Object name can not be null") ); return; } m_header->WriteLn( wxT("///////////////////////////////////////////////////////////////////////////////") ); m_header->WriteLn( wxT("/// Class ") + class_name); m_header->WriteLn( wxT("///////////////////////////////////////////////////////////////////////////////") ); m_header->WriteLn( wxT("class ") + classDecoration + class_name + wxT(" : ") + GetCode( class_obj, wxT("base") ) ); m_header->WriteLn( wxT("{") ); m_header->Indent(); // are there event handlers? if ( !m_useConnect && events.size() > 0 ) { m_header->WriteLn( wxT("DECLARE_EVENT_TABLE()") ); } // private m_header->WriteLn( wxT("private:") ); m_header->Indent(); GenAttributeDeclaration(class_obj,P_PRIVATE); if ( !m_useConnect ) { GenPrivateEventHandlers(events); } m_header->Unindent(); m_header->WriteLn( wxT("") ); // protected m_header->WriteLn( wxT("protected:") ); m_header->Indent(); if (use_enum) GenEnumIds(class_obj); GenAttributeDeclaration(class_obj,P_PROTECTED); GenVirtualEventHandlers(events, eventHandlerPrefix, eventHandlerPostfix); m_header->Unindent(); m_header->WriteLn( wxT("") ); // public m_header->WriteLn( wxT("public:") ); m_header->Indent(); GenAttributeDeclaration(class_obj,P_PUBLIC); // Validators' variables GenValidatorVariables(class_obj); m_header->WriteLn( wxT("") ); // The constructor is also included within public m_header->WriteLn( GetCode( class_obj, wxT("cons_decl") ) ); // Destructor m_header->WriteLn( wxString::Format( wxT("~%s();"), class_name.c_str() ) ); GetGenEventHandlers( class_obj ); m_header->Unindent(); m_header->WriteLn( wxT("") ); m_header->Unindent(); m_header->WriteLn( wxT("};") ); m_header->WriteLn( wxT("") ); } void CppCodeGenerator::GenEnumIds(PObjectBase class_obj) { std::vector< wxString > macros; FindMacros( class_obj, ¯os ); std::vector< wxString >::iterator it = macros.begin(); if ( it != macros.end()) { m_header->WriteLn( wxT("enum") ); m_header->WriteLn( wxT("{") ); m_header->Indent(); // Remove the default macro from the set, for backward compatiblity it = std::find( macros.begin(), macros.end(), wxT("ID_DEFAULT") ); if ( it != macros.end() ) { // The default macro is defined to wxID_ANY m_header->WriteLn( wxT("ID_DEFAULT = wxID_ANY, // Default") ); macros.erase(it); } it = macros.begin(); if ( it != macros.end()) { m_header->WriteLn( wxString::Format( wxT("%s = %i,"), it->c_str(), m_firstID ) ); it++; while ( it != macros.end() ) { m_header->WriteLn( *it + wxT(",") ); it++; } } //m_header->WriteLn(id); m_header->Unindent(); m_header->WriteLn( wxT("};") ); m_header->WriteLn( wxEmptyString ); } } void CppCodeGenerator::GenSubclassSets( PObjectBase obj, std::set< wxString >* subclasses, std::set< wxString >* sourceIncludes, std::vector< wxString >* headerIncludes ) { // Call GenSubclassForwardDeclarations on all children as well for ( unsigned int i = 0; i < obj->GetChildCount(); i++ ) { GenSubclassSets( obj->GetChild( i ), subclasses, sourceIncludes, headerIncludes ); } // Fill the set PProperty subclass = obj->GetProperty( wxT("subclass") ); if ( subclass ) { std::map< wxString, wxString > children; subclass->SplitParentProperty( &children ); std::map< wxString, wxString >::iterator name; name = children.find( wxT("name") ); if ( children.end() == name ) { // No name, so do nothing return; } wxString nameVal = name->second; if ( nameVal.empty() ) { // No name, so do nothing return; } //get namespaces wxString originalValue = nameVal; int delimiter = nameVal.Find( wxT("::") ) ; if ( wxNOT_FOUND == delimiter ) { // Got a subclass subclasses->insert( wxT("class ") + nameVal + wxT(";") ); } else { wxString subClassPrefix, subClassSuffix; do { wxString namespaceStr; namespaceStr = nameVal.Mid( 0, delimiter ); if ( namespaceStr.empty() ) { break; } subClassPrefix += wxT("namespace ") + namespaceStr + wxT("{ "); subClassSuffix += wxT(" }"); nameVal = nameVal.Mid( delimiter + 2 ); delimiter = nameVal.Find( wxT("::") ); } while ( delimiter != wxNOT_FOUND ); if ( delimiter != wxNOT_FOUND || nameVal.empty() ) { wxLogError ( _("Invalid Value for Property\n\tObject: %s\n\tProperty: %s\n\tValue: %s"), obj->GetPropertyAsString( _("name") ).c_str(), _("subclass"), originalValue.c_str() ); return; } wxString subClassDeclar; subClassDeclar += subClassPrefix + wxT("class ") + nameVal + wxT(";") + subClassSuffix; // Got a subclass subclasses->insert( subClassDeclar ); } // Now get the header std::map< wxString, wxString >::iterator header; header = children.find( wxT("header") ); if ( children.end() == header ) { // No header, so do nothing return; } wxString headerVal = header->second; if ( headerVal.empty() ) { // No header, so do nothing return; } // Got a header PObjectInfo info = obj->GetObjectInfo(); if ( !info ) { return; } PObjectPackage pkg = info->GetPackage(); if ( !pkg ) { return; } wxString include = wxT("#include \"") + headerVal + wxT("\""); if ( pkg->GetPackageName() == wxT("Forms") ) { std::vector< wxString >::iterator it = std::find( headerIncludes->begin(), headerIncludes->end(), include ); if ( headerIncludes->end() == it ) { headerIncludes->push_back( include ); } } else { sourceIncludes->insert( include ); } } } void CppCodeGenerator::GenIncludes( PObjectBase project, std::vector* includes, std::set< wxString >* templates ) { GenObjectIncludes( project, includes, templates ); } void CppCodeGenerator::GenObjectIncludes( PObjectBase project, std::vector< wxString >* includes, std::set< wxString >* templates ) { // Call GenIncludes on all children as well for ( unsigned int i = 0; i < project->GetChildCount(); i++ ) { GenObjectIncludes( project->GetChild(i), includes, templates ); } // Fill the set PCodeInfo code_info = project->GetObjectInfo()->GetCodeInfo( wxT("C++") ); if (code_info) { CppTemplateParser parser( project, code_info->GetTemplate( wxT("include") ), m_i18n, m_useRelativePath, m_basePath ); wxString include = parser.ParseTemplate(); if ( !include.empty() ) { if ( templates->insert( include ).second ) { AddUniqueIncludes( include, includes ); } } } // Generate includes for base classes GenBaseIncludes( project->GetObjectInfo(), project, includes, templates ); } void CppCodeGenerator::GenBaseIncludes( PObjectInfo info, PObjectBase obj, std::vector< wxString >* includes, std::set< wxString >* templates ) { if ( !info ) { return; } // Process all the base classes recursively for ( unsigned int i = 0; i < info->GetBaseClassCount(); i++ ) { PObjectInfo base_info = info->GetBaseClass( i ); GenBaseIncludes( base_info, obj, includes, templates ); } PCodeInfo code_info = info->GetCodeInfo( wxT("C++") ); if ( code_info ) { CppTemplateParser parser( obj, code_info->GetTemplate( wxT("include") ), m_i18n, m_useRelativePath, m_basePath ); wxString include = parser.ParseTemplate(); if ( !include.empty() ) { if ( templates->insert( include ).second ) { AddUniqueIncludes( include, includes ); } } } } void CppCodeGenerator::AddUniqueIncludes( const wxString& include, std::vector< wxString >* includes ) { // Split on newlines to only generate unique include lines // This strips blank lines and trims wxStringTokenizer tkz( include, wxT("\n"), wxTOKEN_STRTOK ); bool inPreproc = false; while ( tkz.HasMoreTokens() ) { wxString line = tkz.GetNextToken(); line.Trim( false ); line.Trim( true ); // Anything within a #if preprocessor block will be written if ( line.StartsWith( wxT("#if") ) ) { inPreproc = true; } else if ( line.StartsWith( wxT("#endif") ) ) { inPreproc = false; } if ( inPreproc ) { includes->push_back( line ); continue; } // If it is not an include line, it will be written if ( !line.StartsWith( wxT("#include") ) ) { includes->push_back( line ); continue; } // If it is an include, it must be unique to be written std::vector< wxString >::iterator it = std::find( includes->begin(), includes->end(), line ); if ( includes->end() == it ) { includes->push_back( line ); } } } void CppCodeGenerator::FindDependencies( PObjectBase obj, std::set< PObjectInfo >& info_set ) { unsigned int ch_count = obj->GetChildCount(); if (ch_count > 0) { unsigned int i; for (i = 0; iGetChild(i); info_set.insert(child->GetObjectInfo()); FindDependencies(child, info_set); } } } void CppCodeGenerator::GenConstructor( PObjectBase class_obj, const EventVector &events ) { m_source->WriteLn(); m_source->WriteLn( GetCode( class_obj, wxT("cons_def") ) ); m_source->WriteLn( wxT("{") ); m_source->Indent(); wxString settings = GetCode( class_obj, wxT("settings") ); if ( !settings.empty() ) { m_source->WriteLn( settings ); } for ( unsigned int i = 0; i < class_obj->GetChildCount(); i++ ) { GenConstruction( class_obj->GetChild( i ), true ); } wxString afterAddChild = GetCode( class_obj, wxT("after_addchild") ); if ( !afterAddChild.empty() ) { m_source->WriteLn( afterAddChild ); } if ( m_useConnect && !events.empty() ) { m_source->WriteLn(); m_source->WriteLn( wxT("// Connect Events") ); GenEvents( class_obj, events ); } m_source->Unindent(); m_source->WriteLn( wxT("}") ); } void CppCodeGenerator::GenDestructor( PObjectBase class_obj, const EventVector &events ) { m_source->WriteLn(); wxString className = class_obj->GetPropertyAsString( wxT("name") ); m_source->WriteLn( wxString::Format( wxT("%s::~%s()"), className.c_str(), className.c_str() ) ); m_source->WriteLn( wxT("{") ); m_source->Indent(); if ( m_disconnectEvents && m_useConnect && !events.empty() ) { m_source->WriteLn( wxT("// Disconnect Events") ); GenEvents( class_obj, events, true ); } m_source->Unindent(); m_source->WriteLn( wxT("}") ); } void CppCodeGenerator::GenConstruction(PObjectBase obj, bool is_widget ) { wxString type = obj->GetObjectTypeName(); PObjectInfo info = obj->GetObjectInfo(); if ( ObjectDatabase::HasCppProperties( type ) ) { // Checking if it has not been declared as class attribute // so that, we will declare it inside the constructor wxString perm_str = obj->GetProperty( wxT("permission") )->GetValue(); if ( perm_str == wxT("none") ) { const wxString& decl = GetCode( obj, wxT("declaration") ); if ( !decl.empty() ) { m_source->WriteLn( decl ); } } m_source->WriteLn( GetCode( obj, wxT("construction") ) ); GenSettings( obj->GetObjectInfo(), obj ); bool isWidget = !info->IsSubclassOf( wxT("sizer") ); for ( unsigned int i = 0; i < obj->GetChildCount(); i++ ) { PObjectBase child = obj->GetChild( i ); GenConstruction( child, isWidget ); if ( type == wxT("toolbar") ) { GenAddToolbar(child->GetObjectInfo(), child); } } if ( !isWidget ) // sizers { if (is_widget) { // the parent object is not a sizer. There is no template for // this so we'll make it manually. // It's not a good practice to embed templates into the source code, // because you will need to recompile... wxString _template = wxT("#wxparent $name->SetSizer( $name ); #nl") wxT("#wxparent $name->Layout();") wxT("#ifnull #parent $size") wxT("@{ #nl $name->Fit( #wxparent $name ); @}"); CppTemplateParser parser( obj, _template, m_i18n, m_useRelativePath, m_basePath ); m_source->WriteLn(parser.ParseTemplate()); } } else if ( type == wxT("splitter") ) { // Generating the split switch ( obj->GetChildCount() ) { case 1: { PObjectBase sub1 = obj->GetChild(0)->GetChild(0); wxString _template = wxT("$name->Initialize( "); _template = _template + sub1->GetProperty( wxT("name") )->GetValue() + wxT(" )"); CppTemplateParser parser( obj, _template, m_i18n, m_useRelativePath, m_basePath ); m_source->WriteLn(parser.ParseTemplate()); break; } case 2: { PObjectBase sub1,sub2; sub1 = obj->GetChild(0)->GetChild(0); sub2 = obj->GetChild(1)->GetChild(0); wxString _template; if ( obj->GetProperty( wxT("splitmode") )->GetValue() == wxT("wxSPLIT_VERTICAL") ) { _template = wxT("$name->SplitVertically( "); } else { _template = wxT("$name->SplitHorizontally( "); } _template = _template + sub1->GetProperty( wxT("name") )->GetValue() + wxT(", ") + sub2->GetProperty( wxT("name") )->GetValue() + wxT(", $sashpos );"); CppTemplateParser parser( obj, _template, m_i18n, m_useRelativePath, m_basePath ); m_source->WriteLn(parser.ParseTemplate()); break; } default: wxLogError( wxT("Missing subwindows for wxSplitterWindow widget.") ); break; } } else if ( type == wxT("menubar") || type == wxT("menu") || type == wxT("submenu") || type == wxT("toolbar") || type == wxT("listbook") || type == wxT("notebook") || type == wxT("auinotebook") || type == wxT("treelistctrl") || type == wxT("flatnotebook") ) { wxString afterAddChild = GetCode( obj, wxT("after_addchild") ); if ( !afterAddChild.empty() ) { m_source->WriteLn( afterAddChild ); } m_source->WriteLn(); } } else if ( info->IsSubclassOf( wxT("sizeritembase") ) ) { // The child must be added to the sizer having in mind the // child object type (there are 3 different routines) GenConstruction( obj->GetChild(0), false ); PObjectInfo childInfo = obj->GetChild(0)->GetObjectInfo(); wxString temp_name; if ( childInfo->IsSubclassOf( wxT("wxWindow") ) || wxT("CustomControl") == childInfo->GetClassName() ) { temp_name = wxT("window_add"); } else if ( childInfo->IsSubclassOf( wxT("sizer") ) ) { temp_name = wxT("sizer_add"); } else if ( childInfo->GetClassName() == wxT("spacer") ) { temp_name = wxT("spacer_add"); } else { Debug::Print( wxT("SizerItem child is not a Spacer and is not a subclass of wxWindow or of sizer.") ); return; } m_source->WriteLn( GetCode( obj, temp_name ) ); } else if ( type == wxT("notebookpage") || type == wxT("flatnotebookpage") || type == wxT("listbookpage") || type == wxT("choicebookpage") || type == wxT("auinotebookpage") ) { GenConstruction( obj->GetChild( 0 ), false ); m_source->WriteLn( GetCode( obj, wxT("page_add") ) ); GenSettings( obj->GetObjectInfo(), obj ); } else if ( type == wxT("treelistctrlcolumn") ) { m_source->WriteLn( GetCode( obj, wxT("column_add") ) ); GenSettings( obj->GetObjectInfo(), obj ); } else if ( type == wxT("tool") ) { // If loading bitmap from ICON resource, and size is not set, set size to toolbars bitmapsize // So hacky, yet so useful ... wxSize toolbarsize = obj->GetParent()->GetPropertyAsSize( _("bitmapsize") ); if ( wxDefaultSize != toolbarsize ) { PProperty prop = obj->GetProperty( _("bitmap") ); if ( prop ) { wxString oldVal = prop->GetValueAsString(); wxString path, source; wxSize toolsize; TypeConv::ParseBitmapWithResource( oldVal, &path, &source, &toolsize ); if ( wxT("Load From Icon Resource") == source && wxDefaultSize == toolsize ) { prop->SetValue( wxString::Format( wxT("%s; %s [%i; %i]"), path.c_str(), source.c_str(), toolbarsize.GetWidth(), toolbarsize.GetHeight() ) ); m_source->WriteLn( GetCode( obj, wxT("construction") ) ); prop->SetValue( oldVal ); return; } } } m_source->WriteLn( GetCode( obj, wxT("construction") ) ); } else { // Generate the children for ( unsigned int i = 0; i < obj->GetChildCount(); i++ ) { GenConstruction( obj->GetChild( i ), false ); } } } void CppCodeGenerator::FindMacros( PObjectBase obj, std::vector* macros ) { // iterate through all of the properties of all objects, add the macros // to the vector unsigned int i; for ( i = 0; i < obj->GetPropertyCount(); i++ ) { PProperty prop = obj->GetProperty( i ); if ( prop->GetType() == PT_MACRO ) { wxString value = prop->GetValue(); // Skip wx IDs if ( m_predMacros.end() == m_predMacros.find( value ) ) { if ( macros->end() == std::find( macros->begin(), macros->end(), value ) ) { macros->push_back( value ); } } } } for ( i = 0; i < obj->GetChildCount(); i++ ) { FindMacros( obj->GetChild( i ), macros ); } } void CppCodeGenerator::FindEventHandlers(PObjectBase obj, EventVector &events) { unsigned int i; for (i=0; i < obj->GetEventCount(); i++) { PEvent event = obj->GetEvent(i); if (!event->GetValue().IsEmpty()) events.push_back(event); } for (i=0; i < obj->GetChildCount(); i++) { PObjectBase child = obj->GetChild(i); FindEventHandlers(child,events); } } void CppCodeGenerator::GenDefines( PObjectBase project) { std::vector< wxString > macros; FindMacros( project, ¯os ); // Remove the default macro from the set, for backward compatiblity std::vector< wxString >::iterator it; it = std::find( macros.begin(), macros.end(), wxT("ID_DEFAULT") ); if ( it != macros.end() ) { // The default macro is defined to wxID_ANY m_header->WriteLn( wxT("#define ID_DEFAULT wxID_ANY // Default") ); macros.erase(it); } unsigned int id = m_firstID; if ( id < 1000 ) { wxLogWarning(wxT("First ID is Less than 1000")); } for (it = macros.begin() ; it != macros.end(); it++) { // Don't redefine wx IDs m_header->WriteLn( wxString::Format( wxT("#define %s %i"), it->c_str(), id ) ); id++; } m_header->WriteLn( wxT("") ); } void CppCodeGenerator::GenSettings(PObjectInfo info, PObjectBase obj) { wxString _template; PCodeInfo code_info = info->GetCodeInfo( wxT("C++") ); if ( !code_info ) { return; } _template = code_info->GetTemplate( wxT("settings") ); if ( !_template.empty() ) { CppTemplateParser parser( obj, _template, m_i18n, m_useRelativePath, m_basePath ); wxString code = parser.ParseTemplate(); if ( !code.empty() ) { m_source->WriteLn(code); } } // Proceeding recursively with the base classes for (unsigned int i=0; i< info->GetBaseClassCount(); i++) { PObjectInfo base_info = info->GetBaseClass(i); GenSettings(base_info,obj); } } void CppCodeGenerator::GenAddToolbar(PObjectInfo info, PObjectBase obj) { wxString _template; PCodeInfo code_info = info->GetCodeInfo( wxT("C++") ); if (!code_info) return; _template = code_info->GetTemplate( wxT("toolbar_add") ); if ( !_template.empty() ) { CppTemplateParser parser( obj, _template, m_i18n, m_useRelativePath, m_basePath ); wxString code = parser.ParseTemplate(); if ( !code.empty() ) { m_source->WriteLn(code); } } // Proceeding recursively with the base classes for (unsigned int i=0; i< info->GetBaseClassCount(); i++) { PObjectInfo base_info = info->GetBaseClass(i); GenAddToolbar(base_info,obj); } } /////////////////////////////////////////////////////////////////////// void CppCodeGenerator::GenXpmIncludes( PObjectBase project) { std::set< wxString > include_set; // We begin obtaining the "include" list FindXpmProperties( project, include_set ); if ( include_set.empty() ) { return; } // and then, we generate them std::set::iterator it; for ( it = include_set.begin() ; it != include_set.end(); it++ ) { if ( !it->empty() ) { m_source->WriteLn( *it ); } } m_source->WriteLn(); } void CppCodeGenerator::FindXpmProperties( PObjectBase obj, std::set& xpmset ) { // We go through (browse) for each property in "obj" object. If any of the // PT_XPM_BITMAP type is found, then the proper "include" string is added // in "set". After that, we recursively do it the same with the child objects. unsigned int i, count; count = obj->GetPropertyCount(); for (i = 0; i < count; i++) { PProperty property = obj->GetProperty(i); if ( property->GetType() == PT_BITMAP ) { wxString path = property->GetValue(); size_t semicolonindex = path.find_first_of( wxT(";") ); if ( semicolonindex != path.npos ) { path = path.substr( 0, semicolonindex ); } wxFileName bmpFileName( path ); if ( bmpFileName.GetExt().Upper() == wxT("XPM") ) { wxString absPath = TypeConv::MakeAbsolutePath( path, AppData()->GetProjectPath() ); // It's supposed that "path" contains an absolut path to the file // and not a relative one. wxString relPath = ( m_useRelativePath ? TypeConv::MakeRelativePath( absPath, m_basePath ) : absPath ); wxString inc; inc << wxT("#include \"") << relPath << wxT("\""); xpmset.insert(inc); } } } count = obj->GetChildCount(); for (i = 0; i< count; i++) { PObjectBase child = obj->GetChild(i); FindXpmProperties( child, xpmset ); } } void CppCodeGenerator::UseRelativePath(bool relative, wxString basePath) { bool result; m_useRelativePath = relative; if (m_useRelativePath) { result = wxFileName::DirExists( basePath ); m_basePath = ( result ? basePath : wxT("") ); } } /* wxString CppCodeGenerator::ConvertToRelativePath(wxString path, wxString basePath) { wxString auxPath = path; if (basePath != "") { wxFileName filename(_WXSTR(auxPath)); if (filename.MakeRelativeTo(_WXSTR(basePath))) auxPath = _STDSTR(filename.GetFullPath()); } return auxPath; }*/ #define ADD_PREDEFINED_MACRO(x) m_predMacros.insert( wxT(#x) ) void CppCodeGenerator::SetupPredefinedMacros() { /* no id matches this one when compared to it */ ADD_PREDEFINED_MACRO(wxID_NONE); /* id for a separator line in the menu (invalid for normal item) */ ADD_PREDEFINED_MACRO(wxID_SEPARATOR); ADD_PREDEFINED_MACRO(wxID_ANY); ADD_PREDEFINED_MACRO(wxID_LOWEST); ADD_PREDEFINED_MACRO(wxID_OPEN); ADD_PREDEFINED_MACRO(wxID_CLOSE); ADD_PREDEFINED_MACRO(wxID_NEW); ADD_PREDEFINED_MACRO(wxID_SAVE); ADD_PREDEFINED_MACRO(wxID_SAVEAS); ADD_PREDEFINED_MACRO(wxID_REVERT); ADD_PREDEFINED_MACRO(wxID_EXIT); ADD_PREDEFINED_MACRO(wxID_UNDO); ADD_PREDEFINED_MACRO(wxID_REDO); ADD_PREDEFINED_MACRO(wxID_HELP); ADD_PREDEFINED_MACRO(wxID_PRINT); ADD_PREDEFINED_MACRO(wxID_PRINT_SETUP); ADD_PREDEFINED_MACRO(wxID_PREVIEW); ADD_PREDEFINED_MACRO(wxID_ABOUT); ADD_PREDEFINED_MACRO(wxID_HELP_CONTENTS); ADD_PREDEFINED_MACRO(wxID_HELP_COMMANDS); ADD_PREDEFINED_MACRO(wxID_HELP_PROCEDURES); ADD_PREDEFINED_MACRO(wxID_HELP_CONTEXT); ADD_PREDEFINED_MACRO(wxID_CLOSE_ALL); ADD_PREDEFINED_MACRO(wxID_PAGE_SETUP); ADD_PREDEFINED_MACRO(wxID_HELP_INDEX); ADD_PREDEFINED_MACRO(wxID_HELP_SEARCH); ADD_PREDEFINED_MACRO(wxID_PREFERENCES); ADD_PREDEFINED_MACRO(wxID_EDIT); ADD_PREDEFINED_MACRO(wxID_CUT); ADD_PREDEFINED_MACRO(wxID_COPY); ADD_PREDEFINED_MACRO(wxID_PASTE); ADD_PREDEFINED_MACRO(wxID_CLEAR); ADD_PREDEFINED_MACRO(wxID_FIND); ADD_PREDEFINED_MACRO(wxID_DUPLICATE); ADD_PREDEFINED_MACRO(wxID_SELECTALL); ADD_PREDEFINED_MACRO(wxID_DELETE); ADD_PREDEFINED_MACRO(wxID_REPLACE); ADD_PREDEFINED_MACRO(wxID_REPLACE_ALL); ADD_PREDEFINED_MACRO(wxID_PROPERTIES); ADD_PREDEFINED_MACRO(wxID_VIEW_DETAILS); ADD_PREDEFINED_MACRO(wxID_VIEW_LARGEICONS); ADD_PREDEFINED_MACRO(wxID_VIEW_SMALLICONS); ADD_PREDEFINED_MACRO(wxID_VIEW_LIST); ADD_PREDEFINED_MACRO(wxID_VIEW_SORTDATE); ADD_PREDEFINED_MACRO(wxID_VIEW_SORTNAME); ADD_PREDEFINED_MACRO(wxID_VIEW_SORTSIZE); ADD_PREDEFINED_MACRO(wxID_VIEW_SORTTYPE); ADD_PREDEFINED_MACRO(wxID_FILE); ADD_PREDEFINED_MACRO(wxID_FILE1); ADD_PREDEFINED_MACRO(wxID_FILE2); ADD_PREDEFINED_MACRO(wxID_FILE3); ADD_PREDEFINED_MACRO(wxID_FILE4); ADD_PREDEFINED_MACRO(wxID_FILE5); ADD_PREDEFINED_MACRO(wxID_FILE6); ADD_PREDEFINED_MACRO(wxID_FILE7); ADD_PREDEFINED_MACRO(wxID_FILE8); ADD_PREDEFINED_MACRO(wxID_FILE9); /* Standard button and menu IDs */ ADD_PREDEFINED_MACRO(wxID_OK); ADD_PREDEFINED_MACRO(wxID_CANCEL); ADD_PREDEFINED_MACRO(wxID_APPLY); ADD_PREDEFINED_MACRO(wxID_YES); ADD_PREDEFINED_MACRO(wxID_NO); ADD_PREDEFINED_MACRO(wxID_STATIC); ADD_PREDEFINED_MACRO(wxID_FORWARD); ADD_PREDEFINED_MACRO(wxID_BACKWARD); ADD_PREDEFINED_MACRO(wxID_DEFAULT); ADD_PREDEFINED_MACRO(wxID_MORE); ADD_PREDEFINED_MACRO(wxID_SETUP); ADD_PREDEFINED_MACRO(wxID_RESET); ADD_PREDEFINED_MACRO(wxID_CONTEXT_HELP); ADD_PREDEFINED_MACRO(wxID_YESTOALL); ADD_PREDEFINED_MACRO(wxID_NOTOALL); ADD_PREDEFINED_MACRO(wxID_ABORT); ADD_PREDEFINED_MACRO(wxID_RETRY); ADD_PREDEFINED_MACRO(wxID_IGNORE); ADD_PREDEFINED_MACRO(wxID_ADD); ADD_PREDEFINED_MACRO(wxID_REMOVE); ADD_PREDEFINED_MACRO(wxID_UP); ADD_PREDEFINED_MACRO(wxID_DOWN); ADD_PREDEFINED_MACRO(wxID_HOME); ADD_PREDEFINED_MACRO(wxID_REFRESH); ADD_PREDEFINED_MACRO(wxID_STOP); ADD_PREDEFINED_MACRO(wxID_INDEX); ADD_PREDEFINED_MACRO(wxID_BOLD); ADD_PREDEFINED_MACRO(wxID_ITALIC); ADD_PREDEFINED_MACRO(wxID_JUSTIFY_CENTER); ADD_PREDEFINED_MACRO(wxID_JUSTIFY_FILL); ADD_PREDEFINED_MACRO(wxID_JUSTIFY_RIGHT); ADD_PREDEFINED_MACRO(wxID_JUSTIFY_LEFT); ADD_PREDEFINED_MACRO(wxID_UNDERLINE); ADD_PREDEFINED_MACRO(wxID_INDENT); ADD_PREDEFINED_MACRO(wxID_UNINDENT); ADD_PREDEFINED_MACRO(wxID_ZOOM_100); ADD_PREDEFINED_MACRO(wxID_ZOOM_FIT); ADD_PREDEFINED_MACRO(wxID_ZOOM_IN); ADD_PREDEFINED_MACRO(wxID_ZOOM_OUT); ADD_PREDEFINED_MACRO(wxID_UNDELETE); ADD_PREDEFINED_MACRO(wxID_REVERT_TO_SAVED); /* System menu IDs (used by wxUniv): */ ADD_PREDEFINED_MACRO(wxID_SYSTEM_MENU); ADD_PREDEFINED_MACRO(wxID_CLOSE_FRAME); ADD_PREDEFINED_MACRO(wxID_MOVE_FRAME); ADD_PREDEFINED_MACRO(wxID_RESIZE_FRAME); ADD_PREDEFINED_MACRO(wxID_MAXIMIZE_FRAME); ADD_PREDEFINED_MACRO(wxID_ICONIZE_FRAME); ADD_PREDEFINED_MACRO(wxID_RESTORE_FRAME); /* IDs used by generic file dialog (13 consecutive starting from this value) */ ADD_PREDEFINED_MACRO(wxID_FILEDLGG); ADD_PREDEFINED_MACRO(wxID_HIGHEST); } wxformbuilder-3.1.59/src/codegen/xrccg.h0000644000175000017500000000315311143440027020424 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #ifndef _XRC_CODE_GEN_ #define _XRC_CODE_GEN_ #include "codegen.h" #include "utils/wxfbdefs.h" namespace ticpp { class Element; } /// XRC code generator. class XrcCodeGenerator : public CodeGenerator { private: PCodeWriter m_cw; ticpp::Element* GetElement( PObjectBase obj, ticpp::Element* parent = NULL ); public: /// Configures the code writer for the XML file. void SetWriter( PCodeWriter cw ); /// Generates the XRC code for the project. bool GenerateCode( PObjectBase project ); }; #endif //_XRC_CODE_GEN_ wxformbuilder-3.1.59/src/codegen/codegen.cpp0000644000175000017500000004650111143440027021261 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #include "codegen.h" #include "utils/debug.h" #include "utils/typeconv.h" #include "wx/wx.h" #include #include "rad/appdata.h" #include "model/objectbase.h" #include "utils/wxfbexception.h" TemplateParser::TemplateParser(PObjectBase obj, wxString _template) : m_obj( obj ), m_in( _template ) { } TemplateParser::TemplateParser( const TemplateParser & that, wxString _template ) : m_obj( that.m_obj ), m_in( _template ) { } TemplateParser::Token TemplateParser::GetNextToken() { // There are 3 special characters // #xxxx -> command // $xxxx -> property // %xxxx -> local variable // @x -> Escape a special character. Example: @# is the character #. Token result = TOK_ERROR; if (!m_in.Eof()) { wxChar c = m_in.Peek(); if ( c == wxT('#') ) result = TOK_MACRO; else if (c == wxT('$') ) result = TOK_PROPERTY; else result = TOK_TEXT; } return result; } bool TemplateParser::ParseMacro() { Ident ident; ident = ParseIdent(); switch (ident) { case ID_WXPARENT: return ParseWxParent(); break; case ID_PARENT: return ParseParent(); break; case ID_FORM: return ParseForm(); break; case ID_IFNOTNULL: return ParseIfNotNull(); break; case ID_IFNULL: return ParseIfNull(); break; case ID_FOREACH: return ParseForEach(); break; case ID_PREDEFINED: return ParsePred(); break; case ID_PREDEFINED_INDEX: return ParseNPred(); break; case ID_CHILD: return ParseChild(); break; case ID_NEWLINE: return ParseNewLine(); break; case ID_IFEQUAL: ParseIfEqual(); break; case ID_IFNOTEQUAL: ParseIfNotEqual(); break; case ID_IFPARENTTYPEEQUAL: ParseIfParentTypeEqual(); break; case ID_APPEND: ParseAppend(); break; case ID_CLASS: ParseClass(); break; default: THROW_WXFBEX( wxT("Invalid Macro Type") ); break; } return true; } TemplateParser::Ident TemplateParser::ParseIdent() { Ident ident = ID_ERROR; if (!m_in.Eof()) { wxString macro; m_in.GetC(); wxChar peek( m_in.Peek() ); while (peek != wxChar(EOF) && !m_in.Eof() && peek != wxT('#') && peek != wxT('$') && ( (peek >= wxT('a') && peek <= wxT('z') ) || (peek >= wxT('A') && peek <= wxT('Z') ) || (peek >= wxT('0') && peek <= wxT('9') ) )) { macro += wxChar( m_in.GetC() ); peek = wxChar( m_in.Peek() ); } // Searching the identifier ident = SearchIdent( macro ); } return ident; } wxString TemplateParser::ParsePropertyName( wxString* child ) { wxString propname; // children of parent properties can be referred to with a '/' like "$parent/child" bool foundSlash = false; bool saveChild = ( NULL != child ); if (!m_in.Eof()) { m_in.GetC(); wxChar peek( m_in.Peek() ); while (peek != wxChar(EOF) && !m_in.Eof() && peek != wxT('#') && peek != wxT('$') && ( (peek >= wxT('a') && peek <= wxT('z') ) || (peek >= wxT('A') && peek <= wxT('Z') ) || (peek >= wxT('0') && peek <= wxT('9') ) || peek == wxT('_') || peek == wxT('/') ) ) { if ( foundSlash ) { if ( saveChild ) { (*child) << wxChar( m_in.GetC() ); } } else { wxChar next = wxChar( m_in.GetC() ); if ( wxT('/') == next ) { foundSlash = true; } else { propname << next; } } peek = wxChar( m_in.Peek() ); } } return propname; } bool TemplateParser::ParseProperty() { wxString childName; wxString propname = ParsePropertyName( &childName ); PProperty property = m_obj->GetProperty(propname); if ( NULL == property.get() ) { wxLogError( wxT("The property '%s' does not exist for objects of class '%s'"), propname.c_str(), m_obj->GetClassName().c_str() ); return true; } if ( childName.empty() ) { wxString code = PropertyToCode(property); m_out << code; } else { m_out << property->GetChildFromParent( childName ); } // Debug::Print("parsing property %s",propname.c_str()); return true; } bool TemplateParser::ParseText() { wxString text; int sspace = 0; if ( !m_in.Eof() ) { wxChar peek( m_in.Peek() ); while (peek != wxChar(EOF) && !m_in.Eof() && peek != wxT('#') && peek != wxT('$') ) { wxChar c( m_in.GetC() ); if (c == wxT('@') ) { c = wxChar(m_in.GetC()); if(c == wxT(' '))sspace++; } text << c; peek = wxChar( m_in.Peek() ); } if ( text.find_first_not_of( wxT("\r\n\t ") ) != text.npos ) { // If text is all whitespace, ignore it m_out << text; } else { // ... but allow all '@ ' instances wxString spaces(wxT(' '), sspace); m_out << spaces; } } //Debug::Print(wxT("Parsed Text: %s"),text.c_str()); return true; } bool TemplateParser::ParseInnerTemplate() { return true; } PObjectBase TemplateParser::GetWxParent() { PObjectBase wxparent; std::vector< PObjectBase > candidates; candidates.push_back( m_obj->FindNearAncestor( wxT("container") ) ); candidates.push_back( m_obj->FindNearAncestor( wxT("notebook") ) ); candidates.push_back( m_obj->FindNearAncestor( wxT("splitter") ) ); candidates.push_back( m_obj->FindNearAncestor( wxT("flatnotebook") ) ); candidates.push_back( m_obj->FindNearAncestor( wxT("listbook") ) ); candidates.push_back( m_obj->FindNearAncestor( wxT("choicebook") ) ); candidates.push_back( m_obj->FindNearAncestor( wxT("auinotebook") ) ); candidates.push_back( m_obj->FindNearAncestor( wxT("toolbar") ) ); for ( size_t i = 0; i < candidates.size(); i++ ) { if ( !wxparent ) { wxparent = candidates[i]; } else { if ( candidates[i] && candidates[i]->Deep() > wxparent->Deep() ) { wxparent = candidates[i]; } } } return wxparent; } bool TemplateParser::ParseWxParent() { PObjectBase wxparent( GetWxParent() ); if ( wxparent ) { PProperty property = GetRelatedProperty( wxparent ); m_out << PropertyToCode(property); } else { ignore_whitespaces(); ParsePropertyName(); m_out << RootWxParentToCode(); } return true; } bool TemplateParser::ParseForm() { PObjectBase form (m_obj); PObjectBase parent(form->GetParent()); if ( !parent ) { return false; } // form is a form when grandparent is null PObjectBase grandparent = parent->GetParent(); while ( grandparent ) { form = parent; parent = grandparent; grandparent = grandparent->GetParent(); } PProperty property = GetRelatedProperty( form ); m_out << PropertyToCode( property ); return true; } bool TemplateParser::ParseParent() { PObjectBase parent(m_obj->GetParent()); if (parent) { PProperty property = GetRelatedProperty( parent ); m_out << PropertyToCode(property); } else { m_out << wxT("ERROR"); } return true; } bool TemplateParser::ParseChild() { // Get the first child PObjectBase child(m_obj->GetChild(0)); if (child) { PProperty property = GetRelatedProperty( child ); m_out << PropertyToCode(property); } else m_out << RootWxParentToCode(); return true; } PProperty TemplateParser::GetRelatedProperty( PObjectBase relative ) { ignore_whitespaces(); wxString propname = ParsePropertyName(); return relative->GetProperty( propname ); } bool TemplateParser::ParseForEach() { // Whitespaces at the very start are ignored ignore_whitespaces(); // parsing the property if (GetNextToken() == TOK_PROPERTY) { wxString propname = ParsePropertyName(); wxString inner_template = ExtractInnerTemplate(); PProperty property = m_obj->GetProperty(propname); wxString propvalue = property->GetValue(); // Property value must be an string using ',' as separator. // The template will be generated nesting as many times as // tokens were found in the property value. if (property->GetType() == PT_INTLIST || property->GetType() == PT_UINTLIST) { // For doing that we will use wxStringTokenizer class from wxWidgets wxStringTokenizer tkz( propvalue, wxT(",")); int i = 0; while (tkz.HasMoreTokens()) { wxString token; token = tkz.GetNextToken(); token.Trim(true); token.Trim(false); // Parsing the internal template { wxString code; PTemplateParser parser = CreateParser( this, inner_template ); parser->SetPredefined( token, wxString::Format( wxT("%i"), i++ ) ); code = parser->ParseTemplate(); m_out << wxT("\n") << code; } } } else if (property->GetType() == PT_STRINGLIST) { wxArrayString array = property->GetValueAsArrayString(); for ( unsigned int i = 0 ; i < array.Count(); i++ ) { wxString code; PTemplateParser parser = CreateParser(this,inner_template); parser->SetPredefined( ValueToCode( PT_WXSTRING_I18N, array[i] ), wxString::Format( wxT("%i"), i ) ); code = parser->ParseTemplate(); m_out << wxT("\n") << code; } } else wxLogError(wxT("Property type not compatible with \"foreach\" macro")); } return true; } PProperty TemplateParser::GetProperty( wxString* childName ) { PProperty property( (Property*)NULL ); // Check for #wxparent, #parent, or #child if ( GetNextToken() == TOK_MACRO ) { try { Ident ident = ParseIdent(); switch (ident) { case ID_WXPARENT: { PObjectBase wxparent( GetWxParent() ); if ( wxparent ) { property = GetRelatedProperty( wxparent ); } break; } case ID_PARENT: { PObjectBase parent( m_obj->GetParent() ); if ( parent ) { property = GetRelatedProperty( parent ); } break; } case ID_CHILD: { PObjectBase child( m_obj->GetChild( 0 ) ); if ( child ) { property = GetRelatedProperty( child ); } break; } default: break; } } catch( wxFBException& ex ) { wxLogError( ex.what() ); } } if ( !property ) { if ( GetNextToken() == TOK_PROPERTY ) { wxString propname = ParsePropertyName( childName ); property = m_obj->GetProperty( propname ); } } return property; } void TemplateParser::ignore_whitespaces() { wxChar peek( m_in.Peek() ); while ( peek != wxChar(EOF) && !m_in.Eof() && peek == wxT(' ') ) { m_in.GetC(); peek = wxChar( m_in.Peek() ); } } bool TemplateParser::ParseIfNotNull() { ignore_whitespaces(); // Get the property wxString childName; PProperty property( GetProperty( &childName ) ); if ( !property ) { return false; } wxString inner_template = ExtractInnerTemplate(); if ( !property->IsNull() ) { if ( !childName.empty() ) { if ( property->GetChildFromParent( childName ).empty() ) { return true; } } // Generate the code from the block PTemplateParser parser = CreateParser( this, inner_template ); m_out << parser->ParseTemplate(); } return true; } bool TemplateParser::ParseIfNull() { ignore_whitespaces(); // Get the property wxString childName; PProperty property( GetProperty( &childName ) ); if ( !property ) { return false; } wxString inner_template = ExtractInnerTemplate(); if ( property->IsNull() ) { // Generate the code from the block PTemplateParser parser = CreateParser( this, inner_template ); m_out << parser->ParseTemplate(); } else { if ( !childName.empty() ) { if ( property->GetChildFromParent( childName ).empty() ) { // Generate the code from the block PTemplateParser parser = CreateParser( this, inner_template ); m_out << parser->ParseTemplate(); } } } return true; } wxString TemplateParser::ExtractLiteral() { wxString os; wxChar c; // Whitespaces at the very start are ignored ignore_whitespaces(); c = wxChar(m_in.GetC()); // Initial quotation mark if ( c == wxT('"') ) { bool end = false; // Beginning the template extraction while (!end && !m_in.Eof() && m_in.Peek() != EOF ) { c = wxChar(m_in.GetC()); // obtaining one char // Checking for a possible closing quotation mark if ( c == wxT('"') ) { if ( m_in.Peek() == wxT('"') ) // Char (") denoted as ("") { m_in.GetC(); // Second quotation mark is ignored os << wxT('"'); } else // Closing { end = true; // All the following chars are ignored up to an space char, // so we can avoid errors like "hello"world" -> "hello" wxChar peek( m_in.Peek() ); while (peek != wxChar(EOF) && !m_in.Eof() && peek != wxT(' ') ) { m_in.GetC(); peek = wxChar( m_in.Peek() ); } } } else // one char from literal (N.B. ??) os << c; } } return os; } bool TemplateParser::ParseIfEqual() { // ignore leading whitespace ignore_whitespaces(); // Get the property wxString childName; PProperty property( GetProperty( &childName ) ); if ( property ) { // Get the value to compare to wxString value = ExtractLiteral(); // Get the template to generate if comparison is true wxString inner_template = ExtractInnerTemplate(); // Get the value of the property wxString propValue; if ( childName.empty() ) { propValue = property->GetValue(); } else { propValue = property->GetChildFromParent( childName ); } // Compare if ( propValue == value ) { // Generate the code PTemplateParser parser = CreateParser(this,inner_template); m_out << parser->ParseTemplate(); return true; } } return false; } bool TemplateParser::ParseIfNotEqual() { // ignore leading whitespace ignore_whitespaces(); // Get the property wxString childName; PProperty property( GetProperty( &childName ) ); if ( property ) { // Get the value to compare to wxString value = ExtractLiteral(); // Get the template to generate if comparison is false wxString inner_template = ExtractInnerTemplate(); // Get the value of the property wxString propValue; if ( childName.empty() ) { propValue = property->GetValue(); } else { propValue = property->GetChildFromParent( childName ); } // Compare if ( propValue != value ) { // Generate the code PTemplateParser parser = CreateParser( this, inner_template ); m_out << parser->ParseTemplate();; return true; } } return false; } bool TemplateParser::ParseIfParentTypeEqual() { PObjectBase parent( m_obj->GetParent() ); // get examined type name wxString type = ExtractLiteral(); // get the template to generate if comparison is true wxString inner_template = ExtractInnerTemplate(); // compare give type name with type of the wx parent object if( parent ) { if( parent->GetObjectTypeName() == type ) { // generate the code PTemplateParser parser = CreateParser( this, inner_template ); m_out << parser->ParseTemplate(); return true; } } return false; } TemplateParser::Ident TemplateParser::SearchIdent(wxString ident) { // Debug::Print("Parsing command %s",ident.c_str()); if (ident == wxT("wxparent") ) return ID_WXPARENT; else if (ident == wxT("ifnotnull") ) return ID_IFNOTNULL; else if (ident == wxT("ifnull") ) return ID_IFNULL; else if (ident == wxT("foreach") ) return ID_FOREACH; else if (ident == wxT("pred") ) return ID_PREDEFINED; else if (ident == wxT("npred") ) return ID_PREDEFINED_INDEX; else if (ident == wxT("child") ) return ID_CHILD; else if (ident == wxT("parent") ) return ID_PARENT; else if (ident == wxT("nl") ) return ID_NEWLINE; else if (ident == wxT("ifequal") ) return ID_IFEQUAL; else if (ident == wxT("ifnotequal") ) return ID_IFNOTEQUAL; else if (ident == wxT("ifparenttypeequal") ) return ID_IFPARENTTYPEEQUAL; else if (ident == wxT("append") ) return ID_APPEND; else if (ident == wxT("class") ) return ID_CLASS; else if (ident == wxT("form") ) return ID_FORM; else THROW_WXFBEX( wxString::Format( wxT("Unknown macro: \"%s\""), ident.c_str() ) ); } wxString TemplateParser::ParseTemplate() { try { while (!m_in.Eof()) { Token token = GetNextToken(); switch (token) { case TOK_MACRO: ParseMacro(); break; case TOK_PROPERTY: ParseProperty(); break; case TOK_TEXT: ParseText(); break; default: return wxT(""); } } } catch ( wxFBException& ex ) { wxLogError( ex.what() ); } return m_out; } /** * Obtaining the template enclosed between '@{' y '@}'. * Note: whitespaces at the very start will be ignored. */ wxString TemplateParser::ExtractInnerTemplate() { // bool error = false; wxString os; wxChar c1, c2; // Initial whitespaces are ignored ignore_whitespaces(); // The two following characters must be '@{' c1 = wxChar(m_in.GetC()); c2 = wxChar(m_in.GetC()); if (c1 == wxT('@') && c2 == wxT('{') ) { ignore_whitespaces(); int level = 1; bool end = false; // Beginning with the template extraction while ( !end && !m_in.Eof() && m_in.Peek() != EOF ) { c1 = wxChar(m_in.GetC()); // Checking if there are initial or closing braces if (c1 == wxT('@') ) { c2 = wxChar(m_in.GetC()); if (c2 == wxT('}') ) { level--; if (level == 0) end = true; else { // There isn't a final closing brace, so that we put in // the chars and continue os << c1; os << c2; } } else { os << c1; os << c2; if (c2 == wxT('{') ) level++; } } else os << c1; } } return os; } bool TemplateParser::ParsePred() { if (m_pred != wxT("") ) m_out << m_pred; return true; } bool TemplateParser::ParseNPred() { if (m_npred != wxT("") ) m_out << m_npred; return true; } bool TemplateParser::ParseNewLine() { m_out << wxT('\n'); return true; } void TemplateParser::ParseAppend() { ignore_whitespaces(); } void TemplateParser::ParseClass() { PProperty subclass_prop = m_obj->GetProperty( wxT("subclass") ); if ( subclass_prop ) { wxString subclass = subclass_prop->GetChildFromParent( wxT("name") ); if ( !subclass.empty() ) { m_out << subclass; return; } } m_out << m_obj->GetClassName(); } wxString TemplateParser::PropertyToCode(PProperty property) { if ( property ) { return ValueToCode(property->GetType(), property->GetValue()); } else { return wxEmptyString; } } wxformbuilder-3.1.59/src/codegen/codewriter.h0000644000175000017500000000601611143440027021466 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #ifndef __CODE_WRITER__ #define __CODE_WRITER__ #include /** Abstracts the code generation from the target. Because, in some cases the target is a file, sometimes a TextCtrl, and sometimes both. */ class CodeWriter { private: // Current indentation level in the file int m_indent; int m_cols; protected: /// Write a wxString. virtual void DoWrite( wxString code ) = 0; /// Returns the size of the indentation - was useful when using spaces, now it is 1 because using tabs. virtual int GetIndentSize(); /// Verifies that the wxString does not contain carraige return characters. bool StringOk( wxString s ); /** Divides a badly formed string (including carriage returns) in simple columns, inserting them one after another and taking indent into account. */ void FixWrite( wxString s ); public: /// Constructor. CodeWriter(); /// Destructor. virtual ~CodeWriter(); /// Increment the indent. void Indent(); /// Decrement the indent. void Unindent(); /// Write a line of code. void WriteLn( wxString code = wxEmptyString ); /// Writes a text string into the code. void Write( wxString code ); /// Deletes all the code previously written. virtual void Clear() = 0; }; class wxScintilla; class TCCodeWriter : public CodeWriter { private: wxScintilla *m_tc; protected: void DoWrite( wxString code ); public: TCCodeWriter(); TCCodeWriter( wxScintilla *tc ); void SetTextCtrl( wxScintilla* tc ); void Clear(); }; class StringCodeWriter : public CodeWriter { protected: wxString m_buffer; void DoWrite( wxString code ); public: StringCodeWriter(); void Clear(); wxString GetString(); }; class FileCodeWriter : public StringCodeWriter { private: wxString m_filename; bool m_useMicrosoftBOM; bool m_useUtf8; protected: void WriteBuffer(); public: FileCodeWriter( const wxString &file, bool useMicrosoftBOM = false, bool useUtf8 = true ); ~FileCodeWriter(); void Clear(); }; #endif //__CODE_WRITER__ wxformbuilder-3.1.59/src/codegen/cppcg.h0000644000175000017500000002000511143440027020405 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// /** @file @author José Antonio Hurtado - joseantonio.hurtado@gmail.com @author Juan Antonio Ortega - jortegalalmolda@gmail.com @note The implementation of the generation of relative paths is a little hacky, and not a solution. The value of all properties that are file or a directory paths must be absolute, otherwise the code generation will not work. */ #ifndef _CPP_CODE_GEN_ #define _CPP_CODE_GEN_ #include #include "codegen.h" #include /** * Parse the C++ templates. */ class CppTemplateParser : public TemplateParser { private: bool m_i18n; bool m_useRelativePath; wxString m_basePath; public: CppTemplateParser( PObjectBase obj, wxString _template, bool useI18N, bool useRelativePath, wxString basePath ); CppTemplateParser( const CppTemplateParser & that, wxString _template ); // overrides for C++ PTemplateParser CreateParser( const TemplateParser* oldparser, wxString _template ); wxString RootWxParentToCode(); wxString ValueToCode( PropertyType type, wxString value); }; /** * Generate the C++ code */ class CppCodeGenerator : public CodeGenerator { private: typedef enum { P_PRIVATE, P_PROTECTED, P_PUBLIC } Permission; PCodeWriter m_header; PCodeWriter m_source; bool m_useRelativePath; bool m_i18n; wxString m_basePath; unsigned int m_firstID; bool m_useConnect; bool m_disconnectEvents; /** * Predefined macros won't generate defines. */ std::set m_predMacros; void SetupPredefinedMacros(); /** * Given an object and the name for a template, obtains the code. */ wxString GetCode( PObjectBase obj, wxString name); /** * Stores the project's objects classes set, for generating the includes. */ void FindDependencies( PObjectBase obj, std::set< PObjectInfo >& info_set ); /** * Stores the needed "includes" set for the PT_XPM_BITMAP properties. */ void FindXpmProperties( PObjectBase obj, std::set< wxString >& xpmset); /** * Stores all the properties for "macro" type objects, so that their * related '#define' can be generated subsequently. */ void FindMacros( PObjectBase obj, std::vector< wxString >* macros ); /** * Looks for "non-null" event handlers (PEvent) and collects it into a vector. */ void FindEventHandlers(PObjectBase obj, EventVector &events); /** * Generates classes declarations inside the header file. */ void GenClassDeclaration( PObjectBase class_obj, bool use_enum, const wxString& classDecoration, const EventVector &events, const wxString& eventHandlerPrefix, const wxString& eventHandlerPostfix ); /** * Generates the event table. */ void GenEvents( PObjectBase class_obj, const EventVector &events, bool disconnect = false ); /** * helper function to find the event table entry template in the class or its base classes */ bool GenEventEntry( PObjectBase obj, PObjectInfo obj_info, const wxString& templateName, const wxString& handlerName, bool disconnect = false ); /** * Recursive function for the attributes declaration, used inside GenClassDeclaration. */ void GenAttributeDeclaration( PObjectBase obj, Permission perm); /** * Recursive function for the validators' variables declaration, used inside GenClassDeclaration. */ void GenValidatorVariables( PObjectBase obj); /** * Recursive function for the validators' variables declaration, used inside GenClassDeclaration. */ void GenValVarsBase( PObjectInfo info, PObjectBase obj); /** * Generates the generated_event_handlers template */ void GetGenEventHandlers( PObjectBase obj ); /** * Generates the '#include' section for files. */ void GenIncludes( PObjectBase project, std::vector< wxString >* includes, std::set< wxString >* templates ); void GenObjectIncludes( PObjectBase project, std::vector< wxString >* includes, std::set< wxString >* templates ); void GenBaseIncludes( PObjectInfo info, PObjectBase obj, std::vector< wxString >* includes, std::set< wxString >* templates ); void AddUniqueIncludes( const wxString& include, std::vector< wxString >* includes ); /** * Generate a set of all subclasses to forward declare in the generated header file. * Also generate sets of header files to be include in either the source or header file. */ void GenSubclassSets( PObjectBase obj, std::set< wxString >* subclasses, std::set< wxString >* sourceIncludes, std::vector< wxString >* headerIncludes ); /** * Generates the '#include' section for the XPM properties. */ void GenXpmIncludes( PObjectBase project); /** * Generates the '#define' section for macros. */ void GenDefines( PObjectBase project); /** * Generates an enum with wxWindow identifiers. */ void GenEnumIds( PObjectBase class_obj); /** * Generates the constructor for a class */ void GenConstructor( PObjectBase class_obj, const EventVector &events ); /** * Generates the destructor for a class */ void GenDestructor( PObjectBase class_obj, const EventVector &events ); /** * Makes the objects construction, setting up the objects' and Layout properties. * The algorithm is simmilar to that used in the designer preview generation. */ void GenConstruction( PObjectBase obj, bool is_widget ); /** * Configures the object properties, both own and inherited ones. * Information for the class is given, because it will recursively make the * configuration in the "super-classes". */ void GenSettings( PObjectInfo info, PObjectBase obj); /** * Adds a control for a toolbar. Needs the objectinfo (wxWindow type) where * the template is found, and the objectbase for the control. */ void GenAddToolbar( PObjectInfo info, PObjectBase obj ); void GenPrivateEventHandlers(const EventVector &events); void GenVirtualEventHandlers( const EventVector &events, const wxString& eventHandlerPrefix, const wxString& eventHandlerPostfix ); public: /** * Convert a wxString to the "C/C++" format. */ static wxString ConvertCppString( wxString text); /** * Convert a path to a relative path. */ //static wxString ConvertToRelativePath( wxString path, wxString basePath); /** * Convert an XPM filename to the name of the XPM's internal character array. */ static wxString ConvertXpmName( const wxString& text ); CppCodeGenerator(); /** * Set the codewriter for the header file */ void SetHeaderWriter( PCodeWriter cw ) { m_header = cw; } /** * Set the codewriter for the source file */ void SetSourceWriter( PCodeWriter cw ) { m_source = cw; } /** * Configures the reference path for generating relative paths to * that passed as parameter. * * @note path is generated with the separators, '/', since on Windows * the compilers interpret path correctly. */ void UseRelativePath( bool relative = false, wxString basePath = wxString() ); /** * Set the First ID used during Code Generation. */ void SetFirstID( const unsigned int id ){ m_firstID = id; } /** * Generate the project's code */ bool GenerateCode( PObjectBase project ); /** * Generate an inherited class */ void GenerateInheritedClass( PObjectBase userClasses, PObjectBase form ); }; #endif //_CPP_CODE_GEN_ wxformbuilder-3.1.59/src/codegen/xrccg.cpp0000644000175000017500000001143511143440027020761 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #include "xrccg.h" #include "codewriter.h" #include "utils/typeconv.h" #include "utils/debug.h" #include "model/objectbase.h" #include "model/xrcfilter.h" #include void XrcCodeGenerator::SetWriter( PCodeWriter cw ) { m_cw = cw; } bool XrcCodeGenerator::GenerateCode( PObjectBase project ) { m_cw->Clear(); ticpp::Document doc; ticpp::Declaration decl( "1.0", "UTF-8", "yes" ); doc.LinkEndChild( &decl ); ticpp::Element element( "resource" ); element.SetAttribute( "xmlns", "http://www.wxwindows.org/wxxrc" ); element.SetAttribute( "version", "2.3.0.1" ); // If project is not actually a "Project", generate it if ( project->GetClassName() == wxT("Project") ) { for ( unsigned int i = 0; i < project->GetChildCount(); i++ ) { ticpp::Element* child = GetElement( project->GetChild( i ) ); if ( child ) { element.LinkEndChild( child ); delete child; } } } else { ticpp::Element* child = GetElement( project ); if ( child ) { element.LinkEndChild( child ); delete child; } } doc.LinkEndChild( &element ); TiXmlPrinter printer; printer.SetIndent( "\t" ); #if defined( __WXMSW__ ) printer.SetLineBreak( "\r\n" ); #elif defined( __WXMAC__ ) printer.SetLineBreak( "\r" ); #else printer.SetLineBreak( "\n" ); #endif doc.Accept( &printer ); const std::string& xrcFile = printer.Str(); m_cw->Write( _WXSTR( xrcFile ) ); return true; } ticpp::Element* XrcCodeGenerator::GetElement( PObjectBase obj, ticpp::Element* parent ) { ticpp::Element *element = NULL; IComponent *comp = obj->GetObjectInfo()->GetComponent(); if ( comp ) element = comp->ExportToXrc( obj.get() ); if ( element ) { std::string class_name = element->GetAttribute( "class" ); if ( class_name == "__dummyitem__" ) { delete element; element = NULL; if ( obj->GetChildCount() > 0 ) element = GetElement( obj->GetChild( 0 ) ); return element; } else if ( class_name == "spacer" ) { // Dirty hack to replace the containing sizeritem with the spacer if ( parent ) { parent->SetAttribute( "class", "spacer" ); for ( ticpp::Node* child = element->FirstChild( false ); child; child = child->NextSibling( false ) ) { parent->LinkEndChild( child->Clone().release() ); } delete element; return NULL; } } else if ( class_name == "wxFrame" ) { // Dirty hack to prevent sizer generation directly under a wxFrame // If there is a sizer, the size property of the wxFrame is ignored // when loading the xrc file at runtime if ( obj->GetPropertyAsInteger( _("xrc_skip_sizer") ) ) { for ( unsigned int i = 0; i < obj->GetChildCount(); i++ ) { ticpp::Element* aux = NULL; PObjectBase child = obj->GetChild( i ); if ( child->GetObjectInfo()->IsSubclassOf( wxT("sizer") ) ) { if ( child->GetChildCount() == 1 ) { PObjectBase sizeritem = child->GetChild( 0 ); if ( sizeritem ) { aux = GetElement( sizeritem->GetChild( 0 ), element ); } } } if ( !aux ) { aux = GetElement( child, element ); } if ( aux ) { element->LinkEndChild( aux ); delete aux; } } return element; } } for ( unsigned int i = 0; i < obj->GetChildCount(); i++ ) { ticpp::Element *aux = GetElement( obj->GetChild( i ), element ); if ( aux ) { element->LinkEndChild( aux ); delete aux; } } } else { // The componenet does not XRC element = new ticpp::Element( "object" ); element->SetAttribute( "class", "unknown" ); element->SetAttribute( "name", _STDSTR( obj->GetPropertyAsString( _( "name" ) ) ) ); } return element; } wxformbuilder-3.1.59/src/boost/enable_shared_from_this.hpp0000644000175000017500000000261611143440027024231 0ustar rrmulderrrmulder#ifndef BOOST_ENABLE_SHARED_FROM_THIS_HPP_INCLUDED #define BOOST_ENABLE_SHARED_FROM_THIS_HPP_INCLUDED // // enable_shared_from_this.hpp // // Copyright (c) 2002 Peter Dimov // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // http://www.boost.org/libs/smart_ptr/enable_shared_from_this.html // #include #include #include #include namespace boost { template class enable_shared_from_this { protected: enable_shared_from_this() { } enable_shared_from_this(enable_shared_from_this const &) { } enable_shared_from_this & operator=(enable_shared_from_this const &) { return *this; } ~enable_shared_from_this() { } public: shared_ptr shared_from_this() { shared_ptr p(_internal_weak_this); BOOST_ASSERT(p.get() == this); return p; } shared_ptr shared_from_this() const { shared_ptr p(_internal_weak_this); BOOST_ASSERT(p.get() == this); return p; } typedef T _internal_element_type; // for bcc 5.5.1 mutable weak_ptr<_internal_element_type> _internal_weak_this; }; } // namespace boost #endif // #ifndef BOOST_ENABLE_SHARED_FROM_THIS_HPP_INCLUDED wxformbuilder-3.1.59/src/boost/LICENSE_1_0.txt0000644000175000017500000000247211143440027021154 0ustar rrmulderrrmulderBoost Software License - Version 1.0 - August 17th, 2003 Permission is hereby granted, free of charge, to any person or organization obtaining a copy of the software and accompanying documentation covered by this license (the "Software") to use, reproduce, display, distribute, execute, and transmit the Software, and to prepare derivative works of the Software, and to permit third-parties to whom the Software is furnished to do so, all subject to the following: The copyright notices in the Software and this entire statement, including the above license grant, this restriction and the following disclaimer, must be included in all copies of the Software, in whole or in part, and all derivative works of the Software, unless such copies or derivative works are solely in the form of machine-executable object code generated by a source language processor. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. wxformbuilder-3.1.59/src/boost/intrusive_ptr.hpp0000644000175000017500000001331611143440027022317 0ustar rrmulderrrmulder#ifndef BOOST_INTRUSIVE_PTR_HPP_INCLUDED #define BOOST_INTRUSIVE_PTR_HPP_INCLUDED // // intrusive_ptr.hpp // // Copyright (c) 2001, 2002 Peter Dimov // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // See http://www.boost.org/libs/smart_ptr/intrusive_ptr.html for documentation. // #include #ifdef BOOST_MSVC // moved here to work around VC++ compiler crash # pragma warning(push) # pragma warning(disable:4284) // odd return type for operator-> #endif #include #include #include // for std::less #include // for std::basic_ostream namespace boost { // // intrusive_ptr // // A smart pointer that uses intrusive reference counting. // // Relies on unqualified calls to // // void intrusive_ptr_add_ref(T * p); // void intrusive_ptr_release(T * p); // // (p != 0) // // The object is responsible for destroying itself. // template class intrusive_ptr { private: typedef intrusive_ptr this_type; public: typedef T element_type; intrusive_ptr(): p_(0) { } intrusive_ptr(T * p, bool add_ref = true): p_(p) { if(p_ != 0 && add_ref) intrusive_ptr_add_ref(p_); } #if !defined(BOOST_NO_MEMBER_TEMPLATES) || defined(BOOST_MSVC6_MEMBER_TEMPLATES) template intrusive_ptr(intrusive_ptr const & rhs): p_(rhs.get()) { if(p_ != 0) intrusive_ptr_add_ref(p_); } #endif intrusive_ptr(intrusive_ptr const & rhs): p_(rhs.p_) { if(p_ != 0) intrusive_ptr_add_ref(p_); } ~intrusive_ptr() { if(p_ != 0) intrusive_ptr_release(p_); } #if !defined(BOOST_NO_MEMBER_TEMPLATES) || defined(BOOST_MSVC6_MEMBER_TEMPLATES) template intrusive_ptr & operator=(intrusive_ptr const & rhs) { this_type(rhs).swap(*this); return *this; } #endif intrusive_ptr & operator=(intrusive_ptr const & rhs) { this_type(rhs).swap(*this); return *this; } intrusive_ptr & operator=(T * rhs) { this_type(rhs).swap(*this); return *this; } T * get() const { return p_; } T & operator*() const { return *p_; } T * operator->() const { return p_; } #if defined(__SUNPRO_CC) && BOOST_WORKAROUND(__SUNPRO_CC, <= 0x530) operator bool () const { return p_ != 0; } #elif defined(__MWERKS__) && BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003)) typedef T * (this_type::*unspecified_bool_type)() const; operator unspecified_bool_type() const // never throws { return p_ == 0? 0: &this_type::get; } #else typedef T * this_type::*unspecified_bool_type; operator unspecified_bool_type () const { return p_ == 0? 0: &this_type::p_; } #endif // operator! is a Borland-specific workaround bool operator! () const { return p_ == 0; } void swap(intrusive_ptr & rhs) { T * tmp = p_; p_ = rhs.p_; rhs.p_ = tmp; } private: T * p_; }; template inline bool operator==(intrusive_ptr const & a, intrusive_ptr const & b) { return a.get() == b.get(); } template inline bool operator!=(intrusive_ptr const & a, intrusive_ptr const & b) { return a.get() != b.get(); } template inline bool operator==(intrusive_ptr const & a, T * b) { return a.get() == b; } template inline bool operator!=(intrusive_ptr const & a, T * b) { return a.get() != b; } template inline bool operator==(T * a, intrusive_ptr const & b) { return a == b.get(); } template inline bool operator!=(T * a, intrusive_ptr const & b) { return a != b.get(); } #if __GNUC__ == 2 && __GNUC_MINOR__ <= 96 // Resolve the ambiguity between our op!= and the one in rel_ops template inline bool operator!=(intrusive_ptr const & a, intrusive_ptr const & b) { return a.get() != b.get(); } #endif template inline bool operator<(intrusive_ptr const & a, intrusive_ptr const & b) { return std::less()(a.get(), b.get()); } template void swap(intrusive_ptr & lhs, intrusive_ptr & rhs) { lhs.swap(rhs); } // mem_fn support template T * get_pointer(intrusive_ptr const & p) { return p.get(); } template intrusive_ptr static_pointer_cast(intrusive_ptr const & p) { return static_cast(p.get()); } template intrusive_ptr const_pointer_cast(intrusive_ptr const & p) { return const_cast(p.get()); } template intrusive_ptr dynamic_pointer_cast(intrusive_ptr const & p) { return dynamic_cast(p.get()); } // operator<< #if defined(__GNUC__) && (__GNUC__ < 3) template std::ostream & operator<< (std::ostream & os, intrusive_ptr const & p) { os << p.get(); return os; } #else # if defined(BOOST_MSVC) && BOOST_WORKAROUND(BOOST_MSVC, <= 1200 && __SGI_STL_PORT) // MSVC6 has problems finding std::basic_ostream through the using declaration in namespace _STL using std::basic_ostream; template basic_ostream & operator<< (basic_ostream & os, intrusive_ptr const & p) # else template std::basic_ostream & operator<< (std::basic_ostream & os, intrusive_ptr const & p) # endif { os << p.get(); return os; } #endif } // namespace boost #ifdef BOOST_MSVC # pragma warning(pop) #endif #endif // #ifndef BOOST_INTRUSIVE_PTR_HPP_INCLUDED wxformbuilder-3.1.59/src/boost/readme.txt0000644000175000017500000000075211143440027020667 0ustar rrmulderrrmulderwxFormBuilder Boost Smart Pointer --------------------------------- 1. A subset of boost library (v.1.31.0) wxFormBuilder just uses smart pointers from boost (shared_ptr/weak_ptr). There is no modifications with original boost, I only remove files that it's not necessary for building. You don't have to build this library because there are only headers files. You can find the complete boost library on http://boost.org. Enjoy, The wxFormBuilder Team http://wxformbuilder.orgwxformbuilder-3.1.59/src/boost/scoped_array.hpp0000644000175000017500000000574211143440027022061 0ustar rrmulderrrmulder#ifndef BOOST_SCOPED_ARRAY_HPP_INCLUDED #define BOOST_SCOPED_ARRAY_HPP_INCLUDED // (C) Copyright Greg Colvin and Beman Dawes 1998, 1999. // Copyright (c) 2001, 2002 Peter Dimov // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // http://www.boost.org/libs/smart_ptr/scoped_array.htm // #include #include #include // in case ptrdiff_t not in std #include #include // for std::ptrdiff_t namespace boost { // Debug hooks #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) void sp_array_constructor_hook(void * p); void sp_array_destructor_hook(void * p); #endif // scoped_array extends scoped_ptr to arrays. Deletion of the array pointed to // is guaranteed, either on destruction of the scoped_array or via an explicit // reset(). Use shared_array or std::vector if your needs are more complex. template class scoped_array // noncopyable { private: T * ptr; scoped_array(scoped_array const &); scoped_array & operator=(scoped_array const &); typedef scoped_array this_type; public: typedef T element_type; explicit scoped_array(T * p = 0) : ptr(p) // never throws { #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) boost::sp_array_constructor_hook(ptr); #endif } ~scoped_array() // never throws { #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) boost::sp_array_destructor_hook(ptr); #endif boost::checked_array_delete(ptr); } void reset(T * p = 0) // never throws { BOOST_ASSERT(p == 0 || p != ptr); // catch self-reset errors this_type(p).swap(*this); } T & operator[](std::ptrdiff_t i) const // never throws { BOOST_ASSERT(ptr != 0); BOOST_ASSERT(i >= 0); return ptr[i]; } T * get() const // never throws { return ptr; } // implicit conversion to "bool" #if defined(__SUNPRO_CC) && BOOST_WORKAROUND(__SUNPRO_CC, <= 0x530) operator bool () const { return ptr != 0; } #elif defined(__MWERKS__) && BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003)) typedef T * (this_type::*unspecified_bool_type)() const; operator unspecified_bool_type() const // never throws { return ptr == 0? 0: &this_type::get; } #else typedef T * this_type::*unspecified_bool_type; operator unspecified_bool_type() const // never throws { return ptr == 0? 0: &this_type::ptr; } #endif bool operator! () const // never throws { return ptr == 0; } void swap(scoped_array & b) // never throws { T * tmp = b.ptr; b.ptr = ptr; ptr = tmp; } }; template inline void swap(scoped_array & a, scoped_array & b) // never throws { a.swap(b); } } // namespace boost #endif // #ifndef BOOST_SCOPED_ARRAY_HPP_INCLUDED wxformbuilder-3.1.59/src/boost/shared_ptr.hpp0000644000175000017500000002660011143440027021535 0ustar rrmulderrrmulder#ifndef BOOST_SHARED_PTR_HPP_INCLUDED #define BOOST_SHARED_PTR_HPP_INCLUDED // // shared_ptr.hpp // // (C) Copyright Greg Colvin and Beman Dawes 1998, 1999. // Copyright (c) 2001, 2002, 2003 Peter Dimov // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // See http://www.boost.org/libs/smart_ptr/shared_ptr.htm for documentation. // #include // for broken compiler workarounds #if defined(BOOST_NO_MEMBER_TEMPLATES) && !defined(BOOST_MSVC6_MEMBER_TEMPLATES) #include #else #include #include #include #include #include #include // for std::auto_ptr #include // for std::swap #include // for std::less #include // for std::bad_cast #include // for std::basic_ostream #ifdef BOOST_MSVC // moved here to work around VC++ compiler crash # pragma warning(push) # pragma warning(disable:4284) // odd return type for operator-> #endif namespace boost { template class weak_ptr; template class enable_shared_from_this; namespace detail { struct static_cast_tag {}; struct const_cast_tag {}; struct dynamic_cast_tag {}; struct polymorphic_cast_tag {}; template struct shared_ptr_traits { typedef T & reference; }; template<> struct shared_ptr_traits { typedef void reference; }; #if !defined(BOOST_NO_CV_VOID_SPECIALIZATIONS) template<> struct shared_ptr_traits { typedef void reference; }; template<> struct shared_ptr_traits { typedef void reference; }; template<> struct shared_ptr_traits { typedef void reference; }; #endif // enable_shared_from_this support template void sp_enable_shared_from_this( shared_count const & pn, boost::enable_shared_from_this const * pe, Y const * px ) { if(pe != 0) pe->_internal_weak_this._internal_assign(const_cast(px), pn); } inline void sp_enable_shared_from_this( shared_count const & /*pn*/, ... ) { } } // namespace detail // // shared_ptr // // An enhanced relative of scoped_ptr with reference counted copy semantics. // The object pointed to is deleted when the last shared_ptr pointing to it // is destroyed or reset. // template class shared_ptr { private: // Borland 5.5.1 specific workaround typedef shared_ptr this_type; public: typedef T element_type; typedef T value_type; typedef T * pointer; typedef typename detail::shared_ptr_traits::reference reference; shared_ptr(): px(0), pn() // never throws in 1.30+ { } template explicit shared_ptr( Y * p ): px( p ), pn( p ) // Y must be complete { detail::sp_enable_shared_from_this( pn, p, p ); } // // Requirements: D's copy constructor must not throw // // shared_ptr will release p by calling d(p) // template shared_ptr(Y * p, D d): px(p), pn(p, d) { detail::sp_enable_shared_from_this( pn, p, p ); } // generated copy constructor, assignment, destructor are fine... // except that Borland C++ has a bug, and g++ with -Wsynth warns #if defined(__BORLANDC__) || defined(__GNUC__) shared_ptr & operator=(shared_ptr const & r) // never throws { px = r.px; pn = r.pn; // shared_count::op= doesn't throw return *this; } #endif template explicit shared_ptr(weak_ptr const & r): pn(r.pn) // may throw { // it is now safe to copy r.px, as pn(r.pn) did not throw px = r.px; } template shared_ptr(shared_ptr const & r): px(r.px), pn(r.pn) // never throws { } template shared_ptr(shared_ptr const & r, detail::static_cast_tag): px(static_cast(r.px)), pn(r.pn) { } template shared_ptr(shared_ptr const & r, detail::const_cast_tag): px(const_cast(r.px)), pn(r.pn) { } template shared_ptr(shared_ptr const & r, detail::dynamic_cast_tag): px(dynamic_cast(r.px)), pn(r.pn) { if(px == 0) // need to allocate new counter -- the cast failed { pn = detail::shared_count(); } } template shared_ptr(shared_ptr const & r, detail::polymorphic_cast_tag): px(dynamic_cast(r.px)), pn(r.pn) { if(px == 0) { boost::throw_exception(std::bad_cast()); } } #ifndef BOOST_NO_AUTO_PTR template explicit shared_ptr(std::auto_ptr & r): px(r.get()), pn() { Y * tmp = r.get(); pn = detail::shared_count(r); detail::sp_enable_shared_from_this( pn, tmp, tmp ); } #endif #if !defined(BOOST_MSVC) || (BOOST_MSVC > 1200) template shared_ptr & operator=(shared_ptr const & r) // never throws { px = r.px; pn = r.pn; // shared_count::op= doesn't throw return *this; } #endif #ifndef BOOST_NO_AUTO_PTR template shared_ptr & operator=(std::auto_ptr & r) { this_type(r).swap(*this); return *this; } #endif void reset() // never throws in 1.30+ { this_type().swap(*this); } template void reset(Y * p) // Y must be complete { BOOST_ASSERT(p == 0 || p != px); // catch self-reset errors this_type(p).swap(*this); } template void reset(Y * p, D d) { this_type(p, d).swap(*this); } reference operator* () const // never throws { BOOST_ASSERT(px != 0); return *px; } T * operator-> () const // never throws { BOOST_ASSERT(px != 0); return px; } T * get() const // never throws { return px; } // implicit conversion to "bool" #if defined(__SUNPRO_CC) && BOOST_WORKAROUND(__SUNPRO_CC, <= 0x530) operator bool () const { return px != 0; } #elif \ ( defined(__MWERKS__) && BOOST_WORKAROUND(__MWERKS__, < 0x3200) ) || \ ( defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ < 304) ) typedef T * (this_type::*unspecified_bool_type)() const; operator unspecified_bool_type() const // never throws { return px == 0? 0: &this_type::get; } #else typedef T * this_type::*unspecified_bool_type; operator unspecified_bool_type() const // never throws { return px == 0? 0: &this_type::px; } #endif // operator! is redundant, but some compilers need it bool operator! () const // never throws { return px == 0; } bool unique() const // never throws { return pn.unique(); } long use_count() const // never throws { return pn.use_count(); } void swap(shared_ptr & other) // never throws { std::swap(px, other.px); pn.swap(other.pn); } template bool _internal_less(shared_ptr const & rhs) const { return pn < rhs.pn; } void * _internal_get_deleter(std::type_info const & ti) const { return pn.get_deleter(ti); } // Tasteless as this may seem, making all members public allows member templates // to work in the absence of member template friends. (Matthew Langston) #ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS private: template friend class shared_ptr; template friend class weak_ptr; #endif T * px; // contained pointer detail::shared_count pn; // reference counter }; // shared_ptr template inline bool operator==(shared_ptr const & a, shared_ptr const & b) { return a.get() == b.get(); } template inline bool operator!=(shared_ptr const & a, shared_ptr const & b) { return a.get() != b.get(); } #if __GNUC__ == 2 && __GNUC_MINOR__ <= 96 // Resolve the ambiguity between our op!= and the one in rel_ops template inline bool operator!=(shared_ptr const & a, shared_ptr const & b) { return a.get() != b.get(); } #endif template inline bool operator<(shared_ptr const & a, shared_ptr const & b) { return a._internal_less(b); } template inline void swap(shared_ptr & a, shared_ptr & b) { a.swap(b); } template shared_ptr static_pointer_cast(shared_ptr const & r) { return shared_ptr(r, detail::static_cast_tag()); } template shared_ptr const_pointer_cast(shared_ptr const & r) { return shared_ptr(r, detail::const_cast_tag()); } template shared_ptr dynamic_pointer_cast(shared_ptr const & r) { return shared_ptr(r, detail::dynamic_cast_tag()); } // shared_*_cast names are deprecated. Use *_pointer_cast instead. template shared_ptr shared_static_cast(shared_ptr const & r) { return shared_ptr(r, detail::static_cast_tag()); } template shared_ptr shared_dynamic_cast(shared_ptr const & r) { return shared_ptr(r, detail::dynamic_cast_tag()); } template shared_ptr shared_polymorphic_cast(shared_ptr const & r) { return shared_ptr(r, detail::polymorphic_cast_tag()); } template shared_ptr shared_polymorphic_downcast(shared_ptr const & r) { BOOST_ASSERT(dynamic_cast(r.get()) == r.get()); return shared_static_cast(r); } // get_pointer() enables boost::mem_fn to recognize shared_ptr template inline T * get_pointer(shared_ptr const & p) { return p.get(); } // operator<< #if defined(__GNUC__) && (__GNUC__ < 3) template std::ostream & operator<< (std::ostream & os, shared_ptr const & p) { os << p.get(); return os; } #else # if defined(BOOST_MSVC) && BOOST_WORKAROUND(BOOST_MSVC, <= 1200 && __SGI_STL_PORT) // MSVC6 has problems finding std::basic_ostream through the using declaration in namespace _STL using std::basic_ostream; template basic_ostream & operator<< (basic_ostream & os, shared_ptr const & p) # else template std::basic_ostream & operator<< (std::basic_ostream & os, shared_ptr const & p) # endif { os << p.get(); return os; } #endif // get_deleter (experimental) #if ( defined(__GNUC__) && BOOST_WORKAROUND(__GNUC__, < 3) ) || \ ( defined(__EDG_VERSION__) && BOOST_WORKAROUND(__EDG_VERSION__, <= 238) ) || \ ( defined(__HP_aCC) && BOOST_WORKAROUND(__HP_aCC, <= 33500) ) // g++ 2.9x doesn't allow static_cast(void *) // apparently EDG 2.38 and HP aCC A.03.35 also don't accept it template D * get_deleter(shared_ptr const & p) { void const * q = p._internal_get_deleter(typeid(D)); return const_cast(static_cast(q)); } #else template D * get_deleter(shared_ptr const & p) { return static_cast(p._internal_get_deleter(typeid(D))); } #endif } // namespace boost #ifdef BOOST_MSVC # pragma warning(pop) #endif #endif // #if defined(BOOST_NO_MEMBER_TEMPLATES) && !defined(BOOST_MSVC6_MEMBER_TEMPLATES) #endif // #ifndef BOOST_SHARED_PTR_HPP_INCLUDED wxformbuilder-3.1.59/src/boost/smart_ptr.hpp0000644000175000017500000000133711143440027021415 0ustar rrmulderrrmulder// // smart_ptr.hpp // // For convenience, this header includes the rest of the smart // pointer library headers. // // Copyright (c) 2003 Peter Dimov Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // // http://www.boost.org/libs/smart_ptr/smart_ptr.htm // #include #include #include #include #include #if !defined(BOOST_NO_MEMBER_TEMPLATES) || defined(BOOST_MSVC6_MEMBER_TEMPLATES) # include # include # include #endif wxformbuilder-3.1.59/src/boost/checked_delete.hpp0000644000175000017500000000306511143440027022312 0ustar rrmulderrrmulder#ifndef BOOST_CHECKED_DELETE_HPP_INCLUDED #define BOOST_CHECKED_DELETE_HPP_INCLUDED // MS compatible compilers support #pragma once #if defined(_MSC_VER) && (_MSC_VER >= 1020) # pragma once #endif // // boost/checked_delete.hpp // // Copyright (c) 2002, 2003 Peter Dimov // Copyright (c) 2003 Daniel Frey // Copyright (c) 2003 Howard Hinnant // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // See http://www.boost.org/libs/utility/checked_delete.html for documentation. // namespace boost { // verify that types are complete for increased safety template inline void checked_delete(T * x) { // intentionally complex - simplification causes regressions typedef char type_must_be_complete[ sizeof(T)? 1: -1 ]; (void) sizeof(type_must_be_complete); delete x; } template inline void checked_array_delete(T * x) { typedef char type_must_be_complete[ sizeof(T)? 1: -1 ]; (void) sizeof(type_must_be_complete); delete [] x; } template struct checked_deleter { typedef void result_type; typedef T * argument_type; void operator()(T * x) const { // boost:: disables ADL boost::checked_delete(x); } }; template struct checked_array_deleter { typedef void result_type; typedef T * argument_type; void operator()(T * x) const { boost::checked_array_delete(x); } }; } // namespace boost #endif // #ifndef BOOST_CHECKED_DELETE_HPP_INCLUDED wxformbuilder-3.1.59/src/boost/weak_ptr.hpp0000644000175000017500000001020311143440027021206 0ustar rrmulderrrmulder#ifndef BOOST_WEAK_PTR_HPP_INCLUDED #define BOOST_WEAK_PTR_HPP_INCLUDED // // weak_ptr.hpp // // Copyright (c) 2001, 2002, 2003 Peter Dimov // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // See http://www.boost.org/libs/smart_ptr/weak_ptr.htm for documentation. // #include #ifdef BOOST_MSVC // moved here to work around VC++ compiler crash # pragma warning(push) # pragma warning(disable:4284) // odd return type for operator-> #endif namespace boost { template class weak_ptr { private: // Borland 5.5.1 specific workarounds typedef weak_ptr this_type; public: typedef T element_type; weak_ptr(): px(0), pn() // never throws in 1.30+ { } // generated copy constructor, assignment, destructor are fine // // The "obvious" converting constructor implementation: // // template // weak_ptr(weak_ptr const & r): px(r.px), pn(r.pn) // never throws // { // } // // has a serious problem. // // r.px may already have been invalidated. The px(r.px) // conversion may require access to *r.px (virtual inheritance). // // It is not possible to avoid spurious access violations since // in multithreaded programs r.px may be invalidated at any point. // template weak_ptr(weak_ptr const & r): pn(r.pn) // never throws { px = r.lock().get(); } template weak_ptr(shared_ptr const & r): px(r.px), pn(r.pn) // never throws { } #if !defined(BOOST_MSVC) || (BOOST_MSVC > 1200) template weak_ptr & operator=(weak_ptr const & r) // never throws { px = r.lock().get(); pn = r.pn; return *this; } template weak_ptr & operator=(shared_ptr const & r) // never throws { px = r.px; pn = r.pn; return *this; } #endif shared_ptr lock() const // never throws { #if defined(BOOST_HAS_THREADS) // optimization: avoid throw overhead if(expired()) { return shared_ptr(); } try { return shared_ptr(*this); } catch(bad_weak_ptr const &) { // Q: how can we get here? // A: another thread may have invalidated r after the use_count test above. return shared_ptr(); } #else // optimization: avoid try/catch overhead when single threaded return expired()? shared_ptr(): shared_ptr(*this); #endif } long use_count() const // never throws { return pn.use_count(); } bool expired() const // never throws { return pn.use_count() == 0; } void reset() // never throws in 1.30+ { this_type().swap(*this); } void swap(this_type & other) // never throws { std::swap(px, other.px); pn.swap(other.pn); } void _internal_assign(T * px2, detail::shared_count const & pn2) { px = px2; pn = pn2; } template bool _internal_less(weak_ptr const & rhs) const { return pn < rhs.pn; } // Tasteless as this may seem, making all members public allows member templates // to work in the absence of member template friends. (Matthew Langston) #ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS private: template friend class weak_ptr; template friend class shared_ptr; #endif T * px; // contained pointer detail::weak_count pn; // reference counter }; // weak_ptr template inline bool operator<(weak_ptr const & a, weak_ptr const & b) { return a._internal_less(b); } template void swap(weak_ptr & a, weak_ptr & b) { a.swap(b); } // deprecated, provided for backward compatibility template shared_ptr make_shared(weak_ptr const & r) { return r.lock(); } } // namespace boost #ifdef BOOST_MSVC # pragma warning(pop) #endif #endif // #ifndef BOOST_WEAK_PTR_HPP_INCLUDED wxformbuilder-3.1.59/src/boost/config.hpp0000644000175000017500000000400211143440027020637 0ustar rrmulderrrmulder// Boost config.hpp configuration header file ------------------------------// // (C) Copyright John Maddock 2002. // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org/libs/config for most recent version. // Boost config.hpp policy and rationale documentation has been moved to // http://www.boost.org/libs/config // // CAUTION: This file is intended to be completely stable - // DO NOT MODIFY THIS FILE! // #ifndef BOOST_CONFIG_HPP #define BOOST_CONFIG_HPP // if we don't have a user config, then use the default location: #if !defined(BOOST_USER_CONFIG) && !defined(BOOST_NO_USER_CONFIG) # define BOOST_USER_CONFIG #endif // include it first: #ifdef BOOST_USER_CONFIG # include BOOST_USER_CONFIG #endif // if we don't have a compiler config set, try and find one: #if !defined(BOOST_COMPILER_CONFIG) && !defined(BOOST_NO_COMPILER_CONFIG) && !defined(BOOST_NO_CONFIG) # include #endif // if we have a compiler config, include it now: #ifdef BOOST_COMPILER_CONFIG # include BOOST_COMPILER_CONFIG #endif // if we don't have a std library config set, try and find one: #if !defined(BOOST_STDLIB_CONFIG) && !defined(BOOST_NO_STDLIB_CONFIG) && !defined(BOOST_NO_CONFIG) # include #endif // if we have a std library config, include it now: #ifdef BOOST_STDLIB_CONFIG # include BOOST_STDLIB_CONFIG #endif // if we don't have a platform config set, try and find one: #if !defined(BOOST_PLATFORM_CONFIG) && !defined(BOOST_NO_PLATFORM_CONFIG) && !defined(BOOST_NO_CONFIG) # include #endif // if we have a platform config, include it now: #ifdef BOOST_PLATFORM_CONFIG # include BOOST_PLATFORM_CONFIG #endif // get config suffix code: #include #endif // BOOST_CONFIG_HPP wxformbuilder-3.1.59/src/boost/throw_exception.hpp0000644000175000017500000000156411143440027022625 0ustar rrmulderrrmulder#ifndef BOOST_THROW_EXCEPTION_HPP_INCLUDED #define BOOST_THROW_EXCEPTION_HPP_INCLUDED // MS compatible compilers support #pragma once #if defined(_MSC_VER) && (_MSC_VER >= 1020) # pragma once #endif // // boost/throw_exception.hpp // // Copyright (c) 2002 Peter Dimov and Multi Media Ltd. // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // http://www.boost.org/libs/utility/throw_exception.html // #include #ifdef BOOST_NO_EXCEPTIONS # include #endif namespace boost { #ifdef BOOST_NO_EXCEPTIONS void throw_exception(std::exception const & e); // user defined #else template inline void throw_exception(E const & e) { throw e; } #endif } // namespace boost #endif // #ifndef BOOST_THROW_EXCEPTION_HPP_INCLUDED wxformbuilder-3.1.59/src/boost/shared_array.hpp0000644000175000017500000000764711143440027022060 0ustar rrmulderrrmulder#ifndef BOOST_SHARED_ARRAY_HPP_INCLUDED #define BOOST_SHARED_ARRAY_HPP_INCLUDED // // shared_array.hpp // // (C) Copyright Greg Colvin and Beman Dawes 1998, 1999. // Copyright (c) 2001, 2002 Peter Dimov // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // See http://www.boost.org/libs/smart_ptr/shared_array.htm for documentation. // #include // for broken compiler workarounds #if defined(BOOST_NO_MEMBER_TEMPLATES) && !defined(BOOST_MSVC6_MEMBER_TEMPLATES) #include #else #include #include #include #include #include // for std::ptrdiff_t #include // for std::swap #include // for std::less namespace boost { // // shared_array // // shared_array extends shared_ptr to arrays. // The array pointed to is deleted when the last shared_array pointing to it // is destroyed or reset. // template class shared_array { private: // Borland 5.5.1 specific workarounds typedef checked_array_deleter deleter; typedef shared_array this_type; public: typedef T element_type; explicit shared_array(T * p = 0): px(p), pn(p, deleter()) { } // // Requirements: D's copy constructor must not throw // // shared_array will release p by calling d(p) // template shared_array(T * p, D d): px(p), pn(p, d) { } // generated copy constructor, assignment, destructor are fine void reset(T * p = 0) { BOOST_ASSERT(p == 0 || p != px); this_type(p).swap(*this); } template void reset(T * p, D d) { this_type(p, d).swap(*this); } T & operator[] (std::ptrdiff_t i) const // never throws { BOOST_ASSERT(px != 0); BOOST_ASSERT(i >= 0); return px[i]; } T * get() const // never throws { return px; } // implicit conversion to "bool" #if defined(__SUNPRO_CC) && BOOST_WORKAROUND(__SUNPRO_CC, <= 0x530) operator bool () const { return px != 0; } #elif defined(__MWERKS__) && BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003)) typedef T * (this_type::*unspecified_bool_type)() const; operator unspecified_bool_type() const // never throws { return px == 0? 0: &this_type::get; } #else typedef T * this_type::*unspecified_bool_type; operator unspecified_bool_type() const // never throws { return px == 0? 0: &this_type::px; } #endif bool operator! () const // never throws { return px == 0; } bool unique() const // never throws { return pn.unique(); } long use_count() const // never throws { return pn.use_count(); } void swap(shared_array & other) // never throws { std::swap(px, other.px); pn.swap(other.pn); } private: T * px; // contained pointer detail::shared_count pn; // reference counter }; // shared_array template inline bool operator==(shared_array const & a, shared_array const & b) // never throws { return a.get() == b.get(); } template inline bool operator!=(shared_array const & a, shared_array const & b) // never throws { return a.get() != b.get(); } template inline bool operator<(shared_array const & a, shared_array const & b) // never throws { return std::less()(a.get(), b.get()); } template void swap(shared_array & a, shared_array & b) // never throws { a.swap(b); } } // namespace boost #endif // #if defined(BOOST_NO_MEMBER_TEMPLATES) && !defined(BOOST_MSVC6_MEMBER_TEMPLATES) #endif // #ifndef BOOST_SHARED_ARRAY_HPP_INCLUDED wxformbuilder-3.1.59/src/boost/assert.hpp0000644000175000017500000000176311143440027020706 0ustar rrmulderrrmulder// // boost/assert.hpp - BOOST_ASSERT(expr) // // Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd. // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // Note: There are no include guards. This is intentional. // // See http://www.boost.org/libs/utility/assert.html for documentation. // #undef BOOST_ASSERT #if defined(BOOST_DISABLE_ASSERTS) # define BOOST_ASSERT(expr) ((void)0) #elif defined(BOOST_ENABLE_ASSERT_HANDLER) #include namespace boost { void assertion_failed(char const * expr, char const * function, char const * file, long line); // user defined } // namespace boost #define BOOST_ASSERT(expr) ((expr)? ((void)0): ::boost::assertion_failed(#expr, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__)) #else # include // .h to support old libraries w/o - effect is the same # define BOOST_ASSERT(expr) assert(expr) #endif wxformbuilder-3.1.59/src/boost/scoped_ptr.hpp0000644000175000017500000000657711143440027021557 0ustar rrmulderrrmulder#ifndef BOOST_SCOPED_PTR_HPP_INCLUDED #define BOOST_SCOPED_PTR_HPP_INCLUDED // (C) Copyright Greg Colvin and Beman Dawes 1998, 1999. // Copyright (c) 2001, 2002 Peter Dimov // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // http://www.boost.org/libs/smart_ptr/scoped_ptr.htm // #include #include #include #ifndef BOOST_NO_AUTO_PTR # include // for std::auto_ptr #endif namespace boost { // Debug hooks #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) void sp_scalar_constructor_hook(void * p); void sp_scalar_destructor_hook(void * p); #endif // scoped_ptr mimics a built-in pointer except that it guarantees deletion // of the object pointed to, either on destruction of the scoped_ptr or via // an explicit reset(). scoped_ptr is a simple solution for simple needs; // use shared_ptr or std::auto_ptr if your needs are more complex. template class scoped_ptr // noncopyable { private: T * ptr; scoped_ptr(scoped_ptr const &); scoped_ptr & operator=(scoped_ptr const &); typedef scoped_ptr this_type; public: typedef T element_type; explicit scoped_ptr(T * p = 0): ptr(p) // never throws { #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) boost::sp_scalar_constructor_hook(ptr); #endif } #ifndef BOOST_NO_AUTO_PTR explicit scoped_ptr(std::auto_ptr p): ptr(p.release()) // never throws { #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) boost::sp_scalar_constructor_hook(ptr); #endif } #endif ~scoped_ptr() // never throws { #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) boost::sp_scalar_destructor_hook(ptr); #endif boost::checked_delete(ptr); } void reset(T * p = 0) // never throws { BOOST_ASSERT(p == 0 || p != ptr); // catch self-reset errors this_type(p).swap(*this); } T & operator*() const // never throws { BOOST_ASSERT(ptr != 0); return *ptr; } T * operator->() const // never throws { BOOST_ASSERT(ptr != 0); return ptr; } T * get() const // never throws { return ptr; } // implicit conversion to "bool" #if defined(__SUNPRO_CC) && BOOST_WORKAROUND(__SUNPRO_CC, <= 0x530) operator bool () const { return ptr != 0; } #elif defined(__MWERKS__) && BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003)) typedef T * (this_type::*unspecified_bool_type)() const; operator unspecified_bool_type() const // never throws { return ptr == 0? 0: &this_type::get; } #else typedef T * this_type::*unspecified_bool_type; operator unspecified_bool_type() const // never throws { return ptr == 0? 0: &this_type::ptr; } #endif bool operator! () const // never throws { return ptr == 0; } void swap(scoped_ptr & b) // never throws { T * tmp = b.ptr; b.ptr = ptr; ptr = tmp; } }; template inline void swap(scoped_ptr & a, scoped_ptr & b) // never throws { a.swap(b); } // get_pointer(p) is a generic way to say p.get() template inline T * get_pointer(scoped_ptr const & p) { return p.get(); } } // namespace boost #endif // #ifndef BOOST_SCOPED_PTR_HPP_INCLUDED wxformbuilder-3.1.59/src/utils/typeconv.cpp0000644000175000017500000006070011143440027021255 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #include "typeconv.h" #include #include "utils/stringutils.h" #include "utils/debug.h" #include "rad/bitmaps.h" #include #include #include #include "rad/appdata.h" #include #include #include #include //////////////////////////////////// // Assuming that the locale is constant throughout one execution, // store the locale so that numbers can be stored in the "C" locale, // but the rest of the program works in the user's locale. class LocaleFinder { private: char* m_locale; public: LocaleFinder() { // get current locale char* localePtr = ::setlocale( LC_NUMERIC, 0 ); size_t size = ::strlen( localePtr ) + 1; m_locale = new char[ size ]; ::strncpy( m_locale, localePtr, size ); } ~LocaleFinder() { delete [] m_locale; } const char* GetString() { return m_locale; } }; // Unfortunately, the locale is "C" at the start of execution, and is changed to the correct locale // sometime later. This means that the LocaleFinder object cannot be simple declared like this: // static LocaleFinder s_locale; // Instead, it must be created the first time that it is used, stored for the duration of the program, // and deleted on close. class LocaleHolder { private: LocaleFinder* m_finder; public: LocaleHolder() : m_finder( 0 ) { } ~LocaleHolder() { delete m_finder; } const char* GetString() { if ( 0 == m_finder ) { m_finder = new LocaleFinder; } return m_finder->GetString(); } }; // Creating this object will determine the current locale (when needed) and store it for the duration of the program static LocaleHolder s_locale; // Utility class for switching to "C" locale and back class LocaleSwitcher { private: const char* m_locale; public: LocaleSwitcher() { m_locale = s_locale.GetString(); // Get the locale first, or it will be lost! ::setlocale( LC_NUMERIC, "C" ); } ~LocaleSwitcher() { ::setlocale( LC_NUMERIC, m_locale ); } }; //////////////////////////////////// using namespace TypeConv; wxString TypeConv::_StringToWxString(const std::string &str) { return _StringToWxString(str.c_str()); } wxString TypeConv::_StringToWxString(const char *str) { wxString newstr( str, wxConvUTF8 ); return newstr; } std::string TypeConv::_WxStringToString(const wxString &str) { std::string newstr( str.mb_str(wxConvUTF8) ); return newstr; } std::string TypeConv::_WxStringToAnsiString(const wxString &str) { // std::string newstr( str.mb_str(wxConvISO8859_1) ); setlocale(LC_ALL, ""); size_t len = wcstombs(NULL, str.c_str(), 0); std::vector buf(len + 1); wcstombs(&buf[0], str.c_str(), len); return std::string(&buf[0]); } bool TypeConv::StringToPoint(const wxString &val, wxPoint *point) { wxPoint result; bool error = false; wxString str_x,str_y; long val_x = -1, val_y = -1; if (val != wxT("")) { wxStringTokenizer tkz(val, wxT(",")); if (tkz.HasMoreTokens()) { str_x = tkz.GetNextToken(); str_x.Trim(true); str_x.Trim(false); if (tkz.HasMoreTokens()) { str_y = tkz.GetNextToken(); str_y.Trim(true); str_y.Trim(false); } else error = true; } else error = true; if (!error) error = !str_x.ToLong(&val_x); if (!error) error = !str_y.ToLong(&val_y); if (!error) result = wxPoint(val_x,val_y); } else result = wxDefaultPosition; if (error) result = wxDefaultPosition; point->x = result.x; point->y = result.y; return !error; } wxPoint TypeConv::StringToPoint (const wxString &val) { wxPoint result; StringToPoint (val,&result); return result; } wxSize TypeConv::StringToSize (const wxString &val) { wxPoint point = StringToPoint(val); return wxSize(point.x, point.y); } int TypeConv::BitlistToInt (const wxString &str) { int result = 0; wxStringTokenizer tkz(str, wxT("|")); while (tkz.HasMoreTokens()) { wxString token; token = tkz.GetNextToken(); token.Trim(true); token.Trim(false); result |= GetMacroValue(token); } return result; } wxString TypeConv::PointToString(const wxPoint &point) { wxString value = wxString::Format(wxT("%d,%d"),point.x,point.y); return value; } wxString TypeConv::SizeToString(const wxSize &size) { wxString value = wxString::Format(wxT("%d,%d"),size.GetWidth(), size.GetHeight()); return value; } int TypeConv::GetMacroValue(const wxString &str) { int value = 0; PMacroDictionary dic = MacroDictionary::GetInstance(); dic->SearchMacro( str, &value ); return value; } int TypeConv::StringToInt(const wxString &str) { long l = 0; str.ToLong(&l); return (int)l; } wxFontContainer TypeConv::StringToFont (const wxString &str) { wxFontContainer font; // face name, style, weight, point size, family, underlined wxStringTokenizer tkz( str, wxT(",") ); if ( tkz.HasMoreTokens() ) { wxString faceName = tkz.GetNextToken(); faceName.Trim( true ); faceName.Trim( false ); font.SetFaceName( faceName ); } if ( tkz.HasMoreTokens() ) { long l_style; wxString s_style = tkz.GetNextToken(); if ( s_style.ToLong( &l_style ) ) { font.SetStyle( (int)l_style ); } } if ( tkz.HasMoreTokens() ) { long l_weight; wxString s_weight = tkz.GetNextToken(); if ( s_weight.ToLong( &l_weight ) ) { font.SetWeight( (int)l_weight ); } } if ( tkz.HasMoreTokens() ) { long l_size; wxString s_size = tkz.GetNextToken(); if ( s_size.ToLong( &l_size ) ) { font.SetPointSize( (int)l_size ); } } if ( tkz.HasMoreTokens() ) { long l_family; wxString s_family = tkz.GetNextToken(); if ( s_family.ToLong( &l_family ) ) { font.SetFamily( (int)l_family ); } } if ( tkz.HasMoreTokens() ) { long l_underlined; wxString s_underlined = tkz.GetNextToken(); if ( s_underlined.ToLong( &l_underlined ) ) { font.SetUnderlined( l_underlined != 0 ); } } return font; } wxString TypeConv::FontToString (const wxFontContainer &font) { // face name, style, weight, point size, family, underlined return wxString::Format( wxT("%s,%d,%d,%d,%d,%d"), font.GetFaceName().c_str(), font.GetStyle(), font.GetWeight(), font.GetPointSize(), font.GetFamily(), font.GetUnderlined() ? 1 : 0 ); } wxBitmap TypeConv::StringToBitmap( const wxString& filename ) { #ifndef __WXFB_DEBUG__ wxLogNull stopLogging; #endif // Get path from bitmap property size_t semicolonIndex = filename.find( wxT(";") ); wxString path = filename; if ( semicolonIndex != filename.npos ) { path = filename.substr( 0, semicolonIndex ); } // No value - default bitmap if ( path.empty() ) { return AppBitmaps::GetBitmap( wxT("unknown") ); } // Setup the working directory to the project path - paths should be saved in the .fbp file relative to the location // of the .fbp file wxFileSystem system; system.ChangePathTo( AppData()->GetProjectPath(), true ); // The loader can get goofy on linux if it starts with file:, not sure why (wxGTK 2.8.7) wxFSFile *fsfile = NULL; wxString remainder; if ( path.StartsWith( wxT("file:"), &remainder ) ) { fsfile = system.OpenFile( remainder, wxFS_READ | wxFS_SEEKABLE ); } else { fsfile = system.OpenFile( path, wxFS_READ | wxFS_SEEKABLE ); } // Unable to open the file if ( fsfile == NULL ) { return AppBitmaps::GetBitmap( wxT("unknown") ); } // Create a wxImage from the file stream wxImage img( *(fsfile->GetStream()) ); delete fsfile; // The stream is not an image if ( !img.Ok() ) { return AppBitmaps::GetBitmap( wxT("unknown") ); } // Create a wxBitmap from the image return wxBitmap( img ); } void TypeConv::ParseBitmapWithResource( const wxString& value, wxString* image, wxString* source, wxSize* icoSize ) { // Splitting bitmap resource property value - it is of the form "path; source [width; height]" *image = value; *source = wxT("Load From File"); *icoSize = wxDefaultSize; wxArrayString children; wxStringTokenizer tkz( value, wxT("[];"), wxTOKEN_RET_EMPTY ); while ( tkz.HasMoreTokens() ) { wxString child = tkz.GetNextToken(); child.Trim( false ); child.Trim( true ); children.Add( child ); } // "break;" was left out intentionally long temp; switch ( children.size() ) { case 4: children[3].ToLong( &temp ); icoSize->SetHeight( temp ); case 3: children[2].ToLong( &temp ); icoSize->SetWidth( temp ); case 2: *source = children[1]; case 1: *image = children[0]; default: break; } } wxString TypeConv::MakeAbsolutePath ( const wxString& filename, const wxString& basePath ) { wxFileName fnFile( filename ); wxFileName noChanges = fnFile; if ( fnFile.IsRelative() ) { // Es una ruta relativa, por tanto hemos de obtener la ruta completa // a partir de basePath wxFileName fnBasePath( basePath ); if ( fnBasePath.IsAbsolute() ) { if ( fnFile.MakeAbsolute(basePath) ) { wxString path = fnFile.GetFullPath(); return path; } } } // Either it is already absolute, or it could not be made absolute, so give it back - but change to '/' for separators wxString path = noChanges.GetFullPath(); return path; } wxString TypeConv::MakeRelativePath( const wxString& filename, const wxString& basePath ) { wxFileName fnFile( filename ); wxFileName noChanges = fnFile; if ( fnFile.IsAbsolute() ) { wxFileName fnBasePath( basePath) ; if ( fnBasePath.IsAbsolute() ) { if ( fnFile.MakeRelativeTo( basePath ) ) { return fnFile.GetFullPath( wxPATH_UNIX ); } } } // Either it is already relative, or it could not be made relative, so give it back - but change to '/' for separators if ( noChanges.IsAbsolute() ) { wxString path = noChanges.GetFullPath(); return path; } else { return noChanges.GetFullPath( wxPATH_UNIX ); } } void TypeConv::SplitFileSystemURL( const wxString& url, wxString* protocol, wxString* path, wxString* anchor ) { wxString remainder; if ( url.StartsWith( wxT("file:"), &remainder ) ) { *protocol = wxT("file:"); } else { protocol->clear(); remainder = url; } *path = remainder.BeforeFirst( wxT('#') ); if ( remainder.size() > path->size() ) { *anchor = remainder.substr( path->size() ); } else { anchor->clear(); } } wxString TypeConv::MakeAbsoluteURL( const wxString& url, const wxString& basePath ) { wxString protocol, path, anchor; SplitFileSystemURL( url, &protocol, &path, &anchor ); return protocol + MakeAbsolutePath( path, basePath ) + anchor; } wxString TypeConv::MakeRelativeURL( const wxString& url, const wxString& basePath ) { wxString protocol, path, anchor; SplitFileSystemURL( url, &protocol, &path, &anchor ); return protocol + MakeRelativePath( path, basePath ) + anchor; } #define ElseIfSystemColourConvert( NAME, value ) \ else if ( value == wxT(#NAME) ) \ { \ systemVal = NAME; \ } wxSystemColour TypeConv::StringToSystemColour( const wxString& str ) { wxSystemColour systemVal = wxSYS_COLOUR_BTNFACE; if( false ) {} ElseIfSystemColourConvert( wxSYS_COLOUR_SCROLLBAR, str ) ElseIfSystemColourConvert( wxSYS_COLOUR_BACKGROUND, str ) ElseIfSystemColourConvert( wxSYS_COLOUR_ACTIVECAPTION, str ) ElseIfSystemColourConvert( wxSYS_COLOUR_INACTIVECAPTION, str ) ElseIfSystemColourConvert( wxSYS_COLOUR_MENU, str ) ElseIfSystemColourConvert( wxSYS_COLOUR_WINDOW, str ) ElseIfSystemColourConvert( wxSYS_COLOUR_WINDOWFRAME, str ) ElseIfSystemColourConvert( wxSYS_COLOUR_MENUTEXT, str ) ElseIfSystemColourConvert( wxSYS_COLOUR_WINDOWTEXT, str ) ElseIfSystemColourConvert( wxSYS_COLOUR_CAPTIONTEXT, str ) ElseIfSystemColourConvert( wxSYS_COLOUR_ACTIVEBORDER, str ) ElseIfSystemColourConvert( wxSYS_COLOUR_INACTIVEBORDER, str ) ElseIfSystemColourConvert( wxSYS_COLOUR_APPWORKSPACE, str ) ElseIfSystemColourConvert( wxSYS_COLOUR_HIGHLIGHT, str ) ElseIfSystemColourConvert( wxSYS_COLOUR_HIGHLIGHTTEXT, str ) ElseIfSystemColourConvert( wxSYS_COLOUR_BTNFACE, str ) ElseIfSystemColourConvert( wxSYS_COLOUR_BTNSHADOW, str ) ElseIfSystemColourConvert( wxSYS_COLOUR_GRAYTEXT, str ) ElseIfSystemColourConvert( wxSYS_COLOUR_BTNTEXT, str ) ElseIfSystemColourConvert( wxSYS_COLOUR_INACTIVECAPTIONTEXT, str ) ElseIfSystemColourConvert( wxSYS_COLOUR_BTNHIGHLIGHT, str ) ElseIfSystemColourConvert( wxSYS_COLOUR_3DDKSHADOW, str ) ElseIfSystemColourConvert( wxSYS_COLOUR_3DLIGHT, str ) ElseIfSystemColourConvert( wxSYS_COLOUR_INFOTEXT, str ) ElseIfSystemColourConvert( wxSYS_COLOUR_INFOBK, str ) return systemVal; } wxColour TypeConv::StringToColour( const wxString& str ) { // check for system colour if ( str.find_first_of( wxT("wx") ) == 0 ) { return wxSystemSettings::GetColour( StringToSystemColour( str ) ); } else { wxStringTokenizer tkz(str,wxT(",")); unsigned int red,green,blue; red = green = blue = 0; // bool set_red, set_green, set_blue; // set_red = set_green = set_blue = false; if (tkz.HasMoreTokens()) { wxString s_red = tkz.GetNextToken(); long l_red; if (s_red.ToLong(&l_red) && (l_red >= 0 && l_red <= 255)) { red = (int)l_red; // set_size = true; } } if (tkz.HasMoreTokens()) { wxString s_green = tkz.GetNextToken(); long l_green; if (s_green.ToLong(&l_green) && (l_green >= 0 && l_green <= 255)) { green = (int)l_green; // set_size = true; } } if (tkz.HasMoreTokens()) { wxString s_blue = tkz.GetNextToken(); long l_blue; if (s_blue.ToLong(&l_blue) && (l_blue >= 0 && l_blue <= 255)) { blue = (int)l_blue; // set_size = true; } } return wxColour(red,green,blue); } } wxString TypeConv::ColourToString( const wxColour& colour ) { return wxString::Format(wxT("%d,%d,%d"),colour.Red(),colour.Green(),colour.Blue()); } #define SystemColourConvertCase( NAME ) \ case NAME: \ s = wxT(#NAME); \ break; wxString TypeConv::SystemColourToString( long colour ) { wxString s; switch ( colour ) { SystemColourConvertCase( wxSYS_COLOUR_SCROLLBAR ) SystemColourConvertCase( wxSYS_COLOUR_BACKGROUND ) SystemColourConvertCase( wxSYS_COLOUR_ACTIVECAPTION ) SystemColourConvertCase( wxSYS_COLOUR_INACTIVECAPTION ) SystemColourConvertCase( wxSYS_COLOUR_MENU ) SystemColourConvertCase( wxSYS_COLOUR_WINDOW ) SystemColourConvertCase( wxSYS_COLOUR_WINDOWFRAME ) SystemColourConvertCase( wxSYS_COLOUR_MENUTEXT ) SystemColourConvertCase( wxSYS_COLOUR_WINDOWTEXT ) SystemColourConvertCase( wxSYS_COLOUR_CAPTIONTEXT ) SystemColourConvertCase( wxSYS_COLOUR_ACTIVEBORDER ) SystemColourConvertCase( wxSYS_COLOUR_INACTIVEBORDER ) SystemColourConvertCase( wxSYS_COLOUR_APPWORKSPACE ) SystemColourConvertCase( wxSYS_COLOUR_HIGHLIGHT ) SystemColourConvertCase( wxSYS_COLOUR_HIGHLIGHTTEXT ) SystemColourConvertCase( wxSYS_COLOUR_BTNFACE ) SystemColourConvertCase( wxSYS_COLOUR_BTNSHADOW ) SystemColourConvertCase( wxSYS_COLOUR_GRAYTEXT ) SystemColourConvertCase( wxSYS_COLOUR_BTNTEXT ) SystemColourConvertCase( wxSYS_COLOUR_INACTIVECAPTIONTEXT ) SystemColourConvertCase( wxSYS_COLOUR_BTNHIGHLIGHT ) SystemColourConvertCase( wxSYS_COLOUR_3DDKSHADOW ) SystemColourConvertCase( wxSYS_COLOUR_3DLIGHT ) SystemColourConvertCase( wxSYS_COLOUR_INFOTEXT ) SystemColourConvertCase( wxSYS_COLOUR_INFOBK ) } return s; } bool TypeConv::FlagSet (const wxString &flag, const wxString ¤tValue) { bool set = false; wxStringTokenizer tkz(currentValue, wxT("|")); while (!set && tkz.HasMoreTokens()) { wxString token; token = tkz.GetNextToken(); token.Trim(true); token.Trim(false); if (token == flag) set = true; } return set; } wxString TypeConv::ClearFlag(const wxString &flag, const wxString ¤tValue) { if (flag == wxT("")) return currentValue; wxString result; wxStringTokenizer tkz(currentValue, wxT("|")); while (tkz.HasMoreTokens()) { wxString token; token = tkz.GetNextToken(); token.Trim(true); token.Trim(false); if (token != flag) { if (result != wxT("")) result = result + wxT('|'); result = result + token; } } return result; } wxString TypeConv::SetFlag (const wxString &flag, const wxString ¤tValue) { if (flag == wxT("")) return currentValue; bool found = false; wxString result = currentValue; wxStringTokenizer tkz(currentValue, wxT("|")); while (tkz.HasMoreTokens()) { wxString token; token = tkz.GetNextToken(); token.Trim(true); token.Trim(false); if (token == flag) found = true; } if (!found) { if (result != wxT("")) result = result + wxT('|'); result = result + flag; } return result; } // la representación de un array de cadenas será: // 'string1' 'string2' 'string3' // el caracter (') se representa dentro de una cadena como ('') // 'wxString''1''' wxArrayString TypeConv::OldStringToArrayString( const wxString& str ) { int i=0, size = (int)str.Length(), state = 0; wxArrayString result; wxString substr; while (i < size) { wxChar c = str[i]; switch (state) { case 0: // esperando (') de comienzo de cadena if (c == wxT('\'')) state = 1; break; case 1: // guardando cadena if (c == wxT('\'')) { if (i+1 < size && str[i+1] == wxT('\'')) { substr = substr + wxT('\''); // sustitución ('') por (') y seguimos i++; } else { result.Add(substr); // fin de cadena substr.Clear(); state = 0; } } else substr = substr + c; // seguimos guardado la cadena break; } i++; } return result; } wxArrayString TypeConv::StringToArrayString( const wxString& str ) { wxArrayString result; WX_PG_TOKENIZER2_BEGIN( str, wxT('"') ) result.Add ( token ); WX_PG_TOKENIZER2_END() return result; } wxString TypeConv::ArrayStringToString(const wxArrayString &arrayStr) { wxString result; wxPropertyGrid::ArrayStringToString( result, arrayStr, wxT('"'), wxT('"'), 1 ); return result; } wxString TypeConv::ReplaceSynonymous(const wxString &bitlist) { wxMessageBox(wxT("Antes: ")+bitlist); wxString result; wxString translation; wxStringTokenizer tkz(bitlist, wxT("|")); while (tkz.HasMoreTokens()) { wxString token; token = tkz.GetNextToken(); token.Trim(true); token.Trim(false); if (result != wxT("")) result = result + wxChar('|'); if (MacroDictionary::GetInstance()->SearchSynonymous( token, translation)) result += translation; else result += token; } wxMessageBox(wxT("Despues: ")+result); return result; } wxString TypeConv::TextToString(const wxString &str) { wxString result; for (unsigned int i=0 ; i < str.length() ; i++) { wxChar c = str[i]; if ( c == wxT('\\') ) { if (i < str.length() - 1) { wxChar next = str[i+1]; switch (next) { case wxT('n'): result += wxT('\n'); i++; break; case wxT('t'): result += wxT('\t'); i++; break; case wxT('r'): result += wxT('\r'); i++; break; case wxT('\\'): result += wxT('\\'); i++; break; } } } else result += c; } return result; } wxString TypeConv::StringToText(const wxString &str) { wxString result; for (unsigned int i=0 ; i < str.length() ; i++) { wxChar c = str[i]; switch (c) { case wxT('\n'): result += wxT("\\n"); break; case wxT('\t'): result += wxT("\\t"); break; case wxT('\r'): result += wxT("\\r"); break; case wxT('\\'): result += wxT("\\\\"); break; default: result += c; break; } } return result; } double TypeConv::StringToFloat( const wxString& str ) { // Numbers are stored in "C" locale LocaleSwitcher switcher; double out; str.ToDouble( &out ); return out; } wxString TypeConv::FloatToString( const double& val ) { // Numbers are stored in "C" locale LocaleSwitcher switcher; wxString convert; convert << val; return convert; } /////////////////////////////////////////////////////////////////////////////// PMacroDictionary MacroDictionary::s_instance = 0; PMacroDictionary MacroDictionary::GetInstance() { if ( 0 == s_instance ) { s_instance = new MacroDictionary(); } return s_instance; } void MacroDictionary::Destroy() { delete s_instance; s_instance = 0; } bool MacroDictionary::SearchMacro(wxString name, int *result) { bool found = false; MacroMap::iterator it = m_map.find(name); if (it != m_map.end()) { found = true; *result = it->second; } return found; } bool MacroDictionary::SearchSynonymous(wxString synName, wxString& result) { bool found = false; SynMap::iterator it = m_synMap.find(synName); if (it != m_synMap.end()) { found = true; result = it->second; } return found; } /* #define MACRO(x) m_map.insert(MacroMap::value_type(#x,x)) #define MACRO2(x,y) m_map.insert(MacroMap::value_type(#x,y))*/ void MacroDictionary::AddMacro(wxString name, int value) { m_map.insert(MacroMap::value_type(name,value)); } void MacroDictionary::AddSynonymous(wxString synName, wxString name) { m_synMap.insert(SynMap::value_type(synName, name)); } MacroDictionary::MacroDictionary() { // Las macros serán incluidas en las bibliotecas de componentes... // Sizers macros } wxformbuilder-3.1.59/src/utils/debug.h0000644000175000017500000000235311143440027020141 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #ifndef __DEBUG_H__ #define __DEBUG_H__ #include namespace Debug { void Print( const wxChar*, ... ); }; #endif //__DEBUG_H__ wxformbuilder-3.1.59/src/utils/wxfbipc.cpp0000644000175000017500000001466611143440027021062 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // Ryan Mulder - rjmyst3@gmail.com // /////////////////////////////////////////////////////////////////////////////// #include "wx/wxprec.h" #ifdef __BORLANDC__ #pragma hdrstop #endif #ifndef WX_PRECOMP #include "wx/wx.h" #endif #include "wxfbipc.h" #include #include "utils/debug.h" bool wxFBIPC::VerifySingleInstance( const wxString& file, bool switchTo ) { // Possible send a message to the running instance through this string later, for now it is left empty wxString expression = wxEmptyString; // Make path absolute wxFileName path( file ); if ( !path.IsOk() ) { wxLogError( wxT("This path is invalid: %s"), file.c_str() ); return false; } if ( !path.IsAbsolute() ) { if ( !path.MakeAbsolute() ) { wxLogError( wxT("Could not make path absolute: %s"), file.c_str() ); return false; } } // Check for single instance // Create lockfile/mutex name wxString name = wxString::Format( wxT("wxFormBuilder-%s-%s"), wxGetUserId().c_str(), path.GetFullPath().c_str() ); // Get forbidden characters wxString forbidden = wxFileName::GetForbiddenChars(); // Repace forbidded characters for ( size_t c = 0; c < forbidden.Length(); ++c ) { wxString bad( forbidden.GetChar( c ) ); name.Replace( bad.c_str(), wxT("_") ); } // Paths are not case sensitive in windows #ifdef __WXMSW__ name = name.MakeLower(); #endif // GetForbiddenChars is missing "/" in unix. Prepend '.' to make lockfiles hidden #ifndef __WXMSW__ name.Replace( wxT("/"), wxT("_") ); name.Prepend( wxT(".") ); #endif // Check to see if I already have a server with this name - if so, no need to make another! if ( m_server.get() ) { if ( m_server->m_name == name ) { return true; } } std::auto_ptr< wxSingleInstanceChecker > checker; { // Suspend logging, because error messages here are not useful #ifndef __WXFB_DEBUG__ wxLogNull stopLogging; #endif checker.reset( new wxSingleInstanceChecker( name ) ); } if ( !checker->IsAnotherRunning() ) { // This is the first instance of this project, so setup a server and save the single instance checker if ( CreateServer( name ) ) { m_checker = checker; return true; } else { return false; } } else if ( switchTo ) { // Suspend logging, because error messages here are not useful #ifndef __WXFB_DEBUG__ wxLogNull stopLogging; #endif // There is another app, so connect and send the expression // Cannot have a client and a server at the same time, due to the implementation of wxTCPServer and wxTCPClient, // so temporarily drop the server if there is one bool hadServer = false; wxString oldName; if ( m_server.get() != NULL ) { oldName = m_server->m_name; m_server.reset(); hadServer = true; } // Create the client std::auto_ptr< AppClient > client( new AppClient ); // Create the connection std::auto_ptr< wxConnectionBase > connection; #ifdef __WXMSW__ connection.reset( client->MakeConnection( wxT("localhost"), name, name ) ); #else bool connected = false; for ( int i = m_port; i < m_port + 20; ++i ) { wxString nameWithPort = wxString::Format( wxT("%i%s"), i, name.c_str() ); connection.reset( client->MakeConnection( wxT("127.0.0.1"), nameWithPort, name ) ); if ( NULL != connection.get() ) { connected = true; wxChar* pid = connection->Request( wxT("PID"), NULL ); if ( NULL != pid ) { wxLogStatus( wxT("%s already open in process %s"), file.c_str(), pid ); } break; } } if ( !connected ) { wxLogError( wxT("There is a lockfile named '%s', but unable to make a connection to that instance."), name.c_str() ); } #endif // Drop the connection and client connection.reset(); client.reset(); // Create the server again, if necessary if ( hadServer ) { CreateServer( oldName ); } } return false; } bool wxFBIPC::CreateServer( const wxString& name ) { // Suspend logging, because error messages here are not useful #ifndef __WXFB_DEBUG__ wxLogNull stopLogging; #endif std::auto_ptr< AppServer > server( new AppServer( name ) ); #ifdef __WXMSW__ if ( server->Create( name ) ) { m_server = server; return true; } #else { for ( int i = m_port; i < m_port + 20; ++i ) { wxString nameWithPort = wxString::Format( wxT("%i%s"), i, name.c_str() ); if( server->Create( nameWithPort ) ) { m_server = server; return true; } else { Debug::Print( wxT("Server Creation Failed. %s"), nameWithPort.c_str() ); } } } #endif wxLogError( wxT("Failed to create an IPC service with name %s"), name.c_str() ); return false; } void wxFBIPC::Reset() { m_server.reset(); m_checker.reset(); } wxConnectionBase* AppServer::OnAcceptConnection( const wxString& topic ) { if ( topic == m_name ) { wxFrame* frame = wxDynamicCast( wxTheApp->GetTopWindow(), wxFrame ); if ( !frame ) { return NULL; } frame->Enable(); if ( frame->IsIconized() ) { frame->Iconize( false ); } frame->Raise(); return new AppConnection; } return NULL; } wxConnectionBase* AppClient::OnMakeConnection() { return new AppConnection; } wxChar* AppConnection::OnRequest( const wxString& /*topic*/, const wxString& /*item*/, int* size, wxIPCFormat /*format*/ ) { unsigned long pid = ::wxGetProcessId(); if ( 0 == pid ) { if ( NULL != size ) { *size = 0; } return NULL; } else { int length = m_data.Printf( wxT("%lu"), pid ); if ( NULL != size ) { *size = (length + 1) * sizeof(wxChar); } return const_cast< wxChar* >( m_data.c_str() ); } } wxformbuilder-3.1.59/src/utils/stringutils.cpp0000644000175000017500000003261211143440027021776 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #include "stringutils.h" #include "typeconv.h" #include #include #include "wxfbexception.h" #include #include #include #include #include wxString StringUtils::IntToStr(int num) { //wxString stream; //stream << num; //return stream; wxString result; result.Printf(wxT("%d"),num); return result; } wxString StringUtils::GetSupportedEncodings( bool columnateWithTab, wxArrayString* array ) { wxString result = wxEmptyString; size_t count = wxFontMapper::GetSupportedEncodingsCount(); size_t max = 40; for ( size_t i = 0; i < count; ++i ) { wxFontEncoding encoding = wxFontMapper::GetEncoding( i ); wxString name = wxFontMapper::GetEncodingName( encoding ); size_t length = name.length(); if ( length > max ) { max = length + 10; } if ( columnateWithTab ) { name = name.Pad( (size_t)((max - length)/8 + 1), wxT('\t') ); } else { name = name.Pad( max - length ); } name += wxFontMapper::GetEncodingDescription( encoding ); if ( NULL != array ) { array->Add( name ); } result += name; result += wxT("\n"); } return result; } wxFontEncoding StringUtils::GetEncodingFromUser( const wxString& message ) { wxArrayString array; GetSupportedEncodings( false, &array ); int selection = ::wxGetSingleChoiceIndex( message, _("Choose an Encoding"), array, wxTheApp->GetTopWindow() ); if ( -1 == selection ) { return wxFONTENCODING_MAX; } return wxFontMapper::GetEncoding( selection ); } namespace XMLUtils { template < class T, class U > void LoadXMLFileImp( T& doc, bool condenseWhiteSpace, const wxString& path, U* declaration ) { if ( NULL == declaration ) { // Ask user to all wxFB to convert the file to UTF-8 and add the XML declaration wxString msg = _("This xml file has no declaration.\n"); msg += _("Would you like wxFormBuilder to backup the file and convert it to UTF-8\?\n"); msg += _("You will be prompted for an encoding.\n\n"); msg += _("Path: "); msg += path; int result = wxMessageBox( msg, _("Missing Declaration"), wxICON_QUESTION | wxYES_NO | wxYES_DEFAULT, wxTheApp->GetTopWindow() ); if ( wxNO == result ) { // User declined, give up THROW_WXFBEX( _("Missing Declaration on XML File: ") << path ); } // User accepted, convert the file wxFontEncoding chosenEncoding = StringUtils::GetEncodingFromUser( _("Please choose the original encoding.") ); if ( wxFONTENCODING_MAX == chosenEncoding ) { THROW_WXFBEX( _("Missing Declaration on XML File: ") << path ); } ConvertAndAddDeclaration( path, chosenEncoding ); // Reload LoadXMLFile( doc, condenseWhiteSpace, path ); return; } // The file will have a declaration at this point wxString version = _WXSTR( declaration->Version() ); if ( version.empty() ) { version = wxT("1.0"); } wxString standalone = _WXSTR( declaration->Standalone() ); if ( standalone.empty() ) { standalone = wxT("yes"); } wxString encodingName = _WXSTR( declaration->Encoding() ); if ( encodingName.empty() ) { // Ask user to all wxFB to convert the file to UTF-8 and add the XML declaration wxString msg = _("This xml file has no encoding specified.\n"); msg += _("Would you like wxFormBuilder to backup the file and convert it to UTF-8\?\n"); msg += _("You will be prompted for an encoding.\n\n"); msg += _("Path: "); msg += path; if ( wxNO == wxMessageBox( msg, _("Unknown Encoding"), wxICON_QUESTION | wxYES_NO | wxYES_DEFAULT, wxTheApp->GetTopWindow() ) ) { // User declined, give up THROW_WXFBEX( _("Unknown Encoding for XML File: ") << path ); } // User accepted, convert the file wxFontEncoding chosenEncoding = StringUtils::GetEncodingFromUser( _("Please choose the original encoding.") ); if ( wxFONTENCODING_MAX == chosenEncoding ) { THROW_WXFBEX( _("Unknown Encoding for XML File: ") << path ); } ConvertAndChangeDeclaration( path, version, standalone, chosenEncoding ); // Reload LoadXMLFile( doc, condenseWhiteSpace, path ); return; } // The file will have an encoding at this point wxFontEncoding encoding = wxFontMapperBase::GetEncodingFromName( encodingName.MakeLower() ); if ( wxFONTENCODING_UTF8 == encoding ) { // This is what we want return; } else if ( wxFONTENCODING_MAX == encoding ) { wxString msg = wxString::Format( _("The encoding of this xml file is not supported.\n\nFile: %s\nEncoding: %s\nSupported Encodings:\n\n%s"), path.c_str(), encodingName.c_str(), StringUtils::GetSupportedEncodings().c_str() ); wxMessageBox( msg, wxString::Format( _("Unsupported Encoding: %s"), encodingName.c_str() ) ); THROW_WXFBEX( _("Unsupported encoding for XML File: ") << path ); } else { // Ask user to all wxFB to convert the file to UTF-8 and add the XML declaration wxString msg = wxString::Format( _("This xml file has specified encoding %s. wxFormBuilder only works with UTF-8.\n"), wxFontMapper::GetEncodingDescription( encoding ).c_str() ); msg += _("Would you like wxFormBuilder to backup the file and convert it to UTF-8\?\n\n"); msg += _("Path: "); msg += path; if ( wxNO == wxMessageBox( msg, _("Not UTF-8"), wxICON_QUESTION | wxYES_NO | wxYES_DEFAULT, wxTheApp->GetTopWindow() ) ) { // User declined, give up THROW_WXFBEX( _("Wrong Encoding for XML File: ") << path ); } // User accepted, convert the file ConvertAndChangeDeclaration( path, version, standalone, encoding ); // Reload LoadXMLFile( doc, condenseWhiteSpace, path ); return; } } }; void XMLUtils::LoadXMLFile( ticpp::Document& doc, bool condenseWhiteSpace, const wxString& path ) { try { if ( path.empty() ) { THROW_WXFBEX( _("LoadXMLFile needs a path") ) } if ( !::wxFileExists( path ) ) { THROW_WXFBEX( _("The file does not exist.\nFile: ") << path ) } TiXmlBase::SetCondenseWhiteSpace( condenseWhiteSpace ); doc.SetValue( std::string( path.mb_str( wxConvFile ) ) ); doc.LoadFile(); } catch ( ticpp::Exception& ) { // Ask user to all wxFB to convert the file to UTF-8 and add the XML declaration wxString msg = _("This xml file could not be loaded. This could be the result of an unsupported encoding.\n"); msg += _("Would you like wxFormBuilder to backup the file and convert it to UTF-8\?\n"); msg += _("You will be prompted for the original encoding.\n\n"); msg += _("Path: "); msg += path; if ( wxNO == wxMessageBox( msg, _("Unable to load file"), wxICON_QUESTION | wxYES_NO | wxYES_DEFAULT, wxTheApp->GetTopWindow() ) ) { // User declined, give up THROW_WXFBEX( _("Unable to load file: ") << path ); } // User accepted, convert the file wxFontEncoding chosenEncoding = StringUtils::GetEncodingFromUser( _("Please choose the original encoding.") ); if ( wxFONTENCODING_MAX == chosenEncoding ) { THROW_WXFBEX( _("Unable to load file: ") << path ); } ConvertAndAddDeclaration( path, chosenEncoding ); LoadXMLFile( doc, condenseWhiteSpace, path ); } ticpp::Declaration* declaration; try { ticpp::Node* firstChild = doc.FirstChild(); declaration = firstChild->ToDeclaration(); } catch( ticpp::Exception& ) { declaration = NULL; } LoadXMLFileImp( doc, condenseWhiteSpace, path, declaration ); } void XMLUtils::LoadXMLFile( TiXmlDocument& doc, bool condenseWhiteSpace, const wxString& path ) { if ( path.empty() ) { THROW_WXFBEX( _("LoadXMLFile needs a path") ) } if ( !::wxFileExists( path ) ) { THROW_WXFBEX( _("The file does not exist.\nFile: ") << path ) } TiXmlBase::SetCondenseWhiteSpace( condenseWhiteSpace ); doc.SetValue( std::string( path.mb_str( wxConvFile ) ) ); if ( !doc.LoadFile() ) { // Ask user to all wxFB to convert the file to UTF-8 and add the XML declaration wxString msg = _("This xml file could not be loaded. This could be the result of an unsupported encoding.\n"); msg += _("Would you like wxFormBuilder to backup the file and convert it to UTF-8\?\n"); msg += _("You will be prompted for the original encoding.\n\n"); msg += _("Path: "); msg += path; if ( wxNO == wxMessageBox( msg, _("Unable to load file"), wxICON_QUESTION | wxYES_NO | wxYES_DEFAULT, wxTheApp->GetTopWindow() ) ) { // User declined, give up THROW_WXFBEX( _("Unable to load file: ") << path ); } // User accepted, convert the file wxFontEncoding chosenEncoding = StringUtils::GetEncodingFromUser( _("Please choose the original encoding.") ); if ( wxFONTENCODING_MAX == chosenEncoding ) { THROW_WXFBEX( _("Unable to load file: ") << path ); } ConvertAndAddDeclaration( path, chosenEncoding ); LoadXMLFile( doc, condenseWhiteSpace, path ); } TiXmlDeclaration* declaration = NULL; TiXmlNode* firstChild = doc.FirstChild(); if ( firstChild ) { declaration = firstChild->ToDeclaration(); } LoadXMLFileImp( doc, condenseWhiteSpace, path, declaration ); } void XMLUtils::ConvertAndAddDeclaration( const wxString& path, wxFontEncoding encoding, bool backup ) { ConvertAndChangeDeclaration( path, wxT("1.0"), wxT("yes"), encoding, backup ); } void XMLUtils::ConvertAndChangeDeclaration( const wxString& path, const wxString& version, const wxString& standalone, wxFontEncoding encoding, bool backup ) { // Backup the file if ( backup ) { if ( !::wxCopyFile( path, path + wxT(".bak") ) ) { wxString msg = wxString::Format( _("Unable to backup file.\nFile: %s\nBackup: %s.bak"), path.c_str(), path.c_str() ); THROW_WXFBEX( msg ) } } // Read the entire contents into a string wxFFile oldEncoding( path.c_str(), wxT("r") ); wxString contents; wxCSConv encodingConv( encoding ); if ( !oldEncoding.ReadAll( &contents, encodingConv ) ) { wxString msg = wxString::Format( _("Unable to read the file in the specified encoding.\nFile: %s\nEncoding: %s"), path.c_str(), wxFontMapper::GetEncodingDescription( encoding ).c_str() ); THROW_WXFBEX( msg ); } if ( contents.empty() ) { wxString msg = wxString::Format( _("The file is either empty or read with the wrong encoding.\nFile: %s\nEncoding: %s"), path.c_str(), wxFontMapper::GetEncodingDescription( encoding ).c_str() ); THROW_WXFBEX( msg ); } if ( !oldEncoding.Close() ) { wxString msg = wxString::Format( _("Unable to close original file.\nFile: %s"), path.c_str() ); THROW_WXFBEX( msg ); } // Modify the declaration, so TinyXML correctly determines the new encoding int declStart = contents.Find( wxT("<\?") ); int declEnd = contents.Find( wxT("\?>") ); if ( wxNOT_FOUND == declStart && wxNOT_FOUND == declEnd ) { int firstElement = contents.Find( wxT("<") ); if ( wxNOT_FOUND == firstElement ) { firstElement = 0; } contents.insert( firstElement, wxString::Format( wxT("<\?xml version=\"%s\" encoding=\"UTF-8\" standalone=\"%s\" \?>\n"), version.c_str(), standalone.c_str() ) ); } else { if ( wxNOT_FOUND == declStart ) { wxString msg = wxString::Format( _("Found a declaration end tag \"\?>\" but could not find the start \"<\?\".\nFile: %s"), path.c_str() ); THROW_WXFBEX( msg ); } if ( wxNOT_FOUND == declEnd ) { wxString msg = wxString::Format( _("Found a declaration start tag \"<\?\" but could not find the end \"\?>\".\nFile: %s"), path.c_str() ); THROW_WXFBEX( msg ); } // declStart and declEnd are both valid, replace that section with a new declaration contents.replace( declStart, declEnd - declStart + 2, wxString::Format( wxT("<\?xml version=\"%s\" encoding=\"UTF-8\" standalone=\"%s\" \?>"), version.c_str(), standalone.c_str() ).c_str() ); } // Remove the old file if ( !::wxRemoveFile( path ) ) { wxString msg = wxString::Format( _("Unable to delete original file.\nFile: %s"), path.c_str() ); THROW_WXFBEX( msg ); } // Write the new file wxFFile newEncoding( path.c_str(), wxT("w") ); if ( !newEncoding.Write( contents, wxConvUTF8 ) ) { wxString msg = wxString::Format( _("Unable to write file in its new encoding.\nFile: %s\nEncoding: %s"), path.c_str(), wxFontMapper::GetEncodingDescription( wxFONTENCODING_UTF8 ).c_str() ); THROW_WXFBEX( msg ); } if ( !newEncoding.Close() ) { wxString msg = wxString::Format( _("Unable to close file after converting the encoding.\nFile: %s\nOld Encoding: %s\nNew Encoding: %s"), path.c_str(), wxFontMapper::GetEncodingDescription( encoding ).c_str(), wxFontMapper::GetEncodingDescription( wxFONTENCODING_UTF8 ).c_str() ); THROW_WXFBEX( msg ); } } wxformbuilder-3.1.59/src/utils/annoyingdialog.h0000644000175000017500000000311711143440027022054 0ustar rrmulderrrmulder/* * This file was copied from Code::Blocks Studio, an open-source cross-platform IDE * Copyright (C) 2003 Yiannis An. Mandravellos * * This program is distributed under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or (at your option) any later version. * * Revision: 4204 * Id: annoyingdialog.cpp 4204 2007-07-02 12:30:47Z mandrav * HeadURL: http://svn.berlios.de/svnroot/repos/codeblocks/trunk/src/sdk/annoyingdialog.cpp */ #include #include #include class wxCheckBox; /** Dialog that contains a "Don't annoy me" checkbox. Using this dialog, the user can select not to display this dialog again. The dialog can be then re-enabled in the settings */ class AnnoyingDialog : public wxDialog { public: enum dStyle { OK, YES_NO, YES_NO_CANCEL, OK_CANCEL, ONE_BUTTON, TWO_BUTTONS, THREE_BUTTONS }; AnnoyingDialog(const wxString& caption, const wxString& message, const wxArtID icon = wxART_INFORMATION, dStyle style = YES_NO, int defaultReturn = wxID_YES, bool separate = true, const wxString& b1 = wxEmptyString, const wxString& b2 = wxEmptyString, const wxString& b3 = wxEmptyString); virtual ~AnnoyingDialog(){} virtual int ShowModal(); private: void OnButton( wxCommandEvent& event ); wxCheckBox* m_cb; bool m_dontAnnoy; int m_defRet; DECLARE_EVENT_TABLE() }; wxformbuilder-3.1.59/src/utils/encodingutils.cpp0000644000175000017500000000375211143440027022261 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #include "encodingutils.h" #include #include "wx/wx.h" #include void UTF8ToAnsi(const wxString &filename) { wxString temp_filename = filename + wxT(".tmp"); ::wxCopyFile(filename,temp_filename); ::wxRemoveFile(filename); { wxFileInputStream input(temp_filename); wxFileOutputStream output(filename); if (input.IsOk() && output.IsOk()) { while (!input.Eof()) { unsigned char c; input.Read(&c,1); if (input.LastRead() != 1) break; if (c == 0xC2 || c == 0xC3) { unsigned char aux = c; input.Read(&c,1); if (input.LastRead() != 1) break; if (aux == 0xC3) c += 64; } output.Write(&c,1); } } } ::wxRemoveFile(temp_filename); } wxformbuilder-3.1.59/src/utils/wxfbexception.h0000644000175000017500000000414211143440027021736 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // Ryan Mulder - rjmyst3@gmail.com // /////////////////////////////////////////////////////////////////////////////// #ifndef WXFBEXCEPTION #define WXFBEXCEPTION #include /** Exception class for wxFormBuilder */ class wxFBException { public: explicit wxFBException( const wxString& what ) : m_what(what) {} virtual ~wxFBException() throw() {} virtual const wxChar* what() const throw() { return m_what.c_str(); } private: wxString m_what; }; /** This allows you to stream your exceptions in. It will take care of the conversion and throwing the exception. */ #define THROW_WXFBEX( message ) \ { \ wxString hopefullyThisNameWontConflictWithOtherVariables; \ wxString file( __FILE__, wxConvUTF8 ); \ file = file.substr( file.find_last_of( wxT("\\/") ) + 1 ); \ hopefullyThisNameWontConflictWithOtherVariables << message << wxT(" <") << file << wxT("@"); \ hopefullyThisNameWontConflictWithOtherVariables << wxString::Format( wxT("%i"), __LINE__ ) << wxT(">"); \ throw wxFBException( hopefullyThisNameWontConflictWithOtherVariables ); \ } #endif //WXFBEXCEPTION wxformbuilder-3.1.59/src/utils/typeconv.h0000644000175000017500000001134211143440027020720 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #ifndef __TYPE_UTILS__ #define __TYPE_UTILS__ #include "wx/wx.h" #include #include #include #include "model/types.h" #include "fontcontainer.h" // macros para la conversión entre wxString <-> wxString #define _WXSTR(x) TypeConv::_StringToWxString(x) #define _STDSTR(x) TypeConv::_WxStringToString(x) #define _ANSISTR(x) TypeConv::_WxStringToAnsiString(x) namespace TypeConv { wxString _StringToWxString( const std::string &str ); wxString _StringToWxString( const char *str ); std::string _WxStringToString( const wxString &str ); std::string _WxStringToAnsiString( const wxString & str ); wxPoint StringToPoint( const wxString &str ); bool StringToPoint( const wxString &str, wxPoint *point ); wxSize StringToSize( const wxString &str ); wxString PointToString( const wxPoint &point ); wxString SizeToString( const wxSize &size ); int BitlistToInt( const wxString &str ); int GetMacroValue( const wxString &str ); int StringToInt( const wxString &str ); bool FlagSet( const wxString &flag, const wxString ¤tValue ); wxString ClearFlag( const wxString &flag, const wxString ¤tValue ); wxString SetFlag( const wxString &flag, const wxString ¤tValue ); wxBitmap StringToBitmap( const wxString& filename ); wxFontContainer StringToFont( const wxString &str ); wxString FontToString( const wxFontContainer &font ); wxColour StringToColour( const wxString &str ); wxSystemColour StringToSystemColour( const wxString& str ); wxString ColourToString( const wxColour &colour ); wxString SystemColourToString( long colour ); bool StringToBool( const wxString &str ); wxString BoolToString( bool val ); wxArrayString StringToArrayString( const wxString &str ); wxString ArrayStringToString( const wxArrayString &arrayStr ); void ParseBitmapWithResource( const wxString& value, wxString* image, wxString* source, wxSize* icoSize ); /** @internal Used to import old projects. */ wxArrayString OldStringToArrayString( const wxString& str ); wxString ReplaceSynonymous( const wxString &bitlist ); void SplitFileSystemURL( const wxString& url, wxString* protocol, wxString* path, wxString* anchor ); // Obtiene la ruta absoluta de un archivo wxString MakeAbsolutePath( const wxString& filename, const wxString& basePath ); wxString MakeAbsoluteURL( const wxString& url, const wxString& basePath ); // Obtiene la ruta relativa de un archivo wxString MakeRelativePath( const wxString& filename, const wxString& basePath ); wxString MakeRelativeURL( const wxString& url, const wxString& basePath ); // dada una cadena de caracteres obtiene otra transformando los caracteres // especiales denotados al estilo C ('\n' '\\' '\t') wxString StringToText( const wxString &str ); wxString TextToString( const wxString &str ); double StringToFloat( const wxString& str ); wxString FloatToString( const double& val ); }; // No me gusta nada tener que usar variables globales o singletons // pero hasta no dar con otro diseño más elegante seguiremos con este... // TO-DO: incluirlo en GlobalApplicationData class MacroDictionary; typedef MacroDictionary* PMacroDictionary; class MacroDictionary { private: typedef std::map MacroMap; static PMacroDictionary s_instance; typedef std::map SynMap; MacroMap m_map; SynMap m_synMap; MacroDictionary(); public: static PMacroDictionary GetInstance(); static void Destroy(); bool SearchMacro( wxString name, int *result ); void AddMacro( wxString name, int value ); void AddSynonymous( wxString synName, wxString name ); bool SearchSynonymous( wxString synName, wxString& result ); }; #endif //__TYPE_UTILS__ wxformbuilder-3.1.59/src/utils/encodingutils.h0000644000175000017500000000241511143440027021721 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #ifndef __ENC_UTILS_H__ #define __ENC_UTILS_H__ #include void UTF8ToAnsi(const wxString &filename); #endif //__ENC_UTILS_H__ wxformbuilder-3.1.59/src/utils/wxfbdefs.h0000644000175000017500000000623011143440027020661 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // Ryan Mulder - rjmyst3@gmail.com // /////////////////////////////////////////////////////////////////////////////// #ifndef WXFBDEFS_H #define WXFBDEFS_H #include #include #include #include class ObjectBase; class ObjectInfo; class ObjectPackage; class Property; class PropertyInfo; class OptionList; class CodeInfo; class EventInfo; class Event; class PropertyCategory; class wxFBManager; class CodeWriter; class TemplateParser; class TCCodeWriter; class StringCodeWriter; // Let's go with a few typedefs for frequently used types, // please use it, code will be cleaner and easier to read. typedef boost::shared_ptr POptionList; typedef boost::shared_ptr PObjectBase; typedef boost::weak_ptr WPObjectBase; typedef boost::shared_ptr PObjectPackage; typedef boost::weak_ptr WPObjectPackage; typedef boost::shared_ptr PCodeInfo; typedef boost::shared_ptr PObjectInfo; typedef boost::shared_ptr PProperty; typedef boost::shared_ptr PPropertyInfo; typedef boost::shared_ptr PEventInfo; typedef boost::shared_ptr PEvent; typedef boost::shared_ptr PPropertyCategory; typedef std::map PropertyInfoMap; typedef std::map ObjectInfoMap; typedef std::map EventInfoMap; typedef std::map PropertyMap; typedef std::map EventMap; typedef std::vector ObjectBaseVector; typedef std::vector EventVector; typedef boost::shared_ptr PwxFBManager; typedef boost::shared_ptr PCodeWriter; typedef boost::shared_ptr PTemplateParser; typedef boost::shared_ptr PTCCodeWriter; typedef boost::shared_ptr PStringCodeWriter; // Flatnotebook styles are stored in config, if style #defines change, or config is manually modified, these style overrides still apply #define FNB_STYLE_OVERRIDES( x ) ( x | wxFNB_CUSTOM_DLG | wxFNB_NO_X_BUTTON ) & ( ~wxFNB_X_ON_TAB & ~wxFNB_MOUSE_MIDDLE_CLOSES_TABS & ~wxFNB_DCLICK_CLOSES_TABS & ~wxFNB_ALLOW_FOREIGN_DND ) #endif //WXFBDEFS_H wxformbuilder-3.1.59/src/utils/debug.cpp0000644000175000017500000000325211143440027020473 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #include "debug.h" #include "rad/appdata.h" #include #include "wx/wx.h" void Debug::Print( const wxChar* format, ... ) { #ifdef __WXFB_DEBUG__ wxLog* target = AppData()->GetDebugLogTarget(); if ( target != 0 ) { wxLog* oldTarget = wxLog::SetActiveTarget( target ); va_list argptr; va_start(argptr, format); wxString s; s.PrintfV(format, argptr); wxLogMessage(s); va_end(argptr); wxLog::SetActiveTarget( oldTarget ); } #endif //__WXFB_DEBUG__ } wxformbuilder-3.1.59/src/utils/wxlogstring.h0000644000175000017500000000264311143440027021444 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // Ryan Mulder - rjmyst3@gmail.com // /////////////////////////////////////////////////////////////////////////////// #include class wxLogString : public wxLog { private: wxString m_str; public: wxLogString(){} void DoLogString( const wxChar* str, time_t t ) { m_str += str; m_str += wxT("\n"); } void FlushStr( wxString& str ) { str = m_str; m_str.clear(); } wxString GetStr() const { return m_str; } }; wxformbuilder-3.1.59/src/utils/wxfbipc.h0000644000175000017500000000433211143440027020514 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // Ryan Mulder - rjmyst3@gmail.com // /////////////////////////////////////////////////////////////////////////////// #ifndef WXFBIPC_H #define WXFBIPC_H #include #include #include /* Only allow one instance of a project to be loaded at a time */ class AppServer; class wxFBIPC { private: std::auto_ptr< wxSingleInstanceChecker > m_checker; std::auto_ptr< AppServer > m_server; const int m_port; bool CreateServer( const wxString& name ); public: wxFBIPC() : m_port( 4242 ) { } bool VerifySingleInstance( const wxString& file, bool switchTo = true ); void Reset(); }; // Connection class, for use by both communicationg instances class AppConnection: public wxConnection { private: wxString m_data; public: AppConnection(){} ~AppConnection(){} wxChar* OnRequest( const wxString& topic, const wxString& item, int* size, wxIPCFormat format ); }; // Server class, for listening to connection requests class AppServer: public wxServer { public: const wxString m_name; AppServer( const wxString& name ) : m_name( name ){} wxConnectionBase* OnAcceptConnection( const wxString& topic ); }; // Client class, to be used by subsequent instances in OnInit class AppClient: public wxClient { public: AppClient(){} wxConnectionBase* OnMakeConnection(); }; #endif //WXFBIPC_H wxformbuilder-3.1.59/src/utils/annoyingdialog.cpp0000644000175000017500000001304411143440027022407 0ustar rrmulderrrmulder/* * This file is part of Code::Blocks Studio, an open-source cross-platform IDE * Copyright (C) 2003 Yiannis An. Mandravellos * * This program is distributed under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or (at your option) any later version. * * Revision: 4204 * Id: annoyingdialog.cpp 4204 2007-07-02 12:30:47Z mandrav * HeadURL: http://svn.berlios.de/svnroot/repos/codeblocks/trunk/src/sdk/annoyingdialog.cpp */ #include #include #include #include #include #include #include #include #include "annoyingdialog.h" BEGIN_EVENT_TABLE(AnnoyingDialog, wxDialog) EVT_BUTTON(-1, AnnoyingDialog::OnButton) END_EVENT_TABLE() AnnoyingDialog::AnnoyingDialog(const wxString& caption, const wxString& message, const wxArtID icon, dStyle style, int defaultReturn, bool /*separate*/, const wxString& b1, const wxString& b2, const wxString& b3) : wxDialog(NULL, -1, caption, wxDefaultPosition, wxDefaultSize, wxCAPTION), m_cb(0), m_dontAnnoy(false), m_defRet(defaultReturn) { wxConfigBase* config = wxConfigBase::Get(); int defRet; if ( config->Read( wxT("annoyingdialog/") + caption, &defRet ) ) { if ( defRet != wxID_CANCEL ) { m_dontAnnoy = true; m_defRet = defRet; return; } } wxBoxSizer *outerSizer = new wxBoxSizer( wxVERTICAL ); wxFlexGridSizer *mainArea = new wxFlexGridSizer(2, 0, 0); wxStaticBitmap *bitmap = new wxStaticBitmap(this, -1, wxArtProvider::GetBitmap(icon, wxART_MESSAGE_BOX), wxDefaultPosition); mainArea->Add(bitmap, 0, wxALL, 5); wxStaticText *txt = new wxStaticText(this, -1, message, wxDefaultPosition, wxDefaultSize, 0); mainArea->Add( txt, 0, wxALIGN_CENTER|wxALL, 5 ); mainArea->Add( 1, 1, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5 ); int numButtons = 0; int id1 = -1; int id2 = -1; int id3 = -1; wxString bTxt1; wxString bTxt2; wxString bTxt3; if(style == OK || style == ONE_BUTTON) { numButtons = 1; id1 = (style == OK ? wxID_OK : 1); bTxt1 = b1.IsEmpty() ? wxString(_("&OK")) : b1; } else if(style == YES_NO || style == OK_CANCEL || style == TWO_BUTTONS) { numButtons = 2; id1 = (style == YES_NO ? wxID_YES : (style == OK_CANCEL ? wxID_OK : 1)); id2 = (style == YES_NO ? wxID_NO : (style == OK_CANCEL ? wxID_CANCEL : 2)); bTxt1 = b1.IsEmpty() ? (style == YES_NO ? wxString(_("&Yes")) : wxString(_("&OK"))) : b1; bTxt2 = b2.IsEmpty() ? (style == YES_NO ? wxString(_("&No")) : wxString(_("&Cancel"))) : b2; } else if(style == YES_NO_CANCEL || style == THREE_BUTTONS) { numButtons = 3; id1 = (style == YES_NO_CANCEL ? wxID_YES : 1); id2 = (style == YES_NO_CANCEL ? wxID_NO : 2); id3 = (style == YES_NO_CANCEL ? wxID_CANCEL : 3); bTxt1 = b1.IsEmpty() ? wxString(_("&Yes")) : b1; bTxt2 = b2.IsEmpty() ? wxString(_("&No")) : b2; bTxt3 = b3.IsEmpty() ? wxString(_("&Cancel")) : b3; } else { wxLogError( wxT("Fatal error:\nUndefined style in dialog %s"), caption.c_str() ); return; } wxSizer* buttonSizer = 0; if (style < ONE_BUTTON) // standard buttons? use wxStdDialogButtonSizer { wxStdDialogButtonSizer *buttonArea = new wxStdDialogButtonSizer(); wxButton *but1 = new wxButton(this, id1, bTxt1, wxDefaultPosition, wxDefaultSize, 0); but1->SetDefault(); buttonArea->AddButton(but1); if(numButtons > 1) { wxButton *but2 = new wxButton(this, id2, bTxt2, wxDefaultPosition, wxDefaultSize, 0); but2->SetDefault(); buttonArea->AddButton(but2); } if(numButtons > 2) { wxButton *but3 = new wxButton(this, id3, bTxt3, wxDefaultPosition, wxDefaultSize, 0); but3->SetDefault(); buttonArea->AddButton(but3); } buttonArea->Realize(); buttonSizer = buttonArea; } else { // wxStdDialogButtonSizer accepts only standard IDs for its buttons, so we can't use // it with custom buttons buttonSizer = new wxBoxSizer(wxHORIZONTAL); wxButton *but1 = new wxButton(this, id1, bTxt1, wxDefaultPosition, wxDefaultSize, 0); but1->SetDefault(); buttonSizer->Add(but1, 0, wxRIGHT, 5); if(numButtons > 1) { wxButton *but2 = new wxButton(this, id2, bTxt2, wxDefaultPosition, wxDefaultSize, 0); but2->SetDefault(); buttonSizer->Add(but2, 0, wxRIGHT, 5); } if(numButtons > 2) { wxButton *but3 = new wxButton(this, id3, bTxt3, wxDefaultPosition, wxDefaultSize, 0); but3->SetDefault(); buttonSizer->Add(but3, 0, wxRIGHT, 5); } } outerSizer->Add( mainArea, 0, wxALIGN_CENTER|wxALL, 5); outerSizer->Add( buttonSizer, 0, wxALIGN_CENTER); m_cb = new wxCheckBox(this, -1, _("Don't annoy me again!"), wxDefaultPosition, wxDefaultSize, 0); outerSizer->Add(m_cb, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxBOTTOM, 5); SetSizer( outerSizer ); outerSizer->SetSizeHints(this); Centre(); } void AnnoyingDialog::OnButton(wxCommandEvent& event) { if(!m_cb) { wxLogError(_T("Ow... null pointer.")); return; } if ( event.GetId() != wxID_CANCEL ) { wxConfigBase* config = wxConfigBase::Get(); if ( m_cb->IsChecked() ) { config->Write( wxT("annoyingdialog/") + GetTitle(), event.GetId() ); } } EndModal(event.GetId()); } int AnnoyingDialog::ShowModal() { if(m_dontAnnoy) return m_defRet; return wxDialog::ShowModal(); }; wxformbuilder-3.1.59/src/utils/stringutils.h0000644000175000017500000000425711143440027021447 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #include namespace ticpp { class Document; }; class TiXmlDocument; class wxArrayString; namespace StringUtils { wxString IntToStr(int num); wxString GetSupportedEncodings( bool columnateWithTab = true, wxArrayString* array = NULL ); wxFontEncoding GetEncodingFromUser( const wxString& message ); }; namespace XMLUtils { // These are only vaguely string related, perhaps they deserve their own files. // These load xml files and verify the encoding is correct, optionally converting // the files using wxWidgets. void LoadXMLFile( ticpp::Document& doc, bool condenseWhiteSpace, const wxString& path = wxEmptyString ); void LoadXMLFile( TiXmlDocument& doc, bool condenseWhiteSpace, const wxString& path = wxEmptyString ); // Converts to UTF-8 and prepends declaration void ConvertAndAddDeclaration( const wxString& path, wxFontEncoding encoding = wxFONTENCODING_SYSTEM, bool backup = true ); void ConvertAndChangeDeclaration( const wxString& path, const wxString& version, const wxString& standalone, wxFontEncoding encoding = wxFONTENCODING_SYSTEM, bool backup = true ); } wxformbuilder-3.1.59/src/controls/wxWindowsLicence.txt0000644000175000017500000000470111143440026023440 0ustar rrmulderrrmulder wxWindows Library Licence, Version 3.1 ====================================== Copyright (C) 1998-2005 Julian Smart, Robert Roebling et al Everyone is permitted to copy and distribute verbatim copies of this licence document, but changing it is not allowed. WXWINDOWS LIBRARY LICENCE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public Licence as published by the Free Software Foundation; either version 2 of the Licence, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public Licence for more details. You should have received a copy of the GNU Library General Public Licence along with this software, usually in a file named COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. EXCEPTION NOTICE 1. As a special exception, the copyright holders of this library give permission for additional uses of the text contained in this release of the library as licenced under the wxWindows Library Licence, applying either version 3.1 of the Licence, or (at your option) any later version of the Licence as published by the copyright holders of version 3.1 of the Licence document. 2. The exception is that you may use, copy, link, modify and distribute under your own terms, binary object code versions of works based on the Library. 3. If you copy code from files distributed under the terms of the GNU General Public Licence or the GNU Library General Public Licence into a copy of this library, as this licence permits, the exception does not apply to the code that you add in this way. To avoid misleading anyone as to the status of such modified files, you must delete this exception notice from such code and/or adjust the licensing conditions notice accordingly. 4. If you write modifications of your own for this library, it is your choice whether to permit this exception to apply to your modifications. If you do not wish that, you must delete the exception notice from such code and/or adjust the licensing conditions notice accordingly. wxformbuilder-3.1.59/src/controls/README.txt0000644000175000017500000000421111143440026021075 0ustar rrmulderrrmulderwxFormBuilder 3rd Party Controls -------------------------------- Introduction: The wxFormBuilder 3rd Party Controls are a set of controls that are used internally by wxFormBuilder. They are a requirement for wxFormBuilder to build. You can just build the controls as its own package by using Premake, for your platform, to generate the build files of your choice. Now these projects are included in the main Premake script so it is not necessary to generate and build just the controls for wxFormBuilder. REMEMBER: The way you get new additions and updates to the build files you need to run Premake. This is means that it is good practice to run Premake before starting to build or develop wxFormBuilder. Build Steps: - To create the needed build files navigate to the 'Premake' directory under the wxFormBuilder directory structure and type: * Code::Blocks Projects and workspace: Windows: premake-win32 --target cb-gcc --file src\controls\build\premake.lua Linux: premake-linux --target cb-gcc --file src/controls/build/premake.lua * GNU makefiles: Windows: premake-win32 --target gnu --file src\controls\build\premake.lua Linux: premake-linux --target gnu --file src/controls/build/premake.lua - Navigate to '../src/controls/build' directory. - For Code::Blocks, use the generated .workspace to build the 3rd Party controls. - For GNU makefiles type: (Assumes you have properly setup your system to build with gcc or MinGW) * Release: make CONFIG=Release * Debug: make Includes: 1. wxFlatNotebook Used to give a good look and feel to the tabs in the wxFormBuilder user interface. 2. wxPropGrid Used to show all the properties of all the controls that can be placed in wxFormBuilder. 3. wxScintilla Used to display the C++ and xrc code. It has syntax highlighting. Notes: - Code::Blocks is a free cross-platform IDE and it can be found here: http://codeblocks.org - Premake can be found here: http://premake.sourceforge.net - Subversion is a great free cross-platform version control manager. It can be found here: http://subversion.tigris.org Enjoy, The wxFormBuilder Teamwxformbuilder-3.1.59/src/md5/md5.hh0000644000175000017500000001024211143440026017230 0ustar rrmulderrrmulder// MD5.CC - source code for the C++/object oriented translation and // modification of MD5. // Translation and modification (c) 1995 by Mordechai T. Abzug // This translation/ modification is provided "as is," without express or // implied warranty of any kind. // The translator/ modifier does not claim (1) that MD5 will do what you think // it does; (2) that this translation/ modification is accurate; or (3) that // this software is "merchantible." (Language for this disclaimer partially // copied from the disclaimer below). /* based on: MD5.H - header file for MD5C.C MDDRIVER.C - test driver for MD2, MD4 and MD5 Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All rights reserved. License to copy and use this software is granted provided that it is identified as the "RSA Data Security, Inc. MD5 Message-Digest Algorithm" in all material mentioning or referencing this software or this function. License is also granted to make and use derivative works provided that such works are identified as "derived from the RSA Data Security, Inc. MD5 Message-Digest Algorithm" in all material mentioning or referencing the derived work. RSA Data Security, Inc. makes no representations concerning either the merchantability of this software or the suitability of this software for any particular purpose. It is provided "as is" without express or implied warranty of any kind. These notices must be retained in any copies of any part of this documentation and/or software. */ #include #include #include class MD5 { public: // methods for controlled operation: MD5 (); // simple initializer void update (const unsigned char *input, unsigned int input_length); void update (std::istream& stream); void update (FILE *file); void update (std::ifstream& stream); void finalize (); // constructors for special circumstances. All these constructors finalize // the MD5 context. MD5 (unsigned char *string); // digest string, finalize MD5 (std::istream& stream); // digest stream, finalize MD5 (FILE *file); // digest file, close, finalize MD5 (std::ifstream& stream); // digest stream, close, finalize // methods to acquire finalized result unsigned char *raw_digest (); // digest as a 16-byte binary array char * hex_digest (); // digest as a 33-byte ascii-hex string friend std::ostream& operator<< (std::ostream&, MD5 context); private: // first, some types: typedef unsigned int uint4; // assumes integer is 4 words long typedef unsigned short int uint2; // assumes short integer is 2 words long typedef unsigned char uint1; // assumes char is 1 word long // next, the private data: uint4 state[4]; uint4 count[2]; // number of *bits*, mod 2^64 uint1 buffer[64]; // input buffer uint1 digest[16]; uint1 finalized; // last, the private methods, mostly static: void init (); // called by all constructors void transform (const uint1 *buffer); // does the real update work. Note // that length is implied to be 64. static void encode (uint1 *dest, uint4 *src, uint4 length); static void decode (uint4 *dest, const uint1 *src, uint4 length); static void memcpy (uint1 *dest, const uint1 *src, uint4 length); static void memset (uint1 *start, uint1 val, uint4 length); static inline uint4 rotate_left (uint4 x, uint4 n); static inline uint4 F (uint4 x, uint4 y, uint4 z); static inline uint4 G (uint4 x, uint4 y, uint4 z); static inline uint4 H (uint4 x, uint4 y, uint4 z); static inline uint4 I (uint4 x, uint4 y, uint4 z); static inline void FF (uint4& a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac); static inline void GG (uint4& a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac); static inline void HH (uint4& a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac); static inline void II (uint4& a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac); }; wxformbuilder-3.1.59/src/md5/README0000644000175000017500000001035611143440026017110 0ustar rrmulderrrmulderC++/object oriented translation and modification of MD5. Version: 1.00 (28 Aug 95) Version: 1.02 (22 Sep 97) Translation and modification (c) 1995 by Mordechai T. Abzug Thanks to Martin Cleaver for for making it happy on Windows NT and Solaris. This translation/ modification is provided "as is," without express or implied warranty of any kind. The translator/ modifier does not claim (1) that MD5 will do what you think it does; (2) that this translation/ modification is accurate; or (3) that this software is "merchantible." (Language for this disclaimer partially copied from the disclaimer below). Based on: MD5.H - header file for MD5C.C MD5C.C - RSA Data Security, Inc., MD5 message-digest algorithm MDDRIVER.C - test driver for MD2, MD4 and MD5 Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All rights reserved. License to copy and use this software is granted provided that it is identified as the "RSA Data Security, Inc. MD5 Message-Digest Algorithm" in all material mentioning or referencing this software or this function. License is also granted to make and use derivative works provided that such works are identified as "derived from the RSA Data Security, Inc. MD5 Message-Digest Algorithm" in all material mentioning or referencing the derived work. RSA Data Security, Inc. makes no representations concerning either the merchantability of this software or the suitability of this software for any particular purpose. It is provided "as is" without express or implied warranty of any kind. These notices must be retained in any copies of any part of this documentation and/or software. ------------------------------------------------------------------------------- A note on compilation: MD5 assumes that an unsigned char is at least a byte long, that an unsigned short int is at least two bytes long, and that an unsigned int is at least four bytes long. If your system is different, you should modify md5.hh accordingly. HOW TO USE: (1) standalone: Driver.cc provides a nice interface for simple uses of md5. The included makefile will do fine. However, if this is the limit of your md5 use, you may as well use the original C source, which is somewhat smaller. (2) as an object-oriented module: The MD5 objects in this module are MD5 contexts that are initialized, then updated zero or more times, then finalized, and then have their digest accessed zero or more times. Note that they *must* be "finalized" between initialization and the availability of the digest; this is part of the definition of MD5. The updating is done with a message, either with a stdio file opened for reading (it is the user's responsibility to make sure that the file is open), with an ifstream (again, the user's responsibility), with an istream, or with an unsigned char string (typecast if you're using normal char strings). If you initialized with the default contructor (see later), you can update a single MD5 object multiple times, even with different types of objects (say, a file and then a string). Note that a stdio file is closed after an update, and the streams must no longer be "good". Example: "context.update(file);". Initialization of the object depends on the type of updating you intend to do (which is why it's here). If you want a general-purpose MD5 object capable of being updated multiple times, with any object type, use the default constructor (ie. "MD5 context;"). If you only want to use the MD5 object for one update, you can initialize with that object; this does an implicit finalization Example: "MD5 context (cin);". Finalization must be done explicitly on object initialized with the default constructor (see above); finalization is implicit with all other contrsuctors. Once finalization has occurred, update is an error. Example: "context.finalize();" After finalizing, you can look at the digest. MD5::raw_digest() returns an 16-member array of unsigned chars (bytes). MD5::hex_digest() returns a 33-byte long character string that is a hex representation of the raw digest. There is also a << operator for ostreams. Example: "unsigned char *digest=context.hex_digest();". Example: 'cout << "Digest is: " << context << endl;'. See driver.cc for more examples. wxformbuilder-3.1.59/src/md5/md5.cc0000644000175000017500000003147111143440026017225 0ustar rrmulderrrmulder// MD5.CC - source code for the C++/object oriented translation and // modification of MD5. // Translation and modification (c) 1995 by Mordechai T. Abzug // This translation/ modification is provided "as is," without express or // implied warranty of any kind. // The translator/ modifier does not claim (1) that MD5 will do what you think // it does; (2) that this translation/ modification is accurate; or (3) that // this software is "merchantible." (Language for this disclaimer partially // copied from the disclaimer below). /* based on: MD5C.C - RSA Data Security, Inc., MD5 message-digest algorithm MDDRIVER.C - test driver for MD2, MD4 and MD5 Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All rights reserved. License to copy and use this software is granted provided that it is identified as the "RSA Data Security, Inc. MD5 Message-Digest Algorithm" in all material mentioning or referencing this software or this function. License is also granted to make and use derivative works provided that such works are identified as "derived from the RSA Data Security, Inc. MD5 Message-Digest Algorithm" in all material mentioning or referencing the derived work. RSA Data Security, Inc. makes no representations concerning either the merchantability of this software or the suitability of this software for any particular purpose. It is provided "as is" without express or implied warranty of any kind. These notices must be retained in any copies of any part of this documentation and/or software. */ #include "md5.hh" #include #include #include using namespace std; // MD5 simple initialization method MD5::MD5(){ init(); } // MD5 block update operation. Continues an MD5 message-digest // operation, processing another message block, and updating the // context. void MD5::update ( const uint1 *input, uint4 input_length) { uint4 input_index, buffer_index; uint4 buffer_space; // how much space is left in buffer if (finalized){ // so we can't update! cerr << "MD5::update: Can't update a finalized digest!" << endl; return; } // Compute number of bytes mod 64 buffer_index = (unsigned int)((count[0] >> 3) & 0x3F); // Update number of bits if ( (count[0] += ((uint4) input_length << 3))<((uint4) input_length << 3) ) count[1]++; count[1] += ((uint4)input_length >> 29); buffer_space = 64 - buffer_index; // how much space is left in buffer // Transform as many times as possible. if (input_length >= buffer_space) { // ie. we have enough to fill the buffer // fill the rest of the buffer and transform memcpy (buffer + buffer_index, input, buffer_space); transform (buffer); // now, transform each 64-byte piece of the input, bypassing the buffer for (input_index = buffer_space; input_index + 63 < input_length; input_index += 64) transform (input+input_index); buffer_index = 0; // so we can buffer remaining } else input_index=0; // so we can buffer the whole input // and here we do the buffering: memcpy(buffer+buffer_index, input+input_index, input_length-input_index); } // MD5 update for files. // Like above, except that it works on files (and uses above as a primitive.) void MD5::update(FILE *file){ unsigned char buffer[1024]; int len; while ((len=fread(buffer, 1, 1024, file))) update(buffer, len); fclose (file); } // MD5 update for istreams. // Like update for files; see above. void MD5::update(istream& stream){ unsigned char buffer[1024]; int len; while (stream.good()){ stream.read((char*)buffer, 1024); // note that return value of read is unusable. len=stream.gcount(); update(buffer, len); } } // MD5 update for ifstreams. // Like update for files; see above. void MD5::update(ifstream& stream){ unsigned char buffer[1024]; int len; while (stream.good()){ stream.read((char*)buffer, 1024); // note that return value of read is unusable. len=stream.gcount(); update(buffer, len); } } // MD5 finalization. Ends an MD5 message-digest operation, writing the // the message digest and zeroizing the context. void MD5::finalize (){ unsigned char bits[8]; unsigned int index, padLen; static uint1 PADDING[64]={ 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; if (finalized){ cerr << "MD5::finalize: Already finalized this digest!" << endl; return; } // Save number of bits encode (bits, count, 8); // Pad out to 56 mod 64. index = (uint4) ((count[0] >> 3) & 0x3f); padLen = (index < 56) ? (56 - index) : (120 - index); update (PADDING, padLen); // Append length (before padding) update (bits, 8); // Store state in digest encode (digest, state, 16); // Zeroize sensitive information memset (buffer, 0, sizeof(*buffer)); finalized=1; } MD5::MD5(FILE *file){ init(); // must be called be all constructors update(file); finalize (); } MD5::MD5(istream& stream){ init(); // must called by all constructors update (stream); finalize(); } MD5::MD5(ifstream& stream){ init(); // must called by all constructors update (stream); finalize(); } unsigned char *MD5::raw_digest(){ uint1 *s = new uint1[16]; if (!finalized){ cerr << "MD5::raw_digest: Can't get digest if you haven't "<< "finalized the digest!" <> 8) & 0xff); output[j+2] = (uint1) ((input[i] >> 16) & 0xff); output[j+3] = (uint1) ((input[i] >> 24) & 0xff); } } // Decodes input (unsigned char) into output (UINT4). Assumes len is // a multiple of 4. void MD5::decode (uint4 *output, const uint1 *input, uint4 len){ unsigned int i, j; for (i = 0, j = 0; j < len; i++, j += 4) output[i] = ((uint4)input[j]) | (((uint4)input[j+1]) << 8) | (((uint4)input[j+2]) << 16) | (((uint4)input[j+3]) << 24); } // Note: Replace "for loop" with standard memcpy if possible. void MD5::memcpy (uint1 *output, const uint1 *input, uint4 len){ unsigned int i; for (i = 0; i < len; i++) output[i] = input[i]; } // Note: Replace "for loop" with standard memset if possible. void MD5::memset (uint1 *output, uint1 value, uint4 len){ unsigned int i; for (i = 0; i < len; i++) output[i] = value; } // ROTATE_LEFT rotates x left n bits. inline unsigned int MD5::rotate_left (uint4 x, uint4 n){ return (x << n) | (x >> (32-n)) ; } // F, G, H and I are basic MD5 functions. inline unsigned int MD5::F (uint4 x, uint4 y, uint4 z){ return (x & y) | (~x & z); } inline unsigned int MD5::G (uint4 x, uint4 y, uint4 z){ return (x & z) | (y & ~z); } inline unsigned int MD5::H (uint4 x, uint4 y, uint4 z){ return x ^ y ^ z; } inline unsigned int MD5::I (uint4 x, uint4 y, uint4 z){ return y ^ (x | ~z); } // FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4. // Rotation is separate from addition to prevent recomputation. inline void MD5::FF(uint4& a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac){ a += F(b, c, d) + x + ac; a = rotate_left (a, s) +b; } inline void MD5::GG(uint4& a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac){ a += G(b, c, d) + x + ac; a = rotate_left (a, s) +b; } inline void MD5::HH(uint4& a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac){ a += H(b, c, d) + x + ac; a = rotate_left (a, s) +b; } inline void MD5::II(uint4& a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac){ a += I(b, c, d) + x + ac; a = rotate_left (a, s) +b; } wxformbuilder-3.1.59/sdk/tinyxml/build_instructions.txt0000644000175000017500000000516111143440026023723 0ustar rrmulderrrmulderTiCPP (TinyXML C++ wrapper) --------------------------------------------------- Introduction: 'TiCPP' is short for the official name TinyXML++. It is a completely new interface to TinyXML (http://http://www.grinninglizard.com/tinyxml/) that uses MANY of the C++ strengths. Templates, exceptions, and much better error handling. It is also fully documented in doxygen. It is really cool because this version let's you interface tiny the exact same way as before or you can choose to use the new 'TiCPP' classes. All you need to do is define TIXML_USE_TICPP. It has been tested in VC 6.0, VC 7.0, VC 7.1, VC 8.0, MinGW gcc 3.4.5, and in Linux GNU gcc 3+. TinyXML++ uses Premake as the build system, so you won't find any project files because you generate them for your specific system. Premake is a build script generator. Premake supports creatation of build scripts for: * MS Visual Studio 6, 2002, 2003, or 2005 * GNU make (including Cygwin and MinGW) * Code::Blocks * And more ... Build Steps: 1) Download Premake from http://premake.sf.net/download 2) Checkout the source for TinyXML++ using Subversion. - svn checkout http://ticpp.googlecode.com/svn/trunk/ ticpp 3) Place the Premake executable in the root directory of TiCPP or somewhere in your path. 4) To create the needed build files navigate to the TinyXML++ directory (ticpp) and type: * Code::Blocks Projects and workspace: Windows: premake --target cb-gcc [--unicode] [--dynamic-runtime] [--ticpp-shared] Linux: premake --target cb-gcc [--unicode] [--dynamic-runtime] [--ticpp-shared] * GNU makefiles: Windows: premake-win32 --target gnu [--unicode] [--dynamic-runtime] [--ticpp-shared] Linux: premake-linux --target gnu [--unicode] [--dynamic-runtime] [--ticpp-shared] * Visual Studio 2005 (8.0) [Windows ONLY] Windows: premake-win32 --target vs2005 [--unicode] [--dynamic-runtime] [--ticpp-shared] 5) Now use the build system of your choice. - For Code::Blocks, use the generated .cbp/.workspace to build TinyXML++ as a static library. - For GNU makefiles type: (Assumes you have properly setup your system to build with gcc or MinGW) * Release: make CONFIG=Release * Debug: make - For Visual Studio, use the generated .vcproj/.sln to build TinyXML++ as a static library. Notes: - Premake can be found here: http://premake.sourceforge.net - Subversion is a great free cross-platform version control manager. It can be found here: http://subversion.tigris.org - Code::Blocks is a free cross-platform IDE and it can be found here: http://codeblocks.org Enjoy, The TiCPP Team wxformbuilder-3.1.59/sdk/tinyxml/tinyxmlparser.cpp0000644000175000017500000011423511143440026022667 0ustar rrmulderrrmulder/* www.sourceforge.net/projects/tinyxml Original code (2.0 and earlier )copyright (c) 2000-2002 Lee Thomason (www.grinninglizard.com) This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ #include #include #include "tinyxml.h" //#define DEBUG_PARSER #if defined( DEBUG_PARSER ) # if defined( DEBUG ) && defined( _MSC_VER ) # include # define TIXML_LOG OutputDebugString # else # define TIXML_LOG printf # endif #endif // Note tha "PutString" hardcodes the same list. This // is less flexible than it appears. Changing the entries // or order will break putstring. TiXmlBase::Entity TiXmlBase::entity[ NUM_ENTITY ] = { { "&", 5, '&' }, { "<", 4, '<' }, { ">", 4, '>' }, { """, 6, '\"' }, { "'", 6, '\'' } }; // Bunch of unicode info at: // http://www.unicode.org/faq/utf_bom.html // Including the basic of this table, which determines the #bytes in the // sequence from the lead byte. 1 placed for invalid sequences -- // although the result will be junk, pass it through as much as possible. // Beware of the non-characters in UTF-8: // ef bb bf (Microsoft "lead bytes") // ef bf be // ef bf bf const unsigned char TIXML_UTF_LEAD_0 = 0xefU; const unsigned char TIXML_UTF_LEAD_1 = 0xbbU; const unsigned char TIXML_UTF_LEAD_2 = 0xbfU; const int TiXmlBase::utf8ByteTable[256] = { // 0 1 2 3 4 5 6 7 8 9 a b c d e f 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x00 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x10 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x20 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x30 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x40 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x50 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x60 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x70 End of ASCII range 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x80 0x80 to 0xc1 invalid 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x90 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0xa0 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0xb0 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // 0xc0 0xc2 to 0xdf 2 byte 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // 0xd0 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, // 0xe0 0xe0 to 0xef 3 byte 4, 4, 4, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // 0xf0 0xf0 to 0xf4 4 byte, 0xf5 and higher invalid }; void TiXmlBase::ConvertUTF32ToUTF8( unsigned long input, char* output, int* length ) { const unsigned long BYTE_MASK = 0xBF; const unsigned long BYTE_MARK = 0x80; const unsigned long FIRST_BYTE_MARK[7] = { 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC }; if (input < 0x80) *length = 1; else if ( input < 0x800 ) *length = 2; else if ( input < 0x10000 ) *length = 3; else if ( input < 0x200000 ) *length = 4; else { *length = 0; return; } // This code won't covert this correctly anyway. output += *length; // Scary scary fall throughs. switch (*length) { case 4: --output; *output = (char)((input | BYTE_MARK) & BYTE_MASK); input >>= 6; case 3: --output; *output = (char)((input | BYTE_MARK) & BYTE_MASK); input >>= 6; case 2: --output; *output = (char)((input | BYTE_MARK) & BYTE_MASK); input >>= 6; case 1: --output; *output = (char)(input | FIRST_BYTE_MARK[*length]); } } /*static*/ int TiXmlBase::IsAlpha( unsigned char anyByte, TiXmlEncoding /*encoding*/ ) { // This will only work for low-ascii, everything else is assumed to be a valid // letter. I'm not sure this is the best approach, but it is quite tricky trying // to figure out alhabetical vs. not across encoding. So take a very // conservative approach. // if ( encoding == TIXML_ENCODING_UTF8 ) // { if ( anyByte < 127 ) return isalpha( anyByte ); else return 1; // What else to do? The unicode set is huge...get the english ones right. // } // else // { // return isalpha( anyByte ); // } } /*static*/ int TiXmlBase::IsAlphaNum( unsigned char anyByte, TiXmlEncoding /*encoding*/ ) { // This will only work for low-ascii, everything else is assumed to be a valid // letter. I'm not sure this is the best approach, but it is quite tricky trying // to figure out alhabetical vs. not across encoding. So take a very // conservative approach. // if ( encoding == TIXML_ENCODING_UTF8 ) // { if ( anyByte < 127 ) return isalnum( anyByte ); else return 1; // What else to do? The unicode set is huge...get the english ones right. // } // else // { // return isalnum( anyByte ); // } } class TiXmlParsingData { friend class TiXmlDocument; public: void Stamp( const char* now, TiXmlEncoding encoding ); const TiXmlCursor& Cursor() { return cursor; } private: // Only used by the document! TiXmlParsingData( const char* start, int _tabsize, int row, int col ) { assert( start ); stamp = start; tabsize = _tabsize; cursor.row = row; cursor.col = col; } TiXmlCursor cursor; const char* stamp; int tabsize; }; void TiXmlParsingData::Stamp( const char* now, TiXmlEncoding encoding ) { assert( now ); // Do nothing if the tabsize is 0. if ( tabsize < 1 ) { return; } // Get the current row, column. int row = cursor.row; int col = cursor.col; const char* p = stamp; assert( p ); while ( p < now ) { // Treat p as unsigned, so we have a happy compiler. const unsigned char* pU = (const unsigned char*)p; // Code contributed by Fletcher Dunn: (modified by lee) switch (*pU) { case 0: // We *should* never get here, but in case we do, don't // advance past the terminating null character, ever return; case '\r': // bump down to the next line ++row; col = 0; // Eat the character ++p; // Check for \r\n sequence, and treat this as a single character if (*p == '\n') { ++p; } break; case '\n': // bump down to the next line ++row; col = 0; // Eat the character ++p; // Check for \n\r sequence, and treat this as a single // character. (Yes, this bizarre thing does occur still // on some arcane platforms...) if (*p == '\r') { ++p; } break; case '\t': // Eat the character ++p; // Skip to next tab stop col = (col / tabsize + 1) * tabsize; break; case TIXML_UTF_LEAD_0: if ( encoding == TIXML_ENCODING_UTF8 ) { if ( *(p+1) && *(p+2) ) { // In these cases, don't advance the column. These are // 0-width spaces. if ( *(pU+1)==TIXML_UTF_LEAD_1 && *(pU+2)==TIXML_UTF_LEAD_2 ) p += 3; else if ( *(pU+1)==0xbfU && *(pU+2)==0xbeU ) p += 3; else if ( *(pU+1)==0xbfU && *(pU+2)==0xbfU ) p += 3; else { p +=3; ++col; } // A normal character. } } else { ++p; ++col; } break; default: if ( encoding == TIXML_ENCODING_UTF8 ) { // Eat the 1 to 4 byte utf8 character. int step = TiXmlBase::utf8ByteTable[*((const unsigned char*)p)]; if ( step == 0 ) step = 1; // Error case from bad encoding, but handle gracefully. p += step; // Just advance one column, of course. ++col; } else { ++p; ++col; } break; } } cursor.row = row; cursor.col = col; assert( cursor.row >= -1 ); assert( cursor.col >= -1 ); stamp = p; assert( stamp ); } const char* TiXmlBase::SkipWhiteSpace( const char* p, TiXmlEncoding encoding ) { if ( !p || !*p ) { return 0; } if ( encoding == TIXML_ENCODING_UTF8 ) { while ( *p ) { const unsigned char* pU = (const unsigned char*)p; // Skip the stupid Microsoft UTF-8 Byte order marks if ( *(pU+0)==TIXML_UTF_LEAD_0 && *(pU+1)==TIXML_UTF_LEAD_1 && *(pU+2)==TIXML_UTF_LEAD_2 ) { p += 3; continue; } else if(*(pU+0)==TIXML_UTF_LEAD_0 && *(pU+1)==0xbfU && *(pU+2)==0xbeU ) { p += 3; continue; } else if(*(pU+0)==TIXML_UTF_LEAD_0 && *(pU+1)==0xbfU && *(pU+2)==0xbfU ) { p += 3; continue; } if ( IsWhiteSpace( *p ) || *p == '\n' || *p =='\r' ) // Still using old rules for white space. ++p; else break; } } else { while ( *p && IsWhiteSpace( *p ) || *p == '\n' || *p =='\r' ) ++p; } return p; } #ifdef TIXML_USE_STL /*static*/ bool TiXmlBase::StreamWhiteSpace( std::istream * in, TIXML_STRING * tag ) { for( ;; ) { if ( !in->good() ) return false; int c = in->peek(); // At this scope, we can't get to a document. So fail silently. if ( !IsWhiteSpace( c ) || c <= 0 ) return true; *tag += (char) in->get(); } } /*static*/ bool TiXmlBase::StreamTo( std::istream * in, int character, TIXML_STRING * tag ) { //assert( character > 0 && character < 128 ); // else it won't work in utf-8 while ( in->good() ) { int c = in->peek(); if ( c == character ) return true; if ( c <= 0 ) // Silent failure: can't get document at this scope return false; in->get(); *tag += (char) c; } return false; } #endif // One of TinyXML's more performance demanding functions. Try to keep the memory overhead down. The // "assign" optimization removes over 10% of the execution time. // const char* TiXmlBase::ReadName( const char* p, TIXML_STRING * name, TiXmlEncoding encoding ) { // Oddly, not supported on some comilers, //name->clear(); // So use this: *name = ""; assert( p ); // Names start with letters or underscores. // Of course, in unicode, tinyxml has no idea what a letter *is*. The // algorithm is generous. // // After that, they can be letters, underscores, numbers, // hyphens, or colons. (Colons are valid ony for namespaces, // but tinyxml can't tell namespaces from names.) if ( p && *p && ( IsAlpha( (unsigned char) *p, encoding ) || *p == '_' ) ) { const char* start = p; while( p && *p && ( IsAlphaNum( (unsigned char ) *p, encoding ) || *p == '_' || *p == '-' || *p == '.' || *p == ':' ) ) { //(*name) += *p; // expensive ++p; } if ( p-start > 0 ) { name->assign( start, p-start ); } return p; } return 0; } const char* TiXmlBase::GetEntity( const char* p, char* value, int* length, TiXmlEncoding encoding ) { // Presume an entity, and pull it out. TIXML_STRING ent; int i; *length = 0; if ( *(p+1) && *(p+1) == '#' && *(p+2) ) { unsigned long ucs = 0; ptrdiff_t delta = 0; unsigned mult = 1; if ( *(p+2) == 'x' ) { // Hexadecimal. if ( !*(p+3) ) return 0; const char* q = p+3; q = strchr( q, ';' ); if ( !q || !*q ) return 0; delta = q-p; --q; while ( *q != 'x' ) { if ( *q >= '0' && *q <= '9' ) ucs += mult * (*q - '0'); else if ( *q >= 'a' && *q <= 'f' ) ucs += mult * (*q - 'a' + 10); else if ( *q >= 'A' && *q <= 'F' ) ucs += mult * (*q - 'A' + 10 ); else return 0; mult *= 16; --q; } } else { // Decimal. if ( !*(p+2) ) return 0; const char* q = p+2; q = strchr( q, ';' ); if ( !q || !*q ) return 0; delta = q-p; --q; while ( *q != '#' ) { if ( *q >= '0' && *q <= '9' ) ucs += mult * (*q - '0'); else return 0; mult *= 10; --q; } } if ( encoding == TIXML_ENCODING_UTF8 ) { // convert the UCS to UTF-8 ConvertUTF32ToUTF8( ucs, value, length ); } else { *value = (char)ucs; *length = 1; } return p + delta + 1; } // Now try to match it. for( i=0; iappend( cArr, len ); } } else { bool whitespace = false; // Remove leading white space: p = SkipWhiteSpace( p, encoding ); while ( p && *p && !StringEqual( p, endTag, caseInsensitive, encoding ) ) { if ( *p == '\r' || *p == '\n' ) { whitespace = true; ++p; } else if ( IsWhiteSpace( *p ) ) { whitespace = true; ++p; } else { // If we've found whitespace, add it before the // new character. Any whitespace just becomes a space. if ( whitespace ) { (*text) += ' '; whitespace = false; } int len; char cArr[4] = { 0, 0, 0, 0 }; p = GetChar( p, cArr, &len, encoding ); if ( len == 1 ) (*text) += cArr[0]; // more efficient else text->append( cArr, len ); } } } if ( p ) p += strlen( endTag ); return p; } #ifdef TIXML_USE_STL void TiXmlDocument::StreamIn( std::istream * in, TIXML_STRING * tag ) { // The basic issue with a document is that we don't know what we're // streaming. Read something presumed to be a tag (and hope), then // identify it, and call the appropriate stream method on the tag. // // This "pre-streaming" will never read the closing ">" so the // sub-tag can orient itself. if ( !StreamTo( in, '<', tag ) ) { SetError( TIXML_ERROR_PARSING_EMPTY, 0, 0, TIXML_ENCODING_UNKNOWN ); return; } while ( in->good() ) { int tagIndex = (int) tag->length(); while ( in->good() && in->peek() != '>' ) { int c = in->get(); if ( c <= 0 ) { SetError( TIXML_ERROR_EMBEDDED_NULL, 0, 0, TIXML_ENCODING_UNKNOWN ); break; } (*tag) += (char) c; } if ( in->good() ) { // We now have something we presume to be a node of // some sort. Identify it, and call the node to // continue streaming. TiXmlNode* node = Identify( tag->c_str() + tagIndex, TIXML_DEFAULT_ENCODING ); if ( node ) { node->StreamIn( in, tag ); bool isElement = node->ToElement() != 0; delete node; node = 0; // If this is the root element, we're done. Parsing will be // done by the >> operator. if ( isElement ) { return; } } else { SetError( TIXML_ERROR, 0, 0, TIXML_ENCODING_UNKNOWN ); return; } } } // We should have returned sooner. SetError( TIXML_ERROR, 0, 0, TIXML_ENCODING_UNKNOWN ); } #endif const char* TiXmlDocument::Parse( const char* p, TiXmlParsingData* prevData, TiXmlEncoding encoding ) { ClearError(); // Parse away, at the document level. Since a document // contains nothing but other tags, most of what happens // here is skipping white space. if ( !p || !*p ) { SetError( TIXML_ERROR_DOCUMENT_EMPTY, 0, 0, TIXML_ENCODING_UNKNOWN ); return 0; } // Note that, for a document, this needs to come // before the while space skip, so that parsing // starts from the pointer we are given. location.Clear(); if ( prevData ) { location.row = prevData->cursor.row; location.col = prevData->cursor.col; } else { location.row = 0; location.col = 0; } TiXmlParsingData data( p, TabSize(), location.row, location.col ); location = data.Cursor(); if ( encoding == TIXML_ENCODING_UNKNOWN ) { // Check for the Microsoft UTF-8 lead bytes. const unsigned char* pU = (const unsigned char*)p; if ( *(pU+0) && *(pU+0) == TIXML_UTF_LEAD_0 && *(pU+1) && *(pU+1) == TIXML_UTF_LEAD_1 && *(pU+2) && *(pU+2) == TIXML_UTF_LEAD_2 ) { encoding = TIXML_ENCODING_UTF8; useMicrosoftBOM = true; } } p = SkipWhiteSpace( p, encoding ); if ( !p ) { SetError( TIXML_ERROR_DOCUMENT_EMPTY, 0, 0, TIXML_ENCODING_UNKNOWN ); return 0; } while ( p && *p ) { TiXmlNode* node = Identify( p, encoding ); if ( node ) { p = node->Parse( p, &data, encoding ); LinkEndChild( node ); } else { break; } // Did we get encoding info? if ( encoding == TIXML_ENCODING_UNKNOWN && node->ToDeclaration() ) { TiXmlDeclaration* dec = node->ToDeclaration(); const char* enc = dec->Encoding(); assert( enc ); if ( *enc == 0 ) encoding = TIXML_ENCODING_UTF8; else if ( StringEqual( enc, "UTF-8", true, TIXML_ENCODING_UNKNOWN ) ) encoding = TIXML_ENCODING_UTF8; else if ( StringEqual( enc, "UTF8", true, TIXML_ENCODING_UNKNOWN ) ) encoding = TIXML_ENCODING_UTF8; // incorrect, but be nice else encoding = TIXML_ENCODING_LEGACY; } p = SkipWhiteSpace( p, encoding ); } // Was this empty? if ( !firstChild ) { SetError( TIXML_ERROR_DOCUMENT_EMPTY, 0, 0, encoding ); return 0; } // All is well. return p; } void TiXmlDocument::SetError( int err, const char* pError, TiXmlParsingData* data, TiXmlEncoding encoding ) { // The first error in a chain is more accurate - don't set again! if ( error ) return; assert( err > 0 && err < TIXML_ERROR_STRING_COUNT ); error = true; errorId = err; errorDesc = errorString[ errorId ]; errorLocation.Clear(); if ( pError && data ) { data->Stamp( pError, encoding ); errorLocation = data->Cursor(); } } TiXmlNode* TiXmlNode::Identify( const char* p, TiXmlEncoding encoding ) { TiXmlNode* returnNode = 0; p = SkipWhiteSpace( p, encoding ); if( !p || !*p || *p != '<' ) { return 0; } TiXmlDocument* doc = GetDocument(); p = SkipWhiteSpace( p, encoding ); if ( !p || !*p ) { return 0; } // What is this thing? // - Elements start with a letter or underscore, but xml is reserved. // - Comments: "; if ( !StringEqual( p, startTag, false, encoding ) ) { document->SetError( TIXML_ERROR_PARSING_COMMENT, p, data, encoding ); return 0; } p += strlen( startTag ); // [ 1475201 ] TinyXML parses entities in comments // Oops - ReadText doesn't work, because we don't want to parse the entities. // p = ReadText( p, &value, false, endTag, false, encoding ); // // from the XML spec: /* [Definition: Comments may appear anywhere in a document outside other markup; in addition, they may appear within the document type declaration at places allowed by the grammar. They are not part of the document's character data; an XML processor MAY, but need not, make it possible for an application to retrieve the text of comments. For compatibility, the string "--" (double-hyphen) MUST NOT occur within comments.] Parameter entity references MUST NOT be recognized within comments. An example of a comment: */ value = ""; // Keep all the white space. while ( p && *p && !StringEqual( p, endTag, false, encoding ) ) { value.append( p, 1 ); ++p; } if ( p ) p += strlen( endTag ); return p; } const char* TiXmlAttribute::Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding ) { p = SkipWhiteSpace( p, encoding ); if ( !p || !*p ) return 0; // int tabsize = 4; // if ( document ) // tabsize = document->TabSize(); if ( data ) { data->Stamp( p, encoding ); location = data->Cursor(); } // Read the name, the '=' and the value. const char* pErr = p; p = ReadName( p, &name, encoding ); if ( !p || !*p ) { if ( document ) document->SetError( TIXML_ERROR_READING_ATTRIBUTES, pErr, data, encoding ); return 0; } p = SkipWhiteSpace( p, encoding ); if ( !p || !*p || *p != '=' ) { if ( document ) document->SetError( TIXML_ERROR_READING_ATTRIBUTES, p, data, encoding ); return 0; } ++p; // skip '=' p = SkipWhiteSpace( p, encoding ); if ( !p || !*p ) { if ( document ) document->SetError( TIXML_ERROR_READING_ATTRIBUTES, p, data, encoding ); return 0; } const char* end; const char SINGLE_QUOTE = '\''; const char DOUBLE_QUOTE = '\"'; if ( *p == SINGLE_QUOTE ) { ++p; end = "\'"; // single quote in string p = ReadText( p, &value, false, end, false, encoding ); } else if ( *p == DOUBLE_QUOTE ) { ++p; end = "\""; // double quote in string p = ReadText( p, &value, false, end, false, encoding ); } else { // All attribute values should be in single or double quotes. // But this is such a common error that the parser will try // its best, even without them. value = ""; while ( p && *p // existence && !IsWhiteSpace( *p ) && *p != '\n' && *p != '\r' // whitespace && *p != '/' && *p != '>' ) // tag end { if ( *p == SINGLE_QUOTE || *p == DOUBLE_QUOTE ) { // [ 1451649 ] Attribute values with trailing quotes not handled correctly // We did not have an opening quote but seem to have a // closing one. Give up and throw an error. if ( document ) document->SetError( TIXML_ERROR_READING_ATTRIBUTES, p, data, encoding ); return 0; } value += *p; ++p; } } return p; } #ifdef TIXML_USE_STL void TiXmlText::StreamIn( std::istream * in, TIXML_STRING * tag ) { while ( in->good() ) { int c = in->peek(); if ( !cdata && (c == '<' ) ) { return; } if ( c <= 0 ) { TiXmlDocument* document = GetDocument(); if ( document ) document->SetError( TIXML_ERROR_EMBEDDED_NULL, 0, 0, TIXML_ENCODING_UNKNOWN ); return; } (*tag) += (char) c; in->get(); // "commits" the peek made above if ( cdata && c == '>' && tag->size() >= 3 ) { size_t len = tag->size(); if ( (*tag)[len-2] == ']' && (*tag)[len-3] == ']' ) { // terminator of cdata. return; } } } } #endif const char* TiXmlText::Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding ) { value = ""; TiXmlDocument* document = GetDocument(); if ( data ) { data->Stamp( p, encoding ); location = data->Cursor(); } const char* const startTag = ""; if ( cdata || StringEqual( p, startTag, false, encoding ) ) { cdata = true; if ( !StringEqual( p, startTag, false, encoding ) ) { document->SetError( TIXML_ERROR_PARSING_CDATA, p, data, encoding ); return 0; } p += strlen( startTag ); // Keep all the white space, ignore the encoding, etc. while ( p && *p && !StringEqual( p, endTag, false, encoding ) ) { value += *p; ++p; } TIXML_STRING dummy; p = ReadText( p, &dummy, false, endTag, false, encoding ); return p; } else { bool ignoreWhite = true; const char* end = "<"; p = ReadText( p, &value, ignoreWhite, end, false, encoding ); if ( p ) return p-1; // don't truncate the '<' return 0; } } #ifdef TIXML_USE_STL void TiXmlDeclaration::StreamIn( std::istream * in, TIXML_STRING * tag ) { while ( in->good() ) { int c = in->get(); if ( c <= 0 ) { TiXmlDocument* document = GetDocument(); if ( document ) document->SetError( TIXML_ERROR_EMBEDDED_NULL, 0, 0, TIXML_ENCODING_UNKNOWN ); return; } (*tag) += (char) c; if ( c == '>' ) { // All is well. return; } } } #endif const char* TiXmlDeclaration::Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding _encoding ) { p = SkipWhiteSpace( p, _encoding ); // Find the beginning, find the end, and look for // the stuff in-between. TiXmlDocument* document = GetDocument(); if ( !p || !*p || !StringEqual( p, "SetError( TIXML_ERROR_PARSING_DECLARATION, 0, 0, _encoding ); return 0; } if ( data ) { data->Stamp( p, _encoding ); location = data->Cursor(); } p += 5; version = ""; encoding = ""; standalone = ""; while ( p && *p ) { if ( *p == '>' ) { ++p; return p; } p = SkipWhiteSpace( p, _encoding ); if ( StringEqual( p, "version", true, _encoding ) ) { TiXmlAttribute attrib; p = attrib.Parse( p, data, _encoding ); version = attrib.Value(); } else if ( StringEqual( p, "encoding", true, _encoding ) ) { TiXmlAttribute attrib; p = attrib.Parse( p, data, _encoding ); encoding = attrib.Value(); } else if ( StringEqual( p, "standalone", true, _encoding ) ) { TiXmlAttribute attrib; p = attrib.Parse( p, data, _encoding ); standalone = attrib.Value(); } else { // Read over whatever it is. while( p && *p && *p != '>' && !IsWhiteSpace( *p ) ) ++p; } } return 0; } bool TiXmlText::Blank() const { for ( unsigned i=0; igood() ) { int c = in->get(); if ( c <= 0 ) { TiXmlDocument* document = GetDocument(); if ( document ) document->SetError( TIXML_ERROR_EMBEDDED_NULL, 0, 0, TIXML_ENCODING_UNKNOWN ); return; } (*tag) += (char) c; if ( c == '>' ) { // All is well. return; } } } #endif const char* TiXmlStylesheetReference::Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding _encoding ) { p = SkipWhiteSpace( p, _encoding ); // Find the beginning, find the end, and look for // the stuff in-between. TiXmlDocument* document = GetDocument(); if ( !p || !*p || !StringEqual( p, "SetError( TIXML_ERROR_PARSING_DECLARATION, 0, 0, _encoding ); return 0; } if ( data ) { data->Stamp( p, _encoding ); location = data->Cursor(); } p += 5; type = ""; href = ""; while ( p && *p ) { if ( *p == '>' ) { ++p; return p; } p = SkipWhiteSpace( p, _encoding ); if ( StringEqual( p, "type", true, _encoding ) ) { TiXmlAttribute attrib; p = attrib.Parse( p, data, _encoding ); type = attrib.Value(); } else if ( StringEqual( p, "href", true, _encoding ) ) { TiXmlAttribute attrib; p = attrib.Parse( p, data, _encoding ); href = attrib.Value(); } else { // Read over whatever it is. while( p && *p && *p != '>' && !IsWhiteSpace( *p ) ) ++p; } } return 0; } wxformbuilder-3.1.59/sdk/tinyxml/tinyxml.cpp0000644000175000017500000011337311143440026021454 0ustar rrmulderrrmulder/* www.sourceforge.net/projects/tinyxml Original code (2.0 and earlier )copyright (c) 2000-2006 Lee Thomason (www.grinninglizard.com) This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ #include "tinyxml.h" #include #ifdef TIXML_USE_STL #include #include #endif bool TiXmlBase::condenseWhiteSpace = true; // Microsoft compiler security FILE* TiXmlFOpen( const char* filename, const char* mode ) { #if defined(_MSC_VER) && (_MSC_VER >= 1400 ) FILE* fp = 0; errno_t err = fopen_s( &fp, filename, mode ); if ( !err && fp ) return fp; return 0; #else return fopen( filename, mode ); #endif } void TiXmlBase::EncodeString( const TIXML_STRING& str, TIXML_STRING* outString ) { int i=0; while( i<(int)str.length() ) { unsigned char c = (unsigned char) str[i]; if ( c == '&' && i < ( (int)str.length() - 2 ) && str[i+1] == '#' && str[i+2] == 'x' ) { // Hexadecimal character reference. // Pass through unchanged. // © -- copyright symbol, for example. // // The -1 is a bug fix from Rob Laveaux. It keeps // an overflow from happening if there is no ';'. // There are actually 2 ways to exit this loop - // while fails (error case) and break (semicolon found). // However, there is no mechanism (currently) for // this function to return an error. while ( i<(int)str.length()-1 ) { outString->append( str.c_str() + i, 1 ); ++i; if ( str[i] == ';' ) break; } } else if ( c == '&' ) { outString->append( entity[0].str, entity[0].strLength ); ++i; } else if ( c == '<' ) { outString->append( entity[1].str, entity[1].strLength ); ++i; } else if ( c == '>' ) { outString->append( entity[2].str, entity[2].strLength ); ++i; } else if ( c == '\"' ) { outString->append( entity[3].str, entity[3].strLength ); ++i; } else if ( c == '\'' ) { outString->append( entity[4].str, entity[4].strLength ); ++i; } else if ( c < 32 ) { // Easy pass at non-alpha/numeric/symbol // Below 32 is symbolic. char buf[ 32 ]; #if defined(TIXML_SNPRINTF) TIXML_SNPRINTF( buf, sizeof(buf), "&#x%02X;", (unsigned) ( c & 0xff ) ); #else sprintf( buf, "&#x%02X;", (unsigned) ( c & 0xff ) ); #endif //*ME: warning C4267: convert 'size_t' to 'int' //*ME: Int-Cast to make compiler happy ... outString->append( buf, (int)strlen( buf ) ); ++i; } else { //char realc = (char) c; //outString->append( &realc, 1 ); *outString += (char) c; // somewhat more efficient function call. ++i; } } } TiXmlNode::TiXmlNode( NodeType _type ) : TiXmlBase() { parent = 0; type = _type; firstChild = 0; lastChild = 0; prev = 0; next = 0; } TiXmlNode::~TiXmlNode() { TiXmlNode* node = firstChild; TiXmlNode* temp = 0; while ( node ) { temp = node; node = node->next; delete temp; } } void TiXmlNode::CopyTo( TiXmlNode* target ) const { target->SetValue (value.c_str() ); target->userData = userData; } void TiXmlNode::Clear() { TiXmlNode* node = firstChild; TiXmlNode* temp = 0; while ( node ) { temp = node; node = node->next; delete temp; } firstChild = 0; lastChild = 0; } TiXmlNode* TiXmlNode::LinkEndChild( TiXmlNode* node ) { assert( node->parent == 0 || node->parent == this ); assert( node->GetDocument() == 0 || node->GetDocument() == this->GetDocument() ); if ( node->Type() == TiXmlNode::DOCUMENT ) { delete node; if ( GetDocument() ) GetDocument()->SetError( TIXML_ERROR_DOCUMENT_TOP_ONLY, 0, 0, TIXML_ENCODING_UNKNOWN ); return 0; } node->parent = this; node->prev = lastChild; node->next = 0; if ( lastChild ) lastChild->next = node; else firstChild = node; // it was an empty list. lastChild = node; return node; } TiXmlNode* TiXmlNode::InsertEndChild( const TiXmlNode& addThis ) { if ( addThis.Type() == TiXmlNode::DOCUMENT ) { if ( GetDocument() ) GetDocument()->SetError( TIXML_ERROR_DOCUMENT_TOP_ONLY, 0, 0, TIXML_ENCODING_UNKNOWN ); return 0; } TiXmlNode* node = addThis.Clone(); if ( !node ) return 0; return LinkEndChild( node ); } TiXmlNode* TiXmlNode::InsertBeforeChild( TiXmlNode* beforeThis, const TiXmlNode& addThis ) { if ( !beforeThis || beforeThis->parent != this ) { return 0; } if ( addThis.Type() == TiXmlNode::DOCUMENT ) { if ( GetDocument() ) GetDocument()->SetError( TIXML_ERROR_DOCUMENT_TOP_ONLY, 0, 0, TIXML_ENCODING_UNKNOWN ); return 0; } TiXmlNode* node = addThis.Clone(); if ( !node ) return 0; node->parent = this; node->next = beforeThis; node->prev = beforeThis->prev; if ( beforeThis->prev ) { beforeThis->prev->next = node; } else { assert( firstChild == beforeThis ); firstChild = node; } beforeThis->prev = node; return node; } TiXmlNode* TiXmlNode::InsertAfterChild( TiXmlNode* afterThis, const TiXmlNode& addThis ) { if ( !afterThis || afterThis->parent != this ) { return 0; } if ( addThis.Type() == TiXmlNode::DOCUMENT ) { if ( GetDocument() ) GetDocument()->SetError( TIXML_ERROR_DOCUMENT_TOP_ONLY, 0, 0, TIXML_ENCODING_UNKNOWN ); return 0; } TiXmlNode* node = addThis.Clone(); if ( !node ) return 0; node->parent = this; node->prev = afterThis; node->next = afterThis->next; if ( afterThis->next ) { afterThis->next->prev = node; } else { assert( lastChild == afterThis ); lastChild = node; } afterThis->next = node; return node; } TiXmlNode* TiXmlNode::ReplaceChild( TiXmlNode* replaceThis, const TiXmlNode& withThis ) { if ( replaceThis->parent != this ) return 0; TiXmlNode* node = withThis.Clone(); if ( !node ) return 0; node->next = replaceThis->next; node->prev = replaceThis->prev; if ( replaceThis->next ) replaceThis->next->prev = node; else lastChild = node; if ( replaceThis->prev ) replaceThis->prev->next = node; else firstChild = node; delete replaceThis; node->parent = this; return node; } bool TiXmlNode::RemoveChild( TiXmlNode* removeThis ) { if ( removeThis->parent != this ) { assert( 0 ); return false; } if ( removeThis->next ) removeThis->next->prev = removeThis->prev; else lastChild = removeThis->prev; if ( removeThis->prev ) removeThis->prev->next = removeThis->next; else firstChild = removeThis->next; delete removeThis; return true; } const TiXmlNode* TiXmlNode::FirstChild( const char * _value ) const { const TiXmlNode* node; for ( node = firstChild; node; node = node->next ) { if ( strcmp( node->Value(), _value ) == 0 ) return node; } return 0; } const TiXmlNode* TiXmlNode::LastChild( const char * _value ) const { const TiXmlNode* node; for ( node = lastChild; node; node = node->prev ) { if ( strcmp( node->Value(), _value ) == 0 ) return node; } return 0; } const TiXmlNode* TiXmlNode::IterateChildren( const TiXmlNode* previous ) const { if ( !previous ) { return FirstChild(); } else { assert( previous->parent == this ); return previous->NextSibling(); } } const TiXmlNode* TiXmlNode::IterateChildren( const char * val, const TiXmlNode* previous ) const { if ( !previous ) { return FirstChild( val ); } else { assert( previous->parent == this ); return previous->NextSibling( val ); } } const TiXmlNode* TiXmlNode::NextSibling( const char * _value ) const { const TiXmlNode* node; for ( node = next; node; node = node->next ) { if ( strcmp( node->Value(), _value ) == 0 ) return node; } return 0; } const TiXmlNode* TiXmlNode::PreviousSibling( const char * _value ) const { const TiXmlNode* node; for ( node = prev; node; node = node->prev ) { if ( strcmp( node->Value(), _value ) == 0 ) return node; } return 0; } void TiXmlElement::RemoveAttribute( const char * name ) { #ifdef TIXML_USE_STL TIXML_STRING str( name ); TiXmlAttribute* node = attributeSet.Find( str ); #else TiXmlAttribute* node = attributeSet.Find( name ); #endif if ( node ) { attributeSet.Remove( node ); delete node; } } const TiXmlElement* TiXmlNode::FirstChildElement() const { const TiXmlNode* node; for ( node = FirstChild(); node; node = node->NextSibling() ) { if ( node->ToElement() ) return node->ToElement(); } return 0; } const TiXmlElement* TiXmlNode::FirstChildElement( const char * _value ) const { const TiXmlNode* node; for ( node = FirstChild( _value ); node; node = node->NextSibling( _value ) ) { if ( node->ToElement() ) return node->ToElement(); } return 0; } const TiXmlElement* TiXmlNode::NextSiblingElement() const { const TiXmlNode* node; for ( node = NextSibling(); node; node = node->NextSibling() ) { if ( node->ToElement() ) return node->ToElement(); } return 0; } const TiXmlElement* TiXmlNode::NextSiblingElement( const char * _value ) const { const TiXmlNode* node; for ( node = NextSibling( _value ); node; node = node->NextSibling( _value ) ) { if ( node->ToElement() ) return node->ToElement(); } return 0; } const TiXmlDocument* TiXmlNode::GetDocument() const { const TiXmlNode* node; for( node = this; node; node = node->parent ) { if ( node->ToDocument() ) return node->ToDocument(); } return 0; } TiXmlElement::TiXmlElement (const char * _value) : TiXmlNode( TiXmlNode::ELEMENT ) { firstChild = lastChild = 0; value = _value; } #ifdef TIXML_USE_STL TiXmlElement::TiXmlElement( const std::string& _value ) : TiXmlNode( TiXmlNode::ELEMENT ) { firstChild = lastChild = 0; value = _value; } #endif TiXmlElement::TiXmlElement( const TiXmlElement& copy) : TiXmlNode( TiXmlNode::ELEMENT ) { firstChild = lastChild = 0; copy.CopyTo( this ); } void TiXmlElement::operator=( const TiXmlElement& base ) { ClearThis(); base.CopyTo( this ); } TiXmlElement::~TiXmlElement() { ClearThis(); } void TiXmlElement::ClearThis() { Clear(); while( attributeSet.First() ) { TiXmlAttribute* node = attributeSet.First(); attributeSet.Remove( node ); delete node; } } const char* TiXmlElement::Attribute( const char* name ) const { const TiXmlAttribute* node = attributeSet.Find( name ); if ( node ) return node->Value(); return 0; } #ifdef TIXML_USE_STL const std::string* TiXmlElement::Attribute( const std::string& name ) const { const TiXmlAttribute* node = attributeSet.Find( name ); if ( node ) return &node->ValueStr(); return 0; } #endif const char* TiXmlElement::Attribute( const char* name, int* i ) const { const char* s = Attribute( name ); if ( i ) { if ( s ) { *i = atoi( s ); } else { *i = 0; } } return s; } #ifdef TIXML_USE_STL const std::string* TiXmlElement::Attribute( const std::string& name, int* i ) const { const std::string* s = Attribute( name ); if ( i ) { if ( s ) { *i = atoi( s->c_str() ); } else { *i = 0; } } return s; } #endif const char* TiXmlElement::Attribute( const char* name, double* d ) const { const char* s = Attribute( name ); if ( d ) { if ( s ) { *d = atof( s ); } else { *d = 0; } } return s; } #ifdef TIXML_USE_STL const std::string* TiXmlElement::Attribute( const std::string& name, double* d ) const { const std::string* s = Attribute( name ); if ( d ) { if ( s ) { *d = atof( s->c_str() ); } else { *d = 0; } } return s; } #endif int TiXmlElement::QueryIntAttribute( const char* name, int* ival ) const { const TiXmlAttribute* node = attributeSet.Find( name ); if ( !node ) return TIXML_NO_ATTRIBUTE; return node->QueryIntValue( ival ); } #ifdef TIXML_USE_STL int TiXmlElement::QueryIntAttribute( const std::string& name, int* ival ) const { const TiXmlAttribute* node = attributeSet.Find( name ); if ( !node ) return TIXML_NO_ATTRIBUTE; return node->QueryIntValue( ival ); } #endif int TiXmlElement::QueryDoubleAttribute( const char* name, double* dval ) const { const TiXmlAttribute* node = attributeSet.Find( name ); if ( !node ) return TIXML_NO_ATTRIBUTE; return node->QueryDoubleValue( dval ); } #ifdef TIXML_USE_STL int TiXmlElement::QueryDoubleAttribute( const std::string& name, double* dval ) const { const TiXmlAttribute* node = attributeSet.Find( name ); if ( !node ) return TIXML_NO_ATTRIBUTE; return node->QueryDoubleValue( dval ); } #endif void TiXmlElement::SetAttribute( const char * name, int val ) { char buf[64]; #if defined(TIXML_SNPRINTF) TIXML_SNPRINTF( buf, sizeof(buf), "%d", val ); #else sprintf( buf, "%d", val ); #endif SetAttribute( name, buf ); } #ifdef TIXML_USE_STL void TiXmlElement::SetAttribute( const std::string& name, int val ) { std::ostringstream oss; oss << val; SetAttribute( name, oss.str() ); } #endif void TiXmlElement::SetDoubleAttribute( const char * name, double val ) { char buf[256]; #if defined(TIXML_SNPRINTF) TIXML_SNPRINTF( buf, sizeof(buf), "%f", val ); #else sprintf( buf, "%f", val ); #endif SetAttribute( name, buf ); } void TiXmlElement::SetAttribute( const char * cname, const char * cvalue ) { #ifdef TIXML_USE_STL TIXML_STRING _name( cname ); TIXML_STRING _value( cvalue ); #else const char* _name = cname; const char* _value = cvalue; #endif TiXmlAttribute* node = attributeSet.Find( _name ); if ( node ) { node->SetValue( _value ); return; } TiXmlAttribute* attrib = new TiXmlAttribute( cname, cvalue ); if ( attrib ) { attributeSet.Add( attrib ); } else { TiXmlDocument* document = GetDocument(); if ( document ) document->SetError( TIXML_ERROR_OUT_OF_MEMORY, 0, 0, TIXML_ENCODING_UNKNOWN ); } } #ifdef TIXML_USE_STL void TiXmlElement::SetAttribute( const std::string& name, const std::string& _value ) { TiXmlAttribute* node = attributeSet.Find( name ); if ( node ) { node->SetValue( _value ); return; } TiXmlAttribute* attrib = new TiXmlAttribute( name, _value ); if ( attrib ) { attributeSet.Add( attrib ); } else { TiXmlDocument* document = GetDocument(); if ( document ) document->SetError( TIXML_ERROR_OUT_OF_MEMORY, 0, 0, TIXML_ENCODING_UNKNOWN ); } } #endif void TiXmlElement::Print( FILE* cfile, int depth ) const { int i; assert( cfile ); for ( i=0; iNext() ) { fprintf( cfile, " " ); attrib->Print( cfile, depth ); } // There are 3 different formatting approaches: // 1) An element without children is printed as a node // 2) An element with only a text child is printed as text // 3) An element with children is printed on multiple lines. TiXmlNode* node; if ( !firstChild ) { fprintf( cfile, " />" ); } else if ( firstChild == lastChild && firstChild->ToText() ) { fprintf( cfile, ">" ); firstChild->Print( cfile, depth + 1 ); fprintf( cfile, "", value.c_str() ); } else { fprintf( cfile, ">" ); for ( node = firstChild; node; node=node->NextSibling() ) { if ( !node->ToText() ) { fprintf( cfile, "\n" ); } node->Print( cfile, depth+1 ); } fprintf( cfile, "\n" ); for( i=0; i", value.c_str() ); } } void TiXmlElement::CopyTo( TiXmlElement* target ) const { // superclass: TiXmlNode::CopyTo( target ); // Element class: // Clone the attributes, then clone the children. const TiXmlAttribute* attribute = 0; for( attribute = attributeSet.First(); attribute; attribute = attribute->Next() ) { target->SetAttribute( attribute->Name(), attribute->Value() ); } TiXmlNode* node = 0; for ( node = firstChild; node; node = node->NextSibling() ) { target->LinkEndChild( node->Clone() ); } } bool TiXmlElement::Accept( TiXmlVisitor* visitor ) const { if ( visitor->VisitEnter( *this, attributeSet.First() ) ) { for ( const TiXmlNode* node=FirstChild(); node; node=node->NextSibling() ) { if ( !node->Accept( visitor ) ) break; } } return visitor->VisitExit( *this ); } TiXmlNode* TiXmlElement::Clone() const { TiXmlElement* clone = new TiXmlElement( Value() ); if ( !clone ) return 0; CopyTo( clone ); return clone; } const char* TiXmlElement::GetText() const { const TiXmlNode* child = this->FirstChild(); if ( child ) { const TiXmlText* childText = child->ToText(); if ( childText ) { return childText->Value(); } } return 0; } TiXmlDocument::TiXmlDocument() : TiXmlNode( TiXmlNode::DOCUMENT ) { tabsize = 4; useMicrosoftBOM = false; ClearError(); } TiXmlDocument::TiXmlDocument( const char * documentName ) : TiXmlNode( TiXmlNode::DOCUMENT ) { tabsize = 4; useMicrosoftBOM = false; value = documentName; ClearError(); } #ifdef TIXML_USE_STL TiXmlDocument::TiXmlDocument( const std::string& documentName ) : TiXmlNode( TiXmlNode::DOCUMENT ) { tabsize = 4; useMicrosoftBOM = false; value = documentName; ClearError(); } #endif TiXmlDocument::TiXmlDocument( const TiXmlDocument& copy ) : TiXmlNode( TiXmlNode::DOCUMENT ) { copy.CopyTo( this ); } void TiXmlDocument::operator=( const TiXmlDocument& copy ) { Clear(); copy.CopyTo( this ); } bool TiXmlDocument::LoadFile( TiXmlEncoding encoding ) { // See STL_STRING_BUG below. //StringToBuffer buf( value ); return LoadFile( Value(), encoding ); } bool TiXmlDocument::SaveFile() const { // See STL_STRING_BUG below. // StringToBuffer buf( value ); // // if ( buf.buffer && SaveFile( buf.buffer ) ) // return true; // // return false; return SaveFile( Value() ); } bool TiXmlDocument::LoadFile( const char* _filename, TiXmlEncoding encoding ) { // There was a really terrifying little bug here. The code: // value = filename // in the STL case, cause the assignment method of the std::string to // be called. What is strange, is that the std::string had the same // address as it's c_str() method, and so bad things happen. Looks // like a bug in the Microsoft STL implementation. // Add an extra string to avoid the crash. TIXML_STRING filename( _filename ); value = filename; // reading in binary mode so that tinyxml can normalize the EOL FILE* file = TiXmlFOpen( value.c_str (), "rb" ); if ( file ) { bool result = LoadFile( file, encoding ); fclose( file ); return result; } else { SetError( TIXML_ERROR_OPENING_FILE, 0, 0, TIXML_ENCODING_UNKNOWN ); return false; } } bool TiXmlDocument::LoadFile( FILE* file, TiXmlEncoding encoding ) { if ( !file ) { SetError( TIXML_ERROR_OPENING_FILE, 0, 0, TIXML_ENCODING_UNKNOWN ); return false; } // Delete the existing data: Clear(); location.Clear(); // Get the file size, so we can pre-allocate the string. HUGE speed impact. long length = 0; fseek( file, 0, SEEK_END ); length = ftell( file ); fseek( file, 0, SEEK_SET ); // Strange case, but good to handle up front. if ( length <= 0 ) { SetError( TIXML_ERROR_DOCUMENT_EMPTY, 0, 0, TIXML_ENCODING_UNKNOWN ); return false; } // If we have a file, assume it is all one big XML file, and read it in. // The document parser may decide the document ends sooner than the entire file, however. TIXML_STRING data; data.reserve( length ); // Subtle bug here. TinyXml did use fgets. But from the XML spec: // 2.11 End-of-Line Handling // // // ...the XML processor MUST behave as if it normalized all line breaks in external // parsed entities (including the document entity) on input, before parsing, by translating // both the two-character sequence #xD #xA and any #xD that is not followed by #xA to // a single #xA character. // // // It is not clear fgets does that, and certainly isn't clear it works cross platform. // Generally, you expect fgets to translate from the convention of the OS to the c/unix // convention, and not work generally. /* while( fgets( buf, sizeof(buf), file ) ) { data += buf; } */ char* buf = new char[ length+1 ]; buf[0] = 0; if ( fread( buf, length, 1, file ) != 1 ) { delete [] buf; SetError( TIXML_ERROR_OPENING_FILE, 0, 0, TIXML_ENCODING_UNKNOWN ); return false; } const char* lastPos = buf; const char* p = buf; buf[length] = 0; while( *p ) { assert( p < (buf+length) ); if ( *p == 0xa ) { // Newline character. No special rules for this. Append all the characters // since the last string, and include the newline. data.append( lastPos, (p-lastPos+1) ); // append, include the newline ++p; // move past the newline lastPos = p; // and point to the new buffer (may be 0) assert( p <= (buf+length) ); } else if ( *p == 0xd ) { // Carriage return. Append what we have so far, then // handle moving forward in the buffer. if ( (p-lastPos) > 0 ) { data.append( lastPos, p-lastPos ); // do not add the CR } data += (char)0xa; // a proper newline if ( *(p+1) == 0xa ) { // Carriage return - new line sequence p += 2; lastPos = p; assert( p <= (buf+length) ); } else { // it was followed by something else...that is presumably characters again. ++p; lastPos = p; assert( p <= (buf+length) ); } } else { ++p; } } // Handle any left over characters. if ( p-lastPos ) { data.append( lastPos, p-lastPos ); } delete [] buf; buf = 0; Parse( data.c_str(), 0, encoding ); if ( Error() ) return false; else return true; } bool TiXmlDocument::SaveFile( const char * filename ) const { // The old c stuff lives on... FILE* fp = TiXmlFOpen( filename, "w" ); if ( fp ) { bool result = SaveFile( fp ); fclose( fp ); return result; } return false; } bool TiXmlDocument::SaveFile( FILE* fp ) const { if ( useMicrosoftBOM ) { const unsigned char TIXML_UTF_LEAD_0 = 0xefU; const unsigned char TIXML_UTF_LEAD_1 = 0xbbU; const unsigned char TIXML_UTF_LEAD_2 = 0xbfU; fputc( TIXML_UTF_LEAD_0, fp ); fputc( TIXML_UTF_LEAD_1, fp ); fputc( TIXML_UTF_LEAD_2, fp ); } Print( fp, 0 ); return (ferror(fp) == 0); } void TiXmlDocument::CopyTo( TiXmlDocument* target ) const { TiXmlNode::CopyTo( target ); target->error = error; target->errorId = errorId; target->errorDesc = errorDesc; target->tabsize = tabsize; target->errorLocation = errorLocation; target->useMicrosoftBOM = useMicrosoftBOM; TiXmlNode* node = 0; for ( node = firstChild; node; node = node->NextSibling() ) { target->LinkEndChild( node->Clone() ); } } TiXmlNode* TiXmlDocument::Clone() const { TiXmlDocument* clone = new TiXmlDocument(); if ( !clone ) return 0; CopyTo( clone ); return clone; } void TiXmlDocument::Print( FILE* cfile, int depth ) const { assert( cfile ); for ( const TiXmlNode* node=FirstChild(); node; node=node->NextSibling() ) { node->Print( cfile, depth ); fprintf( cfile, "\n" ); } } bool TiXmlDocument::Accept( TiXmlVisitor* visitor ) const { if ( visitor->VisitEnter( *this ) ) { for ( const TiXmlNode* node=FirstChild(); node; node=node->NextSibling() ) { if ( !node->Accept( visitor ) ) break; } } return visitor->VisitExit( *this ); } const TiXmlAttribute* TiXmlAttribute::Next() const { // We are using knowledge of the sentinel. The sentinel // have a value or name. if ( next->value.empty() && next->name.empty() ) return 0; return next; } /* TiXmlAttribute* TiXmlAttribute::Next() { // We are using knowledge of the sentinel. The sentinel // have a value or name. if ( next->value.empty() && next->name.empty() ) return 0; return next; } */ const TiXmlAttribute* TiXmlAttribute::Previous() const { // We are using knowledge of the sentinel. The sentinel // have a value or name. if ( prev->value.empty() && prev->name.empty() ) return 0; return prev; } /* TiXmlAttribute* TiXmlAttribute::Previous() { // We are using knowledge of the sentinel. The sentinel // have a value or name. if ( prev->value.empty() && prev->name.empty() ) return 0; return prev; } */ void TiXmlAttribute::Print( FILE* cfile, int /*depth*/, TIXML_STRING* str ) const { TIXML_STRING n, v; EncodeString( name, &n ); EncodeString( value, &v ); if (value.find ('\"') == TIXML_STRING::npos) { if ( cfile ) { fprintf (cfile, "%s=\"%s\"", n.c_str(), v.c_str() ); } if ( str ) { (*str) += n; (*str) += "=\""; (*str) += v; (*str) += "\""; } } else { if ( cfile ) { fprintf (cfile, "%s='%s'", n.c_str(), v.c_str() ); } if ( str ) { (*str) += n; (*str) += "='"; (*str) += v; (*str) += "'"; } } } int TiXmlAttribute::QueryIntValue( int* ival ) const { if ( TIXML_SSCANF( value.c_str(), "%d", ival ) == 1 ) return TIXML_SUCCESS; return TIXML_WRONG_TYPE; } int TiXmlAttribute::QueryDoubleValue( double* dval ) const { if ( TIXML_SSCANF( value.c_str(), "%lf", dval ) == 1 ) return TIXML_SUCCESS; return TIXML_WRONG_TYPE; } void TiXmlAttribute::SetIntValue( int _value ) { char buf [64]; #if defined(TIXML_SNPRINTF) TIXML_SNPRINTF(buf, sizeof(buf), "%d", _value); #else sprintf (buf, "%d", _value); #endif SetValue (buf); } void TiXmlAttribute::SetDoubleValue( double _value ) { char buf [256]; #if defined(TIXML_SNPRINTF) TIXML_SNPRINTF( buf, sizeof(buf), "%lf", _value); #else sprintf (buf, "%lf", _value); #endif SetValue (buf); } int TiXmlAttribute::IntValue() const { return atoi (value.c_str ()); } double TiXmlAttribute::DoubleValue() const { return atof (value.c_str ()); } TiXmlComment::TiXmlComment( const TiXmlComment& copy ) : TiXmlNode( TiXmlNode::COMMENT ) { copy.CopyTo( this ); } void TiXmlComment::operator=( const TiXmlComment& base ) { Clear(); base.CopyTo( this ); } void TiXmlComment::Print( FILE* cfile, int depth ) const { assert( cfile ); for ( int i=0; i", value.c_str() ); } void TiXmlComment::CopyTo( TiXmlComment* target ) const { TiXmlNode::CopyTo( target ); } bool TiXmlComment::Accept( TiXmlVisitor* visitor ) const { return visitor->Visit( *this ); } TiXmlNode* TiXmlComment::Clone() const { TiXmlComment* clone = new TiXmlComment(); if ( !clone ) return 0; CopyTo( clone ); return clone; } void TiXmlText::Print( FILE* cfile, int depth ) const { assert( cfile ); if ( cdata ) { int i; fprintf( cfile, "\n" ); for ( i=0; i\n", value.c_str() ); // unformatted output } else { TIXML_STRING buffer; EncodeString( value, &buffer ); fprintf( cfile, "%s", buffer.c_str() ); } } void TiXmlText::CopyTo( TiXmlText* target ) const { TiXmlNode::CopyTo( target ); target->cdata = cdata; } bool TiXmlText::Accept( TiXmlVisitor* visitor ) const { return visitor->Visit( *this ); } TiXmlNode* TiXmlText::Clone() const { TiXmlText* clone = 0; clone = new TiXmlText( "" ); if ( !clone ) return 0; CopyTo( clone ); return clone; } TiXmlDeclaration::TiXmlDeclaration( const char * _version, const char * _encoding, const char * _standalone ) : TiXmlNode( TiXmlNode::DECLARATION ) { version = _version; encoding = _encoding; standalone = _standalone; } #ifdef TIXML_USE_STL TiXmlDeclaration::TiXmlDeclaration( const std::string& _version, const std::string& _encoding, const std::string& _standalone ) : TiXmlNode( TiXmlNode::DECLARATION ) { version = _version; encoding = _encoding; standalone = _standalone; } #endif TiXmlDeclaration::TiXmlDeclaration( const TiXmlDeclaration& copy ) : TiXmlNode( TiXmlNode::DECLARATION ) { copy.CopyTo( this ); } void TiXmlDeclaration::operator=( const TiXmlDeclaration& copy ) { Clear(); copy.CopyTo( this ); } void TiXmlDeclaration::Print( FILE* cfile, int /*depth*/, TIXML_STRING* str ) const { if ( cfile ) fprintf( cfile, "" ); if ( str ) (*str) += "?>"; } void TiXmlDeclaration::CopyTo( TiXmlDeclaration* target ) const { TiXmlNode::CopyTo( target ); target->version = version; target->encoding = encoding; target->standalone = standalone; } bool TiXmlDeclaration::Accept( TiXmlVisitor* visitor ) const { return visitor->Visit( *this ); } TiXmlNode* TiXmlDeclaration::Clone() const { TiXmlDeclaration* clone = new TiXmlDeclaration(); if ( !clone ) return 0; CopyTo( clone ); return clone; } TiXmlStylesheetReference::TiXmlStylesheetReference( const char * _type, const char * _href ) : TiXmlNode( TiXmlNode::STYLESHEETREFERENCE ) { type = _type; href = _href; } #ifdef TIXML_USE_STL TiXmlStylesheetReference::TiXmlStylesheetReference( const std::string& _type, const std::string& _href ) : TiXmlNode( TiXmlNode::STYLESHEETREFERENCE ) { type = _type; href = _href; } #endif TiXmlStylesheetReference::TiXmlStylesheetReference( const TiXmlStylesheetReference& copy ) : TiXmlNode( TiXmlNode::STYLESHEETREFERENCE ) { copy.CopyTo( this ); } void TiXmlStylesheetReference::operator=( const TiXmlStylesheetReference& copy ) { Clear(); copy.CopyTo( this ); } void TiXmlStylesheetReference::Print( FILE* cfile, int /*depth*/, TIXML_STRING* str ) const { if ( cfile ) fprintf( cfile, ""); if ( str ) (*str) += "?>"; } void TiXmlStylesheetReference::CopyTo( TiXmlStylesheetReference* target ) const { TiXmlNode::CopyTo( target ); target->type = type; target->href = href; } bool TiXmlStylesheetReference::Accept( TiXmlVisitor* visitor ) const { return visitor->Visit( *this ); } TiXmlNode* TiXmlStylesheetReference::Clone() const { TiXmlStylesheetReference* clone = new TiXmlStylesheetReference(); if ( !clone ) return 0; CopyTo( clone ); return clone; } void TiXmlUnknown::Print( FILE* cfile, int depth ) const { for ( int i=0; i", value.c_str() ); } void TiXmlUnknown::CopyTo( TiXmlUnknown* target ) const { TiXmlNode::CopyTo( target ); } bool TiXmlUnknown::Accept( TiXmlVisitor* visitor ) const { return visitor->Visit( *this ); } TiXmlNode* TiXmlUnknown::Clone() const { TiXmlUnknown* clone = new TiXmlUnknown(); if ( !clone ) return 0; CopyTo( clone ); return clone; } TiXmlAttributeSet::TiXmlAttributeSet() { sentinel.next = &sentinel; sentinel.prev = &sentinel; } TiXmlAttributeSet::~TiXmlAttributeSet() { assert( sentinel.next == &sentinel ); assert( sentinel.prev == &sentinel ); } void TiXmlAttributeSet::Add( TiXmlAttribute* addMe ) { #ifdef TIXML_USE_STL assert( !Find( TIXML_STRING( addMe->Name() ) ) ); // Shouldn't be multiply adding to the set. #else assert( !Find( addMe->Name() ) ); // Shouldn't be multiply adding to the set. #endif addMe->next = &sentinel; addMe->prev = sentinel.prev; sentinel.prev->next = addMe; sentinel.prev = addMe; } void TiXmlAttributeSet::Remove( TiXmlAttribute* removeMe ) { TiXmlAttribute* node; for( node = sentinel.next; node != &sentinel; node = node->next ) { if ( node == removeMe ) { node->prev->next = node->next; node->next->prev = node->prev; node->next = 0; node->prev = 0; return; } } assert( 0 ); // we tried to remove a non-linked attribute. } #ifdef TIXML_USE_STL const TiXmlAttribute* TiXmlAttributeSet::Find( const std::string& name ) const { for( const TiXmlAttribute* node = sentinel.next; node != &sentinel; node = node->next ) { if ( node->name == name ) return node; } return 0; } /* TiXmlAttribute* TiXmlAttributeSet::Find( const std::string& name ) { for( TiXmlAttribute* node = sentinel.next; node != &sentinel; node = node->next ) { if ( node->name == name ) return node; } return 0; } */ #endif const TiXmlAttribute* TiXmlAttributeSet::Find( const char* name ) const { for( const TiXmlAttribute* node = sentinel.next; node != &sentinel; node = node->next ) { if ( strcmp( node->name.c_str(), name ) == 0 ) return node; } return 0; } /* TiXmlAttribute* TiXmlAttributeSet::Find( const char* name ) { for( TiXmlAttribute* node = sentinel.next; node != &sentinel; node = node->next ) { if ( strcmp( node->name.c_str(), name ) == 0 ) return node; } return 0; } */ #ifdef TIXML_USE_STL std::istream& operator>> (std::istream & in, TiXmlNode & base) { TIXML_STRING tag; tag.reserve( 8 * 1000 ); base.StreamIn( &in, &tag ); base.Parse( tag.c_str(), 0, TIXML_DEFAULT_ENCODING ); return in; } #endif #ifdef TIXML_USE_STL std::ostream& operator<< (std::ostream & out, const TiXmlNode & base) { TiXmlPrinter printer; printer.SetStreamPrinting(); base.Accept( &printer ); out << printer.Str(); return out; } std::string& operator<< (std::string& out, const TiXmlNode& base ) { TiXmlPrinter printer; printer.SetStreamPrinting(); base.Accept( &printer ); out.append( printer.Str() ); return out; } #endif TiXmlHandle TiXmlHandle::FirstChild() const { if ( node ) { TiXmlNode* child = node->FirstChild(); if ( child ) return TiXmlHandle( child ); } return TiXmlHandle( 0 ); } TiXmlHandle TiXmlHandle::FirstChild( const char * value ) const { if ( node ) { TiXmlNode* child = node->FirstChild( value ); if ( child ) return TiXmlHandle( child ); } return TiXmlHandle( 0 ); } TiXmlHandle TiXmlHandle::FirstChildElement() const { if ( node ) { TiXmlElement* child = node->FirstChildElement(); if ( child ) return TiXmlHandle( child ); } return TiXmlHandle( 0 ); } TiXmlHandle TiXmlHandle::FirstChildElement( const char * value ) const { if ( node ) { TiXmlElement* child = node->FirstChildElement( value ); if ( child ) return TiXmlHandle( child ); } return TiXmlHandle( 0 ); } TiXmlHandle TiXmlHandle::Child( int count ) const { if ( node ) { int i; TiXmlNode* child = node->FirstChild(); for ( i=0; child && iNextSibling(), ++i ) { // nothing } if ( child ) return TiXmlHandle( child ); } return TiXmlHandle( 0 ); } TiXmlHandle TiXmlHandle::Child( const char* value, int count ) const { if ( node ) { int i; TiXmlNode* child = node->FirstChild( value ); for ( i=0; child && iNextSibling( value ), ++i ) { // nothing } if ( child ) return TiXmlHandle( child ); } return TiXmlHandle( 0 ); } TiXmlHandle TiXmlHandle::ChildElement( int count ) const { if ( node ) { int i; TiXmlElement* child = node->FirstChildElement(); for ( i=0; child && iNextSiblingElement(), ++i ) { // nothing } if ( child ) return TiXmlHandle( child ); } return TiXmlHandle( 0 ); } TiXmlHandle TiXmlHandle::ChildElement( const char* value, int count ) const { if ( node ) { int i; TiXmlElement* child = node->FirstChildElement( value ); for ( i=0; child && iNextSiblingElement( value ), ++i ) { // nothing } if ( child ) return TiXmlHandle( child ); } return TiXmlHandle( 0 ); } bool TiXmlPrinter::VisitEnter( const TiXmlDocument& ) { return true; } bool TiXmlPrinter::VisitExit( const TiXmlDocument& ) { return true; } bool TiXmlPrinter::VisitEnter( const TiXmlElement& element, const TiXmlAttribute* firstAttribute ) { DoIndent(); buffer += "<"; buffer += element.Value(); for( const TiXmlAttribute* attrib = firstAttribute; attrib; attrib = attrib->Next() ) { buffer += " "; attrib->Print( 0, 0, &buffer ); } if ( !element.FirstChild() ) { buffer += " />"; DoLineBreak(); } else { buffer += ">"; if ( element.FirstChild()->ToText() && element.LastChild() == element.FirstChild() && element.FirstChild()->ToText()->CDATA() == false ) { simpleTextPrint = true; // no DoLineBreak()! } else { DoLineBreak(); } } ++depth; return true; } bool TiXmlPrinter::VisitExit( const TiXmlElement& element ) { --depth; if ( !element.FirstChild() ) { // nothing. } else { if ( simpleTextPrint ) { simpleTextPrint = false; } else { DoIndent(); } buffer += ""; DoLineBreak(); } return true; } bool TiXmlPrinter::Visit( const TiXmlText& text ) { if ( text.CDATA() ) { DoIndent(); buffer += ""; DoLineBreak(); } else if ( simpleTextPrint ) { TIXML_STRING str; TiXmlBase::EncodeString( text.ValueTStr(), &str ); buffer += str; } else { DoIndent(); TIXML_STRING str; TiXmlBase::EncodeString( text.ValueTStr(), &str ); buffer += str; DoLineBreak(); } return true; } bool TiXmlPrinter::Visit( const TiXmlDeclaration& declaration ) { DoIndent(); declaration.Print( 0, 0, &buffer ); DoLineBreak(); return true; } bool TiXmlPrinter::Visit( const TiXmlComment& comment ) { DoIndent(); buffer += ""; DoLineBreak(); return true; } bool TiXmlPrinter::Visit( const TiXmlUnknown& unknown ) { DoIndent(); buffer += "<"; buffer += unknown.Value(); buffer += ">"; DoLineBreak(); return true; } wxformbuilder-3.1.59/sdk/tinyxml/premake4.lua0000644000175000017500000000343711143440026021456 0ustar rrmulderrrmulder--***************************************************************************** --* Author: RJP Computing --* Copyright (C) 2009 RJP Computing --* --* Permission is hereby granted, free of charge, to any person obtaining a copy of --* this software and associated documentation files (the "Software"), to deal in --* the Software without restriction, including without limitation the rights to --* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of --* the Software, and to permit persons to whom the Software is furnished to do so, --* subject to the following conditions: --* --* The above copyright notice and this permission notice shall be included in all --* copies or substantial portions of the Software. --* --* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR --* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS --* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR --* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER --* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN --* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --* --* NOTES: --* - use the '/' slash for all paths. --***************************************************************************** solution "TinyXML++" targetdir "lib" implibdir "lib" configurations { "Debug", "Release" } -- This is for including other Premake scripts. dofile( "ticpp4.lua" ) -- Add options here. newoption { trigger = "dynamic-runtime", description = "Use the dynamicly loadable version of the runtime." } newoption { trigger = "unicode", description = "Use the Unicode character set" } wxformbuilder-3.1.59/sdk/tinyxml/readme.txt0000644000175000017500000004663511143440026021250 0ustar rrmulderrrmulder/** @mainpage

TinyXML

TinyXML is a simple, small, C++ XML parser that can be easily integrated into other programs.

What it does.

In brief, TinyXML parses an XML document, and builds from that a Document Object Model (DOM) that can be read, modified, and saved. XML stands for "eXtensible Markup Language." It allows you to create your own document markups. Where HTML does a very good job of marking documents for browsers, XML allows you to define any kind of document markup, for example a document that describes a "to do" list for an organizer application. XML is a very structured and convenient format. All those random file formats created to store application data can all be replaced with XML. One parser for everything. The best place for the complete, correct, and quite frankly hard to read spec is at http://www.w3.org/TR/2004/REC-xml-20040204/. An intro to XML (that I really like) can be found at http://skew.org/xml/tutorial. There are different ways to access and interact with XML data. TinyXML uses a Document Object Model (DOM), meaning the XML data is parsed into a C++ objects that can be browsed and manipulated, and then written to disk or another output stream. You can also construct an XML document from scratch with C++ objects and write this to disk or another output stream. TinyXML is designed to be easy and fast to learn. It is two headers and four cpp files. Simply add these to your project and off you go. There is an example file - xmltest.cpp - to get you started. TinyXML is released under the ZLib license, so you can use it in open source or commercial code. The details of the license are at the top of every source file. TinyXML attempts to be a flexible parser, but with truly correct and compliant XML output. TinyXML should compile on any reasonably C++ compliant system. It does not rely on exceptions or RTTI. It can be compiled with or without STL support. TinyXML fully supports the UTF-8 encoding, and the first 64k character entities.

What it doesn't do.

TinyXML doesn't parse or use DTDs (Document Type Definitions) or XSLs (eXtensible Stylesheet Language.) There are other parsers out there (check out www.sourceforge.org, search for XML) that are much more fully featured. But they are also much bigger, take longer to set up in your project, have a higher learning curve, and often have a more restrictive license. If you are working with browsers or have more complete XML needs, TinyXML is not the parser for you. The following DTD syntax will not parse at this time in TinyXML: @verbatim ]> @endverbatim because TinyXML sees this as a !DOCTYPE node with an illegally embedded !ELEMENT node. This may be addressed in the future.

Tutorials.

For the impatient, here are some tutorials to get you going. A great way to get started, but it is worth your time to read this (very short) manual completely. - @subpage ticppTutorial - @subpage tutorial0

Code Status.

TinyXML is mature, tested code. It is very stable. If you find bugs, please file a bug report on the sourceforge web site (www.sourceforge.net/projects/tinyxml). We'll get them straightened out as soon as possible. There are some areas of improvement; please check sourceforge if you are interested in working on TinyXML.

Related Projects

TinyXML projects you may find useful! (Descriptions provided by the projects.)
  • TinyXPath (http://tinyxpath.sourceforge.net). TinyXPath is a small footprint XPath syntax decoder, written in C++.
  • @subpage ticpp (http://code.google.com/p/ticpp/). TinyXML++ is a completely new interface to TinyXML that uses MANY of the C++ strengths. Templates, exceptions, and much better error handling.

Features

Using STL

TinyXML can be compiled to use or not use STL. When using STL, TinyXML uses the std::string class, and fully supports std::istream, std::ostream, operator<<, and operator>>. Many API methods have both 'const char*' and 'const std::string&' forms. When STL support is compiled out, no STL files are included whatsoever. All the string classes are implemented by TinyXML itself. API methods all use the 'const char*' form for input. Use the compile time #define: TIXML_USE_STL to compile one version or the other. This can be passed by the compiler, or set as the first line of "tinyxml.h". Note: If compiling the test code in Linux, setting the environment variable TINYXML_USE_STL=YES/NO will control STL compilation. In the Windows project file, STL and non STL targets are provided. In your project, It's probably easiest to add the line "#define TIXML_USE_STL" as the first line of tinyxml.h.

UTF-8

TinyXML supports UTF-8 allowing to manipulate XML files in any language. TinyXML also supports "legacy mode" - the encoding used before UTF-8 support and probably best described as "extended ascii". Normally, TinyXML will try to detect the correct encoding and use it. However, by setting the value of TIXML_DEFAULT_ENCODING in the header file, TinyXML can be forced to always use one encoding. TinyXML will assume Legacy Mode until one of the following occurs:
  1. If the non-standard but common "UTF-8 lead bytes" (0xef 0xbb 0xbf) begin the file or data stream, TinyXML will read it as UTF-8.
  2. If the declaration tag is read, and it has an encoding="UTF-8", then TinyXML will read it as UTF-8.
  3. If the declaration tag is read, and it has no encoding specified, then TinyXML will read it as UTF-8.
  4. If the declaration tag is read, and it has an encoding="something else", then TinyXML will read it as Legacy Mode. In legacy mode, TinyXML will work as it did before. It's not clear what that mode does exactly, but old content should keep working.
  5. Until one of the above criteria is met, TinyXML runs in Legacy Mode.
What happens if the encoding is incorrectly set or detected? TinyXML will try to read and pass through text seen as improperly encoded. You may get some strange results or mangled characters. You may want to force TinyXML to the correct mode. You may force TinyXML to Legacy Mode by using LoadFile( TIXML_ENCODING_LEGACY ) or LoadFile( filename, TIXML_ENCODING_LEGACY ). You may force it to use legacy mode all the time by setting TIXML_DEFAULT_ENCODING = TIXML_ENCODING_LEGACY. Likewise, you may force it to TIXML_ENCODING_UTF8 with the same technique. For English users, using English XML, UTF-8 is the same as low-ASCII. You don't need to be aware of UTF-8 or change your code in any way. You can think of UTF-8 as a "superset" of ASCII. UTF-8 is not a double byte format - but it is a standard encoding of Unicode! TinyXML does not use or directly support wchar, TCHAR, or Microsoft's _UNICODE at this time. It is common to see the term "Unicode" improperly refer to UTF-16, a wide byte encoding of unicode. This is a source of confusion. For "high-ascii" languages - everything not English, pretty much - TinyXML can handle all languages, at the same time, as long as the XML is encoded in UTF-8. That can be a little tricky, older programs and operating systems tend to use the "default" or "traditional" code page. Many apps (and almost all modern ones) can output UTF-8, but older or stubborn (or just broken) ones still output text in the default code page. For example, Japanese systems traditionally use SHIFT-JIS encoding. Text encoded as SHIFT-JIS can not be read by TinyXML. A good text editor can import SHIFT-JIS and then save as UTF-8. The Skew.org link does a great job covering the encoding issue. The test file "utf8test.xml" is an XML containing English, Spanish, Russian, and Simplified Chinese. (Hopefully they are translated correctly). The file "utf8test.gif" is a screen capture of the XML file, rendered in IE. Note that if you don't have the correct fonts (Simplified Chinese or Russian) on your system, you won't see output that matches the GIF file even if you can parse it correctly. Also note that (at least on my Windows machine) console output is in a Western code page, so that Print() or printf() cannot correctly display the file. This is not a bug in TinyXML - just an OS issue. No data is lost or destroyed by TinyXML. The console just doesn't render UTF-8.

Entities

TinyXML recognizes the pre-defined "character entities", meaning special characters. Namely: @verbatim & & < < > > " " ' ' @endverbatim These are recognized when the XML document is read, and translated to there UTF-8 equivalents. For instance, text with the XML of: @verbatim Far & Away @endverbatim will have the Value() of "Far & Away" when queried from the TiXmlText object, and will be written back to the XML stream/file as an ampersand. Older versions of TinyXML "preserved" character entities, but the newer versions will translate them into characters. Additionally, any character can be specified by its Unicode code point: The syntax " " or " " are both to the non-breaking space characher.

Printing

TinyXML can print output in several different ways that all have strengths and limitations. - Print( FILE* ). Output to a std-C stream, which includes all C files as well as stdout. - "Pretty prints", but you don't have control over printing options. - The output is streamed directly to the FILE object, so there is no memory overhead in the TinyXML code. - used by Print() and SaveFile() - operator<<. Output to a c++ stream. - Integrates with standart C++ iostreams. - Outputs in "network printing" mode without line breaks. Good for network transmission and moving XML between C++ objects, but hard for a human to read. - TiXmlPrinter. Output to a std::string or memory buffer. - API is less concise - Future printing options will be put here. - Printing may change slightly in future versions as it is refined and expanded.

Streams

With TIXML_USE_STL on TinyXML supports C++ streams (operator <<,>>) streams as well as C (FILE*) streams. There are some differences that you may need to be aware of. C style output: - based on FILE* - the Print() and SaveFile() methods Generates formatted output, with plenty of white space, intended to be as human-readable as possible. They are very fast, and tolerant of ill formed XML documents. For example, an XML document that contains 2 root elements and 2 declarations, will still print. C style input: - based on FILE* - the Parse() and LoadFile() methods A fast, tolerant read. Use whenever you don't need the C++ streams. C++ style output: - based on std::ostream - operator<< Generates condensed output, intended for network transmission rather than readability. Depending on your system's implementation of the ostream class, these may be somewhat slower. (Or may not.) Not tolerant of ill formed XML: a document should contain the correct one root element. Additional root level elements will not be streamed out. C++ style input: - based on std::istream - operator>> Reads XML from a stream, making it useful for network transmission. The tricky part is knowing when the XML document is complete, since there will almost certainly be other data in the stream. TinyXML will assume the XML data is complete after it reads the root element. Put another way, documents that are ill-constructed with more than one root element will not read correctly. Also note that operator>> is somewhat slower than Parse, due to both implementation of the STL and limitations of TinyXML.

White space

The world simply does not agree on whether white space should be kept, or condensed. For example, pretend the '_' is a space, and look at "Hello____world". HTML, and at least some XML parsers, will interpret this as "Hello_world". They condense white space. Some XML parsers do not, and will leave it as "Hello____world". (Remember to keep pretending the _ is a space.) Others suggest that __Hello___world__ should become Hello___world. It's an issue that hasn't been resolved to my satisfaction. TinyXML supports the first 2 approaches. Call TiXmlBase::SetCondenseWhiteSpace( bool ) to set the desired behavior. The default is to condense white space. If you change the default, you should call TiXmlBase::SetCondenseWhiteSpace( bool ) before making any calls to Parse XML data, and I don't recommend changing it after it has been set.

Handles

Where browsing an XML document in a robust way, it is important to check for null returns from method calls. An error safe implementation can generate a lot of code like: @verbatim TiXmlElement* root = document.FirstChildElement( "Document" ); if ( root ) { TiXmlElement* element = root->FirstChildElement( "Element" ); if ( element ) { TiXmlElement* child = element->FirstChildElement( "Child" ); if ( child ) { TiXmlElement* child2 = child->NextSiblingElement( "Child" ); if ( child2 ) { // Finally do something useful. @endverbatim Handles have been introduced to clean this up. Using the TiXmlHandle class, the previous code reduces to: @verbatim TiXmlHandle docHandle( &document ); TiXmlElement* child2 = docHandle.FirstChild( "Document" ).FirstChild( "Element" ).Child( "Child", 1 ).ToElement(); if ( child2 ) { // do something useful @endverbatim Which is much easier to deal with. See TiXmlHandle for more information.

Row and Column tracking

Being able to track nodes and attributes back to their origin location in source files can be very important for some applications. Additionally, knowing where parsing errors occured in the original source can be very time saving. TinyXML can tracks the row and column origin of all nodes and attributes in a text file. The TiXmlBase::Row() and TiXmlBase::Column() methods return the origin of the node in the source text. The correct tabs can be configured in TiXmlDocument::SetTabSize().

Using and Installing

To Compile and Run xmltest: A Linux Makefile and a Windows Visual C++ .dsw file is provided. Simply compile and run. It will write the file demotest.xml to your disk and generate output on the screen. It also tests walking the DOM by printing out the number of nodes found using different techniques. The Linux makefile is very generic and runs on many systems - it is currently tested on mingw and MacOSX. You do not need to run 'make depend'. The dependecies have been hard coded.

Windows project file for VC6

  • tinyxml: tinyxml library, non-STL
  • tinyxmlSTL: tinyxml library, STL
  • tinyXmlTest: test app, non-STL
  • tinyXmlTestSTL: test app, STL

Makefile

At the top of the makefile you can set: PROFILE, DEBUG, and TINYXML_USE_STL. Details (such that they are) are in the makefile. In the tinyxml directory, type "make clean" then "make". The executable file 'xmltest' will be created.

To Use in an Application:

Add tinyxml.cpp, tinyxml.h, tinyxmlerror.cpp, tinyxmlparser.cpp, tinystr.cpp, and tinystr.h to your project or make file. That's it! It should compile on any reasonably compliant C++ system. You do not need to enable exceptions or RTTI for TinyXML.

How TinyXML works.

An example is probably the best way to go. Take: @verbatim Go to the Toy store! Do bills @endverbatim Its not much of a To Do list, but it will do. To read this file (say "demo.xml") you would create a document, and parse it in: @verbatim TiXmlDocument doc( "demo.xml" ); doc.LoadFile(); @endverbatim And its ready to go. Now lets look at some lines and how they relate to the DOM. @verbatim @endverbatim The first line is a declaration, and gets turned into the TiXmlDeclaration class. It will be the first child of the document node. This is the only directive/special tag parsed by by TinyXML. Generally directive tags are stored in TiXmlUnknown so the commands wont be lost when it is saved back to disk. @verbatim @endverbatim A comment. Will become a TiXmlComment object. @verbatim @endverbatim The "ToDo" tag defines a TiXmlElement object. This one does not have any attributes, but does contain 2 other elements. @verbatim @endverbatim Creates another TiXmlElement which is a child of the "ToDo" element. This element has 1 attribute, with the name "priority" and the value "1". @verbatim Go to the @endverbatim A TiXmlText. This is a leaf node and cannot contain other nodes. It is a child of the "Item" TiXmlElement. @verbatim @endverbatim Another TiXmlElement, this one a child of the "Item" element. Etc. Looking at the entire object tree, you end up with: @verbatim TiXmlDocument "demo.xml" TiXmlDeclaration "version='1.0'" "standalone=no" TiXmlComment " Our to do list data" TiXmlElement "ToDo" TiXmlElement "Item" Attribtutes: priority = 1 TiXmlText "Go to the " TiXmlElement "bold" TiXmlText "Toy store!" TiXmlElement "Item" Attributes: priority=2 TiXmlText "Do bills" @endverbatim

Documentation

The documentation is build with Doxygen, using the 'dox' configuration file.

License

TinyXML is released under the zlib license: This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution.

References

The World Wide Web Consortium is the definitive standard body for XML, and there web pages contain huge amounts of information. The definitive spec: http://www.w3.org/TR/2004/REC-xml-20040204/ I also recommend "XML Pocket Reference" by Robert Eckstein and published by OReilly...the book that got the whole thing started.

Contributors, Contacts, and a Brief History

Thanks very much to everyone who sends suggestions, bugs, ideas, and encouragement. It all helps, and makes this project fun. A special thanks to the contributors on the web pages that keep it lively. So many people have sent in bugs and ideas, that rather than list here we try to give credit due in the "changes.txt" file. TinyXML was originally written by Lee Thomason. (Often the "I" still in the documentation.) Lee reviews changes and releases new versions, with the help of Yves Berquin, Andrew Ellerton, and the tinyXml community. We appreciate your suggestions, and would love to know if you use TinyXML. Hopefully you will enjoy it and find it useful. Please post questions, comments, file bugs, or contact us at: www.sourceforge.net/projects/tinyxml Lee Thomason, Yves Berquin, Andrew Ellerton */ wxformbuilder-3.1.59/sdk/tinyxml/premake.lua0000644000175000017500000000325311143440026021366 0ustar rrmulderrrmulder--***************************************************************************** --* Author: RJP Computing --* Copyright (C) 2007 RJP Computing --* --* Permission is hereby granted, free of charge, to any person obtaining a copy of --* this software and associated documentation files (the "Software"), to deal in --* the Software without restriction, including without limitation the rights to --* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of --* the Software, and to permit persons to whom the Software is furnished to do so, --* subject to the following conditions: --* --* The above copyright notice and this permission notice shall be included in all --* copies or substantial portions of the Software. --* --* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR --* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS --* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR --* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER --* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN --* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --* --* NOTES: --* - use the '/' slash for all paths. --***************************************************************************** project.name = "TinyXML++" project.bindir = "lib" project.libdir = "lib" -- This is for including other Premake scripts. dopackage( "ticpp.lua" ) -- Add options here. addoption( "dynamic-runtime", "Use the dynamicly loadable version of the runtime." ) addoption( "unicode", "Use the Unicode character set" ) wxformbuilder-3.1.59/sdk/tinyxml/ticpp.h0000644000175000017500000014124511143440026020533 0ustar rrmulderrrmulder/* http://code.google.com/p/ticpp/ Copyright (c) 2006 Ryan Pusztai, Ryan Mulder Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /** @copydoc ticpp @file @author Ryan Pusztai @author Ryan Mulder @date 04/11/2006 @version 0.04a by edam@waxworlds.org: based Exception based on std::exception; added stream << and >> support; added Document::Parse(); bug fix; improved THROW() macro. @version 0.04 Added NodeImp class. Also made all the classes inherit from NodeImp. @version 0.03 Added Declaration class @version 0.02 Added Element class @version 0.01 Added Exception class, Document class @todo add UNKNOWN support. See ticpp::NodeFactory. @todo add TYPECOUNT support. See ticpp::NodeFactory. @todo Add a quick reference */ #ifdef TIXML_USE_TICPP #ifndef TICPP_INCLUDED #define TICPP_INCLUDED #include "tinyxml.h" #include #include #include #include #include /** @subpage ticpp is a TinyXML wrapper that uses a lot more C++ ideals. It throws exceptions, uses templates, is in its own name space, and requires STL (Standard Template Library). This is done to ease the use of getting values in and out of the xml. If you don't perfer to use some of the concepts just don't use it. It is just a wrapper that extends TinyXML. It doesn't actually change any of TinyXML. */ namespace ticpp { /** This is a ticpp exception class */ class Exception : public std::exception { public: /** Construct an exception with a message */ Exception( const std::string& details ); ~Exception() throw(); /// Override std::exception::what() to return m_details const char* what() const throw(); std::string m_details; /**< Exception Details */ }; /** This allows you to stream your exceptions in. It will take care of the conversion and throwing the exception. */ #define TICPPTHROW( message ) \ { \ std::ostringstream full_message; \ std::string file( __FILE__ ); \ file = file.substr( file.find_last_of( "\\/" ) + 1 ); \ full_message << message << " <" << file << "@" << __LINE__ << ">"; \ full_message << BuildDetailedErrorString(); \ throw Exception( full_message.str() ); \ } // Forward Declarations for Visitor, and others. class Document; class Element; class Declaration; class StylesheetReference; class Text; class Comment; class Attribute; /** Wrapper around TiXmlVisitor */ class Visitor : public TiXmlVisitor { public: // Overload the TiXmlVisitor functions, wrap objects, call ticpp::Visitor functions /// @internal virtual bool VisitEnter( const TiXmlDocument& doc ); /// @internal virtual bool VisitExit( const TiXmlDocument& doc ); /// @internal virtual bool VisitEnter( const TiXmlElement& element, const TiXmlAttribute* firstAttribute ); /// @internal virtual bool VisitExit( const TiXmlElement& element ); /// @internal virtual bool Visit( const TiXmlDeclaration& declaration ); /// @internal virtual bool Visit( const TiXmlStylesheetReference& stylesheet ); /// @internal virtual bool Visit( const TiXmlText& text ); /// @internal virtual bool Visit( const TiXmlComment& comment ); public: /// Visit a document. virtual bool VisitEnter( const Document& /*doc*/ ) { return true; } /// Visit a document. virtual bool VisitExit( const Document& /*doc*/ ) { return true; } /// Visit an element. virtual bool VisitEnter( const Element& /*element*/, const Attribute* /*firstAttribute*/ ) { return true; } /// Visit an element. virtual bool VisitExit( const Element& /*element*/ ) { return true; } /// Visit a declaration virtual bool Visit( const Declaration& /*declaration*/ ) { return true; } /// Visit a stylesheet reference virtual bool Visit( const StylesheetReference& /*stylesheet*/ ) { return true; } /// Visit a text node virtual bool Visit( const Text& /*text*/ ) { return true; } /// Visit a comment node virtual bool Visit( const Comment& /*comment*/ ) { return true; } }; /** Wrapper around TiXmlBase */ class Base { public: /** Converts any class with a proper overload of the << opertor to a std::string @param value The value to be converted @throws Exception When value cannot be converted to a std::string */ template < class T > std::string ToString( const T& value ) const { std::stringstream convert; convert << value; if ( convert.fail() ) { TICPPTHROW( "Could not convert value to text" ); } return convert.str(); } std::string ToString( const std::string& value ) const { return value; } /** Converts a std::string to any class with a proper overload of the >> opertor @param temp The string to be converted @param out [OUT] The container for the returned value @throws Exception When temp cannot be converted to the target type */ template < class T > void FromString( const std::string& temp, T* out ) const { std::istringstream val( temp ); val >> *out; if ( val.fail() ) { TICPPTHROW( "Could not convert \"" << temp << "\" to target type" ); } } /** Specialization for std::string */ void FromString( const std::string& temp, std::string* out ) const { *out = temp; } /** Return the position, in the original source file, of this node or attribute. Wrapper around TiXmlBase::Row() */ int Row() const { return GetBasePointer()->Row(); } /** Return the position, in the original source file, of this node or attribute. Wrapper around TiXmlBase::Row() */ int Column() const { return GetBasePointer()->Column(); } /** Compare internal TiXml pointers to determine is both are wrappers around the same node */ bool operator == ( const Base& rhs ) const { return ( GetBasePointer() == rhs.GetBasePointer() ); } /** Compare internal TiXml pointers to determine is both are wrappers around the same node */ bool operator != ( const Base& rhs ) const { return ( GetBasePointer() != rhs.GetBasePointer() ); } /** Builds detailed error string using TiXmlDocument::Error() and others */ std::string BuildDetailedErrorString() const { std::ostringstream full_message; #ifndef TICPP_NO_RTTI TiXmlNode* node = dynamic_cast< TiXmlNode* >( GetBasePointer() ); if ( node != 0 ) { TiXmlDocument* doc = node->GetDocument(); if ( doc != 0 ) { if ( doc->Error() ) { full_message << "\nDescription: " << doc->ErrorDesc() << "\nFile: " << (strlen( doc->Value() ) > 0 ? doc->Value() : "") << "\nLine: " << doc->ErrorRow() << "\nColumn: " << doc->ErrorCol(); } } } #endif return full_message.str(); } /** Destructor */ virtual ~Base() { } protected: mutable TiCppRCImp* m_impRC; /**< Holds status of internal TiXmlPointer - use this to determine if object has been deleted already */ /** @internal Updates the pointer to the reference counter to point at the counter in the new node. @param node TiXmlBase containing the new reference counter */ void SetImpRC( TiXmlBase* node ) { m_impRC = node->m_tiRC; } void ValidatePointer() const { if ( m_impRC->IsNull() ) { TICPPTHROW( "Internal TiXml Pointer is NULL" ); } } /** @internal Get internal TiXmlBase* */ virtual TiXmlBase* GetBasePointer() const = 0; }; /** Wrapper around TiXmlAttribute */ class Attribute : public Base { private: TiXmlAttribute* m_tiXmlPointer; TiXmlBase* GetBasePointer() const { ValidatePointer(); return m_tiXmlPointer; } public: /** Construct an empty attribute. */ Attribute(); /** Construct an attribute with @a name and @a value @param name The name of the attribute @param value The value of the attribute */ Attribute( const std::string& name, const std::string& value ); /** @internal Construct an attribute with the internal pointer @param attribute The internal pointer */ Attribute( TiXmlAttribute* attribute ); /** Get the value of this attribute Uses Base::FromString to convert TiXmlAttribute::ValueStr from a std::string, and puts it in the passed pointer. @param value [OUT] A pointer to fill with the value */ template < class T > void GetValue( T* value ) const { ValidatePointer(); FromString( m_tiXmlPointer->ValueStr(), value ); } /** Get the value of this attribute. Simple wrapper for TiXmlAttribute::ValueStr. @see GetValue */ std::string Value() const; /** Set the value of this node. Uses Base::ToString to convert value to a std::string, then calls TiXmlAttribute::SetValue. @param value The value to set */ template < class T > void SetValue( const T& value ) { ValidatePointer(); m_tiXmlPointer->SetValue( ToString( value ) ); } /** Get the value of this attribute Uses Base::FromString to convert TiXmlAttribute::Name from a std::string, and puts it in the passed pointer. @param name [OUT] A pointer to fill with the name */ template < class T > void GetName( T* name ) const { ValidatePointer(); FromString( m_tiXmlPointer->Name(), name ); } /** Get the value of this attribute. Simple wrapper for TiXmlAttribute::Name. @see GetName */ std::string Name() const; /** Set the value of this attribute. Uses Base::ToString to convert @a name to a std::string, then calls TiXmlAttribute::SetName. @param name The name to set */ template < class T > void SetName( const T& name ) { ValidatePointer(); m_tiXmlPointer->SetName( ToString( name ) ); } /** @internal Updates the reference count for the old and new pointers. */ void operator=( const Attribute& copy ); /** @internal Updates the reference count for the old and new pointers. */ Attribute( const Attribute& copy ); /* Decrements reference count. */ ~Attribute(); /** Get the next sibling attribute in the DOM. */ Attribute* Next( bool throwIfNoAttribute = true ) const; /** Get the previous sibling attribute in the DOM. */ Attribute* Previous( bool throwIfNoAttribute = true ) const; /** @internal Just for Iterator<> @param next [OUT] The pointer to the next valid attribute @return true if there is a next attribute, false if not */ void IterateNext( const std::string&, Attribute** next ) const; /** @internal Just for Iterator<> @param previous [OUT] The pointer to the previous valid attribute @return true if there is a previous attribute, false if not */ void IteratePrevious( const std::string&, Attribute** previous ) const; /** All TinyXml classes can print themselves to a filestream. */ virtual void Print( FILE* file, int depth ) const; private: /** @internal Sets the internal pointer. Saves a copy of the pointer to the RC object. @param newPointer TiXmlAttribute* to set. */ void SetTiXmlPointer( TiXmlAttribute* newPointer ); }; /** Wrapper around TiXmlNode */ class Node : public Base { public: /** Get the value of this node Uses Base::FromString to convert TiXmlNode::ValueStr from a std::string, and puts it in the passed pointer. @param value [OUT] A pointer to fill with the value */ template < class T > void GetValue( T* value) const { FromString( GetTiXmlPointer()->ValueStr(), value ); } /** Get the value of this node. Simple wrapper for TiXmlNode::ValueStr. @see GetValue */ std::string Value() const; /** Set the value of this node. Uses Base::ToString to convert value to a std::string, then calls TiXmlNode::SetValue. @param value The value to set */ template < class T > void SetValue( const T& value ) { GetTiXmlPointer()->SetValue( ToString( value ) ); } /** Clear all Nodes below this. Simple wrapper for TiXmlNode::Clear. */ void Clear(); /** The Parent of this Node. Simple wrapper for TiXmlNode::Parent. @param throwIfNoParent [DEF] If true, throws when Parent = NULL. @return The parent of this node, NULL if there is no Parent. @throws Exception When throwIfNoParent is true, and TiXmlNode::Parent returns Null. */ Node* Parent( bool throwIfNoParent = true ) const; /** The first child of this node. @param throwIfNoChildren [DEF] If true, will throw an exception if there are no children. @return Pointer to child, Null if no children and 'throwIfNoChildren' is false. @throws Exception When throwIfNoChildren is true, and TiXmlNode::FirstChild returns Null. @see TiXmlNode::FirstChild */ Node* FirstChild( bool throwIfNoChildren = true ) const; /** @internal The first child of this node with the matching @a value. @overload @param value Value to match. @param throwIfNoChildren [DEF] If true, will throw an exception if there are no children. @see FirstChild( bool throwIfNoChildren = true ) */ Node* FirstChild( const char* value, bool throwIfNoChildren = true ) const; /** The first child of this node with the matching @a value. @overload @param value Value to match. @param throwIfNoChildren [DEF] If true, will throw an exception if there are no children. @see FirstChild( const char* value, bool throwIfNoChildren = true ) */ Node* FirstChild( const std::string& value, bool throwIfNoChildren = true ) const; /** The last child of this node. @param throwIfNoChildren [DEF] If true, will throw an exception if there are no children. @return Pointer to child, Null if no children and 'throwIfNoChildren' is false. @throws Exception When throwIfNoChildren is true, and TiXmlNode::LastChild returns Null. @see TiXmlNode::LastChild */ Node* LastChild( bool throwIfNoChildren = true ) const; /** @internal The last child of this node with the matching @a value. @overload @param value Value to match. @param throwIfNoChildren [DEF] If true, will throw an exception if there are no children. @see LastChild( bool throwIfNoChildren = true ) */ Node* LastChild( const char* value, bool throwIfNoChildren = true ) const; /** The last child of this node with the matching @a value. @overload @param value Value to match. @param throwIfNoChildren [DEF] If true, will throw an exception if there are no children. @see LastChild( const char* value, bool throwIfNoChildren = true ) */ Node* LastChild( const std::string& value, bool throwIfNoChildren = true ) const; /** An alternate way to walk the children of a node. Simple wrapper for TiXmlNode::IterateChildren. @param previous The previous Node* that was returned from IterateChildren. @return NULL When there are no more children. */ Node* IterateChildren( Node* previous ) const; /** This flavor of IterateChildren searches for children with a particular @a value. Simple wrapper for TiXmlNode::IterateChildren. @param value The value you want to search for. @param previous The previous Node* that was returned from IterateChildren. @return NULL When there are no more children. */ Node* IterateChildren( const std::string& value, Node* previous ) const; /** Adds a child past the LastChild. Throws if you try to insert a document. @note This takes a copy of @a addThis so it is not as efficiant as LinkEndChild. @param addThis Node to insert. @throws Exception When TiXmlNode::InsertEndChild returns Null @see LinkEndChild @see TiXmlNode::InsertEndChild */ Node* InsertEndChild( Node& addThis ); /** Adds a child past the LastChild. Throws if you try to link a document. @param childNode Node to link. @throws Exception When TiXmlNode::LinkEndChild returns Null. @see InsertEndChild @see TiXmlNode::LinkEndChild */ Node* LinkEndChild( Node* childNode ); /** Adds a child before the specified child. Throws if you try to insert a document. @param beforeThis Node that will have @a addThis linked before. @param addThis Node to insert before. @throws Exception When TiXmlNode::InsertBeforeChild returns Null. @see InsertAfterChild @see TiXmlNode::InsertBeforeChild */ Node* InsertBeforeChild( Node* beforeThis, Node& addThis ); /** Adds a child after the specified child. Throws if you try to insert a document. @param afterThis Node that will have @a addThis linked after. @param addThis Node to insert after. @throws Exception When TiXmlNode::InsertAfterChild returns Null. @see InsertBeforeChild @see TiXmlNode::InsertAfterChild */ Node* InsertAfterChild( Node* afterThis, Node& addThis ); /** Replace a child of this node. Throws if you try to replace with a document. @param replaceThis Node to replace. @param withThis Node that is replacing @a replaceThis. @throws Exception When TiXmlNode::ReplaceChild returns Null. @see TiXmlNode::ReplaceChild */ Node* ReplaceChild( Node* replaceThis, Node& withThis ); /** Delete a child of this node. @param removeThis Node to delete. @throws Exception When removeThis is not a child of this Node. @see TiXmlNode::RemoveChild */ void RemoveChild( Node* removeThis ); /** Navigate to a sibling node. Wrapper around TiXmlNode::PreviousSibling. @param throwIfNoSiblings [DEF] If true, will throw an exception if there are no siblings. @return Pointer to sibling, Null if no siblings and 'throwIfNoSiblings' is false. @throws Exception When TiXmlNode::PreviousSibling returns Null and 'throwIfNoSiblings' is true. */ Node* PreviousSibling( bool throwIfNoSiblings = true ) const; /** Navigate to a sibling node with the given @a value. @overload @param value The value of the node to look for. @param throwIfNoSiblings [DEF] If true, will throw an exception if there are no siblings. @see PreviousSibling( bool throwIfNoSiblings ) */ Node* PreviousSibling( const std::string& value, bool throwIfNoSiblings = true ) const; /** @internal Navigate to a sibling node with the given @a value. @overload @param value The value of the node to look for. @param throwIfNoSiblings [DEF] If true, will throw an exception if there are no siblings. @see PreviousSibling( const std::string& value, bool throwIfNoSiblings ) */ Node* PreviousSibling( const char* value, bool throwIfNoSiblings = true ) const; /** Navigate to a sibling node. Wrapper around TiXmlNode::NextSibling. @param throwIfNoSiblings [DEF] If true, will throw an exception if there are no siblings. @return Pointer to sibling, Null if no siblings and 'throwIfNoSiblings' is false. @throws Exception When TiXmlNode::NextSibling returns Null and 'throwIfNoSiblings' is true. */ Node* NextSibling( bool throwIfNoSiblings = true ) const; /** Navigate to a sibling node with the given @a value. @overload @param value The value of the node to look for. @param throwIfNoSiblings [DEF] If true, will throw an exception if there are no siblings. @see NextSibling( bool throwIfNoSiblings ) */ Node* NextSibling( const std::string& value, bool throwIfNoSiblings = true ) const; /** @internal Navigate to a sibling node with the given @a value. @overload @param value The value of the node to look for. @param throwIfNoSiblings [DEF] If true, will throw an exception if there are no siblings. @see NextSibling( const std::string& value, bool throwIfNoSiblings ) */ Node* NextSibling( const char* value, bool throwIfNoSiblings = true ) const; /** @internal Just for Iterator<> @param value The value of nodes to iterate through @param next [OUT] The pointer to the first valid node */ template < class T > void IterateFirst( const std::string& value, T** first ) const { *first = 0; for( Node* child = FirstChild( value, false ); child; child = child->NextSibling( value, false ) ) { *first = dynamic_cast< T* >( child ); if ( 0 != *first ) { return; } } } virtual void IterateFirst( const std::string&, Attribute** ) const { TICPPTHROW( "Attributes can only be iterated with Elements." ) } /** @internal Just for Iterator<> @param value The value of nodes to iterate through @param next [OUT] The pointer to the next valid node */ template < class T > void IterateNext( const std::string& value, T** next ) const { Node* sibling = NextSibling( value, false ); *next = dynamic_cast< T* >( sibling ); while ( ( 0 != sibling ) && ( 0 == *next ) ) { sibling = sibling->NextSibling( value, false ); *next = dynamic_cast< T* >( sibling ); } } /** @internal Just for Iterator<> @param value The value of nodes to iterate through @param previous [OUT] The pointer to the previous valid node */ template < class T > void IteratePrevious( const std::string& value, T** previous ) const { Node* sibling = PreviousSibling( value, false ); *previous = dynamic_cast< T* >( sibling ); while ( ( 0 != sibling ) && ( 0 == *previous ) ) { sibling = sibling->PreviousSibling( value, false ); *previous = dynamic_cast< T* >( sibling ); } } /** Navigate to a sibling element. Wrapper around TiXmlNode::NextSibling. @param throwIfNoSiblings [DEF] If true, will throw an exception if there are no sibling element. @return Pointer to sibling, Null if no siblings and 'throwIfNoSiblings' is false. @throws Exception When TiXmlNode::NextSibling returns Null and 'throwIfNoSiblings' is true. */ Element* NextSiblingElement( bool throwIfNoSiblings = true ) const; /** Navigate to a sibling element with the given @a value. @overload @param value The value of the element to look for. @param throwIfNoSiblings [DEF] If true, will throw an exception if there are no sibling elements. @see NextSiblingElement( bool throwIfNoSiblings ) */ Element* NextSiblingElement( const std::string& value, bool throwIfNoSiblings = true ) const; /** @internal Navigate to a sibling element with the given @a value. @overload @param value The value of the element to look for. @param throwIfNoSiblings [DEF] If true, will throw an exception if there are no sibling elements. @see NextSiblingElement( const std::string& value, bool throwIfNoSiblings ) */ Element* NextSiblingElement( const char* value, bool throwIfNoSiblings = true ) const; /** The first child element of this node. @param throwIfNoChildren [DEF] If true, will throw an exception if there are no element children. @return Pointer to child, Null if no element children and 'throwIfNoChildren' is false. @throws Exception When throwIfNoChildren is true, and TiXmlNode::FirstChildElement returns Null. @see TiXmlNode::FirstChildElement */ Element* FirstChildElement( bool throwIfNoChildren = true ) const; /** @internal The first child element of this node with the matching @a value. @overload @param value Value to match. @param throwIfNoChildren [DEF] If true, will throw an exception if there are no element children. @see FirstChildElement( bool throwIfNoChildren = true ) */ Element* FirstChildElement( const char* value, bool throwIfNoChildren = true ) const; /** The first child element of this node with the matching @a value. @overload @param value Value to match. @param throwIfNoChildren [DEF] If true, will throw an exception if there are no element children. @see FirstChildElement( const char* value, bool throwIfNoChildren = true ) */ Element* FirstChildElement( const std::string& value, bool throwIfNoChildren = true ) const; /** Query the type (as TiXmlNode::NodeType ) of this node. */ int Type() const; /** Return a pointer to the Document this node lives in. @param throwIfNoDocument [DEF] If true, will throw an exception if this node is not linked under a Document. @return A pointer to the Document this node lives in, NULL if not linked under a Document, and 'throwIfNoDocument' is false. @throws Exception When this node is not linked under a Document and 'throwIfNoDocument' is true. */ Document* GetDocument( bool throwIfNoDocument = true ) const; /** Check if this node has no children. @return true if this node has no children. */ bool NoChildren() const; #ifndef TICPP_NO_RTTI /** Pointer conversion ( NOT OBJECT CONVERSION ) - replaces TiXmlNode::ToElement, TiXmlNode::ToDocument, TiXmlNode::ToComment, etc. @throws Exception When the target is not an object of class T @warning Some ancient compilers do not support explicit specification of member template arguments, which this depends on ( e.g. VC6 ). */ template < class T > T* To() const { T* pointer = dynamic_cast< T* >( this ); if ( 0 == pointer ) { std::string thisType = typeid( this ).name(); std::string targetType = typeid( T ).name(); std::string thatType = typeid( *this ).name(); TICPPTHROW( "The " << thisType.substr( 6 ) << " could not be casted to a " << targetType.substr( 6 ) << " *, because the target object is not a " << targetType.substr( 6 ) << ". (It is a " << thatType.substr( 6 ) << ")" ); } return pointer; } #endif /** Pointer conversion - replaces TiXmlNode::ToDocument. @throws Exception When this node is not a Document. */ Document* ToDocument() const; /** Pointer conversion - replaces TiXmlNode::ToElement. @throws Exception When this node is not a Element. */ Element* ToElement() const; /** Pointer conversion - replaces TiXmlNode::ToComment. @throws Exception When this node is not a Comment. */ Comment* ToComment() const; /** Pointer conversion - replaces TiXmlNode::ToText. @throws Exception When this node is not a Text. */ Text* ToText() const; /** Pointer conversion - replaces TiXmlNode::ToDeclaration. @throws Exception When this node is not a Declaration. */ Declaration* ToDeclaration() const; /** Pointer conversion - replaces TiXmlNode::ToStylesheetReference. @throws Exception When this node is not a StylesheetReference. */ StylesheetReference* ToStylesheetReference() const; /** Create an exact duplicate of this node and return it. @note Using auto_ptr to manage the memory declared on the heap by TiXmlNode::Clone. @code // Now using clone ticpp::Document doc( "C:\\Test.xml" ); ticpp::Node* sectionToClone; sectionToClone = doc.FirstChild( "settings" ); std::auto_ptr< ticpp::Node > clonedNode = sectionToClone->Clone(); // Now you can use the clone. ticpp::Node* node2 = clonedNode->FirstChildElement()->FirstChild(); ... // After the variable clonedNode goes out of scope it will automatically be cleaned up. @endcode @return Pointer the duplicate node. */ std::auto_ptr< Node > Clone() const; /** Accept a hierchical visit the nodes in the TinyXML DOM. @return The boolean returned by the visitor. */ bool Accept( TiXmlVisitor* visitor ) const; /** Stream input operator. */ friend std::istream& operator >>( std::istream& in, Node& base ) { in >> *base.GetTiXmlPointer(); return in; } /** Stream output operator. */ friend std::ostream& operator <<( std::ostream& out, const Node& base ) { out << *base.GetTiXmlPointer(); return out; } protected: /** @internal Allows NodeImp to use Node*'s. */ virtual TiXmlNode* GetTiXmlPointer() const = 0; TiXmlBase* GetBasePointer() const { return GetTiXmlPointer(); } /** @internal Constructs the correct child of Node, based on the Type of the TiXmlNode*. */ Node* NodeFactory( TiXmlNode* tiXmlNode, bool throwIfNull = true, bool rememberSpawnedWrapper = true ) const; }; /** Iterator for conveniently stepping through Nodes and Attributes. TinyXML++ introduces iterators: @code ticpp::Iterator< ticpp::Node > child; for ( child = child.begin( parent ); child != child.end(); child++ ) @endcode Iterators have the added advantage of filtering by type: @code // Only iterates through Comment nodes ticpp::Iterator< ticpp::Comment > child; for ( child = child.begin( parent ); child != child.end(); child++ ) @endcode @code // Only iterates through Element nodes with value "ElementValue" ticpp::Iterator< ticpp::Element > child( "ElementValue" ); for ( child = child.begin( parent ); child != child.end(); child++ ) @endcode Finally, Iterators also work with Attributes @code ticpp::Iterator< ticpp::Attribute > attribute; for ( attribute = attribute.begin( element ); attribute != attribute.end(); attribute++ ) @endcode */ template < class T = Node > class Iterator { private: T* m_p; /**< Internal Pointer */ std::string m_value; /**< Value for NextSibling calls */ public: /** For for loop comparisons. @param parent The parent of the nodes to iterate. @return The first child of type T. @code ticpp::Iterator< ticpp::Node > child; for ( child = child.begin( parent ); child != child.end(); child++ ) @endcode */ T* begin( const Node* parent ) const { T* pointer; parent->IterateFirst( m_value, &pointer ); return pointer; } /** For for loop comparisons. @return NULL @code ticpp::Iterator< ticpp::Node > child; for ( child = child.begin( parent ); child != child.end(); child++ ) @endcode */ T* end() const { return 0; } /** Constructor. @param value If not empty, this iterator will only visit nodes with matching value. @code // Only iterates through Element nodes with value "ElementValue" ticpp::Iterator< ticpp::Element > child( "ElementValue" ); for ( child = child.begin( parent ); child != child.end(); child++ ) @endcode */ Iterator( const std::string& value = "" ) : m_p( 0 ), m_value( value ) { } /// Constructor Iterator( T* node, const std::string& value = "" ) : m_p( node ), m_value( value ) { } /// Constructor Iterator( const Iterator& it ) : m_p( it.m_p ), m_value( it.m_value ) { } /** Gets internal pointer. @return The internal pointer. */ T* Get() const { return m_p; } /** Sets internal pointer */ Iterator& operator=( const Iterator& it ) { m_p = it.m_p; m_value = it.m_value; return *this; } /** Sets internal pointer */ Iterator& operator=( T* p ) { m_p = p; return *this; } /** Sets internal pointer to the Next Sibling, or Iterator::END, if there are no more siblings */ Iterator& operator++() { m_p->IterateNext( m_value, &m_p ); return *this; } /** Sets internal pointer to the Next Sibling, or Iterator::END, if there are no more siblings */ Iterator operator++(int) { Iterator tmp(*this); ++(*this); return tmp; } /** Sets internal pointer to the Previous Sibling, or Iterator::END, if there are no prior siblings */ Iterator& operator--() { m_p->IteratePrevious( m_value, &m_p ); return *this; } /** Sets internal pointer to the Previous Sibling, or Iterator::END, if there are no prior siblings */ Iterator operator--(int) { Iterator tmp(*this); --(*this); return tmp; } /** Compares internal pointer */ bool operator!=( const T* p ) const { if ( m_p == p ) { return false; } if ( 0 == m_p || 0 == p ) { return true; } return *m_p != *p; } /** Compares internal pointer */ bool operator!=( const Iterator& it ) const { return operator!=( it.m_p ); } /** Compares internal pointer* */ bool operator==( T* p ) const { if ( m_p == p ) { return true; } if ( 0 == m_p || 0 == p ) { return false; } return *m_p == *p; } /** Compares internal pointer */ bool operator==( const Iterator& it ) const { return operator==( it.m_p ); } /** So Iterator behaves like a STL iterator */ T* operator->() const { return m_p; } /** So Iterator behaves like a STL iterator */ T& operator*() const { return *m_p; } }; /** Implementation of Node wrapper */ template < class T > class NodeImp : public Node { protected: T* m_tiXmlPointer; /**< Internal pointer to the TiXml Class which is being wrapped */ /** @internal Gets the internal TinyXML pointer. @returns The internal TiXmlNode*. */ TiXmlNode* GetTiXmlPointer() const { ValidatePointer(); return m_tiXmlPointer; } /** @internal Sets the internal pointer. Saves a copy of the pointer to the RC object. @param newPointer TiXmlNode* to set. */ void SetTiXmlPointer( T* newPointer ) { m_tiXmlPointer = newPointer; SetImpRC( newPointer ); } /** @internal Constructor used by child classes. */ NodeImp( T* tiXmlPointer ) { // Check for NULL pointers if ( 0 == tiXmlPointer ) { #ifdef TICPP_NO_RTTI TICPPTHROW( "Can not create TinyXML objext" ); #else TICPPTHROW( "Can not create a " << typeid( T ).name() ); #endif } SetTiXmlPointer( tiXmlPointer ); m_impRC->IncRef(); } /** @internal Updates the reference count for the old and new pointers. In addition, the spawnedWrappers must be cleared out before a new TiXml object is loaded in. */ virtual void operator=( const NodeImp& copy ) { // Dropping the reference to the old object this->m_impRC->DecRef(); // Pointing to the new Object SetTiXmlPointer( copy.m_tiXmlPointer ); // The internal tixml pointer changed in the above line this->m_impRC->IncRef(); } /** @internal Updates the reference count for the old and new pointers. In addition, the spawnedWrappers must be cleared out before a new TiXml object is loaded in */ NodeImp( const NodeImp& copy ) : Node( copy ) { // Pointing to the new Object SetTiXmlPointer( copy.m_tiXmlPointer ); // The internal tixml pointer changed in the above line this->m_impRC->IncRef(); } public: /* Deletes the spawned wrapper objects. Decrements reference count. */ virtual ~NodeImp() { m_impRC->DecRef(); } }; /** Wrapper around TiXmlComment */ class Comment : public NodeImp< TiXmlComment > { public: /** Constructor. */ Comment(); /** Constructor. */ Comment( TiXmlComment* comment ); /** Constructor. */ Comment( const std::string& comment ); }; /** Wrapper around TiXmlText */ class Text : public NodeImp< TiXmlText > { public: /** Constructor. */ Text(); /** Constructor. @overload */ Text( TiXmlText* text ); /** Constructor. @overload */ Text( const std::string& value ); /** Streams value into a string and creates a Text with it. Uses ToString to covert the parameter to a string. @param value The value of the Text node. @throws Exception @see TiXmlText */ template < class T > Text( const T& value ) : NodeImp< TiXmlText >( new TiXmlText( ToString( value ) ) ) { m_impRC->InitRef(); } }; /** Wrapper around TiXmlDocument */ class Document : public NodeImp< TiXmlDocument > { public: /** Default Constructor. Create an empty document, that has no name. */ Document(); /** Constructor. */ Document( TiXmlDocument* document ); /** Constructor. */ Document( const char* documentName ); /** Constructor. Create a document with a name. The name of the document is also the filename of the xml. @param documentName Name to set in the Document. */ Document( const std::string& documentName ); /** Load a file using the current document value. Throws if load is unsuccessful. @param encoding Sets the documents encoding. @see TiXmlEncoding @throws Exception */ void LoadFile( TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING ); /** Save a file using the current document value. Throws if it can't save the file. @throws Exception */ void SaveFile() const; /** Load a file using the given filename. Throws if load is unsuccessful. @param filename File to load. @param encoding Sets the documents encoding. @see TiXmlEncoding @throws Exception */ void LoadFile( const std::string& filename, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING ); /** @copydoc Document::LoadFile( const std::string&, TiXmlEncoding ) */ void LoadFile( const char* filename, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING ); /** Save a file using the given filename. Throws if it can't save the file. @param filename File to save. @throws Exception */ void SaveFile( const std::string& filename ) const; /** Parse the given xml data. @param xml Xml to parse. @param throwIfParseError [DEF] If true, throws when there is a parse error. @param encoding Sets the documents encoding. @throws Exception */ void Parse( const std::string& xml, bool throwIfParseError = true, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING ); }; /** Wrapper around TiXmlElement */ class Element : public NodeImp< TiXmlElement > { public: /** Default Constructor. */ Element(); /** Default Constructor. Initializes all the variables. @param value The value of the element. */ Element( const std::string& value ); /** Default Constructor. Initializes all the variables. @param value The value of the element. */ Element( const char* value ); /** Constructor. */ Element( TiXmlElement* element ); /** Constructor that allows you to set the element text @param value The value of the element. @param text The text to set. */ template < class T > Element( const std::string& value, const T& text ) : NodeImp< TiXmlElement >( new TiXmlElement( value ) ) { m_impRC->InitRef(); SetText( text ); } /** Access the first attribute in this element. @param throwIfNoAttributes [DEF] If true, throws when there are no attributes @return The first attribute, NULL if there are none and @a throwIfNoAttributes is true */ Attribute* FirstAttribute( bool throwIfNoAttributes = true ) const; /** Access the last attribute in this element. @param throwIfNoAttributes [DEF] If true, throws when there are no attributes @return The last attribute, NULL if there are none and @a throwIfNoAttributes is true */ Attribute* LastAttribute( bool throwIfNoAttributes = true ) const; /** @internal Just for Iterator<> @param value The value of nodes to iterate through @param next [OUT] The pointer to the first valid node */ void IterateFirst( const std::string&, Attribute** first ) const { *first = 0; for( Attribute* child = FirstAttribute( false ); child; child = child->Next( false ) ) { *first = dynamic_cast< Attribute* >( child ); if ( 0 != *first ) { return; } } } /** Sets an attribute of name to a given value. The attribute will be created if it does not exist, or changed if it does. Uses ToString to convert the @a value to a string, so there is no need to use any other SetAttribute methods. @see GetAttribute */ template < class T > void SetAttribute ( const std::string& name, const T& value ) { ValidatePointer(); m_tiXmlPointer->SetAttribute( name, ToString( value ) ); } /** Gets the text of an Element. @param throwIfNotFound [DEF] If true, will throw an exception if there is no text in this element @note This only works if the Text is the FirstChild node @throws Exception When there is no text and throwIfNotFound is true @see GetText( T* value, bool throwIfNotFound = false ) @see GetTextOrDefault @see GetTextOrDefault( T* value, const DefaultT& defaultValue ) @see TiXmlElement::GetText */ std::string GetText( bool throwIfNotFound = true ) const { // Get the element's text value as a std::string std::string temp; if ( !GetTextImp( &temp ) ) { if ( throwIfNotFound ) { TICPPTHROW( "Text does not exists in the current element" ); } } return temp; } /** Gets the text of an Element, if it doesn't exist it will return the defaultValue. @param defaultValue What to put in 'value' if there is no text in this element @note This only works if the Text is the FirstChild node @see GetText @see GetText( T* value, bool throwIfNotFound = false ) @see GetTextOrDefault( T* value, const DefaultT& defaultValue ) @see TiXmlElement::GetText */ std::string GetTextOrDefault( const std::string& defaultValue ) const { // Get the element's text value as a std::string std::string temp; if ( !GetTextImp( &temp ) ) { return defaultValue; } return temp; } /** Gets the text value of an Element, if it doesn't exist it will return the defaultValue. Uses FromString to convert the string to the type of choice @param value [OUT] The container for the returned value @param defaultValue What to put in 'value' if there is no text in this element @note This is different than GetText() in that it will covert the text to what ever type you want. @note This only works if the Text is the FirstChild node @see GetText @see GetText( T* value, bool throwIfNotFound = false ) @see GetTextOrDefault( const std::string& defaultValue ) @see TiXmlElement::GetText */ template < class T, class DefaultT > void GetTextOrDefault( T* value, const DefaultT& defaultValue ) const { // Get the element's text value as a std::string std::string temp; if ( !GetTextImp( &temp ) ) { // The text value does not exist - set value to the default *value = defaultValue; return; } // Stream the value from the string to T FromString( temp, value ); } /** Gets the text of an Element. Uses FromString to convert the string to the type of choice. @param value [OUT] The container for the returned value @param throwIfNotFound [DEF] If true, will throw an exception if there is no text in this element @note This is different than GetText() in that it will covert the text to what ever type you want @note This only works if the Text is the FirstChild node @throws Exception When there is no text and throwIfNotFound is true @see GetText @see GetTextOrDefault @see GetTextOrDefault( T* value, const DefaultT& defaultValue ) @see TiXmlElement::GetText */ template< class T > void GetText( T* value, bool throwIfNotFound = true ) const { // Get the element's text value as a std::string std::string temp; if ( !GetTextImp( &temp ) ) { if ( throwIfNotFound ) { TICPPTHROW( "Text does not exists in the current element" ); } else { return; } } // Stream the value from the string to T FromString( temp, value ); } /** Convenience function to set the text of an element. Creates a Text node and inserts it as the first child. Uses ToString to convert the parameter to a string. @param value The text to set. */ template < class T > void SetText( const T& value ) { ValidatePointer(); std::string temp = ToString( value ); if ( m_tiXmlPointer->NoChildren() ) { m_tiXmlPointer->LinkEndChild( new TiXmlText( temp ) ); } else { if ( 0 == m_tiXmlPointer->GetText() ) { m_tiXmlPointer->InsertBeforeChild( m_tiXmlPointer->FirstChild(), TiXmlText( temp ) ); } else { // There already is text, so change it m_tiXmlPointer->FirstChild()->SetValue( temp ); } } } /** Gets an attribute of @a name from an element, if it doesn't exist it will return the defaultValue. Uses FromString to convert the string to the type of choice. @param name The name of the attribute you are querying. @param value [OUT] The container for the returned value. @param defaultValue What to put in @a value if there is no attribute in this element. @throws Exception @see GetAttribute */ template < class T, class DefaulT > void GetAttributeOrDefault( const std::string& name, T* value, const DefaulT& defaultValue ) const { // Get the attribute's value as a std::string std::string temp; if ( !GetAttributeImp( name, &temp ) ) { // The attribute does not exist - set value to the default *value = defaultValue; return; } // Stream the value from the string to T FromString( temp, value ); } /** Gets an attribute of @a name from an element, if it doesn't exist it will return the defaultValue. @param name The name of the attribute you are querying. @param defaultValue What to put in @a value if there is no attribute in this element. @see GetAttribute */ std::string GetAttributeOrDefault( const std::string& name, const std::string& defaultValue ) const; /** Returns an attribute of @a name from an element. Uses FromString to convert the string to the type of choice. @param name The name of the attribute you are querying. @param throwIfNotFound [DEF] If true, will throw an exception if the attribute doesn't exist @throws Exception When the attribute doesn't exist and throwIfNotFound is true @see GetAttributeOrDefault */ template < class T > T GetAttribute( const std::string& name, bool throwIfNotFound = true ) const { // Get the attribute's value as a std::string std::string temp; T value; if ( !GetAttributeImp( name, &temp ) ) { if ( throwIfNotFound ) { TICPPTHROW( "Attribute does not exist" ); } } else { // Stream the value from the string to T FromString( temp, &value ); } return value; } /** Gets an attribute of @a name from an element. Uses FromString to convert the string to the type of choice. @param name The name of the attribute you are querying. @param value [OUT] The container for the returned value @param throwIfNotFound [DEF] If true, will throw an exception if the attribute doesn't exist @throws Exception When the attribute doesn't exist and throwIfNotFound is true @see GetAttributeOrDefault */ template< class T > void GetAttribute( const std::string& name, T* value, bool throwIfNotFound = true ) const { // Get the attribute's value as a std::string std::string temp; if ( !GetAttributeImp( name, &temp ) ) { if ( throwIfNotFound ) { TICPPTHROW( "Attribute does not exist" ); } else { return; } } // Stream the value from the string to T FromString( temp, value ); } /** Gets an attribute of @a name from an element. Returns an empty string if the attribute does not exist. @param name The name of the attribute you are querying. @return The value of the attribute, or an empty string if it does not exist. @see GetAttributeOrDefault */ std::string GetAttribute( const std::string& name ) const; /** Returns true, if attribute exists @param name The name of the attribute you are checking. @return Existence of attribute */ bool HasAttribute( const std::string& name ) const; /** Removes attribute from element. @param name The name of the attribute to remove. */ void RemoveAttribute( const std::string& name ); private: /** @internal Implimentation of the GetAttribute and GetAttributeOrDefault template methods. */ bool GetAttributeImp( const std::string& name, std::string* value ) const; /** @internal Implimentation of the GetText, GetTextOrDefault, GetTextValue, and GetTextValueOrDefault template methods. */ bool GetTextImp( std::string* value ) const; }; /** Wrapper around TiXmlDeclaration */ class Declaration : public NodeImp< TiXmlDeclaration > { public: /** Default Constructor. Construct an empty declaration. */ Declaration(); /** Constructor. */ Declaration( TiXmlDeclaration* declaration ); /** Constructor. */ Declaration( const std::string& version, const std::string& encoding, const std::string& standalone ); /** Version. Will return an empty string if none was found. */ std::string Version() const; /** Encoding. Will return an empty string if none was found. */ std::string Encoding() const; /** StandAlone. Is this a standalone document? */ std::string Standalone() const; }; /** Wrapper around TiXmlStylesheetReference */ class StylesheetReference : public NodeImp< TiXmlStylesheetReference > { public: /** Default Constructor. Construct an empty declaration. */ StylesheetReference(); /** Constructor. */ StylesheetReference( TiXmlStylesheetReference* stylesheetReference ); /** Constructor. */ StylesheetReference( const std::string& type, const std::string& href ); /** Type. Will return an empty string if none was found. */ std::string Type() const; /** Href. Will return an empty string if none was found. */ std::string Href() const; }; } #endif // TICPP_INCLUDED #endif // TIXML_USE_TICPP wxformbuilder-3.1.59/sdk/tinyxml/ticpp.lua0000644000175000017500000001067011143440026021062 0ustar rrmulderrrmulder--***************************************************************************** --* Author: RJP Computing --* Date: 01/21/2008 --* Version: 1.02 --* Copyright (C) 2008 RJP Computing --* --* Permission is hereby granted, free of charge, to any person obtaining a copy of --* this software and associated documentation files (the "Software"), to deal in --* the Software without restriction, including without limitation the rights to --* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of --* the Software, and to permit persons to whom the Software is furnished to do so, --* subject to the following conditions: --* --* The above copyright notice and this permission notice shall be included in all --* copies or substantial portions of the Software. --* --* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR --* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS --* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR --* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER --* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN --* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --* --* NOTES: --* - use the '/' slash for all paths. --***************************************************************************** --******* Initial Setup ************ --* Most of the setting are set here. --********************************** -- Set the name of your package. package.name = "TiCPP" -- Set this if you want a different name for your target than the package's name. local targetName = "ticpp" -- Set the kind of package you want to create. if ( options["ticpp-shared"] ) then package.kind = "dll" else package.kind = "lib" end -- Set the files to include/exclude. package.files = { matchfiles( "*.cpp", "*.h" ) } package.excludes = { "xmltest.cpp" } -- Setup the output directory options. -- Note: Use 'libdir' for "lib" kind only. package.bindir = "../lib" package.libdir = "../lib" -- Set the defines. package.defines = { "TIXML_USE_TICPP" } --------------------------- DO NOT EDIT BELOW ---------------------------------- --******* GENAERAL SETUP ********** --* Settings that are not dependant --* on the operating system. --********************************* -- Package options addoption( "ticpp-shared", "Build the library as a dll" ) -- Common setup package.language = "c++" -- Set object output directory. if ( string.find( target or "", ".*-gcc" ) or target == "gnu" ) then package.objdir = ".obj" end -- Set the default targetName if none is specified. if ( string.len( targetName ) == 0 ) then targetName = package.name end -- Set the targets. package.config["Release"].target = targetName package.config["Debug"].target = targetName.."d" -- Set the build options. if ( options["dynamic-runtime"] ) then package.buildflags = { "extra-warnings" } package.config["Release"].buildflags = { "no-symbols", "optimize-speed" } else package.buildflags = { "static-runtime", "extra-warnings" } package.config["Release"].buildflags = { "no-symbols", "optimize-speed" } end if ( options["unicode"] ) then table.insert( package.buildflags, "unicode" ) end if ( string.find( target or "", ".*-gcc" ) or target == "gnu" ) then table.insert( package.config["Debug"].buildoptions, "-O0" ) end -- Set the defines. if ( options["unicode"] ) then table.insert( package.defines, { "UNICODE", "_UNICODE" } ) end table.insert( package.config["Debug"].defines, { "DEBUG", "_DEBUG" } ) table.insert( package.config["Release"].defines, "NDEBUG" ) if ( ( target == "vs2005" ) or ( target == "vs2008" ) ) then -- Windows and Visual C++ 2005/2008 table.insert( package.defines, "_CRT_SECURE_NO_DEPRECATE" ) end if ( OS == "windows" ) then --******* WINDOWS SETUP *********** --* Settings that are Windows specific. --********************************* -- Set the Windows defines. table.insert( package.defines, { "WIN32", "_WINDOWS" } ) else --******* LINUX SETUP ************* --* Settings that are Linux specific. --********************************* -- Ignore resource files in Linux. table.insert( package.excludes, matchrecursive( "*.rc" ) ) table.insert( package.buildoptions, "-fPIC" ) end wxformbuilder-3.1.59/sdk/tinyxml/ticpprc.h0000644000175000017500000000573111143440026021057 0ustar rrmulderrrmulder/* http://code.google.com/p/ticpp/ Copyright (c) 2006 Ryan Pusztai, Ryan Mulder Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifdef TIXML_USE_TICPP #ifndef TICPPRC_INCLUDED #define TICPPRC_INCLUDED #include // Forward declare ticpp::Node, so it can be made a friend of TiCppRC namespace ticpp { class Base; } // Forward declare TiCppRCImp so TiCppRC can hold a pointer to it class TiCppRCImp; /** Base class for reference counting functionality */ class TiCppRC { // Allow ticpp::Node to directly modify reference count friend class ticpp::Base; private: TiCppRCImp* m_tiRC; /**< Pointer to reference counter */ public: /** Constructor Spawns new reference counter with a pointer to this */ TiCppRC(); /** Destructor Nullifies the pointer to this held by the reference counter Decrements reference count */ virtual ~TiCppRC(); std::vector< ticpp::Base* > m_spawnedWrappers; /**< Remember all wrappers that we've created with 'new' - ( e.g. NodeFactory, FirstChildElement, etc. )*/ /** Delete all container objects we've spawned with 'new'. */ void DeleteSpawnedWrappers(); }; class TiCppRCImp { private: int m_count; /**< Holds reference count to me, and to the node I point to */ TiCppRC* m_tiCppRC; /**< Holds pointer to an object inheriting TiCppRC */ public: /** Initializes m_tiCppRC pointer, and set reference count to 1 */ TiCppRCImp( TiCppRC* tiCppRC ); /** Allows the TiCppRC object to set the pointer to itself ( m_tiCppRc ) to NULL when the TiCppRC object is deleted */ void Nullify(); /** Increment Reference Count */ void IncRef(); /** Decrement Reference Count */ void DecRef(); /** Set Reference Count to 1 - dangerous! - Use only if you are sure of the consequences */ void InitRef(); /** Get internal pointer to the TiCppRC object - not reference counted, use at your own risk */ TiCppRC* Get(); /** Returns state of internal pointer - will be null if the object was deleted */ bool IsNull(); }; #endif // TICPP_INCLUDED #endif // TIXML_USE_TICPP wxformbuilder-3.1.59/sdk/tinyxml/ticpp4.lua0000644000175000017500000000751711143440026021154 0ustar rrmulderrrmulder--***************************************************************************** --* Author: RJP Computing --* Date: 01/21/2008 --* Version: 1.02 --* Copyright (C) 2009 RJP Computing --* --* Permission is hereby granted, free of charge, to any person obtaining a copy of --* this software and associated documentation files (the "Software"), to deal in --* the Software without restriction, including without limitation the rights to --* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of --* the Software, and to permit persons to whom the Software is furnished to do so, --* subject to the following conditions: --* --* The above copyright notice and this permission notice shall be included in all --* copies or substantial portions of the Software. --* --* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR --* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS --* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR --* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER --* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN --* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --* --* NOTES: --* - use the '/' slash for all paths. --***************************************************************************** --******* Initial Setup ************ --* Most of the setting are set here. --********************************** -- Set the name of your package. project "TiCPP" -- Set this if you want a different name for your target than the projects's name. outName = "ticpp" -- Set the files to include/exclude. files { "*.cpp", "*.h" } excludes { "xmltest.cpp" } -- Setup the output directory options. -- Note: Use 'libdir' for "lib" kind only. --bindir "../lib" --libdir "../lib" -- Set the defines. defines { "TIXML_USE_TICPP" } --------------------------- DO NOT EDIT BELOW ---------------------------------- -- Common setup language "C++" flags { "ExtraWarnings" } --******* GENAERAL SETUP ********** --* Settings that are not dependant --* on the operating system. --********************************* -- OPTIONS --------------------------------------------------------------------- -- -- -- Package options -- newoption { trigger = "ticpp-shared", description = "Build TinyXML++ as a dll" } -- -- TinyXML++ dll -- if _OPTIONS["ticpp-shared"] then kind "SharedLib" else kind "StaticLib" end -- -- Dynamic Runtime -- if not _OPTIONS["dynamic-runtime"] then flags { "StaticRuntime" } end -- CONFIGURATIONS ------------------------------------------------------------- -- -- -- Unicode -- configuration "unicode" flags { "Unicode" } defines { "UNICODE", "_UNICODE" } -- -- GCC compilers -- configuration { "code*", "gmake" } objdir ".obj" buildoptions { "-O0" } -- -- Visual Studio -- configuration "vs*" -- Windows and Visual C++ 2005/2008 defines { "_CRT_SECURE_NO_DEPRECATE" } -- -- Release/Debug -- -- Set the default targetName if none is specified. if #outName <= 0 then outName = project().name end print( outName ) print( project().name ) -- Set the targets. configuration "Release" targetname ( outName ) defines { "NDEBUG" } flags { "OptimizeSpeed" } configuration "Debug" targetname ( outName.."d" ) defines { "DEBUG", "_DEBUG" } flags { "Symbols" } -- -- Operating Systems specific -- if configuration "windows" then defines { "WIN32", "_WINDOWS" } else excludes { "**.rc" } -- Ignore resource files in Linux. buildoptions { "-fPIC" } end wxformbuilder-3.1.59/sdk/tinyxml/tinystr.h0000644000175000017500000002111711143440026021123 0ustar rrmulderrrmulder/* www.sourceforge.net/projects/tinyxml Original file by Yves Berquin. This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ /* * THIS FILE WAS ALTERED BY Tyge Lovset, 7. April 2005. * * - completely rewritten. compact, clean, and fast implementation. * - sizeof(TiXmlString) = pointer size (4 bytes on 32-bit systems) * - fixed reserve() to work as per specification. * - fixed buggy compares operator==(), operator<(), and operator>() * - fixed operator+=() to take a const ref argument, following spec. * - added "copy" constructor with length, and most compare operators. * - added swap(), clear(), size(), capacity(), operator+(). */ #ifndef TIXML_USE_STL #ifndef TIXML_STRING_INCLUDED #define TIXML_STRING_INCLUDED #include #include /* The support for explicit isn't that universal, and it isn't really required - it is used to check that the TiXmlString class isn't incorrectly used. Be nice to old compilers and macro it here: */ #if defined(_MSC_VER) && (_MSC_VER >= 1200 ) // Microsoft visual studio, version 6 and higher. #define TIXML_EXPLICIT explicit #elif defined(__GNUC__) && (__GNUC__ >= 3 ) // GCC version 3 and higher.s #define TIXML_EXPLICIT explicit #else #define TIXML_EXPLICIT #endif /* TiXmlString is an emulation of a subset of the std::string template. Its purpose is to allow compiling TinyXML on compilers with no or poor STL support. Only the member functions relevant to the TinyXML project have been implemented. The buffer allocation is made by a simplistic power of 2 like mechanism : if we increase a string and there's no more room, we allocate a buffer twice as big as we need. */ class TiXmlString { public : // The size type used typedef size_t size_type; // Error value for find primitive static const size_type npos; // = -1; // TiXmlString empty constructor TiXmlString () : rep_(&nullrep_) { } // TiXmlString copy constructor TiXmlString ( const TiXmlString & copy) : rep_(0) { init(copy.length()); memcpy(start(), copy.data(), length()); } // TiXmlString constructor, based on a string TIXML_EXPLICIT TiXmlString ( const char * copy) : rep_(0) { init( static_cast( strlen(copy) )); memcpy(start(), copy, length()); } // TiXmlString constructor, based on a string TIXML_EXPLICIT TiXmlString ( const char * str, size_type len) : rep_(0) { init(len); memcpy(start(), str, len); } // TiXmlString destructor ~TiXmlString () { quit(); } // = operator TiXmlString& operator = (const char * copy) { return assign( copy, (size_type)strlen(copy)); } // = operator TiXmlString& operator = (const TiXmlString & copy) { return assign(copy.start(), copy.length()); } // += operator. Maps to append TiXmlString& operator += (const char * suffix) { return append(suffix, static_cast( strlen(suffix) )); } // += operator. Maps to append TiXmlString& operator += (char single) { return append(&single, 1); } // += operator. Maps to append TiXmlString& operator += (const TiXmlString & suffix) { return append(suffix.data(), suffix.length()); } // Convert a TiXmlString into a null-terminated char * const char * c_str () const { return rep_->str; } // Convert a TiXmlString into a char * (need not be null terminated). const char * data () const { return rep_->str; } // Return the length of a TiXmlString size_type length () const { return rep_->size; } // Alias for length() size_type size () const { return rep_->size; } // Checks if a TiXmlString is empty bool empty () const { return rep_->size == 0; } // Return capacity of string size_type capacity () const { return rep_->capacity; } // single char extraction const char& at (size_type index) const { assert( index < length() ); return rep_->str[ index ]; } // [] operator char& operator [] (size_type index) const { assert( index < length() ); return rep_->str[ index ]; } // find a char in a string. Return TiXmlString::npos if not found size_type find (char lookup) const { return find(lookup, 0); } // find a char in a string from an offset. Return TiXmlString::npos if not found size_type find (char tofind, size_type offset) const { if (offset >= length()) return npos; for (const char* p = c_str() + offset; *p != '\0'; ++p) { if (*p == tofind) return static_cast< size_type >( p - c_str() ); } return npos; } void clear () { //Lee: //The original was just too strange, though correct: // TiXmlString().swap(*this); //Instead use the quit & re-init: quit(); init(0,0); } /* Function to reserve a big amount of data when we know we'll need it. Be aware that this function DOES NOT clear the content of the TiXmlString if any exists. */ void reserve (size_type cap); TiXmlString& assign (const char* str, size_type len); TiXmlString& append (const char* str, size_type len); void swap (TiXmlString& other) { Rep* r = rep_; rep_ = other.rep_; other.rep_ = r; } private: void init(size_type sz) { init(sz, sz); } void set_size(size_type sz) { rep_->str[ rep_->size = sz ] = '\0'; } char* start() const { return rep_->str; } char* finish() const { return rep_->str + rep_->size; } struct Rep { size_type size, capacity; char str[1]; }; void init(size_type sz, size_type cap) { if (cap) { // Lee: the original form: // rep_ = static_cast(operator new(sizeof(Rep) + cap)); // doesn't work in some cases of new being overloaded. Switching // to the normal allocation, although use an 'int' for systems // that are overly picky about structure alignment. const size_type bytesNeeded = sizeof(Rep) + cap; const size_type intsNeeded = ( bytesNeeded + sizeof(int) - 1 ) / sizeof( int ); rep_ = reinterpret_cast( new int[ intsNeeded ] ); rep_->str[ rep_->size = sz ] = '\0'; rep_->capacity = cap; } else { rep_ = &nullrep_; } } void quit() { if (rep_ != &nullrep_) { // The rep_ is really an array of ints. (see the allocator, above). // Cast it back before delete, so the compiler won't incorrectly call destructors. delete [] ( reinterpret_cast( rep_ ) ); } } Rep * rep_; static Rep nullrep_; } ; inline bool operator == (const TiXmlString & a, const TiXmlString & b) { return ( a.length() == b.length() ) // optimization on some platforms && ( strcmp(a.c_str(), b.c_str()) == 0 ); // actual compare } inline bool operator < (const TiXmlString & a, const TiXmlString & b) { return strcmp(a.c_str(), b.c_str()) < 0; } inline bool operator != (const TiXmlString & a, const TiXmlString & b) { return !(a == b); } inline bool operator > (const TiXmlString & a, const TiXmlString & b) { return b < a; } inline bool operator <= (const TiXmlString & a, const TiXmlString & b) { return !(b < a); } inline bool operator >= (const TiXmlString & a, const TiXmlString & b) { return !(a < b); } inline bool operator == (const TiXmlString & a, const char* b) { return strcmp(a.c_str(), b) == 0; } inline bool operator == (const char* a, const TiXmlString & b) { return b == a; } inline bool operator != (const TiXmlString & a, const char* b) { return !(a == b); } inline bool operator != (const char* a, const TiXmlString & b) { return !(b == a); } TiXmlString operator + (const TiXmlString & a, const TiXmlString & b); TiXmlString operator + (const TiXmlString & a, const char* b); TiXmlString operator + (const char* a, const TiXmlString & b); /* TiXmlOutStream is an emulation of std::ostream. It is based on TiXmlString. Only the operators that we need for TinyXML have been developped. */ class TiXmlOutStream : public TiXmlString { public : // TiXmlOutStream << operator. TiXmlOutStream & operator << (const TiXmlString & in) { *this += in; return *this; } // TiXmlOutStream << operator. TiXmlOutStream & operator << (const char * in) { *this += in; return *this; } } ; #endif // TIXML_STRING_INCLUDED #endif // TIXML_USE_STL wxformbuilder-3.1.59/sdk/tinyxml/dox0000644000175000017500000014271311143440026017761 0ustar rrmulderrrmulder# Doxyfile 1.4.3 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project # # All text after a hash (#) is considered a comment and will be ignored # The format is: # TAG = value [value, ...] # For lists items can also be appended using: # TAG += value [value, ...] # Values that contain spaces should be placed between quotes (" ") #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- # The PROJECT_NAME tag is a single word (or a sequence of words surrounded # by quotes) that should identify the project. PROJECT_NAME = TinyXml # The PROJECT_NUMBER tag can be used to enter a project or revision number. # This could be handy for archiving the generated documentation or # if some version control system is used. PROJECT_NUMBER = 2.5.3 # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. # If a relative path is entered, it will be relative to the location # where doxygen was started. If left blank the current directory will be used. OUTPUT_DIRECTORY = ./docs # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create # 4096 sub-directories (in 2 levels) under the output directory of each output # format and will distribute the generated files over these directories. # Enabling this option can be useful when feeding doxygen a huge amount of # source files, where putting all generated files in the same directory would # otherwise cause performance problems for the file system. CREATE_SUBDIRS = NO # The OUTPUT_LANGUAGE tag is used to specify the language in which all # documentation generated by doxygen is written. Doxygen will use this # information to generate all constant output in the proper language. # The default language is English, other supported languages are: # Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, # Dutch, Finnish, French, German, Greek, Hungarian, Italian, Japanese, # Japanese-en (Japanese with English messages), Korean, Korean-en, Norwegian, # Polish, Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish, # Swedish, and Ukrainian. OUTPUT_LANGUAGE = English # This tag can be used to specify the encoding used in the generated output. # The encoding is not always determined by the language that is chosen, # but also whether or not the output is meant for Windows or non-Windows users. # In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES # forces the Windows encoding (this is the default for the Windows binary), # whereas setting the tag to NO uses a Unix-style encoding (the default for # all platforms other than Windows). USE_WINDOWS_ENCODING = YES # If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will # include brief member descriptions after the members that are listed in # the file and class documentation (similar to JavaDoc). # Set to NO to disable this. BRIEF_MEMBER_DESC = YES # If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend # the brief description of a member or function before the detailed description. # Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the # brief descriptions will be completely suppressed. REPEAT_BRIEF = YES # This tag implements a quasi-intelligent brief description abbreviator # that is used to form the text in various listings. Each string # in this list, if found as the leading text of the brief description, will be # stripped from the text and the result after processing the whole list, is # used as the annotated text. Otherwise, the brief description is used as-is. # If left blank, the following values are used ("$name" is automatically # replaced with the name of the entity): "The $name class" "The $name widget" # "The $name file" "is" "provides" "specifies" "contains" # "represents" "a" "an" "the" ABBREVIATE_BRIEF = # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then # Doxygen will generate a detailed section even if there is only a brief # description. ALWAYS_DETAILED_SEC = NO # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all # inherited members of a class in the documentation of that class as if those # members were ordinary class members. Constructors, destructors and assignment # operators of the base classes will not be shown. INLINE_INHERITED_MEMB = NO # If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full # path before files name in the file list and in the header files. If set # to NO the shortest path that makes the file name unique will be used. FULL_PATH_NAMES = NO # If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag # can be used to strip a user-defined part of the path. Stripping is # only done if one of the specified strings matches the left-hand part of # the path. The tag can be used to show relative paths in the file list. # If left blank the directory from which doxygen is run is used as the # path to strip. STRIP_FROM_PATH = # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of # the path mentioned in the documentation of a class, which tells # the reader which header file to include in order to use a class. # If left blank only the name of the header file containing the class # definition is used. Otherwise one should specify the include paths that # are normally passed to the compiler using the -I flag. STRIP_FROM_INC_PATH = # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter # (but less readable) file names. This can be useful is your file systems # doesn't support long names like on DOS, Mac, or CD-ROM. SHORT_NAMES = NO # If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen # will interpret the first line (until the first dot) of a JavaDoc-style # comment as the brief description. If set to NO, the JavaDoc # comments will behave just like the Qt-style comments (thus requiring an # explicit @brief command for a brief description. JAVADOC_AUTOBRIEF = YES # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen # treat a multi-line C++ special comment block (i.e. a block of //! or /// # comments) as a brief description. This used to be the default behaviour. # The new default is to treat a multi-line C++ comment block as a detailed # description. Set this tag to YES if you prefer the old behaviour instead. MULTILINE_CPP_IS_BRIEF = NO # If the DETAILS_AT_TOP tag is set to YES then Doxygen # will output the detailed description near the top, like JavaDoc. # If set to NO, the detailed description appears after the member # documentation. DETAILS_AT_TOP = NO # If the INHERIT_DOCS tag is set to YES (the default) then an undocumented # member inherits the documentation from any documented member that it # re-implements. INHERIT_DOCS = YES # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC # tag is set to YES, then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. DISTRIBUTE_GROUP_DOC = NO # If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce # a new page for each member. If set to NO, the documentation of a member will # be part of the file/class/namespace that contains it. SEPARATE_MEMBER_PAGES = NO # The TAB_SIZE tag can be used to set the number of spaces in a tab. # Doxygen uses this value to replace tabs by spaces in code fragments. TAB_SIZE = 4 # This tag can be used to specify a number of aliases that acts # as commands in the documentation. An alias has the form "name=value". # For example adding "sideeffect=\par Side Effects:\n" will allow you to # put the command \sideeffect (or @sideeffect) in the documentation, which # will result in a user-defined paragraph with heading "Side Effects:". # You can put \n's in the value part of an alias to insert newlines. ALIASES = # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C # sources only. Doxygen will then generate output that is more tailored for C. # For instance, some of the names that are used will be different. The list # of all members will be omitted, etc. OPTIMIZE_OUTPUT_FOR_C = NO # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java sources # only. Doxygen will then generate output that is more tailored for Java. # For instance, namespaces will be presented as packages, qualified scopes # will look different, etc. OPTIMIZE_OUTPUT_JAVA = NO # Set the SUBGROUPING tag to YES (the default) to allow class member groups of # the same type (for instance a group of public functions) to be put as a # subgroup of that type (e.g. under the Public Functions section). Set it to # NO to prevent subgrouping. Alternatively, this can be done per class using # the \nosubgrouping command. SUBGROUPING = YES #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- # If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in # documentation are documented, even if no documentation was available. # Private class members and static file members will be hidden unless # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES EXTRACT_ALL = NO # If the EXTRACT_PRIVATE tag is set to YES all private members of a class # will be included in the documentation. EXTRACT_PRIVATE = NO # If the EXTRACT_STATIC tag is set to YES all static members of a file # will be included in the documentation. EXTRACT_STATIC = NO # If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) # defined locally in source files will be included in the documentation. # If set to NO only classes defined in header files are included. EXTRACT_LOCAL_CLASSES = YES # This flag is only useful for Objective-C code. When set to YES local # methods, which are defined in the implementation section but not in # the interface are included in the documentation. # If set to NO (the default) only methods in the interface are included. EXTRACT_LOCAL_METHODS = NO # If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all # undocumented members of documented classes, files or namespaces. # If set to NO (the default) these members will be included in the # various overviews, but no documentation section is generated. # This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_MEMBERS = YES # If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. # If set to NO (the default) these classes will be included in the various # overviews. This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_CLASSES = YES # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all # friend (class|struct|union) declarations. # If set to NO (the default) these declarations will be included in the # documentation. HIDE_FRIEND_COMPOUNDS = NO # If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any # documentation blocks found inside the body of a function. # If set to NO (the default) these blocks will be appended to the # function's detailed documentation block. HIDE_IN_BODY_DOCS = NO # The INTERNAL_DOCS tag determines if documentation # that is typed after a \internal command is included. If the tag is set # to NO (the default) then the documentation will be excluded. # Set it to YES to include the internal documentation. INTERNAL_DOCS = NO # If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate # file names in lower-case letters. If set to YES upper-case letters are also # allowed. This is useful if you have classes or files whose names only differ # in case and if your file system supports case sensitive file names. Windows # and Mac users are advised to set this option to NO. CASE_SENSE_NAMES = YES # If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen # will show members with their full class and namespace scopes in the # documentation. If set to YES the scope will be hidden. HIDE_SCOPE_NAMES = NO # If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen # will put a list of the files that are included by a file in the documentation # of that file. SHOW_INCLUDE_FILES = YES # If the INLINE_INFO tag is set to YES (the default) then a tag [inline] # is inserted in the documentation for inline members. INLINE_INFO = YES # If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen # will sort the (detailed) documentation of file and class members # alphabetically by member name. If set to NO the members will appear in # declaration order. SORT_MEMBER_DOCS = YES # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the # brief documentation of file, namespace and class members alphabetically # by member name. If set to NO (the default) the members will appear in # declaration order. SORT_BRIEF_DOCS = NO # If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be # sorted by fully-qualified names, including namespaces. If set to # NO (the default), the class list will be sorted only by class name, # not including the namespace part. # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. # Note: This option applies only to the class list, not to the # alphabetical list. SORT_BY_SCOPE_NAME = NO # The GENERATE_TODOLIST tag can be used to enable (YES) or # disable (NO) the todo list. This list is created by putting \todo # commands in the documentation. GENERATE_TODOLIST = YES # The GENERATE_TESTLIST tag can be used to enable (YES) or # disable (NO) the test list. This list is created by putting \test # commands in the documentation. GENERATE_TESTLIST = YES # The GENERATE_BUGLIST tag can be used to enable (YES) or # disable (NO) the bug list. This list is created by putting \bug # commands in the documentation. GENERATE_BUGLIST = YES # The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or # disable (NO) the deprecated list. This list is created by putting # \deprecated commands in the documentation. GENERATE_DEPRECATEDLIST= YES # The ENABLED_SECTIONS tag can be used to enable conditional # documentation sections, marked by \if sectionname ... \endif. ENABLED_SECTIONS = # The MAX_INITIALIZER_LINES tag determines the maximum number of lines # the initial value of a variable or define consists of for it to appear in # the documentation. If the initializer consists of more lines than specified # here it will be hidden. Use a value of 0 to hide initializers completely. # The appearance of the initializer of individual variables and defines in the # documentation can be controlled using \showinitializer or \hideinitializer # command in the documentation regardless of this setting. MAX_INITIALIZER_LINES = 30 # Set the SHOW_USED_FILES tag to NO to disable the list of files generated # at the bottom of the documentation of classes and structs. If set to YES the # list will mention the files that were used to generate the documentation. SHOW_USED_FILES = YES # If the sources in your project are distributed over multiple directories # then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy # in the documentation. SHOW_DIRECTORIES = YES # The FILE_VERSION_FILTER tag can be used to specify a program or script that # doxygen should invoke to get the current version for each file (typically from the # version control system). Doxygen will invoke the program by executing (via # popen()) the command , where is the value of # the FILE_VERSION_FILTER tag, and is the name of an input file # provided by doxygen. Whatever the progam writes to standard output # is used as the file version. See the manual for examples. FILE_VERSION_FILTER = #--------------------------------------------------------------------------- # configuration options related to warning and progress messages #--------------------------------------------------------------------------- # The QUIET tag can be used to turn on/off the messages that are generated # by doxygen. Possible values are YES and NO. If left blank NO is used. QUIET = YES # The WARNINGS tag can be used to turn on/off the warning messages that are # generated by doxygen. Possible values are YES and NO. If left blank # NO is used. WARNINGS = YES # If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings # for undocumented members. If EXTRACT_ALL is set to YES then this flag will # automatically be disabled. WARN_IF_UNDOCUMENTED = YES # If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for # potential errors in the documentation, such as not documenting some # parameters in a documented function, or documenting parameters that # don't exist or using markup commands wrongly. WARN_IF_DOC_ERROR = YES # This WARN_NO_PARAMDOC option can be abled to get warnings for # functions that are documented, but have no documentation for their parameters # or return value. If set to NO (the default) doxygen will only warn about # wrong or incomplete parameter documentation, but not about the absence of # documentation. WARN_NO_PARAMDOC = NO # The WARN_FORMAT tag determines the format of the warning messages that # doxygen can produce. The string should contain the $file, $line, and $text # tags, which will be replaced by the file and line number from which the # warning originated and the warning text. Optionally the format may contain # $version, which will be replaced by the version of the file (if it could # be obtained via FILE_VERSION_FILTER) WARN_FORMAT = "$file:$line: $text" # The WARN_LOGFILE tag can be used to specify a file to which warning # and error messages should be written. If left blank the output is written # to stderr. WARN_LOGFILE = #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- # The INPUT tag can be used to specify the files and/or directories that contain # documented source files. You may enter file names like "myfile.cpp" or # directories like "/usr/src/myproject". Separate the files or directories # with spaces. INPUT = . \ readme.txt \ tutorial_gettingStarted.txt \ tutorial_ticpp.txt # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank the following patterns are tested: # *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx # *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm FILE_PATTERNS = *.h # The RECURSIVE tag can be used to turn specify whether or not subdirectories # should be searched for input files as well. Possible values are YES and NO. # If left blank NO is used. RECURSIVE = NO # The EXCLUDE tag can be used to specify files and/or directories that should # excluded from the INPUT source files. This way you can easily exclude a # subdirectory from a directory tree whose root is specified with the INPUT tag. EXCLUDE = # The EXCLUDE_SYMLINKS tag can be used select whether or not files or # directories that are symbolic links (a Unix filesystem feature) are excluded # from the input. EXCLUDE_SYMLINKS = NO # If the value of the INPUT tag contains directories, you can use the # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude # certain files from those directories. EXCLUDE_PATTERNS = # The EXAMPLE_PATH tag can be used to specify one or more files or # directories that contain example code fragments that are included (see # the \include command). EXAMPLE_PATH = # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank all files are included. EXAMPLE_PATTERNS = # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be # searched for input files to be used with the \include or \dontinclude # commands irrespective of the value of the RECURSIVE tag. # Possible values are YES and NO. If left blank NO is used. EXAMPLE_RECURSIVE = NO # The IMAGE_PATH tag can be used to specify one or more files or # directories that contain image that are included in the documentation (see # the \image command). IMAGE_PATH = # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program # by executing (via popen()) the command , where # is the value of the INPUT_FILTER tag, and is the name of an # input file. Doxygen will then use the output that the filter program writes # to standard output. If FILTER_PATTERNS is specified, this tag will be # ignored. INPUT_FILTER = # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern # basis. Doxygen will compare the file name with each pattern and apply the # filter if there is a match. The filters are a list of the form: # pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further # info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER # is applied to all files. FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER) will be used to filter the input files when producing source # files to browse (i.e. when SOURCE_BROWSER is set to YES). FILTER_SOURCE_FILES = NO #--------------------------------------------------------------------------- # configuration options related to source browsing #--------------------------------------------------------------------------- # If the SOURCE_BROWSER tag is set to YES then a list of source files will # be generated. Documented entities will be cross-referenced with these sources. # Note: To get rid of all source code in the generated output, make sure also # VERBATIM_HEADERS is set to NO. SOURCE_BROWSER = NO # Setting the INLINE_SOURCES tag to YES will include the body # of functions and classes directly in the documentation. INLINE_SOURCES = NO # Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct # doxygen to hide any special comment blocks from generated source code # fragments. Normal C and C++ comments will always remain visible. STRIP_CODE_COMMENTS = YES # If the REFERENCED_BY_RELATION tag is set to YES (the default) # then for each documented function all documented # functions referencing it will be listed. REFERENCED_BY_RELATION = YES # If the REFERENCES_RELATION tag is set to YES (the default) # then for each documented function all documented entities # called/used by that function will be listed. REFERENCES_RELATION = YES # If the USE_HTAGS tag is set to YES then the references to source code # will point to the HTML generated by the htags(1) tool instead of doxygen # built-in source browser. The htags tool is part of GNU's global source # tagging system (see http://www.gnu.org/software/global/global.html). You # will need version 4.8.6 or higher. USE_HTAGS = NO # If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen # will generate a verbatim copy of the header file for each class for # which an include is specified. Set to NO to disable this. VERBATIM_HEADERS = YES #--------------------------------------------------------------------------- # configuration options related to the alphabetical class index #--------------------------------------------------------------------------- # If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index # of all compounds will be generated. Enable this if the project # contains a lot of classes, structs, unions or interfaces. ALPHABETICAL_INDEX = NO # If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then # the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns # in which this list will be split (can be a number in the range [1..20]) COLS_IN_ALPHA_INDEX = 5 # In case all classes in a project start with a common prefix, all # classes will be put under the same header in the alphabetical index. # The IGNORE_PREFIX tag can be used to specify one or more prefixes that # should be ignored while generating the index headers. IGNORE_PREFIX = #--------------------------------------------------------------------------- # configuration options related to the HTML output #--------------------------------------------------------------------------- # If the GENERATE_HTML tag is set to YES (the default) Doxygen will # generate HTML output. GENERATE_HTML = YES # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `html' will be used as the default path. HTML_OUTPUT = . # The HTML_FILE_EXTENSION tag can be used to specify the file extension for # each generated HTML page (for example: .htm,.php,.asp). If it is left blank # doxygen will generate files with .html extension. HTML_FILE_EXTENSION = .html # The HTML_HEADER tag can be used to specify a personal HTML header for # each generated HTML page. If it is left blank doxygen will generate a # standard header. HTML_HEADER = # The HTML_FOOTER tag can be used to specify a personal HTML footer for # each generated HTML page. If it is left blank doxygen will generate a # standard footer. HTML_FOOTER = # The HTML_STYLESHEET tag can be used to specify a user-defined cascading # style sheet that is used by each HTML page. It can be used to # fine-tune the look of the HTML output. If the tag is left blank doxygen # will generate a default style sheet. Note that doxygen will try to copy # the style sheet file to the HTML output directory, so don't put your own # stylesheet in the HTML output directory as well, or it will be erased! HTML_STYLESHEET = # If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, # files or namespaces will be aligned in HTML using tables. If set to # NO a bullet list will be used. HTML_ALIGN_MEMBERS = YES # If the GENERATE_HTMLHELP tag is set to YES, additional index files # will be generated that can be used as input for tools like the # Microsoft HTML help workshop to generate a compressed HTML help file (.chm) # of the generated HTML documentation. GENERATE_HTMLHELP = YES # If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can # be used to specify the file name of the resulting .chm file. You # can add a path in front of the file if the result should not be # written to the html output directory. CHM_FILE = TinyXML Help_v2.5.3.chm # If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can # be used to specify the location (absolute path including file name) of # the HTML help compiler (hhc.exe). If non-empty doxygen will try to run # the HTML help compiler on the generated index.hhp. HHC_LOCATION = "C:\Program Files\DocRunner\hhc.exe" # If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag # controls if a separate .chi index file is generated (YES) or that # it should be included in the master .chm file (NO). GENERATE_CHI = NO # If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag # controls whether a binary table of contents is generated (YES) or a # normal table of contents (NO) in the .chm file. BINARY_TOC = NO # The TOC_EXPAND flag can be set to YES to add extra items for group members # to the contents of the HTML help documentation and to the tree view. TOC_EXPAND = NO # The DISABLE_INDEX tag can be used to turn on/off the condensed index at # top of each HTML page. The value NO (the default) enables the index and # the value YES disables it. DISABLE_INDEX = NO # This tag can be used to set the number of enum values (range [1..20]) # that doxygen will group on one line in the generated HTML documentation. ENUM_VALUES_PER_LINE = 4 # If the GENERATE_TREEVIEW tag is set to YES, a side panel will be # generated containing a tree-like index structure (just like the one that # is generated for HTML Help). For this to work a browser that supports # JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, # Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are # probably better off using the HTML help feature. GENERATE_TREEVIEW = NO # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be # used to set the initial width (in pixels) of the frame in which the tree # is shown. TREEVIEW_WIDTH = 250 #--------------------------------------------------------------------------- # configuration options related to the LaTeX output #--------------------------------------------------------------------------- # If the GENERATE_LATEX tag is set to YES (the default) Doxygen will # generate Latex output. GENERATE_LATEX = NO # The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `latex' will be used as the default path. LATEX_OUTPUT = latex # The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be # invoked. If left blank `latex' will be used as the default command name. LATEX_CMD_NAME = latex # The MAKEINDEX_CMD_NAME tag can be used to specify the command name to # generate index for LaTeX. If left blank `makeindex' will be used as the # default command name. MAKEINDEX_CMD_NAME = makeindex # If the COMPACT_LATEX tag is set to YES Doxygen generates more compact # LaTeX documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_LATEX = NO # The PAPER_TYPE tag can be used to set the paper type that is used # by the printer. Possible values are: a4, a4wide, letter, legal and # executive. If left blank a4wide will be used. PAPER_TYPE = a4wide # The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX # packages that should be included in the LaTeX output. EXTRA_PACKAGES = # The LATEX_HEADER tag can be used to specify a personal LaTeX header for # the generated latex document. The header should contain everything until # the first chapter. If it is left blank doxygen will generate a # standard header. Notice: only use this tag if you know what you are doing! LATEX_HEADER = # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated # is prepared for conversion to pdf (using ps2pdf). The pdf file will # contain links (just like the HTML output) instead of page references # This makes the output suitable for online browsing using a pdf viewer. PDF_HYPERLINKS = NO # If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of # plain latex in the generated Makefile. Set this option to YES to get a # higher quality PDF documentation. USE_PDFLATEX = NO # If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. # command to the generated LaTeX files. This will instruct LaTeX to keep # running if errors occur, instead of asking the user for help. # This option is also used when generating formulas in HTML. LATEX_BATCHMODE = NO # If LATEX_HIDE_INDICES is set to YES then doxygen will not # include the index chapters (such as File Index, Compound Index, etc.) # in the output. LATEX_HIDE_INDICES = NO #--------------------------------------------------------------------------- # configuration options related to the RTF output #--------------------------------------------------------------------------- # If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output # The RTF output is optimized for Word 97 and may not look very pretty with # other RTF readers or editors. GENERATE_RTF = NO # The RTF_OUTPUT tag is used to specify where the RTF docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `rtf' will be used as the default path. RTF_OUTPUT = rtf # If the COMPACT_RTF tag is set to YES Doxygen generates more compact # RTF documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_RTF = NO # If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated # will contain hyperlink fields. The RTF file will # contain links (just like the HTML output) instead of page references. # This makes the output suitable for online browsing using WORD or other # programs which support those fields. # Note: wordpad (write) and others do not support links. RTF_HYPERLINKS = NO # Load stylesheet definitions from file. Syntax is similar to doxygen's # config file, i.e. a series of assignments. You only have to provide # replacements, missing definitions are set to their default value. RTF_STYLESHEET_FILE = # Set optional variables used in the generation of an rtf document. # Syntax is similar to doxygen's config file. RTF_EXTENSIONS_FILE = #--------------------------------------------------------------------------- # configuration options related to the man page output #--------------------------------------------------------------------------- # If the GENERATE_MAN tag is set to YES (the default) Doxygen will # generate man pages GENERATE_MAN = NO # The MAN_OUTPUT tag is used to specify where the man pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `man' will be used as the default path. MAN_OUTPUT = man # The MAN_EXTENSION tag determines the extension that is added to # the generated man pages (default is the subroutine's section .3) MAN_EXTENSION = .3 # If the MAN_LINKS tag is set to YES and Doxygen generates man output, # then it will generate one additional man file for each entity # documented in the real man page(s). These additional files # only source the real man page, but without them the man command # would be unable to find the correct page. The default is NO. MAN_LINKS = NO #--------------------------------------------------------------------------- # configuration options related to the XML output #--------------------------------------------------------------------------- # If the GENERATE_XML tag is set to YES Doxygen will # generate an XML file that captures the structure of # the code including all documentation. GENERATE_XML = NO # The XML_OUTPUT tag is used to specify where the XML pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `xml' will be used as the default path. XML_OUTPUT = xml # The XML_SCHEMA tag can be used to specify an XML schema, # which can be used by a validating XML parser to check the # syntax of the XML files. XML_SCHEMA = # The XML_DTD tag can be used to specify an XML DTD, # which can be used by a validating XML parser to check the # syntax of the XML files. XML_DTD = # If the XML_PROGRAMLISTING tag is set to YES Doxygen will # dump the program listings (including syntax highlighting # and cross-referencing information) to the XML output. Note that # enabling this will significantly increase the size of the XML output. XML_PROGRAMLISTING = YES #--------------------------------------------------------------------------- # configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- # If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will # generate an AutoGen Definitions (see autogen.sf.net) file # that captures the structure of the code including all # documentation. Note that this feature is still experimental # and incomplete at the moment. GENERATE_AUTOGEN_DEF = NO #--------------------------------------------------------------------------- # configuration options related to the Perl module output #--------------------------------------------------------------------------- # If the GENERATE_PERLMOD tag is set to YES Doxygen will # generate a Perl module file that captures the structure of # the code including all documentation. Note that this # feature is still experimental and incomplete at the # moment. GENERATE_PERLMOD = NO # If the PERLMOD_LATEX tag is set to YES Doxygen will generate # the necessary Makefile rules, Perl scripts and LaTeX code to be able # to generate PDF and DVI output from the Perl module output. PERLMOD_LATEX = NO # If the PERLMOD_PRETTY tag is set to YES the Perl module output will be # nicely formatted so it can be parsed by a human reader. This is useful # if you want to understand what is going on. On the other hand, if this # tag is set to NO the size of the Perl module output will be much smaller # and Perl will parse it just the same. PERLMOD_PRETTY = YES # The names of the make variables in the generated doxyrules.make file # are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. # This is useful so different doxyrules.make files included by the same # Makefile don't overwrite each other's variables. PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the preprocessor #--------------------------------------------------------------------------- # If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will # evaluate all C-preprocessor directives found in the sources and include # files. ENABLE_PREPROCESSING = NO # If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro # names in the source code. If set to NO (the default) only conditional # compilation will be performed. Macro expansion can be done in a controlled # way by setting EXPAND_ONLY_PREDEF to YES. MACRO_EXPANSION = NO # If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES # then the macro expansion is limited to the macros specified with the # PREDEFINED and EXPAND_AS_PREDEFINED tags. EXPAND_ONLY_PREDEF = NO # If the SEARCH_INCLUDES tag is set to YES (the default) the includes files # in the INCLUDE_PATH (see below) will be search if a #include is found. SEARCH_INCLUDES = YES # The INCLUDE_PATH tag can be used to specify one or more directories that # contain include files that are not input files but should be processed by # the preprocessor. INCLUDE_PATH = # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # patterns (like *.h and *.hpp) to filter out the header-files in the # directories. If left blank, the patterns specified with FILE_PATTERNS will # be used. INCLUDE_FILE_PATTERNS = # The PREDEFINED tag can be used to specify one or more macro names that # are defined before the preprocessor is started (similar to the -D option of # gcc). The argument of the tag is a list of macros of the form: name # or name=definition (no spaces). If the definition and the = are # omitted =1 is assumed. To prevent a macro definition from being # undefined via #undef or recursively expanded use the := operator # instead of the = operator. PREDEFINED = # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then # this tag can be used to specify a list of macro names that should be expanded. # The macro definition that is found in the sources will be used. # Use the PREDEFINED tag if you want to use a different macro definition. EXPAND_AS_DEFINED = # If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then # doxygen's preprocessor will remove all function-like macros that are alone # on a line, have an all uppercase name, and do not end with a semicolon. Such # function macros are typically used for boiler-plate code, and will confuse # the parser if not removed. SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- # Configuration::additions related to external references #--------------------------------------------------------------------------- # The TAGFILES option can be used to specify one or more tagfiles. # Optionally an initial location of the external documentation # can be added for each tagfile. The format of a tag file without # this location is as follows: # TAGFILES = file1 file2 ... # Adding location for the tag files is done as follows: # TAGFILES = file1=loc1 "file2 = loc2" ... # where "loc1" and "loc2" can be relative or absolute paths or # URLs. If a location is present for each tag, the installdox tool # does not have to be run to correct the links. # Note that each tag file must have a unique name # (where the name does NOT include the path) # If a tag file is not located in the directory in which doxygen # is run, you must also specify the path to the tagfile here. TAGFILES = # When a file name is specified after GENERATE_TAGFILE, doxygen will create # a tag file that is based on the input files it reads. GENERATE_TAGFILE = # If the ALLEXTERNALS tag is set to YES all external classes will be listed # in the class index. If set to NO only the inherited external classes # will be listed. ALLEXTERNALS = NO # If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed # in the modules index. If set to NO, only the current project's groups will # be listed. EXTERNAL_GROUPS = YES # The PERL_PATH should be the absolute path and name of the perl script # interpreter (i.e. the result of `which perl'). PERL_PATH = /usr/bin/perl #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- # If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will # generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base # or super classes. Setting the tag to NO turns the diagrams off. Note that # this option is superseded by the HAVE_DOT option below. This is only a # fallback. It is recommended to install and use dot, since it yields more # powerful graphs. CLASS_DIAGRAMS = YES # If set to YES, the inheritance and collaboration graphs will hide # inheritance and usage relations if the target is undocumented # or is not a class. HIDE_UNDOC_RELATIONS = YES # If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is # available from the path. This tool is part of Graphviz, a graph visualization # toolkit from AT&T and Lucent Bell Labs. The other options in this section # have no effect if this option is set to NO (the default) HAVE_DOT = NO # If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect inheritance relations. Setting this tag to YES will force the # the CLASS_DIAGRAMS tag to NO. CLASS_GRAPH = YES # If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect implementation dependencies (inheritance, containment, and # class references variables) of the class with other documented classes. COLLABORATION_GRAPH = YES # If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen # will generate a graph for groups, showing the direct groups dependencies GROUP_GRAPHS = YES # If the UML_LOOK tag is set to YES doxygen will generate inheritance and # collaboration diagrams in a style similar to the OMG's Unified Modeling # Language. UML_LOOK = NO # If set to YES, the inheritance and collaboration graphs will show the # relations between templates and their instances. TEMPLATE_RELATIONS = NO # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT # tags are set to YES then doxygen will generate a graph for each documented # file showing the direct and indirect include dependencies of the file with # other documented files. INCLUDE_GRAPH = YES # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and # HAVE_DOT tags are set to YES then doxygen will generate a graph for each # documented header file showing the documented files that directly or # indirectly include this file. INCLUDED_BY_GRAPH = YES # If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will # generate a call dependency graph for every global function or class method. # Note that enabling this option will significantly increase the time of a run. # So in most cases it will be better to enable call graphs for selected # functions only using the \callgraph command. CALL_GRAPH = NO # If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen # will graphical hierarchy of all classes instead of a textual one. GRAPHICAL_HIERARCHY = YES # If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES # then doxygen will show the dependencies a directory has on other directories # in a graphical way. The dependency relations are determined by the #include # relations between the files in the directories. DIRECTORY_GRAPH = YES # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images # generated by dot. Possible values are png, jpg, or gif # If left blank png will be used. DOT_IMAGE_FORMAT = png # The tag DOT_PATH can be used to specify the path where the dot tool can be # found. If left blank, it is assumed the dot tool can be found in the path. DOT_PATH = # The DOTFILE_DIRS tag can be used to specify one or more directories that # contain dot files that are included in the documentation (see the # \dotfile command). DOTFILE_DIRS = # The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width # (in pixels) of the graphs generated by dot. If a graph becomes larger than # this value, doxygen will try to truncate the graph, so that it fits within # the specified constraint. Beware that most browsers cannot cope with very # large images. MAX_DOT_GRAPH_WIDTH = 1024 # The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height # (in pixels) of the graphs generated by dot. If a graph becomes larger than # this value, doxygen will try to truncate the graph, so that it fits within # the specified constraint. Beware that most browsers cannot cope with very # large images. MAX_DOT_GRAPH_HEIGHT = 1024 # The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the # graphs generated by dot. A depth value of 3 means that only nodes reachable # from the root by following a path via at most 3 edges will be shown. Nodes # that lay further from the root node will be omitted. Note that setting this # option to 1 or 2 may greatly reduce the computation time needed for large # code bases. Also note that a graph may be further truncated if the graph's # image dimensions are not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH # and MAX_DOT_GRAPH_HEIGHT). If 0 is used for the depth value (the default), # the graph is not depth-constrained. MAX_DOT_GRAPH_DEPTH = 0 # Set the DOT_TRANSPARENT tag to YES to generate images with a transparent # background. This is disabled by default, which results in a white background. # Warning: Depending on the platform used, enabling this option may lead to # badly anti-aliased labels on the edges of a graph (i.e. they become hard to # read). DOT_TRANSPARENT = NO # Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output # files in one run (i.e. multiple -o and -T options on the command line). This # makes dot run faster, but since only newer versions of dot (>1.8.10) # support this, this feature is disabled by default. DOT_MULTI_TARGETS = NO # If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will # generate a legend page explaining the meaning of the various boxes and # arrows in the dot generated graphs. GENERATE_LEGEND = YES # If the DOT_CLEANUP tag is set to YES (the default) Doxygen will # remove the intermediate dot files that are used to generate # the various graphs. DOT_CLEANUP = YES #--------------------------------------------------------------------------- # Configuration::additions related to the search engine #--------------------------------------------------------------------------- # The SEARCHENGINE tag specifies whether or not a search engine should be # used. If set to NO the values of all tags below this one will be ignored. SEARCHENGINE = NOwxformbuilder-3.1.59/sdk/tinyxml/tutorial_gettingStarted.txt0000644000175000017500000004666411143440026024730 0ustar rrmulderrrmulder/** @page tutorial0 TinyXML Tutorial

What is this?

This tutorial has a few tips and suggestions on how to use TinyXML effectively. I've also tried to include some C++ tips like how to convert strings to integers and vice versa. This isn't anything to do with TinyXML itself, but it may helpful for your project so I've put it in anyway. If you don't know basic C++ concepts this tutorial won't be useful. Likewise if you don't know what a DOM is, look elsewhere first.

Before we start

Some example XML datasets/files will be used. example1.xml: @verbatim World @endverbatim example2.xml: @verbatim Alas Great World Alas (again) @endverbatim example3.xml: @verbatim @endverbatim example4.xml @verbatim Welcome to MyApp Thank you for using MyApp @endverbatim

Getting Started

Load XML from a file

The simplest way to load a file into a TinyXML DOM is: @verbatim TiXmlDocument doc( "demo.xml" ); doc.LoadFile(); @endverbatim A more real-world usage is shown below. This will load the file and display the contents to STDOUT: @verbatim // load the named file and dump its structure to STDOUT void dump_to_stdout(const char* pFilename) { TiXmlDocument doc(pFilename); bool loadOkay = doc.LoadFile(); if (loadOkay) { printf("\n%s:\n", pFilename); dump_to_stdout( &doc ); // defined later in the tutorial } else { printf("Failed to load file \"%s\"\n", pFilename); } } @endverbatim A simple demonstration of this function is to use a main like this: @verbatim int main(void) { dump_to_stdout("example1.xml"); return 0; } @endverbatim Recall that Example 1 XML is: @verbatim World @endverbatim Running the program with this XML will display this in the console/DOS window: @verbatim DOCUMENT + DECLARATION + ELEMENT Hello + TEXT[World] @endverbatim The ``dump_to_stdout`` function is defined later in this tutorial and is useful if you want to understand recursive traversal of a DOM.

Building Documents Programatically

This is how to build Example 1 pragmatically: @verbatim void build_simple_doc( ) { // Make xml: World TiXmlDocument doc; TiXmlDeclaration * decl = new TiXmlDeclaration( "1.0", "", "" ); TiXmlElement * element = new TiXmlElement( "Hello" ); TiXmlText * text = new TiXmlText( "World" ); element->LinkEndChild( text ); doc.LinkEndChild( decl ); doc.LinkEndChild( element ); doc.SaveFile( "madeByHand.xml" ); } @endverbatim This can be loaded and displayed on the console with: @verbatim dump_to_stdout("madeByHand.xml"); // this func defined later in the tutorial @endverbatim and you'll see it is identical to Example 1: @verbatim madeByHand.xml: Document + Declaration + Element [Hello] + Text: [World] @endverbatim This code produces exactly the same XML DOM but it shows a different ordering to node creation and linking: @verbatim void write_simple_doc2( ) { // same as write_simple_doc1 but add each node // as early as possible into the tree. TiXmlDocument doc; TiXmlDeclaration * decl = new TiXmlDeclaration( "1.0", "", "" ); doc.LinkEndChild( decl ); TiXmlElement * element = new TiXmlElement( "Hello" ); doc.LinkEndChild( element ); TiXmlText * text = new TiXmlText( "World" ); element->LinkEndChild( text ); doc.SaveFile( "madeByHand2.xml" ); } @endverbatim Both of these produce the same XML, namely: @verbatim World @endverbatim Or in structure form: @verbatim DOCUMENT + DECLARATION + ELEMENT Hello + TEXT[World] @endverbatim

Attributes

Given an existing node, settings attributes is easy: @verbatim window = new TiXmlElement( "Demo" ); window->SetAttribute("name", "Circle"); window->SetAttribute("x", 5); window->SetAttribute("y", 15); window->SetDoubleAttribute("radius", 3.14159); @endverbatim You can it also work with the TiXmlAttribute objects if you want. The following code shows one way (not the only way) to get all attributes of an element, print the name and string value, and if the value can be converted to an integer or double, print that value too: @verbatim // print all attributes of pElement. // returns the number of attributes printed int dump_attribs_to_stdout(TiXmlElement* pElement, unsigned int indent) { if ( !pElement ) return 0; TiXmlAttribute* pAttrib=pElement->FirstAttribute(); int i=0; int ival; double dval; const char* pIndent=getIndent(indent); printf("\n"); while (pAttrib) { printf( "%s%s: value=[%s]", pIndent, pAttrib->Name(), pAttrib->Value()); if (pAttrib->QueryIntValue(&ival)==TIXML_SUCCESS) printf( " int=%d", ival); if (pAttrib->QueryDoubleValue(&dval)==TIXML_SUCCESS) printf( " d=%1.1f", dval); printf( "\n" ); i++; pAttrib=pAttrib->Next(); } return i; } @endverbatim

Writing a document to a file

Writing a pre-built DOM to a file is trivial: @verbatim doc.SaveFile( saveFilename ); @endverbatim Recall, for example, example 4: @verbatim Welcome to MyApp Thank you for using MyApp @endverbatim The following function builds this DOM and writes the file "appsettings.xml": @verbatim void write_app_settings_doc( ) { TiXmlDocument doc; TiXmlElement* msg; TiXmlDeclaration* decl = new TiXmlDeclaration( "1.0", "", "" ); doc.LinkEndChild( decl ); TiXmlElement * root = new TiXmlElement( "MyApp" ); doc.LinkEndChild( root ); TiXmlComment * comment = new TiXmlComment(); comment->SetValue(" Settings for MyApp " ); root->LinkEndChild( comment ); TiXmlElement * msgs = new TiXmlElement( "Messages" ); root->LinkEndChild( msgs ); msg = new TiXmlElement( "Welcome" ); msg->LinkEndChild( new TiXmlText( "Welcome to MyApp" )); msgs->LinkEndChild( msg ); msg = new TiXmlElement( "Farewell" ); msg->LinkEndChild( new TiXmlText( "Thank you for using MyApp" )); msgs->LinkEndChild( msg ); TiXmlElement * windows = new TiXmlElement( "Windows" ); root->LinkEndChild( windows ); TiXmlElement * window; window = new TiXmlElement( "Window" ); windows->LinkEndChild( window ); window->SetAttribute("name", "MainFrame"); window->SetAttribute("x", 5); window->SetAttribute("y", 15); window->SetAttribute("w", 400); window->SetAttribute("h", 250); TiXmlElement * cxn = new TiXmlElement( "Connection" ); root->LinkEndChild( cxn ); cxn->SetAttribute("ip", "192.168.0.1"); cxn->SetDoubleAttribute("timeout", 123.456); // floating point attrib dump_to_stdout( &doc ); doc.SaveFile( "appsettings.xml" ); } @endverbatim The dump_to_stdout function will show this structure: @verbatim Document + Declaration + Element [MyApp] (No attributes) + Comment: [ Settings for MyApp ] + Element [Messages] (No attributes) + Element [Welcome] (No attributes) + Text: [Welcome to MyApp] + Element [Farewell] (No attributes) + Text: [Thank you for using MyApp] + Element [Windows] (No attributes) + Element [Window] + name: value=[MainFrame] + x: value=[5] int=5 d=5.0 + y: value=[15] int=15 d=15.0 + w: value=[400] int=400 d=400.0 + h: value=[250] int=250 d=250.0 5 attributes + Element [Connection] + ip: value=[192.168.0.1] int=192 d=192.2 + timeout: value=[123.456000] int=123 d=123.5 2 attributes @endverbatim I was surprised that TinyXml, by default, writes the XML in what other APIs call a "pretty" format - it modifies the whitespace of text of elements that contain other nodes so that writing the tree includes an indication of nesting level. I haven't looked yet to see if there is a way to turn off indenting when writing a file - its bound to be easy. [Lee: It's easy in STL mode, just use cout << myDoc. Non-STL mode is always in "pretty" format. Adding a switch would be a nice feature and has been requested.]

XML to/from C++ objects

Intro

This example assumes you're loading and saving your app settings in an XML file, e.g. something like example4.xml. There are a number of ways to do this. For example, look into the TinyBind project at http://sourceforge.net/projects/tinybind This section shows a plain-old approach to loading and saving a basic object structure using XML.

Set up your object classes

Start off with some basic classes like these: @verbatim #include #include using namespace std; typedef std::map MessageMap; // a basic window abstraction - demo purposes only class WindowSettings { public: int x,y,w,h; string name; WindowSettings() : x(0), y(0), w(100), h(100), name("Untitled") { } WindowSettings(int x, int y, int w, int h, const string& name) { this->x=x; this->y=y; this->w=w; this->h=h; this->name=name; } }; class ConnectionSettings { public: string ip; double timeout; }; class AppSettings { public: string m_name; MessageMap m_messages; list m_windows; ConnectionSettings m_connection; AppSettings() {} void save(const char* pFilename); void load(const char* pFilename); // just to show how to do it void setDemoValues() { m_name="MyApp"; m_messages.clear(); m_messages["Welcome"]="Welcome to "+m_name; m_messages["Farewell"]="Thank you for using "+m_name; m_windows.clear(); m_windows.push_back(WindowSettings(15,15,400,250,"Main")); m_connection.ip="Unknown"; m_connection.timeout=123.456; } }; @endverbatim This is a basic main() that shows how to create a default settings object tree, save it and load it again: @verbatim int main(void) { AppSettings settings; settings.save("appsettings2.xml"); settings.load("appsettings2.xml"); return 0; } @endverbatim The following main() shows creation, modification, saving and then loading of a settings structure: @verbatim int main(void) { // block: customise and save settings { AppSettings settings; settings.m_name="HitchHikerApp"; settings.m_messages["Welcome"]="Don't Panic"; settings.m_messages["Farewell"]="Thanks for all the fish"; settings.m_windows.push_back(WindowSettings(15,25,300,250,"BookFrame")); settings.m_connection.ip="192.168.0.77"; settings.m_connection.timeout=42.0; settings.save("appsettings2.xml"); } // block: load settings { AppSettings settings; settings.load("appsettings2.xml"); printf("%s: %s\n", settings.m_name.c_str(), settings.m_messages["Welcome"].c_str()); WindowSettings & w=settings.m_windows.front(); printf("%s: Show window '%s' at %d,%d (%d x %d)\n", settings.m_name.c_str(), w.name.c_str(), w.x, w.y, w.w, w.h); printf("%s: %s\n", settings.m_name.c_str(), settings.m_messages["Farewell"].c_str()); } return 0; } @endverbatim When the save() and load() are completed (see below), running this main() displays on the console: @verbatim HitchHikerApp: Don't Panic HitchHikerApp: Show window 'BookFrame' at 15,25 (300 x 100) HitchHikerApp: Thanks for all the fish @endverbatim

Encode C++ state as XML

There are lots of different ways to approach saving this to a file. Here's one: @verbatim void AppSettings::save(const char* pFilename) { TiXmlDocument doc; TiXmlElement* msg; TiXmlComment * comment; string s; TiXmlDeclaration* decl = new TiXmlDeclaration( "1.0", "", "" ); doc.LinkEndChild( decl ); TiXmlElement * root = new TiXmlElement(m_name.c_str()); doc.LinkEndChild( root ); comment = new TiXmlComment(); s=" Settings for "+m_name+" "; comment->SetValue(s.c_str()); root->LinkEndChild( comment ); // block: messages { MessageMap::iterator iter; TiXmlElement * msgs = new TiXmlElement( "Messages" ); root->LinkEndChild( msgs ); for (iter=m_messages.begin(); iter != m_messages.end(); iter++) { const string & key=(*iter).first; const string & value=(*iter).second; msg = new TiXmlElement(key.c_str()); msg->LinkEndChild( new TiXmlText(value.c_str())); msgs->LinkEndChild( msg ); } } // block: windows { TiXmlElement * windowsNode = new TiXmlElement( "Windows" ); root->LinkEndChild( windowsNode ); list::iterator iter; for (iter=m_windows.begin(); iter != m_windows.end(); iter++) { const WindowSettings& w=*iter; TiXmlElement * window; window = new TiXmlElement( "Window" ); windowsNode->LinkEndChild( window ); window->SetAttribute("name", w.name.c_str()); window->SetAttribute("x", w.x); window->SetAttribute("y", w.y); window->SetAttribute("w", w.w); window->SetAttribute("h", w.h); } } // block: connection { TiXmlElement * cxn = new TiXmlElement( "Connection" ); root->LinkEndChild( cxn ); cxn->SetAttribute("ip", m_connection.ip.c_str()); cxn->SetDoubleAttribute("timeout", m_connection.timeout); } doc.SaveFile(pFilename); } @endverbatim Running this with the modified main produces this file: @verbatim Thanks for all the fish Don't Panic @endverbatim

Decoding state from XML

As with encoding objects, there are a number of approaches to decoding XML into your own C++ object structure. The following approach uses TiXmlHandles. @verbatim void AppSettings::load(const char* pFilename) { TiXmlDocument doc(pFilename); if (!doc.LoadFile()) return; TiXmlHandle hDoc(&doc); TiXmlElement* pElem; TiXmlHandle hRoot(0); // block: name { pElem=hDoc.FirstChildElement().Element(); // should always have a valid root but handle gracefully if it does if (!pElem) return; m_name=pElem->Value(); // save this for later hRoot=TiXmlHandle(pElem); } // block: string table { m_messages.clear(); // trash existing table pElem=hRoot.FirstChild( "Messages" ).FirstChild().Element(); for( pElem; pElem; pElem=pElem->NextSiblingElement()) { const char *pKey=pElem->Value(); const char *pText=pElem->GetText(); if (pKey && pText) { m_messages[pKey]=pText; } } } // block: windows { m_windows.clear(); // trash existing list TiXmlElement* pWindowNode=hRoot.FirstChild( "Windows" ).FirstChild().Element(); for( pWindowNode; pWindowNode; pWindowNode=pWindowNode->NextSiblingElement()) { WindowSettings w; const char *pName=pWindowNode->Attribute("name"); if (pName) w.name=pName; pWindowNode->QueryIntAttribute("x", &w.x); // If this fails, original value is left as-is pWindowNode->QueryIntAttribute("y", &w.y); pWindowNode->QueryIntAttribute("w", &w.w); pWindowNode->QueryIntAttribute("hh", &w.h); m_windows.push_back(w); } } // block: connection { pElem=hRoot.FirstChild("Connection").Element(); if (pElem) { m_connection.ip=pElem->Attribute("ip"); pElem->QueryDoubleAttribute("timeout",&m_connection.timeout); } } } @endverbatim

Full listing for dump_to_stdout

Below is a copy-and-paste demo program for loading arbitrary XML files and dumping the structure to STDOUT using the recursive traversal listed above. @verbatim // tutorial demo program #include "stdafx.h" #include "tinyxml.h" // ---------------------------------------------------------------------- // STDOUT dump and indenting utility functions // ---------------------------------------------------------------------- const unsigned int NUM_INDENTS_PER_SPACE=2; const char * getIndent( unsigned int numIndents ) { static const char * pINDENT=" + "; static const unsigned int LENGTH=strlen( pINDENT ); unsigned int n=numIndents*NUM_INDENTS_PER_SPACE; if ( n > LENGTH ) n = LENGTH; return &pINDENT[ LENGTH-n ]; } // same as getIndent but no "+" at the end const char * getIndentAlt( unsigned int numIndents ) { static const char * pINDENT=" "; static const unsigned int LENGTH=strlen( pINDENT ); unsigned int n=numIndents*NUM_INDENTS_PER_SPACE; if ( n > LENGTH ) n = LENGTH; return &pINDENT[ LENGTH-n ]; } int dump_attribs_to_stdout(TiXmlElement* pElement, unsigned int indent) { if ( !pElement ) return 0; TiXmlAttribute* pAttrib=pElement->FirstAttribute(); int i=0; int ival; double dval; const char* pIndent=getIndent(indent); printf("\n"); while (pAttrib) { printf( "%s%s: value=[%s]", pIndent, pAttrib->Name(), pAttrib->Value()); if (pAttrib->QueryIntValue(&ival)==TIXML_SUCCESS) printf( " int=%d", ival); if (pAttrib->QueryDoubleValue(&dval)==TIXML_SUCCESS) printf( " d=%1.1f", dval); printf( "\n" ); i++; pAttrib=pAttrib->Next(); } return i; } void dump_to_stdout( TiXmlNode* pParent, unsigned int indent = 0 ) { if ( !pParent ) return; TiXmlNode* pChild; TiXmlText* pText; int t = pParent->Type(); printf( "%s", getIndent(indent)); int num; switch ( t ) { case TiXmlNode::DOCUMENT: printf( "Document" ); break; case TiXmlNode::ELEMENT: printf( "Element [%s]", pParent->Value() ); num=dump_attribs_to_stdout(pParent->ToElement(), indent+1); switch(num) { case 0: printf( " (No attributes)"); break; case 1: printf( "%s1 attribute", getIndentAlt(indent)); break; default: printf( "%s%d attributes", getIndentAlt(indent), num); break; } break; case TiXmlNode::COMMENT: printf( "Comment: [%s]", pParent->Value()); break; case TiXmlNode::UNKNOWN: printf( "Unknown" ); break; case TiXmlNode::TEXT: pText = pParent->ToText(); printf( "Text: [%s]", pText->Value() ); break; case TiXmlNode::DECLARATION: printf( "Declaration" ); break; default: break; } printf( "\n" ); for ( pChild = pParent->FirstChild(); pChild != 0; pChild = pChild->NextSibling()) { dump_to_stdout( pChild, indent+1 ); } } // load the named file and dump its structure to STDOUT void dump_to_stdout(const char* pFilename) { TiXmlDocument doc(pFilename); bool loadOkay = doc.LoadFile(); if (loadOkay) { printf("\n%s:\n", pFilename); dump_to_stdout( &doc ); // defined later in the tutorial } else { printf("Failed to load file \"%s\"\n", pFilename); } } // ---------------------------------------------------------------------- // main() for printing files named on the command line // ---------------------------------------------------------------------- int main(int argc, char* argv[]) { for (int i=1; i Debug\tinyxml_1.exe example1.xml example1.xml: Document + Declaration + Element [Hello] (No attributes) + Text: [World] @endverbatim Authors and Changes
  • Written by Ellers, April, May, June 2005
  • Minor edits and integration into doc system, Lee Thomason September 2005
  • Updated by Ellers, October 2005
*/ wxformbuilder-3.1.59/sdk/tinyxml/Makefile0000644000175000017500000000602711143440026020701 0ustar rrmulderrrmulder# C++ Static Library Makefile autogenerated by premake # Don't edit this file! Instead edit `premake.lua` then rerun `make` ifndef CONFIG CONFIG=Release endif ifeq ($(CONFIG),Release) BINDIR := ../lib LIBDIR := ../lib OBJDIR := .obj/Release OUTDIR := ../lib CPPFLAGS := -MMD -D "TIXML_USE_TICPP" -D "UNICODE" -D "_UNICODE" -D "NDEBUG" CFLAGS += $(CPPFLAGS) $(TARGET_ARCH) -O3 -Wall -fPIC CXXFLAGS := $(CFLAGS) LDFLAGS += -L$(BINDIR) -L$(LIBDIR) -s LDDEPS := RESFLAGS := -D "TIXML_USE_TICPP" -D "UNICODE" -D "_UNICODE" -D "NDEBUG" TARGET := libticpp.a BLDCMD = ar -rcs $(OUTDIR)/$(TARGET) $(OBJECTS) $(TARGET_ARCH) endif ifeq ($(CONFIG),Debug) BINDIR := ../lib LIBDIR := ../lib OBJDIR := .obj/Debug OUTDIR := ../lib CPPFLAGS := -MMD -D "TIXML_USE_TICPP" -D "UNICODE" -D "_UNICODE" -D "DEBUG" -D "_DEBUG" CFLAGS += $(CPPFLAGS) $(TARGET_ARCH) -g -Wall -fPIC -O0 CXXFLAGS := $(CFLAGS) LDFLAGS += -L$(BINDIR) -L$(LIBDIR) LDDEPS := RESFLAGS := -D "TIXML_USE_TICPP" -D "UNICODE" -D "_UNICODE" -D "DEBUG" -D "_DEBUG" TARGET := libticppd.a BLDCMD = ar -rcs $(OUTDIR)/$(TARGET) $(OBJECTS) $(TARGET_ARCH) endif OBJECTS := \ $(OBJDIR)/tinyxmlerror.o \ $(OBJDIR)/tinystr.o \ $(OBJDIR)/ticpp.o \ $(OBJDIR)/tinyxml.o \ $(OBJDIR)/tinyxmlparser.o \ MKDIR_TYPE := msdos CMD := $(subst \,\\,$(ComSpec)$(COMSPEC)) ifeq (,$(CMD)) MKDIR_TYPE := posix endif ifeq (/bin/sh.exe,$(SHELL)) MKDIR_TYPE := posix endif ifeq ($(MKDIR_TYPE),posix) CMD_MKBINDIR := mkdir -p $(BINDIR) CMD_MKLIBDIR := mkdir -p $(LIBDIR) CMD_MKOUTDIR := mkdir -p $(OUTDIR) CMD_MKOBJDIR := mkdir -p $(OBJDIR) else CMD_MKBINDIR := $(CMD) /c if not exist $(subst /,\\,$(BINDIR)) mkdir $(subst /,\\,$(BINDIR)) CMD_MKLIBDIR := $(CMD) /c if not exist $(subst /,\\,$(LIBDIR)) mkdir $(subst /,\\,$(LIBDIR)) CMD_MKOUTDIR := $(CMD) /c if not exist $(subst /,\\,$(OUTDIR)) mkdir $(subst /,\\,$(OUTDIR)) CMD_MKOBJDIR := $(CMD) /c if not exist $(subst /,\\,$(OBJDIR)) mkdir $(subst /,\\,$(OBJDIR)) endif .PHONY: clean $(OUTDIR)/$(TARGET): $(OBJECTS) $(LDDEPS) $(RESOURCES) @echo Linking TiCPP -@$(CMD_MKBINDIR) -@$(CMD_MKLIBDIR) -@$(CMD_MKOUTDIR) @$(BLDCMD) clean: @echo Cleaning TiCPP ifeq ($(MKDIR_TYPE),posix) -@rm -f $(OUTDIR)/$(TARGET) -@rm -rf $(OBJDIR) else -@if exist $(subst /,\,$(OUTDIR)/$(TARGET)) del /q $(subst /,\,$(OUTDIR)/$(TARGET)) -@if exist $(subst /,\,$(OBJDIR)) del /q $(subst /,\,$(OBJDIR)) -@if exist $(subst /,\,$(OBJDIR)) rmdir /s /q $(subst /,\,$(OBJDIR)) endif $(OBJDIR)/tinyxmlerror.o: tinyxmlerror.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/tinystr.o: tinystr.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/ticpp.o: ticpp.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/tinyxml.o: tinyxml.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/tinyxmlparser.o: tinyxmlparser.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -include $(OBJECTS:%.o=%.d) wxformbuilder-3.1.59/sdk/tinyxml/ticpp.cpp0000644000175000017500000006107111143440026021064 0ustar rrmulderrrmulder/* http://code.google.com/p/ticpp/ Copyright (c) 2006 Ryan Pusztai, Ryan Mulder Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifdef TIXML_USE_TICPP #include "ticpp.h" #include "ticpprc.h" #include "tinyxml.h" #include using namespace ticpp; // In the following Visitor functions, casting away const should be safe, as the object can only be referred to by a const & bool Visitor::VisitEnter( const TiXmlDocument& doc ) { return VisitEnter( Document( const_cast< TiXmlDocument* >( &doc ) ) ); } bool Visitor::VisitExit( const TiXmlDocument& doc ) { return VisitEnter( Document( const_cast< TiXmlDocument* >( &doc ) ) ); } bool Visitor::VisitEnter( const TiXmlElement& element, const TiXmlAttribute* firstAttribute ) { if ( 0 != firstAttribute ) { Attribute attribute( const_cast< TiXmlAttribute* >( firstAttribute ) ); return VisitEnter( Element( const_cast< TiXmlElement* >( &element ) ), &attribute ); } else { return VisitEnter( Element( const_cast< TiXmlElement* >( &element ) ), 0 ); } } bool Visitor::VisitExit( const TiXmlElement& element ) { return VisitExit( Element( const_cast< TiXmlElement* >( &element ) ) ); } bool Visitor::Visit( const TiXmlDeclaration& declaration ) { return Visit( Declaration( const_cast< TiXmlDeclaration* >( &declaration ) ) ); } bool Visitor::Visit( const TiXmlStylesheetReference& stylesheet ) { return Visit( StylesheetReference( const_cast< TiXmlStylesheetReference* >( &stylesheet ) ) ); } bool Visitor::Visit( const TiXmlText& text ) { return Visit( Text( const_cast< TiXmlText* >( &text ) ) ); } bool Visitor::Visit( const TiXmlComment& comment ) { return Visit( Comment( const_cast< TiXmlComment* >( &comment ) ) ); } Attribute::Attribute() { SetTiXmlPointer( new TiXmlAttribute() ); m_impRC->InitRef(); } Attribute::Attribute( TiXmlAttribute* attribute ) { SetTiXmlPointer( attribute ); m_impRC->IncRef(); } Attribute::Attribute( const std::string& name, const std::string& value ) { SetTiXmlPointer( new TiXmlAttribute( name, value ) ); m_impRC->InitRef(); } void Attribute::operator=( const Attribute& copy ) { // Dropping the reference to the old object this->m_impRC->DecRef(); // Pointing to the new Object SetTiXmlPointer( copy.m_tiXmlPointer ); // The internal tixml pointer changed in the above line this->m_impRC->IncRef(); } Attribute::Attribute( const Attribute& copy ) : Base() { // Dropping the reference to the old object this->m_impRC->DecRef(); // Pointing to the new Object SetTiXmlPointer( copy.m_tiXmlPointer ); // The internal tixml pointer changed in the above line this->m_impRC->IncRef(); } Attribute::~Attribute() { m_impRC->DecRef(); } std::string Attribute::Value() const { ValidatePointer(); return m_tiXmlPointer->ValueStr(); } std::string Attribute::Name() const { ValidatePointer(); return m_tiXmlPointer->Name(); } Attribute* Attribute::Next( bool throwIfNoAttribute ) const { ValidatePointer(); TiXmlAttribute* attribute = m_tiXmlPointer->Next(); if ( 0 == attribute ) { if ( throwIfNoAttribute ) { TICPPTHROW( "No more attributes found" ) } else { return 0; } } Attribute* temp = new Attribute( attribute ); attribute->m_spawnedWrappers.push_back( temp ); return temp; } Attribute* Attribute::Previous( bool throwIfNoAttribute ) const { ValidatePointer(); TiXmlAttribute* attribute = m_tiXmlPointer->Previous(); if ( 0 == attribute ) { if ( throwIfNoAttribute ) { TICPPTHROW( "No more attributes found" ) } else { return 0; } } Attribute* temp = new Attribute( attribute ); attribute->m_spawnedWrappers.push_back( temp ); return temp; } void Attribute::IterateNext( const std::string&, Attribute** next ) const { *next = Next( false ); } void Attribute::IteratePrevious( const std::string&, Attribute** previous ) const { *previous = Previous( false ); } void Attribute::Print( FILE* file, int depth ) const { ValidatePointer(); m_tiXmlPointer->Print( file, depth ); } void Attribute::SetTiXmlPointer( TiXmlAttribute* newPointer ) { m_tiXmlPointer = newPointer; SetImpRC( newPointer ); } //***************************************************************************** Node* Node::NodeFactory( TiXmlNode* tiXmlNode, bool throwIfNull, bool rememberSpawnedWrapper ) const { if ( 0 == tiXmlNode ) { if ( throwIfNull ) { TICPPTHROW( "tiXmlNode is NULL" ) } else { return 0; } } Node* temp; switch ( tiXmlNode->Type() ) { case TiXmlNode::DOCUMENT: temp = new Document( tiXmlNode->ToDocument() ); break; case TiXmlNode::ELEMENT: temp = new Element( tiXmlNode->ToElement() ); break; case TiXmlNode::COMMENT: temp = new Comment( tiXmlNode->ToComment() ); break; case TiXmlNode::TEXT: temp = new Text( tiXmlNode->ToText() ); break; case TiXmlNode::DECLARATION: temp = new Declaration( tiXmlNode->ToDeclaration() ); break; case TiXmlNode::STYLESHEETREFERENCE: temp = new StylesheetReference( tiXmlNode->ToStylesheetReference() ); break; default: TICPPTHROW( "Type is unsupported" ) } if ( rememberSpawnedWrapper ) { tiXmlNode->m_spawnedWrappers.push_back( temp ); } return temp; } std::string Node::Value() const { return GetTiXmlPointer()->ValueStr(); } void Node::Clear() { GetTiXmlPointer()->Clear(); } Node* Node::Parent( bool throwIfNoParent ) const { TiXmlNode* parent = GetTiXmlPointer()->Parent(); if ( ( 0 == parent ) && throwIfNoParent ) { TICPPTHROW( "No parent exists" ); } return NodeFactory( parent, false ); } Node* Node::FirstChild( bool throwIfNoChildren ) const { return FirstChild( "", throwIfNoChildren ); } Node* Node::FirstChild( const std::string& value, bool throwIfNoChildren ) const { return FirstChild( value.c_str(), throwIfNoChildren ); } Node* Node::FirstChild( const char* value, bool throwIfNoChildren ) const { TiXmlNode* childNode; if ( 0 == strlen( value ) ) { childNode = GetTiXmlPointer()->FirstChild(); } else { childNode = GetTiXmlPointer()->FirstChild( value ); } if ( ( 0 == childNode ) && throwIfNoChildren ) { TICPPTHROW( "Child with the value of \"" << value << "\" not found" ); } return NodeFactory( childNode, false ); } Node* Node::LastChild( bool throwIfNoChildren ) const { return LastChild( "", throwIfNoChildren ); } Node* Node::LastChild( const std::string& value, bool throwIfNoChildren ) const { return LastChild( value.c_str(), throwIfNoChildren ); } Node* Node::LastChild( const char* value, bool throwIfNoChildren ) const { TiXmlNode* childNode; if ( 0 == strlen( value ) ) { childNode = GetTiXmlPointer()->LastChild(); } else { childNode = GetTiXmlPointer()->LastChild( value ); } if ( ( 0 == childNode ) && throwIfNoChildren ) { TICPPTHROW( "Child with the value of \"" << value << "\" not found" ); } return NodeFactory( childNode, false ); } Node* Node::IterateChildren ( Node* previous ) const { TiXmlNode* pointer; if ( 0 == previous ) { pointer = GetTiXmlPointer()->IterateChildren( 0 ); } else { pointer = GetTiXmlPointer()->IterateChildren( previous->GetTiXmlPointer() ); } return NodeFactory( pointer, false ); } Node* Node::IterateChildren( const std::string& value, Node* previous ) const { TiXmlNode* pointer; if ( 0 == previous ) { pointer = GetTiXmlPointer()->IterateChildren( value, 0 ); } else { pointer = GetTiXmlPointer()->IterateChildren( value, previous->GetTiXmlPointer() ); } return NodeFactory( pointer, false ); } Node* Node::InsertEndChild( Node& addThis ) { if ( addThis.Type() == TiXmlNode::DOCUMENT ) { TICPPTHROW( "Node is a Document and can't be inserted" ); } TiXmlNode* pointer = GetTiXmlPointer()->InsertEndChild( *addThis.GetTiXmlPointer() ); if ( 0 == pointer ) { TICPPTHROW( "Node can't be inserted" ); } return NodeFactory( pointer ); } Node* Node::LinkEndChild( Node* childNode ) { if ( childNode->Type() == TiXmlNode::DOCUMENT ) { TICPPTHROW( "Node is a Document and can't be linked" ); } // Increment reference count when adding to the tree childNode->m_impRC->IncRef(); if ( 0 == GetTiXmlPointer()->LinkEndChild( childNode->GetTiXmlPointer() ) ) { TICPPTHROW( "Node can't be linked" ); } return childNode; } Node* Node::InsertBeforeChild( Node* beforeThis, Node& addThis ) { if ( addThis.Type() == TiXmlNode::DOCUMENT ) { TICPPTHROW( "Node is a Document and can't be inserted" ); } // Increment reference count when adding to the tree addThis.m_impRC->IncRef(); TiXmlNode* pointer = GetTiXmlPointer()->InsertBeforeChild( beforeThis->GetTiXmlPointer(), *addThis.GetTiXmlPointer() ); if ( 0 == pointer ) { TICPPTHROW( "Node can't be inserted" ); } return NodeFactory( pointer ); } Node* Node::InsertAfterChild( Node* afterThis, Node& addThis ) { if ( addThis.Type() == TiXmlNode::DOCUMENT ) { TICPPTHROW( "Node is a Document and can't be inserted" ); } // Increment reference count when adding to the tree addThis.m_impRC->IncRef(); TiXmlNode* pointer = GetTiXmlPointer()->InsertAfterChild( afterThis->GetTiXmlPointer(), *addThis.GetTiXmlPointer() ); if ( 0 == pointer ) { TICPPTHROW( "Node can't be inserted" ); } return NodeFactory( pointer ); } Node* Node::ReplaceChild( Node* replaceThis, Node& withThis ) { if ( withThis.Type() == TiXmlNode::DOCUMENT ) { TICPPTHROW( "Node is a Document and can't be inserted" ); } // Increment reference count when adding to the tree withThis.m_impRC->IncRef(); TiXmlNode* pointer = GetTiXmlPointer()->ReplaceChild( replaceThis->GetTiXmlPointer(), *withThis.GetTiXmlPointer() ); if ( 0 == pointer ) { TICPPTHROW( "Node can't be inserted" ); } return NodeFactory( pointer ); } void Node::RemoveChild( Node* removeThis ) { if ( !GetTiXmlPointer()->RemoveChild( removeThis->GetTiXmlPointer() ) ) { TICPPTHROW( "Node to remove (" << removeThis->Value() << ") is not a child of this Node (" << Value() << ")" ) } } Node* Node::PreviousSibling( bool throwIfNoSiblings ) const { return PreviousSibling( "", throwIfNoSiblings ); } Node* Node::PreviousSibling( const std::string& value, bool throwIfNoSiblings ) const { return PreviousSibling( value.c_str(), throwIfNoSiblings ); } Node* Node::PreviousSibling( const char* value, bool throwIfNoSiblings ) const { TiXmlNode* sibling; if ( 0 == strlen( value ) ) { sibling = GetTiXmlPointer()->PreviousSibling(); } else { sibling = GetTiXmlPointer()->PreviousSibling( value ); } if ( ( 0 == sibling ) && throwIfNoSiblings ) { TICPPTHROW( "No Siblings found with value, '" << value << "', Prior to this Node (" << Value() << ")" ) } return NodeFactory( sibling, false ); } Node* Node::NextSibling( bool throwIfNoSiblings ) const { return NextSibling( "", throwIfNoSiblings ); } Node* Node::NextSibling( const std::string& value, bool throwIfNoSiblings ) const { return NextSibling( value.c_str(), throwIfNoSiblings ); } Node* Node::NextSibling( const char* value, bool throwIfNoSiblings ) const { TiXmlNode* sibling; if ( 0 == strlen( value ) ) { sibling = GetTiXmlPointer()->NextSibling(); } else { sibling = GetTiXmlPointer()->NextSibling( value ); } if ( ( 0 == sibling ) && throwIfNoSiblings ) { TICPPTHROW( "No Siblings found with value, '" << value << "', After this Node (" << Value() << ")" ) } return NodeFactory( sibling, false ); } Element* Node::NextSiblingElement( bool throwIfNoSiblings ) const { return NextSiblingElement( "", throwIfNoSiblings ); } Element* Node::NextSiblingElement( const std::string& value, bool throwIfNoSiblings ) const { return NextSiblingElement( value.c_str(), throwIfNoSiblings ); } Element* Node::NextSiblingElement( const char* value, bool throwIfNoSiblings ) const { TiXmlElement* sibling; if ( 0 == strlen( value ) ) { sibling = GetTiXmlPointer()->NextSiblingElement(); } else { sibling = GetTiXmlPointer()->NextSiblingElement( value ); } if ( 0 == sibling ) { if ( throwIfNoSiblings ) { TICPPTHROW( "No Element Siblings found with value, '" << value << "', After this Node (" << Value() << ")" ) } else { return 0; } } Element* temp = new Element( sibling ); sibling->m_spawnedWrappers.push_back( temp ); return temp; } Element* Node::FirstChildElement( bool throwIfNoChildren ) const { return FirstChildElement( "", throwIfNoChildren ); } Element* Node::FirstChildElement( const std::string& value, bool throwIfNoChildren ) const { return FirstChildElement( value.c_str(), throwIfNoChildren ); } Element* Node::FirstChildElement( const char* value, bool throwIfNoChildren ) const { TiXmlElement* element; if ( 0 == strlen( value ) ) { element = GetTiXmlPointer()->FirstChildElement(); } else { element = GetTiXmlPointer()->FirstChildElement( value ); } if ( 0 == element ) { if( throwIfNoChildren ) { TICPPTHROW( "Element (" << Value() << ") does NOT contain a child with the value of '" << value << "'" ) } else { return 0; } } Element* temp = new Element( element ); element->m_spawnedWrappers.push_back( temp ); return temp; } int Node::Type() const { return GetTiXmlPointer()->Type(); } Document* Node::GetDocument( bool throwIfNoDocument ) const { TiXmlDocument* doc = GetTiXmlPointer()->GetDocument(); if ( 0 == doc ) { if( throwIfNoDocument ) { TICPPTHROW( "This node (" << Value() << ") is not linked under a document" ) } else { return 0; } } Document* temp = new Document( doc ); doc->m_spawnedWrappers.push_back( temp ); return temp; } bool Node::NoChildren() const { return GetTiXmlPointer()->NoChildren(); } Document* Node::ToDocument() const { TiXmlDocument* doc = GetTiXmlPointer()->ToDocument(); if ( 0 == doc ) { TICPPTHROW( "This node (" << Value() << ") is not a Document" ) } Document* temp = new Document( doc ); doc->m_spawnedWrappers.push_back( temp ); return temp; } Element* Node::ToElement() const { TiXmlElement* doc = GetTiXmlPointer()->ToElement(); if ( 0 == doc ) { TICPPTHROW( "This node (" << Value() << ") is not a Element" ) } Element* temp = new Element( doc ); doc->m_spawnedWrappers.push_back( temp ); return temp; } Comment* Node::ToComment() const { TiXmlComment* doc = GetTiXmlPointer()->ToComment(); if ( 0 == doc ) { TICPPTHROW( "This node (" << Value() << ") is not a Comment" ) } Comment* temp = new Comment( doc ); doc->m_spawnedWrappers.push_back( temp ); return temp; } Text* Node::ToText() const { TiXmlText* doc = GetTiXmlPointer()->ToText(); if ( 0 == doc ) { TICPPTHROW( "This node (" << Value() << ") is not a Text" ) } Text* temp = new Text( doc ); doc->m_spawnedWrappers.push_back( temp ); return temp; } Declaration* Node::ToDeclaration() const { TiXmlDeclaration* doc = GetTiXmlPointer()->ToDeclaration(); if ( 0 == doc ) { TICPPTHROW( "This node (" << Value() << ") is not a Declaration" ) } Declaration* temp = new Declaration( doc ); doc->m_spawnedWrappers.push_back( temp ); return temp; } StylesheetReference* Node::ToStylesheetReference() const { TiXmlStylesheetReference* doc = GetTiXmlPointer()->ToStylesheetReference(); if ( 0 == doc ) { TICPPTHROW( "This node (" << Value() << ") is not a StylesheetReference" ) } StylesheetReference* temp = new StylesheetReference( doc ); doc->m_spawnedWrappers.push_back( temp ); return temp; } std::auto_ptr< Node > Node::Clone() const { TiXmlNode* node = GetTiXmlPointer()->Clone(); if ( 0 == node ) { TICPPTHROW( "Node could not be cloned" ); } std::auto_ptr< Node > temp( NodeFactory( node, false, false ) ); // Take ownership of the memory from TiXml temp->m_impRC->InitRef(); return temp; } bool Node::Accept( TiXmlVisitor* visitor ) const { return GetTiXmlPointer()->Accept( visitor ); } //***************************************************************************** Comment::Comment() : NodeImp< TiXmlComment >( new TiXmlComment() ) { m_impRC->InitRef(); } Comment::Comment( TiXmlComment* comment ) : NodeImp< TiXmlComment >( comment ) { } Comment::Comment( const std::string& comment ) : NodeImp< TiXmlComment >( new TiXmlComment() ) { m_impRC->InitRef(); m_tiXmlPointer->SetValue( comment ); } //***************************************************************************** Text::Text() : NodeImp< TiXmlText >( new TiXmlText("") ) { m_impRC->InitRef(); } Text::Text( const std::string& value ) : NodeImp< TiXmlText >( new TiXmlText( value ) ) { m_impRC->InitRef(); } Text::Text( TiXmlText* text ) : NodeImp< TiXmlText >( text ) { } //***************************************************************************** Document::Document() : NodeImp< TiXmlDocument >( new TiXmlDocument() ) { m_impRC->InitRef(); } Document::Document( TiXmlDocument* document ) : NodeImp< TiXmlDocument >( document ) { } Document::Document( const char* documentName ) : NodeImp< TiXmlDocument >( new TiXmlDocument( documentName ) ) { m_impRC->InitRef(); } Document::Document( const std::string& documentName ) : NodeImp< TiXmlDocument >( new TiXmlDocument( documentName ) ) { m_impRC->InitRef(); } void Document::LoadFile( TiXmlEncoding encoding ) { if ( !m_tiXmlPointer->LoadFile( encoding ) ) { TICPPTHROW( "Couldn't load " << m_tiXmlPointer->Value() ); } } void Document::SaveFile( void ) const { if ( !m_tiXmlPointer->SaveFile() ) { TICPPTHROW( "Couldn't save " << m_tiXmlPointer->Value() ); } } void Document::LoadFile( const std::string& filename, TiXmlEncoding encoding ) { if ( !m_tiXmlPointer->LoadFile( filename.c_str(), encoding ) ) { TICPPTHROW( "Couldn't load " << filename ); } } void Document::LoadFile( const char* filename, TiXmlEncoding encoding ) { if ( !m_tiXmlPointer->LoadFile( filename, encoding ) ) { TICPPTHROW( "Couldn't load " << filename ); } } void Document::SaveFile( const std::string& filename ) const { if ( !m_tiXmlPointer->SaveFile( filename.c_str() ) ) { TICPPTHROW( "Couldn't save " << filename ); } } void Document::Parse( const std::string& xml, bool throwIfParseError, TiXmlEncoding encoding ) { m_tiXmlPointer->Parse( xml.c_str(), 0, encoding ); if( throwIfParseError && m_tiXmlPointer->Error() ) { TICPPTHROW( "Error parsing xml." ); } } //***************************************************************************** Element::Element() : NodeImp< TiXmlElement >( new TiXmlElement( "DefaultValueCausedByCreatingAnElementWithNoParameters" ) ) { m_impRC->InitRef(); } Element::Element( const std::string& value ) : NodeImp< TiXmlElement >( new TiXmlElement( value ) ) { m_impRC->InitRef(); } Element::Element( const char* value ) : NodeImp< TiXmlElement >( new TiXmlElement( value ) ) { m_impRC->InitRef(); } Element::Element( TiXmlElement* element ) : NodeImp< TiXmlElement >( element ) { } Attribute* Element::FirstAttribute( bool throwIfNoAttributes ) const { ValidatePointer(); TiXmlAttribute* attribute = m_tiXmlPointer->FirstAttribute(); if ( ( 0 == attribute ) && throwIfNoAttributes ) { TICPPTHROW( "This Element (" << Value() << ") has no attributes" ) } if ( 0 == attribute ) { if( throwIfNoAttributes ) { TICPPTHROW( "Element (" << Value() << ") has no attributes" ) } else { return 0; } } Attribute* temp = new Attribute( attribute ); attribute->m_spawnedWrappers.push_back( temp ); return temp; } Attribute* Element::LastAttribute( bool throwIfNoAttributes ) const { ValidatePointer(); TiXmlAttribute* attribute = m_tiXmlPointer->LastAttribute(); if ( ( 0 == attribute ) && throwIfNoAttributes ) { TICPPTHROW( "This Element (" << Value() << ") has no attributes" ) } if ( 0 == attribute ) { if( throwIfNoAttributes ) { TICPPTHROW( "Element (" << Value() << ") has no attributes" ) } else { return 0; } } Attribute* temp = new Attribute( attribute ); attribute->m_spawnedWrappers.push_back( temp ); return temp; } std::string Element::GetAttributeOrDefault( const std::string& name, const std::string& defaultValue ) const { std::string value; if ( !GetAttributeImp( name, &value ) ) { return defaultValue; } return value; } std::string Element::GetAttribute( const std::string& name ) const { return GetAttributeOrDefault( name, std::string() ); } bool Element::HasAttribute( const std::string& name ) const { ValidatePointer(); return ( 0 != m_tiXmlPointer->Attribute( name.c_str() ) ); } void Element::RemoveAttribute( const std::string& name ) { ValidatePointer(); m_tiXmlPointer->RemoveAttribute( name.c_str() ); } bool Element::GetAttributeImp( const std::string& name, std::string* value ) const { ValidatePointer(); // Get value from TinyXML, if the attribute exists const char* retVal = m_tiXmlPointer->Attribute( name.c_str() ); // TinyXML returns NULL if the attribute doesn't exist if ( 0 == retVal ) { return false; } else { *value = retVal; return true; } } bool Element::GetTextImp( std::string* value ) const { ValidatePointer(); // Get value from TinyXML, if the attribute exists const char* retVal = m_tiXmlPointer->GetText(); // TinyXML returns NULL if the attribute doesn't exist if ( 0 == retVal ) { return false; } else { *value = retVal; return true; } } //***************************************************************************** Declaration::Declaration() : NodeImp< TiXmlDeclaration >( new TiXmlDeclaration() ) { m_impRC->InitRef(); } Declaration::Declaration( TiXmlDeclaration* declaration ) : NodeImp< TiXmlDeclaration >( declaration ) { } Declaration::Declaration( const std::string& version, const std::string& encoding, const std::string& standalone ) : NodeImp< TiXmlDeclaration >( new TiXmlDeclaration( version, encoding, standalone ) ) { m_impRC->InitRef(); } std::string Declaration::Version() const { return m_tiXmlPointer->Version(); } std::string Declaration::Encoding() const { return m_tiXmlPointer->Encoding(); } std::string Declaration::Standalone() const { return m_tiXmlPointer->Standalone(); } //***************************************************************************** StylesheetReference::StylesheetReference() : NodeImp< TiXmlStylesheetReference >( new TiXmlStylesheetReference() ) { m_impRC->InitRef(); } StylesheetReference::StylesheetReference( TiXmlStylesheetReference* stylesheetReference ) : NodeImp< TiXmlStylesheetReference >( stylesheetReference ) { } StylesheetReference::StylesheetReference( const std::string& type, const std::string& href ) : NodeImp< TiXmlStylesheetReference >( new TiXmlStylesheetReference( type, href ) ) { m_impRC->InitRef(); } std::string StylesheetReference::Type() const { return m_tiXmlPointer->Type(); } std::string StylesheetReference::Href() const { return m_tiXmlPointer->Href(); } //***************************************************************************** Exception::Exception(const std::string &details) : m_details( details ) { } Exception::~Exception() throw() { } const char* Exception::what() const throw() { return m_details.c_str(); } //***************************************************************************** TiCppRC::TiCppRC() { // Spawn reference counter for this object m_tiRC = new TiCppRCImp( this ); } void TiCppRC::DeleteSpawnedWrappers() { std::vector< Base* >::reverse_iterator wrapper; for ( wrapper = m_spawnedWrappers.rbegin(); wrapper != m_spawnedWrappers.rend(); ++wrapper ) { delete *wrapper; } m_spawnedWrappers.clear(); } TiCppRC::~TiCppRC() { DeleteSpawnedWrappers(); // Set pointer held by reference counter to NULL this->m_tiRC->Nullify(); // Decrement reference - so reference counter will delete itself if necessary this->m_tiRC->DecRef(); } //***************************************************************************** TiCppRCImp::TiCppRCImp( TiCppRC* tiCppRC ) : m_count( 1 ), m_tiCppRC ( tiCppRC ) { } void TiCppRCImp::IncRef() { m_count++; } void TiCppRCImp::DecRef() { m_count--; if ( 0 == m_count ) { delete m_tiCppRC; delete this; } } void TiCppRCImp::InitRef() { m_count = 1; } void TiCppRCImp::Nullify() { m_tiCppRC = 0; } TiCppRC* TiCppRCImp::Get() { return m_tiCppRC; } bool TiCppRCImp::IsNull() { return 0 == m_tiCppRC; } #endif // TIXML_USE_TICPP wxformbuilder-3.1.59/sdk/tinyxml/tinystr.cpp0000644000175000017500000000505211143440026021456 0ustar rrmulderrrmulder/* www.sourceforge.net/projects/tinyxml Original file by Yves Berquin. This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ /* * THIS FILE WAS ALTERED BY Tyge Lvset, 7. April 2005. */ #ifndef TIXML_USE_STL #include "tinystr.h" // Error value for find primitive const TiXmlString::size_type TiXmlString::npos = static_cast< TiXmlString::size_type >(-1); // Null rep. TiXmlString::Rep TiXmlString::nullrep_ = { 0, 0, { '\0' } }; void TiXmlString::reserve (size_type cap) { if (cap > capacity()) { TiXmlString tmp; tmp.init(length(), cap); memcpy(tmp.start(), data(), length()); swap(tmp); } } TiXmlString& TiXmlString::assign(const char* str, size_type len) { size_type cap = capacity(); if (len > cap || cap > 3*(len + 8)) { TiXmlString tmp; tmp.init(len); memcpy(tmp.start(), str, len); swap(tmp); } else { memmove(start(), str, len); set_size(len); } return *this; } TiXmlString& TiXmlString::append(const char* str, size_type len) { size_type newsize = length() + len; if (newsize > capacity()) { reserve (newsize + capacity()); } memmove(finish(), str, len); set_size(newsize); return *this; } TiXmlString operator + (const TiXmlString & a, const TiXmlString & b) { TiXmlString tmp; tmp.reserve(a.length() + b.length()); tmp += a; tmp += b; return tmp; } TiXmlString operator + (const TiXmlString & a, const char* b) { TiXmlString tmp; TiXmlString::size_type b_len = static_cast( strlen(b) ); tmp.reserve(a.length() + b_len); tmp += a; tmp.append(b, b_len); return tmp; } TiXmlString operator + (const char* a, const TiXmlString & b) { TiXmlString tmp; TiXmlString::size_type a_len = static_cast( strlen(a) ); tmp.reserve(a_len + b.length()); tmp.append(a, a_len); tmp += b; return tmp; } #endif // TIXML_USE_STL wxformbuilder-3.1.59/sdk/tinyxml/tinyxmlerror.cpp0000644000175000017500000000342211143440026022517 0ustar rrmulderrrmulder/* www.sourceforge.net/projects/tinyxml Original code (2.0 and earlier )copyright (c) 2000-2006 Lee Thomason (www.grinninglizard.com) This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ #include "tinyxml.h" // The goal of the seperate error file is to make the first // step towards localization. tinyxml (currently) only supports // english error messages, but the could now be translated. // // It also cleans up the code a bit. // const char* TiXmlBase::errorString[ TIXML_ERROR_STRING_COUNT ] = { "No error", "Error", "Failed to open file", "Memory allocation failed.", "Error parsing Element.", "Failed to read Element name", "Error reading Element value.", "Error reading Attributes.", "Error: empty tag.", "Error reading end tag.", "Error parsing Unknown.", "Error parsing Comment.", "Error parsing Declaration.", "Error document empty.", "Error null (0) or unexpected EOF found in input stream.", "Error parsing CDATA.", "Error when TiXmlDocument added to document, because TiXmlDocument can only be at the root.", }; wxformbuilder-3.1.59/sdk/tinyxml/tutorial_ticpp.txt0000644000175000017500000001314711143440026023045 0ustar rrmulderrrmulder/** @page ticppTutorial TinyXML++ Tutorial Take a look here @subpage ticpp This is a work in progress. @page ticpp TinyXML++

General Concepts

The TinyXML++ classes are all wrappers around the corresponding classes within TinyXML. There is no reason to create TinyXML++ objects on the heap, using @p new, because the memory is managed for you. If you choose to use @p new to create TinyXML++ objects, you will @b always need to use @p delete to clean up. Basically, TinyXML++ objects are just wrappers around TinyXML pointers.

Goals

- Simplify the use and interface of TinyXml, using C++ concepts. - Use exceptions for error handling, so there are no return codes to check - Use templates for automatic type conversion - Use STL style iterators to move through nodes and attributes

Details

Use exceptions for error handling

When using the original TinyXML, every function returns a value indicating success or failure. A programmer would have to check that value to ensure the function succeeded. Example: @code // Load a document TiXmlDocument doc( pFilename ); if ( !doc.LoadFile() ) return; // Get a node TiXmlElement* pElem = doc.FirstChildElement(); if ( !pElem ) return; // Get the node we want pElem = pElem->NextSibling(); if ( !pElem ) return; // do something useful here @endcode An alternative was to use TiXmlHandle, which allows for function chaining by checking the intermediate function return values: Example: @code // Load a document TiXmlDocument doc(pFilename); if (!doc.LoadFile()) return; // Make a document handle TiXmlHandle hDoc(&doc); // Get an element by using the handle to chain calls // Note the conversion of the TiXmlHandle to the TiXmlElement* - .Element() TiXmlElement* pElem = hDoc.FirstChildElement().NextSibling().Element(); if ( !pElem ) return; // do something useful here @endcode With TinyXML++, if there is an error during a function call, it throws an exception. This means that a programmer can assume that every function is successful, as long as the functions are enclosed in a try-catch block. Example: @code try { // Load a document ticpp::Document doc( pFilename ); doc.LoadFile(); // Get an element by chaining calls - no return values to check, no TiXmlHandle ticpp::Element* pElem = doc.FirstChildElement()->NextSibling(); // do something useful here } catch( ticpp::Exception& ex ) { // If any function has an error, execution will enter here. // Report the error std::cout << ex.what(); } @endcode

Use templates for automatic type conversion

When using TinyXML, a programmer either needs to convert values to and from strings, or choose from one of many overloads to get the value in the desired type. Example: @code // Load a document TiXmlDocument doc( pFilename ); if ( !doc.LoadFile() ) return; // Get a node TiXmlElement* pElem = doc.FirstChildElement(); if ( !pElem ) return; // Get the node we want pElem = pElem->NextSibling(); if ( !pElem ) return; // Get the attribute as a string, convert to int const char* pszAttr = pElem->Attribute( "myAttribute" ); int attr = atoi( pszAttr ); // Get the attribute as an int int attr2; if ( TIXML_SUCCESS != pElem->QueryIntAttribute( "myAttribute", &attr2 ) ) { return; } // Get the attribute as a double double attr3; if ( TIXML_SUCCESS != pElem->QueryDoubleAttribute( "myAttribute", &attr3 ) ) { return; } // Get the attribute as a float float attr4; if ( TIXML_SUCCESS != pElem->QueryFloatAttribute( "myAttribute", &attr4 ) ) { return; } @endcode TinyXML++ uses templates for automatic type conversion. Example: @code try { // Load a document ticpp::Document doc( pFilename ); doc.LoadFile(); // Get an element by chaining calls - no return values to check, no TiXmlHandle ticpp::Element* pElem = doc.FirstChildElement()->NextSibling(); // GetAttribute can determine the type of the pointer, and convert automatically // Get the attribute as a string std::string attr; pElem->GetAttribute( "myAttribute", &attr ); // Get the attribute as an int int attr2; pElem->GetAttribute( "myAttribute", &attr2 ); // Get the attribute as an float float attr3; pElem->GetAttribute( "myAttribute", &attr3 ); // Get the attribute as an double double attr4; pElem->GetAttribute( "myAttribute", &attr4 ); // Get the attribute as an bool bool attr5; pElem->GetAttribute( "myAttribute", &attr5 ); } catch( ticpp::Exception& ex ) { // If any function has an error, execution will enter here. // Report the error std::cout << ex.what(); } @endcode

Use STL style iterators to move through nodes and attributes

TinyXML has two ways to iterate: First Method: @code for( child = parent->FirstChild( false ); child; child = child->NextSibling( false ) ) @endcode Second Method: @code child = 0; while( child = parent->IterateChildren( child ) ) @endcode Although both methods work quite well, the syntax is not familiar. TinyXML++ introduces iterators: @code ticpp::Iterator< ticpp::Node > child; for ( child = child.begin( parent ); child != child.end(); child++ ) @endcode Iterators have the added advantage of filtering by type: @code // Only iterates through Comment nodes ticpp::Iterator< ticpp::Comment > child; for ( child = child.begin( parent ); child != child.end(); child++ ) @endcode @code // Only iterates through Element nodes with value "ElementValue" ticpp::Iterator< ticpp::Element > child( "ElementValue" ); for ( child = child.begin( parent ); child != child.end(); child++ ) @endcode Finally, Iterators also work with Attributes @code ticpp::Iterator< ticpp::Attribute > attribute; for ( attribute = attribute.begin( element ); attribute != attribute.end(); attribute++ ) @endcode */ wxformbuilder-3.1.59/sdk/tinyxml/tinyxml.h0000644000175000017500000020343711143440026021122 0ustar rrmulderrrmulder/* www.sourceforge.net/projects/tinyxml Original code (2.0 and earlier )copyright (c) 2000-2006 Lee Thomason (www.grinninglizard.com) This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ #ifndef TINYXML_INCLUDED #define TINYXML_INCLUDED #ifdef _MSC_VER #pragma warning( push ) #pragma warning( disable : 4530 ) #pragma warning( disable : 4786 ) #endif #include #include #include #include #include // Help out windows: #if defined( _DEBUG ) && !defined( DEBUG ) #define DEBUG #endif #ifdef TIXML_USE_TICPP #ifndef TIXML_USE_STL #define TIXML_USE_STL #endif #endif #ifdef TIXML_USE_STL #include #include #include #define TIXML_STRING std::string #else #include "tinystr.h" #define TIXML_STRING TiXmlString #endif // Deprecated library function hell. Compilers want to use the // new safe versions. This probably doesn't fully address the problem, // but it gets closer. There are too many compilers for me to fully // test. If you get compilation troubles, undefine TIXML_SAFE #define TIXML_SAFE #ifdef TIXML_SAFE #if defined(_MSC_VER) && (_MSC_VER >= 1400 ) // Microsoft visual studio, version 2005 and higher. #define TIXML_SNPRINTF _snprintf_s #define TIXML_SNSCANF _snscanf_s #define TIXML_SSCANF sscanf_s #elif defined(_MSC_VER) && (_MSC_VER >= 1200 ) // Microsoft visual studio, version 6 and higher. //#pragma message( "Using _sn* functions." ) #define TIXML_SNPRINTF _snprintf #define TIXML_SNSCANF _snscanf #define TIXML_SSCANF sscanf #elif defined(__GNUC__) && (__GNUC__ >= 3 ) // GCC version 3 and higher.s //#warning( "Using sn* functions." ) #define TIXML_SNPRINTF snprintf #define TIXML_SNSCANF snscanf #define TIXML_SSCANF sscanf #else #define TIXML_SSCANF sscanf #endif #endif class TiXmlDocument; class TiXmlElement; class TiXmlComment; class TiXmlUnknown; class TiXmlAttribute; class TiXmlText; class TiXmlDeclaration; class TiXmlStylesheetReference; class TiXmlParsingData; const int TIXML_MAJOR_VERSION = 2; const int TIXML_MINOR_VERSION = 5; const int TIXML_PATCH_VERSION = 3; /* Internal structure for tracking location of items in the XML file. */ struct TiXmlCursor { TiXmlCursor() { Clear(); } void Clear() { row = col = -1; } int row; // 0 based. int col; // 0 based. }; /** If you call the Accept() method, it requires being passed a TiXmlVisitor class to handle callbacks. For nodes that contain other nodes (Document, Element) you will get called with a VisitEnter/VisitExit pair. Nodes that are always leaves are simple called with Visit(). If you return 'true' from a Visit method, recursive parsing will continue. If you return false, no children of this node or its sibilings will be Visited. All flavors of Visit methods have a default implementation that returns 'true' (continue visiting). You need to only override methods that are interesting to you. Generally Accept() is called on the TiXmlDocument, although all nodes suppert Visiting. You should never change the document from a callback. @sa TiXmlNode::Accept() */ class TiXmlVisitor { public: virtual ~TiXmlVisitor() {} /// Visit a document. virtual bool VisitEnter( const TiXmlDocument& /*doc*/ ) { return true; } /// Visit a document. virtual bool VisitExit( const TiXmlDocument& /*doc*/ ) { return true; } /// Visit an element. virtual bool VisitEnter( const TiXmlElement& /*element*/, const TiXmlAttribute* /*firstAttribute*/ ) { return true; } /// Visit an element. virtual bool VisitExit( const TiXmlElement& /*element*/ ) { return true; } /// Visit a declaration virtual bool Visit( const TiXmlDeclaration& /*declaration*/ ) { return true; } /// Visit a stylesheet reference virtual bool Visit( const TiXmlStylesheetReference& /*stylesheet*/ ) { return true; } /// Visit a text node virtual bool Visit( const TiXmlText& /*text*/ ) { return true; } /// Visit a comment node virtual bool Visit( const TiXmlComment& /*comment*/ ) { return true; } /// Visit an unknow node virtual bool Visit( const TiXmlUnknown& /*unknown*/ ) { return true; } }; // Only used by Attribute::Query functions enum { TIXML_SUCCESS, TIXML_NO_ATTRIBUTE, TIXML_WRONG_TYPE }; // Used by the parsing routines. enum TiXmlEncoding { TIXML_ENCODING_UNKNOWN, TIXML_ENCODING_UTF8, TIXML_ENCODING_LEGACY }; const TiXmlEncoding TIXML_DEFAULT_ENCODING = TIXML_ENCODING_UNKNOWN; /** TiXmlBase is a base class for every class in TinyXml. It does little except to establish that TinyXml classes can be printed and provide some utility functions. In XML, the document and elements can contain other elements and other types of nodes. @verbatim A Document can contain: Element (container or leaf) Comment (leaf) Unknown (leaf) Declaration( leaf ) An Element can contain: Element (container or leaf) Text (leaf) Attributes (not on tree) Comment (leaf) Unknown (leaf) A Decleration contains: Attributes (not on tree) @endverbatim */ #ifdef TIXML_USE_TICPP #include "ticpprc.h" class TiXmlBase : public TiCppRC #else class TiXmlBase #endif { friend class TiXmlNode; friend class TiXmlElement; friend class TiXmlDocument; public: TiXmlBase() : userData(0) {} virtual ~TiXmlBase() {} /** All TinyXml classes can print themselves to a filestream or the string class (TiXmlString in non-STL mode, std::string in STL mode.) Either or both cfile and str can be null. This is a formatted print, and will insert tabs and newlines. (For an unformatted stream, use the << operator.) */ virtual void Print( FILE* cfile, int depth ) const = 0; /** The world does not agree on whether white space should be kept or not. In order to make everyone happy, these global, static functions are provided to set whether or not TinyXml will condense all white space into a single space or not. The default is to condense. Note changing this value is not thread safe. */ static void SetCondenseWhiteSpace( bool condense ) { condenseWhiteSpace = condense; } /// Return the current white space setting. static bool IsWhiteSpaceCondensed() { return condenseWhiteSpace; } /** Return the position, in the original source file, of this node or attribute. The row and column are 1-based. (That is the first row and first column is 1,1). If the returns values are 0 or less, then the parser does not have a row and column value. Generally, the row and column value will be set when the TiXmlDocument::Load(), TiXmlDocument::LoadFile(), or any TiXmlNode::Parse() is called. It will NOT be set when the DOM was created from operator>>. The values reflect the initial load. Once the DOM is modified programmatically (by adding or changing nodes and attributes) the new values will NOT update to reflect changes in the document. There is a minor performance cost to computing the row and column. Computation can be disabled if TiXmlDocument::SetTabSize() is called with 0 as the value. @sa TiXmlDocument::SetTabSize() */ int Row() const { return location.row + 1; } int Column() const { return location.col + 1; } ///< See Row() void SetUserData( void* user ) { userData = user; } ///< Set a pointer to arbitrary user data. void* GetUserData() { return userData; } ///< Get a pointer to arbitrary user data. const void* GetUserData() const { return userData; } ///< Get a pointer to arbitrary user data. // Table that returs, for a given lead byte, the total number of bytes // in the UTF-8 sequence. static const int utf8ByteTable[256]; virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding /*= TIXML_ENCODING_UNKNOWN */ ) = 0; /** Expands entities in a string. Note this should not contian the tag's '<', '>', etc, or they will be transformed into entities! */ static void EncodeString( const TIXML_STRING& str, TIXML_STRING* out ); enum { TIXML_NO_ERROR = 0, TIXML_ERROR, TIXML_ERROR_OPENING_FILE, TIXML_ERROR_OUT_OF_MEMORY, TIXML_ERROR_PARSING_ELEMENT, TIXML_ERROR_FAILED_TO_READ_ELEMENT_NAME, TIXML_ERROR_READING_ELEMENT_VALUE, TIXML_ERROR_READING_ATTRIBUTES, TIXML_ERROR_PARSING_EMPTY, TIXML_ERROR_READING_END_TAG, TIXML_ERROR_PARSING_UNKNOWN, TIXML_ERROR_PARSING_COMMENT, TIXML_ERROR_PARSING_DECLARATION, TIXML_ERROR_DOCUMENT_EMPTY, TIXML_ERROR_EMBEDDED_NULL, TIXML_ERROR_PARSING_CDATA, TIXML_ERROR_DOCUMENT_TOP_ONLY, TIXML_ERROR_STRING_COUNT }; protected: static const char* SkipWhiteSpace( const char*, TiXmlEncoding encoding ); inline static bool IsWhiteSpace( char c ) { return ( isspace( (unsigned char) c ) || c == '\n' || c == '\r' ); } inline static bool IsWhiteSpace( int c ) { if ( c < 256 ) return IsWhiteSpace( (char) c ); return false; // Again, only truly correct for English/Latin...but usually works. } #ifdef TIXML_USE_STL static bool StreamWhiteSpace( std::istream * in, TIXML_STRING * tag ); static bool StreamTo( std::istream * in, int character, TIXML_STRING * tag ); #endif /* Reads an XML name into the string provided. Returns a pointer just past the last character of the name, or 0 if the function has an error. */ static const char* ReadName( const char* p, TIXML_STRING* name, TiXmlEncoding encoding ); /* Reads text. Returns a pointer past the given end tag. Wickedly complex options, but it keeps the (sensitive) code in one place. */ static const char* ReadText( const char* in, // where to start TIXML_STRING* text, // the string read bool ignoreWhiteSpace, // whether to keep the white space const char* endTag, // what ends this text bool ignoreCase, // whether to ignore case in the end tag TiXmlEncoding encoding ); // the current encoding // If an entity has been found, transform it into a character. static const char* GetEntity( const char* in, char* value, int* length, TiXmlEncoding encoding ); // Get a character, while interpreting entities. // The length can be from 0 to 4 bytes. inline static const char* GetChar( const char* p, char* _value, int* length, TiXmlEncoding encoding ) { assert( p ); if ( encoding == TIXML_ENCODING_UTF8 ) { *length = utf8ByteTable[ *((const unsigned char*)p) ]; assert( *length >= 0 && *length < 5 ); } else { *length = 1; } if ( *length == 1 ) { if ( *p == '&' ) return GetEntity( p, _value, length, encoding ); *_value = *p; return p+1; } else if ( *length ) { //strncpy( _value, p, *length ); // lots of compilers don't like this function (unsafe), // and the null terminator isn't needed for( int i=0; p[i] && i<*length; ++i ) { _value[i] = p[i]; } return p + (*length); } else { // Not valid text. return 0; } } // Return true if the next characters in the stream are any of the endTag sequences. // Ignore case only works for english, and should only be relied on when comparing // to English words: StringEqual( p, "version", true ) is fine. static bool StringEqual( const char* p, const char* endTag, bool ignoreCase, TiXmlEncoding encoding ); static const char* errorString[ TIXML_ERROR_STRING_COUNT ]; TiXmlCursor location; /// Field containing a generic user pointer void* userData; // None of these methods are reliable for any language except English. // Good for approximation, not great for accuracy. static int IsAlpha( unsigned char anyByte, TiXmlEncoding encoding ); static int IsAlphaNum( unsigned char anyByte, TiXmlEncoding encoding ); inline static int ToLower( int v, TiXmlEncoding encoding ) { if ( encoding == TIXML_ENCODING_UTF8 ) { if ( v < 128 ) return tolower( v ); return v; } else { return tolower( v ); } } static void ConvertUTF32ToUTF8( unsigned long input, char* output, int* length ); private: TiXmlBase( const TiXmlBase& ); // not implemented. void operator=( const TiXmlBase& base ); // not allowed. struct Entity { const char* str; unsigned int strLength; char chr; }; enum { NUM_ENTITY = 5, MAX_ENTITY_LENGTH = 6 }; static Entity entity[ NUM_ENTITY ]; static bool condenseWhiteSpace; }; /** The parent class for everything in the Document Object Model. (Except for attributes). Nodes have siblings, a parent, and children. A node can be in a document, or stand on its own. The type of a TiXmlNode can be queried, and it can be cast to its more defined type. */ class TiXmlNode : public TiXmlBase { friend class TiXmlDocument; friend class TiXmlElement; public: #ifdef TIXML_USE_STL /** An input stream operator, for every class. Tolerant of newlines and formatting, but doesn't expect them. */ friend std::istream& operator >> (std::istream& in, TiXmlNode& base); /** An output stream operator, for every class. Note that this outputs without any newlines or formatting, as opposed to Print(), which includes tabs and new lines. The operator<< and operator>> are not completely symmetric. Writing a node to a stream is very well defined. You'll get a nice stream of output, without any extra whitespace or newlines. But reading is not as well defined. (As it always is.) If you create a TiXmlElement (for example) and read that from an input stream, the text needs to define an element or junk will result. This is true of all input streams, but it's worth keeping in mind. A TiXmlDocument will read nodes until it reads a root element, and all the children of that root element. */ friend std::ostream& operator<< (std::ostream& out, const TiXmlNode& base); /// Appends the XML node or attribute to a std::string. friend std::string& operator<< (std::string& out, const TiXmlNode& base ); #endif /** The types of XML nodes supported by TinyXml. (All the unsupported types are picked up by UNKNOWN.) */ enum NodeType { DOCUMENT, ELEMENT, COMMENT, UNKNOWN, TEXT, DECLARATION, STYLESHEETREFERENCE, TYPECOUNT }; virtual ~TiXmlNode(); /** The meaning of 'value' changes for the specific type of TiXmlNode. @verbatim Document: filename of the xml file Element: name of the element Comment: the comment text Unknown: the tag contents Text: the text string @endverbatim The subclasses will wrap this function. */ const char *Value() const { return value.c_str (); } #ifdef TIXML_USE_STL /** Return Value() as a std::string. If you only use STL, this is more efficient than calling Value(). Only available in STL mode. */ const std::string& ValueStr() const { return value; } #endif const TIXML_STRING& ValueTStr() const { return value; } /** Changes the value of the node. Defined as: @verbatim Document: filename of the xml file Element: name of the element Comment: the comment text Unknown: the tag contents Text: the text string @endverbatim */ void SetValue(const char * _value) { value = _value;} #ifdef TIXML_USE_STL /// STL std::string form. void SetValue( const std::string& _value ) { value = _value; } #endif /// Delete all the children of this node. Does not affect 'this'. void Clear(); /// One step up the DOM. TiXmlNode* Parent() { return parent; } const TiXmlNode* Parent() const { return parent; } const TiXmlNode* FirstChild() const { return firstChild; } ///< The first child of this node. Will be null if there are no children. TiXmlNode* FirstChild() { return firstChild; } const TiXmlNode* FirstChild( const char * value ) const; ///< The first child of this node with the matching 'value'. Will be null if none found. /// The first child of this node with the matching 'value'. Will be null if none found. TiXmlNode* FirstChild( const char * _value ) { // Call through to the const version - safe since nothing is changed. Exiting syntax: cast this to a const (always safe) // call the method, cast the return back to non-const. return const_cast< TiXmlNode* > ((const_cast< const TiXmlNode* >(this))->FirstChild( _value )); } const TiXmlNode* LastChild() const { return lastChild; } /// The last child of this node. Will be null if there are no children. TiXmlNode* LastChild() { return lastChild; } const TiXmlNode* LastChild( const char * value ) const; /// The last child of this node matching 'value'. Will be null if there are no children. TiXmlNode* LastChild( const char * _value ) { return const_cast< TiXmlNode* > ((const_cast< const TiXmlNode* >(this))->LastChild( _value )); } #ifdef TIXML_USE_STL const TiXmlNode* FirstChild( const std::string& _value ) const { return FirstChild (_value.c_str ()); } ///< STL std::string form. TiXmlNode* FirstChild( const std::string& _value ) { return FirstChild (_value.c_str ()); } ///< STL std::string form. const TiXmlNode* LastChild( const std::string& _value ) const { return LastChild (_value.c_str ()); } ///< STL std::string form. TiXmlNode* LastChild( const std::string& _value ) { return LastChild (_value.c_str ()); } ///< STL std::string form. #endif /** An alternate way to walk the children of a node. One way to iterate over nodes is: @verbatim for( child = parent->FirstChild(); child; child = child->NextSibling() ) @endverbatim IterateChildren does the same thing with the syntax: @verbatim child = 0; while( child = parent->IterateChildren( child ) ) @endverbatim IterateChildren takes the previous child as input and finds the next one. If the previous child is null, it returns the first. IterateChildren will return null when done. */ const TiXmlNode* IterateChildren( const TiXmlNode* previous ) const; TiXmlNode* IterateChildren( const TiXmlNode* previous ) { return const_cast< TiXmlNode* >( (const_cast< const TiXmlNode* >(this))->IterateChildren( previous ) ); } /// This flavor of IterateChildren searches for children with a particular 'value' const TiXmlNode* IterateChildren( const char * value, const TiXmlNode* previous ) const; TiXmlNode* IterateChildren( const char * _value, const TiXmlNode* previous ) { return const_cast< TiXmlNode* >( (const_cast< const TiXmlNode* >(this))->IterateChildren( _value, previous ) ); } #ifdef TIXML_USE_STL const TiXmlNode* IterateChildren( const std::string& _value, const TiXmlNode* previous ) const { return IterateChildren (_value.c_str (), previous); } ///< STL std::string form. TiXmlNode* IterateChildren( const std::string& _value, const TiXmlNode* previous ) { return IterateChildren (_value.c_str (), previous); } ///< STL std::string form. #endif /** Add a new node related to this. Adds a child past the LastChild. Returns a pointer to the new object or NULL if an error occured. */ TiXmlNode* InsertEndChild( const TiXmlNode& addThis ); /** Add a new node related to this. Adds a child past the LastChild. NOTE: the node to be added is passed by pointer, and will be henceforth owned (and deleted) by tinyXml. This method is efficient and avoids an extra copy, but should be used with care as it uses a different memory model than the other insert functions. @sa InsertEndChild */ TiXmlNode* LinkEndChild( TiXmlNode* addThis ); /** Add a new node related to this. Adds a child before the specified child. Returns a pointer to the new object or NULL if an error occured. */ TiXmlNode* InsertBeforeChild( TiXmlNode* beforeThis, const TiXmlNode& addThis ); /** Add a new node related to this. Adds a child after the specified child. Returns a pointer to the new object or NULL if an error occured. */ TiXmlNode* InsertAfterChild( TiXmlNode* afterThis, const TiXmlNode& addThis ); /** Replace a child of this node. Returns a pointer to the new object or NULL if an error occured. */ TiXmlNode* ReplaceChild( TiXmlNode* replaceThis, const TiXmlNode& withThis ); /// Delete a child of this node. bool RemoveChild( TiXmlNode* removeThis ); /// Navigate to a sibling node. const TiXmlNode* PreviousSibling() const { return prev; } TiXmlNode* PreviousSibling() { return prev; } /// Navigate to a sibling node. const TiXmlNode* PreviousSibling( const char * ) const; TiXmlNode* PreviousSibling( const char *_prev ) { return const_cast< TiXmlNode* >( (const_cast< const TiXmlNode* >(this))->PreviousSibling( _prev ) ); } #ifdef TIXML_USE_STL const TiXmlNode* PreviousSibling( const std::string& _value ) const { return PreviousSibling (_value.c_str ()); } ///< STL std::string form. TiXmlNode* PreviousSibling( const std::string& _value ) { return PreviousSibling (_value.c_str ()); } ///< STL std::string form. const TiXmlNode* NextSibling( const std::string& _value) const { return NextSibling (_value.c_str ()); } ///< STL std::string form. TiXmlNode* NextSibling( const std::string& _value) { return NextSibling (_value.c_str ()); } ///< STL std::string form. #endif /// Navigate to a sibling node. const TiXmlNode* NextSibling() const { return next; } TiXmlNode* NextSibling() { return next; } /// Navigate to a sibling node with the given 'value'. const TiXmlNode* NextSibling( const char * ) const; TiXmlNode* NextSibling( const char* _next ) { return const_cast< TiXmlNode* >( (const_cast< const TiXmlNode* >(this))->NextSibling( _next ) ); } /** Convenience function to get through elements. Calls NextSibling and ToElement. Will skip all non-Element nodes. Returns 0 if there is not another element. */ const TiXmlElement* NextSiblingElement() const; TiXmlElement* NextSiblingElement() { return const_cast< TiXmlElement* >( (const_cast< const TiXmlNode* >(this))->NextSiblingElement() ); } /** Convenience function to get through elements. Calls NextSibling and ToElement. Will skip all non-Element nodes. Returns 0 if there is not another element. */ const TiXmlElement* NextSiblingElement( const char * ) const; TiXmlElement* NextSiblingElement( const char *_next ) { return const_cast< TiXmlElement* >( (const_cast< const TiXmlNode* >(this))->NextSiblingElement( _next ) ); } #ifdef TIXML_USE_STL const TiXmlElement* NextSiblingElement( const std::string& _value) const { return NextSiblingElement (_value.c_str ()); } ///< STL std::string form. TiXmlElement* NextSiblingElement( const std::string& _value) { return NextSiblingElement (_value.c_str ()); } ///< STL std::string form. #endif /// Convenience function to get through elements. const TiXmlElement* FirstChildElement() const; TiXmlElement* FirstChildElement() { return const_cast< TiXmlElement* >( (const_cast< const TiXmlNode* >(this))->FirstChildElement() ); } /// Convenience function to get through elements. const TiXmlElement* FirstChildElement( const char * _value ) const; TiXmlElement* FirstChildElement( const char * _value ) { return const_cast< TiXmlElement* >( (const_cast< const TiXmlNode* >(this))->FirstChildElement( _value ) ); } #ifdef TIXML_USE_STL const TiXmlElement* FirstChildElement( const std::string& _value ) const { return FirstChildElement (_value.c_str ()); } ///< STL std::string form. TiXmlElement* FirstChildElement( const std::string& _value ) { return FirstChildElement (_value.c_str ()); } ///< STL std::string form. #endif /** Query the type (as an enumerated value, above) of this node. The possible types are: DOCUMENT, ELEMENT, COMMENT, UNKNOWN, TEXT, and DECLARATION. */ int Type() const { return type; } /** Return a pointer to the Document this node lives in. Returns null if not in a document. */ const TiXmlDocument* GetDocument() const; TiXmlDocument* GetDocument() { return const_cast< TiXmlDocument* >( (const_cast< const TiXmlNode* >(this))->GetDocument() ); } /// Returns true if this node has no children. bool NoChildren() const { return !firstChild; } virtual const TiXmlDocument* ToDocument() const { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. virtual const TiXmlElement* ToElement() const { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. virtual const TiXmlComment* ToComment() const { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. virtual const TiXmlUnknown* ToUnknown() const { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. virtual const TiXmlText* ToText() const { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. virtual const TiXmlDeclaration* ToDeclaration() const { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. virtual const TiXmlStylesheetReference* ToStylesheetReference() const { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. virtual TiXmlDocument* ToDocument() { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. virtual TiXmlElement* ToElement() { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. virtual TiXmlComment* ToComment() { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. virtual TiXmlUnknown* ToUnknown() { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. virtual TiXmlText* ToText() { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. virtual TiXmlDeclaration* ToDeclaration() { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. virtual TiXmlStylesheetReference* ToStylesheetReference() { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. /** Create an exact duplicate of this node and return it. The memory must be deleted by the caller. */ virtual TiXmlNode* Clone() const = 0; /** Accept a hierchical visit the nodes in the TinyXML DOM. Every node in the XML tree will be conditionally visited and the host will be called back via the TiXmlVisitor interface. This is essentially a SAX interface for TinyXML. (Note however it doesn't re-parse the XML for the callbacks, so the performance of TinyXML is unchanged by using this interface versus any other.) The interface has been based on ideas from: - http://www.saxproject.org/ - http://c2.com/cgi/wiki?HierarchicalVisitorPattern Which are both good references for "visiting". An example of using Accept(): @verbatim TiXmlPrinter printer; tinyxmlDoc.Accept( &printer ); const char* xmlcstr = printer.CStr(); @endverbatim */ virtual bool Accept( TiXmlVisitor* visitor ) const = 0; protected: TiXmlNode( NodeType _type ); // Copy to the allocated object. Shared functionality between Clone, Copy constructor, // and the assignment operator. void CopyTo( TiXmlNode* target ) const; #ifdef TIXML_USE_STL // The real work of the input operator. virtual void StreamIn( std::istream* in, TIXML_STRING* tag ) = 0; #endif // Figure out what is at *p, and parse it. Returns null if it is not an xml node. TiXmlNode* Identify( const char* start, TiXmlEncoding encoding ); TiXmlNode* parent; NodeType type; TiXmlNode* firstChild; TiXmlNode* lastChild; TIXML_STRING value; TiXmlNode* prev; TiXmlNode* next; private: TiXmlNode( const TiXmlNode& ); // not implemented. void operator=( const TiXmlNode& base ); // not allowed. }; /** An attribute is a name-value pair. Elements have an arbitrary number of attributes, each with a unique name. @note The attributes are not TiXmlNodes, since they are not part of the tinyXML document object model. There are other suggested ways to look at this problem. */ class TiXmlAttribute : public TiXmlBase { friend class TiXmlAttributeSet; public: /// Construct an empty attribute. TiXmlAttribute() : TiXmlBase() { document = 0; prev = next = 0; } #ifdef TIXML_USE_STL /// std::string constructor. TiXmlAttribute( const std::string& _name, const std::string& _value ) { name = _name; value = _value; document = 0; prev = next = 0; } #endif /// Construct an attribute with a name and value. TiXmlAttribute( const char * _name, const char * _value ) { name = _name; value = _value; document = 0; prev = next = 0; } const char* Name() const { return name.c_str(); } ///< Return the name of this attribute. const char* Value() const { return value.c_str(); } ///< Return the value of this attribute. #ifdef TIXML_USE_STL const std::string& ValueStr() const { return value; } ///< Return the value of this attribute. #endif int IntValue() const; ///< Return the value of this attribute, converted to an integer. double DoubleValue() const; ///< Return the value of this attribute, converted to a double. // Get the tinyxml string representation const TIXML_STRING& NameTStr() const { return name; } /** QueryIntValue examines the value string. It is an alternative to the IntValue() method with richer error checking. If the value is an integer, it is stored in 'value' and the call returns TIXML_SUCCESS. If it is not an integer, it returns TIXML_WRONG_TYPE. A specialized but useful call. Note that for success it returns 0, which is the opposite of almost all other TinyXml calls. */ int QueryIntValue( int* _value ) const; /// QueryDoubleValue examines the value string. See QueryIntValue(). int QueryDoubleValue( double* _value ) const; void SetName( const char* _name ) { name = _name; } ///< Set the name of this attribute. void SetValue( const char* _value ) { value = _value; } ///< Set the value. void SetIntValue( int _value ); ///< Set the value from an integer. void SetDoubleValue( double _value ); ///< Set the value from a double. #ifdef TIXML_USE_STL /// STL std::string form. void SetName( const std::string& _name ) { name = _name; } /// STL std::string form. void SetValue( const std::string& _value ) { value = _value; } #endif /// Get the next sibling attribute in the DOM. Returns null at end. const TiXmlAttribute* Next() const; TiXmlAttribute* Next() { return const_cast< TiXmlAttribute* >( (const_cast< const TiXmlAttribute* >(this))->Next() ); } /// Get the previous sibling attribute in the DOM. Returns null at beginning. const TiXmlAttribute* Previous() const; TiXmlAttribute* Previous() { return const_cast< TiXmlAttribute* >( (const_cast< const TiXmlAttribute* >(this))->Previous() ); } bool operator==( const TiXmlAttribute& rhs ) const { return rhs.name == name; } bool operator<( const TiXmlAttribute& rhs ) const { return name < rhs.name; } bool operator>( const TiXmlAttribute& rhs ) const { return name > rhs.name; } /* Attribute parsing starts: first letter of the name returns: the next char after the value end quote */ virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding ); // Prints this Attribute to a FILE stream. virtual void Print( FILE* cfile, int depth ) const { Print( cfile, depth, 0 ); } void Print( FILE* cfile, int depth, TIXML_STRING* str ) const; // [internal use] // Set the document pointer so the attribute can report errors. void SetDocument( TiXmlDocument* doc ) { document = doc; } private: TiXmlAttribute( const TiXmlAttribute& ); // not implemented. void operator=( const TiXmlAttribute& base ); // not allowed. TiXmlDocument* document; // A pointer back to a document, for error reporting. TIXML_STRING name; TIXML_STRING value; TiXmlAttribute* prev; TiXmlAttribute* next; }; /* A class used to manage a group of attributes. It is only used internally, both by the ELEMENT and the DECLARATION. The set can be changed transparent to the Element and Declaration classes that use it, but NOT transparent to the Attribute which has to implement a next() and previous() method. Which makes it a bit problematic and prevents the use of STL. This version is implemented with circular lists because: - I like circular lists - it demonstrates some independence from the (typical) doubly linked list. */ class TiXmlAttributeSet { public: TiXmlAttributeSet(); ~TiXmlAttributeSet(); void Add( TiXmlAttribute* attribute ); void Remove( TiXmlAttribute* attribute ); const TiXmlAttribute* First() const { return ( sentinel.next == &sentinel ) ? 0 : sentinel.next; } TiXmlAttribute* First() { return ( sentinel.next == &sentinel ) ? 0 : sentinel.next; } const TiXmlAttribute* Last() const { return ( sentinel.prev == &sentinel ) ? 0 : sentinel.prev; } TiXmlAttribute* Last() { return ( sentinel.prev == &sentinel ) ? 0 : sentinel.prev; } const TiXmlAttribute* Find( const char* _name ) const; TiXmlAttribute* Find( const char* _name ) { return const_cast< TiXmlAttribute* >( (const_cast< const TiXmlAttributeSet* >(this))->Find( _name ) ); } #ifdef TIXML_USE_STL const TiXmlAttribute* Find( const std::string& _name ) const; TiXmlAttribute* Find( const std::string& _name ) { return const_cast< TiXmlAttribute* >( (const_cast< const TiXmlAttributeSet* >(this))->Find( _name ) ); } #endif private: //*ME: Because of hidden/disabled copy-construktor in TiXmlAttribute (sentinel-element), //*ME: this class must be also use a hidden/disabled copy-constructor !!! TiXmlAttributeSet( const TiXmlAttributeSet& ); // not allowed void operator=( const TiXmlAttributeSet& ); // not allowed (as TiXmlAttribute) TiXmlAttribute sentinel; }; /** The element is a container class. It has a value, the element name, and can contain other elements, text, comments, and unknowns. Elements also contain an arbitrary number of attributes. */ class TiXmlElement : public TiXmlNode { public: /// Construct an element. TiXmlElement (const char * in_value); #ifdef TIXML_USE_STL /// std::string constructor. TiXmlElement( const std::string& _value ); #endif TiXmlElement( const TiXmlElement& ); void operator=( const TiXmlElement& base ); virtual ~TiXmlElement(); /** Given an attribute name, Attribute() returns the value for the attribute of that name, or null if none exists. */ const char* Attribute( const char* name ) const; /** Given an attribute name, Attribute() returns the value for the attribute of that name, or null if none exists. If the attribute exists and can be converted to an integer, the integer value will be put in the return 'i', if 'i' is non-null. */ const char* Attribute( const char* name, int* i ) const; /** Given an attribute name, Attribute() returns the value for the attribute of that name, or null if none exists. If the attribute exists and can be converted to an double, the double value will be put in the return 'd', if 'd' is non-null. */ const char* Attribute( const char* name, double* d ) const; /** QueryIntAttribute examines the attribute - it is an alternative to the Attribute() method with richer error checking. If the attribute is an integer, it is stored in 'value' and the call returns TIXML_SUCCESS. If it is not an integer, it returns TIXML_WRONG_TYPE. If the attribute does not exist, then TIXML_NO_ATTRIBUTE is returned. */ int QueryIntAttribute( const char* name, int* _value ) const; /// QueryDoubleAttribute examines the attribute - see QueryIntAttribute(). int QueryDoubleAttribute( const char* name, double* _value ) const; /// QueryFloatAttribute examines the attribute - see QueryIntAttribute(). int QueryFloatAttribute( const char* name, float* _value ) const { double d; int result = QueryDoubleAttribute( name, &d ); if ( result == TIXML_SUCCESS ) { *_value = (float)d; } return result; } #ifdef TIXML_USE_STL /** Template form of the attribute query which will try to read the attribute into the specified type. Very easy, very powerful, but be careful to make sure to call this with the correct type. NOTE: This method doesn't work correctly for 'string' types. @return TIXML_SUCCESS, TIXML_WRONG_TYPE, or TIXML_NO_ATTRIBUTE */ template< typename T > int QueryValueAttribute( const std::string& name, T* outValue ) const { const TiXmlAttribute* node = attributeSet.Find( name ); if ( !node ) return TIXML_NO_ATTRIBUTE; std::stringstream sstream( node->ValueStr() ); sstream >> *outValue; if ( !sstream.fail() ) return TIXML_SUCCESS; return TIXML_WRONG_TYPE; } /* This is - in theory - a bug fix for "QueryValueAtribute returns truncated std::string" but template specialization is hard to get working cross-compiler. Leaving the bug for now. // The above will fail for std::string because the space character is used as a seperator. // Specialize for strings. Bug [ 1695429 ] QueryValueAtribute returns truncated std::string template<> int QueryValueAttribute( const std::string& name, std::string* outValue ) const { const TiXmlAttribute* node = attributeSet.Find( name ); if ( !node ) return TIXML_NO_ATTRIBUTE; *outValue = node->ValueStr(); return TIXML_SUCCESS; } */ #endif /** Sets an attribute of name to a given value. The attribute will be created if it does not exist, or changed if it does. */ void SetAttribute( const char* name, const char * _value ); #ifdef TIXML_USE_STL const std::string* Attribute( const std::string& name ) const; const std::string* Attribute( const std::string& name, int* i ) const; const std::string* Attribute( const std::string& name, double* d ) const; int QueryIntAttribute( const std::string& name, int* _value ) const; int QueryDoubleAttribute( const std::string& name, double* _value ) const; /// STL std::string form. void SetAttribute( const std::string& name, const std::string& _value ); ///< STL std::string form. void SetAttribute( const std::string& name, int _value ); #endif /** Sets an attribute of name to a given value. The attribute will be created if it does not exist, or changed if it does. */ void SetAttribute( const char * name, int value ); /** Sets an attribute of name to a given value. The attribute will be created if it does not exist, or changed if it does. */ void SetDoubleAttribute( const char * name, double value ); /** Deletes an attribute with the given name. */ void RemoveAttribute( const char * name ); #ifdef TIXML_USE_STL void RemoveAttribute( const std::string& name ) { RemoveAttribute (name.c_str ()); } ///< STL std::string form. #endif const TiXmlAttribute* FirstAttribute() const { return attributeSet.First(); } ///< Access the first attribute in this element. TiXmlAttribute* FirstAttribute() { return attributeSet.First(); } const TiXmlAttribute* LastAttribute() const { return attributeSet.Last(); } ///< Access the last attribute in this element. TiXmlAttribute* LastAttribute() { return attributeSet.Last(); } /** Convenience function for easy access to the text inside an element. Although easy and concise, GetText() is limited compared to getting the TiXmlText child and accessing it directly. If the first child of 'this' is a TiXmlText, the GetText() returns the character string of the Text node, else null is returned. This is a convenient method for getting the text of simple contained text: @verbatim This is text const char* str = fooElement->GetText(); @endverbatim 'str' will be a pointer to "This is text". Note that this function can be misleading. If the element foo was created from this XML: @verbatim This is text @endverbatim then the value of str would be null. The first child node isn't a text node, it is another element. From this XML: @verbatim This is text @endverbatim GetText() will return "This is ". WARNING: GetText() accesses a child node - don't become confused with the similarly named TiXmlHandle::Text() and TiXmlNode::ToText() which are safe type casts on the referenced node. */ const char* GetText() const; /// Creates a new Element and returns it - the returned element is a copy. virtual TiXmlNode* Clone() const; // Print the Element to a FILE stream. virtual void Print( FILE* cfile, int depth ) const; /* Attribtue parsing starts: next char past '<' returns: next char past '>' */ virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding ); virtual const TiXmlElement* ToElement() const { return this; } ///< Cast to a more defined type. Will return null not of the requested type. virtual TiXmlElement* ToElement() { return this; } ///< Cast to a more defined type. Will return null not of the requested type. /** Walk the XML tree visiting this node and all of its children. */ virtual bool Accept( TiXmlVisitor* visitor ) const; protected: void CopyTo( TiXmlElement* target ) const; void ClearThis(); // like clear, but initializes 'this' object as well // Used to be public [internal use] #ifdef TIXML_USE_STL virtual void StreamIn( std::istream * in, TIXML_STRING * tag ); #endif /* [internal use] Reads the "value" of the element -- another element, or text. This should terminate with the current end tag. */ const char* ReadValue( const char* in, TiXmlParsingData* prevData, TiXmlEncoding encoding ); private: TiXmlAttributeSet attributeSet; }; /** An XML comment. */ class TiXmlComment : public TiXmlNode { public: /// Constructs an empty comment. TiXmlComment() : TiXmlNode( TiXmlNode::COMMENT ) {} /// Construct a comment from text. TiXmlComment( const char* _value ) : TiXmlNode( TiXmlNode::COMMENT ) { SetValue( _value ); } TiXmlComment( const TiXmlComment& ); void operator=( const TiXmlComment& base ); virtual ~TiXmlComment() {} /// Returns a copy of this Comment. virtual TiXmlNode* Clone() const; // Write this Comment to a FILE stream. virtual void Print( FILE* cfile, int depth ) const; /* Attribtue parsing starts: at the ! of the !-- returns: next char past '>' */ virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding ); virtual const TiXmlComment* ToComment() const { return this; } ///< Cast to a more defined type. Will return null not of the requested type. virtual TiXmlComment* ToComment() { return this; } ///< Cast to a more defined type. Will return null not of the requested type. /** Walk the XML tree visiting this node and all of its children. */ virtual bool Accept( TiXmlVisitor* visitor ) const; protected: void CopyTo( TiXmlComment* target ) const; // used to be public #ifdef TIXML_USE_STL virtual void StreamIn( std::istream * in, TIXML_STRING * tag ); #endif // virtual void StreamOut( TIXML_OSTREAM * out ) const; private: }; /** XML text. A text node can have 2 ways to output the next. "normal" output and CDATA. It will default to the mode it was parsed from the XML file and you generally want to leave it alone, but you can change the output mode with SetCDATA() and query it with CDATA(). */ class TiXmlText : public TiXmlNode { friend class TiXmlElement; public: /** Constructor for text element. By default, it is treated as normal, encoded text. If you want it be output as a CDATA text element, set the parameter _cdata to 'true' */ TiXmlText (const char * initValue ) : TiXmlNode (TiXmlNode::TEXT) { SetValue( initValue ); cdata = false; } virtual ~TiXmlText() {} #ifdef TIXML_USE_STL /// Constructor. TiXmlText( const std::string& initValue ) : TiXmlNode (TiXmlNode::TEXT) { SetValue( initValue ); cdata = false; } #endif TiXmlText( const TiXmlText& copy ) : TiXmlNode( TiXmlNode::TEXT ) { copy.CopyTo( this ); } void operator=( const TiXmlText& base ) { base.CopyTo( this ); } // Write this text object to a FILE stream. virtual void Print( FILE* cfile, int depth ) const; /// Queries whether this represents text using a CDATA section. bool CDATA() const { return cdata; } /// Turns on or off a CDATA representation of text. void SetCDATA( bool _cdata ) { cdata = _cdata; } virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding ); virtual const TiXmlText* ToText() const { return this; } ///< Cast to a more defined type. Will return null not of the requested type. virtual TiXmlText* ToText() { return this; } ///< Cast to a more defined type. Will return null not of the requested type. /** Walk the XML tree visiting this node and all of its children. */ virtual bool Accept( TiXmlVisitor* content ) const; protected : /// [internal use] Creates a new Element and returns it. virtual TiXmlNode* Clone() const; void CopyTo( TiXmlText* target ) const; bool Blank() const; // returns true if all white space and new lines // [internal use] #ifdef TIXML_USE_STL virtual void StreamIn( std::istream * in, TIXML_STRING * tag ); #endif private: bool cdata; // true if this should be input and output as a CDATA style text element }; /** In correct XML the declaration is the first entry in the file. @verbatim @endverbatim TinyXml will happily read or write files without a declaration, however. There are 3 possible attributes to the declaration: version, encoding, and standalone. Note: In this version of the code, the attributes are handled as special cases, not generic attributes, simply because there can only be at most 3 and they are always the same. */ class TiXmlDeclaration : public TiXmlNode { public: /// Construct an empty declaration. TiXmlDeclaration() : TiXmlNode( TiXmlNode::DECLARATION ) {} #ifdef TIXML_USE_STL /// Constructor. TiXmlDeclaration( const std::string& _version, const std::string& _encoding, const std::string& _standalone ); #endif /// Construct. TiXmlDeclaration( const char* _version, const char* _encoding, const char* _standalone ); TiXmlDeclaration( const TiXmlDeclaration& copy ); void operator=( const TiXmlDeclaration& copy ); virtual ~TiXmlDeclaration() {} /// Version. Will return an empty string if none was found. const char *Version() const { return version.c_str (); } /// Encoding. Will return an empty string if none was found. const char *Encoding() const { return encoding.c_str (); } /// Is this a standalone document? const char *Standalone() const { return standalone.c_str (); } /// Creates a copy of this Declaration and returns it. virtual TiXmlNode* Clone() const; // Print this declaration to a FILE stream. virtual void Print( FILE* cfile, int depth, TIXML_STRING* str ) const; virtual void Print( FILE* cfile, int depth ) const { Print( cfile, depth, 0 ); } virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding ); virtual const TiXmlDeclaration* ToDeclaration() const { return this; } ///< Cast to a more defined type. Will return null not of the requested type. virtual TiXmlDeclaration* ToDeclaration() { return this; } ///< Cast to a more defined type. Will return null not of the requested type. /** Walk the XML tree visiting this node and all of its children. */ virtual bool Accept( TiXmlVisitor* visitor ) const; protected: void CopyTo( TiXmlDeclaration* target ) const; // used to be public #ifdef TIXML_USE_STL virtual void StreamIn( std::istream * in, TIXML_STRING * tag ); #endif private: TIXML_STRING version; TIXML_STRING encoding; TIXML_STRING standalone; }; /** A stylesheet reference looks like this: @verbatim @endverbatim Note: In this version of the code, the attributes are handled as special cases, not generic attributes, simply because there can only be at most 2 and they are always the same. */ class TiXmlStylesheetReference : public TiXmlNode { public: /// Construct an empty declaration. TiXmlStylesheetReference() : TiXmlNode( TiXmlNode::STYLESHEETREFERENCE ) {} #ifdef TIXML_USE_STL /// Constructor. TiXmlStylesheetReference( const std::string& _type, const std::string& _href ); #endif /// Construct. TiXmlStylesheetReference( const char* _type, const char* _href ); TiXmlStylesheetReference( const TiXmlStylesheetReference& copy ); void operator=( const TiXmlStylesheetReference& copy ); virtual ~TiXmlStylesheetReference() {} /// Type. Will return an empty string if none was found. const char *Type() const { return type.c_str (); } /// Href. Will return an empty string if none was found. const char *Href() const { return href.c_str (); } /// Creates a copy of this StylesheetReference and returns it. virtual TiXmlNode* Clone() const; // Print this declaration to a FILE stream. virtual void Print( FILE* cfile, int depth, TIXML_STRING* str ) const; virtual void Print( FILE* cfile, int depth ) const { Print( cfile, depth, 0 ); } virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding ); virtual const TiXmlStylesheetReference* ToStylesheetReference() const { return this; } ///< Cast to a more defined type. Will return null not of the requested type. virtual TiXmlStylesheetReference* ToStylesheetReference() { return this; } ///< Cast to a more defined type. Will return null not of the requested type. /** Walk the XML tree visiting this node and all of its children. */ virtual bool Accept( TiXmlVisitor* visitor ) const; protected: void CopyTo( TiXmlStylesheetReference* target ) const; // used to be public #ifdef TIXML_USE_STL virtual void StreamIn( std::istream * in, TIXML_STRING * tag ); #endif private: TIXML_STRING type; TIXML_STRING href; }; /** Any tag that tinyXml doesn't recognize is saved as an unknown. It is a tag of text, but should not be modified. It will be written back to the XML, unchanged, when the file is saved. DTD tags get thrown into TiXmlUnknowns. */ class TiXmlUnknown : public TiXmlNode { public: TiXmlUnknown() : TiXmlNode( TiXmlNode::UNKNOWN ) {} virtual ~TiXmlUnknown() {} TiXmlUnknown( const TiXmlUnknown& copy ) : TiXmlNode( TiXmlNode::UNKNOWN ) { copy.CopyTo( this ); } void operator=( const TiXmlUnknown& copy ) { copy.CopyTo( this ); } /// Creates a copy of this Unknown and returns it. virtual TiXmlNode* Clone() const; // Print this Unknown to a FILE stream. virtual void Print( FILE* cfile, int depth ) const; virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding ); virtual const TiXmlUnknown* ToUnknown() const { return this; } ///< Cast to a more defined type. Will return null not of the requested type. virtual TiXmlUnknown* ToUnknown() { return this; } ///< Cast to a more defined type. Will return null not of the requested type. /** Walk the XML tree visiting this node and all of its children. */ virtual bool Accept( TiXmlVisitor* content ) const; protected: void CopyTo( TiXmlUnknown* target ) const; #ifdef TIXML_USE_STL virtual void StreamIn( std::istream * in, TIXML_STRING * tag ); #endif private: }; /** Always the top level node. A document binds together all the XML pieces. It can be saved, loaded, and printed to the screen. The 'value' of a document node is the xml file name. */ class TiXmlDocument : public TiXmlNode { public: /// Create an empty document, that has no name. TiXmlDocument(); /// Create a document with a name. The name of the document is also the filename of the xml. TiXmlDocument( const char * documentName ); #ifdef TIXML_USE_STL /// Constructor. TiXmlDocument( const std::string& documentName ); #endif TiXmlDocument( const TiXmlDocument& copy ); void operator=( const TiXmlDocument& copy ); virtual ~TiXmlDocument() {} /** Load a file using the current document value. Returns true if successful. Will delete any existing document data before loading. */ bool LoadFile( TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING ); /// Save a file using the current document value. Returns true if successful. bool SaveFile() const; /// Load a file using the given filename. Returns true if successful. bool LoadFile( const char * filename, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING ); /// Save a file using the given filename. Returns true if successful. bool SaveFile( const char * filename ) const; /** Load a file using the given FILE*. Returns true if successful. Note that this method doesn't stream - the entire object pointed at by the FILE* will be interpreted as an XML file. TinyXML doesn't stream in XML from the current file location. Streaming may be added in the future. */ bool LoadFile( FILE*, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING ); /// Save a file using the given FILE*. Returns true if successful. bool SaveFile( FILE* ) const; #ifdef TIXML_USE_STL bool LoadFile( const std::string& filename, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING ) ///< STL std::string version. { // StringToBuffer f( filename ); // return ( f.buffer && LoadFile( f.buffer, encoding )); return LoadFile( filename.c_str(), encoding ); } bool SaveFile( const std::string& filename ) const ///< STL std::string version. { // StringToBuffer f( filename ); // return ( f.buffer && SaveFile( f.buffer )); return SaveFile( filename.c_str() ); } #endif /** Parse the given null terminated block of xml data. Passing in an encoding to this method (either TIXML_ENCODING_LEGACY or TIXML_ENCODING_UTF8 will force TinyXml to use that encoding, regardless of what TinyXml might otherwise try to detect. */ virtual const char* Parse( const char* p, TiXmlParsingData* data = 0, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING ); /** Get the root element -- the only top level element -- of the document. In well formed XML, there should only be one. TinyXml is tolerant of multiple elements at the document level. */ const TiXmlElement* RootElement() const { return FirstChildElement(); } TiXmlElement* RootElement() { return FirstChildElement(); } /** If an error occurs, Error will be set to true. Also, - The ErrorId() will contain the integer identifier of the error (not generally useful) - The ErrorDesc() method will return the name of the error. (very useful) - The ErrorRow() and ErrorCol() will return the location of the error (if known) */ bool Error() const { return error; } /// Contains a textual (english) description of the error if one occurs. const char * ErrorDesc() const { return errorDesc.c_str (); } /** Generally, you probably want the error string ( ErrorDesc() ). But if you prefer the ErrorId, this function will fetch it. */ int ErrorId() const { return errorId; } /** Returns the location (if known) of the error. The first column is column 1, and the first row is row 1. A value of 0 means the row and column wasn't applicable (memory errors, for example, have no row/column) or the parser lost the error. (An error in the error reporting, in that case.) @sa SetTabSize, Row, Column */ int ErrorRow() const { return errorLocation.row+1; } int ErrorCol() const { return errorLocation.col+1; } ///< The column where the error occured. See ErrorRow() /** SetTabSize() allows the error reporting functions (ErrorRow() and ErrorCol()) to report the correct values for row and column. It does not change the output or input in any way. By calling this method, with a tab size greater than 0, the row and column of each node and attribute is stored when the file is loaded. Very useful for tracking the DOM back in to the source file. The tab size is required for calculating the location of nodes. If not set, the default of 4 is used. The tabsize is set per document. Setting the tabsize to 0 disables row/column tracking. Note that row and column tracking is not supported when using operator>>. The tab size needs to be enabled before the parse or load. Correct usage: @verbatim TiXmlDocument doc; doc.SetTabSize( 8 ); doc.Load( "myfile.xml" ); @endverbatim @sa Row, Column */ void SetTabSize( int _tabsize ) { tabsize = _tabsize; } int TabSize() const { return tabsize; } /** If you have handled the error, it can be reset with this call. The error state is automatically cleared if you Parse a new XML block. */ void ClearError() { error = false; errorId = 0; errorDesc = ""; errorLocation.row = errorLocation.col = 0; //errorLocation.last = 0; } /** Write the document to standard out using formatted printing ("pretty print"). */ void Print() const { Print( stdout, 0 ); } /* Write the document to a string using formatted printing ("pretty print"). This will allocate a character array (new char[]) and return it as a pointer. The calling code pust call delete[] on the return char* to avoid a memory leak. */ //char* PrintToMemory() const; /// Print this Document to a FILE stream. virtual void Print( FILE* cfile, int depth = 0 ) const; // [internal use] void SetError( int err, const char* errorLocation, TiXmlParsingData* prevData, TiXmlEncoding encoding ); virtual const TiXmlDocument* ToDocument() const { return this; } ///< Cast to a more defined type. Will return null not of the requested type. virtual TiXmlDocument* ToDocument() { return this; } ///< Cast to a more defined type. Will return null not of the requested type. /** Walk the XML tree visiting this node and all of its children. */ virtual bool Accept( TiXmlVisitor* content ) const; protected : // [internal use] virtual TiXmlNode* Clone() const; #ifdef TIXML_USE_STL virtual void StreamIn( std::istream * in, TIXML_STRING * tag ); #endif private: void CopyTo( TiXmlDocument* target ) const; bool error; int errorId; TIXML_STRING errorDesc; int tabsize; TiXmlCursor errorLocation; bool useMicrosoftBOM; // the UTF-8 BOM were found when read. Note this, and try to write. }; /** A TiXmlHandle is a class that wraps a node pointer with null checks; this is an incredibly useful thing. Note that TiXmlHandle is not part of the TinyXml DOM structure. It is a separate utility class. Take an example: @verbatim @endverbatim Assuming you want the value of "attributeB" in the 2nd "Child" element, it's very easy to write a *lot* of code that looks like: @verbatim TiXmlElement* root = document.FirstChildElement( "Document" ); if ( root ) { TiXmlElement* element = root->FirstChildElement( "Element" ); if ( element ) { TiXmlElement* child = element->FirstChildElement( "Child" ); if ( child ) { TiXmlElement* child2 = child->NextSiblingElement( "Child" ); if ( child2 ) { // Finally do something useful. @endverbatim And that doesn't even cover "else" cases. TiXmlHandle addresses the verbosity of such code. A TiXmlHandle checks for null pointers so it is perfectly safe and correct to use: @verbatim TiXmlHandle docHandle( &document ); TiXmlElement* child2 = docHandle.FirstChild( "Document" ).FirstChild( "Element" ).Child( "Child", 1 ).ToElement(); if ( child2 ) { // do something useful @endverbatim Which is MUCH more concise and useful. It is also safe to copy handles - internally they are nothing more than node pointers. @verbatim TiXmlHandle handleCopy = handle; @endverbatim What they should not be used for is iteration: @verbatim int i=0; while ( true ) { TiXmlElement* child = docHandle.FirstChild( "Document" ).FirstChild( "Element" ).Child( "Child", i ).ToElement(); if ( !child ) break; // do something ++i; } @endverbatim It seems reasonable, but it is in fact two embedded while loops. The Child method is a linear walk to find the element, so this code would iterate much more than it needs to. Instead, prefer: @verbatim TiXmlElement* child = docHandle.FirstChild( "Document" ).FirstChild( "Element" ).FirstChild( "Child" ).ToElement(); for( child; child; child=child->NextSiblingElement() ) { // do something } @endverbatim */ class TiXmlHandle { public: /// Create a handle from any node (at any depth of the tree.) This can be a null pointer. TiXmlHandle( TiXmlNode* _node ) { this->node = _node; } /// Copy constructor TiXmlHandle( const TiXmlHandle& ref ) { this->node = ref.node; } TiXmlHandle operator=( const TiXmlHandle& ref ) { this->node = ref.node; return *this; } /// Return a handle to the first child node. TiXmlHandle FirstChild() const; /// Return a handle to the first child node with the given name. TiXmlHandle FirstChild( const char * value ) const; /// Return a handle to the first child element. TiXmlHandle FirstChildElement() const; /// Return a handle to the first child element with the given name. TiXmlHandle FirstChildElement( const char * value ) const; /** Return a handle to the "index" child with the given name. The first child is 0, the second 1, etc. */ TiXmlHandle Child( const char* value, int index ) const; /** Return a handle to the "index" child. The first child is 0, the second 1, etc. */ TiXmlHandle Child( int index ) const; /** Return a handle to the "index" child element with the given name. The first child element is 0, the second 1, etc. Note that only TiXmlElements are indexed: other types are not counted. */ TiXmlHandle ChildElement( const char* value, int index ) const; /** Return a handle to the "index" child element. The first child element is 0, the second 1, etc. Note that only TiXmlElements are indexed: other types are not counted. */ TiXmlHandle ChildElement( int index ) const; #ifdef TIXML_USE_STL TiXmlHandle FirstChild( const std::string& _value ) const { return FirstChild( _value.c_str() ); } TiXmlHandle FirstChildElement( const std::string& _value ) const { return FirstChildElement( _value.c_str() ); } TiXmlHandle Child( const std::string& _value, int index ) const { return Child( _value.c_str(), index ); } TiXmlHandle ChildElement( const std::string& _value, int index ) const { return ChildElement( _value.c_str(), index ); } #endif /** Return the handle as a TiXmlNode. This may return null. */ TiXmlNode* ToNode() const { return node; } /** Return the handle as a TiXmlElement. This may return null. */ TiXmlElement* ToElement() const { return ( ( node && node->ToElement() ) ? node->ToElement() : 0 ); } /** Return the handle as a TiXmlText. This may return null. */ TiXmlText* ToText() const { return ( ( node && node->ToText() ) ? node->ToText() : 0 ); } /** Return the handle as a TiXmlUnknown. This may return null. */ TiXmlUnknown* ToUnknown() const { return ( ( node && node->ToUnknown() ) ? node->ToUnknown() : 0 ); } /** @deprecated use ToNode. Return the handle as a TiXmlNode. This may return null. */ TiXmlNode* Node() const { return ToNode(); } /** @deprecated use ToElement. Return the handle as a TiXmlElement. This may return null. */ TiXmlElement* Element() const { return ToElement(); } /** @deprecated use ToText() Return the handle as a TiXmlText. This may return null. */ TiXmlText* Text() const { return ToText(); } /** @deprecated use ToUnknown() Return the handle as a TiXmlUnknown. This may return null. */ TiXmlUnknown* Unknown() const { return ToUnknown(); } private: TiXmlNode* node; }; /** Print to memory functionality. The TiXmlPrinter is useful when you need to: -# Print to memory (especially in non-STL mode) -# Control formatting (line endings, etc.) When constructed, the TiXmlPrinter is in its default "pretty printing" mode. Before calling Accept() you can call methods to control the printing of the XML document. After TiXmlNode::Accept() is called, the printed document can be accessed via the CStr(), Str(), and Size() methods. TiXmlPrinter uses the Visitor API. @verbatim TiXmlPrinter printer; printer.SetIndent( "\t" ); doc.Accept( &printer ); fprintf( stdout, "%s", printer.CStr() ); @endverbatim */ class TiXmlPrinter : public TiXmlVisitor { public: TiXmlPrinter() : depth( 0 ), simpleTextPrint( false ), buffer(), indent( " " ), lineBreak( "\n" ) {} virtual bool VisitEnter( const TiXmlDocument& doc ); virtual bool VisitExit( const TiXmlDocument& doc ); virtual bool VisitEnter( const TiXmlElement& element, const TiXmlAttribute* firstAttribute ); virtual bool VisitExit( const TiXmlElement& element ); virtual bool Visit( const TiXmlDeclaration& declaration ); virtual bool Visit( const TiXmlText& text ); virtual bool Visit( const TiXmlComment& comment ); virtual bool Visit( const TiXmlUnknown& unknown ); /** Set the indent characters for printing. By default 4 spaces but tab (\t) is also useful, or null/empty string for no indentation. */ void SetIndent( const char* _indent ) { indent = _indent ? _indent : "" ; } /// Query the indention string. const char* Indent() { return indent.c_str(); } /** Set the line breaking string. By default set to newline (\n). Some operating systems prefer other characters, or can be set to the null/empty string for no indenation. */ void SetLineBreak( const char* _lineBreak ) { lineBreak = _lineBreak ? _lineBreak : ""; } /// Query the current line breaking string. const char* LineBreak() { return lineBreak.c_str(); } /** Switch over to "stream printing" which is the most dense formatting without linebreaks. Common when the XML is needed for network transmission. */ void SetStreamPrinting() { indent = ""; lineBreak = ""; } /// Return the result. const char* CStr() { return buffer.c_str(); } /// Return the length of the result string. size_t Size() { return buffer.size(); } #ifdef TIXML_USE_STL /// Return the result. const std::string& Str() { return buffer; } #endif private: void DoIndent() { for( int i=0; i include. Thanks to Steve Lhomme for that. Changes in version 2.0.0 BETA - Made the ToXXX() casts safe if 'this' is null. When "LoadFile" is called with a filename, the value will correctly get set. Thanks to Brian Yoder. - Fixed bug where isalpha() and isalnum() would get called with a negative value for high ascii numbers. Thanks to Alesky Aksenov. - Fixed some errors codes that were not getting set. - Made methods "const" that were not. - Added a switch to enable or disable the ignoring of white space. ( TiXmlDocument::SetIgnoreWhiteSpace() ) - Greater standardization and code re-use in the parser. - Added a stream out operator. - Added a stream in operator. - Entity support, of predefined entites. &#x entities are untouched by input or output. - Improved text out formatting. - Fixed ReplaceChild bug, thanks to Tao Chen. Changes in version 2.0.1 - Fixed hanging on loading a 0 length file. Thanks to Jeff Scozzafava. - Fixed crashing on InsertBeforeChild and InsertAfterChild. Also possibility of bad links being created by same function. Thanks to Frank De prins. - Added missing licence text. Thanks to Lars Willemsens. - Added include, at the suggestion of Steve Walters. Changes in version 2.1.0 - Yves Berquin brings us the STL switch. The forum on SourceForge, and various emails to me, have long debated all out STL vs. no STL at all. And now you can have it both ways. TinyXml will compile either way. Changes in version 2.1.1 - Compilation warnings. Changes in version 2.1.2 - Uneeded code is not compiled in the STL case. - Changed headers so that STL can be turned on or off in tinyxml.h Changes in version 2.1.3 - Fixed non-const reference in API; now uses a pointer. - Copy constructor of TiXmlString not checking for assignment to self. - Nimrod Cohen found a truly evil bug in the STL implementation that occurs when a string is converted to a c_str and then assigned to self. Search for STL_STRING_BUG for a full description. I'm asserting this is a Microsoft STL bug, since &string and string.c_str() should never be the same. Nevertheless, the code works around it. - Urivan Saaib pointed out a compiler conflict, where the C headers define the isblank macro, which was wiping out the TiXmlString::isblank() method. The method was unused and has been removed. Changes in version 2.1.4 - Reworked the entity code. Entities were not correctly surving round trip input and output. Will now automatically create entities for high ascii in output. Changes in version 2.1.5 - Bug fix by kylotan : infinite loop on some input (tinyxmlparser.cpp rev 1.27) - Contributed by Ivica Aracic (bytelord) : 1 new VC++ project to compile versions as static libraries (tinyxml_lib.dsp), and an example usage in xmltest.dsp (Patch request ID 678605) - A suggestion by Ronald Fenner Jr (dormlock) to add #include and for Apple's Project Builder (Patch request ID 697642) - A patch from ohommes that allows to parse correctly dots in element names and attribute names (Patch request 602600 and kylotan 701728) - A patch from hermitgeek ( James ) and wasteland for improper error reporting - Reviewed by Lee, with the following changes: - Got sick of fighting the STL/non-STL thing in the windows build. Broke them out as seperate projects. - I have too long not included the dsw. Added. - TinyXmlText had a protected Print. Odd. - Made LinkEndChild public, with docs and appropriate warnings. - Updated the docs. 2.2.0 - Fixed an uninitialized pointer in the TiXmlAttributes - Fixed STL compilation problem in MinGW (and gcc 3?) - thanks Brian Yoder for finding this one - Fixed a syntax error in TiXmlDeclaration - thanks Brian Yoder - Fletcher Dunn proposed and submitted new error handling that tracked the row and column. Lee modified it to not have performance impact. - General cleanup suggestions from Fletcher Dunn. - In error handling, general errors will no longer clear the error state of specific ones. - Fix error in documentation : comments starting with ">) has now been fixed. 2.5.2 - Lieven, and others, pointed out a missing const-cast that upset the Open Watcom compiler. Should now be fixed. - ErrorRow and ErrorCol should have been const, and weren't. Fixed thanks to Dmitry Polutov. 2.5.3 - zloe_zlo identified a missing string specialization for QueryValueAttribute() [ 1695429 ]. Worked on this bug, but not sure how to fix it in a safe, cross-compiler way. - increased warning level to 4 and turned on detect 64 bit portability issues for VC2005. May address [ 1677737 ] VS2005: /Wp64 warnings - grosheck identified several problems with the Document copy. Many thanks for [ 1660367 ] - Nice catch, and suggested fix, be Gilad Novik on the Printer dropping entities. "[ 1600650 ] Bug when printing xml text" is now fixed. - A subtle fix from Nicos Gollan in the tinystring initializer: [ 1581449 ] Fix initialiser of TiXmlString::nullrep_ - Great catch, although there isn't a submitter for the bug. [ 1475201 ] TinyXML parses entities in comments. Comments should not, in fact, parse entities. Fixed the code path and added tests. - We were not catching all the returns from ftell. Thanks to Bernard for catching that. wxformbuilder-3.1.59/sdk/plugin_interface/xrcconv.cpp0000644000175000017500000006305311143440026023243 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #include "xrcconv.h" #include "wx/wx.h" #include "wx/tokenzr.h" #include #include #include static wxString StringToXrcText( const wxString &str ) { wxString result; for ( unsigned int i = 0 ; i < str.Length() ; i++ ) { wxChar c = str[i]; switch ( c ) { case wxChar( '\n' ): result = result + wxT( "\\n" ); break; case wxChar( '\t' ): result = result + wxT( "\\t" ); break; case wxChar( '\r' ): result = result + wxT( "\\r" ); break; case wxChar( '\\' ): result = result + wxT( "\\\\" ); break; case wxChar( '_' ): result = result + wxT( "__" ); break; case wxChar( '&' ): result = result + wxT( "_" ); break; default: result = result + c; break; } } return result; } static wxString XrcTextToString( const wxString &str ) { wxString result; for ( unsigned int i = 0 ; i < str.Length() ; i++ ) { wxChar c = str[i]; if ( c == wxChar( '\\' ) && i < str.length() - 1 ) { wxChar next = str[i+1]; switch ( next ) { case wxChar( 'n' ): result = result + wxChar( '\n' ); i++; break; case wxChar( 't' ): result = result + wxChar( '\t' ); i++; break; case wxChar( 'r' ): result = result + wxChar( '\r' ); i++; break; case wxChar( '\\' ): result = result + wxChar( '\\' ); i++; break; } } else if ( c == wxChar( '_' ) ) { if ( i < str.Length() - 1 && str[i+1] == wxChar( '_' ) ) { result = result + wxChar( '_' ); i++; } else result = result + wxChar( '&' ); } else result = result + c; } return result; } static wxString ReplaceSynonymous( const wxString &bitlist ) { IComponentLibrary* lib = GetComponentLibrary( NULL ); wxString result, translation; wxStringTokenizer tkz( bitlist, wxT( "|" ) ); while ( tkz.HasMoreTokens() ) { wxString token; token = tkz.GetNextToken(); token.Trim( true ); token.Trim( false ); if ( result != wxT( "" ) ) result = result + wxChar( '|' ); if ( lib->FindSynonymous( token, translation ) ) result += translation; else result += token; } delete lib; return result; } ObjectToXrcFilter::ObjectToXrcFilter( IObject *obj, const wxString &classname, const wxString &objname, const wxString &base ) { m_obj = obj; m_xrcObj = new ticpp::Element( "object" ); m_xrcObj->SetAttribute( "class", classname.mb_str( wxConvUTF8 ) ); if ( objname != wxT( "" ) ) m_xrcObj->SetAttribute( "name", objname.mb_str( wxConvUTF8 ) ); if ( base != wxT( "" ) ) m_xrcObj->SetAttribute( "base", base.mb_str( wxConvUTF8 ) ); } ObjectToXrcFilter::~ObjectToXrcFilter() { delete m_xrcObj; } void ObjectToXrcFilter::AddProperty( const wxString &objPropName, const wxString &xrcPropName, const int &propType ) { std::string name( xrcPropName.mb_str( wxConvUTF8 ) ); ticpp::Element propElement( name ); switch ( propType ) { case XRC_TYPE_SIZE: case XRC_TYPE_POINT: case XRC_TYPE_BITLIST: LinkText( m_obj->GetPropertyAsString( objPropName ), &propElement ); break; case XRC_TYPE_TEXT: // The text must be converted to XRC format { wxString text = m_obj->GetPropertyAsString( objPropName ); LinkText( text, &propElement, true ); } break; case XRC_TYPE_BOOL: case XRC_TYPE_INTEGER: LinkInteger( m_obj->GetPropertyAsInteger( objPropName ), &propElement ); break; case XRC_TYPE_FLOAT: LinkFloat( m_obj->GetPropertyAsFloat( objPropName ), &propElement ); break; case XRC_TYPE_COLOUR: LinkColour( m_obj->GetPropertyAsColour( objPropName ), &propElement ); break; case XRC_TYPE_FONT: LinkFont( m_obj->GetPropertyAsFont( objPropName ), &propElement ); break; case XRC_TYPE_STRINGLIST: LinkStringList( m_obj->GetPropertyAsArrayString( objPropName ), &propElement ); break; case XRC_TYPE_BITMAP: { wxString bitmapProp = m_obj->GetPropertyAsString( objPropName ); if ( bitmapProp.empty() ) { break; } wxString filename = bitmapProp.BeforeFirst( wxT(';') ); if ( filename.empty() ) { break; } if ( bitmapProp.size() < ( filename.size() + 2 ) ) { break; } wxString source = bitmapProp.substr( filename.size() + 2 ); if ( source.StartsWith( wxT( "Load From File" ) ) ) { LinkText( filename, &propElement ); } } break; } m_xrcObj->LinkEndChild( &propElement ); } void ObjectToXrcFilter::AddPropertyValue ( const wxString &xrcPropName, const wxString &xrcPropValue, bool xrcFormat ) { ticpp::Element propElement( xrcPropName.mb_str( wxConvUTF8 ) ); LinkText( xrcPropValue, &propElement, xrcFormat ); m_xrcObj->LinkEndChild( &propElement ); } void ObjectToXrcFilter::AddPropertyPair ( const wxString& objPropName1, const wxString& objPropName2, const wxString& xrcPropName ) { AddPropertyValue( xrcPropName, wxString::Format( _( "%d,%d" ), m_obj->GetPropertyAsInteger( objPropName1 ), m_obj->GetPropertyAsInteger( objPropName2 ) ) ); } ticpp::Element* ObjectToXrcFilter::GetXrcObject() { return new ticpp::Element( *m_xrcObj ); } void ObjectToXrcFilter::LinkText( const wxString &text, ticpp::Element *propElement, bool xrcFormat ) { wxString value = ( xrcFormat ? StringToXrcText( text ) : text ); propElement->SetText( value.mb_str( wxConvUTF8 ) ); } void ObjectToXrcFilter::LinkInteger( const int &integer, ticpp::Element *propElement ) { propElement->SetText( integer ); } void ObjectToXrcFilter::LinkFloat( const double& value, ticpp::Element* propElement ) { propElement->SetText( value ); } void ObjectToXrcFilter::LinkColour( const wxColour &colour, ticpp::Element *propElement ) { wxString value = wxString::Format( wxT( "#%02x%02x%02x" ), colour.Red(), colour.Green(), colour.Blue() ); propElement->SetText( value.mb_str( wxConvUTF8 ) ); } void ObjectToXrcFilter::LinkFont( const wxFontContainer &font, ticpp::Element *propElement ) { if ( font.GetPointSize() > 0 ) { wxString aux; aux.Printf( wxT( "%d" ), font.GetPointSize() ); ticpp::Element size( "size" ); size.SetText( aux.mb_str( wxConvUTF8 ) ); propElement->LinkEndChild( &size ); } ticpp::Element family( "family" ); switch ( font.GetFamily() ) { case wxFONTFAMILY_DECORATIVE: family.SetText( "decorative" ); break; case wxFONTFAMILY_ROMAN: family.SetText( "roman" ); break; case wxFONTFAMILY_SWISS: family.SetText( "swiss" ); break; case wxFONTFAMILY_SCRIPT: family.SetText( "script" ); break; case wxFONTFAMILY_MODERN: family.SetText( "modern" ); break; case wxFONTFAMILY_TELETYPE: family.SetText( "teletype" ); break; default: family.SetText( "default" ); break; } propElement->LinkEndChild( &family ); ticpp::Element style( "style" ); switch ( font.GetStyle() ) { case wxFONTSTYLE_SLANT: style.SetText( "slant" ); break; case wxFONTSTYLE_ITALIC: style.SetText( "italic" ); break; default: style.SetText( "normal" ); break; } propElement->LinkEndChild( &style ); ticpp::Element weight( "weight" ); switch ( font.GetWeight() ) { case wxFONTWEIGHT_LIGHT: weight.SetText( "light" ); break; case wxFONTWEIGHT_BOLD: weight.SetText( "bold" ); break; default: weight.SetText( "normal" ); break; } propElement->LinkEndChild( &weight ); ticpp::Element underlined( "underlined" ); underlined.SetText( font.GetUnderlined() ? "1" : "0" ); propElement->LinkEndChild( &underlined ); if ( !font.GetFaceName().empty() ) { ticpp::Element face( "face" ); face.SetText( font.GetFaceName().mb_str( wxConvUTF8 ) ); propElement->LinkEndChild( &face ); } } void ObjectToXrcFilter::LinkStringList( const wxArrayString &array, ticpp::Element *propElement, bool xrcFormat ) { for ( size_t i = 0; i < array.GetCount(); i++ ) { wxString value = ( xrcFormat ? StringToXrcText( array[i] ) : array[i] ); ticpp::Element item( "item" ); item.SetText( value.mb_str( wxConvUTF8 ) ); propElement->LinkEndChild( &item ); } } void ObjectToXrcFilter::AddWindowProperties() { wxString style; if ( !m_obj->IsNull( _( "style" ) ) ) style = m_obj->GetPropertyAsString( _T( "style" ) ); if ( !m_obj->IsNull( _( "window_style" ) ) ){ if ( !style.IsEmpty() ) style += _T( '|' ); style += m_obj->GetPropertyAsString( _T( "window_style" ) ); } if ( !style.IsEmpty() ) AddPropertyValue( _T( "style" ), style ); wxString extraStyle; if ( !m_obj->IsNull( _( "extra_style" ) ) ) extraStyle = m_obj->GetPropertyAsString( _T( "extra_style" ) ); if ( !m_obj->IsNull( _( "window_extra_style" ) ) ){ if ( !extraStyle.IsEmpty() ) extraStyle += _T( '|' ); extraStyle += m_obj->GetPropertyAsString( _T( "window_extra_style" ) ); } if ( !extraStyle.IsEmpty() ) AddPropertyValue( _T( "exstyle" ), extraStyle ); if ( !m_obj->IsNull( _( "pos" ) ) ) AddProperty( _( "pos" ), _( "pos" ), XRC_TYPE_SIZE ); if ( !m_obj->IsNull( _( "size" ) ) ) AddProperty( _( "size" ), _( "size" ), XRC_TYPE_SIZE ); if ( !m_obj->IsNull( _( "bg" ) ) ) AddProperty( _( "bg" ), _( "bg" ), XRC_TYPE_COLOUR ); if ( !m_obj->IsNull( _( "fg" ) ) ) AddProperty( _( "fg" ), _( "fg" ), XRC_TYPE_COLOUR ); if ( !m_obj->IsNull( _( "enabled" ) ) && !m_obj->GetPropertyAsInteger( _( "enabled" ) ) ) AddProperty( _( "enabled" ), _( "enabled" ), XRC_TYPE_BOOL ); if ( !m_obj->IsNull( _( "focused" ) ) ) AddPropertyValue( _( "focused" ), _( "0" ) ); if ( !m_obj->IsNull( _( "hidden" ) ) && m_obj->GetPropertyAsInteger( _( "hidden" ) ) ) AddProperty( _( "hidden" ), _( "hidden" ), XRC_TYPE_BOOL ); if ( !m_obj->IsNull( _( "font" ) ) ) AddProperty( _( "font" ), _( "font" ), XRC_TYPE_FONT ); if ( !m_obj->IsNull( _( "tooltip" ) ) ) AddProperty( _( "tooltip" ), wxT( "tooltip" ), XRC_TYPE_TEXT ); if ( !m_obj->IsNull( _( "subclass" ) ) ) { wxString subclass = m_obj->GetChildFromParentProperty( _( "subclass" ), wxT( "name" ) ); if ( !subclass.empty() ) { m_xrcObj->SetAttribute( "subclass", subclass.mb_str( wxConvUTF8 ) ); } } }; /////////////////////////////////////////////////////////////////////////////// XrcToXfbFilter::XrcToXfbFilter( ticpp::Element *obj, const wxString &/*classname*/, const wxString &objname ) { m_xrcObj = obj; m_xfbObj = new ticpp::Element( "object" ); try { std::string name; obj->GetAttribute( "class", &name ); m_xfbObj->SetAttribute( "class", name ); } catch( ticpp::Exception& ex ) { wxLogDebug( wxString( ex.m_details.c_str(), wxConvUTF8 ) ); } if ( !objname.empty() ) AddProperty( wxT( "name" ), objname, XRC_TYPE_TEXT ); } XrcToXfbFilter::XrcToXfbFilter( ticpp::Element *obj, const wxString &classname ) { m_xrcObj = obj; m_xfbObj = new ticpp::Element( "object" ); m_xfbObj->SetAttribute( "class", classname.mb_str( wxConvUTF8 ) ); try { std::string name; obj->GetAttribute( "name", &name ); wxString objname( name.c_str(), wxConvUTF8 ); AddPropertyValue( wxT( "name" ), objname ); } catch( ticpp::Exception& ex ) { wxLogDebug( wxString( ex.m_details.c_str(), wxConvUTF8 ) ); } } XrcToXfbFilter::~XrcToXfbFilter() { delete m_xfbObj; } ticpp::Element* XrcToXfbFilter::GetXrcProperty( const wxString &name ) { return m_xrcObj->FirstChildElement( name.mb_str( wxConvUTF8 ) ); } void XrcToXfbFilter::AddProperty( const wxString &xrcPropName, const wxString &xfbPropName, const int &propType ) { ticpp::Element propElement( "property" ); propElement.SetAttribute( "name", xfbPropName.mb_str( wxConvUTF8 ) ); switch ( propType ) { case XRC_TYPE_SIZE: case XRC_TYPE_POINT: case XRC_TYPE_BOOL: ImportTextProperty( xrcPropName, &propElement ); break; case XRC_TYPE_TEXT: ImportTextProperty( xrcPropName, &propElement, true ); break; case XRC_TYPE_INTEGER: ImportIntegerProperty( xrcPropName, &propElement ); break; case XRC_TYPE_FLOAT: ImportFloatProperty( xrcPropName, &propElement ); break; case XRC_TYPE_BITLIST: ImportBitlistProperty( xrcPropName, &propElement ); break; case XRC_TYPE_COLOUR: ImportColourProperty( xrcPropName, &propElement ); break; case XRC_TYPE_FONT: ImportFontProperty( xrcPropName, &propElement ); break; case XRC_TYPE_STRINGLIST: ImportStringListProperty( xrcPropName, &propElement, true ); break; case XRC_TYPE_BITMAP: ImportBitmapProperty( xrcPropName, &propElement ); break; } m_xfbObj->LinkEndChild( &propElement ); } void XrcToXfbFilter::AddPropertyValue ( const wxString &xfbPropName, const wxString &xfbPropValue, bool parseXrcText ) { ticpp::Element propElement( "property" ); propElement.SetAttribute( "name", xfbPropName.mb_str( wxConvUTF8 ) ); wxString value = ( parseXrcText ? XrcTextToString( xfbPropValue ) : xfbPropValue ); propElement.SetText( value.mb_str( wxConvUTF8 ) ); m_xfbObj->LinkEndChild( &propElement ); } void XrcToXfbFilter::AddStyleProperty() { try { ticpp::Element *xrcProperty = m_xrcObj->FirstChildElement( "style" ); wxString bitlist = wxString( xrcProperty->GetText().c_str(), wxConvUTF8 ); bitlist = ReplaceSynonymous( bitlist ); // FIXME: We should avoid hardcoding these things std::set< wxString > windowStyles; windowStyles.insert( wxT( "wxSIMPLE_BORDER" ) ); windowStyles.insert( wxT( "wxDOUBLE_BORDER" ) ); windowStyles.insert( wxT( "wxSUNKEN_BORDER" ) ); windowStyles.insert( wxT( "wxRAISED_BORDER" ) ); windowStyles.insert( wxT( "wxSTATIC_BORDER" ) ); windowStyles.insert( wxT( "wxNO_BORDER" ) ); windowStyles.insert( wxT( "wxTRANSPARENT_WINDOW" ) ); windowStyles.insert( wxT( "wxTAB_TRAVERSAL" ) ); windowStyles.insert( wxT( "wxWANTS_CHARS" ) ); windowStyles.insert( wxT( "wxVSCROLL" ) ); windowStyles.insert( wxT( "wxHSCROLL" ) ); windowStyles.insert( wxT( "wxALWAYS_SHOW_SB" ) ); windowStyles.insert( wxT( "wxCLIP_CHILDREN" ) ); windowStyles.insert( wxT( "wxFULL_REPAINT_ON_RESIZE" ) ); wxString style, windowStyle; wxStringTokenizer tkz( bitlist, wxT( " |" ) ); while ( tkz.HasMoreTokens() ) { wxString token; token = tkz.GetNextToken(); token.Trim( true ); token.Trim( false ); if ( windowStyles.find( token ) == windowStyles.end() ) { if ( !style.IsEmpty() ) style += _T( "|" ); style += token; } else { if ( !windowStyle.IsEmpty() ) windowStyle += _T( "|" ); windowStyle += token; } } if ( !style.empty() ) { AddPropertyValue( wxT( "style" ), style ); } AddPropertyValue( wxT( "window_style" ), windowStyle ); } catch( ticpp::Exception& ex ) { wxLogDebug( wxString( ex.m_details.c_str(), wxConvUTF8 ) ); } } void XrcToXfbFilter::AddExtraStyleProperty() { try { ticpp::Element *xrcProperty = m_xrcObj->FirstChildElement( "exstyle" ); wxString bitlist = wxString( xrcProperty->GetText().c_str(), wxConvUTF8 ); bitlist = ReplaceSynonymous( bitlist ); // FIXME: We should avoid hardcoding these things std::set< wxString > windowStyles; windowStyles.insert( wxT( "wxWS_EX_VALIDATE_RECURSIVELY" ) ); windowStyles.insert( wxT( "wxWS_EX_BLOCK_EVENTS" ) ); windowStyles.insert( wxT( "wxWS_EX_TRANSIENT" ) ); windowStyles.insert( wxT( "wxWS_EX_PROCESS_IDLE" ) ); windowStyles.insert( wxT( "wxWS_EX_PROCESS_UI_UPDATES" ) ); wxString style, windowStyle; wxStringTokenizer tkz( bitlist, wxT( " |" ) ); while ( tkz.HasMoreTokens() ) { wxString token; token = tkz.GetNextToken(); token.Trim( true ); token.Trim( false ); if ( windowStyles.find( token ) == windowStyles.end() ) { if ( !style.IsEmpty() ) style += _T( "|" ); style += token; } else { if ( !windowStyle.IsEmpty() ) windowStyle += _T( "|" ); windowStyle += token; } } if ( !style.empty() ) { AddPropertyValue( wxT( "extra_style" ), style ); } AddPropertyValue( wxT( "window_extra_style" ), windowStyle ); } catch( ticpp::Exception& ex ) { wxLogDebug( wxString( ex.m_details.c_str(), wxConvUTF8 ) ); } } void XrcToXfbFilter::AddPropertyPair( const char* xrcPropName, const wxString& xfbPropName1, const wxString& xfbPropName2 ) { try { ticpp::Element* pairProp = m_xrcObj->FirstChildElement( xrcPropName ); wxString width = wxEmptyString; wxString height = wxEmptyString; wxStringTokenizer tkz( wxString( pairProp->GetText().c_str(), wxConvUTF8 ), wxT( "," ) ); if ( tkz.HasMoreTokens() ) { width = tkz.GetNextToken(); if ( tkz.HasMoreTokens() ) { height = tkz.GetNextToken(); } } AddPropertyValue( xfbPropName1, width ); AddPropertyValue( xfbPropName2, height ); } catch( ticpp::Exception& ex ) { wxLogDebug( wxString( ex.m_details.c_str(), wxConvUTF8 ) ); } } ticpp::Element* XrcToXfbFilter::GetXfbObject() { return m_xfbObj->Clone().release()->ToElement(); } //----------------------------- void XrcToXfbFilter::ImportTextProperty( const wxString &xrcPropName, ticpp::Element *property, bool parseXrcText ) { try { ticpp::Element *xrcProperty = m_xrcObj->FirstChildElement( xrcPropName.mb_str( wxConvUTF8 ) ); // Convert XRC text to normal text wxString value( wxString( xrcProperty->GetText().c_str(), wxConvUTF8 ) ); if ( parseXrcText ) value = XrcTextToString( value ); property->SetText( value.mb_str( wxConvUTF8 ) ); } catch( ticpp::Exception& ex ) { wxLogDebug( wxString( ex.m_details.c_str(), wxConvUTF8 ) ); } } void XrcToXfbFilter::ImportIntegerProperty( const wxString &xrcPropName, ticpp::Element *property ) { try { ticpp::Element *xrcProperty = m_xrcObj->FirstChildElement( xrcPropName.mb_str( wxConvUTF8 ) ); property->SetText( xrcProperty->GetText() ); } catch( ticpp::Exception& ) { property->SetText( "0" ); } } void XrcToXfbFilter::ImportFloatProperty( const wxString &xrcPropName, ticpp::Element *property ) { try { ticpp::Element *xrcProperty = m_xrcObj->FirstChildElement( xrcPropName.mb_str( wxConvUTF8 ) ); property->SetText( xrcProperty->GetText() ); } catch( ticpp::Exception& ) { property->SetText( "0.0" ); } } void XrcToXfbFilter::ImportBitlistProperty( const wxString &xrcPropName, ticpp::Element *property ) { try { ticpp::Element *xrcProperty = m_xrcObj->FirstChildElement( xrcPropName.mb_str( wxConvUTF8 ) ); wxString bitlist = wxString( xrcProperty->GetText().c_str(), wxConvUTF8 ); bitlist = ReplaceSynonymous( bitlist ); property->SetText( bitlist.mb_str( wxConvUTF8 ) ); } catch( ticpp::Exception& ex ) { wxLogDebug( wxString( ex.m_details.c_str(), wxConvUTF8 ) ); } } void XrcToXfbFilter::ImportFontProperty( const wxString &xrcPropName, ticpp::Element *property ) { try { ticpp::Element *xrcProperty = m_xrcObj->FirstChildElement( xrcPropName.mb_str( wxConvUTF8 ) ); ticpp::Element *element; wxFontContainer font; // the size try { element = xrcProperty->FirstChildElement( "size" ); long size; element->GetText( &size ); font.SetPointSize( size ); } catch( ticpp::Exception& ex ) { wxLogDebug( wxString( ex.m_details.c_str(), wxConvUTF8 ) ); } // the family try { element = xrcProperty->FirstChildElement( "family" ); wxString family_str( element->GetText().c_str(), wxConvUTF8 ); if ( family_str == _( "decorative" ) ) font.SetFamily( wxDECORATIVE ); else if ( family_str == _( "roman" ) ) font.SetFamily( wxROMAN ); else if ( family_str == _( "swiss" ) ) font.SetFamily( wxSWISS ); else if ( family_str == _( "script" ) ) font.SetFamily( wxSCRIPT ); else if ( family_str == _( "modern" ) ) font.SetFamily( wxMODERN ); else if ( family_str == _( "teletype" ) ) font.SetFamily( wxTELETYPE ); else font.SetFamily( wxDEFAULT ); } catch( ticpp::Exception& ) { font.SetFamily( wxDEFAULT ); } // the style try { element = xrcProperty->FirstChildElement( "style" ); wxString style_str( element->GetText().c_str(), wxConvUTF8 ); if ( style_str == _( "slant" ) ) font.SetStyle( wxSLANT ); else if ( style_str == _( "italic" ) ) font.SetStyle( wxITALIC ); else font.SetStyle( wxNORMAL ); } catch( ticpp::Exception& ) { font.SetStyle( wxNORMAL ); } // weight try { element = xrcProperty->FirstChildElement( "weight" ); wxString weight_str( element->GetText().c_str(), wxConvUTF8 ); if ( weight_str == _( "light" ) ) font.SetWeight( wxLIGHT ); else if ( weight_str == _( "bold" ) ) font.SetWeight( wxBOLD ); else font.SetWeight( wxNORMAL ); } catch( ticpp::Exception& ) { font.SetWeight( wxNORMAL ); } // underlined try { element = xrcProperty->FirstChildElement( "underlined" ); wxString underlined_str( element->GetText().c_str(), wxConvUTF8 ); if ( underlined_str == wxT( "1" ) ) font.SetUnderlined( true ); else font.SetUnderlined( false ); } catch( ticpp::Exception& ) { font.SetUnderlined( false ); } // face try { element = xrcProperty->FirstChildElement( "face" ); wxString face( element->GetText().c_str(), wxConvUTF8 ); font.SetFaceName( face ); } catch( ticpp::Exception& ) { font.SetFaceName( wxEmptyString ); } // We already have the font type. So we must now use the wxFB format wxString font_str = wxString::Format( wxT("%s,%d,%d,%d,%d,%d"), font.GetFaceName().c_str(), font.GetStyle(), font.GetWeight(), font.GetPointSize(), font.GetFamily(), font.GetUnderlined() ); property->SetText( font_str.mb_str( wxConvUTF8 ) ); } catch( ticpp::Exception& ex ) { wxLogDebug( wxString( ex.m_details.c_str(), wxConvUTF8 ) ); } } void XrcToXfbFilter::ImportBitmapProperty( const wxString &xrcPropName, ticpp::Element *property ) { try { ticpp::Element *xrcProperty = m_xrcObj->FirstChildElement( xrcPropName.mb_str( wxConvUTF8 ) ); wxString res( xrcProperty->GetText().c_str(), wxConvUTF8 ); res.Trim(); res += wxT( "; Load From File" ); property->SetText( res.mb_str( wxConvUTF8 ) ); } catch( ticpp::Exception& ex ) { wxLogDebug( wxString( ex.m_details.c_str(), wxConvUTF8 ) ); } } void XrcToXfbFilter::ImportColourProperty( const wxString &xrcPropName, ticpp::Element *property ) { try { ticpp::Element *xrcProperty = m_xrcObj->FirstChildElement( xrcPropName.mb_str( wxConvUTF8 ) ); std::string value = xrcProperty->GetText(); // Changing "#rrggbb" format to "rrr,ggg,bbb" std::string hexColour = "0x" + value.substr( 1, 2 ) + " 0x" + value.substr( 3, 2 ) + " 0x" + value.substr( 5, 2 ); std::istringstream strIn; std::ostringstream strOut; unsigned int red, green, blue; strIn.str( hexColour ); strIn >> std::hex; strIn >> red; strIn >> green; strIn >> blue; strOut << red << "," << green << "," << blue; property->SetText( strOut.str() ); } catch( ticpp::Exception& ex ) { wxLogDebug( wxString( ex.m_details.c_str(), wxConvUTF8 ) ); } } void XrcToXfbFilter::ImportStringListProperty( const wxString &xrcPropName, ticpp::Element *property , bool parseXrcText ) { try { ticpp::Element *xrcProperty = m_xrcObj->FirstChildElement( xrcPropName.mb_str( wxConvUTF8 ) ); wxString res; ticpp::Element *element = xrcProperty->FirstChildElement( "item", false ); while ( element ) { try { wxString value( element->GetText().c_str(), wxConvUTF8 ); if ( parseXrcText ) value = XrcTextToString( value ); res += wxChar( '\"' ) + value + wxT( "\" " ); } catch( ticpp::Exception& ex ) { wxLogDebug( wxT("%s. line: %i"), wxString( ex.m_details.c_str(), wxConvUTF8 ).c_str(), __LINE__ ); } element = element->NextSiblingElement( "item", false ); } res.Trim(); property->SetText( res.mb_str( wxConvUTF8 ) ); } catch( ticpp::Exception& ex ) { wxLogDebug( wxT("%s. line: %i"), wxString( ex.m_details.c_str(), wxConvUTF8 ).c_str(), __LINE__ ); } } void XrcToXfbFilter::AddWindowProperties() { AddProperty( _( "pos" ), _( "pos" ), XRC_TYPE_POINT ); AddProperty( _( "size" ), _( "size" ), XRC_TYPE_SIZE ); AddProperty( _( "bg" ), _( "bg" ), XRC_TYPE_COLOUR ); AddProperty( _( "fg" ), _( "fg" ), XRC_TYPE_COLOUR ); AddProperty( _( "font" ), _( "font" ), XRC_TYPE_FONT ); if ( m_xrcObj->FirstChildElement( "enabled", false ) ) { AddProperty( _( "enabled"), _("enabled"), XRC_TYPE_BOOL ); } AddProperty( _( "hidden"), _("hidden"), XRC_TYPE_BOOL ); AddProperty( _( "tooltip"), _("tooltip"), XRC_TYPE_TEXT ); AddStyleProperty(); AddExtraStyleProperty(); // Subclass std::string subclass; m_xrcObj->GetAttribute( "subclass", &subclass, false ); if ( !subclass.empty() ) { ticpp::Element propElement( "property" ); propElement.SetAttribute( "name", "subclass" ); propElement.SetText( subclass ); m_xfbObj->LinkEndChild( &propElement ); } }; wxformbuilder-3.1.59/sdk/plugin_interface/fontcontainer.h0000644000175000017500000000653111143440026024075 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // Ryan Mulder - rjmyst3@gmail.com // /////////////////////////////////////////////////////////////////////////////// #ifndef __WXFONTCONTAINER__ #define __WXFONTCONTAINER__ #include /** @class wxFontContainer @brief Because the class wxFont cannot be a container for invalid font data (like default values). */ class wxFontContainer : public wxObject { public: int m_pointSize; ///< Point Size int m_family; ///< Family int m_style; ///< Style int m_weight; ///< Weight bool m_underlined; ///< Underlined wxString m_faceName; ///< Face Name inline void InitDefaults() { m_pointSize = -1; m_family = wxFONTFAMILY_DEFAULT; m_style = wxFONTSTYLE_NORMAL; m_weight = wxFONTWEIGHT_NORMAL; m_underlined = false; m_faceName = wxEmptyString; } wxFontContainer() { InitDefaults(); } inline wxFontContainer( const wxFont& font ) { if ( !font.IsOk() ) { InitDefaults(); } else { m_pointSize = font.GetPointSize(); m_family = font.GetFamily(); m_style = font.GetStyle(); m_weight = font.GetWeight(); m_underlined = font.GetUnderlined(); m_faceName = font.GetFaceName(); } } inline wxFontContainer( int pointSize, int family = wxFONTFAMILY_DEFAULT, int style = wxFONTSTYLE_NORMAL, int weight = wxFONTWEIGHT_NORMAL, bool underlined = false, const wxString& faceName = wxEmptyString ) : m_pointSize( pointSize ), m_family( family ), m_style( style ), m_weight( weight ), m_underlined( underlined ), m_faceName( faceName ) { } wxFont GetFont() const { int pointSize = m_pointSize <= 0 ? wxNORMAL_FONT->GetPointSize() : m_pointSize; return wxFont( pointSize, m_family, m_style, m_weight, m_underlined, m_faceName ); } // Duplicate wxFont's interface for backward compatiblity #define MAKE_GET_AND_SET( NAME, TYPE, VARIABLE ) \ TYPE Get##NAME() const { return VARIABLE; } \ void Set##NAME( TYPE value ){ VARIABLE = value; } MAKE_GET_AND_SET( PointSize, int, m_pointSize ) MAKE_GET_AND_SET( Family, int, m_family ) MAKE_GET_AND_SET( Style, int, m_style ) MAKE_GET_AND_SET( Weight, int, m_weight ) MAKE_GET_AND_SET( Underlined, bool, m_underlined ) MAKE_GET_AND_SET( FaceName, wxString, m_faceName ) // Allow implicit cast to wxFont operator wxFont() const { return GetFont(); } }; #endif //__WXFONTCONTAINER__ wxformbuilder-3.1.59/sdk/plugin_interface/premake.lua0000644000175000017500000002114411143440026023177 0ustar rrmulderrrmulder--***************************************************************************** --* Author: RJP Computing --* Date: 12/15/2006 --* Version: 1.00-beta --* Copyright (C) 2006 RJP Computing --* --* This program is free software; you can redistribute it and/or --* modify it under the terms of the GNU General Public License --* as published by the Free Software Foundation; either version 2 --* of the License, or (at your option) any later version. --* --* This program is distributed in the hope that it will be useful, --* but WITHOUT ANY WARRANTY; without even the implied warranty of --* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --* GNU General Public License for more details. --* --* You should have received a copy of the GNU General Public License --* along with this program; if not, write to the Free Software --* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --* --* NOTES: --* - use the '/' slash for all paths. --***************************************************************************** -- wxWidgets version local wx_ver = "28" --******* Initial Setup ************ --* Most of the setting are set here. --********************************** -- Set the name of your package. package.name = "plugin-interface" -- Set this if you want a different name for your target than the package's name. local targetName = "fbPluginInterface" -- Set the kind of package you want to create. -- Options: exe | winexe | lib | dll package.kind = "lib" -- Set the files to include. package.files = { matchrecursive( "*.cpp", "*.h", "*.rc" ) } -- Set the include paths. package.includepaths = { "../tinyxml" } -- Set the libraries it links to. package.links = { "TiCPP" } package.libdir = "../lib" -- Set the defines. package.defines = { "TIXML_USE_TICPP" } -- Hack the dll output to prefix 'lib' to the begining. package.targetprefix = "lib" --------------------------- DO NOT EDIT BELOW ---------------------------------- --******* GENAERAL SETUP ********** --* Settings that are not dependant --* on the operating system. --********************************* -- Package options addoption( "unicode", "Use the Unicode character set" ) addoption( "with-wx-shared", "Link against wxWidgets as a shared library" ) if ( not windows ) then addoption( "disable-wx-debug", "Compile against a wxWidgets library without debugging" ) end -- Common setup package.language = "c++" -- Set object output directory. if ( options["unicode"] ) then package.config["Debug"].objdir = ".objsud" package.config["Release"].objdir = ".objsu" else package.config["Debug"].objdir = ".objsd" package.config["Release"].objdir = ".objs" end -- Set debug flags if ( options["disable-wx-debug"] and ( not windows ) ) then debug_option = "--debug=no" debug_macro = { "NDEBUG", "__WXFB_DEBUG__" } else debug_option = "--debug=yes" debug_macro = { "DEBUG", "_DEBUG", "__WXDEBUG__", "__WXFB_DEBUG__"} end -- Set the default targetName if none is specified. if ( string.len( targetName ) == 0 ) then targetName = package.name end -- Set the targets. package.config["Release"].target = targetName package.config["Debug"].target = targetName.."d" -- Set the build options. package.buildflags = { "extra-warnings" } package.config["Release"].buildflags = { "no-symbols", "optimize-speed" } if ( options["unicode"] ) then table.insert( package.buildflags, "unicode" ) end if ( string.find( target or "", ".*-gcc" ) or target == "gnu" ) then table.insert( package.config["Debug"].buildoptions, "-O0" ) table.insert( package.config["Release"].buildoptions, "-fno-strict-aliasing" ) end -- Set the defines. if ( options["with-wx-shared"] ) then table.insert( package.defines, "WXUSINGDLL" ) end if ( options["unicode"] ) then table.insert( package.defines, { "UNICODE", "_UNICODE" } ) end table.insert( package.defines, "__WX__" ) table.insert( package.config["Debug"].defines, debug_macro ) table.insert( package.config["Release"].defines, "NDEBUG" ) if ( windows ) then --******* WINDOWS SETUP *********** --* Settings that are Windows specific. --********************************* -- Set wxWidgets include paths if ( target == "cb-gcc" ) then table.insert( package.includepaths, "$(#WX.include)" ) else table.insert( package.includepaths, "$(WXWIN)/include" ) end -- Set the correct 'setup.h' include path. if ( options["with-wx-shared"] ) then if ( options["unicode"] ) then if ( target == "cb-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(#WX.lib)/gcc_dll/mswud" ) table.insert( package.config["Release"].includepaths, "$(#WX.lib)/gcc_dll/mswu" ) elseif ( target == "gnu" or target == "cl-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/gcc_dll/mswud" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/gcc_dll/mswu" ) else table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/vc_dll/mswud" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/vc_dll/mswu" ) end else if ( target == "cb-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(#WX.lib)/gcc_dll/mswd" ) table.insert( package.config["Release"].includepaths, "$(#WX.lib)/gcc_dll/msw" ) elseif ( target == "gnu" or target == "cl-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/gcc_dll/mswd" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/gcc_dll/msw" ) else table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/vc_dll/mswd" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/vc_dll/msw" ) end end else if ( options["unicode"] ) then if ( target == "cb-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(#WX.lib)/gcc_lib/mswud" ) table.insert( package.config["Release"].includepaths, "$(#WX.lib)/gcc_lib/mswu" ) elseif ( target == "gnu" or target == "cl-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/gcc_lib/mswud" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/gcc_lib/mswu" ) else table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/vc_lib/mswud" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/vc_lib/mswu" ) end else if ( target == "cb-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(#WX.lib)/gcc_lib/mswd" ) table.insert( package.config["Release"].includepaths, "$(#WX.lib)/gcc_lib/msw" ) elseif ( target == "gnu" or target == "cl-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/gcc_lib/mswd" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/gcc_lib/msw" ) else table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/vc_lib/mswd" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/vc_lib/msw" ) end end end -- Set the linker options. if ( options["with-wx-shared"] ) then if ( target == "cb-gcc" ) then table.insert( package.libpaths, "$(#WX.lib)/gcc_dll" ) elseif ( target == "gnu" or target == "cl-gcc" ) then table.insert( package.libpaths, "$(WXWIN)/lib/gcc_dll" ) else table.insert( package.libpaths, "$(WXWIN)/lib/vc_dll" ) end else if ( target == "cb-gcc" ) then table.insert( package.libpaths, "$(#WX.lib)/gcc_lib" ) elseif ( target == "gnu" or target == "cl-gcc" ) then table.insert( package.libpaths, "$(WXWIN)/lib/gcc_lib" ) else table.insert( package.libpaths, "$(WXWIN)/lib/vc_lib" ) end end -- Set wxWidgets libraries to link. if ( options["unicode"] ) then table.insert( package.config["Release"].links, "wxmsw"..wx_ver.."u" ) table.insert( package.config["Debug"].links, "wxmsw"..wx_ver.."ud" ) else table.insert( package.config["Release"].links, "wxmsw"..wx_ver ) table.insert( package.config["Debug"].links, "wxmsw"..wx_ver.."d" ) end -- Set the Windows defines. table.insert( package.defines, { "__WXMSW__", "WIN32", "_WINDOWS" } ) else --******* LINUX SETUP ************* --* Settings that are Linux specific. --********************************* -- Ignore resource files in Linux. table.insert( package.excludes, matchrecursive( "*.rc" ) ) table.insert( package.buildoptions, "-fPIC" ) -- Set wxWidgets build options. table.insert( package.config["Debug"].buildoptions, "`wx-config "..debug_option.." --cflags`" ) table.insert( package.config["Release"].buildoptions, "`wx-config --debug=no --cflags`" ) -- Set the wxWidgets link options. table.insert( package.config["Debug"].linkoptions, "`wx-config "..debug_option.." --libs`" ) table.insert( package.config["Release"].linkoptions, "`wx-config --libs`" ) end wxformbuilder-3.1.59/sdk/plugin_interface/plugin.h0000644000175000017500000001231011143440026022512 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #ifndef __PLUGIN_H__ #define __PLUGIN_H__ #include "component.h" #include "wx/wx.h" #include #include // Library implementation. This module must be implemented inside the library, // instead of linking it as an object for doing the plugin. // We will make a template so that the preprocessor implements the library inside // the module itself. class ComponentLibrary : public IComponentLibrary { private: typedef struct { wxString name; IComponent *component; }AComponent; typedef struct { wxString name; int value; } AMacro; typedef struct { wxString name, syn; } ASynonymous; std::vector m_components; std::vector m_macros; typedef std::map SynMap; SynMap m_synMap; public: virtual ~ComponentLibrary() { std::vector< AComponent >::reverse_iterator component; for ( component = m_components.rbegin(); component != m_components.rend(); ++component ) { delete component->component; } } void RegisterComponent( const wxString& text, IComponent* c ) { AComponent comp; comp.component = c; comp.name = text; m_components.push_back(comp); } void RegisterMacro(const wxString &text, const int value) { AMacro macro; macro.name = text; macro.value = value; m_macros.push_back(macro); } void RegisterMacroSynonymous(const wxString &syn, const wxString &name) { /*ASynonymous asyn; asyn.name = name; asyn.syn = syn; m_synonymous.push_back(asyn);*/ m_synMap.insert(SynMap::value_type(syn, name)); } IComponent* GetComponent(unsigned int idx) { if (idx < m_components.size()) return m_components[idx].component; return NULL; } wxString GetComponentName(unsigned int idx) { if (idx < m_components.size()) return m_components[idx].name; return wxString(); } wxString GetMacroName(unsigned int idx) { if (idx < m_macros.size()) return m_macros[idx].name; return wxString(); } int GetMacroValue(unsigned int idx) { if (idx < m_macros.size()) return m_macros[idx].value; return 0; } /*wxString GetMacroSynonymous(unsigned int idx) { if (idx < m_synonymous.size()) return m_synonymous[idx].syn; return wxString(); } wxString GetSynonymousName(unsigned int idx) { if (idx < m_synonymous.size()) return m_synonymous[idx].name; return wxString(); }*/ bool FindSynonymous(const wxString& syn, wxString& trans) { bool found = false; SynMap::iterator it = m_synMap.find(syn); if (it != m_synMap.end()) { found = true; trans = it->second; } return found; } unsigned int GetMacroCount() { return (unsigned int)m_macros.size(); } unsigned int GetComponentCount() { return (unsigned int)m_components.size(); } /*unsigned int GetSynonymousCount() { return m_synonymous.size(); }*/ }; /** * Base class for components */ class ComponentBase : public IComponent { private: int m_type; IManager* m_manager; public: ComponentBase() : m_type( 0 ), m_manager( NULL ) {} void __SetComponentType( int type ) { m_type = ( type >= 0 && type <= 2 ? type : COMPONENT_TYPE_ABSTRACT ); } void __SetManager( IManager* manager ) { m_manager = manager; } IManager* GetManager() { return m_manager; } wxObject* Create( IObject* /*obj*/, wxObject* /*parent*/ ) { return m_manager->NewNoObject(); /* Even components which are not visible must be unique in the map */ } void Cleanup( wxObject* obj ) { wxWindow* window = dynamic_cast< wxWindow* >( obj ); if ( window != 0 ) { if ( window->GetEventHandler() != window ) { window->PopEventHandler( true ); } } } void OnCreated( wxObject* /*wxobject*/, wxWindow* /*wxparent*/ ) { } void OnSelected( wxObject* /*wxobject*/ ) { } ticpp::Element* ExportToXrc(IObject* /*obj*/) { return NULL; } ticpp::Element* ImportFromXrc(ticpp::Element* /*xrcObj*/) { return NULL; } int GetComponentType() { return m_type; } }; #endif // __PLUGIN_H__ wxformbuilder-3.1.59/sdk/plugin_interface/Makefile0000644000175000017500000000571311143440026022514 0ustar rrmulderrrmulder# C++ Shared Library Makefile autogenerated by premake # Don't edit this file! Instead edit `premake.lua` then rerun `make` ifndef CONFIG CONFIG=Release endif ifeq ($(CONFIG),Release) BINDIR := ../../output/lib/wxformbuilder LIBDIR := ../lib OBJDIR := .objsu OUTDIR := ../lib CPPFLAGS := -MMD -D "TIXML_USE_TICPP" -D "WXUSINGDLL" -D "UNICODE" -D "_UNICODE" -D "__WX__" -D "NDEBUG" -I "../tinyxml" CFLAGS += $(CPPFLAGS) $(TARGET_ARCH) -O3 -Wall -fPIC -fno-strict-aliasing `wx-config --debug=no --cflags` CXXFLAGS := $(CFLAGS) LDFLAGS += -L$(BINDIR) -L$(LIBDIR) -s `wx-config --libs` -lticpp LDDEPS := ../lib/libticpp.a RESFLAGS := -D "TIXML_USE_TICPP" -D "WXUSINGDLL" -D "UNICODE" -D "_UNICODE" -D "__WX__" -D "NDEBUG" -I "../tinyxml" TARGET := libfbPluginInterface.a BLDCMD = ar -rcs $(OUTDIR)/$(TARGET) $(OBJECTS) $(TARGET_ARCH) endif ifeq ($(CONFIG),Debug) BINDIR := ../../output/lib/wxformbuilder LIBDIR := ../lib OBJDIR := .objsud OUTDIR := ../lib CPPFLAGS := -MMD -D "TIXML_USE_TICPP" -D "WXUSINGDLL" -D "UNICODE" -D "_UNICODE" -D "__WX__" -D "NDEBUG" -D "__WXFB_DEBUG__" -I "../tinyxml" CFLAGS += $(CPPFLAGS) $(TARGET_ARCH) -g -Wall -fPIC -O0 `wx-config --debug=no --cflags` CXXFLAGS := $(CFLAGS) LDFLAGS += -L$(BINDIR) -L$(LIBDIR) `wx-config --debug=no --libs` -lticppd LDDEPS := ../lib/libticppd.a RESFLAGS := -D "TIXML_USE_TICPP" -D "WXUSINGDLL" -D "UNICODE" -D "_UNICODE" -D "__WX__" -D "NDEBUG" -D "__WXFB_DEBUG__" -I "../tinyxml" TARGET := libfbPluginInterfaced.a BLDCMD = ar -rcs $(OUTDIR)/$(TARGET) $(OBJECTS) $(TARGET_ARCH) endif OBJECTS := \ $(OBJDIR)/xrcconv.o \ MKDIR_TYPE := msdos CMD := $(subst \,\\,$(ComSpec)$(COMSPEC)) ifeq (,$(CMD)) MKDIR_TYPE := posix endif ifeq (/bin/sh.exe,$(SHELL)) MKDIR_TYPE := posix endif ifeq ($(MKDIR_TYPE),posix) CMD_MKBINDIR := mkdir -p $(BINDIR) CMD_MKLIBDIR := mkdir -p $(LIBDIR) CMD_MKOUTDIR := mkdir -p $(OUTDIR) CMD_MKOBJDIR := mkdir -p $(OBJDIR) else CMD_MKBINDIR := $(CMD) /c if not exist $(subst /,\\,$(BINDIR)) mkdir $(subst /,\\,$(BINDIR)) CMD_MKLIBDIR := $(CMD) /c if not exist $(subst /,\\,$(LIBDIR)) mkdir $(subst /,\\,$(LIBDIR)) CMD_MKOUTDIR := $(CMD) /c if not exist $(subst /,\\,$(OUTDIR)) mkdir $(subst /,\\,$(OUTDIR)) CMD_MKOBJDIR := $(CMD) /c if not exist $(subst /,\\,$(OBJDIR)) mkdir $(subst /,\\,$(OBJDIR)) endif .PHONY: clean $(OUTDIR)/$(TARGET): $(OBJECTS) $(LDDEPS) $(RESOURCES) @echo Linking plugin-interface -@$(CMD_MKBINDIR) -@$(CMD_MKLIBDIR) -@$(CMD_MKOUTDIR) @$(BLDCMD) clean: @echo Cleaning plugin-interface ifeq ($(MKDIR_TYPE),posix) -@rm -f $(OUTDIR)/$(TARGET) -@rm -rf $(OBJDIR) else -@if exist $(subst /,\,$(OUTDIR)/$(TARGET)) del /q $(subst /,\,$(OUTDIR)/$(TARGET)) -@if exist $(subst /,\,$(OBJDIR)) del /q $(subst /,\,$(OBJDIR)) -@if exist $(subst /,\,$(OBJDIR)) rmdir /s /q $(subst /,\,$(OBJDIR)) endif $(OBJDIR)/xrcconv.o: xrcconv.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -include $(OBJECTS:%.o=%.d) wxformbuilder-3.1.59/sdk/plugin_interface/xrcconv.h0000644000175000017500000001212011143440026022675 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #include "wx/wx.h" #include "component.h" #define XRC_TYPE_TEXT 0 #define XRC_TYPE_INTEGER 1 #define XRC_TYPE_BOOL 2 #define XRC_TYPE_COLOUR 3 #define XRC_TYPE_FONT 4 #define XRC_TYPE_BITLIST 5 #define XRC_TYPE_SIZE 6 #define XRC_TYPE_POINT 7 #define XRC_TYPE_STRINGLIST 8 #define XRC_TYPE_BITMAP 9 #define XRC_TYPE_FLOAT 10 namespace ticpp { class Element; } /** * Filter for exporting an objetc to XRC format. * * This class helps exporting an objetc to XRC format. Just it's needed to setup * the properties names' "mapping" with their types, and the XML element will be * created in XRC format. * * For instance: * * @code * ... * ObjectToXrcFilter xrc(obj, "wxButton", "button1"); * xrc.AddProperty("label", "label", XRC_TYPE_STRING); * xrc.AddProperty("style", "style", XRC_TYPE_BITLIST); * xrc.AddProperty("default", "default", XRC_TYPE_BOOL); * ticpp::Element *xrcObj = xrc.GetXrcObject(); * @endcode */ class ObjectToXrcFilter { public: ObjectToXrcFilter(IObject *obj, const wxString &classname, const wxString &objname = wxT(""), const wxString &base = wxT("")); ~ObjectToXrcFilter(); void AddProperty (const wxString &objPropName, const wxString &xrcPropName, const int &propType); void AddPropertyValue (const wxString &xrcPropName, const wxString &xrcPropValue, bool xrcFormat = false); void AddPropertyPair ( const wxString& objPropName1, const wxString& objPropName2, const wxString& xrcPropName ); void AddWindowProperties(); ticpp::Element* GetXrcObject(); private: ticpp::Element* m_xrcObj; IObject *m_obj; void LinkText(const wxString &text, ticpp::Element *propElement, bool xrcFormat = false); void LinkColour(const wxColour &colour, ticpp::Element *propElement); void LinkFont(const wxFontContainer &font, ticpp::Element *propElement); void LinkInteger(const int &integer, ticpp::Element *propElement); void LinkFloat( const double& value, ticpp::Element* propElement ); void LinkStringList(const wxArrayString &array, ticpp::Element *propElement, bool xrcFormat = false); }; /** * Filter for exporting an XRC object to XFB format (Xml-FormBuilder) * * The usage is similar to the ObjectToXrcFilter filter. It's only * needed to add the properties with their related types. * */ class XrcToXfbFilter { public: XrcToXfbFilter(ticpp::Element *obj, const wxString &classname); XrcToXfbFilter(ticpp::Element *obj, const wxString &classname, const wxString &objname); ~XrcToXfbFilter(); void AddProperty (const wxString &xrcPropName, const wxString &xfbPropName, const int &propType); void AddPropertyValue (const wxString &xfbPropName, const wxString &xfbPropValue, bool parseXrcText = false); void AddWindowProperties(); void AddPropertyPair( const char* xrcPropName, const wxString& xfbPropName1, const wxString& xfbPropName2 ); ticpp::Element* GetXfbObject(); private: ticpp::Element *m_xfbObj; ticpp::Element *m_xrcObj; void ImportTextProperty(const wxString &xrcPropName, ticpp::Element *property, bool parseXrcText = false); void ImportIntegerProperty(const wxString &xrcPropName, ticpp::Element *property); void ImportFloatProperty(const wxString &xrcPropName, ticpp::Element *property); void ImportBitlistProperty(const wxString &xrcPropName, ticpp::Element *property); void ImportBitmapProperty(const wxString &xrcPropName, ticpp::Element *property); void ImportColourProperty(const wxString &xrcPropName, ticpp::Element *property); void ImportFontProperty(const wxString &xrcPropName, ticpp::Element *property); void ImportStringListProperty(const wxString &xrcPropName, ticpp::Element *property, bool parseXrcText = false); void AddStyleProperty(); void AddExtraStyleProperty(); ticpp::Element *GetXrcProperty(const wxString &name); }; wxformbuilder-3.1.59/sdk/plugin_interface/default.xpm0000644000175000017500000000333711143440026023226 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// /* XPM */ static const char * default_xpm[] = { "21 21 4 1", " c None", ". c #000000", "+ c #FF0000", "@ c #FF6262", " ", " ", " ", " ..... ", " .+@@@+. ", " .+@@@@@+. ", " .+....@+. ", " .. .@+. ", " .@+. ", " .@+. ", " .@+. ", " .@+. ", " .@+. ", " .++. ", " .... ", " .@+. ", " .++. ", " .... ", " ", " ", " "}; wxformbuilder-3.1.59/sdk/plugin_interface/component.h0000644000175000017500000002072411143440026023226 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #ifndef __COMPONENT_H__ #define __COMPONENT_H__ #include "wx/wx.h" #include #include #include "fontcontainer.h" #define COMPONENT_TYPE_ABSTRACT 0 #define COMPONENT_TYPE_WINDOW 1 #define COMPONENT_TYPE_SIZER 2 namespace ticpp { class Element; } class IComponent; // Sections for source code generation enum { CG_DECLARATION, CG_CONSTRUCTION, CG_POST_CONSTRUCTION, CG_SETTINGS }; // Programming languages for source code generation enum { CG_CPP }; // Plugins interface // The point is to provide an interface for accessing the object's properties // from the plugin itself, in a safe way. class IObject { public: virtual bool IsNull (const wxString& pname) = 0; virtual int GetPropertyAsInteger (const wxString& pname) = 0; virtual wxFontContainer GetPropertyAsFont (const wxString& pname) = 0; virtual wxColour GetPropertyAsColour (const wxString& pname) = 0; virtual wxString GetPropertyAsString (const wxString& pname) = 0; virtual wxPoint GetPropertyAsPoint (const wxString& pname) = 0; virtual wxSize GetPropertyAsSize (const wxString& pname) = 0; virtual wxBitmap GetPropertyAsBitmap (const wxString& pname) = 0; virtual wxArrayInt GetPropertyAsArrayInt(const wxString& pname) = 0; virtual wxArrayString GetPropertyAsArrayString(const wxString& pname) = 0; virtual double GetPropertyAsFloat(const wxString& pname) = 0; virtual wxString GetChildFromParentProperty( const wxString& parentName, const wxString& childName ) = 0; virtual wxString GetClassName() = 0; virtual ~IObject(){} }; // Interface which intends to contain all the components for a plugin // This is an abstract class and it'll be the object that the DLL will export. class IComponentLibrary { public: // Used by the plugin for registering components and macros virtual void RegisterComponent(const wxString &text, IComponent *c) = 0; virtual void RegisterMacro(const wxString &text, const int value) = 0; virtual void RegisterMacroSynonymous(const wxString &text, const wxString &name) = 0; // Used by wxFormBuilder for recovering components and macros virtual IComponent* GetComponent(unsigned int idx) = 0; virtual wxString GetComponentName(unsigned int idx) = 0; virtual wxString GetMacroName(unsigned int i) = 0; virtual int GetMacroValue(unsigned int i) = 0; //virtual wxString GetMacroSynonymous(unsigned int i) = 0; //virtual wxString GetSynonymousName(unsigned int i) = 0; virtual bool FindSynonymous(const wxString& syn, wxString& trans) = 0; virtual unsigned int GetMacroCount() = 0; virtual unsigned int GetComponentCount() = 0; //virtual unsigned int GetSynonymousCount() = 0; virtual ~IComponentLibrary(){} }; /** * Component Interface */ class IComponent { public: /** * Create an instance of the wxObject and return a pointer */ virtual wxObject* Create( IObject* obj, wxObject* parent ) = 0; /** * Cleanup (do the reverse of Create) */ virtual void Cleanup( wxObject* obj ) = 0; /** * Allows components to do something after they have been created. * For example, Abstract components like NotebookPage and SizerItem can * add the actual widget to the Notebook or sizer. * * @param wxobject The object which was just created. * @param wxparent The wxWidgets parent - the wxObject that the created object was added to. */ virtual void OnCreated( wxObject* wxobject, wxWindow* wxparent ) = 0; /** * Allows components to respond when selected in object tree. * For example, when a wxNotebook's page is selected, it can switch to that page */ virtual void OnSelected( wxObject* wxobject ) = 0; /** * Export the object to an XRC node */ virtual ticpp::Element* ExportToXrc( IObject* obj ) = 0; /** * Converts from an XRC element to a wxFormBuilder project file XML element */ virtual ticpp::Element* ImportFromXrc( ticpp::Element* xrcObj ) = 0; virtual int GetComponentType() = 0; virtual ~IComponent(){} }; // Used to identify wxObject* that must be manually deleted class wxNoObject : public wxObject { }; /** Interface to the "Manager" class in the application. Essentially a collection of utility functions that take a wxObject* and do something useful. */ class IManager { public: /** Get the count of the children of this object. */ virtual size_t GetChildCount( wxObject* wxobject ) = 0; /** Get a child of the object. @param childIndex Index of the child to get. */ virtual wxObject* GetChild( wxObject* wxobject, size_t childIndex ) = 0; /** Get the parent of the object. */ virtual wxObject* GetParent( wxObject* wxobject ) = 0; /** Get the IObject interface to the parent of the object. */ virtual IObject* GetIParent( wxObject* wxobject ) = 0; /** Get the corresponding object interface pointer for the object. This allows easy read only access to properties. */ virtual IObject* GetIObject( wxObject* wxobject ) = 0; /** Modify a property of the object. @param property The name of the property to modify. @param value The new value for the property. @param allowUndo If true, the property change will be placed into the undo stack, if false it will be modified silently. */ virtual void ModifyProperty( wxObject* wxobject, wxString property, wxString value, bool allowUndo = true ) = 0; // used so the wxNoObjects are both created and destroyed in the application virtual wxNoObject* NewNoObject() = 0; /** Select the object in the object tree Returns true if selection changed, false if already selected */ virtual bool SelectObject( wxObject* wxobject ) = 0; virtual ~IManager(){} }; #ifdef BUILD_DLL #define DLL_FUNC extern "C" WXEXPORT #else #define DLL_FUNC extern "C" #endif // Function that the application calls to get the library DLL_FUNC IComponentLibrary* GetComponentLibrary( IManager* manager ); // Function that the application calls to free the library DLL_FUNC void FreeComponentLibrary( IComponentLibrary* lib ); #define BEGIN_LIBRARY() \ \ extern "C" WXEXPORT IComponentLibrary* GetComponentLibrary( IManager* manager ) \ { \ IComponentLibrary* lib = new ComponentLibrary(); #define END_LIBRARY() \ return lib; \ } \ extern "C" WXEXPORT void FreeComponentLibrary( IComponentLibrary* lib ) \ { \ delete lib; \ } #define MACRO( name ) \ lib->RegisterMacro( wxT(#name), name ); #define SYNONYMOUS( syn, name ) \ lib->RegisterMacroSynonymous( wxT(#syn), wxT(#name) ); #define _REGISTER_COMPONENT( name, class, type )\ { \ ComponentBase* c = new class(); \ c->__SetComponentType( type ); \ c->__SetManager( manager ); \ lib->RegisterComponent( wxT(name), c ); \ } #define WINDOW_COMPONENT( name, class ) \ _REGISTER_COMPONENT( name, class, COMPONENT_TYPE_WINDOW ) #define SIZER_COMPONENT( name,class ) \ _REGISTER_COMPONENT( name, class, COMPONENT_TYPE_SIZER ) #define ABSTRACT_COMPONENT( name, class ) \ _REGISTER_COMPONENT( name, class, COMPONENT_TYPE_ABSTRACT ) #endif //__COMPONENT_H__ wxformbuilder-3.1.59/output/resources/wxFormBuilder_Banner.png0000644000175000017500000013436311143440026025117 0ustar rrmulderrrmulderPNG  IHDRڔ/sRGBgAMA a cHRMz&u0`:pQ<tEXtSoftwarePaint.NET v3.0/WFNIDATx^x\Նn!!mӴii9 q8N13333 $Y2۲d l2S֞ٳ$ͽg΀ƣ~Ϸ־o 6\ſwZq'.㺺?1זsĿ|"kW5cdy-?g1O&X/q~ɸ|/鸀c] d>G$Y8KB ӸnD)"EnD2 K(8AdF>nD1q8RDdơDfBd]7>9DıDElO>-{7F#6qdb=Ƚuy_z:'uyڝDD:d_Y>*ϣr;α|ەۗm%J4n!ұiRe}o?usOV@"`04d0HqQ`0 xD$*8$W"/&   "   ya@@`m D4<>   } 1~ѠАЀa(0g_D.2X?ƼMv (p{_$ ZK?C#$D<>Ǫ "V@aeFKKP,T (* XLEIU"`* ~<&0A%A_~ $!~CdO}H(gJ̔EL$*Hl1=I4aQ^i- [*H0|? RU"f_ U &a( S 3M*< 9 A AbHiS]LHEb=1 u}T+AL_Fy-%SW?)DZ ~ϛIP$@LxD1C}RT\}(Jڪ>G"rKsK$_bYY{%6p{"\&\|LkEؒ0E?x|Q£4Xa#S0 *KY  8H~-B)Y\V>U"*I ~Z~[rࠊ0,# ) AX~DGXڊ ^(z;S$.@,}%n xw©, J.^*%J ii-}C%e3v35m)3R_,_Fy 6%R#aqu?KxDnUIW]T8\6)*Е\Q"!JA=$&(l j-[6m$aJ,յ=^ \ Jy˪>ʪɐҪ[H*, r=4/Rݰ$-#Il70GpGUIrDGR.cH T~ކ9ʤ4І<|ow""MxNtS[)e7Z$/)$ 6AP$n _ @gsT@Ec7tM!AEWfwmȞ!fgZ+ʬ-N@QM_4d'{ A7@&}Di,@65Yׁ&2 dD.g(PTByX᤬ qâ8lab <=4(A~5Mu(IPYmW61rjeMk5!Q(foi-FE>_4\`huHaupn:ZyhpTqp]p@F3=7q?A$ 6x(ꭰT]BfrT)154V"cCbl#0JUɃ*UNQyay2GApȣЖgMy004Dض)T) Ge'/R3kKU3tܧ>fJq8C* ?C$2eV2u#ee*:dn\oG;ކTa506a8_a3V$n o6]U.π*&XrWXŖJ 11h`*F" r:pЀG??7} gP| o~EϦv͡tߝ[kNWw?uVq<U?A:;6wNJa6<,#P{}XRW &A :eWy@*3mDW!r7)zSR4oߧ=iK43%Hw]ihJM>Owqmh4jY |n:M7"6S7AJ?I=םkKۚu^u:,&B;5f1DQe-Cm{V6C+J+>`q9$C{QeefƥIW)a!oKh PmXAM}ALEIo i-?601gpi$n@lQl-Z+V~Qy?WpSC҂ @\Yyi&Td4 }9Dhd@ @l8MN"2NR@9AלDb[^D?kY;4 &0a5 J\{"6աw8_y*LYY;m,F+[s6ȣVaraaTW;P nTc\A"GeH$G ocVTݯ)Ѷg{-s /bGP1 @)υw=}+rf v_H2-< rޅd#PoF rTF}BR]fVÀڲE)kZmۺՃ:m~߾A$8# Ţi!`%@{R t P ;xdܶ344Bh @d 2@APu'b걦"]jIח. A &HLBCCBd׊o7KumWnSm% sUX>LVk:diYkm>!PxIBCCoUUIUIC>㶔UB^hQ^$?^I"6˜e3RZ*~sl{F2sZAHX>&zRV@/wRE/"h>@H+^{.l@d&C$<%AL9GSw)$&"&0D@"c u 9I "}O@Dz.fq_ߎ^yq(lDpe 44$<\>tY;̅QnG +d<q~HtYm%X!J6x6\J*D(~I䥙0r}TjsL2aJ2~l\BDnS-~ S@تFq~Rl f{*_Z+Έ &(44UOo$Y` "+/h 9Oɻ+̂$AL> D"gh P"ȘͧhdI$@r2F 'b I/~b 2ug,usGix>pFSƒ&A#u"ڠ4ݘ+:VW(U (˕JC*D|k98pr\sOr w q[pB}T'⺟* OTtE1URx?鋄$Z+z(V)amU*l} A$YrR "P ێ]3)Ch4̆9K3vA*d* 24i%2~)0D"HJhxV Db 9A ZRUa˪+Ն8nDzi7DB"ace!GTCW]e 6f=>cl~sdsv.+|RTRq;HaKk ĩKOI>n IUQHJ֒[Z66C~xah,@HCl?vQd da@RvDQ2 2ہL@$) @r 9CSD"HN"P Db 9  :^DM]i#.uD*r]b3lVPDQTpO"Km4mi-?rZQ5,L0^@>%@ \m d P HƑ lyZ,;GwSQ 9CvH@Lq:mh b2 2I$MDo.Hd rJ֡s.<8z=Xy0H<ƹu.yغ˭\q\pm)+Ykn5kVY%wUu;pl 9d`rƏȳe?Շ_G/jQ7|)*x3$%?TiЛUc~ey#ك<mn.A>wYQY9~ }%F.R&yJs!" "$Q# *\LQ 9Id@1a5UT &yO5ڥn3٣lJÜe.+!~{U[2e)UPkas.$(@4@6 k"X@r 9K .H<@DD4%$@dbVVfsbJf$DYTlݾRq̉B`(8E:q,:?幗Us0|+2Ɠ*aݳ\l9[jxDaΰⴔ 9k# Nͮ !s~|景YUeUʰ#6@Rqn3_|~/T忢,5SQ j@4;uoyZfҊy+]2]G rg.D둺bXA+ VŀH*b ` TI $ &H b]<"=t4&m(ٿ:~,׍:ò\zșVrg衹,"u#GGP*LyQꥭTSV?pdj8cz8 V~DU'xdz,'tk|TA]٦k)VkR+ PaW6+^?_0}Ȧs4hYAjW%e NS׵CV\`Q0 b&g3 &0q-Plu'sjDLD7Q#hY9ӪT]oKY˨uO!a`,u|ɸq#nz*"~BL`ȅAb߄Usi.铘=&晼. I4!&4*E\hYE5i@ QL?ՇxhAh~sYg]xςPAw8kNR%aU,xW\-w= %$ Yppl<ӡѩ7cB' p)#׏"8?sHA@wb.u1'p&:F_=8HV}&i0 Z^O,ޒO"4l#ʨo]̽ˣRD0"}úMy }3(`$0vQm]!G'͊z jگ(V8&dɞ3z1xDˋN\y9'qy q҉\@(1N2qTđ {6zm&ibs0jR]۾.@B Roru'CĄ_ʺ}:R3\(thw:= Bnd{m K\fgV"j. H tl[V% %RTe6 UjUonv?wHg\x^:T_;Ax</`a£bjQHiZp0LGT-3~Jpy^9Eq4.O!N( 'qYq\QDGqyq83c#Xu,Tf ʶJUnVX݀$HsA) 3ǭFG@øjMw5h ?#qkKNs9*r哔!1dψ|-6~c$-tr_s׽.+ljs^ÃσKy \Cy x4<ؒc8zѨu]rWE'.pyqƉӸ8I\8qN8(p"GG8G:+]6J*]J$q sY.7|UVQ*tHO!G>e~Ҫ ?# 7Cw.ϊ8ӈSNĥ@;QKNe!@D>:qF⾾}ےp7*lL+*+@sI\\ZMʍ2^]ΪSp=pECoӟ=om@_d=E:omjV`Qd^-AM~yaQbKX\ /[iG}m%L kDv^igUnA\S.QP*-c9;Ã9mk0I=yDGpο J\7p%.78 N8Nb!8B' p#GGbqymz=dʣ< QeSVM=:*0FhaΩJdXa7S4rU\ͤTG[E:^y+%ݶHIj.kZIyeWO$jSm2LgR܏]t+QH]wukVAVrH׵.eձzC<]弗Gw]Άy"𨞒Ogf B<` . ?cpt)I%8>D1.98c" q\D>.9:q b(8v':e~C:e#H$\!V֍6x(ua } 7π}{6tJy S ~8ԖgUNsԈgW)| HCbXIp*1~miIQgji()-'benXUnxrkUwszJj>N%5?F%j!UO%U3EC%ݍƿWU ]Pʃ:@b #`5'LJs ON\x,mp[W9N;q '%"NXD;q N#߉</@]n_."FNY;zRV 覭 ,pUN?'Ua+5=ïG kFeg[c a244p !E"BX\>p@"W[YVG$qԇl .GwoUs).Sp*k54D ϐ~ d`jJ[| BՅLĽ_ŦZ|u%QaNJ/E*fo\;X" Ka%D)CWD\U+7baN/27ި驿u+K2 m'@E@i'TZ*-P)-h6JP5r~eIpd͞:,NUf ֹ 'N\ @fAH+v.9N(1 'qQq\rs: p%.x4]3eJxuP{;nrzB{tHHvQ@AtT:*( TJ; -6(JW)A3 mU.9m d9f]~gyE>YkXy0<*|r<3ř:eˠq$qupIYFx 3ȍ*MqDᗫ,~!驰R[_ L&"K}Vo[غ%T\xM~pRy+sЏt0?/,2pkGFY9Ov]My D^w>XfLX|%Q<ZQRXQ[ H{$] 'bPC~D APPRtT }t#It`Jul/.$g @-/r%<>6< wg^Q g J;_J\\@3(=ǜv.u1G'p:p|\1(q|B@-iHw)+:l}^ҷD' k俿Wn8DWъ vk|nYQ1Zұza2F{Oycag1V xLl8,jzYK} S|jd ~rZi2ӈO"j&J,ݡTCtc h@c *IM۸i\ndxp.nc` o5h=WE`7 ,3m9M dJFl@ Js). @}ތ?iX q ]H<4i+OgDKvk]|*KwFtSSEHi:xKsxjТ'u9OSRsq?|0E?lVrp8b4T99f.܌a|~/@YSaUZ071 61c?>[VBQHku#vhslZ` d .PR.@/.*xuAzV @w9"ᑏEJl8b1Rsz$NR (Ʊ.XNJ<( z 9 @#hY, ~ssC=.aVU#n.Q;.ici `굢g_z U|CzF:v =Qz3:z  1_!Ò;3 !b; dH(@80qS m&Hu( #*Coo '̦g^|^|&ujjVT~s#'̡sQ Id)eRFeOL䮌&@fF&..&S}~* Gϧscը׎ZvʄYh}{!@.V@{xVP?<ߤ(u>( ;PƘD_Ey P8{`c?ISR0" l 4p(a,\7ݻtm,/ QiA<~'!rF(cV T@dX8cX]T( %x}JpӴb9Z C@/_159tr^}Bs327lK6%)= _P?[9#:8tu=*~R3zJ,|%w~lS;u}1wÆk.׼v}? 04l}Sަ } RzsVk9w &ϡOu&Ґ Ki❴})u>|Q]bhjؿ'J%l}|ǞUugQ ܋ ;jU/^mYr6N4mՍxa'{%ִu7z'TQ'g<.@vT}ҍy.e*Wmo;7~ms;z r3{X4>Ky®[>࿳:OH]$Ѥ 6З4N˶bEQҋs,2#Zc3p֊iM_NAIQqzOd<ňx@ (XV x@瀧r8Ff icP[(_>x7NVh,g;]@CQRV%g.x;Dڏ*5i=cw3x+P=4fl/Qp~H 2,(:ʕ=p>E:EL_T=puzt~^zzJ=nܝ6-"}5zI90җbC.a.M?@3Pô08-r+f˺!ϟ\6̯ȱ;ѬehΊ#$JxgV,ݧ%8MYC3죝NǞ[5OSw>H RZIGτ;2DO< ='N{jв5m7Yi;4lI)F()eɎ♼lpaUrIUF>_y]=D˲ ᩔRm@H]wjR}14|J~mZeKagwk'xШK $PCO'Τv ͵O-|&-+8e6U5#,N?zS4rHaEHáҰibEHWdL89XJ"&@;GyiL2oM]ME Jf')_ KuYe Cjj<>hrO2Tm8LDL` .8P+Tm?tAnM:fCl=v;wn"~f;fzqGۅ^hxp+sP RR)+[ʣ<~y &i{U?'ūzԴP6p& Fb: 4$,^ǴE94ʃS 6`9F;v=@Ћ4tCh+ZjHZESq[z OǯDPPDϯO_@I^XH#>LM)Bj4>oڙvJOӬE){q`̄ӕ蕷kR]I4}^fc埢#*d5(ݦԖQ57qJQz;wR#Pg,aalA&^{4}j24 {G(&n+.SRé^TioJ[9"rP~3ie4nJOD9+y1ԹlqϤ.HӒWPʢtڽ: +g-XG`<4DeRK=`AFEh)gaj˖2Q!{uTB>:)ASzz+1`q8xTV;~Wͳ&kK}ܠ+DzCI~,oTg+_%58$/q/5T Ln@< ?\(Ku6H(+FK=NV{(Nm <=U-|PifTN5! ZuӫoUw4@:\p:iԲiYut~C&duv2>2w#-Xߪ ´Y4ltٰ NFRt j0ES4P=_^G;b D**oۈ#U'F\f2"83 v!t b!-^s=*G@T7o|I {\Ӵlgq<a> SHaisGQОGʃA?.oٔx;6}rm=jl-T)*7zӂ%"=G 2Jz[DIѲ@×b1k0"rιΆwΣ9g$ENP)07rHB>75Q55ZE P)C$4a5Y=oپ=d%zoЋVtF}I{QJǾn=zjEMKϽN$ך!^\j5I{M"\x{sJ&e*zZUW\5M PdBa7w>hDU>n|Cfxh|#׬'u;i%PHae>އHK{G!uʏ3sS.8%+TV7?R{R=h/ "͔cwRШ@Z(%nnۇGVzv'_ h{<04ߌT2*B`bb} ƪ:3@2BTw\6xXXS00#sF"^ ᱘`4yɛA}&~ /E ldkxpi9R]W0/ <Ã1 C) (P<^u UVRmumXv󳛶Ui+HYLTO{ܞ ~sH mփwB&Lwm "W*\zxHwUې²Nؼ C{Иym8n9 ) 555(>359 ={j}N>K]==G?zv%[`UoуOLϼT^~Ђva C#xg+VWx==nmzjT0l~T"Y&}èDj 3W#A޾75VMU\T{l]Ux*5uP%C',A+~6ǡ{Tv=Ζ2?N )s WV[B a9bҶ49n,?%&MGg,Bs'qM[DYr=t& V/9yQf$ݏǟyJnC:P)_\M'\b\us{PQSRU (ɣ^!o*D/2`zGg.P*6JP zqabE{ ((yuvCdWT%hla`C ۨu <%VmGSe%CFN_}yrvDlJo"TSg/Ug -zϝ8grh|9Gٹʡs6E*aml=#SPh;ޞ_9W͋Yި\u:0O-4m[-ƼȿS9{SNchnƸEWީKJM™t 5괤=*^LWiLu}gY.koF {B S8}O/ҿ@MuJL&A`MNs.MwoֻV q$`"|sc+|~nx,/Cx@x@Lxt~R]K $ToR }\ sCy0<+ݘtܧסU@qpanme>A[r=߿hrԭ:Z8S{ Z>ZN}&Lt5恅UVd<r镱p7Aj/9a*=M(B )/vwއFB4=;Pu(lJ6*j5..Ye6b02z[zE9bzzkjt&x0xJtHIѢD;z9%$lUrC(ԤhڃW? ߻Jub qŕZeP7 ֊x%J" )V[FOBP&>6hR.4R8l2|7^aOj}2-ZlM7f&n;~ϿM/~'&ktZ~Db(+@,.jNuiIu9~ HIV˕ud5*6[~H?Pc4xx uϥSt/ZSYSf,qQMX89kA4`d2b굤GQV]C E)c}5ܐvE- }; wA)`x +/PLyxfJ)0x8`xнߊcyŠdg.(.I!}%KtaNeQRURyxČ] 2ϐv=6wJ%4bXUN6kUiТ#i1bcJ51P; Rhn\7ޭYzkSѰRSSGji#!>Q+,è;ѳƜ= ؼ^դ}m0xwzGj5G̤!%1>ZvL$HkM-oةRs a1C}{Dgo5@Jjv(*FSc\8Wa f(5|L-Vp .@8=#へ^@(KO~ a0@5E66diSH1>%l7Dcn#nFD?kڕ>ꍕ޸R{,1{Cbc&@PͶ7P,e_T3@ \۫QR <{PxՀǃ%N[ix=W Lai&R ?>#x(@ r)u8=CWm` rhCO tVo.MRv1Hyj$V#69< /ݸJ_z8򱜶6`+R߁_ Hdr ]%˷*P^E N0Q۞4ErLtgӴԽjGUR]HcfoXsqJԇGy*XQQcxKɥP[[~&j]uzhuHᝍ{QIPOR2h-C3t+cC=jO@:ȀD1{&\&Zk-́ڻjdTGhجiz @J6]GI01v:f}5U\%w 0DFadnA<7ؓk@ d${=X=!kK.èj)ۨT>& lVraNXy> 0yp"oW[<*yy( <Q懯er~(HPG!Péx6Co;x ;w@{5|k/vocP hbШYjDMCs30&Ʈ@U^>E-Pk짼CWe>[Jq5AĨ*E)b +VgGkґ^~cT%Šs)?dnV!ôVf~cFXK[]{3ϿU @L{"9D?߰YGG*̐>٪sݶe9^*>P@#@>3ux}DgD'i@M"=Cd$51(x0G :ذ-8lMc{k?V:m l o:c*'dp 2Xa*ŸhA7ϓMiز7*ihI 8Sj|oߟAC;匴}Xi&>7<*7Y֘RgtTM,{"554yAJ)- Fx}?Hh~ f4aABǽq3> 637VEmGse"5"2uTҽ(H MHsZ۩3K?/Q+ <8CadmV3ݭP6W=MV :RUMU@7+iUۮéﰙ4~*Blx#m'y%9l9Youeh/D6 W$L֥oS>oUT xԕ^<J( ,2pD;y4ʃ~E0@̦@V$JW slE[ yO:ꊚ`yT1q;@(P A0@2[H< Ȥ9P FYp"sc:ϡz}6V w:_DY(w|ؿe0RXKܾ|tEG%M߅[wѶj*: ۸(ܻbD9/^ͺ+8h\<;'xQ‘+Sl9yi. tV+;P%% 7~mBW<"&R]k5WCbG v;ыy4 r.W[pVjܾ͋F9jK)+;6w Jcێm\~KNhn`mOQz]4rK9lZJnojL'/Ly펨 iϖ{8A RbH@xU<4@mL)kӸ9Q˜) WJ[`P[uUމv~0m(@RӢ "Bțua 3 R vHd Ɔ; nU-I"<~"RaUUXwO>ibĚ?#xy₃婳8_֨Da.s[Ϊ,#"<G"H]VXi, BrΡ?@\knr/( (Wvܕn~ .^Ew}Pް9j ;k!ᑋNjP s{>^1Gb+z`4ĕ1=1#DB0YSZQOd Vș[t '~ ^hw;N㧥`S^z}SfaJ'T b@it4] 0 ٪ Iξ&_:Kk?OmDwxX9 8<W(j+6̥`x?r MZUWM){+ îs<( Q<~5wЪu[hM6v.^i<<⡌)R,z\ʽ%O_ȣRzbsCl'p[g9b\WjD?Fk<|VPg4ҧ\ǟin/Q]<}Zbcnĥj[8](eߵ4VbT35,J޲c/gvW)nJOU=#\ 0r6-Z^Ød=?85q|սJa<)4??gI6N ec4>NoUA5/ڭ = .R1#U 7N}çc>a߃X|ɱbaً4]1T^65:k4ꅴRl5!ګkCv'uɷ}P2[rOLAex"j(UApVcE4tf@e\ԶO2n1͆U_+5l7: ZDnӷKηWo}ZEWk 2u8 =yzPwHæmK~k^/^.'zM tx<¥۵0xZF]054in6MTy=C})ztoVFnb5դfՆxޚ̪*w  9U}q84gwNr4 |b,nvǪ~ >Џ<N'Yns.(jX? 44yVⷉW;h>TN_ߙ4jS4HQuZ/y_u䉽\ۗkFC|/"SS2iE;VnQECU!{%ky7Ћ=Ȣ;B @4Gjp聅x(I 0.~YM^MB=F,U z]یvJ1illEHd4ia@e u8]U0z$LFrht26%_Mhi"L̤3l8)ZH:Oh>NShxqcgl^#ߧ.*Q£ug{ ޑOs^r3e1jjV]FeXypuFXư4W_XqٰU5]}F7@^쯞p -D','8{  z+UG=8y@qI0rLC90s7rG/lDôiEHy"L r`2#zة(aGx߮G}pZt3_Gք({Kk*KC«st[*Vz"H6Cr1H]L!$LU}0<&,-&<L_dg:scNLECoS -gjzXKfbrF-T,$buA1q}G.i*sz }*hNؐĎoTISR%˷^rp/4Z JYjm1H55j7 cˣ{ tߑeIWvo84q:/{9TJ8ZvTG7p<@y(xفUn.ƞl/_Ll- hKЄEt~r@GśQq% (i8HU@3q [C~)dpsb7.wmLj\DfouMːG0!YD|@"'TyGDJmG;.ƒ{&˱$#_{A[mgb (i+}z9˹O5rǎj1؏|>vL*j8vF(I*54.y G6ǜm-ףj4+hd~~oݍhQ,=j NyIS_ caIDAd 6^Ñ8[ߚӓF/V',a8vܕh*x/{筋G cӱ$F2-i,B [ArHo$  ۵zV毆jl?0o2 1$bуs_| fbgeq{!-pV#u} *oˋV4o'M_|XL_&ǂG܂h䊱xZ7 -E{h%61DΠf,= @2iR:K1d*1s98κ@7])~$;ib̜\<'^7 cny ɀIҲ",G ?@`jT_G~V 4;,/Vqߧ7:9&.8^ǬU'ZN;}y$΀$C8F$DŽu'TZpٖK*En D*do;*) &{OLdrʂ 3@>Bab 1&?SּA(k+p<όZju%__S Fط>{iY8 ViGh"Z m}6aÅ 7YPw7YroEYҫ2aOLJ֓8s*FuV,kJl۱)Sd9qB?bY|F!ҍ2RsPچXX)bO1261~ 8F|,L Kܘkq1(BIxXС|6^@>UXʱ%<E`?Ksם4k1JZz ,X6O¬q$i?E )01yrĊbJ^EtH]YSĺH)h U'q;~C2ve4c@Y OYsV18gf>_<scce2}QJ㽘<7%6Bq˶28(@᪷L}2NǂuXc(XgG٬gi*m & %P+6V'.kWsVlL+6!5:"1'J Ϗ[y Qt,~~p,W+ i CC7}3q0Y*Qq?J+6`r.n[d@088+ +%"uYkgeձH>^Su9mUVˆy<<.<~tci#tʣ>"ƒUVx!Tg &16~R+ی+yF*Kn%akDnctlơe>`Lǚ영-lӃSX,"ͷ%/>};.>~ ?NxNqlhŸ=jpǹ pCi-_YW}Ϛrb}|Gw`%=4S"MUY tj|f?;zuαI_Fs9J_*q5 h}]z XК= > K]e*1~]u@.=KnE-ԃ{L%J)'T0?tADd(ğ)q0@`ϦyrSZx$ mZF;@XdenrN7\.xmH^<ݬ+"2@ⶠ#L%bn3 *6ԇPgUBm ^ /A)Q}6=?;HNrw7PrO2fkqc8H1_ӯ/J~`\)  ` *qa(]*Fcb_E( @"a$~T"ۣ@,Q#R?Xk%cJy y\%tiq3ǑUP O #`q,tb.+@~vn90𜋿\c_9+,<' 6ŁG'(dާHayž?~.3oxz'/s6B_P2qqTR4: <2&SUAi8DŬjS1PJ4@? 7Gb#*x$RDJiIQz= £4$"eQ$QOYW QDͧq\K.:q.<sNִi=bed3</'/tTJ_:+\x%~b=\AoHo_Ix= ~G߼w8:@DNލ DCohّ:5RRN:Jzz4,l0.nOBLcYOAbx/@ `hh`Daڅh'VIՋ&pt,q8\jD=LhI5ϜV$OǓrk;6Dhƺ_:b3٣MgRZ$ҒQ1?υ/< r(aJu5@^Qmŋw 6(alG})vB cgSv]{T{)2^h$_T i8G` ґh9ANʹHs/Q7W谎0r_ +5AUP1)-?|uu *uʣT꣌ЍV"WG{d'ng!+%"%+T[প`'[0J Dd:kJ=~ iBynNݕ !/( 2t~,gz6?$8CZJ@2JVJWf  2ϕ"SXU@44Lxh0DX;攘+(E{+jLWYL|JԇجԈNgy dW ,=#ae 0gDLiG$Lx<25_ ߼ir:RVorzzyZ,ޢp}Ũqi&it3BTz}Cgx䪫%T 8͍qzyih)7olY{Ht[~\=ϗ|Q;bxg &V?X-%nA_p8ttNM鴔Eф`gFIa6lYȚUX2e5Yk1ѵ'*tT_y H0}eSq@XcEy* /M{90 - 61%=6q3+eoD!frdLkUj*.$H}&PTH@\#= ?@fBGs<4jcGbȁ {c;/LV21 xn^B< kOiP.7=5xgvlHWr8FK|%Fn4ٰ ^t .g :W>TTN =Yݞ@ŧ.W/#̨=ܸG(xpU^kmޜvޚ~S}a k/j|YwZ-ǀqyr085"G)d橺V ~~UF L{mVF==-9DSS<.8 u1 >d<N8CAjCWO)h9($nO a۪01YIa9 /l N N?CBJxt7}eS ~X@bQKL_ 1Ko&LtIa{ǐ7^hi)vYea Ik)]4"ϝT# {T!H6֍(s ߫WihɔVYe@ ^D^];]_"sfP*ώE@[Ue8roRy Znm 6bWp`C~cIɧ7*a0q-:R+(}1=#{*zcnC4!uW8?IM/@8lDO])%q@e + u,!c'8\ Tr ebl( 0`z1KYi@fl}^lXwLSDBRZH F S«3}?4^汮 (&?[_4j/7PW'p']}H*i5$S]փi@>[@d^ ߾{? Rc^s#k#U굉^齉^賉^Gf tFmHeRXmt;t{Btyt?5{!kstɭeό*?8ur8;Ш׃m4sm f@Ɗ%}%><0M!}Q<I_D_/V&ڄ&e%A*" QY'L(n'3UFQkS$QZī3b*?c,)-֊ɬu]W),~^6ǯ%Nƨs&C@no곝Xf1@S)TK}羑6. ŧ>b LvR3_EcHW]xL61 dsiW}$\'=F‘ػ ktXƸyq+^[F>;^ =F"QD?MtQ)L)yE ˷,[J '}e _瞓)ΰ4˂=$֠ԇ6R8=eiP MkAxfĸDwBjNr;ͷ~{iǠ$:>jz":QeW 9N:e=M'5-%Zg,<N]P02Vuˇ\bz ,c/G XtÙ΂B즯 4)uRX@crñq]TcʉH@zb㝏Fd#铱9`r@8G;gT>b#=N$!pIbn|Au.ړspiۿ{` ~T`ٚ&@,u*@(,s }>tJ˓s(h3aDh֨8{TC=NEHG7# @D#65Tke4=?sjMҤʫW!V!7?3q2 ?}#2Rb?3wK3({gbidg P0@j+O*Ԝsnx|zLk<}fHJ0/y~d7mQ 'b'ߍgL!  ?v /cR;[?"F K- / f6M0eU ,aHPQ髄scS}> Åƾj\$UFF",em8|6(y@"{j9HE/e:|*奄~=#:Uڎu" Q)믿SX5AZ [,lǮ,wLWDZ2\/Sy}A*](x$rX)/_GRWxy*6~ FT_5J=n%8x2o7FOFbf> 37 ex@˰ MaDTaμ+۞~L¹h>2^?xX+Dĭ >D( t9D,zaW}i+GH0מJ$ܽRtWl7] x"q*8UZL-1QDdJ/YUUȂ5Ղ&V\0e[2<# yaEh[=\LO9dOAq ",JD4^1ɄI<,w, SC.2Q2^(Y5}HGH*yQ?lѽ%)U Wy@DO2eDMgͷ(9͔9vGs- vX~7$D< "Zh;T)UYK|(s.a0 {T)GG?zi:==z/j8o<0Z%x!l|mxk pՇGױ1H]zw8r3W[ H# @`FBCco@n@~B _m6@Pm_X" ͜px?DG,6R]]$Hd|IY5}%Յ6m~SeO) X:ˁe)ܽ#"TT4fwy7:; ggTZl\gdغףDSZQb׺ 4ѯ@JԊʷJG/FZg^Mi2J3}hws,YԓN Q3=7&{+v&z'bGWS 6aQ:*%}. B Q& c?T)c߭#|هt<(FzAlqrDzW`RX TS}eDOգ*li,[HYR&2$B8(+!WQԇYJDɸT" eƯBf˽7SKH vs$gOu4K[ -7RUU ScjWf _<ln9(/[.U! 'go`WW>RﯰԔK.@bo- 㬯nS Q hnje6} r?R]c_/DQ 6xp*K(rUL_] aBm8Qq EFE`ݜ*ԖQK "=]z8c89.ޜk.gh*MJ+h|"H1 7J t(~iQ)G'F'uzq$q>f+R1II*sLך.C&1G` 7;͂|߷pDul6֏Cu!gA(V<;oy)^p֍OWaqY5јg*,6_lkۛbC݌i~]@@lMx-#@Imk$. &A}K[dۚ5PJ㇨ o{ KnW~P-_p \=~uC /MҺ퓥K:K1Cf8r2R,g`r ۟nGJQ!5]E#h~̰3YcX=r =x3z5]Vspg:o̻ Ǜ0NTQs,^FT겞*vJkGSAnR _?, *bs855V!.@,= qx|1sXRf3aOyoB%x$rMAfAYkKeUz)U@Sc D6ȝ=FX>͈~P$%^{]Or0rYQ*Zy" ַUH}sQanx&EmfQ':Qg)PYRDAY4dF g{j>0ˍf8h5d#v,cx̱r!yDMdy nw%j{#~Y԰o,ߊj?U{sϡ~YޏeFuWjo+CR i͎jYhVne UR;Xwrq&DۑЯW*DVaWb7ވH E7udtHb\hXwYes o!ASΠL]4Sj̻ӤɱLuHthv>K:KDxXtY S!QS=TzURK{iq`xvSvYq fV! 6^ ,G`tIo?-2 XX f%@ %"ߕKayXl;Xqe8i,,,EUXz {! ,> me(]R>@B`"Շ2fq1vYe'\&%Q{8Uwr]YqTQV9)UY Qe9}PqB:W"MgADޯ5bS.<,ƹ DA ̈́ U#ڤ_ T<bwAX)NcY{A #=nܮ+_dH\ Hv"T*$`aT]N߽+ Jwԇh#>zJP$t<]~ZUphw b#~PEV)[3us]xh*{0 hfkC 2êd*Kv GyhPC()ٕJ$6YTq`աt{SZN+Lypj*x+YI\Fƥ S][4, 803fle|6&XnSѢwk@34އg_:V DWX$K3G}湾nxZ}Q LT2G5& atlpv;ez].K~e,"SbY9Z:enRv@T,cOH_~eV ~B)ss(3D|QYV!M*hx*įVdj,xY4 XXNnWtK#њrW8wW˘g  ݁u[=h(髠 ]RTZF Y]Uk9j637BO{$J-ψJg0xtT#afR *+@J>\WjC0}"Aʃ)+:"0n3=qѹOfB'2ޠR^Bƺ덥YXJ* n$eGXDirb* ]HiW2M>v >li([OJhhF7C uJS^񛫥Mv:K5FRaG:K"DYdir:}{>,UWCBUW&D^WkSWσVCC "m`P3Iaqwz QsD:˷0e?;ؙ0K2*zgd6u@܍JE4WX@@4G(4=jCj-[w 7 "Y.UHgR_s7R-r0M R" J T;aktKvEٮ F)o$5"Baƒ{;8e~聇 1#rOHD4@r^Yƫab5Vcٺy؁MO*DpKci \JLaP!%+jݹԝ@o,GU9  Y  bOb^<4@<0mjDވYk I WDNy"A [uߖHu_Ǻ \ 8]l4Ε0#AHlUYX:$<̔O"8TUR\i,HDvZ!P֦gB [{jcPÒƲmkZ]b3" =bH廮< JjDWcX~ގ\+ǥ,뵥"amJ~D@lXzu<4D\2ѝ|R!fT~zI U*r tGޢig]3Q!"cI:̋b\eś=qG9C 8^T!qAq@5 j,&zXaSyyXRRhC=Tت*/wT=2^_]{ 2U_&Z!!SW8֩/w0Gcm84|ԖH]vB4#4VFr_DG\w]ct0puY^s~VY5̸HBCJrhN@Ve9]I[}\eXIxc²bk*kVT`{1J8Iem,eƲ1Mt2=M6lc@@hmRM߽+S},FNZ}H)mjZkƒ!*GJ-Om0shڔnPsAbвALg%I$0;εqĽM!!)- y眺R`ɹ9ǒA$B:S+t+ݬ2!i,]6}Xѵ1y07]zBaGVWd),68G@TB[תK㸲qY{Nz0<<ԇQ & ţ> !A#gD97?DjDgTܗKύ[ť2c!f)T3z:U$_}EVz^R ?K@$@qԕaq ~ Tey,jD\y@ P%NtC֧),}sr^ȍBMtpVrR`hB~/WWQ"C-;Sc^y,_¢R 0(X8CNY?.+s`x(X`bR1z2}⦮_ ߔV<'߃? |RT׈gD>KO7bBl8,k:+JoA~H"WlH]i> KJKE5:Wzndσr7r.R`q*Dr^69o.ٕ6ƚ8*Ĝe{8R^=KčsQrLN>3tL@hH΋^%/\7qCccgvOV@/1gmmyP߇0Bar Pݒ`ikýofJ?gq# HXӡ9RT!n> R!&7^_& G?oQM7D?U'?Q̉~?/+_~/;Ϳ_V'~w_?~ǿѭo;/w>Hw(S/SϾLO?W p =k#ޠO>=3oCOE>*y]wTdeʸ⾧w*.|@?x!=̇U<гjxjѣ/զG^:*PEדl3vҟTt۞љn{2TщDGOx{nh;#m6;'~Pk ǃܸAǿ渿_ݧ7[jF|XSM鯈=؉F!t#uՠFGK??I75ѭ~ J߽L7"}77DA|/[7}Vy'xɃ"1;q.uk7C;7%N?C?q[o-}TQO0e0IENDB`wxformbuilder-3.1.59/output/resources/splash.png0000644000175000017500000033474411143440026022340 0ustar rrmulderrrmulderPNG  IHDRApsRGBgAMA a cHRMz&u0`:pQ<tEXtSoftwarePaint.NET v3.0/WFkIDATx^]XYfrm7r^sZc=؉"b tww;~3Às_~=sx"_bb·~k锔褦}Ygѹ|Ε+W.w| :okhϗ^zI޽{:h߫rS\)**O}.]uY@~yWǽ\yKL)P]t2s u^zE4~1=3W ի:1q:-k~εktN̝1K'22R'--M\w:uħ]<^{N=+##COEAd2mh/{ѯ* _Sњ5:?ѹ=;:pH+:9g{M>H'7t^=ZNz{|MWuz cW~޹g_ɹp]gd: 'ox;͛tn߾jLU%vF;vNVVɓ'^P׮]u5jeyW'33Sǝ5>GSn]1GMWݕ[`矯 OqzF]kWt ht|7^G|L|>|zDaJ2??[f۷q{+MhHo*amڵ/կ_CׯDcPW_ ݼyx;wAQG'O9::3L G 4 ߸qCss5'+=#6ﲧVj?M}XX"OOOJIIQ{Bk{q#)6.ڹRxxEDs$%'9/O1"טO&*..&{@:wyxxBr!;>{n1/p,P~~hsrppҾ}C5euDwxn< <<}.\HE9PreGt@m~(qpJws/ecKOhp,KIT|D}˟R̋());::1]n-_+Vӧŵa~9sF5 {/cn`_̓Ǐ؎s3&&F|<b9zСz{ H~rvvjHHG<M֔z"rt8vZlG熐OU.RBe J_FCtж_ffR·'9 ,ŋ2b7N,.X4L l<T^^^dee% }%g͎X+>>`۶mW[5&] H\>ZJmkܛ߶n~qqqq$ Sl`/ձcMcTײzjڴiݻ9" ~(//O2sGҸExrlnS;pѨ5%oY*uF Foۨm*ȈgØJ Y`+‚_ /\y0|2eeeSlL!ΑNob@M XS $XDzUoKLHx=AV) 쎸hEx%c1 wrr8nhvPZz*~U FphEu ߷,HUhG&n}7דUšp,[o3i:@Z=4G889AIN'S}.u<充z웗OY2k8A5V6h55uL-{͚5׍ ={Vk͛@cMT{qO86B!BQM8ʕ+\@w Jlx7:ɘuzІtnkK V{7ї=/\gI]5{ ṟ?El{bEի{U`E8';%xdA´D6ȟfm_H8%~I3 Zhx@ Ǽh4r1j;0ulEn%3LhLr5/. l~|/80!q4B?8CFӠUY4nmKw9ܠRnU]r^ 澝c6vkfv'RP ϲ,O,F`Wxfkz%sҶɅ (tҝBQNؽ1ŵG1O_Hνm,u^u9Iv\ΠG=_=Zf`xO$X𱰡)=<=*ே.d`fm|4t0=y`*3r'Oi( q [ȷes<ȋ@|2YM罽T^/ܱxc s۫uuT46չ])x ^6l@ bv.&Y.:,RXDw~we:pL KwU %<׃>N)h ̕=sBx`;sF{^s|,Lڪ9Vh(^^>BQ`I) 14dv3v;ѺYT:Kh`!9[@2g/kB$ Z<{=L☄/}E@VB-ቐ iA޿?etJQ~K~ؼE:}MsPNp3?9B]yOMK%{a_M)>QE.x9P,M@bD2xn$SYx8&$@% @ag@2C CPP$B(?5XcR_p}%k4\Ì{1xa,%Be暶6Bw̹Ttİ(B>4` ll:&&VX!PhXop=.ήj~ЬC7Vt܂~btS˟:ٛߥ=¼,Q"CWKG{Wׄ zA yzRTL$[&r3?ZFf:G)='|=1TɈ.dɇ;][itNH8dhbvoV -MTZt0,e<`_H.!Et2Nq7 :'0< &L0 `RSԛ=o.eQ:k)]:QS>#TI]'L>S{nirܕ|X+aM*׍M{FȞ5 &fX| 84̣Ԁ0I`C`s0ׇe*c6 .Ze`U BsOXJ0x @ Tq'X/p KfuX`;8Ktlq.`pdҮ*0n~#VYㄇ*s71!ўMvh=.4/>aN5F?c_k֒mcJgM n2`ɎUX0XH E<58Uzy4k-! 7 f04|osK"s(Zľ:r0m:tHv鴛^f_D.x҇Xdp{̎ԏE~8蓜`3'qY'Y(q\c4izQӬeIlfR=aAV`p߹{0Vؕu1/0c`*4]4@隡J(t0Cs’-A7{8fc7&Arw47 LJB0@__߰pRxTK)%BW8>q H@PoXpʛms>ԱjYY ~C\ʎ4{l?{<%%&?eb4rDuɵZ,pa./%ȽX{` 8(6]P;}!ͨNc3zv }5J-xSׅQ4pe&\ZHϴ9K=&Wu4yXyLDJJa'ޏCl?КZTrA8^gЂ h^;ċ :~•R. T*0w" C,H_UC+:r@yZͅL2`G4qc~Y{,b8~]q0%Q/*:hb&M֭)(iSJ֍b\٣0;PW X~,TtG8nt0m޾}Fqfsp9sQmem @??`0`P|.]?|8~s _A Zwx}`4q0mxZ}Ţ >C4,qMІq[+;n w[fzy@ƛȅ^3g ڷC1 0`hh 9͸2Yey5y -^X Xr24YǖC|9CR!kF7@^걱q|l<0NN܏)55c#|%%`_`i9xgzڋNԕ<_-&ݝIjX+ƒ!ǐ^wp ~ dM?fptؓ[>Z/'IJ"Sd[H])S6ħ"W.OvT{6dK,`00DW \T@X%Fz(TU)I XǩWt00*M6y }`FI`,ťKqo,~$9c.ޠ!Hc!!.4aPYR%XLaW<'|7 f{h AEuOj!">\3a+ a@eO]Z]ߥlō€|tMz;ޡE`g=꬗CuAț ')4HH.Y9pBK7_mi}}N:ueEF/>DͶO@zqݹG/N`7jn0# a?A.N 6%+띴j/rh6hJbCs(Zd]JͽLQyx>6;F83;<)VKEG3gbgsYDEDž>A|*&,)2&Z %ffEU@c &a%duÓzE7!ڡ=<= J hM2Kam0c_X`};4m=A0V \x'E}.RSHZz֣g =!G~tMdNz-ƍ'Q. hԨU`ft$5hQx|BZ6"a̛5Oh I:Ъq`xCh~;dazG1cSbay|u+5! #~KגDj?+;M? pO7[?-wRhJ{!A@h83\jԹM) L7ҌՎΕV8M{.9FOQt{m(uU|v9cPw?ÂAxC˩{4f;MhH:|.=ԃR*ko++2ϥK,iy͡u#ZӰYFtQOX<\V/eqtnIm5'&GL}5=N\~kjA "4'uCSl@+4twD \ub%raXD3l({ox˧jvA\{Oսtミ6H&Ғ%;ti9<7-A0p(̍F,=EcW)%A.@rG};3XK*3 SOo( 5|^+85,aڡWW#)He_}˧^`MW: q?e/~ - SQ]ө~0ܘH 8t9$F=7(yT.26\"q$3)7έG_E㥮%lu6Klu)@㳵e"W+S:ґBj8" q_amvִf0ͫx#֍cE)6ễ(~zGhqs_5E0J8u6K\iyο1߭J}cҺIx@KfFaZ iCk#>kRw.CM^,Zs,bE3NR"V^@,%׎E*n*b * Sim) -V1 c 0p)!%:YhŠ%%a. :,H8g7!U|v+U=ӶmgSXƵR+ChLͲwJHCѱ_u^WV aچbT {+;71/@{ΖYnX zpXn5[ /YsU2W6^1P_G$04]öcne yH'Yu9mgv6C&ۭv+mi(aEv'4Km1رcE8ì|h&FN!=8mlj&*xIujm aHU1$h~"JU 76UP?-_cA(BQs M ,"p k&,`"DR^UFi`MIY{^<q Z|84]h&UqVӲyq tRlud#[J22OR5uL[uO!CK,JGQ`VTTlvq,@Q'WdscBI! J|Cjωh١(Zz0 %"iΚ,qk7u 6ШG= !B|$OYx1 3/rbw\ŔJ'lBjQ^郪J?,DLJVh`x$v?ll-3x.ULZnn %W&$A. ux +fNM|?W+Ea  ,[KK.O>˜|h!th`yp-#| !L h< 3 UbsR(38,0lP+.rc?n1;Zwl;)kݤVqd{ue; 23¬7Ys R:Nbr\PpT,0$_U#7MAA ONme_X:#TEes$=qyt,E0d&b_u~ZvY%#iamF v|nsBi1m8m;zP64g'Yp.2n8ϟOӧOS ؉z-pE[LXwU X"bև)ʁlm/9RV3*ڧ O`FRB3D#?AFRh AzE3pU\**>˾IsMie6j:Ԛ{Pb{ZB{eS/`$פ8]6PvCeQˁ;0ı  >l!(! VȵLNG恗rC+>g[]VK4_%ɭw:ѨgL']%ΰ M???w@.'԰aJ-+)eGw;X+fs3fZЌ4}Gh64Ėboj6p=iwl"=1c&x2t?CJ&Ҝ;h :2)ϒx(ʎVEԭHS\\^S>}5#_S4XNzgjl!| I EF0*7- K ;My5w;tZ*^l* `̓K}|YbՑ1)IeE!DIۤhh0x62'iop.d~p\I-MP.RMJ+)7a[tv!\a!EuQp1 <[]8i()s|4esFkɭpCiiBCWw.R54n 5>K}nn=5czYi 'Z4?C>ajrY4;k6 d97*2I7~ik$1%n}U+Yo. ,D۷oO}:W|[.%ܵkW @HPpaQ{wp >"E@s'4Gvt|kʼn9j؊)Zgi*H6ni<_ƠfvW.*wU ! xv(OI]3åO*m*HeSq,Aރkk*\0Vh(\bF}SS"ϢW7h}<.0/@ M! ¬~TX5   Ǯ_T4{jrEz׮4rp!͘j{(@z([X +sL>,*R) ]hJ\o &,vZr>Buv1*ŊUl77B|TM 4\.XDV'5>nn6-Z$O?K qþOWW??-cOppGZgp0a4RZ[JᾁB529}ݸqSy$23sXuޗ\t -\9\FSC4d1N.Va%l`BnJy!p.b W ;7iҴZ/pOW`M<֐W^yE: ?|`a3/!@9V00d}Hng?H.S<|E,?g `G2i9y'yS~Y|Sa?Q75ϳvk) Y=hf/FirnngGr5dfM3֣0EA ⌔վ2O uaׯnG U?#4{lZ j[Y-_ XC@Eh8'L( :dmGLoƌBcy1~xp=DDD]"%B8C ~?p@)CPC}!M{̅c{\/D #obo]0_=ʱ"&Y]^^ ~EfhY%R>Tkrr 5>ϼh>v[r~7ΌHdH 0JM`Z| 5 pkҍ mkC:p]Q_ I`om䪰>,;=ڿK ݾh].p~ z7{ccˁKItf+ ^~)u+zjD?@aҤI4p@ -qիW\0@֚ula-..HhWeDt{gNfh-8жXU0ep! :{ ! 2D|GT+ Іg-ie!: ~ѣMWW0{`  7q/UY ?aqRyU)pC""=#$LʤdUU*8w:>m="O>zrF͡^A+y^5Lק7Qnv dE3GɁgX FjMtG[ Ꭺ|<swֵq8BIb eTy (^EK.j,UК`E8\wZ,X0+ dOK;ȁ) Ъy7"3o<85xo^by.{ݘ4J -D[נWU<L`CwvE+-V|담/;!7,6v}(HwߋSH 냠mucXp2`eh X$Mpb2J궂'R*iBTGrJdîյ{ );t+z-͸.9\, al&Rūqyfp,:ƹg8}%S|/F{SLX+OJt6ggTA% nݼ.#Cِ^ xQ:&FӮUy)C\{^JU[Ps:ݻwgj3 *t G>} m .k>mʡnatN&Ғ-h"̧w/%8 J^nK S`\РA!v>@Fi\2C;#ߡw2Χ.q Z;Q!\J 0YɆ;YACtVHnd }}&9E5$.phl*޹G'£eŒv{G$* YaA WmtG9w+) @[eE&<\j۔9#8O:BE.Bq=z,da@^2-%%^)#o!P2I* UK^^ae̜{ 4C%q"V\lv9ܘɂpz^!+L\7(G\u h,jJ-*Uܮ4oa6PLNLǜi /& W9tΝ AuX* )C=X(> /."H8]hu@4MCE?|Oz|l_諯TQab YENI&+5G=. )"Tb 4TeVd|ԥu?Nv>^B+xgZ8{c Ɨ4[XT|O+ɭ*>ŰVVWVeo Hә ]Ic&nd`DfN)57+Uz=J̿Aqior͡ҨdžDuy4='^LLgdVjai1n s[``4\Woޥs iKMܛF'/|f zaJ03Rhc ؚ$~G)?\cYXBaLF[$GC#KNK0gg _j*cW:`#<@ mK^J0}& "[q.h ЃX{p_2CC}ҁ\___%M-G9WlN԰!?3 {)%S^|Iie[eQ ݔ훑#@u뙢݌ي3KՇ|(1#,Hk%̘-?7 u6^F;׾Z9uƱ4x{2ͷͤ>^FaIjMzv/ X ΛQ)'?Jzn4!;ő.^$,&Sy4&CҶ/;5l13U~0#;hEUjrt^B9f8"H۶t-k/Da7P{5y~;))4̎Na1RjLrgQdtFhE[ 6c@$YF}ߛFitZV>Edp{+NF̙ DXI`iJ]EsyyI{q ;&^>xvA ~Nj yC+/(=|$::Z$x@҉$jEK#\\Sb=h AU 2O-^m~O^̦oRItg$[ЊN|^тzZrvy> fBt6A{%sh_\^?5#ocIU|@VC/VWAҷ &}dhXEFhtΩQ6q!-4f$ ،lֿ}S|uG[iϙ( ċt 2 NQ6~u,=i9-t2Eg_K{@bS\Am,X?Գ|y(ՁZ|D_:^`NԙHs :%8L +>*f?.S… Kk+jSH*1.XG'e^z9%GAA+7 k[mƫk<;}:{d-_&YwH6 M`ߒd+{˷SfII1yc)+%gu l3wp!''oݏ4yܦb߫\2 qh܋ec*\F{dt>~O+j3,,=kź O Qn-o04UhՁ0:RL+Liju\ GSyo NV G簼l:~ċ/Pf^C nұt0Q1kEC8B ^ ,=%CV3aorНRyU <'Bo\ɯT 9?mGYı`R*>  Z ![~Zs1` HU=vˎ#jn@ իWkT%Nv(Im dþ&$[ޝd҉?ާO }JνFίS^zq hma7j~+@/,О 1eO&Iad9s6c:r^9 LGHI{hn,"S(rJKset6_F{&✪yیMncvM琻CS;.%ۜg1dN 9V' U.d#cTg*#2vMy\ٹ` Yd'NI02H 9᪐%q";wPKeBT:AdR`FړP"?@u601H!QQ"^]A >ccG Mg |ذaT_5["FupsqNNNOt-h>OCq8:h>seRvm\B{%2s#dcXhsA~uI6GiNeHnݴJ+ޢWCY(` xO١Ղ" /*dZz'hi.=Lϳl%3T2\IUt uN`+НzVi$\s K(Ȣ)4ClO;|$ Nf?"/'l.Vu}9TAI6>f7#AWLwPߨstןS bd, IA?{_ :En{ɿͿMbMy,rH]i'hw^ٽ;B-);k@Js%ߵitv%qLz19Dh)0{3gܡr s:>q=|܏76ih6<EyҨԂIH잜<HozAߚub,V @= $)Zy鱁HlPjX27R~b); aNly䊩Z?R:`!+ !LXxú?"r*@\ +O{^uMݬwXh]&-X*>-}AEdz(s‡m&^n0PJ1 ;*7IԻڃS hҧ] xu2C?觑sˈ"FOMe:65޴n3-PI3Q_Ab6뷸T;Lܨ)R+_haIrA6Ϗ;& ¾8,v Q/|ҊLXKB!,履~*:v5(,t3v؇f4fU>(Z,Ats$BJD-k=bxE 1h+wf&k7d }\2("x6kK~7昝WzRF ΚK(13=#%w.C}F.SMNrC"3Q)N4x-[LsFjm}C =HH)>FwR7Tej+2y&R\V1UhkΝmO94 'J1hI0IwChG^1F! ev T=墕_g|HW~;aBy)mdYdCGAcI\"zK۷ĵt|ky)u5xT"қx!Vt~v-k:0OQXu;C= (8:sShG(>%Ӫ2~K [*-Fs™TtEY%߾QvWP22ٝmKY[gfrHRv.W0עfi n33#&teL*\]OUr5˙z/tƞ2Hra̼6IR8j<-ehku=ҷpAcFB|oKA@l"4ch:}F 9CWGw8AP<('gW]z;q0c'_EZO 1t-+e@<4:3s#P l>^pSr˻&o$Ѯi!>) ճgoWgEN;_6tZZ6G(6%p#A4l. Y/\b J` 6X0 $?:Hn0;X R}EͿ4 Yьnnn.H * 勁۷I/]xq"jaSxuF|F\^]* ܽвar&36 !!3<#u$X c)i_8ȍ lx:p|4vhB!^UB5A'`2 n=vG 3\Eʀ>x*u?$hR#jҲ t/bJ؇"maʎ^}8_WFTCo}2O|@S#Kzc4b< ggNAm'Zcđm&XJڠzYeym`P&&|L>h' `>ES?Gai #R)2hÏpxR 'D@Aq&ML%DEDĀ&q_7Lx( ͠ ~ͷlM&_;4`TN \ -5dwJyiЗ_D'-g3 +/J'7W'5[ݐ|I-ч_O>q;]iLz`ʏ*! Rq)F&mxtUK@ݠAPS"h+An@SƪR}X !4VT)HM Nȁ.VZ ܹs؃T+ TOhrVwIP|}/sq u*~}LE~i@{N ƍ|FO()#}e|TLNf;h:qC]{IiA:;bEu{>NRv^2=8|T½6L ]EbT qY_ZQQs"@CE0' ׫WO$0`v@VSJ\cʁ{ BʀvV?t&rcDi?u]N>JuO6NuD9#hX*RXaz{h 5p>s^nSúeH V60r9@a1Y=O:`+~pTňCjj -H 'Մ@WB*"> +`/ݥ e|מ4X$ 8rM:U4O>k(.s qNwy GO׺m6rEf:j4Ι>yl0[s1 OwK&$٩ ӴA|M9PB*sH8Knڴ鉮^8(kF v$K郡X?;VaRk Lgr.ü^cǎUc]p-!+{a3rLwE'>}Yf*qmxỲУ^1#arʀۅlF1Pw Q-G2 Aޓ4qdB|fD-p +6>ǪWD•G5IQsdkx rowUQ<J@@_(;Є"/GLxE($(a@Bp: )ыTG\6L U]+k?ёOftYsMPy*&&EBPMl9̣֟!t>NyEV's{''LPidofN2sG~}hdkT{i\kyS$2`\H&"PC4;"0S>Ä0AL~(xxNjY(5{R$bK"3Vem-W IG`h.DL_Enᜄ&"m<'m݉\2?MGiK0D@-k=_Al2!$;exN?_,A A qp$4q74jdW6Sf]0#X'X#L8& zh|D?|Yl,p/pg}VfD+w "3%{u-h2s*6dFWΌl>IGhG˸Tm$m9A{{8 rHK9!#XdvcTxoy۠H۠-+(ZΝ;%p>.ߑ}ЌF/e`k@ZZom 2ʼh'->{7,X\+;O @ pE3::Ť.56zmG}=:MaQ">f0ECc 8Ts=06" 8O<R9Z5AK@/qLܒĹ)5 +G2+%y!X/(& )L`U6ڪ.m/vh0m6mRL9&hA[熶.Gu6·c hX@6_b:PIO U>vJ0 "O6i5i.`.`Z| ] !"ж<CGq#a9Z5$LI'w`]ZOCp\X |0Vd'qB0*-$q/Dp{H>a.es$x'ŽĘCHI0Z%PwCr? @qaF 8I0j(FG.>ձ?c lddwݏrjt3.<<@Z:,h>C¤B+0a}$. D $,G~OF@d駟… ! nXZ0:CEYzG0Ќ$)8"! r{| op\)B$"> SmF("7z$ZO=>><`\muUפzE=&{EY^z|B_mS L7h|ŗSbK۱Z5!; ’F{_aU }1WF {Jsx 00w|V .+{:\'z dFQV*1*c8?I{M]k\l<}crs*|yo:yW7xCh G< A>=ZչH mM6ۋ<(3;Ȁp@ZC 5 OAU<`  DaB<|&Og؆-el<5!UѓjF)1ѱtx~:X`+j9@ax%Gh(nݺԽ{w1ciF W,RRdP;1ʃ=Hc#I~ s1NS)sqL@ <;<{TqOT.h5'M -Ꮗ6O;Kap͏h LиaVG5=Q'( .LЀ0P Ka.] AB8(fv6w ;b;e:Iď0Ua>Vᯇ 9,`m`z @Pa>'m%Wc1bτeN du,( A q 7wȑmVǏ/ %KbKࡽ'K`hcJ |xg?t`mÒb,,xH v;IJU_MB,fp)%3:`=i\/COf()/dEh1Țp!Bn4>~)' A@bҥ4sL3grhAF~sBS&&<~ icj,/ 4ٳg.0㝁 ?;p=hS&:]Hlt氽ڱ#|A0e}0 i99#Yh3\ M~~ >D+=vhh8jq-6 wzZ:[E;9afMVh4$ _̕hm*wL`*E%Ӎ01Hڵ`=p@ر1'_z%^Yqԩ"Z8S,H}ir?`B d~WRp ~B| x59Osp+ :baFܫMftOSiS;;G {U * 6(Շv[|=mIVB$')w9磨X{bbR k׾Ս);}))h)EP n9~'Cm֑\i7!0o󊯲Y/#1I1 LMvvY+VUۿK_>uM,I jlڛR_]5Ahv_TȭU^~o Xza.VwWfFuq!B%sk<̱9F6r`gWJwt8$XKI VW)H~XS0A"33ݜgJ˄l IÄS{OBڞgirw Gg:q=s^$\xDy;eL={*q1\_ 'Αf/c01(Wd2s}1HGo})C~WKᮀEc"MP3+R 4qD=A>^!C{G 6}s}|yoi,_V2w!>.3:2.hL d:Xhc:ZQQzyPpP( ㄟ8K.3Ny͡^c6:Ypⳋ)<s|d?G8IGl¿΋f!xlX`!_Bs(9๠)I:=~ M9$=Mdo!ȆG 2#:ڕ#N }b6))YhElmzFʳA_!H `UfkI}~MF:ɘy,cMUY_ [ƾ{ &L|HN`e=zբ߀EV 4&Į^PJ V;uT!?yILu5QZRx^n `̓", :`6/JIN~bhXf<0b" + KZGDdMk>A$ɑ?r~h,4?$HæC}a~?6ȱpaQ ksXYsf(BVb̿@xeʽ|ܒG]qW~ߢk'N=h 1VPcC_a\%hHǎNͣ%q4 4d!>Z@!WD1(8}/h7BQa(F AkmE 33MEjv9 =WވH1Nb=WNPK' Ch߉}gJJk0CV[w0\k߷ Yϸ3hZeo;ڍdjL,hj32؜M֐%5z`4W{2¥bj` 򊿁u YPLe$E~y. l?PwhHԢE ᇇ駟K#׽tLDP3~CT \?,-4y3Fpq/)D ,r9@ܪcC5"pAaڇX8XXn:tD0̘$.Y4\ǯ"O`_ݠ+w)._GWQ{Trݺ d;dqZ5؃? NnN*& mN9sEdr&9Ц-*fQD3imY/J l!2:`| =_@Na4E%@ZjM!Y|?bbb<5'}@;BN|+-b3a g,P89^Զ`{3ﭴv& db O#2YKk,qDzZ~yȼM⬮4srkҲdԫ\K2e,5ZO/ q~AQ d"H^~l Nܘ}0u"|  yRPN¤}AZ=+8$3V}Z6>tdG񇈋ut'7Šִɳl8!.d>(6Ufk#' @h!kq0jGa KE.J*AIE(&.ݥ»\|Rx1M$䋴1N:̨Xm&xU hJͿ!\w$\qrhQ(ܫR3(?\t|9 &F|ypXNP:E{3)6&OEgoOt.2PхK4n{ e檮!Qv:,cPfs<(ʎ5bceD=|/Rﭳ3Ӗ"k,+E`$+fk#F0J.²!H\!<@laۊ%- \X࠰v-оY Xfu܂M}6ooMӹYM+l&gGEXoT_ ^2ߣ578u =cç "Ql C2cves"㓠>/ETeC;,IaadȸxL`<)d-rgwOIg³#8D D*r\*  Zԁ9ü 8A=KоY7k5hߥ5yyZMk+{l`^#p\;/Se%DM]O  O*k7]^rⳮP@r '[Lq"Lmiu0Y9sN-vg)aBPi"[#s&D 'tgyFdD ?#v 4P@c-ްA#V< GD]/+zA_!H.'e|)f-,I ^}3C$1J}#Ww$#=z"Qe$P*6Vj:7+k:W$Uu^6]R)_~ԤI2c8@Hx%,IYz͓'3eK9d%5j$ rZ G3vs({9nё42s&LZ}$V9r4Zʠ8& dpIr(U-add$@ }p^]$O.$# "Q=GB n&+ D J?rZ@YW/<'(0`SOýgF ηܵ[T(cd+9ָ}Ơ}]idcUFsmY3( ̐kro{\`"AJr(oX@}0ll+%y&b̦-ju^6]`@QFr6i"O۽˸L}2&?%!s^x4̴\L̨ʮ59:I^Gх\LI\ yd_ ]act{] Q. 8JC?b1wF U|XBߡAwKa ',w Jg mXA9WxE:~C.WHx_WĦоoz*z]J}+io\O"> PMb#5iS+3aEҔYs#t ޤk6vn D\S5w\@tzzԑE Vu.cm9s<OckT8!D(Vߘj:uԩ\@zRv+t28OkW&M.tRKo",:|@) 7uBG'hIlCh'|"@O;?8@X_`9ի'3ߔ? 2bfz[_ovM$4kW;wq6t>ac !-'nuAy`.aֆy[(4oi:.TDIegq>NwS!߻b؎i6)l 5yؘ:ڃ1i;vCb#9Igo5)<*bR))5l^QFn āТdp7I_AZ](PۊWㄦ\"\AV z'@C`_ Eg< "I :Bb2 AH9K.XXdQ x,]szIN Af7eAˬΒ`x1}6||p?^[$HJ#Bǘp(!q x"u0R<$7͐32D0.n׾S|K WH\ҥֲ x~oWށwjF.edSvWBO"Sr7n x(!(UKb}}er7DAJoB)-Xr?e?`ؘAk#eou-h[`eecz6#sb9g:rQ>Ui!Rd40! NXqLq` _:B`W<RE#?qa*1*6̫Ν; =X{^ Sj_ mJ cYpKL{JѾ!ZHaA \K H)S$m)6@s)*Zb%|o҆UQ JM23xDy\b*%q}͖IVo9oiE~it/,n5in8GMOc7ѪEyLT2Xi\ʥרu*pr .qb)9Hm[{ R/oe^tM ,qqtaH;"+ r# Y̙ *d-L.y!ްa0ijz~m?\XaV Oq q9K̖` 74|[0/WzHEC,7:/%\GM&B׳L*{8"^о0iz/XTa@1e*b[sĚ { fSqMYZ.Qcm?&j 4oެAKfs7cTU-x7 7)yIޡ)t;OGsm $kzq'U'7yTilt&V`ESf@]G5:&Q>R \, bir `u;0B8÷ tL2;4H*1Ś~Hf߭[7# }10k#I:p?qwΠtZ5#BS|g*/oTđI[T'=PD]ZK(Xwk\; S2+& 0#er),K%g,ٜ$ 4$]Bcmr4W8[긭Z-{T~d$TO) SILB(^o_ tlr eL(=Jt PL9(q4r NUHИtAkF^>Yd! |tM&8a\q&DP` X I[rW+B;Wql7Wc|׮1u 7[r_)[Tk@(jxQBJGـDr>M62M˶ykX^yF.>*oKҨ%N/oi31p1 hO c!tQ ؇p R 'ujJ.~T"H,&x5L?L3\Q. h0aǾcBxdG,1AM6VRy`:M5\ &XXo)ԁ}W /e !*8{hBp2bܻFs2תi_ C9[C?E1+ym\m 6lDsA|Wan&r}P .*r.ov&"xg2<:1|CW,ٝ '+ZϛVlל)+iOٰ ͖- h! E .`jx`Ѫ ؟K2sfq$@ldS͢.T^'F.= e(̱-[$D\Bgϕ!Y #1 `1[׀r :&S!ec<Ձ=P#q>_Q$;4e*EҖ⚒o+P<>Iͤ\w fB'Ifsi bޑ|䬈\h:J;l<lt9h w:(oCo!6hѴ`!xWv!N}nެAl<%e92Aiq~U9E; Xi7o\2$ DŽD蛔W Sh4LAzed̴} PW8ܲI-8E娊j}X\%U"e*Ǭ (o;WqM}Xڵ9F|[VcY͵OJkʀ7Tf1|@9{D~ |ЛvE'hJq-zNKMG6c?of>3۬Z-l|MUC')l( Мh؆?@۷o/ ~@ uUf˃=]MBqM-[{HeC5}`HBj(*Fuy17߹Ҍk>b%1@T]/ Gq:ir HN`;]әmx_+l6G?,V㝜C!Q7c{Vnq.4рMPIVudk1eMC=E`VG#t1ʉrbawo.XTr[J@\kH ="܄_pxfkz~OW"I TVV^.~ BK(LeI嵾E={0+%1x3׾ 1S[[]KE w<}soMbJLɦd:Cv'Bh'Xcu ֟نGia7cug)Zh;E<mh]r`}5ׄϞO-?::451%U 7zpaZGV1 ^a1H4R[ ޕ}i}1ykh57J*|+7jӥ>vZ2/-"sڎJmGmv~u:hZ86 H N4G' Lo? ]؛Z=`̓<WIJKK}z dllkT(PN &\.[[k:k ɬy$ͻ k%tsEIoII`ZPGh^$-0:J3mrj&j5l3~BAcGӂr6V(g=m4Qhv,0U?T~Q_/1X#=$O&J4ފoofȩYXpVڸ8>owTL"%$g \B77 78R] +oУɓ9mKԨjW Z5" &`sÌVEU g]5XׂWv,+7HkbjE*`9xJw0g] \'vbF IVoY-lҶh#{OIGl4_{piB )LzSCj{I5{-?A񋊸v%Rӳlr69ФI2aw(jlbԃR>-]x/o.K{y8+k Kg#Q?ڴ XBsVy{_[@ PѺm5H޺/ݍ hM5`<^?b;.^ؔ&R IIdK |c+_Z<}5;!z{ \մU76[,XllawPgq3b *+(",5`%3*;_(b=Ws~Ԓkت2ѷw9k|Y ;W ~GO[88lqlũa",<|"-Xx򼉳<1y[a.昇WxXcއr#}l2?Dfrר Ը }~huXQھ︂R:q_sfM0h>P̢ 4s5-Yn>pEAu֠ C-,mmik3lZ9|YV2YOAgϡxzm[y6[E[ [-NfmNnw*jOf_x 2Czl3wZ͋,ҮO'\g A_U΋}ݓqӡ@Κ5kD_M'^eF=0`we{F̴48ϸW =U9MO Zla@mZ{w~;j ]MI'7~ W_;3COlZм9kL8[cUsx>93{^fBshb2`#fo lMafFmfGp)o퇛o5@~&؏+`V5:0?qyZ'Hs6w֠Mem_y̆}]X2"Ҷ֯ص.n:q^w :R<+q\rJp]&㲘2w޽222qyWGȨI}ttd8Gƅdd>`;woPˉT q3f $H5qB W65W1c.#W_]Gf~3]Gm-9nIɩ9rc1]؇+-z^+.ή5 A `yx4Zf5_byQ&bg~X3#fWq: .LyT2iɅÍ[ \ذo,XU˅_^ߴ5Е}>KZ2qI"B]0|uF>K~o԰%M5fQ]mfc<&љǭUqmpV Z۸-ic'a^:^eYqQ2F424IawrߺU.88<+襗|Q/žƑ8H Y}ݻwoz̈}Pwʕ"?]tm{: 5Hn沚l,<9,v{1+Zř s^{,?mS Шb^V HW}WRQrJ^dGi58@f.#ac}va^];0.ɹc3caZ+SW&_@Vߴ׭ z5>{M4}M 1qeڱ}K)4|]VcFW4sɖvCVpƼH[q]7hU˖7ڠ`Kg( 2+eS Bbuŵo`IcP{WFQF2N+\3P)tww=̃"""Ԟlބ.Aj]vщ'D~}Euj#0Tm^}Uz魷"$B^xw*mzQׁ6BEC'-_yKoh (&&f ,=5}<Qdī䞔ő*@.0xs9R-oURu㥊bxC3(qroZ-1uɺ{h-vq)}p>uOkMy_/n2}Uf 0~IkjǪpÛ͌/~r6|=ڷ*`[qNS5t^a[h9noƽ V4`l ?rs~VΣ-\ծ]ǘf_ۍ;ci7asî6krrv#̗uiI7|Γ[B8G-quisf/mat&?*"#U.U9"*F fgy2JdhC^cٯ{5kGo8ެ q6Aehi4Y.{ 5Ja--CD!+~yzoak6do6k׭h7m,Rz^0հՂWG]_3փMviyi=@G}m~APz-4: iՏ.~ۤ_߶9m=4Vy)?^ڽtJ4{6 c2ث]?wY9|ՠ ͸- Ͷh/1jQm;\كLw{і9ݣ'R(2c ܅JCCeWFׯ-WC`e\`DF^^2:uJ/7`9cںo7pF}J$N: 52bo)/gқo)B&|h/HlB?ұPzɉ 7miWS 5QҲ]Ϙ;p%w V<>;wΘ_^zeEm"Y:| 5캜6Y@uMoѫhMפ z퇙Ϭ9BװqeĄ_:_u?Ǜu[z.>㧿5_ _ Mjyu ~Ii%uoяg~{cc8l۰Ӥ k/|հZР|f}V,o9b1{e`_gqL52ϭ|Uw|Sue;Iz=ոm%5Kծhs)5/4OW___GQرc $ q sXK?Ɉ:.,I{VkFS]Cz`w$QF,y:w\jvampp!{/`*U2Mo[~{=z4fP7>n|C oZ." {U> 5{3]h7ԓIuyKic_VanwNobHkyncnp;jOAll3hɝ.y^yW<~|ƮFwfF= EFm-_G%؏٢ - -zͻŏm ^4y3~集ovъ..1{ ԳAv4eAkz.=F''ٺu(g?dʖ0+__gi /=~FN# iѽ?{y mm;h=*Cˬa?/㌿cβzm} BgjmgZ7nޛtը˴;Nl~\mG]|O5r_|_(wۖŵw494b 9/y'[Dw?v>m[tcڬe]vEF_z ̦ lȄo|J^x_y+ƿޗ!}빺?vqһxՓ,Zg]waC!z6<),&shUS5{6}5ʵx??9A/9,AOٱΘc)a]>|D}G9].J2u;o|ݡÆܹ} 4H/] Vh' 5i'_P|`كmK6V=ka+59FJ/U"\bIg}g"[*"5!օʅwe]ς iy+"ҌBRLCRMcMRr /.zbeZࣸ]qU< սv^vޅQ F3N*\q%R=z( JtwګklF <6neN+ֲ6?u?L+?}Ǎѻ?Z_WUuy{ 𾆟5[`yum˜E>{ dܴr#+ ueO>?񭏾U[uv?nO.jm,Wau`0~?W?iO2 Kko]eM+uw}Rjݟ0U4c_{6@D7L+OkۨAFz-hemXk2_z6~8M9oUK{|_ u ^x孴W,mvYȖ;Mf7?ƳϽp_u _vZ>d ï;Ѡm&cvLbPs6֘֬ FFoYaEfq ؄Yi!}[ѵ^|JW_;֭y/4ܹ_enHK왳Ⲝ Ƌ_:h9zI)aQ +}b=L=Mc#We/fnUPgq }gf.MYk3KL_Wa`_\rE_ԚMVG9 T<|6f-?.Eۙ1& q}J7M;]r}v;[ڸ>pONC&)pY_H^2 WXx2pq6)9=ow)/82l׫%`AVߢܻ_|yw?{uog7s}nʫ79bK/tN:Q|dN)c(-gϞ3 7 1=];|b3۳X{muvݲwƈ4 ,ihsA&sDqS҅WY0?sGܖut_tȐ!9K@ٸxo[,g<4ZvU;w-_ݠkiztwns{^6.Kono՟fWٿU^E~^o'l\ڤr՞吹Sv3mu.0~K uoxc!¯2{ ڍG~Wn=n2od {uٰ_wش<9y? zw?/#S۟5w~GoOff[w]||g^+ѶcgAOUMmjȲY֜7ob|ܚ3Ԩz,*aoEMb&Lv6ܪa~i?Nk_E^]G_5*x.]}]vǩ~R٭^NCooݯ~t޽̳x? W ^zݔ}翞~G֠Ӭ{Zbh~18\1n'm6gK?tQ -OB'֎?gf^y/k{{w_'4oܟK3r gΜ5 ]Ō OyxqfƍVNZ zɘ,Ƈ.6q7tyZ9l2OL[ZPXHS,(,Z>n:pRU;_YrjA|RR!{Xm9kYbnfa藖PQZ AI&_uA;RmSX#s-}] ~MoۺI wzkᾠ!3v #e)H4lGJIcOehXduY#es.۸yKL9Nֳ8umʠiRM]2tF8cޑI}@RԜU;94sЊ5, ظ>˂cqŶ|w\ǚ {w>=Ž /Ơ`W`='JcvsdzpRy*^_5'xz?UMv]|ymN; 7*KwD5ÌrZZÉjN~lwg/bm__Wޕ3o؄?T3~Ak+GG;:<{M1 |on~F`~Ȳ~l1~~5J~B>E`ŷ$톮Jo?0թp"nwBW.tW4`a& z)I2w^˷}EMp2ZrAΈLT~n&elooQq˾ /k_Z\f2 ?>#Vgaa wXx /ς ^yw>"y6nXSgpz$$6ߤu}&YR.{3v82:;# ]Xkn>kŋb+\y@f͚u|;vݲqe{]$nN2cCxNZwߔ%n:sS[ %v:v966.q)GE-pcSWls%V#STɋvlvp8tnݮ,;rd^֗p0x\}ç5gd.5BZ*n`oyڮ2RavoTͻnG}# .͚u}ш%K q>.#^Vk͕K9C BBB9~}ܔ|sQ^~>s,斪covm‚ n 9\-{V~<#goHٴ~\| Lgxm-_K}֤rqsHIIY&+4"fv.[_m+s~gyEW7r+6/|_tܸq>fǸ^g6ߤNXÚz24v='7y^RtWq?xj[BB !?%#WA7&3L[=Phn~/*z35r9F1۸7F]ǘq,q4Ȏ؀a37f0(_Q-m bu_IVo|3ƭ 14Tu' m{q+ީ?Y-~ًk0WWg ܄9w?XsmEfi˯Ȍ12O}8X ~^ͮg)G7.&-prŷm|vT΋q7ΣMM\ìV ~8w׏tY_˖m= 0Xڲ2˩g᯾{7Ͻʥg2ٌJ!k$IשIH{?1~zOġQ_刞 9ǟ~iݾ{HA]ľ8A ߭:uAS-+rwﻆn7\ _k)b>TZ ºuqf_S3pQ8~AX]BʰYfXzn?{WTuowwmB-(nRepwRܭ.$0k&yC߼&ކ}况?d#k4M֣t;u_34s h6)|M:w dȹsw#V7^7޽<8{}UZKXxDLCu=r ~KpR*-Fk8']QyJ?gA̓VHS{@Cdmկ fIx1kE+?u'*#٦IӉ~SȐ-F>s`|þ*16sbQ(\h^UNVLfoVl>4μoh.pcɘ72䰱3l޲m8AplBҖ]{vSc*5]uۏ  T4Iӎ 9~…Bx<"C92nwc~&]*+ͫn9֧^>UOI;aV9s׈ 4b&^$nTECvM\ܽ̀$AZ pMݎn'Ɓ)h˚Mӝ1F9fY{^Ű0ʷI`HNdSf̚7o_uwcG-hhx}iH?{ÇςGT&YnX3Wn?&؜F-aɚM4ނI6[L9pEΐS^?"M\SEgrkV^BP2M#ؿ͆l!ࡣ/]l4tMIg.O\ޔ4o<4)0# ` _jڪӦ=z.8plO?AxT-T<`sD&M#;w[A/qK~ruk WK*W._'3UˊkF$PF޵ݫR~hfnK>)S3uQnQ6]nݺjĴ/"ϝ75: }d<0 §v*5]VĽo@]Աk՚0t4UnzZjߡ˚Vz5h̃-(kw_ZSj]vȱe1׌3qn۞#A`҃Z:Q_ҫ[FqE]~0Ghe8Zs5hUȡrXE^I C,((o~EJ9z7~Qw#qhFWj9&RˁtCdj^h rKv! (y5YcAuwؖVʽq=#} :f\hE=ZI_($Y}&%U}dJHYKo_aY19X!-cqb-;2F!yNUX+*)zBm"KEϭnVr E7©oE\2XWD׻X]8VJ-ȋ:rH'QQg^6ÞIIsz$iWt`K,sj2frߺc"IG0V5S"^:O$yX6!%43 4 .Uؼ6QP($u/qyXͫEQ)4[0 zؠe=} VZ5H޺ghf2ύFPXϵ?$lNw}*=ZjmtMshggw 9#"MVZ-{Q?n% 6?r4y/QG o~<.D"GhBJm@&@!=‘ 2 ֕]~ 5ڸVUl9Aus8oװjMΔohT(@*uzއkM # zuG.ueȕnk5ԁ]$PoW.|,n9 8##M3E=Q귡I޸9]"lkUyO3*a*v!3WH*b[má['Mo87y'>mKiht bJWSԹVd\^JÊ2d8UNuI Tg;sD;Χu4[CU*m\k1j Wϟk F^Tj~9I~K}YDK-Hr[.k*Ȏ:XUJ:)"F'>$WJа҅)\G)&ɭfvfȪeF؟g=*}(L1 ,9 J2P={":G<}k܃vl6ʔ@(μFH+_`=ΠQ?*|{o :T^j>52u( ?/Bp?֡|("mG(,ڹZO!!Q/}6HzҨ-֥cvs9K;8W2e+ĹJSR gW,Z愇GH[s:uV1+BCb0c6%ڱ1b :TȘ5)S=V~Iv420E9S@A: ~T<ػT{ْLD 2fĦt5{<?yEH>!*|`%6Pw\V%>7:װ/t!Ӏj>zVk,K-&({Zu}!s' 8gk{1 M.e+)"f < Q)3zi|0אCO>)cTusf p]Y0vOl1z9Bg:} ٬# Uv6רuN:%+FVe臽u=CrZ="sB~ /39"R f& GaYsZ?qS0Bu [){*5 i=Xb$2MƜ`ɖ.*U(#QFr/i<)נ?| )B7G_r7٬JE'J,2QdaY n 5#j~os-$YDfaڶL0$0H٦8 WH:+>=)WWa5ސ7ʷ[ed'I%0'M:"Wa(>s Yq=ѼRjk4r;!_VvE06(Mo<5yO%[hJ,3/YrEG#(IlVQ#*Q$6y\Q?C%4±LrI~OHH|x'U g"ˡ|Lm%Ou".sb2 LKVIw dxamҵZO CO.KHRU"=o,aHO[}QN鸗߶\T~05+0)3bxfod槟{{)1(=ajy& w>+墺\kpM~d>+uy_Hߚ,ϲf}X` 3fN%r(ΖWDb?=Md,%% ±2)`1p CrEj5S(2MnZU N `󔀚6{2t)Ch_md.kp _~9TO>{u۝6;RN3 >-p F%QiiF>hB(PBiAe1P]1&٬da'9ʐ[\ a.!gQT2+ dL~VA%$=b󊄪& Sg!0HtMeiC{$14dʜMJOo %.ua_?L|c@e D qhV%teDEz40=(~g ㊹7K>W?-5SE6pFLA"]̣)~b:dj.ʴUңӲuR7*UM!ϛ$)3"ݻ+io)6b '25 ,$Uݢ)RiU#>6aI6~(\Z]J>U'J.4]lk`2P;yb`@ː/"@LQ!dJCE!GaQJSG$L'6{d@8yzV[#4:R0Ŝ ٖma̯N 48_e̚穭[W 3H FM^+U  ʩ蠇p ]v]$;T[\~wzX %2K6+(+p 0PW]оBHN/aO+v):;8Pr z0SU ubt>i2d} zO? g57)߃d=fQhoɲM`4:߄bcT@5ķ/~R{3LaCD]cG.|E2^-9v\wg\o)ݣUڇ w,BVRvL9p|:L8qL9 7UpzqE\M6{,OJ!h]H`SMc᧦4;8Yځ=]HsT*퀮HE9UfYzf.O'{0Dji4ߚ@Djt(qToN_>MRw\^q,%UI E֘ RetCmZJ=%z=01oWz3"fΜ)R2b7!S勃C$ {b(g4sAiа I cgЮT.lMg+o~ZC"SCbb.R12Ua.>%;%}bH `g43v"K.+z@ k^u6?"5p'’H 4.H@'r_̩23TpYU3M<7m<0_gUuIX@`w9ҫjTӬ,.kYxL)Kv' z?owн<tcDISSj@OI#slgSSR;Z+51ʁSYmj鰌٬Ci`[3X8h5COHA=qdrps-Mbm*ыh~d٭cDe~EؘISVg:! =M:>A/½+jD0 9CEbNd)#rtڙX_<cMq-Mhԕ8eȜFLS'`eR6'lw;.1W 9mbJ̸L5 ʚD} qsËK9ƩVhS&RF"/p,us< tEWG˔)q[en}E)~2?%`o HzI_"$~ H{᯿k=VY]>8~YJ.Xw##-p3ohi)]Jn\[ji?^p()Oz'((k:OH p̃$L1Uꫭ :mU;VTeF_u $ ]EII-{aȰSZ::9Ǔ Pcjg2&rjRGB0xt,R>BQ-PYϿ.2ɐ;8EpbҙIXuA y M}ZB,Ux.Ԟ/-(ӉΛ5Uh/+÷ UR'!7PeE=c%Iy*">g Yl26ȴ \4Myvs| suu$4&X;)f(X*3̙4Rk3#Kif{crMNNP/`&& i1T#|'QknSRfqx2xvY0HfU6sa<{UHxxCh `\#c2Fz{3B~ 58י%Ji LۣG DB\c { TRSjo|S6m*?p#GI~$E]q+$i~ GJZ yfck֩um3=X8P 3J#A {.Q bl]Vooo˧r[_i0d/ ߮r pj['jqOpsc rxLG)gU;" 0i|F !m4L4}*/&sdߤL5ca) $DAŤAHK-xdYD<ܷB3!+׈ v<1f=^gj{ENiX<2<8*O͍ w=BxW/(NV9Pٽ{YV{f:"G4ԣ| J:ׄRJ g\7 ۔7XTMJaJxq \$!v>NeT;Trv *gFC*|be@#;|."y)2-pi)X`!0%)-#Afl;3')d5솔t7T+O.&1H $?t`/RR/_+%Kq+g Mˋpҩ `C͚gPK ٓѿAB>[3&'!^jxTKUS%1PW%UVHD:L*萷'Ns\Q IԾӉhfM} ۓğPk3Wk)"?R'$tj1e.=?@]0?fF$knq.|ޤL39yiȃُyq0ɐa%$nO3k(8~F32*.jar(m _bHgF>:]@azܣnݺ-#޴i&~ӦMè4ҥ7oKWYO[A5Nҥ3O*Qݯܱ[ٲy~Fe5ʒ˕V*k׬W6];V;?>}Vx2DE33y,VQ @+J|r-,e&|* . z`ϐbگ۹T Bƀ^D^r!$0}rXۇClRJ? 02t+S@Mo灨ndΣAV{ ςTѳM7IK꫿wf͚[}iӦZjN|1Y]J`$ ÎWs<hzÓ8^0Հco 1.jf, iײJkS&ܜ5r .ڐTO<]=N{"T՛>~ fdҡkVn݆7nq>^V[lx2e5ʆm[w({ާ:x@J9wk_,?}Ly:D!^ߕ!GqzJ)NPG}ir[%~gd->ǽtԱlAְ΃PբP|4 7$љPq镝Z'T$FG@xhKHyM)W8A!~I!}c}MioMLAqژ\h`(3)"FgcȰߴN:P'E~L8ߎ_ULdP;:!GP-bi*VY3zP&>r̙V\=hǎ]>_׽{Wbccls} kTz,uf@E *6s63yh'|.[7v.B,8lH2.VK9X2tQ.+r)p LiT<L'|jue /<xhOyooオkҺu={\?ec'O_Γߓhݡ\X_26\S$Ar窦kAh`祴?z*!=>"h))v$Rm2u{Adcݤ0`J{1PD()fik;FjxtE*QHKSth\e8(RiY3 8gI+X_RF#3)G@;22Az2M2/dA:K`Ld&L ? ^  o4/oOډ\RE,TzLּ%TŰ) L!Y}a`L2|6ij{{ qI{RaЄç ~93ARfX7w*|⿹)׷''KE܅(0fܼexG_d| >MtO%:In[-u޳sZ> 5 jHxUO[YK)eV݄=ֶ|Zb1WF_:&Ӕ ~#G΂3x 8:(KXssW 2a'ޫldh#P4ʫA@4Tݱ/O-xc*ogEiʴalF8tg=oyа q sΔOgr ~"UrE42>[WW r@xE.^buRUq/}^5gQK?HO\༑SF յ` ͻ9TlvBY\a>;>NH/}k֬ SnrzP/SqV5pM N7ī`/aCRXU s@T"a珅dO2-Pzdk_s̩\:nz^Q-K60˾>"r^R <^أbk<<kO$U9a.ɁJd(zFri_]4C1!'nE8 G1^ H论XxXE SL#C- W|r9kFsvtۓ20+ٖ~{2Μ ,Щ\U?}]xrǫF;euZc'VKxk=ս]cQ+1͍ ;<(R2ٻA0rB0gvyW׶"8f%MĶĹc,H) /TtC |7 "AC=,79UWhRpa%&6kieF[?->BP*!ԆPԵ^tQQĐ#6@V%o)t"c GM/3g`kAqaK-9"=.x`rP0CoQ?ՠC๺m/TkkvJy7-ψDUTOOwȏ@"Ke CٿȢ.P}ڌ(VcW8C`;eBαpF0h㽔PB gվB9O/˵xQʧ adj?0G[^ثj Fg1g^e# -󐋰,Y {Xڷk*]]w%X@ڮRl%@(@ Do Ͳqb>~ʼnt`/#&paBUBB8Gv^M_ly}qo(2 D1Ϟ> HJzbr l_54qúP+6v7}Tڷ-t wA0vKbn򔌅))Dɢ~%(]tmq+ ,BtP!P#XDNr.{-*UmtiRܪS"ݹ0 }}#oS{ {m!l[(P&ȹ|{7 ]~}JK"tF1#v8hCVO>᤭UtR=ҽSm%Ȩ7޽YM7hFo+[qNs)(]!̣®*]QǪ|l䵶+_r|%YJ!G(3#RedUYfW ' e+RP U`oq&)\\y ?H!SOԔ!HQ!d4s)-mƜg TY#S !^Uyɼ ^st.{q55] WjxxU:QJΒ) a{K@,|Q Sz>štʣT;<sb?#g;+S%Ν;G^><4eT쵬BJ-dr;C/緃GMDgQT y {ZQ@R7ς K'ܗqeU 3Vz;mD0UsHSØa&F0j I6칭/h\&Uy|=O1mrO" .:B΋Jt&){.IPի'56ZLO{.ÞMll/-r}+'y 9ʖ.V-i qPI!і1A)gIwb7{%Qa5gǘ;VJ[\Ϛc UJ0\N VhtY^fevlr^q34C_2iҤi֭CQ%{əPR$QQ5jF[ ThSR-d* 6,T"5e\:U2 )\ zIHL*~6߈ jml[Jzgc4c. )g #y$J%z/3 gG"$M$i4H.aXayc}cV{{L2q<9 )t/d b{Tu_p=~3te[@# ~ې)Y 1 v|? 4p3gβSI (E*k1%3$NOךitJcAyA&{@u>p898` s0,aR0*B,?"GH\zZ$h@IÆ B+੿1 xױWGα {}Ny/S$Tس̊H3 mpIЁ ˊR}Z {!"V|ev0y/λ?Z Xg05h A߫AyQ>Xg%Ѓ=Ūbp<4%K/R\|VW3ev7U4OQ}d*!%3{̓z,o2J 暩rxӧ2 l-9706fmٲe׫Y2g:c^Pm8*_~c0BP$W17`kˁR+^UWfy;MOXX >p9j`+ѯL)XIHop8 "mV[(x1[?ɒ|Ū<`˰iM{Bj|ii4yc`4о w|^ Z]%1y_3[|Gd蜼cǎ/^L&eo|Ւ '`z9 WtPJB΅ac]hL$0t"H8}rs-T.,mK0 HxId7nHxf+5\UuK?3OP9|gKn0gW,Ck܀dHY ]eX j{h~k#* mFeBgTwh am1o2p` O11 v|? C:3V3'cRHyH`@,y `)|2Lk}sx"Oyǚ9o4;mme}g"ڿ X Goα*ksӞLɓjf GT{ " 98^.WǔqOnP AMw˖-P8bRp}1qlOV<늑!'5 jBϥg X{_qOgiӑy9F'e{4W~MzSKcx2ø`tথ:7-E ƤHĵ%_P"c2ie]iA!AI*\tx@s7+;r0 ͦFi/$<|ns/MǡM#E BdJRxy{{8pZ9vp֡qw`$9wba{z;pLzoٲe(@i=9YHWv$#>: 7{S 5)6 =O TS ';//\+x i9|$p:̹]ׅp?"Xh{ 䚢M/@` s Nsg9KAP̝+w }O`}% se˞bEXyp}|!h{T6A ~=^R[PL[0HȬWJ~=\ vdBd"(iʵz%ti p%s=ϝvl)=]r}2J] Yb)SZЎp죸T+*/}! g'NB mt7scE=XX`6`OWgo\qiO~Tܓ"TJz@PP)('myKt{ 5^Q ާ J KzOZe&sFB *̨O~GM4#\ VSHS/n͚5k2M_F>,.S@S#۠p:?L,%5t$糹Ժɋs,r.pҮE2MWֈ3HKۑɧykt${"TPMBu U4Fum!)*>C+pr-5-r\| ["c <-ZXC NA^N3Gkm$l͢_K[iCA\67m հ9TWr +1{^q Q`H H7:v#>[ ivHY0 3> ,qq8qo?N=OКK@j : $~۶m}FڷQ*fO!#e ryx)tIHH$I"%Hk׊Lq^dH'DsB)\Kb}n$Bta=J,kNm޼|+ v}C R0]n[ Bk(B"ZJP ku*U׃JNjmJM]vdd>$hjmI: C@žϪ^m#C>POɟ6~2mҤ}%!%]\EFF|vg2,˗PzM& ڶi7kz5{cu1K;v4eVor*k==9;9^=yO^"'T di>tL<':i<ۧH:8i2ֈDakDu`dp;MH|H$+Wkn..E"qWn8opi9}<&qMa-l7Շ\V"`\  Ь6 ぽ0Pd ĉ'㜍c,/203f̘>-y% 2 x7I!Ӷϩ>>w/.hJǺv(Qrrp캥LD9mmvT>l3f[v}%v̗4pyv\Oj;EO)QS#}pi& 0Kf2S`qvh,xD({>/SN IZGp" ApPSJ>&qoy!P;IoHO7/fcƸ)ϯ-TVm0+\g2 :w(^GC둓%⡅1|?:R хlp\ qƁN(ߏ$Wdte_y88F$}XIPCAP?[Tg?9V)7C&$(IQFBEQp/d⸦$n\s<j)ippNHrxkσNgzQcHoS֭fifjnD T3A怨ݺ6} دcVZ56GM6} cQ}-%n3U\~όr:o o$y 6O , :uڈQ#GΝLi٢z̫^ /综|+}}+Mj6$ګի`IIuE-}hK{0d֤g!36rd){U'(%o(ɽ$J|{//ϒ_<'{N{ڵ~opAkyOGM_9c7֐9c+7 %:b0 '@ ~  {ܹx>+KM#u"gxy'IA7 y(< {}IN,n2<o <,2k$_wj,9㚟䋽*θػޜs}[/8ӯc.>88p!W~_m?!tL=g0MI"5B.a8`b$:<2}7a g8IRAR=w|`eZk#k ? "!/HB{xe9&9j'yID?mr/p%PE+80)hOa)K>WpH-H,#_ $@HJ˖r%Jʵw;.].\ɓԂ !cܔШ 5kNgL9q6uFY3]0q_0}Q;kz!W +bM-p}w7v^$hp8W\Z2rN.~ϋk-גLy3/ņ6YC-tEbJi/'}B$4?27J;Gg_5+j-j>[ϥL&Jhh4/G)wnUPTLӯ9sNO9x{mv*7l&Q-],]BOYvj5= Sh~v1i>mC`n PDWǒće9$j U}c믑yyG)p~QQQY .0 g~ҕb꣡uOhi}FœJh-Ւ^?/ !um1F?d?W;ECg-3g^CE_*I*%AMC&b},= ҆?Q޽R\;wA9qreʎM*k֬W/[,Y\Ybv|E0߽{AcI7[ʽ{Ez/^ģ?ߜ?!KITe O퐑z\mKVILH5DL}L ImII=^)K궤oj|ujǐmBR2%yCTA|5RKIrn ͉ZnWfqB[ػ@!c/|Q k~6z)Sbu>/\*ׯ=|ys4 zr%8W9I4K6NrmyU;̪'IHsa~bϒ yNۄ\-/ϭ>}Jhک+PASm6tMG;Iw53u7aυ}r>3<[/\̙N<}>ýk׮{Q((YoEh㽐}{?qrŋ`.k51s`o.gbbb,>7 K.sci#?3H.ZT >ZW{b:ДaP>鵎*<$Typw$|eʱ' y+yMBM2׊϶lٮܹ[+ r\zM ] ~?+X ]G?ѣrLc"""y捂Ka#L} t7u }B-ִY6*7orG;7s3Z&8cО|U`7skL8̰tLmbGL#?|v}ga-FzÆF_xTzܶ}F/Q;[~YWڍ /k0ҒO߄doҝ>MFnlJ4ah~?qΖU[}C>B[9qFҦeN{_`~n0$Bo־>ƟӮ%9B *7WG5='UKh}'}!U$PksQ.&@-?/xh3q\Á/ D]1\mh;Ԟ@ pj ; >$B:>z串AlnMֻw dv ''9}OMyܼk\5%RcjC0RK]8^r E4ou@J''s"UN>䪣sz2{ 0c ,P M SڧN(lܹSAf@! 2TW}y:GX/q l41hv.3wxFCź)jPddOuGQzgUEq鏩ľ#"w :߲+uT*pdJݺuu`OIQcAjd>|SїR/0m,c B`Bb|vN^;}TADe[W±u)frOY/ekOQ4ӞR3$?纳 >#燅ORo ilrj9 1;>#5}m<9fض} ؖ!\`>pi znN|vkt2 !`j'{ uv2=={$z4.;fQhƧ؞}Frmݎ0Fa33\BR.Ul@Rb XJ'|ȉaF/ۡ =Fv008;-{L;KWn׎n5ijGTqqjuҩmܫaM9^U=i]WSpD \( y܃bge}N!zEg.>֮oa7P\e8Ċ y?Li~Vrhg ~bU2zgsz+P}ɐuMސ` lCvcWigն,Gj{#5,Rܡ4Y zms`_ii셡#.$PI7X?s%u'ksva]#!V/Y.\nηjҮ>J6ReɃʲ,t k; Y)p̌]^ ¡FI@]ab!FLk麃+v3= )[_jM]c~q}4k"E~ALx3 з5ԏr 5Gjk6h}<}z _(QHs&N_+4ZѲ )*!I![;jd2Ah$p+/[o+;0PC0XARp.5 HgʄTJYOUv7Pamʘ =%{Guesm`dbvWXn Fy,bCCsY9iݩl>іq0\ýy i/".A ϔ3WWbnt9µJZ^`hQ5`oS-{j_ڪe_{Š+,:ý+U<ޚd~sD^OmfzO5[ µ ?czYA~ChԪ^2nUX+J9N>9;zvKaf/J͆>`oh҄V½s ڀWyfty挙8cWn?Ack"׭\~uWÄFI}9rQ>{\hT0%CP :2c^':p˩\ݓ(yJLB]\=Е?+S VLkxb. Ү'GPe~sm+T_jR "_A5"{g@NJ6LD-Κ5 ͆yc]4yDw^͜u[#X˜]q-@bblN oki.޾n4T؂]j]M(iro}_RkBis3 Pܢ_]jD:֓?|ߵr{]is5N60 d+x e>R'|Q6վ,:oYC TFY½= u^5^6h4&I^}3hV։/[`ُJ"CjIS³Ҳ47kjsݷu~&&E -j TRnRX׷ "K7[[uX `?nrax}+`V9NjtP/XzZDxV!sZھU5jM k~Q@HxҌҪS笞'~ ,{ȄuO%+,PwKN^o.@<ӳvVm˗KŶ)QT\Px{Tpc%폕[#ZmOwsq/c19}  "㸛Gكuektyجy5i{a7(R7J 3-UfR[ء J\nWq]~ecC.)-q57iVD?"DZ欹bj{f>BݩbŊ/[aMF~??m֢f]F{C巺TVͩiT liHh}QA>$$P$T$d_~Y)ϣ@^$k\2MڞbB.n~Zز} w(2M'uY~$Y[[_ijkfvG)VWo]]x/*ped|SQ`^(C@ )}0YH$ɘ;O>Vc6/d/x4ؗH=e?.T9f͚/!&`ߠqW `ggw ::+d ?,gʂ3R;&Jy&j9^Ki&{|'X\gw^Bwmj͇ ާu$d+J5řu3Ե\n5 oܸ~ ѵZP++Cu pE¤붶%\ :}CJGCPlG3S1o\7O$ؖ. fM=pi7Uo]g~kJ1ЎE;WYrk3栥wAtсtpd?)UTo8=v*Stԓ`_zJ-^j#(yD>iWC`KbA`_(e?z򎟶X05F;:9jlZ"5!UQugNB+S&O_ P@`Y lރ'F%b#C٣n* `&yJj^/2ɟC w'+M_U#BY6V/%GEwKќC3yYq <l#@{گ\}&DxFܽ{_g-Co޸@Aʵ7++/]ET$ !:"%n*7pzՂtΐ{R BwJ<Ԑc5{!5 )]}({6~])sTG2fBu78LH_y>-dzF㎻iU⸣{SYXSG(arwN_rl clh$j[zMF?Gc 7_!E,R$rZu ?Ao" z. -lD5n l!{p; 5CR($oN_}ѲOdPC}|Kh=֨ꀇOjqR͐5:VHS|Xy6WxVmwK]wձd<)ǀ=@O^i ES{!J/+RA hfJz4(i]ᎳG wZAnUϔ)}ΛmA5!n9EK#5%NM^z76Qmn(pQ[ZBNߙ]a :B{AMM_液ת]IR55j.^p񀩳W)u[#'#Kzy$,ӵC)41Sw8>5o޼qoU {?4JqU[k+ɷH6|Iiw Sg` ϧ\]d(%/OZǝ=ʟ_ A#D^̦4_ڧ=/:]BS7E:R@M@M,(UA sn[ eWX⼇~+y=>G S@c$l ?ṋk"ȣxQOJ*~`M=ȃBC>D#0U~hG 4Fgv%%:YH%E=*|سNo!9so3OޕwS/3(|I.vHA|/[79!؃@޶mRD(P /V_#5ۼ!`:no̹oA_[Rg+]CmX*Kҥ[I_H#ylC_w0EJHHj7j'pz;NgFp==el|nz.94 ߧaAϽju{H 8AQu ~ {s6Hbeqv@`tՁ HT8<'76?vo|a(SB>]c=( Ur. SĂūwM\ )5>l$!yy -xt>#ԩ^J|_#7^Wр>u{=^z475#{hc@<|9z̅&ЄJ;wJr]o颥=+Yn{/ޣ,E$G9E&KQM<Sv gh5jw8AvmѧPFAF*U{ߺ 2\;67a[}f]0&e%A2eRqyZMK6*n4f\JݢWz`YܨC]Ä|ft #Fb*&Wm :o)QPS&PKZ5j;{5{.ۧY_柘c^Qa nA%:~qsKG=D${{tĀmH)W>3@'qS-C-Sr7\8ou[+*߭Ts{:;KxLXw}ҍMPFE(LVG}i\5{z |_¹QϮ~L X2ʀBJ͝z `V?h9'g^WԘ0fZABB K:݂i7(Ry[zz$Jz=$Iy W뢥Bh{u[۸29^E8e?+PlfV} s|j2f { _!z #5Ԃ6P4g MLW G1.RꆯoU3Ȱ-'|JX 8§PSߕmج`zډ Tk((*r E x[>۠!7l| .PrQ;g妗PYp28Wx9W{ 9ϝ;7`%@U8 =E {tS]#^S 17AMSce#(!r}YZ vB2kId;|&%4οxn\,kВm&#O&˿j!US$|mB~OMڰ9RBζPC3Py**|Jgg,8 T HPr5|I?(4i;#sŶ/JB[!Uuyr?_ 6Z7vر& 9 <͘׽Z6%V@+esVmy8!A9p_8oN8tQGe6~V|-0޵R4)y:˗-Z]}xȑ-T+Io:5;[ U1}& bru{\2`e^iUr7ƫf`?nO~ 4tw rEW3ڥC&q̟ D:2HQl8AZwq7l{@-6G%K<{0.^M'/}Qre+Ɣ~6cf"\zĈtlO0C+wy ְSy+YՙcdJWC#F I&47BO?trr:`CNaUT{3,| Ih_ q^:0~;~,^۴s(!&7-\p"5/g=gY/FJp^)]c PNOIP>/2!\_3Xh`B!sd|{2lLFQB{>뭾Ȑ6ebjuL3A}ҥBt0@C1 I~]}Bc`^^^ѿ=|O:eyNu4҆A&IPL9brKArUuZ:l.:8/Voy/c%wz+*\<8F^б/P@5<'p&֤U.i /E\7бa49pb}q9=pֱz^Oss; >>̄SYWڲU*Vu ٗk?L3v1nv\a~ m`Ѳ2c}Bc\0J|PU3GW@0D( i=LbB9lc}3l`;lOm&Sd?}jjNa#*}2y4mɾ|ד|.ľqo 638gtS_ E"ą4x jQB8,3|Q+W# 萅gyXg ςLhk!s ɇK k?JJ!1^==J(=N PI,9|&/k?jd[q q@8,}HX;Aajvj/j[*K; ҆~輚TЫ(K1:i5Ne;A7[Omo{}'?3 >ϱm3HwܭT3v!owCD>,YL3iC5 TSS1y{K7´`fiY̗3_b[oz}˘c 0O22 N)Ca:& ]a2n?COCW^}f3~UkO<+Aoک[%EK 6-n@qx̸r#M3ot&Рӗ 3ԡZLeP-][wTM[@ 0\}`e='?ס9`vԄ!C_$T1jTT%UJQĘ;^2??-ÇZ^mFEE)ER:>"z_%K57TԲ2ZߺLeTReh,e0-[?/-؇j˯ᙬQ/!D>px ǀ+ ѣG`Й3gS zY̙=3 ffzt8A>vje*/Aoj}oYʘ?,e0u?fX~u2X-ؾ {HXrCe[ʜWsמ}t[_oyp,TˈMp۫ {%w/b$QEA̻a-9vx- I݋xma (槠ȏ$#"0(~VTG0( }_lT'^hG_+C+%[Je(T]2Mcr뫿E:hE:,aZw !!.هCeKت:Nٻws|eD4կ?w6ȯ 9(K0dAKpH^19'`(%"ыdu  =B62HH G>OfΝ $SRLAv:OU?),&(H/\Df sM8F>!,i?E:%9˺XEK'$B HWYxVኲq~hK$;q\xB?y޵k*'$ زk]pa<ˑMOɟ?y>dS'O ;:Q^ԣGOTDy5kVs[c< `}dSAn(ruL|lcBT<dŃZkLÜH[:n?>6*ԣߌi}ut-@*}M5]}ddP'"QJ6qJ͚q 8Q(QOqJdqJLqJΜqJF߽[Sk>0T=mʬ)| +m}) # u={P=G@"`SNz744THwQG\AOC|lkE/T:@RJH[$.u`O Y 9?|~dXX!;w2biPh2>7qgy -3VKWO:쇺Jpl%uQ<0lK॔K4Zڣ4=:u7Uլ~G7&c;9TI~y'.n~~R`N{|e(ris`,'̖5K3;IZ Z~&a}V軎;j?]=Y)\}e8vM)vv,F|{AX%@ J26AL7T4AH&T唪QB) ]((NpBcEQ>(I$AmeKM9Ng:sHӞ~!hSxx>gBb@-wJ"0dɒE)R`J jChZxO ~G5羏ZIB׳fSFiӦ+<Ź}= @iE'|]4PWS|QuCMџw Jo8R"ҥ8n^3Eg(shFF)!ozOHc掗6{JԻ$͋̃~{9jNƀo J*(*3J*'L/zO"% p.]:tG: J::qP7!Kn]@+cq5әpSR.ϐ!C{iFMyvki CgFuRk@uvB`}G AR5ge4?ijQ()22:: |Os2mle`?w|gGL-cvw T%IA.Pw#a,H,Pw{!IS:B?!?u-s:?-ؓ:u,̙BJO$Rj/NqsFϞ=Rxq5\~23PZi3'2\ c C {CB4zŊqUu8qp#k$/ JfELF5.^ڛ)5ϙ3GUTgʔIH3faeݳ_^۷o{ZF޽{ŘYcCFF&H PƎ3K.W>{idACl uE}iU]{^ .IGXg;Lu3עɕ+W!=PO&s X n58>DL!`ۼ9qAt3=y^t6o *(UT T-ߔ y}&9 0]|!/^ _ Qx-̝)tP 8i]auFCZ6K5u+%͚Z@]ֳH+ Du+W,  w/yի!n40 AA`w߬g=[#Vh2DʄS`1׬S^ }|F#( iu\]4(I<}:}gTC=S[΂7&Q˗qpfl#3,U.8{&)V,ڂc ^9cfdNIxΜ9 L4*ٯ߰Iy:T$*DNK>gZ[eq4)IߏN( NcZN[ ;u${~i-!۶m𲷷}<U%ځ8䅏C88!z8^,ksZC'N^? ҽqߴedP . \jX"o8HөE afJdJ겸2~e7c-BBgN6)L㐷iSliCv;iuo߾i=7=F A#G!n"='췡RcXXPGgP:}2 #eX~ep {XP^xo m޽{V= kƴ̍ =o!fB{KKO^jʨ_`xeX%(P?s^&@bGq 9 0)I5#mg,X1Xѣ`>R~ddwyٿHX}0L&{W4P }ȏ,R, DPgm4f6Fh`&f)d`Xg`h,+Y@a%X}MkjkJp< QQu;o0JfDg1E/gFmNL̘Xb'ssΔ} XD.?'%JHa^%Kr|~',e|]{Z3}f3s~.`vr3'q֏?(rܱ)w(6nQ!̪k?Fp/\&{DeCQ)7C/RqrS,T9H-? T++Q zkٰaCU*h~OuYҗR,G|Ǩ Y%y XPY[Y[|Q`dlfѼr*f/_,Lip=xB3۶T6V_QYj|*eʲ+X͛);{rm;{^k7\>C?pE7"31(Uj/FfA,i۫XXpJA QkW)ndn{i1P k~Yuo̗_n]!(ItXw?yO9D=zVTHJf l׮0z^甐hF0A6 &ؾXOMᐚ\cs/~'#C|j#FliH= I|-ޒ?LS(Zs+\AO+ǎW<{0{nnXIYz=ʒ%˕VX#$M*?|r(}8~ aBRgy\efWa៽썀)G- S @"US&,٥쀔F=}}H?+$&MSQ`E0̗/MVԣIfeh'O.5k}r&T ĤsBmB? TJSK4XV~δò?,˔TAXYRP@Sc9Oj]jhZ? =x,&sبgz[lߎDh[+jq}.Uۗ/]y>vBڦ$,T[+7lV֮ yҕE˔WFI~(e~Va&̫W F+Q"**lX)7WPMxN ZqvڶBYBu_?rOBaeƆ#ʜ Kk>eǐVIp r]7o KLEG,JaZ,YcTR UXX8s6RfoZƍ 1 U2g,~OqƉj:ߒࠔ(QB]'Bgd?/O/ufmCcg#5Ѧ:+7cǪc00 ,͓dX۞Ng:t~ڥ ҆)@J)[ykH E׮]j H2eJݽdjg]X7/۳gO̅yq<{-Z!A4vS*ɀW$dI}]eˆE3vft1?]Af.(/\D6|IAwf<(Юe\5&چjcƦj{1L7>aSmj0F)E_@p*1C=7'Oh$GSו+ SB/(*PZ/ @s}%$f;,?o{~MSzʚ}H,P򥽖6kJэ51 xdiӧ-[( h;з)R/P`d8jTS+gWj#Ƨ yJǎӵCttԺ#(ϟX64 SeOůi^Y\)j{ZwvUZq%}hwSM06sLǜoLcƿ1G74gQPU^H<֦z[;3Na;3VaY) vg:ݼ$„6/=}/{2o9m@CC Y-A(p+LuAx*TvrKFʩXe(epe׊߬"._}xgrO4C*{)}za򇑞ԐHv֬y(3֨(w? !p'> |e̳Pm7+$Z6貅T;3 0؝Nac[8=ZΒL CF6:ؤNN9vRj_g7UqYFCV)_P<{({qoeʨyv6C姑M]vBx~o Z t:1& L>CI`{z&`NIi6׶ն~H;әr {cN){|mk@LonذEed{jGξc$ә+G4&}괇ϿM_#!M Agq !@yK.jTtb߅TT )$Hk7xxHTNaא)Vл4 xlL[>mM&h1P~~Ӕ{H8.]\|}{^Yм'*V_l 3.ex *a=uLeFW>fJp~6`LMΟ" duH3%hwHFF!\"gOig9M㗕R>yeQ˔(4A(Sdkkgi8֯^?̄,sc3F&0߿eڛk +!ՌgP:¤Ƕ6sο,soOO9;nJ'י37~7= kB8U3癖{΃O UX6i4 F%˖+OL쯡~Y[5SZ慰읯sXŲ.}`ed?9Ŷt"I fIˉ*+W+_$W_|Ed4g Y?,`j|F72=Ϣ hT_vU`/_fT\4ӡ[KK?-ʲ>}`l)`9lvjժ:`f&+LWCE!"C` %yⓩ`mlz}zY2_=`r紮g?YX_XX.w-L*Q~3BBuo _\XbRz{fl/Qnݪ*UJa%K&8X lY#YJל{?ҥK6re$` aa83][~ee-{ҋ1c\6S~o?7(· W1cjϝ;nZ8yYd싯Y)%s3g,޳d̘QAZK_dX9P ,2b:'OVv!s8LG IlL<d,{࿹,`س?q(^D)Bמ)O=P6V^F}X `%4t";2>4Ɔ3=J||tX͛7y |O0'XHK2'>VƏ/2d ְ=aE)\y?  U?d{/+Uφ 7]nRFFx\6ϔ̰ uכּ{soծHyKerbSwb%\gof(iST^JqoAuҰnÈ_+.|4&XJK:uJW6owww!)KڵkdL&cгgOQEwʕ+?l۷WΟz}ʔ)V#"KfʔI|ޱcG!-ZT0{Ej?CY͚5,;qD?zbߚ5ks!1uM3]jGG$(_rè͞YXCjC-kmYk '֙gB5騲Cʭh%":VyP88J_FW S+M fyڀ:nݺ) 4=_JSJ-[V Rڵ@ݻEKhfwS{~᠔.oذ!,X *Qe/g:OϼtLݿ_Zx5Y <%{1:ҨsI1/[f3y!!_d_b-ϰe|=`2lTOX~Q p Sn.y|.%3_F6ʓhEd:zmxb=dɒ Uv߾}VHUV 58UtR;%NXԮ:u=%t5ӡL5kڜ {)3/=`,W X~mVŊu%ŋ D>>mdRgNNN/}̙Bd6|3g/\hLȸ09{P'*oP)q=(oۺ/sd%̧9{ =3s_Ql< Ski(ny%kʺ>ÕaqʽPu׺O{AϦ^_-5kVo } QB&ƯP^g͚%k~O0/WNssuYZj4j)j׮-T3&Y߿a SmO&PBB}ϨӝRmOfG2*~fw-/sSI"Eu,,`_v,p9l}VHru~PnvkH; PN{\{\uE{ML_S\Js9%pfL(ŋnݺuu;wF'7OɽQF{ nFi{Ǐo^ 1"݋ #gRrs3g#GtND |"!+tb*eh(js&c4;} shp-{ {JC6tJ{^*ʄ#ʺϕ uW)sx𭢜z.o}8ē8kȢKO\rG{>RJC1jnj?)Ν;6~O82lwĈBZwӧOT/ ,URNd5(l0`M # u(S`YO -sjeXӣjݻBiu g 0_tEi>xZr ~T{ <_) D~]~$Yr8.NO){NW1'O\޽{P54ib.\Xm7GG=3%x)SJW>A{_8~HS.\7XOv`z_-= '`7wWR [䨲TI@I4K8jaJ0b`B CK4: $n'ٖ.Yd[r%K܋\e[}UlOnvDv哙G{ws^u,uV7ޟnyxU]yazB;}匌l]3=m+`Ҫvz˖JJ?yCva<#6E2KS LZn+''"'{@%`m?[ (3L= {Y<`_?&#c : :`{1t@%s۟zljm]!aߨݱ.axb{ | ŖĜ`Ԭ)NK a?o^j<9 M%=K)_tPtPt@t  t Ռsմ$9Y٪gpb+U.`]S9u@`/B NNUsTB=.QQ:{vEܾ=0h¢{ (+Hzj\*%uJLJs/U='B¾Fos<$՞ݥwYt@t E9@uV:g3 aly97xJU^]Ug[_[[V1j|1av8^tbٯ_N~KWU¾Jg6#/: : zh &_0tV55yϞ8/eXӧ*\zT__%++maϡMLaցnMtڶ;w$T[د.^N}*[WW׈|YRi,ًHcƌ դ)kmؤN꣔{{{-{ D.1 ] YFMmߴyPz\+z#f HًH_}׭۠&:ed:s;`Tsn:lRсK^ux5o~s׬^MqO>*,,ABRɶE9b>NC*xom{^D :裏m۶|YۧF֨g ʊkgZ rzSu5zEbȋ8D$J2a~8ʙjdg5s!޵5-[/耣EI$R7lؠq{yԤ)64yuzSMy<_dOâ: %qTH///O[Tii g7zB¾իZ[?2%:0u@`/XDYYYjܸq>(S7wn>6ѱC={-:gw<EKD~O@7A'2؋XDcrsG͞NYUS9c}Ey{;K_@% GpY_Ƹ8r}}93MMKHUk{>%Л7zwXt@tQ$J"ΊϪŋ\S]Ϙ`:}cC"UE~p(a׿U\QQRSg~md@utNYIuuu=YN'aG؋8*<ڶmʇQ)3UR=䪮ɓ@kT!aOD~p(ayAJLSl#%KސՇkCYϩw"]"{"B;Tmm{KT~Dz>˞kC%;E~ C*m]b(WU]5];wew)*%%6/(T'zY5 jR_v#-G ؋XDg`]RCa_O?ϣﳄ}Uem%~mmڷL0҆9u@`/B`|[UdrnPB¾UC"FZ': C!Pw@ xoܬN:z{{-^~GGE~ C*m]b((8yK:}z_|`aUUU-P~nH{1uo}k WV&Lv!8 4T]]/BaH r^ "Bx{y‚{ի΅L;%~MM"FZ': C!P>я{<5>9߳:BH;-cg޻a }^ # $ߋ/}s^LM<Ʈ7Njnn{)?03f̘w?nN.Ȋ{yf8NЇ><}Yϒ35vc\?OU!.kuD`/1 zRIm@y\ {ڝxV=z;{4ݧZW5,~^3;_kl2QfC_tMo{p4|ꪫϟm9]/~vBtOЖnzԩi8-NcZ8N_y>W*={LpGYapL뮻_ ^̙3OӊyMv}ݘ]{W^^޴p 1p[G̗r_#ƪEu]P^&Ou,;RQ.\Ns~ÆMkcm̂;vl"qe\kXp1zꩧ[nrpds|p<]89;a„~z!'q|3oWLV 7t];"Q^ BٿqqqFMbqf,[,Ӯ`o~|2N" {)ٷ~.~l2eJ؍)Q$YlJvT2Y/}Ke^4Q9{=ˎ;#] pwky晅SdG{AMۤtu,%N꛱Ȃ1eq=<ב#G^1NEx)blgWX@ʇ~ wPda5FF8jcĉL?72-TL}[M-MVXL}SJ-"3b.EGtN`/yXڽ{[(gf.;9oSSz-ޡma_}WcZ~DD7w|#iXD? hAd /ig11{N1#M[:#,F>c˨pSl>h1:P(u?1=\6ϟFӟt9Ё ,Ha s'3۪hhP7#/%cAg!&0qƖ.]CFϞ={w޹mh5jT#e4&gu .p??f,0K= syx$FvAjmBikM,8X1 p p^~z{zzaR€}]c:b]{{^V籅}A~pph>y+")ho"eԁ^NNZo>Yagȁ Qs@Ȟv{5 38]Cdic/ D/1cur1ifʼ5'0ADLuC((:==}:!} 3S!\sI J15xp4 1@)})9`Iƀ@H EG}4\ ZɁ1' |gg~ 2g@"s"x|%8\Ĝ?A?*co{;!ۡ;g~FWB;+ GGȖHd/@i 7p"i:|PiO6_7~Cw02Jշ+Os-VǼ\1\ۙ& \HcP0@®:(=AQ1pXpa?q"0&rH B1d".;MDLX O$iRဏt/p" D_w@ U3--ZH73 @D_@]DY'xb }dvp{ IKs 3ѫ3&@G7dHFƝ6͔}ȋOށG-oyi1.?70]C[k  )YYY)+F<٥X3^; GGw&=^F$L5~x65wn25ѱ@6iҥ+b^vC DHraOz#)-QR'(HD}4y ޤ0"w5kC߉y73 2D@߈pI S@W8@F댉\ ,#j$wE6Cm/kGb`\z 5O8h8 ^žL81"j=h )&tG"q*, c;SRR6>({=jy<{{4jnZ0Ǯ@/7giˎhM%>pg7ҤoWNq/ Eb $ *'5m!zd9]coiB5kYbg{e(28i! @G@ Аg"`]ǹb,~3%y\@Nn4 `|yv0qJqp?Mgw|Oĩ +5Ņ;0`> ~7)h#7U{ /9RA8:?V6M`/y`DH%AQ͜%$F:MZJχZݣz9Ǽ(D1k Fk #z2=d!Oƀ;#j5Cct<7C˯l1k_RHn~ث =v-ܲ2jLݡ趈3~a pdPy7R^Caϳq($Bw\1sD)1!C3&D08n̻~Й):'r Ag@6/2.T6%xYa}ȑɴra㉬[jXu%ä `4:b&Ե8cgF~mԒ%K|PU3fU OK>}ͺ8>dT()De]DVKHQb&F.EbfW;"|DP1͜,HUO6Sql4CF?) Gz?"®"_h) 4}ݩJ7s7)%L?zPH9sPV-#z$ 5. ̥|9E<YQTȠyeLδ¸1C#W`~SDGLVZƆqVika q8WL=+ ǀl s(k{~w2B- ## @y>(WVTUBbmd9_u &wviP\HiQl11OIITI[m5DD|DH@ll=Lj|)EYD[DI;]C0)VJ'Z/敁 3:J6 qP&$#xg: ΘOOѩqz<Ҡ0_Ƈ5CL[5"}\YF(`'] <Y13CcO>rKX=d!/<1@n̏dH3V*1@oqB&8Y88%1NȞPccJڵ+`YhNJd/8N=*m}P>rJNa` MSocUE#FvSDF9z>,u ].X\H;0CH?€8Z mUohy7 x.` R$Z#;8g 8qW yO~๎빏M߹'k;2Ͻ>)~3CJqD1|v#7@d/Kv>YcNF`LLli=a,CX P"cLy}$s3Wz͸]8ȍwGh9tO(\#N #0-J&A@A]7C%%F9Uױɓ@gܮg5׎أJr%,Vaf`0Դ LxV&,N{3Bր(h:75?}Ѿ1)I\݂xO,>m܇#@2(͸Y^dO 8lіiLgJ?dZ=Ǽ+3}0΂k r {1 }yod{t ?c0flI Gs}iݯS*K.Wzz%9YϿ~F|EDEQRhl4E vڣݥT~E^95=7o*@X: E KQ ]PSN>PW@SǏ {ǣ8>B;O"+OV{#ո@λ.V}'JWU5uAgE"}r\Y_w]P'۠N ʊ[)DF> About wxFormBuilder
wxFormBuilder
Version 3.1.59-beta (Unicode)
An Open Source GUI Builder for wxWidgets
Developed by:
José Antonio Hurtado
Juan Antonio Ortega
Ryan Mulder
Ryan Pusztai
Additions by:
Jérémie Fouché
R. Mark (kramdar)
Deschamps
Contributions by:
Michal Bliznak
Homepage:
wxformbuilder.org
wxformbuilder-3.1.59/output/xml/icons.xml0000644000175000017500000000277211143440026020754 0ustar rrmulderrrmulder wxformbuilder-3.1.59/output/xml/objtypes.xml0000644000175000017500000001251411143440026021473 0ustar rrmulderrrmulder wxformbuilder-3.1.59/output/xml/default.cppcode0000644000175000017500000002626611143440026022106 0ustar rrmulderrrmulder wxformbuilder-3.1.59/output/xml/properties.cppcode0000644000175000017500000000222111143440026022637 0ustar rrmulderrrmulder wxformbuilder-3.1.59/output/xml/default.xml0000644000175000017500000004021511143440026021257 0ustar rrmulderrrmulder MyProject . 1 1000 0 0 0 1 wxID_ANY 1 0 wxformbuilder-3.1.59/install/macosx/Info.plist0000644000175000017500000000223111143440026021655 0ustar rrmulderrrmulder CFBundleDevelopmentRegion English CFBundleExecutable wxformbuilder CFBundleInfoDictionaryVersion 6.0 CFBundleName wxFormBuilder CFBundleIconFile icon.icns CFBundlePackageType APPL CFBundleVersion 3.0 RC4 CFBundleShortVersionString 3.0 RC4 CSResourcesFileMapped CFBundleDocumentTypes CFBundleTypeExtensions fbp CFBundleTypeIconFile docicon.icns CFBundleTypeName wxFormBuilder project CFBundleTypeRole Editor LSIsAppleDefaultForType LSTypeIsPackage wxformbuilder-3.1.59/install/macosx/icon.icns0000644000175000017500000014427311143440026021530 0ustar rrmulderrrmuldericnsȻics#H>|??>|??is32r T^XRN1(ıd$%ĸ@g ?kt^ U}x>U܂?݂G^{oj;6JJ'!3V0+`X8#.%3SU.0^QU "* $-4'NN<l3۬ ˮZfHvho˶frjb{mtMS\\?zIPIB:ȳb-I<70(w}xz/woQ\O[hY]dmPf_iBk_sfsAeg fUmD_gRkZn̅ր﷡)9%%&'4UC|rq[Y]=^uMDQzt&Ji`< 1m"., 7+c -#*"IJͽҷ˶Ȼݠжɀ UĹfUsUUs8mk(Ôd^\EJ*>4h\rF `-7352+IHBUJ0¼Ŀ:]ſèǦm*V~اd AX  ICN#???????;}???????;}il32% !33/.-+*''  #: 8˿S 7ȵU9ͽZ5϶νՀʶ *ǡÀ0ş~yro =Ûyuoh <—sojc ;nje^ 5yxsmhc[q,:6433/mӈEшEшEfƄ€鞐   8q]d>iyk8   IcFi$%&FJ,NS/Gm(0Vo;4*4*8G`FD~MR$xQ~N6!"8"-{/G]=3-ADL X*bJaXT".++,&/1-:Nd`a)0<< _||fU }ˑU"΢V$ҢU$ԣO$ҳmDڵˎ zܔ+qomkhcϾۓ^~̻ܓ`ƘƸדgΥϓeΓAhnhK)NX̓=dVS\ov_F@ ʓ;aUSMHECB> Ȕ9]RPLIFB?; ȓ8YNLHEB>;7 Ʀ9^cRMJFC@<95 ? GCA?<9630.# 3;@@;-8>A- rw,i-C>=E(6J3J@AK%/332z'nnj3U0j5j\fI.Rl U2p}Ii|.+}X*5N6GykZ  ^8Hi D4,0XAyjH_ 7/1 C-T#l?fUJ_ %MJ Ma@ fF!z= LaiGUN0)'> +D 8K Z0=kmoqb*W[Z[U`ivutsrqfa[x°q^Yʓ^X̘[YΘ\Yљ\ Y؀֛YYξwZġ \ۣƕ!Rݘ#9ݘ+gvsqonljibޘ+Wkпߘ+dmνߘgʣq̺ ۘj̩tžҘ+oѰ{þј+uʯkИ+Zx|tprrhd^ahfnΘ+Eiw[\itIF b'͘Ehv[ZVRZpzZDDB˘ CftYWUSPLIGDB?ʘBdrWUSQOMKHFDB?=ɘAbpTSQOMKIFDB?=; Ș?`nRQOMKIGDB@=;9 m>ZkPOMKIGEB@>;97 =Z_sXNMKIGEC@>;975 6\TOONLJHFDA><9763 AIGECA?=<:8521/-% -:UUWWXV7-GXZ[VH3%UõE#ǽ٣;)&/*,-+'+3+(-2-'+$&(1%T͒7:;:3%`-Ci)*@oQ(?uW(BzN0a}@"-i}>(U͂$Rb(;|-!a.dO%N(R}-T̚KPRE.#h)~5&it3UƷ.#ůj1$($aD;:V0{)/±DU̖BEF>.#lAFzޜ1(BUO~+ou=X +°CǗ $S.J3{{b%Qo<'_~3U͆& $R?D)nG8.#H(Z{-V҉% $z+"I}s6/l\&0k@/wA(Jk+ (u]-3-/.,3../'01-+),.2/0../*.--,+&̊́҃тșĘȘƘƘƘԘўY  !,//1/0/1$u 8@|sB=>?/FPMKJHFD? EcWLMO;>jb__]\ZXSRtd[\^FIowoedb`[dƠwlknT NxomljfNQpLd{~{y{}?(Sxwvtp U &U}8Y×z#XAoa ` #X >LYTxȻС#X$9N*+=gW"%#X%8L+)%!,H_fT+#X#5K('%# "Y!2I&%#  nS 0G$#   .E"  (}B '1L* ("  y뤎)ӛ)Ƴɷ˭̡ˣ̌q{x)͕ԕ뫏В˕اј?(ٟۚۙsؖ(ߤПЮ̒U碆աܗ)బʓĠ㱌磎͍ExxUyȸֿqۙfΐ q⥄ԕВʕА ͓ʙԺuԠԤ’ ٳh8mk #=============>=!~QF[aaaaaaabR7"""""""vf =Z.\0\0\0\\r] waNv>!+****,)***""""""""""""""""́/'!{~rWt^|Gv}|lӣGBXj-#$&zATR{)sŤܞ '#\5+m!G4+ , t 'xld2@&z<] 2|zJ2Ma06~Cit32\9 (04332110/..-,++**))(('&&%#X~znK%0AnP1Drz!tO)b eĻf1Ʒh(ǻi1Ⱦiȿklm¼ný qľ r$u ,&,Ǻȅøȕ̪$ʦʩyԥɰqɨo̾Ȩo˽ʪ#m˽}|zz{̌?m& l˼~~}{yxwvtxɟ&O#lʼ}|{yxwvtsqpqẏ?&|Wjɻ}|{yxxussqpopx̆&\iɺ}|zywwttsqpommw̆iiȹ~~|{yxwvs opnllv̅m&̒iȸ~}{yxwvtsqoonlkku̅&ךgǸ|{yxwvtsqponlkijs̅ךfƷ}zyxwtssqponljiq̅&ךfƶ|zxwutsrppnlkihghq̅&ךeŵzxwvttsoonmkjhhfgp̅ךcĴywvtsqponlkjigeo̅&ךcôxutsqpomljjhgedccm̅&ךaóvtsqpnmlkihgeddbal̅&ך`óurropmlkjhhgecb`ak̅ך`~~}sqoomlkjihfedb`_`j̅&ך^~|{}sqpomlkjhgedcb`_]_i̅&ך]||{zyz}{ytqpomljhhgecbb_`]\]h̅&ך]|}|zywvutsrpomlkihgfdbb`_^\[[g̅ٝZy|{xwwvtsroomlljgecba_^]\[[f̅Jh{yxwvtrpoomlkjhgedcb`^^][Yd̅&-Kywvutrqpomljiggedcb``^\[YXWXc̅&L !Wttssqpnmlkhhgedcb__]\[YXXVVb̅%9\abba`]]\[YYXVUTSRQPONLKJIJX̅ M%)+*)('&&%%$#"!"4̅d-̅ѓe?51$̅ӺsdY@ 3̅̅̅̅̅̅̅̅̅̅̅̅̅ǟ̅ɸʇƇ֣̇ȀɧɈ̤̉ţ¶?s魙m mٰ?u?mU?  #$" HRSSTV WWXXZ[[\S@\bcdeefdb_ZL@)t!f g#t~ftI.fS. ,dW%tj# f. jw7t`f#8@ t`f#B +! *45, >>?!CEE;, "NOO8t`f#p4>??3ILMH3$:Z[L% 8dee\,\rrc2t`f#"3 ?AC:!PPQQ? 2I^_<VgkhJ%Mqwr7tmf$iJ:AC<")PPQRC9P^_/?bjk]>^uu_  tv3 f9 *o!+@C?.$7ONORH"D[^_  UelkDfsuo*tujYZ[[\^^_R&fx]67;Kax?CB<1DL2BLM6K]^V #Ilmm1XqujEt{8f | >CDA ;G46RI"O]\@ &Lmogc`ptkM t~xlmnnoqrsc-frtwza" 8ADB?E),PM.S][0*eonsqU+tP>456770fdJ678;>Igg=0?DB"CB&NP9V]Z   Vnopqsk= tt"f2 "ns6 ;DC+4G= ?Q- IZ]W &kopqsL#t`f#9 7DD:EG5 /SA Q\WC)kopqsW)t`f##  0AEC H;) !SPS\R. TnopqsmHt`f#s4 +FGI5 OWXXZ[49cjjVFbuu`%t`feL9:;>CTq]$ 5FGIIH)  LVXXZZ(]hke<%NswxAt`fwy|j1"DFGHE:NTVXUFfgaQ*[suo> q^c}1 ''))'+2)  8;;- C4 @JJK4 9RXXZ[ \]\ZTH2#       fccabecbff^f\`dfbdeccdabddeffghgfdX?bddfmzkgfde[fdeet΀ցЀ Āffb` Xddz ׀ogcaf]cfڀɀĺ~gddUaffʀ jeeU[fԀЀˀ ëjfef[bff ڀՁЀ́ ūkfedfbff݀ڀ̀ Ŭkffdfbff ۀ؀рŭkffd+fbff΀ ǭkffdfbff܀ Ԁπ̀Ȯkffdfbff݁ۀրՁӀЁπȮkffdfbffڀ р ɯkffdfbff܀րԀсʰkffdfbffހۀ׀Ԁс̱kffdfbff߀܁؁ԁ ̲kffdfbff݂ڀـրՀ ͳkffdfbff݀܀قՀ ͲlgfdU?fbff߀܀ڀˀɀŭtoofbff߀ހҷfbffށ̷fbff Ŷufbffه ֫ ťfbffڧ.fbffᬜ Ƥ)fbff֣ ר(M^ffǞ ૙&)Iff 䬙')ff  㫙+(ff㫙 $6ff㫙6Peqqpoonmlkjjiiggffeed$ff㫙 V|~3}||{{zyxwwvurnff 䬙 *3~}|{{zyvqff 䬙?~~}}|xrff䬙 P)~ysffſ䬙 Y2{uffľ嬙Z)~vffý 嬙[ ú,xff½ 嬙 \˾yff 㫙]̿5|ff˿ߪ^*|ffú ר`õ)ff ֨bĶ ff ֨bƸ8ff ֨ dǺ9ff ֨dɼ6gfـըgʿvhn~ فԨhź khq ހ݁ ӧgɿ xjggr~~ ހӧ^umnwsuqfgl݀ ܀ـӧEljimvkcejzwtr pgb`_`VSQYbdej܀ف ҧAghhmui`_`ho| fXTRRQ7-'6Xfdq߁ځ؀ҧAfhgmui__^]\\by TIFFEC?܁܁րѧAehglͿui_^]\[[YXX_wlJGFFEDC?܀ ܀ـ ѧ@dfekͿtg^]\\[YXXVVWXez`PJGFEDDCA?׀ Ч+?ceej̾sg]\\ZYXXWVUTTW[_djruvxqh`XMIGFEDA@? ݀ڀ؀ՀЧ&?bedi̾sf][ZYXWWUUTSSQQPOOUVWWQMIIGEECBB@@?ހ݁ۀրՁЦ2?bdci̾re\[YXWWVUTSSRQPOONMMLKJIHGGFFEDCB@??9?Ϧ2>acch̾qe[ZXXWVUTTSRQPOONMLKKJIIGGFEEDCA@??>?݀ڀԀ Ϧ2>`bag̾pcZYXWVUTSRRQPPONMLLKJIHHGFEDCCB@@?>=?ـ ڀΦ2=_aaf̽ocYXVUUTTRRQPPOMMLLKJIHHGFEDDCBA@?>=<?ف ߀݀ـՀрͦ!=_a`f̽nbXWVUTSSRRPOONMMKKJJIGFECB@@>>=;? ߀܀ Ձ ̦2=^`_e˼naWVUTSSRQPOONMMLKJIIHGFEEDCBB??>>=<;?݀ڀ̦2<]`_e̼m`VUTTSRQPPONMLKKJIHGGFEEDCBAA?>=<<;:?ڀ؀ԀҀ ˥2;]_]cʻl_UTSRRQPPONMLLKJIHHGFEDCCBA@?>=<<;:9 U ݀ڀ Ҁ ȥ:]cʻl_USSQQPOONMMKKJIIHGGEECA@@?==;99ʁ߀܀ۀրԀӀ £2 9\]]bʻk]TSRQPOONNMLKJIHGGFFEDCCBA@>>=<;::97 π˺2 9[\[aʺk]SRQPOONMLKKJIIGGFEEDCBAA@?==<;::987݀ ՀҀ Ǣ2 9Z[[\mǺi[RQPPONMLLKJIHGGFEDCCBAA@@><;;:98776؀ՁԀрЀ ſ2 8ZZYY\dYQPPONMLLKJIHHGFEDDCBA@@?><<;:988765m 8YZYXWx_VPOONNMKKJJIGFECBA@??>;:9877652 7XYYWWXmv{_RPOONMMLKJJIHGFEEDCBB@@??><;::9886654q2 7WXWWVUTSRQPPONMLKKJIHGGFEEDCBAA?@>=<;:998766543' 2VXWVUSRRQPPONMLLKJIHHGFEDCCBA@@??<;;:98654433?mq_ 'UWVVTR!PPONNLLKJJHHGFFDDCBB@@?>=<;::88766420 &PVUUSRQPOONNMLKJJHGGFFEDDCBA@??><;;:97654432( 6ORRQPPOONMLLKIHGGFEDCCBAA?>>=;:99865543221-#4@GFDCBBA@??>=<;;:998875542110/.-,'    "3-)3-.-+/0/("-.213+313110(-15OSTQ;31.31JTVW TPLE>42010+,38I60/21t ~r[4213,3;̀U70/21ͽU922,3;ĀS70/21۴M91, ,3;ŃeMNL940/21Ԉb==>J_؀܈X11203/1U22303(23/03/3$-.3 1.-3;ƧY>87422021c=1325=:3/!$038>;731003;ƜM20$221W21)33H޹t13H21DYwxxg61.12Bo~~qW313+1H\]6339N|h1223/3>[sS320.3;ƜM23221W21-1:ޠf13I3,2AXH2."/15Py1333.2`~c1022DwO312*33el91/$+3;ƜM210 2221W1 003VeD203H'05F]33+31Gc?2.-"01sV1/025H<2002^qG22',3;ƪR412.)221X2132138{A40G22?h30-/1RoJ4.)'33~pM1/3218O7129|W83/,3;ƴjPKH=3.(221lI@?AEK]̟R61390111'"/038P7005Rn3?qH5313oq:1011Hgf313* ,3;ƿukldI3/(221ҙiikmp|׿pG1/3!.03`9116e\34hW;223\71.004Cz?10# ,3;ƲY91.*221f?122311Tؤh233.03fu;338E33YqB3A2. 328b\21 ,3;ƜM21013221W12/31131Akո730$ )23L>34>433KtI35B932 -18ed11% ,3;ƜM20221W21!33%33UR5/. -09E66Sn1>`R58Xo70-035FQ10) ,3;ƜM23 221W21 /2Oe6.201wM;8`c1027VZ:9f^6.)31B]k71.( ,3;ƜM23 221W21 /2Oi6//$/3e`F>xlP3.32KoI?~D2,3025dN423 ,3;ƜM23221W21!3%23V^60/11OjxkW;1+31Dx~n12")23f[gI12#327I{71002^}N32$,3;ƜM23221ϛd12+3/3@hT;30318R513 /02H<33.1dy@31)+3;™L23221р̭c73133C,28Fopqqm=31005UltuviA32"11=Ox{|jS32+12>XoX33/-38{nB23221m zeU;62023-028BA520-01=hjiihgfecba`_^][ZkQceeoʹrkecQ@lnmv{khgffedcba`_oUkllv̽yqlkUCnqpwojjihhgfedbbr[prr{˻~vrp[Crsstx}tmmkjihggfeeu^qibgpnouqR DuxwyŻxp onmllkjihw\hH.'z^E@M]twxy{zyl0 Ey{{Ⱦ}uttsrqqppoonm|z\9 =cs{jG|ȿyxw vvutssrqz\9  .UzqEI}{{yxw uuz\9 '=Oe|h>Kó~}}||zzyyxxz\9 ;bx? LĶ ~}z\9 AinP Nǹ z\9 (Ealux{paB! PȻz\9 Q´ z\9 RyȷֈׇրҺz\9 FgJ@AwiNILoɲz\9  )?<:@vhM>37=Scȃǫz\9 #9:9?vhL<0sfJ:.-+**)((&'(*:Tlh5 z\9 2"7754+z\9 "654;seI9-+))(''%%$##! %((*" z\9 2!443;rdH8,*)(''&%$##"  z\9 2!233:qdG6*)(('&%$$#"  z\9 2!1219pcF6)(('&%$#""   Vz\9, 0118paE4((&%%$$"!   z\92 0107oaE4''&%$##"! lphP- 2/0/7oaD3'&%$##"  &1-2.0/6n`D3&%$$#"  1./-5n~`C2%$#""  1.--5m}_A1%##!  -,4m}_A0$#"  1,,+3k}^@0#"  ++-B|]?."!  0+*)(.|\8*! 0**(''ttR2& 0)(''&(COX3"  /'('&%$$#"!  .''%%$#""!  %&%$$" , #%%$#"!  *!""!  ' ?ssfm?fmm ɁЅр ͦԃ žԭ 講姝 ɷ ˴ ʮm? ఠ򵞗ܹuq ٨𮗖徖sm بm𮗘u翖sqǼqƺب𮗘u?ٷqIϧǘ׷ݫ޻بs𮗕/մ_Ѡɯϟ꿥ᬙ 񯘁 ġ׼2ը翩ޫݰs躪󻧠جHəٷ篠̦鵝Ӄ̱иޞ9֙ɜࣘmm齪ʞ缙࠙"ܣʞٞΟР ߀!׵Э"ܬۿަָ ŹԼ!ݶ״ఞ㳛?Š 氜 ڸŞӥࢗϲ ب𮗗盙m Ԡ˚ҧНط بs𮗘 sݥѿଚݾ̫ ب 𮗘u܀Uઞ˹䳝ڴټ ب 𮗘uU݀ ว߿գک? ب𮗘sƽఞʿ˗q属۞ ب 𮗙 ?שϼ"轢Ƥب ȗͥŲ#ڪݳبƺέ,滨q?Ɯũبյ ۯހ,୚U֞ġըᵚ ƻŀ΅ ÷ U_   ut8mk@ .Wv|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~uU7!:mwV'zw:k)ؙI'd'e(e(e(e(e(e(e(e(e(e(e(e!(eG000000000000000000000000'(eК0 (eؗK'(em (e9(e(e (e(.iC'888888888888888888888WP P GP C~P P bP P P P P P P P P P P P P P P P P P P P nddddddfwP  P  P  P  P  P  P  P  P  P  P  P  P E ,$Dbz2bzG .E :HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH?&t Z ;beC~ɐG׏Z  ۱TFIIIIIIIIIIIIIIIIII+CHIIIIIIIIG@:0&'888888888888888888888888888888888888886! ,n)ϊ8=L;?Qʆ@?Q֙?Q9?Qm3oxxxxxvlGexxxxoP,fxxxxx|yxxxxxq@Drxxxxxxv,No? h 9ʯ7  ˤ, igsόg36}| vme3 %_ ! ( LB EL3 ' PG7oBeA~~~~~~~~z[ 3>>jOs/KWcؽ ?S3> lmv-[ ?m,3ΌV>%<Tך?z43&epqI7?z43߫([}؛ :.?z43ǝҵtK?w23[hLD~?h*3(H?⸸3ꥥE%`f0? 3 `! 3IO+?3 r3"7S?3 u6]JEK?3 )j+ g ><?3뮭N&Tj?33/,c ?3}xV iѼ#?35 |?d0}G9A3K?E /w[_3`֗'yzCC-N.ܢkTصN?ب܈|ۼZ!ŭ[/iiiiiic! ;fiiiiiV< Vhiiiiig] 7biiiiiic(!diiiii_E`hiiiiiiiiihf]O2 wxformbuilder-3.1.59/install/macosx/makedist.sh0000755000175000017500000000324611143440026022054 0ustar rrmulderrrmulder#!/bin/sh #***************************************************************************** #* Copyright (C) 2007 Auria #* #* This program is free software; you can redistribute it and/or #* modify it under the terms of the GNU General Public License #* as published by the Free Software Foundation; either version 2 #* of the License, or (at your option) any later version. #* #* This program is distributed in the hope that it will be useful, #* but WITHOUT ANY WARRANTY; without even the implied warranty of #* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #* GNU General Public License for more details. #* #* You should have received a copy of the GNU General Public License #* along with this program; if not, write to the Free Software #* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #* #***************************************************************************** # uses tool macdylibbundler.sf.net to integrate wxWidgets libraries # inside the app bundle. Not necessary if you require the user to install # them on his side, or if you use the ones that come with the system on Leopard PLUG_IN_PATH="./output/wxFormBuilder.app/Contents/PlugIns" FILES="-x ./output/wxFormBuilder.app/Contents/MacOS/wxformbuilder \ -x $PLUG_IN_PATH/libadditional.dylib \ -x $PLUG_IN_PATH/libcommon.dylib \ -x $PLUG_IN_PATH/libcontainers.dylib \ -x $PLUG_IN_PATH/liblayout.dylib \ -x $PLUG_IN_PATH/libwx_macu_flatnotebook-2.8_wxfb.dylib \ -x $PLUG_IN_PATH/libwx_macu_propgrid-2.8_wxfb.dylib \ -x $PLUG_IN_PATH/libwx_macu_scintilla-2.8_wxfb.dylib \ -x $PLUG_IN_PATH/libwxadditions-mini.dylib" dylibbundler -od -b -d ./output/wxFormBuilder.app/Contents/libs/ $FILES wxformbuilder-3.1.59/install/macosx/postbuild.sh0000755000175000017500000000772011143440026022261 0ustar rrmulderrrmulder#!/bin/sh #***************************************************************************** #* Copyright (C) 2007 Auria #* #* This program is free software; you can redistribute it and/or #* modify it under the terms of the GNU General Public License #* as published by the Free Software Foundation; either version 2 #* of the License, or (at your option) any later version. #* #* This program is distributed in the hope that it will be useful, #* but WITHOUT ANY WARRANTY; without even the implied warranty of #* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #* GNU General Public License for more details. #* #* You should have received a copy of the GNU General Public License #* along with this program; if not, write to the Free Software #* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #* #***************************************************************************** APPCONTENTS=./output/wxFormBuilder.app/Contents cd .. rm -r -f ./output/wxFormBuilder.app mkdir ./output/wxFormBuilder.app mkdir $APPCONTENTS mkdir $APPCONTENTS/Resources mkdir $APPCONTENTS/MacOS mkdir $APPCONTENTS/PlugIns mkdir $APPCONTENTS/SharedSupport cp ./output/bin/wxformbuilder $APPCONTENTS/MacOS/wxformbuilder cp ./output/lib/wxformbuilder/* $APPCONTENTS/PlugIns cp -r ./output/plugins/ $APPCONTENTS/SharedSupport/plugins cp -r ./output/resources/ $APPCONTENTS/SharedSupport/resources cp -r ./output/xml/ $APPCONTENTS/SharedSupport/xml cp ./install/macosx/icon.icns $APPCONTENTS/Resources/icon.icns cp ./install/macosx/docicon.icns $APPCONTENTS/Resources/docicon.icns cp ./install/macosx/Info.plist $APPCONTENTS/Info.plist # fix libraries' internal name and path... not really necessary but better install_name_tool -id @executable_path/../PlugIns/libwx_macu_flatnotebook-2.8_wxfb.dylib $APPCONTENTS/PlugIns/libwx_macu_flatnotebook-2.8_wxfb.dylib install_name_tool -id @executable_path/../PlugIns/libwx_macu_propgrid-2.8_wxfb.dylib $APPCONTENTS/PlugIns/libwx_macu_propgrid-2.8_wxfb.dylib install_name_tool -id @executable_path/../PlugIns/libwx_macu_scintilla-2.8_wxfb.dylib $APPCONTENTS/PlugIns/libwx_macu_scintilla-2.8_wxfb.dylib install_name_tool -id @executable_path/../PlugIns/libwxadditions-mini.dylib $APPCONTENTS/PlugIns/libwxadditions-mini.dylib install_name_tool -id @executable_path/../PlugIns/libadditional.dylib $APPCONTENTS/PlugIns/libadditional.dylib install_name_tool -id @executable_path/../PlugIns/libcommon.dylib $APPCONTENTS/PlugIns/libcommon.dylib install_name_tool -id @executable_path/../PlugIns/libcontainers.dylib $APPCONTENTS/PlugIns/libcontainers.dylib install_name_tool -id @executable_path/../PlugIns/liblayout.dylib $APPCONTENTS/PlugIns/liblayout.dylib # fix links betwen libraries now that we moved them, so they can find each other # in their new locations install_name_tool -change ../../../../output/lib/wxformbuilder/libwx_macu_flatnotebook-2.8_wxfb.dylib @executable_path/../PlugIns/libwx_macu_flatnotebook-2.8_wxfb.dylib $APPCONTENTS/MacOS/wxformbuilder install_name_tool -change ../../../../output/lib/wxformbuilder/libwx_macu_propgrid-2.8_wxfb.dylib @executable_path/../PlugIns/libwx_macu_propgrid-2.8_wxfb.dylib $APPCONTENTS/MacOS/wxformbuilder install_name_tool -change ../../../../output/lib/wxformbuilder/libwx_macu_scintilla-2.8_wxfb.dylib @executable_path/../PlugIns/libwx_macu_scintilla-2.8_wxfb.dylib $APPCONTENTS/MacOS/wxformbuilder install_name_tool -change ../../../../output/lib/wxformbuilder/libwx_macu_flatnotebook-2.8_wxfb.dylib @executable_path/../PlugIns/libwx_macu_flatnotebook-2.8_wxfb.dylib $APPCONTENTS/PlugIns/libwxadditions-mini.dylib install_name_tool -change ../../../../output/lib/wxformbuilder/libwx_macu_propgrid-2.8_wxfb.dylib @executable_path/../PlugIns/libwx_macu_propgrid-2.8_wxfb.dylib $APPCONTENTS/PlugIns/libwxadditions-mini.dylib install_name_tool -change ../../../../output/lib/wxformbuilder/libwx_macu_scintilla-2.8_wxfb.dylib @executable_path/../PlugIns/libwx_macu_scintilla-2.8_wxfb.dylib $APPCONTENTS/PlugIns/libwxadditions-mini.dylib wxformbuilder-3.1.59/install/macosx/docicon.icns0000644000175000017500000012272711143440026022216 0ustar rrmulderrrmuldericnsics#H????????????????????????????????ics8++++VV*NNN+*NO555-*xX.exyX 5kk4 5kk,5555222y*+Uis32bۼѾބ׃ԥܻ 亞Ӂ b cRĀ p f[4_6 B' ӷg=ۼѾބ׃ԥݻ ƽӁ ͒ nhܫ  X=6ҭ L6-Ӫ52 |7kboS kjhۼѾބ׃ԥ߻ ӁՀh IF!h@A }m .r .#.  #   ߸s8mk!==========)ICN#icl8+++++++++++++++++++++++++++++++V++VyyNNNNNNNy++++y*$NNNNNxy*$NNNNOUyNNrN*/ ,۱rNxxy32rNxyy32xryy  322  32+  32+  32+ -2+------,yyyyN+ΪU+yOΤyΝyy΀yyUΪNOΪΪyil32zyzwxvusvԇŽՇïׇʸ֌؈׋ىǜ׊݉˥։މίpWKHބ ׼yw7& '&&pYY͇ Pʥo߇ Qϰ߀Rq؁/~jb\ WuaXTWkwXPK 2<80#   ja Mp g* M1,2 =<;:9:86543100.-,,( I Ɲ1.~}tOxɄѨ0{}~w'7ԆۯIׁ 䶤AO躤)P)ðR¤'òS¤(ųUä'ǶYǤ ɸ \Ȥʻj- ǤǤηćĀȤͷsrv~ ŹȤ͵rpnkhn 澾ɤ̵qonkhedfr ǻɤȇɊ˴pnljhec_[[e ɹɤ彍}~~}P }~˱}mkjhfdb^\[^ ɹɤ l|}|˰{kiheda_][Y] ȹʤ ׋ z{zɯyhgfdb^\[YXZ ȹʤ ~ xwwȭwffda_][XVVW ȸͤwvwǭvedb`][YWVTV ȹ̤ }uttƫqc`^\ZXWTRQS ȸΤ |rqoŬqa]\ZXVURPOQ ȸͤ |ppkn^[ZXXUSQOMP ȹͤ|nnghdZYXVURPNNJM ɹͤ{lmgda[YXVTRPNLJIL ɹͤ{fmfd`][YXWTRRNLJHHI ɹͤ {Fkhea_\[YVUSPNLJIHI ʹͤ {NPca^\ZXVTQQOLKIGEF ɹΤ{ o ʹΤ{G] ʹΤ{㪀vvxyustrI-Vvqops ʻΤ|Ͻ ʻΤ|л ʻΤ|κ ɻΤ| κ ʻΤ| κ ʻΤ|κ ʻΤ|ͺ ʻϤ| к ʼϤ| ѷޚ ǽϤ| ܹ Ϥ |Ǹ Ϥ |ĵϤ |ĒϤ ~Ϥ ~움Ϥ ԂƅϤ Ϥ ~y{}{yФ Һc})0GxФ|}Ф(bceimoqrvv+x p{}k@uФ!}~^PQRRVX z#dU[hfФ.ڟz|QL Фa#ֈg!mz|<6:VSV>Фw 0$<-z}=r <CФF^@/IDJ(qb1V.-GaGOafrz|B2*&&#= :/cm]Ф@7Ҍ JN9H1GXk^d Np=y{Wz Q1nФF5=R299B SNJ(`O2lQy||meijloQrl\ct*}ФGL&@\ <>HW8+5gRHf[y{w\STVX[?qiZ^c}AФ?+9742XsVeef+Oy{S TDbׂФ9:8."BFT 8cdV z|>h_\\[v ;1wf COФ</C=KOD0Mcdc$Xz}<w;xvФ,mC 4#D Q2x' dXTjWz~;r;xsФ,<.0%jc)>5Og [TBnKz~;n:E SSФ3A=BOJS?xVd ]m3|=n]dvςФ,)#DE>LSW/?@fM&'mg@n}ptrrФ+!"D*- ;2(I*JMpU]^bdfd\FSФÃQZNԉ/Ф+ZQROxpPQQXaNRRQiVPRP_]PPQoׄNQPOPS_yنФФФФФФФϤߤ/ ***U|yxyw uuvvttssvob-fїΎ CԨĿގէ̔էɎԧۂקр sק½pר~oبӀ½nةԀ{lةsk٪sk٫»zk٬ý|hڬkڭրiڮ »hۮ ľhۮĽeܮdܮdܯ c a߯º_߯ºyf\XZ^am_ļsaVQMIFA;5-,2Pxn ƽohdecb`_][XRI<7J~ݤۄsjijkjedcbcb_S@Gt݁܄܁ûtrspommlkjheYAHޞ݀܁ ȿ|{|{{xywuqnhVބ-ĺ{wqy}݀û {ú Wϩ qJEFGFGHIGLT P?k}oSA Ɲ1tByWOɄѨ0TZ|AxԆۯ2Gq@fׁ 䶤Fr¿ ?e躤*FqAg)Eq@g¤'Eqš@f¤(GqŚ?hä'FqȞ?hǤFpՀɟ?iȤFqЀ Ijۋ ǤGrՁsyǤHnԺȤAIjοƕӿȤKjϿݵ!ɤAPlνǢڕɤԽALmͼɤق>&o˼ɤ>0oʻʤX%Xhjihgfedcba``bVBoʺᗇʤvn~zxwvussrqpn@o`BmɹᘆͤX\z~yvutussqponnppaBmȶ☈̤=Q+{}ywwuutsrsudBlǵ 㗇ΤER-~zzyxxwwyhClǵ㘇ͤR,ǰ~%|{z{}kDkƳ ߕͤ=R.ʱpCkǽ ՔͤS0˴.rDkϔͤR2ͷ1wEgϕͤXS3кKYϕͤR7Ѿ?^FdΔΤXR8ʿLF`sxuvuvuvuttqonmljx͔ΤXR%iZniZjaLHFGHKJEDFA=FKFEEIi̔ΤUVQkeMGN\t>xtuunN864dʔΤXUVRlgOHGEGTfkG=?=ʔΤXWTQleOIHGD?=CUomH:57:9ɔΤ8VTOkdNHGEDB@==>AGMMH>7212165ȒΤXVSNjbMFEDCBA>>:9776422332233ǒΤXVPMhaLEECB@??>=;987644311/23ǒΤXVOLg`JBCA@??>=;:986542210.22ƑΤXVOKg`IBBA??>=<:987543110..11đϤXWNJf^G?@??>=;:986543210.-+/0ÐϤXWNIe^F@??>=<:987643210/-,*./~ɿϤXWLHb\E=?>=<;986543211/-,*)-.ÃȬϤXWKGQYB>>=;:976542110/-+*)(,,Ϥ4WKFD~T@==<:986643210/.,+)(),,қ~Ϥ!XJG@NYVA<=;:987543210/.-*)(*,޶ Ϥ [IHC>=<<=;:986543110/.,*)(&+,Ϥ!pGJDAA@??=<;987654321/-,++)-'Ϥ*EGEDCBA?==;:977542110/..-+ϤV  sϤJZФ nULLMLKWrJHIIHIIzѐGHHG KQVeФ#!!"$&*+$'#(%"  Ф(6^ +LuФ!&D¾K'\™יФ/୤Ǧ,C2"WӅQ\Ф>yL(}1"DzWUsporФK48R;#IQ).[N 2`X&]GhO/DzTsz[ФFtVxf6mxrm!L1'>hMQ2B(UPMNL]TsP|CՎ4ФEB1GםYcR,M NX*z6%?>!$! T҉jȟ)ФF+"M k%y<>9Dfk8p(>Tġf Ф-hpe urTÝмt$Ф-[s1!^|%vt&td4ki>*TӌyЕ%2܂Ф,60ym ]4C EzC >{;}wttsTtR|?y؂Ф\zE2T?N4#Sgp>ySsKФ,cVHu9G0*` MwMc=>ySsRФ,=yUuhz!mZ{U}XE. .>ySs9cIۇФ,}N"L-.9_BoI$AzTԕ5 #%Cާ0#ւФ,Ni2./q_&~-JfL3F{W˯עEФ+7giZ:aZnp>I8wp9<fb,3-T6zTmФ̃kqj*QФ+tnnl߄lnnqwkool~qmomxwmnn܄jmlnw݆ФФФФФФФϤߤ/ ***U|yxyw uuvvttssvob-fїΎ CԨĿގէ̔էɎԧۂקр sק½pר~oبӀ½nةԀ{lةsk٪sk٫»zk٬ý|hڬkڭրiڮ »hۮ ľhۮĽeܮdܮdܯ c a߯º_߯ºyf\XZ^am_ļsaVQMIFA;5-,2Pxn ƽohdecb`_][XRI<7J~ݤۄsjijkjedcbcb_S@Gt݁܄܁ûtrspommlkjheYAHޞ݀܁ ȿ|{|{{xywuqnhVބ-ĺ{wqy}ހû {ú WŌĄ ӿ Ѷـہځـ؀ Ɲ俷ɄѨ0ѸԆۯضׁܹ 䶤 ڶ߹躤ڶ ޹۵ ޹¤۵޸¤ݶ޸äݶ ฾Ǥ޶߷Ȥ޶ò¿Ǥ ޷O{Ǥ޷,XȤ ߷ %+*)*++*)((''&'&'%&%&'%\Ȥz890-.,-,+,,+*+*+)**+06ɤ!W:/%#$"$#$##$#$$# %0/ɤԽ&C :/')-+%%&&%%&'%&'&&''&'23ɤق A#>21]mW7--.-,-,- .66ɤ逎"C%C9IqG745434334 6<9ʤ; ?DTC)I@iuS@;;<=< =C>ʤ#vOYTQPONMLKKIHGGM]C-PIv{[HEDE FLDͤ \XXRNLKIIHGGIN^ B0VP{`OL MRH̤#R]\UWa`RPPONMKJLScB5^XiYUTUTU VZOΤ$Sa`\gWUUTRQQRXhC:e_n`^]\] ^dUͤSecis^ZZYXV \lB:Z@ceMM[cfgf gghJͤ#Sji|·xd``_^]\^crC+;(U1$Dk>"*AcwO(!&(P';pD     #Τ>W1$Ck=#,KirJ#J ';pD   #Τg7 G & _gB    #ΤV,=g6  F (,    !Ϥ!W+  #%(.",7#,8".:".<".&.&.&.&.&.&.&.&.&.&.&.&.&.&.&.&.&.&.&.&.&.&.&.&.&.&.&.&.&.&.&.&.&.&.&.&.&.&.&.&.&.&.&.&.&.&.&.&.&.&.&.&.&.&.&.&.&.&.&.&.&.&.&.&.&.&.&.&.&.&.&.&.&.&.:k<&,8h:%*1e5##1vU10CPgvsbM?*  #5KZdmnqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqnkbWF1#0 ; (c) 2007 Ryan Mulder ; License: wxWindows license ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #define UNICODE 1 #define MyAppVer "3.1.59" #define MyAppName "wxFormBuilder" #define MyAppPublisher "Jos Antonio Hurtado" #define MyAppURL "http://wxformbuilder.org" #define MyAppExeName "wxFormBuilder.exe" #define wxFormBuilderMinVer "3.0.57" [Setup] AppName={#MyAppName} AppVerName={#MyAppName} {#MyAppVer} AppPublisher={#MyAppPublisher} AppPublisherURL={#MyAppURL} AppSupportURL={#MyAppURL} AppUpdatesURL={#MyAppURL} DefaultDirName={pf}\{#MyAppName} DisableDirPage=false DefaultGroupName={#MyAppName} DisableProgramGroupPage=false #if UNICODE OutputBaseFilename={#MyAppName}_v{#MyAppVer}-beta #else OutputBaseFilename={#MyAppName}_v{#MyAppVer}-9xME #endif Compression=lzma/ultra SolidCompression=true InternalCompressLevel=ultra OutputDir=. ShowLanguageDialog=yes AppVersion={#MyAppVer} AppendDefaultGroupName=false AllowNoIcons=true WizardImageFile=compiler:WizModernImage-IS.bmp WizardSmallImageFile=compiler:WizModernSmallImage-IS.bmp SetupIconFile=support\wxFormBuilder.ico UninstallDisplayIcon={app}\wxFormBuilder.exe ChangesAssociations=true VersionInfoVersion={#MyAppVer} VersionInfoDescription={#MyAppName} InfoAfterFile=files\Changelog.txt LicenseFile=files\license.txt #if UNICODE MinVersion=0,4.0.1381sp6 #endif [Messages] BeveledLabel={#MyAppName} v{#MyAppVer}-Beta [Tasks] Name: desktopicon; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: unchecked [Files] #if UNICODE Source: files\*; DestDir: {app}; Flags: ignoreversion recursesubdirs createallsubdirs #else Source: files9x\*; DestDir: {app}; Flags: ignoreversion recursesubdirs createallsubdirs #endif Source: source\*; DestDir: {app}\source; Flags: ignoreversion recursesubdirs createallsubdirs; Components: main\srccode [InstallDelete] ; Cleanup debug dlls. Name: {app}\plugins\additional\libadditionald.dll; Type: files Name: {app}\plugins\common\libcommond.dll; Type: files Name: {app}\plugins\layout\liblayoutd.dll; Type: files [Icons] Name: {group}\{#MyAppName}; Filename: {app}\{#MyAppExeName} ;Name: {group}\{#MyAppName} Help; Filename: {app}\{#MyAppName}.hlp Name: {group}\{cm:UninstallProgram,{#MyAppName}}; Filename: {uninstallexe} Name: {userdesktop}\{#MyAppName}; Filename: {app}\{#MyAppExeName}; Tasks: desktopicon [Run] Filename: {app}\{#MyAppExeName}; Description: {cm:LaunchProgram,{#MyAppName}}; Flags: nowait postinstall skipifsilent [Components] Name: main; Description: wxFormBuilder (required); Flags: fixed dontinheritcheck checkablealone; Types: custom compact full Name: main\srccode; Description: SourceCode; Types: custom; Flags: dontinheritcheck checkablealone disablenouninstallwarning [Registry] Root: HKLM; Subkey: SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\{#MyAppExeName}; ValueType: string; ValueData: {app}\{#MyAppExeName}; Flags: uninsdeletekey Root: HKCR; SubKey: .fbp; ValueType: string; ValueData: {#MyAppName}.Project; Flags: uninsdeletekey Root: HKCR; SubKey: {#MyAppName}.Project\DefaultIcon; ValueType: string; ValueName: ; ValueData: {app}\{#MyAppExeName}; Flags: uninsdeletekey Root: HKCR; SubKey: {#MyAppName}.Project; ValueType: string; ValueData: {#MyAppName} Project File; Flags: uninsdeletekey Root: HKCR; SubKey: {#MyAppName}.Project\Shell\Open\Command; ValueType: string; ValueData: """{app}\{#MyAppExeName}"" ""%1"""; Flags: uninsdeletevalue Root: HKCU; SubKey: Software\wxformbuilder\mainframe\editor; ValueType: none; ValueName: notebook_style; Flags: deletevalue; Check: ShouldResetLayout Root: HKCU; SubKey: Software\wxformbuilder\mainframe\editor\cpp; ValueType: none; ValueName: notebook_style; Flags: deletevalue; Check: ShouldResetLayout Root: HKCU; SubKey: Software\wxformbuilder\mainframe\objectInspector; ValueType: none; ValueName: notebook_style; Flags: deletevalue; Check: ShouldResetLayout Root: HKCU; SubKey: Software\wxformbuilder\palette; ValueType: none; ValueName: notebook_style; Flags: deletevalue; Check: ShouldResetLayout [_ISToolPreCompile] Name: create_install_files_pkg.bat; Parameters: ; Flags: runminimized Name: create_source_package.bat; Parameters: ; Flags: runminimized [Code] // -- Version checking functions function GetPathInstalled( AppID: String ): String; var sPrevPath: String; begin // Debug Stuff //MsgBox( AppID + ' was passed into GetPathInstalled', mbInformation, MB_OK); sPrevPath := ''; if not RegQueryStringValue( HKLM, 'Software\Microsoft\Windows\CurrentVersion\Uninstall\'+AppID+'_is1', 'Inno Setup: App Path', sPrevpath) then RegQueryStringValue( HKCU, 'Software\Microsoft\Windows\CurrentVersion\Uninstall\'+AppID+'_is1' , 'Inno Setup: App Path', sPrevpath); // Debug Stuff //MsgBox( 'Installed Path: ' + sPrevPath, mbInformation, MB_OK); Result := sPrevPath; end; function GetInstalledVersion( AppID: String ): String; var sPrevPath: String; begin sPrevPath := ''; if not RegQueryStringValue( HKLM, 'Software\Microsoft\Windows\CurrentVersion\Uninstall\'+AppID+'_is1', 'DisplayVersion', sPrevpath) then RegQueryStringValue( HKCU, 'Software\Microsoft\Windows\CurrentVersion\Uninstall\'+AppID+'_is1' , 'DisplayVersion', sPrevpath); Result := sPrevPath; end; function GetPathUninstallString( AppID: String ): String; var sPrevPath: String; begin sPrevPath := ''; if not RegQueryStringValue( HKLM, 'Software\Microsoft\Windows\CurrentVersion\Uninstall\'+AppID+'_is1', 'UninstallString', sPrevpath) then RegQueryStringValue( HKCU, 'Software\Microsoft\Windows\CurrentVersion\Uninstall\'+AppID+'_is1' , 'UninstallString', sPrevpath); Result := sPrevPath; end; function InitializeSetup(): boolean; var ResultCode: Integer; wxFormBuilderVersion: String; sUninstallEXE: String; begin wxFormBuilderVersion:= GetInstalledVersion('{#MyAppName}'); sUninstallEXE:= RemoveQuotes(GetPathUninstallString('{#MyAppName}')); // Debug Stuff //MsgBox('wxAdditions Version ' + wxAdditionsVersion + ' was found' #13 'The length is ' + IntToStr(Length(wxAdditionsVersion)), mbInformation, MB_OK); //MsgBox('Version ' + wxVersion + ' was found' #13 'The length is ' + IntToStr(Length(wxVersion)), mbInformation, MB_OK); //MsgBox('Uninstall is located at : ' + sUninstallEXE, mbInformation, MB_OK); // Check to make sure there is an exceptable version of wxAdditions installed. if Length(wxFormBuilderVersion) = 0 then begin result:= true; end else begin //MsgBox('wxFormBuilder minimum version: ' + '{#wxFormBuilderMinVer}' #13 'wxFormBuilder current version: ' + wxFormBuilderVersion, mbInformation, MB_OK); if CompareText( wxFormBuilderVersion, '{#wxFormBuilderMinVer}' ) <= 0 then begin if FileExists(sUninstallEXE) then begin if WizardSilent() then begin // Just uninstall without asking because we are in silent mode. Exec(sUninstallEXE, '/SILENT', GetPathInstalled('{#MyAppName}'), SW_SHOWNORMAL, ewWaitUntilTerminated, ResultCode); // Make sure that Setup is visible and the foreground window BringToFrontAndRestore; result := true; end else begin // Ask if they really want to uninstall because we are in the default installer. if MsgBox('Version ' + wxFormBuilderVersion + ' of {#MyAppName} was detected.' #13 'It is recommended that you uninstall the old version first before continuing.' + #13 + #13 + 'Would you like to uninstall it now?', mbInformation, MB_YESNO) = IDYES then begin Exec(sUninstallEXE, '/SILENT', GetPathInstalled('{#MyAppName}'), SW_SHOWNORMAL, ewWaitUntilTerminated, ResultCode); // Make sure that Setup is visible and the foreground window BringToFrontAndRestore; result := true; end else begin result := true; end; end; end; end else begin result := true; end; end; end; function ShouldResetLayout(): boolean; var wxFormBuilderVersion: String; begin wxFormBuilderVersion:= GetInstalledVersion('{#MyAppName}'); if CompareText( wxFormBuilderVersion, '3.0.44' ) <= 0 then begin result := true; end else begin result := false; end; end; // -- END -- Version checking wxformbuilder-3.1.59/install/windows/create_install_files_pkg.bat0000644000175000017500000000415211143440026025615 0ustar rrmulderrrmulder@echo off ::************************************************************************** :: File: create_install_files_pkg.bat :: Version: 1.00 :: Name: RJP Computing :: Date: 03/01/2007 :: Description: Creates the install files package. This doesn't get the :: files from Subversion it just uses the export function. :: Copyright (C) 2007 RJP Computing :: :: This program is free software; you can redistribute it and/or :: modify it under the terms of the GNU General Public License :: as published by the Free Software Foundation; either version 2 :: of the License, or (at your option) any later version. :: :: This program is distributed in the hope that it will be useful, :: but WITHOUT ANY WARRANTY; without even the implied warranty of :: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the :: GNU General Public License for more details. :: :: You should have received a copy of the GNU General Public License :: along with this program; if not, write to the Free Software :: Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. :: :: Notes: 1.00 - Initial release. :: 1.01 - Changed where to copy files from to match new :: layout. ::************************************************************************** set APP_VERSION=1.01 set APP_TITLE=Create Install Files Package echo ---------------------------------------- echo %APP_TITLE% v%APP_VERSION% echo By echo RJP Computing echo. echo Creates the install files package. echo. echo Copyright (c) 2007 echo ---------------------------------------- echo. :: Cleanup old source. if exist files rmdir /S /Q files :: Check to see if 'source' directory exists. if exist files goto BEGIN_COPY mkdir files :BEGIN_COPY echo Coping 'output' directory to 'files' xcopy ..\..\output files /E /I /H /Y /EXCLUDE:excludes goto END :END echo. echo Finished creating install files package... :: Cleanup environment. set APP_VERSION= set APP_TITLE= wxformbuilder-3.1.59/install/windows/excludes0000644000175000017500000000055511143440026021653 0ustar rrmulderrrmulder\.obj\ \.svn\ \Release\ \Debug\ wxFormBuilderd.exe wxmsw28ud_gcc.dll wxmsw28umd_flatnotebook_gcc.dll wxmsw28umd_propgrid_gcc.dll wxmsw28umd_scintilla_gcc.dll wxmsw28umd_flatnotebook_gcc_wxfb.dll wxmsw28umd_propgrid_gcc_wxfb.dll wxmsw28umd_scintilla_gcc_wxfb.dll libadditionald.dll libcommond.dll libcontainersd.dll liblayoutd.dll libwxadditions-minid.dll Thumbs.db wxformbuilder-3.1.59/install/windows/create_source_package.bat0000644000175000017500000000556511143440026025110 0ustar rrmulderrrmulder@echo off ::************************************************************************** :: File: create_source_package.bat :: Version: 1.03 :: Name: RJP Computing :: Date: 03/15/2007 :: Description: Creates a source directory so that the installer can :: include only the needed files. :: Copyright (C) 2007 RJP Computing :: :: This program is free software; you can redistribute it and/or :: modify it under the terms of the GNU General Public License :: as published by the Free Software Foundation; either version 2 :: of the License, or (at your option) any later version. :: :: This program is distributed in the hope that it will be useful, :: but WITHOUT ANY WARRANTY; without even the implied warranty of :: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the :: GNU General Public License for more details. :: :: You should have received a copy of the GNU General Public License :: along with this program; if not, write to the Free Software :: Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ::************************************************************************** set APP_VERSION=1.05 set APP_TITLE=Create Source Package echo ---------------------------------------- echo %APP_TITLE% v%APP_VERSION% echo By echo RJP Computing echo. echo Creates a source directory so that the echo installer can include only the needed echo files. echo. echo Copyright (c) 2007 echo ---------------------------------------- echo. :: Cleanup old source. if exist source rmdir /S /Q source :: Check to see if 'source' directory exists. if exist source goto BEGIN_SVN_EXPORT mkdir source goto BEGIN_SVN_EXPORT :BEGIN_SVN_EXPORT :: Add Subversion install directory to the path. set SVN_ROOT=C:\Program Files\Subversion set SVN_EXPORT="%SVN_ROOT%\bin\svn.exe" export --force set SVN_REPOS=https://wxformbuilder.svn.sourceforge.net/svnroot/wxformbuilder/3.x/trunk echo Using Subversion with command : echo %SVN_EXPORT% echo. echo Exporting wxFormBuilder v3.x source from : echo %SVN_REPOS% echo. echo [svn] Exporting workspace and premake scripts. %SVN_EXPORT% --non-recursive %SVN_REPOS% source\ echo [svn] Exporting 'output' directory to 'source\output' %SVN_EXPORT% %SVN_REPOS%/output source\output echo [svn] Exporting 'plugins' directory to 'source\plugins' %SVN_EXPORT% %SVN_REPOS%/plugins source\plugins ::echo [svn] Exporting 'premake' directory to 'source\premake' ::%SVN_EXPORT% %SVN_REPOS%/premake source\premake echo [svn] Exporting 'sdk' directory to 'source\sdk' %SVN_EXPORT% %SVN_REPOS%/sdk source\sdk echo [svn] Exporting 'src' directory to 'source\src' %SVN_EXPORT% %SVN_REPOS%/src source\src goto END :END echo. echo Finished creating source package... :: Cleanup environment. set APP_VERSION= set APP_TITLE= set SVN_ROOT= set SVN_EXPORT= set SVN_REPOS= wxformbuilder-3.1.59/plugins/additional/premake.lua0000644000175000017500000002317111143440026022673 0ustar rrmulderrrmulder--***************************************************************************** --* Author: RJP Computing --* Date: 12/15/2006 --* Version: 1.00 --* Copyright (C) 2006 RJP Computing --* --* This program is free software; you can redistribute it and/or --* modify it under the terms of the GNU General Public License --* as published by the Free Software Foundation; either version 2 --* of the License, or (at your option) any later version. --* --* This program is distributed in the hope that it will be useful, --* but WITHOUT ANY WARRANTY; without even the implied warranty of --* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --* GNU General Public License for more details. --* --* You should have received a copy of the GNU General Public License --* along with this program; if not, write to the Free Software --* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --* --* NOTES: --* - use the '/' slash for all paths. --***************************************************************************** -- wxWidgets version local wx_ver = "28" --******* Initial Setup ************ --* Most of the setting are set here. --********************************** -- Set the name of your package. package.name = "additional-components-plugin" -- Set this if you want a different name for your target than the package's name. local targetName = "additional" -- Set the kind of package you want to create. -- Options: exe | winexe | lib | dll package.kind = "dll" -- Set the files to include. package.files = { matchrecursive( "*.cpp", "*.h", "*.rc" ) } -- Set the include paths. package.includepaths = { "../../sdk/tinyxml", "../../sdk/plugin_interface" } -- Set the libraries it links to. package.links = { "plugin-interface", "TiCPP" } -- Setup the output directory options. -- Note: Use 'libdir' for "lib" kind only. if ( windows ) then package.bindir = "../../output/plugins/additional" else package.bindir = "../../output/lib/wxformbuilder" end --package.libdir = "../../lib" -- Set the defines. package.defines = { "BUILD_DLL", "TIXML_USE_TICPP" } -- Hack the dll output to prefix 'lib' to the begining. package.targetprefix = "lib" --------------------------- DO NOT EDIT BELOW ---------------------------------- --******* GENAERAL SETUP ********** --* Settings that are not dependant --* on the operating system. --********************************* -- Package options addoption( "unicode", "Use the Unicode character set" ) addoption( "with-wx-shared", "Link against wxWidgets as a shared library" ) if ( not windows ) then addoption( "disable-wx-debug", "Compile against a wxWidgets library without debugging" ) end -- Common setup package.language = "c++" -- Set object output directory. if ( options["unicode"] ) then package.config["Debug"].objdir = ".objsud" package.config["Release"].objdir = ".objsu" else package.config["Debug"].objdir = ".objsd" package.config["Release"].objdir = ".objs" end -- Set debug flags if ( options["disable-wx-debug"] and ( not windows ) ) then debug_option = "--debug=no" debug_macro = { "NDEBUG", "__WXFB_DEBUG__" } else debug_option = "--debug=yes" debug_macro = { "DEBUG", "_DEBUG", "__WXDEBUG__", "__WXFB_DEBUG__" } end -- Set the default targetName if none is specified. if ( string.len( targetName ) == 0 ) then targetName = package.name end -- Set the targets. package.config["Release"].target = targetName package.config["Debug"].target = targetName.."d" -- Set the build options. package.buildflags = { "extra-warnings" } package.config["Release"].buildflags = { "no-symbols", "optimize-speed" } if ( options["unicode"] ) then table.insert( package.buildflags, "unicode" ) end if ( string.find( target or "", ".*-gcc" ) or target == "gnu" ) then table.insert( package.buildflags, "no-import-lib" ) table.insert( package.config["Debug"].buildoptions, "-O0" ) table.insert( package.config["Release"].buildoptions, "-fno-strict-aliasing" ) end -- Set the defines. if ( options["with-wx-shared"] ) then table.insert( package.defines, "WXUSINGDLL" ) end if ( options["unicode"] ) then table.insert( package.defines, { "UNICODE", "_UNICODE" } ) end table.insert( package.defines, "__WX__" ) table.insert( package.config["Debug"].defines, debug_macro ) table.insert( package.config["Release"].defines, "NDEBUG" ) if ( windows ) then --******* WINDOWS SETUP *********** --* Settings that are Windows specific. --********************************* -- Set wxWidgets include paths if ( target == "cb-gcc" ) then table.insert( package.includepaths, "$(#WX.include)" ) else table.insert( package.includepaths, "$(WXWIN)/include" ) end -- Set the correct 'setup.h' include path. if ( options["with-wx-shared"] ) then if ( options["unicode"] ) then if ( target == "cb-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(#WX.lib)/gcc_dll/mswud" ) table.insert( package.config["Release"].includepaths, "$(#WX.lib)/gcc_dll/mswu" ) elseif ( target == "gnu" or target == "cl-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/gcc_dll/mswud" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/gcc_dll/mswu" ) else table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/vc_dll/mswud" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/vc_dll/mswu" ) end else if ( target == "cb-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(#WX.lib)/gcc_dll/mswd" ) table.insert( package.config["Release"].includepaths, "$(#WX.lib)/gcc_dll/msw" ) elseif ( target == "gnu" or target == "cl-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/gcc_dll/mswd" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/gcc_dll/msw" ) else table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/vc_dll/mswd" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/vc_dll/msw" ) end end else if ( options["unicode"] ) then if ( target == "cb-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(#WX.lib)/gcc_lib/mswud" ) table.insert( package.config["Release"].includepaths, "$(#WX.lib)/gcc_lib/mswu" ) elseif ( target == "gnu" or target == "cl-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/gcc_lib/mswud" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/gcc_lib/mswu" ) else table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/vc_lib/mswud" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/vc_lib/mswu" ) end else if ( target == "cb-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(#WX.lib)/gcc_lib/mswd" ) table.insert( package.config["Release"].includepaths, "$(#WX.lib)/gcc_lib/msw" ) elseif ( target == "gnu" or target == "cl-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/gcc_lib/mswd" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/gcc_lib/msw" ) else table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/vc_lib/mswd" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/vc_lib/msw" ) end end end -- Set the linker options. if ( options["with-wx-shared"] ) then if ( target == "cb-gcc" ) then table.insert( package.libpaths, "$(#WX.lib)/gcc_dll" ) elseif ( target == "gnu" or target == "cl-gcc" ) then table.insert( package.libpaths, "$(WXWIN)/lib/gcc_dll" ) else table.insert( package.libpaths, "$(WXWIN)/lib/vc_dll" ) end else if ( target == "cb-gcc" ) then table.insert( package.libpaths, "$(#WX.lib)/gcc_lib" ) elseif ( target == "gnu" or target == "cl-gcc" ) then table.insert( package.libpaths, "$(WXWIN)/lib/gcc_lib" ) else table.insert( package.libpaths, "$(WXWIN)/lib/vc_lib" ) end end -- Set wxWidgets libraries to link. if ( options["unicode"] ) then table.insert( package.config["Release"].links, "wxmsw"..wx_ver.."u" ) table.insert( package.config["Debug"].links, "wxmsw"..wx_ver.."ud" ) else table.insert( package.config["Release"].links, "wxmsw"..wx_ver ) table.insert( package.config["Debug"].links, "wxmsw"..wx_ver.."d" ) end -- Set the Windows defines. table.insert( package.defines, { "__WXMSW__", "WIN32", "_WINDOWS" } ) else --******* LINUX/MAC SETUP ************* --* Settings that are Linux/Mac specific. --************************************* -- Ignore resource files in Linux/Mac. table.insert( package.excludes, matchrecursive( "*.rc" ) ) table.insert( package.buildoptions, "-fPIC" ) -- Add buildflag for proper dll building. if ( macosx ) then table.insert( package.buildflags, "dylib" ) end -- Set wxWidgets build options. table.insert( package.config["Debug"].buildoptions, "`wx-config "..debug_option.." --cflags`" ) table.insert( package.config["Release"].buildoptions, "`wx-config --debug=no --cflags`" ) -- Set the wxWidgets link options. -- richtext is annoying, because it must be explicitly specified if wx is not monolithic, but cannot be specified if it is -- so, determine if wx is monolithic by counting the occurences of "-l" in the --libs output local wxconfig = io.popen("wx-config " .. debug_option .. " --libs") local wxlibs = wxconfig:read("*a") wxconfig:close() local wxLibCount = 0 for w in string.gfind(wxlibs, "-l") do wxLibCount = wxLibCount + 1 end local richtext = "" if ( wxLibCount > 1 ) then richtext = " std richtext" end table.insert( package.config["Debug"].linkoptions, "`wx-config "..debug_option.." --libs" .. richtext .. "`" ) table.insert( package.config["Release"].linkoptions, "`wx-config --libs" .. richtext .. "`" ) end wxformbuilder-3.1.59/plugins/additional/logo.xpm0000644000175000017500000016102711143440026022235 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// /* XPM */ static const char * logo_xpm[] = { "100 100 2128 2", " c None", ". c #0066CD", "+ c #0066CB", "@ c #0065CC", "# c #0067CC", "$ c #0066CC", "% c #0B6DCF", "& c #2E86D9", "* c #378CDB", "= c #368BDB", "- c #358BDB", "; c #348ADB", "> c #338ADA", ", c #3289DA", "' c #3188DA", ") c #3088DA", "! c #2F87D9", "~ c #2E87D9", "{ c #2D86D9", "] c #2D86D8", "^ c #2C85D8", "/ c #2B85D8", "( c #2A84D8", "_ c #2983D8", ": c #2983D7", "< c #2883D7", "[ c #1D7BD4", "} c #0469CD", "| c #60A8E5", "1 c #B4E1FD", "2 c #B8E2FE", "3 c #B6E1FD", "4 c #B4E0FD", "5 c #B3E0FC", "6 c #B1DFFC", "7 c #AFDEFB", "8 c #AEDDFB", "9 c #ADDCFA", "0 c #ABDBFA", "a c #AADAFA", "b c #A8D9F9", "c c #A6D8F9", "d c #A5D7F8", "e c #A4D6F8", "f c #A2D6F7", "g c #A1D5F7", "h c #9FD4F6", "i c #9DD3F6", "j c #9CD2F5", "k c #9AD1F5", "l c #9AD0F4", "m c #98CEF4", "n c #96CDF4", "o c #94CCF4", "p c #93CCF4", "q c #91CBF3", "r c #90CAF3", "s c #8FC9F2", "t c #8DC8F2", "u c #8CC7F1", "v c #8AC6F1", "w c #87C5F0", "x c #7BBCED", "y c #2F87D8", "z c #519CE1", "A c #BBE4FE", "B c #BAE3FE", "C c #B8E2FD", "D c #B5E1FC", "E c #B4E0FC", "F c #B2DFFB", "G c #B1DEFB", "H c #AFDDFA", "I c #ACDBFA", "J c #ABDAF9", "K c #A9D9F9", "L c #A8D9F8", "M c #A6D8F8", "N c #A5D7F7", "O c #A4D6F7", "P c #A2D5F7", "Q c #A0D4F7", "R c #9FD3F6", "S c #9DD2F6", "T c #9CD1F5", "U c #9BD0F5", "V c #99CFF4", "W c #97CEF4", "X c #95CCF3", "Y c #93CBF3", "Z c #92CAF2", "` c #90CAF2", " . c #8FC9F1", ".. c #8EC8F1", "+. c #8CC7F0", "@. c #8AC6F0", "#. c #89C5F0", "$. c #85C3EF", "%. c #1C7AD3", "&. c #9ACEF4", "*. c #BCE4FE", "=. c #BAE3FD", "-. c #B8E1FC", ";. c #B6E1FC", ">. c #B4E0FB", ",. c #B3DFFB", "'. c #B2DEFA", "). c #B0DDFA", "!. c #AFDCFA", "~. c #ADDBF9", "{. c #ACDBF9", "]. c #A7D8F8", "^. c #A6D7F8", "/. c #A5D6F7", "(. c #A3D5F7", "_. c #A2D5F6", ":. c #A0D4F6", "<. c #9FD2F5", "[. c #9ED1F5", "}. c #9CD0F4", "|. c #9ACFF4", "1. c #98CEF3", "2. c #96CDF3", "3. c #94CBF3", "4. c #91C9F2", "5. c #8DC7F0", "6. c #8BC6F0", "7. c #89C5EF", "8. c #54A1E2", "9. c #B7E1FC", "0. c #BCE4FD", "a. c #BBE3FD", "b. c #BAE2FC", "c. c #B8E2FC", "d. c #B7E1FB", "e. c #B6E0FB", "f. c #B4DFFA", "g. c #B2DDFA", "h. c #AEDCFA", "i. c #ACDAF9", "j. c #AAD9F8", "k. c #A9D8F8", "l. c #A8D8F7", "m. c #A6D6F7", "n. c #A5D6F6", "o. c #A3D4F6", "p. c #A2D3F5", "q. c #A1D3F5", "r. c #9DD0F5", "s. c #9BCFF4", "t. c #99CEF3", "u. c #97CDF3", "v. c #95CCF2", "w. c #95CBF2", "x. c #93CAF1", "y. c #91CAF1", "z. c #90C9F0", "A. c #8FC8F0", "B. c #8CC6F0", "C. c #69AFE7", "D. c #BAE2FB", "E. c #BDE4FD", "F. c #BCE3FC", "G. c #BBE3FC", "H. c #B9E2FB", "I. c #B8E1FB", "J. c #C1E4FB", "K. c #C4E5FB", "L. c #B7E0FA", "M. c #B3DEFA", "N. c #B1DDFA", "O. c #B0DCF9", "P. c #AFDBF9", "Q. c #ADDBF8", "R. c #ACDAF8", "S. c #ABD8F7", "T. c #A9D7F7", "U. c #A8D7F7", "V. c #A7D6F7", "W. c #A5D5F6", "X. c #A4D4F6", "Y. c #A3D3F5", "Z. c #A0D2F5", "`. c #9FD1F4", " + c #9DD0F4", ".+ c #9CCFF3", "++ c #9BCFF3", "@+ c #98CDF3", "#+ c #97CCF2", "$+ c #94CBF1", "%+ c #91C9F0", "&+ c #90C8F0", "*+ c #8FC7EF", "=+ c #6BB1E8", "-+ c #BBE2FB", ";+ c #BEE4FC", ">+ c #BDE3FC", ",+ c #BBE3FB", "'+ c #DDF0FD", ")+ c #D3ECFB", "!+ c #C7E6FB", "~+ c #B7DFFA", "{+ c #B3DDF9", "]+ c #B1DDF9", "^+ c #B0DCF8", "/+ c #AFDBF8", "(+ c #ADD9F8", "_+ c #ACD9F8", ":+ c #AAD7F7", "<+ c #A8D6F6", "[+ c #A7D6F6", "}+ c #A6D5F5", "|+ c #A4D4F5", "1+ c #A2D2F4", "2+ c #A0D2F4", "3+ c #9ED0F4", "4+ c #9ACEF2", "5+ c #99CDF2", "6+ c #98CCF1", "7+ c #96CCF1", "8+ c #95CBF1", "9+ c #94CAF1", "0+ c #92C9F0", "a+ c #91C8F0", "b+ c #6EB2E8", "c+ c #BCE2FB", "d+ c #BFE4FC", "e+ c #C5E6FB", "f+ c #E9F5FD", "g+ c #DEF1FC", "h+ c #D4ECFB", "i+ c #C8E6FB", "j+ c #BBE0F9", "k+ c #B4DEF9", "l+ c #B2DBF9", "m+ c #B0DBF8", "n+ c #AFDAF8", "o+ c #AED9F7", "p+ c #ADD9F7", "q+ c #ABD8F6", "r+ c #AAD7F6", "s+ c #A9D6F6", "t+ c #A7D5F6", "u+ c #A5D4F5", "v+ c #A4D3F5", "w+ c #A3D3F4", "x+ c #A1D2F4", "y+ c #A0D1F3", "z+ c #9FD0F3", "A+ c #9ED0F3", "B+ c #9BCEF2", "C+ c #9ACDF2", "D+ c #98CDF1", "E+ c #96CBF0", "F+ c #95CAF0", "G+ c #94CAF0", "H+ c #6FB2E8", "I+ c #BDE2FB", "J+ c #C0E5FC", "K+ c #BEE3FB", "L+ c #D6EDFC", "M+ c #EAF6FD", "N+ c #DFF1FC", "O+ c #C9E6FA", "P+ c #BEE2F9", "Q+ c #B5DEF9", "R+ c #B5DDF9", "S+ c #B3DCF8", "T+ c #B2DBF8", "U+ c #B1DBF7", "V+ c #B0DAF7", "W+ c #ADD8F7", "X+ c #ACD8F6", "Y+ c #ABD7F6", "Z+ c #AAD6F5", "`+ c #A8D6F5", " @ c #A7D5F5", ".@ c #A6D4F4", "+@ c #A5D3F4", "@@ c #A3D2F4", "#@ c #A1D1F3", "$@ c #9FD0F2", "%@ c #9ECFF2", "&@ c #9CCEF2", "*@ c #9ACDF1", "=@ c #99CCF1", "-@ c #70B3E8", ";@ c #C2E5FC", ">@ c #C0E4FB", ",@ c #BFE4FB", "'@ c #D7EDFB", ")@ c #E0F1FC", "!@ c #D5ECFB", "~@ c #CAE7FB", "{@ c #BFE2F9", "]@ c #B7DEF9", "^@ c #B6DDF8", "/@ c #B5DDF8", "(@ c #B4DCF8", "_@ c #B3DBF8", ":@ c #B1DAF7", "<@ c #AFD9F6", "[@ c #AED9F6", "}@ c #ADD8F6", "|@ c #ACD7F6", "1@ c #AAD6F6", "2@ c #A8D5F5", "3@ c #A7D4F4", "4@ c #A5D3F3", "5@ c #A3D2F3", "6@ c #A0D0F2", "7@ c #9ECFF1", "8@ c #9CCEF1", "9@ c #9CCDF1", "0@ c #73B4E8", "a@ c #BFE3FB", "b@ c #C3E5FB", "c@ c #C2E5FB", "d@ c #D8EDFC", "e@ c #E1F1FC", "f@ c #D6ECFB", "g@ c #CBE7FA", "h@ c #C1E2F9", "i@ c #B9DFF9", "j@ c #B8DEF9", "k@ c #B7DDF8", "l@ c #B4DCF7", "m@ c #B4DBF7", "n@ c #B2DBF7", "o@ c #B0D9F6", "p@ c #AED8F6", "q@ c #ADD7F5", "r@ c #ACD7F5", "s@ c #AAD5F5", "t@ c #A8D5F4", "u@ c #A6D3F3", "v@ c #A4D2F3", "w@ c #A3D1F3", "x@ c #A2D1F2", "y@ c #A0CFF2", "z@ c #9DCEF1", "A@ c #74B5E8", "B@ c #C1E3FB", "C@ c #C2E4FB", "D@ c #D9EDFC", "E@ c #EBF6FD", "F@ c #D7ECFB", "G@ c #CCE8FA", "H@ c #C2E3F9", "I@ c #BBDFF9", "J@ c #BADFF8", "K@ c #B9DEF8", "L@ c #B5DCF7", "M@ c #B4DBF6", "N@ c #B2DAF6", "O@ c #B1DAF6", "P@ c #AFD8F6", "Q@ c #AED8F5", "R@ c #ACD6F4", "S@ c #ABD6F4", "T@ c #AAD5F4", "U@ c #A9D5F4", "V@ c #A7D4F3", "W@ c #A7D3F3", "X@ c #A6D3F2", "Y@ c #A4D2F2", "Z@ c #A4D1F2", "`@ c #A1D0F2", " # c #A0CFF1", ".# c #9FCFF1", "+# c #75B6E9", "@# c #C2E3FB", "## c #C6E6FB", "$# c #C5E5FB", "%# c #C4E4FB", "&# c #D9EEFB", "*# c #ECF6FD", "=# c #E2F2FC", "-# c #D8EDFB", ";# c #CEE8FA", "># c #C3E4F9", ",# c #BDE0F8", "'# c #BCE0F8", ")# c #BADEF8", "!# c #B9DEF7", "~# c #B7DDF7", "{# c #B7DCF7", "]# c #B6DCF7", "^# c #B3DAF6", "/# c #B1D9F5", "(# c #AFD8F5", "_# c #AED7F4", ":# c #ABD5F4", "<# c #A9D5F3", "[# c #A8D4F3", "}# c #A8D3F2", "|# c #A5D2F2", "1# c #A3D1F2", "2# c #A2D0F1", "3# c #79B7E9", "4# c #C4E4FA", "5# c #C5E5FA", "6# c #DBEEFB", "7# c #E3F2FC", "8# c #DAEEFB", "9# c #CFE9FA", "0# c #C6E4F9", "a# c #BFE1F9", "b# c #BCDFF8", "c# c #BBDFF8", "d# c #B9DDF7", "e# c #B8DDF7", "f# c #B7DCF6", "g# c #B6DCF6", "h# c #B5DBF6", "i# c #B3DAF5", "j# c #B2D9F5", "k# c #B0D8F5", "l# c #AFD8F4", "m# c #ADD6F3", "n# c #ACD6F3", "o# c #ACD5F3", "p# c #AAD5F3", "q# c #A9D4F3", "r# c #A9D4F2", "s# c #A7D3F2", "t# c #A6D2F2", "u# c #7AB8E9", "v# c #C6E5FB", "w# c #C9E7FB", "x# c #DCEFFB", "y# c #D1E9FA", "z# c #C8E4F9", "A# c #C1E2F8", "B# c #BFE1F8", "C# c #BEE0F8", "D# c #BDE0F7", "E# c #BCDFF7", "F# c #BBDEF7", "G# c #BADEF7", "H# c #B8DDF6", "I# c #B8DCF6", "J# c #B6DBF6", "K# c #B4DBF5", "L# c #B4DAF5", "M# c #B3D9F5", "N# c #B1D8F4", "O# c #B0D8F4", "P# c #B2CFD5", "Q# c #B3CBC5", "R# c #B2CAC5", "S# c #B2C9C5", "T# c #B0C8C4", "U# c #AFC8C4", "V# c #8AB2BD", "W# c #266FA5", "X# c #C8E6FA", "Y# c #B6DEF9", "Z# c #BFE2FA", "`# c #DEF0FC", " $ c #CDE8FA", ".$ c #B5DCF8", "+$ c #C2E2F8", "@$ c #C0E1F8", "#$ c #BEDFF7", "$$ c #BDDFF7", "%$ c #BCDEF7", "&$ c #BADDF6", "*$ c #B9DDF6", "=$ c #B7DBF5", "-$ c #B6DBF5", ";$ c #B7D3DD", ">$ c #C3AF56", ",$ c #CA9D11", "'$ c #CC9900", ")$ c #A5D6F8", "!$ c #9BD2F8", "~$ c #99D1F7", "{$ c #97D0F7", "]$ c #DDEFFC", "^$ c #98CFF5", "/$ c #8CC9F3", "($ c #C1E1F8", "_$ c #BFE0F7", ":$ c #BEE0F7", "<$ c #BCDEF6", "[$ c #BBDEF6", "}$ c #BEC9B0", "|$ c #CC9901", "1$ c #CC9902", "2$ c #96CFF7", "3$ c #96CFF6", "4$ c #BDE1F9", "5$ c #DDEFFB", "6$ c #CCE7FA", "7$ c #A9D7F6", "8$ c #8AC8F3", "9$ c #88C7F2", "0$ c #87C6F2", "a$ c #C2E2F7", "b$ c #C2E1F7", "c$ c #C1E1F7", "d$ c #C0E0F7", "e$ c #BFDFF7", "f$ c #BEDFF6", "g$ c #BED6DC", "h$ c #CA9D10", "i$ c #CF9F08", "j$ c #E6CF11", "k$ c #F4E718", "l$ c #F7EE18", "m$ c #F7ED18", "n$ c #F7EC18", "o$ c #F7EB18", "p$ c #F7EA18", "q$ c #F7E918", "r$ c #F7E818", "s$ c #F7E718", "t$ c #F7E618", "u$ c #F7E518", "v$ c #F7E418", "w$ c #F7E318", "x$ c #F7E218", "y$ c #F7E118", "z$ c #F7E018", "A$ c #F7DF18", "B$ c #F7DE18", "C$ c #F7DD18", "D$ c #F4DA17", "E$ c #EAC811", "F$ c #D1A208", "G$ c #94CEF6", "H$ c #CBE7F9", "I$ c #95CDF4", "J$ c #85C5F1", "K$ c #83C4F1", "L$ c #82C3F1", "M$ c #80C2F0", "N$ c #86C4F0", "O$ c #C3E2F7", "P$ c #C3E1F7", "Q$ c #C1E0F7", "R$ c #C0E0F6", "S$ c #C7B35C", "T$ c #CFA00C", "U$ c #F7EE1F", "V$ c #FFFD1F", "W$ c #FFFC1F", "X$ c #FFFB1F", "Y$ c #FFFA1F", "Z$ c #FFF91F", "`$ c #FFF81F", " % c #FFF71F", ".% c #FFF61F", "+% c #FFF51F", "@% c #FFF41F", "#% c #FFF31F", "$% c #FFF21F", "%% c #FFF11F", "&% c #FFF01F", "*% c #FFEF1F", "=% c #FFEE1F", "-% c #FFED1F", ";% c #FFEC1F", ">% c #FFEB1F", ",% c #FFEA1F", "'% c #FFE91F", ")% c #FFE81F", "!% c #FAE11F", "~% c #D2A50B", "{% c #92CDF6", "]% c #92CDF5", "^% c #DCEEFB", "/% c #CAE6F9", "(% c #94CCF3", "_% c #7EC1F0", ":% c #7DC0EF", "<% c #7BBFEF", "[% c #7ABEEE", "}% c #ADD7F4", "|% c #C4E2F7", "1% c #CBA01B", "2% c #E5CC1B", "3% c #FFFE25", "4% c #FFFD25", "5% c #FFFC25", "6% c #FFFB25", "7% c #FFFA25", "8% c #FFF925", "9% c #FFF825", "0% c #FFF725", "a% c #FFF625", "b% c #FFF525", "c% c #FFF425", "d% c #FFF325", "e% c #FFF225", "f% c #FFF125", "g% c #FFF025", "h% c #FFEF25", "i% c #FFEE25", "j% c #FFED25", "k% c #FFEC25", "l% c #FFEB25", "m% c #FFEA25", "n% c #FFE925", "o% c #FFE825", "p% c #FFE725", "q% c #EECE1B", "r% c #91CCF5", "s% c #79BEEE", "t% c #78BDEE", "u% c #76BCED", "v% c #74BBED", "w% c #7ABDEC", "x% c #8CC6EF", "y% c #A1CADC", "z% c #F2E423", "A% c #FFFD2D", "B% c #FFFC2D", "C% c #FFFB2D", "D% c #FFFA2D", "E% c #FFF92D", "F% c #FFF82D", "G% c #FFF72D", "H% c #FFF62D", "I% c #FFF52D", "J% c #FFF42D", "K% c #FFF32D", "L% c #FFF22D", "M% c #FFF12D", "N% c #FFF02D", "O% c #FFEF2D", "P% c #FFEE2D", "Q% c #FFED2D", "R% c #FFEC2D", "S% c #FFEB2D", "T% c #FFEA2D", "U% c #FFE92D", "V% c #FFE82D", "W% c #FFE72D", "X% c #F9DF23", "Y% c #8FCBF5", "Z% c #8FCBF4", "`% c #C9E5F9", " & c #91CAF2", ".& c #73BAEC", "+& c #71B9EC", "@& c #6FB8EB", "#& c #79B3CD", "$& c #F4EA29", "%& c #FFFC34", "&& c #FFFB34", "*& c #FFFA34", "=& c #FFF934", "-& c #FFF834", ";& c #FFF734", ">& c #FFF634", ",& c #FFF534", "'& c #FFF434", ")& c #FFF334", "!& c #FFF234", "~& c #FFF134", "{& c #FFF034", "]& c #FFEF34", "^& c #FFEE34", "/& c #FFED34", "(& c #FFEC34", "_& c #FFEB34", ":& c #FFEA34", "<& c #FFE934", "[& c #FFE834", "}& c #FFE734", "|& c #FDE429", "1& c #990000", "2& c #692040", "3& c #8DCAF4", "4& c #DAEDFB", "5& c #C8E5F9", "6& c #8FCAF2", "7& c #6EB7EB", "8& c #78B2CD", "9& c #F5EA2E", "0& c #FFFB3B", "a& c #FFFA3B", "b& c #FFFA5D", "c& c #FFFB80", "d& c #FFFA76", "e& c #FFF84E", "f& c #FFF73B", "g& c #FFF63B", "h& c #FFF53B", "i& c #FFF43B", "j& c #FFF33B", "k& c #FFF23B", "l& c #FFF13B", "m& c #FFF03B", "n& c #FFEF3B", "o& c #FFEE3B", "p& c #FFED3B", "q& c #FFEC3B", "r& c #FFEB3B", "s& c #FFEA3B", "t& c #FFE93B", "u& c #FFE83B", "v& c #FDE32E", "w& c #8CC9F4", "x& c #DAEDFA", "y& c #C7E4F9", "z& c #8EC9F2", "A& c #6CB6EA", "B& c #76B1CC", "C& c #F5EA33", "D& c #FFFC41", "E& c #FFFB41", "F& c #FFFA41", "G& c #FFF951", "H& c #FFFCBC", "I& c #FFFCA3", "J& c #FFFA87", "K& c #FFF86B", "L& c #FFF747", "M& c #FFF641", "N& c #FFF541", "O& c #FFF441", "P& c #FFF341", "Q& c #FFF241", "R& c #FFF141", "S& c #FFF041", "T& c #FFEF41", "U& c #FFEE41", "V& c #FFED41", "W& c #FFEC41", "X& c #FFEB41", "Y& c #FFEA41", "Z& c #FFE941", "`& c #FFE841", " * c #FDE333", ".* c #9A0100", "+* c #C63823", "@* c #E6613F", "#* c #F27049", "$* c #F26F48", "%* c #F26E48", "&* c #F26D47", "** c #F26C46", "=* c #F26B45", "-* c #F26A44", ";* c #F26943", ">* c #F26941", ",* c #F26841", "'* c #F26741", ")* c #F26640", "!* c #F2653F", "~* c #F2643E", "{* c #F2643D", "]* c #F2633C", "^* c #F2633B", "/* c #A66367", "(* c #8BC8F3", "_* c #D9EDFA", ":* c #C7E4F8", "<* c #A0D1F4", "[* c #8CC8F1", "}* c #6AB5EA", "|* c #75B0CC", "1* c #F5EA39", "2* c #FFFB49", "3* c #FFFA49", "4* c #FFFC93", "5* c #FFFCC1", "6* c #FFFBA7", "7* c #FFFA8C", "8* c #FFF871", "9* c #FFF755", "0* c #FFF649", "a* c #FFF549", "b* c #FFF449", "c* c #FFF349", "d* c #FFF249", "e* c #FFF149", "f* c #FFF049", "g* c #FFEF49", "h* c #FFEE49", "i* c #FFED49", "j* c #FFEC49", "k* c #FFEB49", "l* c #FFEA49", "m* c #FFE949", "n* c #FFE849", "o* c #FDE339", "p* c #E26143", "q* c #FF865D", "r* c #FF855C", "s* c #FF845B", "t* c #FF835A", "u* c #FF8259", "v* c #FF8158", "w* c #FF8057", "x* c #FF7F56", "y* c #FF7E54", "z* c #FF7D54", "A* c #FF7D53", "B* c #FF7C52", "C* c #FF7B51", "D* c #FF7A50", "E* c #FF794F", "F* c #FF784E", "G* c #FF774D", "H* c #FF764C", "I* c #AF7073", "J* c #89C7F3", "K* c #C6E3F8", "L* c #9FD1F3", "M* c #8BC7F1", "N* c #69B4EA", "O* c #73AFCB", "P* c #F5EA3F", "Q* c #FFFA50", "R* c #FFFCAD", "S* c #FFFCC3", "T* c #FFFBAA", "U* c #FFFA90", "V* c #FFF877", "W* c #FFF65D", "X* c #FFF650", "Y* c #FFF550", "Z* c #FFF450", "`* c #FFF350", " = c #FFF250", ".= c #FFF150", "+= c #FFF050", "@= c #FFEF50", "#= c #FFEE50", "$= c #FFED50", "%= c #FFEC50", "&= c #FFEB50", "*= c #FFEA50", "== c #FFE950", "-= c #FDE43F", ";= c #B8291D", ">= c #FF8A62", ",= c #FF8961", "'= c #FF8861", ")= c #FF8760", "!= c #FF875F", "~= c #FF865E", "{= c #FF855D", "]= c #FF845C", "^= c #FF835B", "/= c #FF825A", "(= c #FF8159", "_= c #FF7E55", ":= c #FF7D55", "<= c #FF7C54", "[= c #FF7B53", "}= c #AF7376", "|= c #D8ECFA", "1= c #C5E3F8", "2= c #B2DAF5", "3= c #9DD0F3", "4= c #67B3E9", "5= c #71AECB", "6= c #F6EA44", "7= c #FFFB57", "8= c #FFFA57", "9= c #FFF957", "0= c #FFFCB0", "a= c #FFFCC6", "b= c #FFFBAD", "c= c #FFF994", "d= c #FFF87C", "e= c #FFF763", "f= c #FFF657", "g= c #FFF557", "h= c #FFF457", "i= c #FFF357", "j= c #FFF257", "k= c #FFF157", "l= c #FFF057", "m= c #FFEF57", "n= c #FFEE57", "o= c #FFED57", "p= c #FFEC57", "q= c #FFEB57", "r= c #FFEA57", "s= c #FFE957", "t= c #FDE444", "u= c #D24B35", "v= c #FF8E66", "w= c #FF8C66", "x= c #FF8B65", "y= c #FF8A64", "z= c #FF8A63", "A= c #FF8962", "B= c #FF8761", "C= c #FF865F", "D= c #FF855E", "E= c #FF835C", "F= c #FF825B", "G= c #FF815A", "H= c #FF8059", "I= c #FF8058", "J= c #FF7F57", "K= c #FF7E56", "L= c #AF7579", "M= c #86C5F2", "N= c #B3DBF6", "O= c #C4E3F8", "P= c #9DCFF2", "Q= c #88C5F0", "R= c #65B2E9", "S= c #71ADCA", "T= c #F6EB4A", "U= c #FFFA5E", "V= c #FFF95E", "W= c #FFFCB3", "X= c #FFFCC8", "Y= c #FFFBB1", "Z= c #FFF999", "`= c #FFF881", " - c #FFF669", ".- c #FFF65E", "+- c #FFF55E", "@- c #FFF45E", "#- c #FFF35E", "$- c #FFF25E", "%- c #FFF15E", "&- c #FFF05E", "*- c #FFEF5E", "=- c #FFEE5E", "-- c #FFED5E", ";- c #FFEC5E", ">- c #FFEB5E", ",- c #FFEA5E", "'- c #FDE44A", ")- c #D8553B", "!- c #FF916B", "~- c #FF8F6A", "{- c #FF8E69", "]- c #FF8D68", "^- c #FF8D67", "/- c #FF8C67", "(- c #FF8B66", "_- c #FF8A65", ":- c #FF8963", "<- c #FF8862", "[- c #FF8660", "}- c #FF855F", "|- c #FF845E", "1- c #FF815B", "2- c #FF805A", "3- c #AF777D", "4- c #84C4F1", "5- c #D7ECFA", "6- c #C3E2F8", "7- c #86C4EF", "8- c #64B1E8", "9- c #6FADCA", "0- c #F6EB4F", "a- c #FFFA65", "b- c #FFF965", "c- c #FFFBB7", "d- c #FFFCCB", "e- c #FFFBB4", "f- c #FFF99D", "g- c #FFF887", "h- c #FFF670", "i- c #FFF565", "j- c #FFF465", "k- c #FFF365", "l- c #FFF265", "m- c #FFF165", "n- c #FFF065", "o- c #FFEF65", "p- c #FFEE65", "q- c #FFED65", "r- c #FFEC65", "s- c #FFEB65", "t- c #FFEA65", "u- c #FDE54F", "v- c #D8563D", "w- c #FF936F", "x- c #FF926E", "y- c #FF916D", "z- c #FF906D", "A- c #FF9978", "B- c #FFAF95", "C- c #FFB39B", "D- c #FF9B7C", "E- c #FF8A66", "F- c #FF8965", "G- c #FF8964", "H- c #FF8863", "I- c #FF8762", "J- c #FF8661", "K- c #FF845F", "L- c #AF7980", "M- c #83C3F1", "N- c #81C3F0", "O- c #D7EBFA", "P- c #6DB7EB", "Q- c #62B0E8", "R- c #6DACCA", "S- c #F7EB55", "T- c #FFF96C", "U- c #FFFBBA", "V- c #FFFCCD", "W- c #FFFBB8", "X- c #FFF9A2", "Y- c #FFF88C", "Z- c #FFF676", "`- c #FFF66C", " ; c #FFF56C", ".; c #FFF46C", "+; c #FFF36C", "@; c #FFF26C", "#; c #FFF16C", "$; c #FFF06C", "%; c #FFEF6C", "&; c #FFEE6C", "*; c #FFED6C", "=; c #FFEC6C", "-; c #FFEB6C", ";; c #FDE555", ">; c #D9573F", ",; c #FF9673", "'; c #FF9572", "); c #FF9472", "!; c #FF9471", "~; c #FFD0C1", "{; c #FFCEBF", "]; c #FFBEA9", "^; c #FFAD93", "/; c #FF8F6C", "(; c #FF8E6B", "_; c #FF8E6A", ":; c #FF8D69", "<; c #FF8C69", "[; c #FF8B67", "}; c #FF8864", "|; c #AF7C83", "1; c #81C2F0", "2; c #D6EBFA", "3; c #83C2EE", "4; c #72BAEC", "5; c #60AFE7", "6; c #6CABCA", "7; c #F7EB5A", "8; c #FFFA73", "9; c #FFF973", "0; c #FFF873", "a; c #FFFBBC", "b; c #FFFCCC", "c; c #FFF9A5", "d; c #FFF892", "e; c #FFF67D", "f; c #FFF673", "g; c #FFF573", "h; c #FFF473", "i; c #FFF373", "j; c #FFF273", "k; c #FFF173", "l; c #FFF073", "m; c #FFEF73", "n; c #FFEE73", "o; c #FFED73", "p; c #FFEC73", "q; c #FFEB73", "r; c #FDE55A", "s; c #D95941", "t; c #FF9877", "u; c #FF9776", "v; c #FFA88C", "w; c #FFE0D6", "x; c #FFD0C0", "y; c #FFC0AC", "z; c #FFB097", "A; c #FF9F81", "B; c #FF9270", "C; c #FF916F", "D; c #FF906E", "E; c #FF8D6B", "F; c #FF8D6A", "G; c #FF8B68", "H; c #AF7E87", "I; c #7FC1F0", "J; c #7EC1EF", "K; c #CEE7F9", "L; c #ACD7F4", "M; c #97CCF1", "N; c #7DBFEE", "O; c #5EAEE7", "P; c #6AAAC9", "Q; c #F7EC60", "R; c #FFF970", "S; c #FFF41A", "T; c #FFF988", "U; c #FFFAA9", "V; c #FFF884", "W; c #FFF55F", "X; c #FFF446", "Y; c #FFF243", "Z; c #FFF45F", "`; c #FFF67A", " > c #FFF57A", ".> c #FFF47A", "+> c #FFF37A", "@> c #FFF27A", "#> c #FFF17A", "$> c #FFF07A", "%> c #FFEF7A", "&> c #FFEE7A", "*> c #FFED7A", "=> c #FFEC7A", "-> c #FFEB77", ";> c #FDDE2D", ">> c #DA5A42", ",> c #FF9C7C", "'> c #FF9B7B", ")> c #FFB9A3", "!> c #FFE1D7", "~> c #FFD1C3", "{> c #FFC2AF", "]> c #FFB299", "^> c #FFA185", "/> c #FF9675", "(> c #FF9574", "_> c #FF9474", ":> c #FF9371", "<> c #FF9271", "[> c #FF906F", "}> c #FF8E6D", "|> c #AF808A", "1> c #7CC0EF", "2> c #A8D4F4", "3> c #87C4EF", "4> c #63B1E8", "5> c #5DADE6", "6> c #69A9C9", "7> c #F4E31A", "8> c #FFF403", "9> c #FFF300", "0> c #FFF888", "a> c #FFF239", "b> c #FFEF13", "c> c #FFEE00", "d> c #FFEE12", "e> c #FFF040", "f> c #FFF36E", "g> c #FFF581", "h> c #FFF481", "i> c #FFF381", "j> c #FFF281", "k> c #FFF181", "l> c #FFF081", "m> c #FFEF81", "n> c #FFEE81", "o> c #FFED81", "p> c #FFEB75", "q> c #FFDE1D", "r> c #FDD700", "s> c #DA5C44", "t> c #FF9F80", "u> c #FF9E7F", "v> c #FFBBA6", "w> c #FFE2D8", "x> c #FFD3C4", "y> c #FFC4B1", "z> c #FFB59D", "A> c #FFA589", "B> c #FF997A", "C> c #FF9979", "D> c #FF9878", "E> c #FF9777", "F> c #FF9676", "G> c #FF9575", "H> c #FF9373", "I> c #FF9272", "J> c #AF838D", "K> c #7CBFEF", "L> c #77BDEE", "M> c #68B4E9", "N> c #5BACE6", "O> c #68A8C8", "P> c #F3E000", "Q> c #FFF400", "R> c #FFF200", "S> c #FFF784", "T> c #FFF139", "U> c #FFED00", "V> c #FFEC00", "W> c #FFEB00", "X> c #FFEC1C", "Y> c #FFEF4E", "Z> c #FFF37F", "`> c #FFF488", " , c #FFF388", "., c #FFF288", "+, c #FFF188", "@, c #FFF088", "#, c #FFEF88", "$, c #FFEE88", "%, c #FFEA6B", "&, c #FFDC0E", "*, c #FFDA00", "=, c #FDD600", "-, c #DB5D46", ";, c #FFA385", ">, c #FFA284", ",, c #FFA183", "', c #FFE3DA", "), c #FFD4C7", "!, c #FFC6B4", "~, c #FFB7A1", "{, c #FFA88D", "], c #FF9D7F", "^, c #FF9C7E", "/, c #FF9B7D", "(, c #FF9A7B", "_, c #FF9879", ":, c #FF9778", "<, c #FF9677", "[, c #AF8690", "}, c #7ABEEF", "|, c #5AABE5", "1, c #66A7C8", "2, c #FFF100", "3, c #FFF9A9", "4, c #FFEE13", "5, c #FFEA00", "6, c #FFE900", "7, c #FFE800", "8, c #FFE804", "9, c #FFF06D", "0, c #FFF48F", "a, c #FFF38F", "b, c #FFF28F", "c, c #FFF18F", "d, c #FFF08F", "e, c #FFEF8B", "f, c #FFE548", "g, c #FFDA04", "h, c #FFD900", "i, c #DB5F48", "j, c #FFA68A", "k, c #FFA588", "l, c #FFE3DB", "m, c #FFD6C9", "n, c #FFC8B7", "o, c #FFBAA5", "p, c #FFAB91", "q, c #FFA083", "r, c #FFA082", "s, c #FF9F82", "t, c #FF9E81", "u, c #FF9E80", "v, c #FF9D80", "w, c #FF9B7E", "x, c #FF9A7C", "y, c #C98E8B", "z, c #65AFE9", "A, c #59ABE5", "B, c #58AAE5", "C, c #64A6C7", "D, c #F3DF00", "E, c #FFF684", "F, c #FFED13", "G, c #FFE700", "H, c #FFE600", "I, c #FFE718", "J, c #FFEC54", "K, c #FFF28B", "L, c #FFF396", "M, c #FFF296", "N, c #FFF196", "O, c #FFEA6A", "P, c #FFDD15", "Q, c #FFDB00", "R, c #FFD800", "S, c #DC614A", "T, c #FFA98E", "U, c #FFA98D", "V, c #FFC2B0", "W, c #FFE5DC", "X, c #FFD7CB", "Y, c #FFCABA", "Z, c #FFBCA8", "`, c #FFAF96", " ' c #FFA488", ".' c #FFA387", "+' c #FFA286", "@' c #FFA285", "#' c #FFA084", "$' c #FF9F83", "%' c #FF9E82", "&' c #FF9D81", "*' c #F79B82", "=' c #0567CA", "-' c #388FDC", ";' c #56A8E4", ">' c #63A6C7", ",' c #F3DE00", "'' c #FFF000", ")' c #FFF788", "!' c #FFF039", "~' c #FFEC13", "{' c #FFE500", "]' c #FFE400", "^' c #FFE300", "/' c #FFE303", "(' c #FFE521", "_' c #FFE944", ":' c #FFEC66", "<' c #FFED76", "[' c #FFED79", "}' c #FFEA62", "|' c #FFE53C", "1' c #FFDF16", "2' c #FDD500", "3' c #DC634C", "4' c #FFAD92", "5' c #FFAC92", "6' c #FFAC91", "7' c #FFC5B3", "8' c #FFE6DE", "9' c #FFD9CD", "0' c #FFCCBD", "a' c #FFBFAB", "b' c #FFB199", "c' c #FFA78C", "d' c #FFA68C", "e' c #FFA68B", "f' c #FFA58A", "g' c #FFA489", "h' c #FFA388", "i' c #FFA287", "j' c #FFA186", "k' c #637CB0", "l' c #0167CC", "m' c #499BE1", "n' c #58A9E5", "o' c #54A8E4", "p' c #62A4C6", "q' c #F3DD00", "r' c #FFEF00", "s' c #FFE200", "t' c #FFE100", "u' c #FFE000", "v' c #FFDF00", "w' c #FFDE00", "x' c #FFDD00", "y' c #FFDC00", "z' c #FFD700", "A' c #FDD400", "B' c #DD644E", "C' c #FF9D7E", "D' c #FFAC93", "E' c #FFB59F", "F' c #FFAA90", "G' c #FFAA91", "H' c #FFAB92", "I' c #FFA990", "J' c #FFA98F", "K' c #FFA88F", "L' c #FFA78D", "M' c #FFA58C", "N' c #FFA58B", "O' c #F0A08E", "P' c #1D6CC4", "Q' c #1475D2", "R' c #2C87D8", "S' c #318ADA", "T' c #308AD9", "U' c #2F89D9", "V' c #2E88D9", "W' c #2D88D9", "X' c #2C87D9", "Y' c #2B87D8", "Z' c #2B86D8", "`' c #2A86D8", " ) c #2985D8", ".) c #2885D7", "+) c #2884D7", "@) c #2784D7", "#) c #2683D7", "$) c #2583D6", "%) c #2582D6", "&) c #2482D6", "*) c #3884BB", "=) c #FFF8A9", "-) c #FFF584", ";) c #FFEF39", ">) c #FFEB13", ",) c #FFD600", "') c #FDD300", ")) c #DB5B44", "!) c #FF7245", "~) c #FF693A", "{) c #FFD2C4", "]) c #FF744A", "^) c #FF7247", "/) c #FF8F6D", "() c #FFAE95", "_) c #FFAD95", ":) c #FFAD94", "<) c #FFAB93", "[) c #FFAA92", "}) c #FFA991", "|) c #DE9F97", "1) c #3C75BD", "2) c #196CB2", "3) c #F3DC00", "4) c #FFF688", "5) c #FFEE39", "6) c #FFEA13", "7) c #FFD500", "8) c #D53F23", "9) c #FF6A3B", "0) c #FF6839", "a) c #FF7349", "b) c #FF6131", "c) c #FF6030", "d) c #FF6132", "e) c #FF7A52", "f) c #FF997B", "g) c #FFAF97", "h) c #FFB099", "i) c #FFAF98", "j) c #FFAE97", "k) c #FFAD96", "l) c #FFAC95", "m) c #FDAB94", "n) c #AB94A6", "o) c #7084B2", "p) c #4278BD", "q) c #3774BF", "r) c #3772BD", "s) c #3765AC", "t) c #375FA4", "u) c #375EA4", "v) c #2452A0", "w) c #2150A0", "x) c #1259B3", "y) c #1F6DAC", "z) c #FFED39", "A) c #FDD200", "B) c #D53E22", "C) c #FF6738", "D) c #FF7248", "E) c #FF5F2F", "F) c #FF5E2E", "G) c #FF5D2D", "H) c #FF5C2B", "I) c #FF6537", "J) c #FF8866", "K) c #FFB39D", "L) c #FFB29D", "M) c #FFB29C", "N) c #FFB19C", "O) c #FFB19B", "P) c #FFB09A", "Q) c #FFAF99", "R) c #FFAE98", "S) c #FFAD97", "T) c #FF9B80", "U) c #FF592B", "V) c #FF4715", "W) c #FF4614", "X) c #FF4513", "Y) c #FF4412", "Z) c #A80A02", "`) c #FFF484", " ! c #FFE913", ".! c #FFD400", "+! c #FDD100", "@! c #FF6637", "#! c #FFB9A4", "$! c #FF8A67", "%! c #FF5B2A", "&! c #FF5929", "*! c #FF5828", "=! c #FF5829", "-! c #FF7751", ";! c #FF9F84", ">! c #FFB6A2", ",! c #FFB6A1", "'! c #FFB5A0", ")! c #FFB4A0", "!! c #FFB49F", "~! c #FFB39E", "{! c #FFB29E", "]! c #FF7B57", "^! c #FF4A18", "/! c #FF4311", "(! c #A80902", "_! c #F3DB00", ":! c #FFF588", "~ c #FF3D0B", ",~ c #FFEE4F", "'~ c #FFF284", ")~ c #FFE50E", "!~ c #FDCD00", "~~ c #D53A1E", "{~ c #FF6C41", "]~ c #FF5827", "^~ c #FF410F", "/~ c #FF3C0A", "(~ c #FFE706", "_~ c #FFF498", ":~ c #FFE306", "<~ c #FFCF00", "[~ c #FDCC00", "}~ c #D53A1D", "|~ c #FF8561", "1~ c #FF6B40", "2~ c #FF3B09", "3~ c #A80801", "4~ c #F3D700", "5~ c #FFE507", "6~ c #FFE933", "7~ c #FFE308", "8~ c #FFCE00", "9~ c #D5391D", "0~ c #FF8F6E", "a~ c #FFCFC0", "b~ c #FF8460", "c~ c #FF6A3F", "d~ c #FF3A08", "e~ c #F3D600", "f~ c #FDCB00", "g~ c #D5381C", "h~ c #FFCEC0", "i~ c #FF835F", "j~ c #FF693E", "k~ c #FF4918", "l~ c #FF3907", "m~ c #A80800", "n~ c #F0D100", "o~ c #FFCD00", "p~ c #FAC700", "q~ c #D5381B", "r~ c #FF9C7F", "s~ c #FF825F", "t~ c #FF683D", "u~ c #FF3806", "v~ c #E5BF00", "w~ c #FFCC00", "x~ c #EFBC00", "y~ c #D5371B", "z~ c #FF5B2B", "A~ c #FF815E", "B~ c #FF673C", "C~ c #FF3704", "D~ c #CE9D00", "E~ c #F8DB00", "F~ c #FCC900", "G~ c #D3A000", "H~ c #D5371A", "I~ c #FF5A2A", "J~ c #FFCDBE", "K~ c #FFB49E", "L~ c #FF805D", "M~ c #FF653B", "N~ c #FF5121", "O~ c #FF3F0C", "P~ c #FF3705", "Q~ c #FF3603", "R~ c #CF9E00", "S~ c #E8C300", "T~ c #F5D500", "U~ c #FBDD00", "V~ c #FBDC00", "W~ c #FBDB00", "X~ c #FBDA00", "Y~ c #FBD900", "Z~ c #FBD800", "`~ c #FBD700", " { c #FBD600", ".{ c #FBD500", "+{ c #FBD400", "@{ c #FBD300", "#{ c #FBD200", "${ c #FBD100", "%{ c #FBD000", "&{ c #FBCF00", "*{ c #FBCE00", "={ c #FBCD00", "-{ c #FBCC00", ";{ c #FBCB00", ">{ c #FBCA00", ",{ c #FBC900", "'{ c #F7C400", "){ c #ECB900", "!{ c #D5361A", "~{ c #FF805C", "{{ c #FF5E31", "]{ c #FF3E0B", "^{ c #FF3502", "/{ c #A80700", "({ c #D53519", "_{ c #FF5726", ":{ c #FF754E", "<{ c #FF6034", "[{ c #FF4817", "}{ c #FF3401", "|{ c #D53518", "1{ c #FF5625", "2{ c #FF5524", "3{ c #FF3300", "4{ c #CF2F15", "5{ c #FF3604", "6{ c #A20400", "7{ c #B6190B", "8{ c #FF5020", "9{ c #F02B00", "0{ c #E03C19", "a{ c #FF5423", "b{ c #FF3D0A", "c{ c #FD3200", "d{ c #B50E00", "e{ c #9A0000", "f{ c #C6250F", "g{ c #E53E19", "h{ c #F2461C", "i{ c #F2451B", "j{ c #F2451A", "k{ c #F24419", "l{ c #F24318", "m{ c #F24217", "n{ c #F24116", "o{ c #F24015", "p{ c #F23F14", "q{ c #F23E14", "r{ c #F23E12", "s{ c #F23D11", "t{ c #F23C10", "u{ c #F23B0F", "v{ c #F23A0E", "w{ c #F2390D", "x{ c #F2380D", "y{ c #F2370C", "z{ c #F2370B", "A{ c #F23609", "B{ c #F23508", "C{ c #F23407", "D{ c #F23206", "E{ c #F23106", "F{ c #F23005", "G{ c #F23004", "H{ c #F22F03", "I{ c #F22E01", "J{ c #F22D00", "K{ c #F22C00", "L{ c #EF2B00", "M{ c #DC2100", "N{ c #AD0A00", "O{ c #00349A", "P{ c #003399", "Q{ c #01359A", "R{ c #003499", "S{ c #003398", "T{ c #02359A", "U{ c #2057AF", "V{ c #2157AF", "W{ c #2158AF", "X{ c #2258AF", "Y{ c #2358AF", "Z{ c #2359AF", "`{ c #2459AF", " ] c #2459B0", ".] c #2559B0", "+] c #083C9E", "@] c #2256AD", "#] c #275BB0", "$] c #275BB1", "%] c #285BB1", "&] c #285CB1", "*] c #295CB1", "=] c #2659B0", "-] c #1E51AB", ";] c #1548A5", ">] c #0B3EA0", ",] c #083B9E", "'] c #86C6F2", ")] c #87C7F2", "!] c #8ECBF4", "~] c #90CCF4", "{] c #91CDF5", "]] c #93CDF5", "^] c #2155AD", "/] c #88BEEC", "(] c #9ED4F8", "_] c #9FD5F9", ":] c #A0D6F9", "<] c #A2D7FA", "[] c #A3D7FA", "}] c #A4D8FA", "|] c #A6D9FB", "1] c #A7DAFB", "2] c #A9DBFB", "3] c #AADCFC", "4] c #8DBFEB", "5] c #5587CA", "6] c #06399D", "7] c #00339A", "8] c #A1D6FA", "9] c #9FD2F7", "0] c #A2D6F9", "a] c #ABDDFC", "b] c #ADDDFD", "c] c #82B2E4", "d] c #3067B8", "e] c #1145A4", "f] c #1246A4", "g] c #04379C", "h] c #3669BA", "i] c #01349A", "j] c #1B4EA9", "k] c #5F91D0", "l] c #AEDEFD", "m] c #5081C6", "n] c #003299", "o] c #5E9AD7", "p] c #8DC3EE", "q] c #5D90CF", "r] c #79A9DE", "s] c #5D99D6", "t] c #184BA7", "u] c #88B8E6", "v] c #1555AF", "w] c #2B77C6", "x] c #2B78C7", "y] c #2C78C7", "z] c #02369B", "A] c #296DBF", "B] c #347EC9", "C] c #357EC9", "D] c #2364B9", "E] c #164FAB", "F] c #3E83CC", "G] c #3E84CC", "H] c #3F84CC", "I] c #073C9F", "J] c #4385CC", "K] c #4587CE", "L] c #4588CE", "M] c #3270BE", "N] c #144AA7", "O] c #4E8DD1", "P] c #4F8DD1", "Q] c #508ED1", "R] c #2058B0", "S] c #073A9D", "T] c #6898D4", "U] c #104EAB", "V] c #419BDE", "W] c #429CDF", "X] c #439DDF", "Y] c #104CAA", "Z] c #03389C", "`] c #4DA1E0", " ^ c #50A5E3", ".^ c #51A6E3", "+^ c #4998DA", "@^ c #3375C3", "#^ c #5EADE7", "$^ c #5FAEE7", "%^ c #4C95D6", "&^ c #3372C0", "*^ c #6CB5EA", "=^ c #1C55AE", "-^ c #5EA1DC", ";^ c #77BCEE", ">^ c #5F9FDB", ",^ c #A5D5F8", "'^ c #194BA7", ")^ c #3E96DA", "!^ c #2065BA", "~^ c #1755AF", "{^ c #4FA4E2", "]^ c #53A6E3", "^^ c #0C44A4", "/^ c #4890D4", "(^ c #3070C0", "_^ c #5095D7", ":^ c #5EA5E0", "<^ c #05389C", "[^ c #3774C1", "}^ c #75BCED", "|^ c #70B4E9", "1^ c #0F44A3", "2^ c #70ADE3", "3^ c #90C6F0", "4^ c #0A3DA0", "5^ c #87BAE8", "6^ c #97C7F0", "7^ c #2B5DB2", "8^ c #2C7AC8", "9^ c #307ECB", "0^ c #2D75C4", "a^ c #2363B8", "b^ c #5AA9E4", "c^ c #144CA9", "d^ c #0C42A2", "e^ c #63ADE5", "f^ c #407FC8", "g^ c #71B8EB", "h^ c #275FB4", "i^ c #6EAAE1", "j^ c #5690D1", "k^ c #5791D1", "l^ c #5891D2", "m^ c #5992D2", "n^ c #5A92D2", "o^ c #5A93D2", "p^ c #5C93D2", "q^ c #295EB3", "r^ c #669BD6", "s^ c #2E61B4", "t^ c #3064B6", "u^ c #3568B9", "v^ c #5588CB", "w^ c #92C5EE", "x^ c #9CCEF3", "y^ c #093C9F", "z^ c #195BB4", "A^ c #4096DB", "B^ c #4395D9", "C^ c #3078C6", "D^ c #4393D7", "E^ c #3A83CD", "F^ c #154FAB", "G^ c #5DACE6", "H^ c #56A2E0", "I^ c #235EB4", "J^ c #6FB6EB", "K^ c #1E57AF", "L^ c #05399D", "M^ c #5C9FDB", "N^ c #4683CB", "O^ c #4177C2", "P^ c #1245A4", "Q^ c #063DA0", "R^ c #459EE0", "S^ c #0B44A4", "T^ c #4DA3E2", "U^ c #3985CE", "V^ c #124DAA", "W^ c #4FA1E0", "X^ c #296ABC", "Y^ c #3B7FC9", "Z^ c #4283CB", "`^ c #6FB7EB", " / c #6AB1E7", "./ c #5FA3DE", "+/ c #04379B", "@/ c #79B6E9", "#/ c #67A3DC", "$/ c #69A3DC", "%/ c #6AA4DD", "&/ c #6AA5DD", "*/ c #6CA6DD", "=/ c #6DA6DE", "-/ c #6EA6DE", ";/ c #3166B8", ">/ c #90C5EF", ",/ c #6B9FD9", "'/ c #6DA0D9", ")/ c #71A4DB", "!/ c #77AADF", "~/ c #6E9FD8", "{/ c #1C4FA9", "]/ c #3588D2", "^/ c #1B5DB4", "// c #2264B9", "(/ c #2366BA", "_/ c #4D9EDE", ":/ c #54A7E4", "( c #073EA0", ",( c #3075C4", "'( c #4996D9", ")( c #2666BA", "!( c #56A5E1", "~( c #519CDC", "{( c #2F6DBD", "]( c #66ADE5", "^( c #0A3FA0", "/( c #5495D6", "(( c #62A3DF", "_( c #03369C", ":( c #2356AD", "<( c #ABDBFC", "[( c #ACDBFB", "}( c #0A3D9F", "|( c #053B9E", "1( c #449DDF", "2( c #48A0E0", "3( c #49A1E1", "4( c #4AA1E1", "5( c #3F8ED4", "6( c #1956AF", "7( c #57A9E5", "8( c #3578C5", "9( c #164EAA", "0( c #68B2E8", "a( c #255FB4", "b( c #0E43A3", "c( c #4582CA", "d( c #164AA6", "e( c #3C6FBC", "f( c #5384C8", "g( c #3686D0", "h( c #2A70C1", "i( c #04389C", "j( c #1A55AF", "k( c #063A9D", "l( c #5BA3DF", "m( c #4789CF", "n( c #306BBC", "o( c #245CB2", "p( c #93C8F1", "q( c #71A4DC", "r( c #73A7DD", "s( c #76A9DF", "t( c #82B5E5", "u( c #71A2D9", "v( c #2267BC", "w( c #1552AD", "x( c #408BD1", "y( c #57A7E3", "z( c #03379B", "A( c #61A9E2", "B( c #073C9E", "C( c #589AD8", "D( c #70B3E7", "E( c #0C41A1", "F( c #8ABAE9", "G( c #3466B7", "H( c #0942A3", "I( c #256CBF", "J( c #266DBF", "K( c #276DBF", "L( c #1854AE", "M( c #2E71C1", "N( c #2F72C1", "O( c #3073C1", "P( c #2564B8", "Q( c #3777C3", "R( c #3877C4", "S( c #3878C4", "T( c #1A52AC", "U( c #0F45A4", "V( c #3F7CC6", "W( c #407CC6", "X( c #417DC6", "Y( c #265EB3", "Z( c #4580C8", "`( c #4680C8", " _ c #4781C8", "._ c #3169B9", "+_ c #487DC5", "@_ c #5488CB", "#_ c #5489CC", "$_ c #5589CC", "%_ c #568ACC", "&_ c #578ACC", "*_ c #588BCD", "=_ c #5689CB", "-_ c #4E80C6", ";_ c #4173BF", " ", " ", " ", " ", " ", " . + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @ ", " # $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ # ", " $ $ $ % & * = = - - ; ; > , , , ' ' ) ! ! ~ ~ & { ] ^ / / ( ( _ : < < [ } $ $ + ", " + $ $ | 1 2 3 4 5 6 7 8 9 0 a b c d e f g h i j k l m n o p q r s t u v w x y $ $ ", " $ $ z A B C 3 D E F G H 9 I J K L M N O P Q R S T U V W n X Y Z ` ...+.@.#.$.%.$ . ", " $ $ &.*.=.C -.;.>.,.'.).!.~.{.J K ].^./.(._.:.<.[.}.|.|.1.2.X 3.Z 4. ...5.6.7.8.$ $ ", " $ $ 9.0.a.b.c.d.e.f.'.g.).h.~.i.j.k.l.m.n.o.p.q.<.[.r.s.|.t.u.v.w.x.y.z.A.5.B.C.$ $ ", " $ $ D.E.F.G.H.I.J.K.L.M.N.O.P.Q.R.S.T.U.V.W.X.Y.q.Z.`. +.+++t.@+#+w.$+x.%+&+*+=+$ $ ", " $ $ -+;+>+,+-+'+'+)+!+~+{+]+^+/+(+_+S.:+<+[+}+|+Y.1+2+`.3+.+.+4+5+6+7+8+9+0+a+b+$ $ ", " $ $ c+d+;+>+e+f+g+h+i+j+k+{+l+m+n+o+p+q+r+s+[+t+u+v+w+x+y+z+A+.+B+C+D+6+E+F+G+H+$ $ ", " $ $ I+J+d+K+L+M+N+h+O+P+Q+R+S+T+U+V+o+W+X+Y+Z+`+ @.@+@w+@@#@y+$@%@&@B+*@=@6+E+-@$ $ ", " $ $ K+;@>@,@'@M+)@!@~@{@]@^@/@(@_@U+:@<@[@}@|@1@Z+2@3@.@4@5@5@#@6@$@7@8@9@*@=@0@$ $ ", " $ $ a@b@c@J.d@M+e@f@g@h@i@j@k@^@l@m@n@:@o@<@p@q@r@Z+s@t@3@u@4@v@w@x@6@y@7@z@9@A@$ $ ", " $ $ B@K.b@C@D@E@e@F@G@H@I@J@K@k@k@L@l@M@N@O@o@P@Q@q@R@S@T@U@V@W@X@Y@Z@x@`@ #.#+#$ $ ", " $ $ @###$#%#&#*#=#-#;#>#,#'#J@)#!#~#{#]#m@M@^#/#/#(#Q@_#R@S@:#<#[#}#X@|#|#1#2#3#$ $ ", " $ $ 4#!+##5#6#*#7#8#9#0#a#,#,#b#c#!#d#e#f#g#h#M@i#j#/#k#l#_#m#n#o#p#q#r#s#t#t#u#$ $ ", " $ $ v#w#i+!+x#*#7#8#y#z#A#B#B#C#D#E#F#G#d#H#I#f#J#K#L#M#j#N#O#P#Q#R#R#S#T#T#U#V#W#W# ", " $ $ X#!+Y#(.Z#`# $B#.$M@,#+$A#@$B#C##$$$%$F#&$*$I#I#=$-$;$>$,$'$'$'$'$'$'$'$'$'$'$'$'$'$'$'$'$'$'$'$'$'$'$'$'$'$'$'$'$'$'$'$'$'$'$ ", " $ $ )$!$~${$a#]$G@'#r+^$/$V }@B#+$($@$_$:$#$$$<$[$&$&$}$,$'$'$|$1$1$1$1$1$1$1$1$1$1$1$1$1$1$1$1$1$1$1$1$1$1$1$1$1$1$1$1$1$1$|$'$'$'$ ", " $ $ 2$~${$3$4$5$6$c#7$W 8$9$0$0$t.o@a$b$c$d$_$e$f$f$g$h$'$i$j$k$l$m$n$n$o$o$o$o$p$q$r$r$s$t$t$t$u$v$w$w$x$x$x$y$y$z$z$A$B$C$D$E$F$'$'$ ", " $ $ G${$3$G$'#x#H$)#`+I$9$0$J$K$L$M$N$#@<$O$P$b$Q$R$S$'$T$U$V$V$W$X$X$Y$Z$`$`$ % %.%.%+%@%#%#%$%%%&%&%&%*%*%=%-%;%;%>%,%'%'%'%)%!%~%'$'$ ", " $ $ {%3$G$]%'#^%/%!#}+(%0$J$K$L$M$_%:%<%[%A.}%|%|%P$1%'$2%3%4%5%6%6%7%8%8%8%9%0%a%a%b%c%d%d%d%e%f%f%g%h%h%i%j%j%j%k%l%m%m%n%o%p%p%q%'$'$ ", " $ $ r%G$]%r%J@6#/%e#u+Y J$K$L$M$_%:%<%s%t%u%v%w%x%y%'$'$z%A%B%C%C%D%D%E%E%F%G%H%H%I%I%J%J%K%L%L%M%M%N%N%O%P%Q%Q%R%R%S%S%T%U%V%V%W%X%'$'$ ", " $ $ Y%]%r%Z%K@6#`%~#|+ &K$L$M$_%:%<%s%t%u%v%.&+&@&#&'$'$$&%&&&&&&&*&=&=&-&;&;&;&>&,&'&'&)&)&)&!&~&{&{&]&]&^&^&/&(&_&_&_&:&<&<&[&}&|&'$'$ ", " 1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&2&$ $ 3&r%Z%3&!#4&5&]#w+6&L$M$_%:%<%s%t%u%v%.&+&@&7&8&'$'$9&0&0&0&a&b&c&d&e&f&f&g&h&h&h&i&j&j&k&l&l&l&m&n&o&o&o&p&q&q&r&r&r&s&t&u&u&v&'$'$ ", " 1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&2&$ $ w&Z%3&/$~#x&y&h#x+z&M$_%:%<%s%t%u%v%.&+&@&7&A&B&'$'$C&D&E&F&G&H&I&J&K&L&M&M&M&N&O&P&P&P&Q&R&R&S&S&T&T&U&V&V&V&W&X&X&Y&Y&Z&Z&`& *'$'$ ", " 1&1&.*+*@*#*$*%*&***=*-*;*>*,*'*)*!*~*{*]*^*/*$ $ (*3&/$8$]#_*:*M@<*[*_%:%<%s%t%u%v%.&+&@&7&A&}*|*'$'$1*2*3*3*4*5*6*7*8*9*0*0*a*a*b*b*c*d*d*d*e*f*f*f*g*h*h*i*i*j*j*k*k*l*l*m*n*o*'$'$ ", " 1&1&p*q*r*r*s*t*u*v*w*x*y*z*A*B*C*D*E*F*G*H*I*$ $ J*/$8$9$]#_*K*^#L*M*:%<%s%t%u%v%.&+&@&7&A&}*N*O*'$'$P*Q*Q*Q*R*S*T*U*V*W*X*X*Y*Z*Z*Z*`* = =.=.=+=+=@=@=@=#=$=$=$=%=&=&=&=*=====-='$'$ ", " 1&1&;=>=,='=)=!=~={=]=^=/=(=v*w*x*_=:=<=[=C*D*}=$ $ 0$8$9$0$M@|=1=2=3=@.<%s%t%u%v%.&+&@&7&A&}*N*4=5='$'$6=7=8=9=0=a=b=c=d=e=f=g=g=g=h=i=i=i=j=k=k=k=l=m=m=m=n=o=o=o=p=q=q=q=r=s=s=t='$'$ ", " 1&1&u=v=w=x=y=z=A='=B=C=D={=]=E=F=G=H=I=J=K=:=L=$ $ M=9$0$J$N=|=O=/#P=Q=s%t%u%v%.&+&@&7&A&}*N*4=R=S='$'$T=U=V=V=W=X=Y=Z=`= -.-+-+-@-@-#-#-#-$-$-%-%-&-&-*-*-=-=-----;-;-;->-,-,-,-'-'$'$ ", " 1&1&)-!-~-{-]-^-/-(-_-:-:-<-B=[-}-}-|-E=F=1-2-3-$ $ 4-0$J$K$^#5-6-(#B+7-t%u%v%.&+&@&7&A&}*N*4=R=8-9-'$'$0-a-b-b-c-d-e-f-g-h-i-i-i-j-j-j-k-l-l-l-m-m-m-n-o-o-o-p-p-q-q-r-r-s-s-s-t-u-'$'$ ", " 1&1&v-w-x-y-z-A-B-C-D-{-/-(-E-F-G-H-I-J-[-}-K-L-$ $ M-J$K$N-/#O-a$(#4+$.u%v%.&+&@&P-A&}*N*4=R=8-Q-R-'$'$S-T-T-T-U-V-W-X-Y-Z-`- ; ;.;.;.;+;+;@;@;#;#;#;$;$;$;%;&;&;&;*;*;*;=;-;-;-;;;'$'$ ", " 1&1&>;,;';);!;~;{;];^;A-/;(;_;:;<;[;(-E-F-};H-|;$ $ 1;K$N-M$x+2;b$_#5+3;v%4;+&@&P-A&}*N*4=R=8-Q-5;6;'$'$7;8;9;0;a;b;e-c;d;e;f;g;g;g;h;h;h;i;j;j;j;k;k;l;l;l;m;m;m;n;o;o;o;p;p;p;q;r;'$'$ ", " 1&1&s;A-t;u;v;w;x;y;z;A;B;B;C;D;z-/;(;E;F;<;G;H;$ $ I;N-M$_%J;K;c$L;M;N;4;+&@&P-A&}*N*4=R=8-Q-5;O;P;'$'$Q;R;L&S;T;U;V;W;X;Y;Z;`; > >.>.>.>+>+>+>@>#>#>#>$>$>$>%>%>&>&>&>*>*>*>=>->;>'$'$ ", " 1&1&>>,>'>'>)>!>~>{>]>^>/>(>_>);:><>B;C;[>D;}>|>$ $ :%M$_%1><%5.2>V@3>.&+&@&P-A&}*N*4=R=4>Q-5;O;5>6>'$'$7>8>9>9>0>U;V;+-a>b>c>d>e>f>g>h>h>i>i>i>j>j>j>k>k>k>l>l>m>m>m>n>n>n>o>p>q>r>'$'$ ", " 1&1&s>t>t>u>v>w>x>y>z>A>B>C>D>E>u;F>G>(>_>H>I>J>$ $ K>_%1><%s%L>u%v%4;+&@&P-A&}*M>4=R=4>Q-5;O;5>N>O>'$'$P>Q>9>R>0>U;S>@-T>b>U>V>W>W>X>Y>Z>`> , , ,.,.,+,+,+,+,@,@,@,#,#,#,$,%,&,*,=,'$'$ ", " 1&1&-,;,>,,,];',),!,~,{,],^,/,D-(,(,B>_,_,:,<,[,$ $ },1><%s%L>u%v%4;+&@&P-A&}*M>4=R=4>Q-5;O;5>N>|,1,'$'$P>9>R>2,0>3,S>@-T>4,V>W>W>5,6,7,8,_&9,0,a,a,b,b,b,c,c,c,d,d,d,d,e,f,g,*,h,=,'$'$ ", " 1&1&i,j,k,k,y;l,m,n,o,p,q,r,s,t,u,v,],^,w,/,x,y,$ $ z,<%s%L>u%v%4;+&@&P-A&}*M>4=R=4>Q-5;O;5>N>A,B,C,'$'$D,R>2,2,0>3,E,@-T>F,W>W>5,6,6,7,G,H,H,I,J,K,L,L,M,M,M,N,N,N,N,O,P,Q,*,h,R,=,'$'$ ", " 1&1&S,T,U,v;V,W,X,Y,Z,`, '.'.'+'@'^>#'#'$'%'&'*'='$ -'s%L>u%v%4;+&@&P-A&}*M>4=R=4>Q-5;O;5>N>A,B,;'>''$'$,'2,2,'')'3,E,#-!'~'W>5,6,6,7,G,H,H,{']'^'/'('_':'o;<'['}'|'1'Q,Q,*,h,R,R,2''$'$ ", " 1&1&3'4'5'6'7'8'9'0'a'b'{,c'd'e'f'f'g'g'h'i'j'j'k'$ l'm'u%v%4;+&@&P-A&}*M>4=R=4>Q-5;O;5>N>A,n';'o'p''$'$q'2,''r')'3,E,#-!'~'5,6,6,7,G,H,H,{']'^'^'s't'u'u'v'w'x'x'y'Q,Q,*,h,R,R,z'A''$'$ ", " 1&1&B'z;`,C'D'9'y>E'F'G'H'p,G'F'I'J'K'L'L'd'M'N'O'P'$ $ Q'R'S'T'U'U'V'W'W'X'Y'Z'`' ).)+)@)#)$)%)&)*)'$'$q'''r'c>)'=)-)#-;)>)6,6,7,G,H,H,{']'^'^'s't'u'u'v'w'x'x'y'Q,Q,*,h,R,R,z',)')'$'$ ", " 1&1&)):;!)~)E>{)v> '<;])^)/)J'()_):)D'<)H'[)G'})I'|)1)$ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ 2)'$'$3)r'c>c>4)=)-)$-5)6)6,7,G,H,H,{']'^'^'s't'u'u'v'w'w'x'y'Q,Q,*,h,R,R,z',)7)')'$'$ ", " 1&1&8)9)~)0)F>{)o,.'G;a)b)c)d)e)f)g)h)i)i)j)j)k)k)l)m)n)o)p)q)q)q)q)q)r)s)t)t)u)v)w)x)$ $ $ $ $ $ y)'$'$3)c>c>U>4)=)-)%-z)6)7,G,H,H,{']'^'^'s't'u'u'v'w'w'x'y'Q,Q,*,h,R,R,z',)7)7)A)'$'$ ", " 1&1&B)~)0)C)/>~>o,.'[;D)c)E)F)G)H)I)J)<)K)L)M)N)O)P)P)h)Q)Q)R)R)S)k)T)U)V)W)X)Y)Z)1&1& '$'$3)c>U>V>4)=)`)%-z) !G,H,H,{']'^'^'s't't'u'v'w'w'x'y'Q,Q,*,h,R,R,z',)7)7).!+!'$'$ ", " 1&1&B)0)C)@!G>~>#!+'$!^)E)F)G)H)%!&!*!=!-!;!>!,!'!'!)!!!!!~!~!{!Q)]!^!V)W)X)Y)/!(!1&1& '$'$_!U>V>V>:!#!@'3!4!F)G)H)%!&!*!5!6!7!8!9!0!a!!!>!,!b!b!M'0!c!d!V)W)X)Y)/!e!(!1&1& '$'$f!V>V>W>:!l!m!^>F-n!G)o!%!&!*!5!6!7!8!p!q!r!s!t!u!v!w!x!^!y!d!V)W)X)Y)/!e!z!A!1&1& '$'$B!V>W>5,`>5,6,`>l!V!#'W!X!%!Y!*!5!6!7!8!p!t!r!s!J!K!L!M!N!Z!y!d!V)W)X)Y)/!e!z!O!`!A!1&1& '$'$ ~5,5,6,.~+~C!*-@~Q!]'^'s't't'u'v'w'w'x'y'y'Q,*,h,h,R,z',),)7).!}!}!D!R!#~S!'$'$ ", " 1&1&T!G!U!b)$~%~&~$'*~=~Y!-~5!6!7!8!p!t!r!s!J!K!L!M!N!Z!y!d!V)W)X)Y)/!;~z!O!`!>~A!1&1& '$'$ ~5,6,7,,~+~'~=-@~)~^'s't't'u'v'w'w'x'y'y'Q,*,h,h,R,z',),)7).!}!}!D!R!#~#~!~'$'$ ", " 1&1&~~U!b)c)$~%~~,s,J-{~-~]~6!7!8!p!t!r!s!J!K!L!M!N!Z!y!d!V)W)X)Y)/!;~^~O!`!>~/~A!1&1& '$'$ ~6,7,G,(~_~'~--@~:~s't't'u'v'w'w'x'y'y'Q,*,h,h,R,z',),)7).!}!}!D!R!#~#~<~[~'$'$ ", " 1&1&}~b)c)E)[>%~,!%'|~1~]~6!7!8!p!t!r!s!J!K!L!M!N!Z!y!d!V)W)X)Y)/!;~^~O!`!>~/~2~3~1&1& '$'$4~7,G,G,H,5~<&6~7~s't't'u'v'w'w'x'y'y'Q,*,h,h,R,z',),)7).!}!}!D!R!#~#~<~8~[~'$'$ ", " 1&1&9~c)E)F)0~a~,!&'b~c~6!7!8!p!t!r!s!J!K!L!M!N!Z!y!d!V)W)X)Y)/!;~^~O!`!>~/~2~d~3~1&1& '$'$e~G,G,H,{']']'^'s't't'u'v'v'w'x'y'y'Q,*,h,h,R,z',),)7).!}!}!D!R!R!#~<~8~8~f~'$'$ ", " 1&1&g~E)F)G)0~h~'!v,i~j~7!8!p!t!r!s!J!K!L!M!N!Z!k~d!V)W)X)Y)/!;~^~O!`!>~/~2~d~l~m~1&1& '$'$n~G,H,{']']'^'s't't'u'v'v'w'x'y'y'Q,*,h,h,R,z',),)7).!.!}!D!R!R!#~<~8~8~o~p~'$'$ ", " 1&1&q~F)G)o!}>h~E'r~s~t~8!p!t!r!s!J!K!L!M!N!Z!k~d!V)W)X)Y)/!;~^~O!`!>~/~2~d~l~u~m~1&1& '$'$v~H,{']']'^'s's't'u'v'v'w'x'y'y'Q,*,h,h,R,z',),)7).!.!}!D!R!R!#~<~8~8~o~w~x~'$'$ ", " 1&1&y~G)o!z~E;{;!!r~A~B~p!t!r!s!J!K!L!M!N!Z!k~d!V)W)X)Y)/!;~^~z!`!>~/~2~d~l~u~C~m~1&1& '$'$D~E~]']'^'s's't'u'v'v'w'x'y'y'Q,*,h,h,R,z'z',)7).!.!}!D!R!R!#~<~8~8~o~w~F~G~'$'$ ", " 1&1&H~o!z~I~1~J~K~w,L~M~t!N~s!J!K!L!M!N!Z!k~d!V)W)X)Y)/!;~^~z!O~>~/~2~d~l~u~P~Q~m~1&1& '$'$R~S~T~U~U~V~W~X~X~Y~Z~`~`~ {.{+{+{+{@{@{#{${%{%{&{*{={={-{;{>{>{,{'{){G~'$'$ ", " 1&1&!{z~I~-~]~<)K~w,~{{{N~s!J!K!L!M!N!Z!k~d!V)W)X)Y)/!;~^~z!O~]{/~2~d~l~u~P~Q~^{/{1&1& '$'$'$'$'$'$'$'$'$'$'$'$'$'$'$'$'$'$'$'$'$'$'$'$'$'$'$'$'$'$'$'$'$'$'$'$'$'$ ", " 1&1&({I~-~]~_{*!:{L~<{N~s!J!K!L!M!N!Z!k~[{V)W)X)Y)/!;~^~z!O~]{/~2~d~l~u~P~Q~^{}{/{1&1& '$'$'$'$'$'$'$'$'$'$'$'$'$'$'$'$'$'$'$'$'$'$'$'$'$'$'$'$'$'$'$'$'$'$'$'$ ", " 1&1&|{-~]~_{1{2{p!t!N~s!J!K!L!M!N!Z!k~[{V)W)X)Y)/!;~^~z!O~]{/~2~d~l~u~P~Q~^{}{3{/{1&1& ", " 1&1&4{]~_{1{2{p!t!N~s!J!K!L!M!N!Z!k~[{V)W)X)Y)/!;~^~z!O~]{/~2~d~l~u~P~5{^{}{3{3{6{1& ", " 1&1&7{_{1{2{p!t!N~8{J!K!L!M!N!Z!k~[{V)W)X)Y)/!;~^~z!O~]{/~2~d~l~u~P~5{^{}{3{3{9{1&1& ", " 1&1&0{2{a{t!N~8{J!K!L!M!N!Z!k~[{V)W)X)Y)/!;~^~z!O~]{b{2~d~l~u~P~5{^{}{3{3{c{d{1&1& ", " 1&1&e{f{g{h{i{j{k{l{m{n{o{p{q{r{s{t{u{v{w{x{y{z{A{B{C{D{E{F{G{H{I{J{K{L{M{N{1&1& ", " 1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1& ", " 1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1& ", " O{P{P{P{P{P{P{P{P{P{P{P{P{P{P{P{Q{ R{P{P{P{P{P{P{P{P{P{P{P{P{P{S{ ", " P{T{U{V{V{W{X{X{Y{Y{Z{`{ ] ].]+]P{ P{P{@]#]$]%]&]&]*]=]-];]>]P{P{P{S{ ", " P{,]K$J$'])]J*8$/$3&!]~]{]]]G$^]P{ P{P{/](]_]:]<][]}]|]1]2]3]4]5]6]P{7] ", " P{,]K$J$'])]J*8$/$3&!]~]{]]]G$^]P{ P{P{/](]_]:]8]9]0]|]1]2]3]a]b]c],]P{ ", " P{,]K$J$']J$d]e]e]e]e]f]f]f]f]g]P{ P{P{/](]_](]h]P{P{i]j]k]3]a]b]l]m]P{ ", " S{P{P{P{P{7] P{P{P{P{ P{P{P{P{7]S{7]P{P{P{P{P{ n]P{P{P{P{P{P{ P{,]K$J$']o]P{P{P{P{P{P{P{P{P{P{i] P{P{/](]_]p]P{P{P{P{P{P{q]a]b]l]r]P{S{ ", " 7]P{P{P{P{P{P{P{ P{P{P{P{P{P{ R{P{P{P{P{P{P{P{P{P{P{P{P{P{ P{P{P{P{P{P{P{P{ P{,]K$J$']s]P{S{ P{P{/](]_]p]P{P{ P{t]a]b]l]u]P{P{ ", " 7]P{v]w]x]y]z]P{ P{P{A]B]C]D]P{7] P{E]F]G]H]z]P{P{I]J]K]L]M]P{P{ S{P{N]O]P]Q]R]P{P{ P{,]K$J$']s]P{P{ P{P{/](]_]p]P{P{ P{S]a]b]l]T]P{S{ ", " P{U]V]W]X]Y]P{ P{Z]`] ^.^+^P{P{ S{P{@^#^$^%^P{P{P{P{&^N*}**^=^P{7] P{T{-^;^t%>^T{P{ P{,]K$J$']s]P{P{S{S{S{S{S{S{S{ P{P{/](]_]p]P{P{ S{P{*]a]b],^'^P{ ", " P{Q{)^W]X]!^P{ P{~^{^ ^.^]^^^P{ 7]P{/^#^$^(^P{n] P{i]_^}*A&:^<^7]P{P{[^}^;^|^1^P{ P{,]K$J$']2^<^P{P{P{P{P{P{P{P{P{ P{P{/](]_]3^i]P{P{P{P{4^5^a]6^7^P{7] ", " S{P{8^W]X]9^P{S{ S{P{0^{^ ^.^]^a^P{ 7]z]b^#^$^c^P{ P{d^e^A&P-f^P{P{N]g^}^;^h^P{7] P{,]K$J$'])]i^j^k^l^m^n^o^p^q^P{ P{P{/](]_]:]r^s^t^u^v^w^3]x^y^P{P{ ", " P{z^W]X]A^P{P{ P{P{B^{^C^D^]^E^P{S{ P{F^G^#^H^P{7] R{P{I^A&P-J^K^L^M^v%}^N^P{O{ P{,]K$J$'])]J*8$/$3&!]~]{]]]O^P{ P{P{/](]_]:]<][]}]|]1]2]3]Z.P^P{P{n] ", " P{Q^W]X]R^S^P{ P{^^T^U^P{V^]^W^Q{P{ P{X^G^#^Y^P{S{ P{P{Z^P-`^`^ /.&v%./+/7] P{,]K$J$'])]@/#/$/%/&/*/=/-/;/P{ P{P{/](]_]:]>/,/'/)/!/w^3]a],^~/{/P{7] ", " P{P{]/X]R^^/P{P{P{//T^(/P{i]_/:/G^y/P{7] n]P{z/`^2/+&.&A/P{P{ P{,]K$J$']s]P{P{ P{P{/](]_]p]P{P{ P{P{B/l]o/C/D/P{ ", " 7]R{E/R^F/G/P{H/I/J/P{P{P{K/:/L/L^P{M/N>G^N/P{n] P{O/P/`^2/+&.&v%Q/P{P{ P{,]K$J$']s]P{P{ P{P{/](]_]p]P{P{ n]P{R/l]o/C/S/P{ ", " n]P{T/R^F/U/P{V/I/W/P{ P{P{X/Y/Z/P{`/N>G^ (P{ O{P{.(P-`^+(@(.&v%#($(P{R{ P{,]K$J$']s]P{P{ P{P{/](]_]p]P{P{ P{P{%(l]o/C/&(P{ ", " P{*(R^F/=(-(;(I/>(P{ 7]P{,(Y/'()(!(N>~(P{P{ P{P{{(A&P-](^(P{/(v%}^((_(P{ P{,]K$J$']s]P{P{ P{P{/](]_]p]P{P{P{R{R{P{P{:(<(l]o/[(}(R{ ", " P{|(1(F/2(3(4(5(P{P{ P{6(Y/7(B,|,N>8(P{S{ S{P{9(0(A&P-a(P{P{b(3/}^;^c(P{P{ P{,]K$J$']s]P{P{ P{P{/](]_]m d(P{P{P{P{+/e((.b]l]o/f(P{S{ ", " P{P{g(F/2(3(4(h(P{7] P{i(]^7(B,|,N>j(P{ P{k(l(}*A&m(P{P{S{P{n(}^;^t%o(P{R{ P{,]K$J$']s]P{P{ P{P{/](]_]:]p(q(r(s(t(e 3]a]b]l]u(P{P{ ", " n]P{v(F/2(3(4(w(P{ P{P{x(7(B,|,y(z(P{ P{P{K]N*}*A(B(P{ P{P{C(;^t%D(E(P{ P{,]K$J$']s]P{P{ P{P{/](]_]:]<][]}]|]1]2]3]a]F(G(P{P{ ", " P{H(I(J(K(K(z(P{ S{P{L(M(N(O(P(P{7] P{P{d^Q(R(S(T(P{R{ P{U(V(W(X(Y(P{O{ P{i(Z(`( _._P{P{ P{P{+_@_#_$_%_%_&_*_=_-_;_D/P{P{7] ", " P{P{P{P{P{P{P{P{ P{P{P{P{P{P{P{ P{P{P{P{P{P{P{7] S{P{P{P{P{P{P{P{P{P{P{P{P{P{P{P{R{ S{P{P{P{P{P{P{P{P{P{P{P{P{P{R{ ", " ", " ", " ", " ", " "}; wxformbuilder-3.1.59/plugins/additional/additional.cpp0000644000175000017500000011307411143440026023362 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #if wxCHECK_VERSION( 2, 8, 0 ) #include #include "logo.xpm" #include "smiley.xpm" #include #include #include #include #endif /////////////////////////////////////////////////////////////////////////////// /** Event handler for events generated by controls in this plugin */ class ComponentEvtHandler : public wxEvtHandler { private: wxWindow* m_window; IManager* m_manager; public: ComponentEvtHandler( wxWindow* win, IManager* manager ) : m_window( win ), m_manager( manager ) { } protected: void OnGridClick( wxGridEvent& event ); void OnGridColSize( wxGridSizeEvent& event ); void OnGridRowSize( wxGridSizeEvent& event ); #if wxCHECK_VERSION( 2, 8, 0 ) void OnColourPickerColourChanged( wxColourPickerEvent& event ); void OnFontPickerFontChanged( wxFontPickerEvent& event ); void OnFilePickerFileChanged( wxFileDirPickerEvent& event ); void OnDirPickerDirChanged( wxFileDirPickerEvent& event ); #endif void OnGenericDirCtrlExpandItem( wxTreeEvent& event ); DECLARE_EVENT_TABLE() }; BEGIN_EVENT_TABLE( ComponentEvtHandler, wxEvtHandler ) #if wxCHECK_VERSION( 2, 8, 0 ) EVT_COLOURPICKER_CHANGED( -1, ComponentEvtHandler::OnColourPickerColourChanged ) EVT_FONTPICKER_CHANGED( -1, ComponentEvtHandler::OnFontPickerFontChanged ) EVT_FILEPICKER_CHANGED( -1, ComponentEvtHandler::OnFilePickerFileChanged ) EVT_DIRPICKER_CHANGED( -1, ComponentEvtHandler::OnDirPickerDirChanged ) #endif // Grid also seems to ignore clicks EVT_GRID_CELL_LEFT_CLICK( ComponentEvtHandler::OnGridClick ) EVT_GRID_LABEL_LEFT_CLICK( ComponentEvtHandler::OnGridClick ) EVT_GRID_COL_SIZE( ComponentEvtHandler::OnGridColSize ) EVT_GRID_ROW_SIZE( ComponentEvtHandler::OnGridRowSize ) END_EVENT_TABLE() /** Event handler for events generated by wxGenericDirCtrl. */ class GenericDirCtrlEvtHandler : public wxEvtHandler { public: GenericDirCtrlEvtHandler( wxWindow* win, IManager* manager ) : m_window( win ), m_manager( manager ) { } protected: void OnGenericDirCtrlLeftClick( wxMouseEvent& event ); DECLARE_EVENT_TABLE() private: wxWindow* m_window; IManager* m_manager; }; BEGIN_EVENT_TABLE( GenericDirCtrlEvtHandler, wxEvtHandler ) // GenericDirCtrl also seems to ignore clicks EVT_LEFT_DOWN( GenericDirCtrlEvtHandler::OnGenericDirCtrlLeftClick ) END_EVENT_TABLE() /////////////////////////////////////////////////////////////////////////////// class CalendarCtrlComponent : public ComponentBase { public: wxObject* Create(IObject *obj, wxObject *parent) { return new wxCalendarCtrl((wxWindow *)parent,-1, wxDefaultDateTime, obj->GetPropertyAsPoint(_("pos")), obj->GetPropertyAsSize(_("size")), obj->GetPropertyAsInteger(_("style")) | obj->GetPropertyAsInteger(_("window_style"))); } ticpp::Element* ExportToXrc(IObject *obj) { ObjectToXrcFilter xrc(obj, _("wxCalendarCtrl"), obj->GetPropertyAsString(_("name"))); xrc.AddWindowProperties(); return xrc.GetXrcObject(); } ticpp::Element* ImportFromXrc( ticpp::Element* xrcObj ) { XrcToXfbFilter filter(xrcObj, _("wxCalendarCtrl")); filter.AddWindowProperties(); return filter.GetXfbObject(); } }; class DatePickerCtrlComponent : public ComponentBase { public: wxObject* Create(IObject *obj, wxObject *parent) { return new wxDatePickerCtrl((wxWindow *)parent,-1, wxDefaultDateTime, obj->GetPropertyAsPoint(_("pos")), obj->GetPropertyAsSize(_("size")), obj->GetPropertyAsInteger(_("style")) | obj->GetPropertyAsInteger(_("window_style"))); } ticpp::Element* ExportToXrc(IObject *obj) { ObjectToXrcFilter xrc(obj, _("wxDatePickerCtrl"), obj->GetPropertyAsString(_("name"))); xrc.AddWindowProperties(); return xrc.GetXrcObject(); } ticpp::Element* ImportFromXrc( ticpp::Element* xrcObj ) { XrcToXfbFilter filter(xrcObj, _("wxDatePickerCtrl")); filter.AddWindowProperties(); return filter.GetXfbObject(); } }; class RichTextCtrlComponent : public ComponentBase { public: wxObject* Create( IObject* obj, wxObject* parent ) { wxRichTextCtrl* richText = new wxRichTextCtrl( (wxWindow*)parent, wxID_ANY, wxEmptyString, obj->GetPropertyAsPoint(_("pos")), obj->GetPropertyAsSize(_("size")), obj->GetPropertyAsInteger(_("style")) | obj->GetPropertyAsInteger(_("window_style"))); wxFont textFont = wxFont(12, wxROMAN, wxNORMAL, wxNORMAL); wxFont boldFont = wxFont(12, wxROMAN, wxNORMAL, wxBOLD); wxFont italicFont = wxFont(12, wxROMAN, wxITALIC, wxNORMAL); wxFont font(12, wxROMAN, wxNORMAL, wxNORMAL); wxRichTextCtrl& r = *richText; r.SetFont(font); r.BeginSuppressUndo(); r.BeginParagraphSpacing(0, 20); r.BeginAlignment(wxTEXT_ALIGNMENT_CENTRE); r.BeginBold(); r.BeginFontSize(14); r.WriteText(wxT("Welcome to wxRichTextCtrl, a wxWidgets control for editing and presenting styled text and images")); r.EndFontSize(); r.Newline(); r.BeginItalic(); r.WriteText(wxT("by Julian Smart")); r.EndItalic(); r.EndBold(); r.Newline(); r.WriteImage(wxBitmap(logo_xpm)); r.EndAlignment(); r.Newline(); r.WriteText(wxT("What can you do with this thing? ")); r.WriteImage(wxBitmap(smiley_xpm)); r.WriteText(wxT(" Well, you can change text ")); r.BeginTextColour(wxColour(255, 0, 0)); r.WriteText(wxT("colour, like this red bit.")); r.EndTextColour(); r.BeginTextColour(wxColour(0, 0, 255)); r.WriteText(wxT(" And this blue bit.")); r.EndTextColour(); r.WriteText(wxT(" Naturally you can make things ")); r.BeginBold(); r.WriteText(wxT("bold ")); r.EndBold(); r.BeginItalic(); r.WriteText(wxT("or italic ")); r.EndItalic(); r.BeginUnderline(); r.WriteText(wxT("or underlined.")); r.EndUnderline(); r.BeginFontSize(14); r.WriteText(wxT(" Different font sizes on the same line is allowed, too.")); r.EndFontSize(); r.WriteText(wxT(" Next we'll show an indented paragraph.")); r.BeginLeftIndent(60); r.Newline(); r.WriteText(wxT("Indented paragraph.")); r.EndLeftIndent(); r.Newline(); r.WriteText(wxT("Next, we'll show a first-line indent, achieved using BeginLeftIndent(100, -40).")); r.BeginLeftIndent(100, -40); r.Newline(); r.WriteText(wxT("It was in January, the most down-trodden month of an Edinburgh winter.")); r.EndLeftIndent(); r.Newline(); r.WriteText(wxT("Numbered bullets are possible, again using subindents:")); r.BeginNumberedBullet(1, 100, 60); r.Newline(); r.WriteText(wxT("This is my first item. Note that wxRichTextCtrl doesn't automatically do numbering, but this will be added later.")); r.EndNumberedBullet(); r.BeginNumberedBullet(2, 100, 60); r.Newline(); r.WriteText(wxT("This is my second item.")); r.EndNumberedBullet(); r.Newline(); r.WriteText(wxT("The following paragraph is right-indented:")); r.BeginRightIndent(200); r.Newline(); r.WriteText(wxT("It was in January, the most down-trodden month of an Edinburgh winter. An attractive woman came into the cafe, which is nothing remarkable.")); r.EndRightIndent(); r.Newline(); wxArrayInt tabs; tabs.Add(400); tabs.Add(600); tabs.Add(800); tabs.Add(1000); wxTextAttrEx attr; attr.SetFlags(wxTEXT_ATTR_TABS); attr.SetTabs(tabs); r.SetDefaultStyle(attr); r.WriteText(wxT("This line contains tabs:\tFirst tab\tSecond tab\tThird tab")); r.Newline(); r.WriteText(wxT("Other notable features of wxRichTextCtrl include:")); r.BeginSymbolBullet(wxT('*'), 100, 60); r.Newline(); r.WriteText(wxT("Compatibility with wxTextCtrl API")); r.EndSymbolBullet(); r.WriteText(wxT("\nNote: this content was generated programmatically and copied from the sample. The images were loaded from inline XPMs. Enjoy wxRichTextCtrl!")); r.EndSuppressUndo(); return richText; } ticpp::Element* ExportToXrc(IObject *obj) { ObjectToXrcFilter xrc(obj, _("unknown"), obj->GetPropertyAsString(_("name"))); //xrc.AddWindowProperties(); return xrc.GetXrcObject(); } ticpp::Element* ImportFromXrc( ticpp::Element* xrcObj ) { XrcToXfbFilter filter(xrcObj, _("wxRichTextCtrl")); filter.AddWindowProperties(); return filter.GetXfbObject(); } }; class HtmlWindowComponent : public ComponentBase { public: wxObject* Create(IObject *obj, wxObject *parent) { wxHtmlWindow *hw = new wxHtmlWindow((wxWindow *)parent,-1, obj->GetPropertyAsPoint(_("pos")), obj->GetPropertyAsSize(_("size")), obj->GetPropertyAsInteger(_("style")) | obj->GetPropertyAsInteger(_("window_style"))); wxString dummy_page( wxT("wxHtmlWindow
") wxT("This is a dummy page.")); hw->SetPage(dummy_page); return hw; } ticpp::Element* ExportToXrc(IObject *obj) { ObjectToXrcFilter xrc(obj, _("wxHtmlWindow"), obj->GetPropertyAsString(_("name"))); xrc.AddWindowProperties(); return xrc.GetXrcObject(); } ticpp::Element* ImportFromXrc( ticpp::Element* xrcObj ) { XrcToXfbFilter filter(xrcObj, _("wxHtmlWindow")); filter.AddWindowProperties(); return filter.GetXfbObject(); } }; class ToggleButtonComponent : public ComponentBase, public wxEvtHandler { public: wxObject* Create(IObject *obj, wxObject *parent) { wxToggleButton* window = new wxToggleButton((wxWindow *)parent,-1, obj->GetPropertyAsString(_("label")), obj->GetPropertyAsPoint(_("pos")), obj->GetPropertyAsSize(_("size")), obj->GetPropertyAsInteger(_("window_style"))); window->SetValue( ( obj->GetPropertyAsInteger(_("value")) != 0 ) ); window->Connect( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler( ToggleButtonComponent::OnToggle ), NULL, this ); return window; } void OnToggle( wxCommandEvent& event ) { wxToggleButton* window = dynamic_cast< wxToggleButton* >( event.GetEventObject() ); if ( 0 != window ) { wxString value; value.Printf( wxT("%i"), window->GetValue() ? 1 : 0 ); GetManager()->ModifyProperty( window, _("value"), value ); window->SetFocus(); } } void Cleanup( wxObject* obj ) { wxToggleButton* window = dynamic_cast< wxToggleButton* >( obj ); if ( 0 != window ) { window->Disconnect( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler( ToggleButtonComponent::OnToggle ), NULL, this ); } ComponentBase::Cleanup( obj ); } ticpp::Element* ExportToXrc(IObject *obj) { ObjectToXrcFilter xrc(obj, _("wxToggleButton"), obj->GetPropertyAsString(_("name"))); xrc.AddWindowProperties(); xrc.AddProperty(_("label"),_("label"), XRC_TYPE_TEXT); xrc.AddProperty(_("value"),_("checked"), XRC_TYPE_BOOL); return xrc.GetXrcObject(); } ticpp::Element* ImportFromXrc( ticpp::Element* xrcObj ) { XrcToXfbFilter filter(xrcObj, _("wxToggleButton")); filter.AddWindowProperties(); filter.AddProperty(_("label"),_("label"), XRC_TYPE_TEXT); filter.AddProperty(_("checked"),_("value"), XRC_TYPE_BOOL); return filter.GetXfbObject(); } }; class TreeCtrlComponent : public ComponentBase { public: wxObject* Create(IObject *obj, wxObject *parent) { int style = obj->GetPropertyAsInteger(_("style")); wxTreeCtrl *tc = new wxTreeCtrl((wxWindow *)parent,-1, obj->GetPropertyAsPoint(_("pos")), obj->GetPropertyAsSize(_("size")), style | obj->GetPropertyAsInteger(_("window_style"))); // dummy nodes wxTreeItemId root = tc->AddRoot(wxT("root node")); wxTreeItemId node1 = tc->AppendItem(root,wxT("node1")); wxTreeItemId node2 = tc->AppendItem(root,wxT("node2")); wxTreeItemId node3 = tc->AppendItem(node2,wxT("node3")); if ( ( style & wxTR_HIDE_ROOT ) == 0 ) { tc->Expand(root); } tc->Expand(node1); tc->Expand(node2); tc->Expand(node3); return tc; } ticpp::Element* ExportToXrc(IObject *obj) { ObjectToXrcFilter xrc(obj, _("wxTreeCtrl"), obj->GetPropertyAsString(_("name"))); xrc.AddWindowProperties(); return xrc.GetXrcObject(); } ticpp::Element* ImportFromXrc( ticpp::Element* xrcObj ) { XrcToXfbFilter filter(xrcObj, _("wxTreeCtrl")); filter.AddWindowProperties(); return filter.GetXfbObject(); } }; class ScrollBarComponent : public ComponentBase { public: wxObject* Create(IObject *obj, wxObject *parent) { wxScrollBar *sb = new wxScrollBar((wxWindow *)parent,-1, obj->GetPropertyAsPoint(_("pos")), obj->GetPropertyAsSize(_("size")), obj->GetPropertyAsInteger(_("style")) | obj->GetPropertyAsInteger(_("window_style"))); sb->SetScrollbar(obj->GetPropertyAsInteger(_T("value")), obj->GetPropertyAsInteger(_T("thumbsize")), obj->GetPropertyAsInteger(_T("range")), obj->GetPropertyAsInteger(_T("pagesize"))); return sb; } ticpp::Element* ExportToXrc(IObject *obj) { ObjectToXrcFilter xrc(obj, _("wxScrollBar"), obj->GetPropertyAsString(_("name"))); xrc.AddWindowProperties(); xrc.AddProperty(_("value"), _("value"), XRC_TYPE_INTEGER); xrc.AddProperty(_("thumbsize"), _("thumbsize"), XRC_TYPE_INTEGER); xrc.AddProperty(_("range"), _("range"), XRC_TYPE_INTEGER); xrc.AddProperty(_("pagesize"), _("pagesize"), XRC_TYPE_INTEGER); return xrc.GetXrcObject(); } ticpp::Element* ImportFromXrc( ticpp::Element* xrcObj ) { XrcToXfbFilter filter(xrcObj, _("wxScrollBar")); filter.AddWindowProperties(); filter.AddProperty(_("value"), _("value"), XRC_TYPE_INTEGER); filter.AddProperty(_("thumbsize"), _("thumbsize"), XRC_TYPE_INTEGER); filter.AddProperty(_("range"), _("range"), XRC_TYPE_INTEGER); filter.AddProperty(_("pagesize"), _("pagesize"), XRC_TYPE_INTEGER); return filter.GetXfbObject(); } }; class SpinCtrlComponent : public ComponentBase, public wxEvtHandler { public: wxObject* Create(IObject *obj, wxObject *parent) { wxSpinCtrl* window = new wxSpinCtrl((wxWindow *)parent,-1, obj->GetPropertyAsString(_("value")), obj->GetPropertyAsPoint(_("pos")), obj->GetPropertyAsSize(_("size")), obj->GetPropertyAsInteger(_("style")) | obj->GetPropertyAsInteger(_("window_style")), obj->GetPropertyAsInteger(_("min")), obj->GetPropertyAsInteger(_("max")), obj->GetPropertyAsInteger(_("initial"))); window->Connect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( SpinCtrlComponent::OnSpin ), NULL, this ); return window; } void OnSpin( wxSpinEvent& event ) { wxSpinCtrl* window = dynamic_cast< wxSpinCtrl* >( event.GetEventObject() ); if ( 0 != window ) { wxString value; value.Printf( wxT("%i"), window->GetValue() ); GetManager()->ModifyProperty( window, _("initial"), value ); window->SetFocus(); } } void Cleanup( wxObject* obj ) { wxSpinCtrl* window = dynamic_cast< wxSpinCtrl* >( obj ); if ( 0 != window ) { window->Disconnect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( SpinCtrlComponent::OnSpin ), NULL, this ); } ComponentBase::Cleanup( obj ); } ticpp::Element* ExportToXrc(IObject *obj) { ObjectToXrcFilter xrc(obj, _("wxSpinCtrl"), obj->GetPropertyAsString(_("name"))); xrc.AddWindowProperties(); xrc.AddProperty(_("initial"),_("value"), XRC_TYPE_TEXT); xrc.AddProperty(_("min"),_("min"), XRC_TYPE_INTEGER); xrc.AddProperty(_("max"),_("max"), XRC_TYPE_INTEGER); return xrc.GetXrcObject(); } ticpp::Element* ImportFromXrc( ticpp::Element* xrcObj ) { XrcToXfbFilter filter(xrcObj, _("wxSpinCtrl")); filter.AddWindowProperties(); filter.AddProperty(_("value"),_("value"), XRC_TYPE_TEXT); filter.AddProperty(_("value"),_("initial"), XRC_TYPE_TEXT); filter.AddProperty(_("min"),_("min"), XRC_TYPE_INTEGER); filter.AddProperty(_("max"),_("max"), XRC_TYPE_INTEGER); return filter.GetXfbObject(); } }; class SpinButtonComponent : public ComponentBase { public: wxObject* Create(IObject *obj, wxObject *parent) { return new wxSpinButton((wxWindow *)parent,-1, obj->GetPropertyAsPoint(_("pos")), obj->GetPropertyAsSize(_("size")), obj->GetPropertyAsInteger(_("style")) | obj->GetPropertyAsInteger(_("window_style"))); } ticpp::Element* ExportToXrc(IObject *obj) { ObjectToXrcFilter xrc(obj, _("wxSpinButton"), obj->GetPropertyAsString(_("name"))); xrc.AddWindowProperties(); return xrc.GetXrcObject(); } ticpp::Element* ImportFromXrc( ticpp::Element* xrcObj ) { XrcToXfbFilter filter(xrcObj, _("wxSpinButton")); filter.AddWindowProperties(); return filter.GetXfbObject(); } }; class CheckListBoxComponent : public ComponentBase { public: wxObject* Create(IObject *obj, wxObject *parent) { wxArrayString choices (obj->GetPropertyAsArrayString(_("choices"))); wxCheckListBox *cl = new wxCheckListBox((wxWindow *)parent,-1, obj->GetPropertyAsPoint(_("pos")), obj->GetPropertyAsSize(_("size")), choices, obj->GetPropertyAsInteger(_("style")) | obj->GetPropertyAsInteger(_("window_style"))); return cl; } ticpp::Element* ExportToXrc(IObject *obj) { ObjectToXrcFilter xrc(obj, _("wxCheckListBox"), obj->GetPropertyAsString(_("name"))); xrc.AddWindowProperties(); xrc.AddProperty(_("choices"), _("content"), XRC_TYPE_STRINGLIST); return xrc.GetXrcObject(); } ticpp::Element* ImportFromXrc( ticpp::Element* xrcObj ) { XrcToXfbFilter filter(xrcObj, _("wxCheckListBox")); filter.AddWindowProperties(); filter.AddProperty(_("content"), _("choices"), XRC_TYPE_STRINGLIST); return filter.GetXfbObject(); } }; class GridComponent : public ComponentBase { public: wxObject* Create(IObject *obj, wxObject *parent) { wxGrid *grid = new wxGrid((wxWindow *)parent,-1, obj->GetPropertyAsPoint(_("pos")), obj->GetPropertyAsSize(_("size")), obj->GetPropertyAsInteger(_("window_style"))); grid->CreateGrid( obj->GetPropertyAsInteger(_("rows")), obj->GetPropertyAsInteger(_("cols"))); grid->EnableDragColMove( obj->GetPropertyAsInteger( _("drag_col_move") ) != 0 ); grid->EnableDragColSize( obj->GetPropertyAsInteger( _("drag_col_size") ) != 0 ); grid->EnableDragGridSize( obj->GetPropertyAsInteger( _("drag_grid_size") ) != 0 ); grid->EnableDragRowSize( obj->GetPropertyAsInteger( _("drag_row_size") ) != 0 ); grid->EnableEditing( obj->GetPropertyAsInteger( _("editing") ) != 0 ); grid->EnableGridLines( obj->GetPropertyAsInteger( _("grid_lines") ) != 0 ); if ( !obj->IsNull( _("grid_line_color") ) ) { grid->SetGridLineColour( obj->GetPropertyAsColour( _("grid_line_color") ) ); } grid->SetMargins( obj->GetPropertyAsInteger( _("margin_width") ), obj->GetPropertyAsInteger( _("margin_height") ) ); // Label Properties grid->SetColLabelAlignment( obj->GetPropertyAsInteger( _("col_label_horiz_alignment") ), obj->GetPropertyAsInteger( _("col_label_vert_alignment") ) ); grid->SetColLabelSize( obj->GetPropertyAsInteger( _("col_label_size") ) ); wxArrayString columnLabels = obj->GetPropertyAsArrayString( _("col_label_values") ); for ( int i = 0; i < (int)columnLabels.size() && i < grid->GetNumberCols(); ++i ) { grid->SetColLabelValue( i, columnLabels[i] ); } wxArrayInt columnSizes = obj->GetPropertyAsArrayInt( _("column_sizes") ); for ( int i = 0; i < (int)columnSizes.size() && i < grid->GetNumberCols(); ++i ) { grid->SetColSize( i, columnSizes[i] ); } grid->SetRowLabelAlignment( obj->GetPropertyAsInteger( _("row_label_horiz_alignment") ), obj->GetPropertyAsInteger( _("row_label_vert_alignment") ) ); grid->SetRowLabelSize( obj->GetPropertyAsInteger( _("row_label_size") ) ); wxArrayString rowLabels = obj->GetPropertyAsArrayString( _("row_label_values") ); for ( int i = 0; i < (int)rowLabels.size() && i < grid->GetNumberRows(); ++i ) { grid->SetRowLabelValue( i, rowLabels[i] ); } wxArrayInt rowSizes = obj->GetPropertyAsArrayInt( _("row_sizes") ); for ( int i = 0; i < (int)rowSizes.size() && i < grid->GetNumberRows(); ++i ) { grid->SetRowSize( i, rowSizes[i] ); } if ( !obj->IsNull( _("label_bg") ) ) { grid->SetLabelBackgroundColour( obj->GetPropertyAsColour( _("label_bg") ) ); } if ( !obj->IsNull( _("label_text") ) ) { grid->SetLabelTextColour( obj->GetPropertyAsColour( _("label_text") ) ); } if ( !obj->IsNull( _("label_font") ) ) { grid->SetLabelFont( obj->GetPropertyAsFont( _("label_font") ) ); } // Default Cell Properties grid->SetDefaultCellAlignment( obj->GetPropertyAsInteger( _("cell_horiz_alignment") ), obj->GetPropertyAsInteger( _("cell_vert_alignment") ) ); if ( !obj->IsNull( _("cell_bg") ) ) { grid->SetDefaultCellBackgroundColour( obj->GetPropertyAsColour( _("cell_bg") ) ); } if ( !obj->IsNull( _("cell_text") ) ) { grid->SetDefaultCellTextColour( obj->GetPropertyAsColour( _("cell_text") ) ); } if ( !obj->IsNull( _("cell_font") ) ) { grid->SetDefaultCellFont( obj->GetPropertyAsFont( _("cell_font") ) ); } // Example Cell Values for ( int col = 0; col < grid->GetNumberCols(); ++col ) { for ( int row = 0; row < grid->GetNumberRows(); ++row ) { grid->SetCellValue( row, col, grid->GetColLabelValue( col ) + wxT("-") + grid->GetRowLabelValue( row ) ); } } if ( obj->GetPropertyAsInteger( _("autosize_rows") ) != 0 ) { grid->AutoSizeRows(); } if ( obj->GetPropertyAsInteger( _("autosize_cols") ) != 0 ) { grid->AutoSizeColumns(); } grid->PushEventHandler( new ComponentEvtHandler( grid, GetManager() ) ); return grid; } ticpp::Element* ExportToXrc(IObject *obj) { ObjectToXrcFilter xrc(obj, _("wxGrid"), obj->GetPropertyAsString(_("name"))); xrc.AddWindowProperties(); return xrc.GetXrcObject(); } ticpp::Element* ImportFromXrc( ticpp::Element* xrcObj ) { XrcToXfbFilter filter(xrcObj, _("wxGrid")); filter.AddWindowProperties(); return filter.GetXfbObject(); } }; void ComponentEvtHandler::OnGridClick( wxGridEvent& event ) { m_manager->SelectObject( m_window ); event.Skip(); } void ComponentEvtHandler::OnGridColSize( wxGridSizeEvent& ) { wxGrid* grid = wxDynamicCast( m_window, wxGrid ); if ( NULL == grid ) { return; } wxString sizes; for ( int i = 0; i < grid->GetNumberCols(); ++i ) { sizes += wxString::Format( wxT("%i,"), grid->GetColSize( i ) ); } sizes = sizes.substr( 0, sizes.length() - 1 ); m_manager->ModifyProperty( m_window, _("column_sizes"), sizes, true ); } void ComponentEvtHandler::OnGridRowSize( wxGridSizeEvent& ) { wxGrid* grid = wxDynamicCast( m_window, wxGrid ); if ( NULL == grid ) { return; } wxString sizes; for ( int i = 0; i < grid->GetNumberRows(); ++i ) { sizes += wxString::Format( wxT("%i,"), grid->GetRowSize( i ) ); } sizes = sizes.substr( 0, sizes.length() - 1 ); m_manager->ModifyProperty( m_window, _("row_sizes"), sizes, true ); } #if wxCHECK_VERSION( 2, 8, 0 ) class PickerComponentBase : public ComponentBase, public wxEvtHandler { public: void OnLeftClick( wxMouseEvent& event ) { wxWindow* window = dynamic_cast< wxWindow* >( event.GetEventObject() ); wxPickerBase* picker = dynamic_cast< wxPickerBase* >( window->GetParent() ); if ( 0 != picker ) { if ( !GetManager()->SelectObject( picker ) ) { event.Skip(); } } } void OnCreated( wxObject* wxobject, wxWindow* /*wxparent*/ ) { wxPickerBase* picker = dynamic_cast< wxPickerBase* >( wxobject ); if ( picker != 0 ) { picker->GetPickerCtrl()->Connect( wxEVT_LEFT_DOWN, wxMouseEventHandler( PickerComponentBase::OnLeftClick ), NULL, this ); wxTextCtrl* text = picker->GetTextCtrl(); if ( 0 != text ) { text->Connect( wxEVT_LEFT_DOWN, wxMouseEventHandler( PickerComponentBase::OnLeftClick ), NULL, this ); } } } void Cleanup( wxObject* obj ) { wxPickerBase* picker = dynamic_cast< wxPickerBase* >( obj ); if ( picker != 0 ) { picker->GetPickerCtrl()->Disconnect( wxEVT_LEFT_DOWN, wxMouseEventHandler( PickerComponentBase::OnLeftClick ), NULL, this ); wxTextCtrl* text = picker->GetTextCtrl(); if ( 0 != text ) { text->Disconnect( wxEVT_LEFT_DOWN, wxMouseEventHandler( PickerComponentBase::OnLeftClick ), NULL, this ); } } ComponentBase::Cleanup( obj ); } }; class ColourPickerComponent : public PickerComponentBase { private: public: wxObject* Create(IObject *obj, wxObject *parent) { wxColourPickerCtrl* colourpicker = new wxColourPickerCtrl( (wxWindow*)parent, obj->GetPropertyAsInteger(_("id")), obj->GetPropertyAsColour(_("colour")), obj->GetPropertyAsPoint(_("pos")), obj->GetPropertyAsSize(_("size")), obj->GetPropertyAsInteger(_("style")) | obj->GetPropertyAsInteger(_("window_style")) ); colourpicker->PushEventHandler( new ComponentEvtHandler( colourpicker, GetManager() ) ); return colourpicker; } ticpp::Element* ExportToXrc(IObject *obj) { ObjectToXrcFilter xrc(obj, _("wxColourPickerCtrl"), obj->GetPropertyAsString(_("name"))); xrc.AddProperty(_("colour"),_("value"),XRC_TYPE_COLOUR); xrc.AddWindowProperties(); return xrc.GetXrcObject(); } ticpp::Element* ImportFromXrc( ticpp::Element* xrcObj ) { XrcToXfbFilter filter(xrcObj, _("wxColourPickerCtrl")); filter.AddProperty(_("value"),_("colour"),XRC_TYPE_COLOUR); filter.AddWindowProperties(); return filter.GetXfbObject(); } }; void ComponentEvtHandler::OnColourPickerColourChanged( wxColourPickerEvent& ) { wxColourPickerCtrl* window = wxDynamicCast( m_window, wxColourPickerCtrl ); if ( window != NULL ) { wxColour colour = window->GetColour(); m_manager->ModifyProperty( window, _("colour"), wxString::Format(wxT("%d,%d,%d"),colour.Red(),colour.Green(),colour.Blue()) ); } } class FontPickerComponent : public PickerComponentBase { public: wxObject* Create(IObject *obj, wxObject *parent) { wxFontPickerCtrl* picker = new wxFontPickerCtrl( (wxWindow*)parent, obj->GetPropertyAsInteger(_("id")), obj->GetPropertyAsFont(_("value")), obj->GetPropertyAsPoint(_("pos")), obj->GetPropertyAsSize(_("size")), obj->GetPropertyAsInteger(_("style")) | obj->GetPropertyAsInteger(_("window_style")) ); if ( !obj->IsNull( _("max_point_size") ) ) { picker->SetMaxPointSize( obj->GetPropertyAsInteger( _("max_point_size") ) ); } picker->PushEventHandler( new ComponentEvtHandler( picker, GetManager() ) ); return picker; } ticpp::Element* ExportToXrc(IObject *obj) { ObjectToXrcFilter xrc(obj, _("wxFontPickerCtrl"), obj->GetPropertyAsString(_("name"))); if ( !obj->IsNull( _("value") ) ) { xrc.AddProperty(_("value"),_("value"),XRC_TYPE_FONT); } xrc.AddWindowProperties(); return xrc.GetXrcObject(); } ticpp::Element* ImportFromXrc( ticpp::Element* xrcObj ) { XrcToXfbFilter filter(xrcObj, _("wxFontPickerCtrl")); filter.AddProperty(_("value"),_("value"),XRC_TYPE_FONT); filter.AddWindowProperties(); return filter.GetXfbObject(); } }; void ComponentEvtHandler::OnFontPickerFontChanged( wxFontPickerEvent& ) { wxFontPickerCtrl* window = wxDynamicCast( m_window, wxFontPickerCtrl ); if ( window != NULL ) { wxFont font = window->GetSelectedFont(); m_manager->ModifyProperty( window, _("value"), wxString::Format( wxT("%s,%d,%d,%d"), font.GetFaceName().c_str(), font.GetStyle(), font.GetWeight(), font.GetPointSize() ) ); } } class FilePickerComponent : public PickerComponentBase { public: wxObject* Create(IObject *obj, wxObject *parent) { wxFilePickerCtrl* picker = new wxFilePickerCtrl( (wxWindow*)parent, obj->GetPropertyAsInteger(_("id")), obj->GetPropertyAsString(_("value")), obj->GetPropertyAsString(_("message")), obj->GetPropertyAsString(_("wildcard")), obj->GetPropertyAsPoint(_("pos")), obj->GetPropertyAsSize(_("size")), obj->GetPropertyAsInteger(_("style")) | obj->GetPropertyAsInteger(_("window_style")) ); picker->PushEventHandler( new ComponentEvtHandler( picker, GetManager() ) ); return picker; } ticpp::Element* ExportToXrc(IObject *obj) { ObjectToXrcFilter xrc(obj, _("wxFilePickerCtrl"), obj->GetPropertyAsString(_("name"))); xrc.AddProperty(_("value"),_("value"),XRC_TYPE_TEXT); xrc.AddProperty(_("message"),_("message"),XRC_TYPE_TEXT); xrc.AddProperty(_("wildcard"),_("wildcard"),XRC_TYPE_TEXT); xrc.AddWindowProperties(); return xrc.GetXrcObject(); } ticpp::Element* ImportFromXrc( ticpp::Element* xrcObj ) { XrcToXfbFilter filter(xrcObj, _("wxFilePickerCtrl")); filter.AddProperty(_("value"),_("value"),XRC_TYPE_FONT); filter.AddProperty(_("message"),_("message"),XRC_TYPE_TEXT); filter.AddProperty(_("wildcard"),_("wildcard"),XRC_TYPE_TEXT); filter.AddWindowProperties(); return filter.GetXfbObject(); } }; void ComponentEvtHandler::OnFilePickerFileChanged( wxFileDirPickerEvent& ) { wxFilePickerCtrl* window = wxDynamicCast( m_window, wxFilePickerCtrl ); if ( window != NULL ) { m_manager->ModifyProperty( window, _("value"), window->GetPath() ); } } class DirPickerComponent : public PickerComponentBase { public: wxObject* Create(IObject *obj, wxObject *parent) { wxDirPickerCtrl* picker = new wxDirPickerCtrl( (wxWindow*)parent, obj->GetPropertyAsInteger(_("id")), obj->GetPropertyAsString(_("value")), obj->GetPropertyAsString(_("message")), obj->GetPropertyAsPoint(_("pos")), obj->GetPropertyAsSize(_("size")), obj->GetPropertyAsInteger(_("style")) | obj->GetPropertyAsInteger(_("window_style")) ); picker->PushEventHandler( new ComponentEvtHandler( picker, GetManager() ) ); return picker; } ticpp::Element* ExportToXrc(IObject *obj) { ObjectToXrcFilter xrc(obj, _("wxDirPickerCtrl"), obj->GetPropertyAsString(_("name"))); xrc.AddProperty(_("value"),_("value"),XRC_TYPE_TEXT); xrc.AddProperty(_("message"),_("message"),XRC_TYPE_TEXT); xrc.AddWindowProperties(); return xrc.GetXrcObject(); } ticpp::Element* ImportFromXrc( ticpp::Element* xrcObj ) { XrcToXfbFilter filter(xrcObj, _("wxDirPickerCtrl")); filter.AddProperty(_("value"),_("value"),XRC_TYPE_FONT); filter.AddProperty(_("message"),_("message"),XRC_TYPE_TEXT); filter.AddWindowProperties(); return filter.GetXfbObject(); } }; void ComponentEvtHandler::OnDirPickerDirChanged( wxFileDirPickerEvent& ) { wxDirPickerCtrl* window = wxDynamicCast( m_window, wxDirPickerCtrl ); if ( window != NULL ) { m_manager->ModifyProperty( window, _("value"), window->GetPath() ); } } class HyperlinkComponent : public ComponentBase { public: wxObject* Create(IObject *obj, wxObject *parent) { wxHyperlinkCtrl* ctrl = new wxHyperlinkCtrl( (wxWindow*)parent, -1, obj->GetPropertyAsString(_("label")), obj->GetPropertyAsString(_("url")), obj->GetPropertyAsPoint(_("pos")), obj->GetPropertyAsSize(_("size")), obj->GetPropertyAsInteger(_("style")) | obj->GetPropertyAsInteger(_("window_style")) ); if ( !obj->IsNull( _("hover_color") ) ) { ctrl->SetHoverColour( obj->GetPropertyAsColour( _("hover_color") ) ); } if ( !obj->IsNull( _("normal_color") ) ) { ctrl->SetNormalColour( obj->GetPropertyAsColour( _("normal_color") ) ); } if ( !obj->IsNull( _("visited_color") ) ) { ctrl->SetVisitedColour( obj->GetPropertyAsColour( _("visited_color") ) ); } return ctrl; } ticpp::Element* ExportToXrc(IObject *obj) { ObjectToXrcFilter xrc(obj, _("wxHyperlinkCtrl"), obj->GetPropertyAsString(_("name"))); xrc.AddProperty(_("label"),_("label"),XRC_TYPE_TEXT); xrc.AddPropertyValue(_("url"), obj->GetPropertyAsString(_("url"))); xrc.AddWindowProperties(); return xrc.GetXrcObject(); } ticpp::Element* ImportFromXrc( ticpp::Element* xrcObj ) { XrcToXfbFilter filter(xrcObj, _("wxHyperlinkCtrl")); filter.AddProperty(_("label"),_("label"),XRC_TYPE_TEXT); try { ticpp::Element *urlElement = xrcObj->FirstChildElement("url"); wxString url(urlElement->GetText().c_str(), wxConvUTF8); filter.AddPropertyValue(_("url"), url); } catch(ticpp::Exception&) { } filter.AddWindowProperties(); return filter.GetXfbObject(); } }; #endif class GenericDirCtrlComponent : public ComponentBase { public: wxObject* Create( IObject* obj, wxObject* parent ) { wxGenericDirCtrl* ctrl = new wxGenericDirCtrl( (wxWindow*)parent, wxID_ANY, obj->GetPropertyAsString(_("defaultfolder")), obj->GetPropertyAsPoint(_("pos")), obj->GetPropertyAsSize(_("size")), obj->GetPropertyAsInteger(_("style")) | obj->GetPropertyAsInteger(_("window_style")), obj->GetPropertyAsString(_("filter")), obj->GetPropertyAsInteger(_("defaultfilter")) ); ctrl->ShowHidden( obj->GetPropertyAsInteger( _("show_hidden") ) != 0 ); ctrl->GetTreeCtrl()->PushEventHandler( new GenericDirCtrlEvtHandler( ctrl, GetManager() ) ); return ctrl; } ticpp::Element* ExportToXrc(IObject *obj) { ObjectToXrcFilter xrc(obj, _("wxGenericDirCtrl"), obj->GetPropertyAsString(_("name"))); xrc.AddProperty(_("defaultfolder"),_("defaultfolder"),XRC_TYPE_TEXT); xrc.AddProperty(_("filter"),_("filter"),XRC_TYPE_TEXT); xrc.AddProperty(_("defaultfilter"),_("defaultfilter"),XRC_TYPE_INTEGER); xrc.AddWindowProperties(); return xrc.GetXrcObject(); } ticpp::Element* ImportFromXrc( ticpp::Element* xrcObj ) { XrcToXfbFilter filter(xrcObj, _("wxGenericDirCtrl")); filter.AddProperty(_("defaultfolder"),_("defaultfolder"),XRC_TYPE_TEXT); filter.AddProperty(_("filter"),_("filter"),XRC_TYPE_TEXT); filter.AddProperty(_("defaultfilter"),_("defaultfilter"),XRC_TYPE_INTEGER); filter.AddWindowProperties(); return filter.GetXfbObject(); } }; void GenericDirCtrlEvtHandler::OnGenericDirCtrlLeftClick( wxMouseEvent& event ) { m_manager->SelectObject( m_window ); event.Skip(); } class CustomControlComponent : public ComponentBase { public: wxObject* Create(IObject* /*obj*/, wxObject *parent) { return new wxPanel((wxWindow *)parent, -1, wxDefaultPosition, wxDefaultSize, 0 ); } ticpp::Element* ExportToXrc(IObject *obj) { ObjectToXrcFilter xrc(obj, obj->GetPropertyAsString(_("class")), obj->GetPropertyAsString(_("name"))); return xrc.GetXrcObject(); } }; /////////////////////////////////////////////////////////////////////////////// BEGIN_LIBRARY() WINDOW_COMPONENT("wxCalendarCtrl",CalendarCtrlComponent) WINDOW_COMPONENT("wxDatePickerCtrl", DatePickerCtrlComponent ) WINDOW_COMPONENT("wxHtmlWindow",HtmlWindowComponent) WINDOW_COMPONENT("wxToggleButton",ToggleButtonComponent) WINDOW_COMPONENT("wxTreeCtrl",TreeCtrlComponent) WINDOW_COMPONENT("wxGrid",GridComponent) WINDOW_COMPONENT("wxScrollBar",ScrollBarComponent) WINDOW_COMPONENT("wxSpinCtrl",SpinCtrlComponent) WINDOW_COMPONENT("wxSpinButton",SpinButtonComponent) WINDOW_COMPONENT("CustomControl", CustomControlComponent) // wxCheckListBox WINDOW_COMPONENT("wxCheckListBox",CheckListBoxComponent) #if wxCHECK_VERSION( 2, 8, 0 ) // wxRichTextCtrl WINDOW_COMPONENT( "wxRichTextCtrl", RichTextCtrlComponent ) MACRO(wxTE_PROCESS_ENTER); MACRO(wxTE_PROCESS_TAB); MACRO(wxTE_READONLY); MACRO(wxTE_AUTO_URL); // wxColourPickerCtrl WINDOW_COMPONENT("wxColourPickerCtrl", ColourPickerComponent) MACRO(wxCLRP_DEFAULT_STYLE) MACRO(wxCLRP_USE_TEXTCTRL) MACRO(wxCLRP_SHOW_LABEL) // wxFontPickerCtrl WINDOW_COMPONENT("wxFontPickerCtrl", FontPickerComponent) MACRO(wxFNTP_DEFAULT_STYLE) MACRO(wxFNTP_USE_TEXTCTRL) MACRO(wxFNTP_FONTDESC_AS_LABEL) MACRO(wxFNTP_USEFONT_FOR_LABEL) // wxFilePickerCtrl WINDOW_COMPONENT("wxFilePickerCtrl", FilePickerComponent) MACRO(wxFLP_DEFAULT_STYLE) MACRO(wxFLP_USE_TEXTCTRL) MACRO(wxFLP_OPEN) MACRO(wxFLP_SAVE) MACRO(wxFLP_OVERWRITE_PROMPT) MACRO(wxFLP_FILE_MUST_EXIST) MACRO(wxFLP_CHANGE_DIR) // wxDirPickerCtrl WINDOW_COMPONENT("wxDirPickerCtrl", DirPickerComponent) MACRO(wxDIRP_DEFAULT_STYLE) MACRO(wxDIRP_USE_TEXTCTRL) MACRO(wxDIRP_DIR_MUST_EXIST) MACRO(wxDIRP_CHANGE_DIR) // wxHyperlinkCtrl WINDOW_COMPONENT("wxHyperlinkCtrl", HyperlinkComponent) MACRO(wxHL_ALIGN_LEFT) MACRO(wxHL_ALIGN_RIGHT) MACRO(wxHL_ALIGN_CENTRE) MACRO(wxHL_CONTEXTMENU) MACRO(wxHL_DEFAULT_STYLE) #endif // wxCalendarCtrl MACRO(wxCAL_SUNDAY_FIRST) MACRO(wxCAL_MONDAY_FIRST) MACRO(wxCAL_SHOW_HOLIDAYS) MACRO(wxCAL_NO_YEAR_CHANGE) MACRO(wxCAL_NO_MONTH_CHANGE) MACRO(wxCAL_SHOW_SURROUNDING_WEEKS) MACRO(wxCAL_SEQUENTIAL_MONTH_SELECTION) // wxDatePickerCtrl MACRO(wxDP_SPIN) MACRO(wxDP_DROPDOWN) MACRO(wxDP_SHOWCENTURY) MACRO(wxDP_ALLOWNONE) MACRO(wxDP_DEFAULT) // wxHtmlWindow MACRO(wxHW_SCROLLBAR_NEVER) MACRO(wxHW_SCROLLBAR_AUTO) MACRO(wxHW_NO_SELECTION) // wxTreeCtrl MACRO(wxTR_EDIT_LABELS) MACRO(wxTR_NO_BUTTONS) MACRO(wxTR_HAS_BUTTONS) MACRO(wxTR_TWIST_BUTTONS) MACRO(wxTR_NO_LINES) MACRO(wxTR_FULL_ROW_HIGHLIGHT) MACRO(wxTR_LINES_AT_ROOT) MACRO(wxTR_HIDE_ROOT) MACRO(wxTR_ROW_LINES) MACRO(wxTR_HAS_VARIABLE_ROW_HEIGHT) MACRO(wxTR_SINGLE) MACRO(wxTR_MULTIPLE) MACRO(wxTR_EXTENDED) MACRO(wxTR_DEFAULT_STYLE) // wxGrid MACRO(wxALIGN_LEFT) MACRO(wxALIGN_CENTRE) MACRO(wxALIGN_RIGHT) MACRO(wxALIGN_TOP) MACRO(wxALIGN_BOTTOM) // wxScrollBar MACRO(wxSB_HORIZONTAL) MACRO(wxSB_VERTICAL) // wxSpinCtrl and wxSpinButton MACRO(wxSP_ARROW_KEYS) MACRO(wxSP_WRAP) MACRO(wxSP_HORIZONTAL) MACRO(wxSP_VERTICAL) // wxGenericDirCtrl WINDOW_COMPONENT("wxGenericDirCtrl",GenericDirCtrlComponent) MACRO(wxDIRCTRL_DIR_ONLY) MACRO(wxDIRCTRL_3D_INTERNAL) MACRO(wxDIRCTRL_SELECT_FIRST) MACRO(wxDIRCTRL_SHOW_FILTERS) MACRO(wxDIRCTRL_EDIT_LABELS) END_LIBRARY() wxformbuilder-3.1.59/plugins/additional/Makefile0000644000175000017500000000702211143440026022201 0ustar rrmulderrrmulder# C++ Static Library Makefile autogenerated by premake # Don't edit this file! Instead edit `premake.lua` then rerun `make` ifndef CONFIG CONFIG=Release endif ifeq ($(CONFIG),Release) BINDIR := ../../output/lib/wxformbuilder LIBDIR := ../.. OBJDIR := .objsu OUTDIR := ../../output/lib/wxformbuilder CPPFLAGS := -MMD -D "BUILD_DLL" -D "TIXML_USE_TICPP" -D "WXUSINGDLL" -D "UNICODE" -D "_UNICODE" -D "__WX__" -D "NDEBUG" -I "../../sdk/tinyxml" -I "../../sdk/plugin_interface" CFLAGS += $(CPPFLAGS) $(TARGET_ARCH) -fPIC -O3 -Wall -fPIC -fno-strict-aliasing `wx-config --debug=no --cflags` CXXFLAGS := $(CFLAGS) LDFLAGS += -L$(BINDIR) -L$(LIBDIR) -shared -s `wx-config --libs std richtext` -L../../sdk/lib -lfbPluginInterface -L../../sdk/lib -lticpp LDDEPS := ../../sdk/lib/libfbPluginInterface.a ../../sdk/lib/libticpp.a RESFLAGS := -D "BUILD_DLL" -D "TIXML_USE_TICPP" -D "WXUSINGDLL" -D "UNICODE" -D "_UNICODE" -D "__WX__" -D "NDEBUG" -I "../../sdk/tinyxml" -I "../../sdk/plugin_interface" TARGET := libadditional.so BLDCMD = $(CXX) -o $(OUTDIR)/$(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(TARGET_ARCH) endif ifeq ($(CONFIG),Debug) BINDIR := ../../output/lib/wxformbuilder LIBDIR := ../.. OBJDIR := .objsud OUTDIR := ../../output/lib/wxformbuilder CPPFLAGS := -MMD -D "BUILD_DLL" -D "TIXML_USE_TICPP" -D "WXUSINGDLL" -D "UNICODE" -D "_UNICODE" -D "__WX__" -D "NDEBUG" -D "__WXFB_DEBUG__" -I "../../sdk/tinyxml" -I "../../sdk/plugin_interface" CFLAGS += $(CPPFLAGS) $(TARGET_ARCH) -fPIC -g -Wall -fPIC -O0 `wx-config --debug=no --cflags` CXXFLAGS := $(CFLAGS) LDFLAGS += -L$(BINDIR) -L$(LIBDIR) -shared `wx-config --debug=no --libs std richtext` -L../../sdk/lib -lfbPluginInterfaced -L../../sdk/lib -lticppd LDDEPS := ../../sdk/lib/libfbPluginInterfaced.a ../../sdk/lib/libticppd.a RESFLAGS := -D "BUILD_DLL" -D "TIXML_USE_TICPP" -D "WXUSINGDLL" -D "UNICODE" -D "_UNICODE" -D "__WX__" -D "NDEBUG" -D "__WXFB_DEBUG__" -I "../../sdk/tinyxml" -I "../../sdk/plugin_interface" TARGET := libadditionald.so BLDCMD = $(CXX) -o $(OUTDIR)/$(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(TARGET_ARCH) endif OBJECTS := \ $(OBJDIR)/additional.o \ MKDIR_TYPE := msdos CMD := $(subst \,\\,$(ComSpec)$(COMSPEC)) ifeq (,$(CMD)) MKDIR_TYPE := posix endif ifeq (/bin/sh.exe,$(SHELL)) MKDIR_TYPE := posix endif ifeq ($(MKDIR_TYPE),posix) CMD_MKBINDIR := mkdir -p $(BINDIR) CMD_MKLIBDIR := mkdir -p $(LIBDIR) CMD_MKOUTDIR := mkdir -p $(OUTDIR) CMD_MKOBJDIR := mkdir -p $(OBJDIR) else CMD_MKBINDIR := $(CMD) /c if not exist $(subst /,\\,$(BINDIR)) mkdir $(subst /,\\,$(BINDIR)) CMD_MKLIBDIR := $(CMD) /c if not exist $(subst /,\\,$(LIBDIR)) mkdir $(subst /,\\,$(LIBDIR)) CMD_MKOUTDIR := $(CMD) /c if not exist $(subst /,\\,$(OUTDIR)) mkdir $(subst /,\\,$(OUTDIR)) CMD_MKOBJDIR := $(CMD) /c if not exist $(subst /,\\,$(OBJDIR)) mkdir $(subst /,\\,$(OBJDIR)) endif .PHONY: clean $(OUTDIR)/$(TARGET): $(OBJECTS) $(LDDEPS) $(RESOURCES) @echo Linking additional-components-plugin -@$(CMD_MKBINDIR) -@$(CMD_MKLIBDIR) -@$(CMD_MKOUTDIR) @$(BLDCMD) clean: @echo Cleaning additional-components-plugin ifeq ($(MKDIR_TYPE),posix) -@rm -f $(OUTDIR)/$(TARGET) -@rm -rf $(OBJDIR) else -@if exist $(subst /,\,$(OUTDIR)/$(TARGET)) del /q $(subst /,\,$(OUTDIR)/$(TARGET)) -@if exist $(subst /,\,$(OBJDIR)) del /q $(subst /,\,$(OBJDIR)) -@if exist $(subst /,\,$(OBJDIR)) rmdir /s /q $(subst /,\,$(OBJDIR)) endif $(OBJDIR)/additional.o: additional.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -include $(OBJECTS:%.o=%.d) wxformbuilder-3.1.59/plugins/additional/smiley.xpm0000644000175000017500000000702311143440026022572 0ustar rrmulderrrmulder/** Silk icon set 1.3 _________________________________________ Mark James http://www.famfamfam.com/lab/icons/silk/ _________________________________________ This work is licensed under a Creative Commons Attribution 2.5 License. [ http://creativecommons.org/licenses/by/2.5/ ] This means you may use it for any purpose, and make any changes you like. All I ask is that you include a link back to this page in your credits. */ /* XPM */ static const char * smiley_xpm[] = { "16 16 147 2", " c None", ". c #F9BB00", "+ c #F7B900", "@ c #F6B800", "# c #F5B600", "$ c #FABC00", "% c #FBDA75", "& c #FCEAAB", "* c #FBF0BD", "= c #FBEFBA", "- c #FAE6A6", "; c #F7D575", "> c #F0B000", ", c #FACD3F", "' c #FCE59A", ") c #FBEFA9", "! c #F8E581", "~ c #F6DE6E", "{ c #F5DA66", "] c #F5DB6E", "^ c #F7E392", "/ c #F8DE94", "( c #F1C03F", "_ c #F9BC00", ": c #FCE9A7", "< c #FAEB99", "[ c #F7E378", "} c #F7DE6B", "| c #F5DA64", "1 c #F4D75C", "2 c #F3D354", "3 c #F3D153", "4 c #F4D871", "5 c #F7DF9E", "6 c #E8A600", "7 c #FBDB7B", "8 c #FBEFA7", "9 c #F8E478", "0 c #F7DF6D", "a c #B58F57", "b c #F5D85E", "c c #F4D456", "d c #B58E54", "e c #F1CC47", "f c #F0CA44", "g c #F4D87B", "h c #F2CF7B", "i c #E4A100", "j c #FCECB2", "k c #F9E786", "l c #F7E06F", "m c #F6DD68", "n c #F5D960", "o c #F4D659", "p c #F3D151", "q c #F2CD48", "r c #F0CA40", "s c #EFC538", "t c #F0C848", "u c #F6DFA1", "v c #E29E00", "w c #F5B700", "x c #FCF3C0", "y c #F7E376", "z c #F6DE6A", "A c #F5DA63", "B c #F4D75B", "C c #F3D253", "D c #F2CE4B", "E c #F1CB43", "F c #EFC63B", "G c #EEC232", "H c #EEC134", "I c #F6DF9A", "J c #DF9B00", "K c #F4B500", "L c #FBEFB8", "M c #F7E072", "N c #B28D30", "O c #D5B447", "P c #F3D455", "Q c #F2CF4E", "R c #F1CB45", "S c #F0C83C", "T c #D0A328", "U c #AC7B16", "V c #EDBF2F", "W c #F6DE99", "X c #DD9900", "Y c #F2B200", "Z c #FBEAAF", "` c #F7E078", " . c #EACC57", ".. c #B0892A", "+. c #D6B13D", "@. c #F0C940", "#. c #D2A72B", "$. c #AC7C17", "%. c #E2B224", "&. c #EEC139", "*. c #F4DB9D", "=. c #D89200", "-. c #F6D67E", ";. c #F8E696", ">. c #F4D75F", ",. c #E8C64B", "'. c #BB912B", "). c #AD8220", "!. c #AD7F1B", "~. c #B8881C", "{. c #E2B226", "]. c #EDBC29", "^. c #F2CF68", "/. c #EBC77E", "(. c #D38C00", "_. c #ECAB00", ":. c #F8E2A3", "<. c #F6DD7C", "[. c #F0C73C", "}. c #EEC334", "|. c #EDBF2C", "1. c #EDBD2C", "2. c #F0C850", "3. c #F1D697", "4. c #D28A00", "5. c #EEBE45", "6. c #F6DC97", "7. c #F6DF8A", "8. c #F2CE55", "9. c #EFC53B", "0. c #EEC133", "a. c #EFC540", "b. c #F2D270", "c. c #EFD292", "d. c #DEAA48", "e. c #EFCB75", "f. c #F5DEA0", "g. c #F7E3A2", "h. c #F7E19E", "i. c #F3DA9B", "j. c #E8C175", "k. c #D08800", "l. c #E09C00", "m. c #DE9A00", "n. c #DB9700", "o. c #D79100", "p. c #CF8700", " ", " . + @ # ", " $ % & * = - ; > ", " , ' ) ! ~ { ] ^ / ( ", " _ : < [ } | 1 2 3 4 5 6 ", " . 7 8 9 0 a b c d e f g h i ", " + j k l m n o p q r s t u v ", " w x y z A B C D E F G H I J ", " K L M N O P Q R S T U V W X ", " Y Z ` ...+.e @.#.$.%.&.*.=. ", " > -.;.>.,.'.).!.~.{.].^./.(. ", " _.:.<.3 E [.}.|.1.2.3.4. ", " 5.6.7.8.9.0.a.b.c.d. ", " i e.f.g.h.i.j.k. ", " l.m.n.o.(.p. ", " "}; wxformbuilder-3.1.59/plugins/common/common.cpp0000644000175000017500000012110611143440026021715 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include #include #include /////////////////////////////////////////////////////////////////////////////// // Custom status bar class for windows to prevent the status bar gripper from // moving the entire wxFB window #if defined(__WIN32__) && wxUSE_NATIVE_STATUSBAR class wxIndependentStatusBar : public wxStatusBar { public: wxIndependentStatusBar( wxWindow *parent, wxWindowID id = wxID_ANY, long style = wxST_SIZEGRIP, const wxString& name = wxStatusBarNameStr ) : wxStatusBar( parent, id, style, name ) { } // override this virtual function to prevent the status bar from moving the main frame virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam) { return wxStatusBarBase::MSWWindowProc(nMsg, wParam, lParam); } }; #else typedef wxStatusBar wxIndependentStatusBar; #endif class wxLeftDownRedirect : public wxEvtHandler { private: wxWindow* m_window; IManager* m_manager; void OnLeftDown( wxMouseEvent& ) { m_manager->SelectObject( m_window ); } public: wxLeftDownRedirect( wxWindow* win, IManager* manager ) : m_window( win ), m_manager( manager ) { } DECLARE_EVENT_TABLE() }; BEGIN_EVENT_TABLE( wxLeftDownRedirect, wxEvtHandler ) EVT_LEFT_DOWN(wxLeftDownRedirect::OnLeftDown) END_EVENT_TABLE() /////////////////////////////////////////////////////////////////////////////// /** Event handler for events generated by controls in this plugin */ class ComponentEvtHandler : public wxEvtHandler { private: wxWindow* m_window; IManager* m_manager; public: ComponentEvtHandler( wxWindow* win, IManager* manager ) : m_window( win ), m_manager( manager ) { } protected: void OnText( wxCommandEvent& event ); void OnChecked( wxCommandEvent& event ); void OnChoice( wxCommandEvent& event ); void OnTool( wxCommandEvent& event ); DECLARE_EVENT_TABLE() }; BEGIN_EVENT_TABLE( ComponentEvtHandler, wxEvtHandler ) EVT_TEXT( wxID_ANY, ComponentEvtHandler::OnText ) EVT_CHECKBOX( wxID_ANY, ComponentEvtHandler::OnChecked ) EVT_CHOICE( wxID_ANY, ComponentEvtHandler::OnChoice ) // Tools do not get click events, so this will help select them EVT_TOOL( wxID_ANY, ComponentEvtHandler::OnTool ) END_EVENT_TABLE() /////////////////////////////////////////////////////////////////////////////// // FORMS /////////////////////////////////////////////////////////////////////////////// // TO-DO: The "Form" type component should be drawn in the designer, so that, // for instance, a dark panel could be drawn for a wxFrame (N.B. ??) class FrameFormComponent : public ComponentBase { public: wxObject* Create(IObject* /*obj*/, wxObject *parent) { wxPanel *panel = new wxPanel((wxWindow *)parent,-1); panel->SetBackgroundColour(wxColour(50,50,50)); return panel; } ticpp::Element* ExportToXrc(IObject *obj) { ObjectToXrcFilter xrc(obj, _("wxFrame"), obj->GetPropertyAsString(_("name"))); xrc.AddWindowProperties(); xrc.AddProperty( _("title"), _("title"), XRC_TYPE_TEXT); if ( !obj->IsNull( _("center") ) ) { xrc.AddPropertyValue( _("centered"), _("1") ); } return xrc.GetXrcObject(); } ticpp::Element* ImportFromXrc( ticpp::Element* xrcObj ) { XrcToXfbFilter filter(xrcObj, _("Frame")); filter.AddWindowProperties(); filter.AddProperty( _("title"), _("title"), XRC_TYPE_TEXT); filter.AddProperty(_("centered"), _("center"), XRC_TYPE_BITLIST); return filter.GetXfbObject(); } }; class PanelFormComponent : public ComponentBase { public: wxObject* Create(IObject* /*obj*/, wxObject *parent) { wxPanel *panel = new wxPanel((wxWindow *)parent,-1); return panel; } ticpp::Element* ExportToXrc(IObject *obj) { ObjectToXrcFilter xrc(obj, _("wxPanel"), obj->GetPropertyAsString(_("name"))); xrc.AddWindowProperties(); return xrc.GetXrcObject(); } ticpp::Element* ImportFromXrc( ticpp::Element* xrcObj ) { XrcToXfbFilter filter(xrcObj, _("Panel")); filter.AddWindowProperties(); return filter.GetXfbObject(); } }; class DialogFormComponent : public ComponentBase { public: wxObject* Create(IObject* /*obj*/, wxObject *parent) { wxPanel *panel = new wxPanel((wxWindow *)parent,-1); return panel; } ticpp::Element* ExportToXrc(IObject *obj) { ObjectToXrcFilter xrc(obj, _("wxDialog"), obj->GetPropertyAsString(_("name"))); xrc.AddWindowProperties(); xrc.AddProperty( _("title"), _("title"), XRC_TYPE_TEXT); if ( !obj->IsNull( _("center") ) ) { xrc.AddPropertyValue( _("centered"), _("1") ); } return xrc.GetXrcObject(); } ticpp::Element* ImportFromXrc( ticpp::Element* xrcObj ) { XrcToXfbFilter filter(xrcObj, _("Dialog")); filter.AddWindowProperties(); filter.AddProperty( _("title"), _("title"), XRC_TYPE_TEXT); filter.AddProperty(_("centered"), _("center"), XRC_TYPE_BITLIST); return filter.GetXfbObject(); } }; /////////////////////////////////////////////////////////////////////////////// // WIDGETS /////////////////////////////////////////////////////////////////////////////// class ButtonComponent : public ComponentBase { public: wxObject* Create(IObject *obj, wxObject *parent) { wxButton* button = new wxButton((wxWindow*)parent,-1, obj->GetPropertyAsString(_("label")), obj->GetPropertyAsPoint(_("pos")), obj->GetPropertyAsSize(_("size")), obj->GetPropertyAsInteger(_("style")) | obj->GetPropertyAsInteger(_("window_style"))); if ( obj->GetPropertyAsInteger( _("default") ) != 0 ) { button->SetDefault(); } return button; } ticpp::Element* ExportToXrc(IObject *obj) { ObjectToXrcFilter xrc(obj, _("wxButton"), obj->GetPropertyAsString(_("name"))); xrc.AddWindowProperties(); xrc.AddProperty(_("label"),_("label"),XRC_TYPE_TEXT); xrc.AddProperty(_("default"),_("default"),XRC_TYPE_BOOL); return xrc.GetXrcObject(); } ticpp::Element* ImportFromXrc( ticpp::Element* xrcObj ) { XrcToXfbFilter filter(xrcObj, _("wxButton")); filter.AddWindowProperties(); filter.AddProperty(_("label"),_("label"),XRC_TYPE_TEXT); filter.AddProperty(_("default"),_("default"),XRC_TYPE_BOOL); return filter.GetXfbObject(); } }; class BitmapButtonComponent : public ComponentBase { public: wxObject* Create(IObject *obj, wxObject *parent) { wxBitmapButton* button = new wxBitmapButton((wxWindow*)parent,-1, obj->GetPropertyAsBitmap(_("bitmap")), obj->GetPropertyAsPoint(_("pos")), obj->GetPropertyAsSize(_("size")), obj->GetPropertyAsInteger(_("style")) | obj->GetPropertyAsInteger(_("window_style"))); if ( obj->GetPropertyAsInteger( _("default") ) != 0 ) { button->SetDefault(); } if ( !obj->IsNull( _("disabled") ) ) { button->SetBitmapDisabled( obj->GetPropertyAsBitmap( _("disabled") ) ); } if ( !obj->IsNull( _("selected") ) ) { button->SetBitmapSelected( obj->GetPropertyAsBitmap( _("selected") ) ); } if ( !obj->IsNull( _("focus") ) ) { button->SetBitmapFocus( obj->GetPropertyAsBitmap( _("focus") ) ); } if ( !obj->IsNull( _("hover") ) ) { button->SetBitmapHover( obj->GetPropertyAsBitmap( _("hover") ) ); } return button; } ticpp::Element* ExportToXrc(IObject *obj) { ObjectToXrcFilter xrc(obj, _("wxBitmapButton"), obj->GetPropertyAsString(_("name"))); xrc.AddWindowProperties(); xrc.AddProperty(_("bitmap"),_("bitmap"),XRC_TYPE_BITMAP); if ( !obj->IsNull( _("disabled") ) ) { xrc.AddProperty(_("disabled"),_("disabled"),XRC_TYPE_BITMAP); } if ( !obj->IsNull( _("selected") ) ) { xrc.AddProperty(_("selected"),_("selected"),XRC_TYPE_BITMAP); } if ( !obj->IsNull( _("focus") ) ) { xrc.AddProperty(_("focus"),_("focus"),XRC_TYPE_BITMAP); } if ( !obj->IsNull( _("hover") ) ) { xrc.AddProperty(_("hover"),_("hover"),XRC_TYPE_BITMAP); } xrc.AddProperty(_("default"),_("default"),XRC_TYPE_BOOL); return xrc.GetXrcObject(); } ticpp::Element* ImportFromXrc( ticpp::Element* xrcObj ) { XrcToXfbFilter filter(xrcObj, _("wxBitmapButton")); filter.AddWindowProperties(); filter.AddProperty(_("bitmap"),_("bitmap"),XRC_TYPE_BITMAP); filter.AddProperty(_("disabled"),_("disabled"),XRC_TYPE_BITMAP); filter.AddProperty(_("selected"),_("selected"),XRC_TYPE_BITMAP); filter.AddProperty(_("focus"),_("focus"),XRC_TYPE_BITMAP); filter.AddProperty(_("hover"),_("hover"),XRC_TYPE_BITMAP); filter.AddProperty(_("default"),_("default"),XRC_TYPE_BOOL); return filter.GetXfbObject(); } }; class TextCtrlComponent : public ComponentBase { public: wxObject* Create(IObject *obj, wxObject *parent) { wxTextCtrl* tc = new wxTextCtrl((wxWindow *)parent,-1, obj->GetPropertyAsString(_("value")), obj->GetPropertyAsPoint(_("pos")), obj->GetPropertyAsSize(_("size")), obj->GetPropertyAsInteger(_("style")) | obj->GetPropertyAsInteger(_("window_style"))); if ( !obj->IsNull( _("maxlength") ) ) { tc->SetMaxLength( obj->GetPropertyAsInteger( _("maxlength") ) ); } tc->PushEventHandler( new ComponentEvtHandler( tc, GetManager() ) ); return tc; } ticpp::Element* ExportToXrc(IObject *obj) { ObjectToXrcFilter xrc(obj, _("wxTextCtrl"), obj->GetPropertyAsString(_("name"))); xrc.AddWindowProperties(); xrc.AddProperty(_("value"),_("value"),XRC_TYPE_TEXT); if (!obj->IsNull(_("maxlength"))) xrc.AddProperty(_("maxlength"), _("maxlength"), XRC_TYPE_INTEGER); return xrc.GetXrcObject(); } ticpp::Element* ImportFromXrc( ticpp::Element* xrcObj ) { XrcToXfbFilter filter(xrcObj, _("wxTextCtrl")); filter.AddWindowProperties(); filter.AddProperty(_("value"),_("value"),XRC_TYPE_TEXT); filter.AddProperty(_("maxlength"), _("maxlength"), XRC_TYPE_INTEGER); return filter.GetXfbObject(); } }; void ComponentEvtHandler::OnText( wxCommandEvent& ) { wxTextCtrl* tc = wxDynamicCast( m_window, wxTextCtrl ); if ( tc != NULL ) { m_manager->ModifyProperty( m_window, _("value"), tc->GetValue() ); tc->SetInsertionPointEnd(); tc->SetFocus(); } } class StaticTextComponent : public ComponentBase { public: wxObject* Create(IObject *obj, wxObject *parent) { wxStaticText* st = new wxStaticText((wxWindow *)parent,-1, obj->GetPropertyAsString(_("label")), obj->GetPropertyAsPoint(_("pos")), obj->GetPropertyAsSize(_("size")), obj->GetPropertyAsInteger(_("style")) | obj->GetPropertyAsInteger(_("window_style"))); st->Wrap( obj->GetPropertyAsInteger( _("wrap") ) ); return st; } ticpp::Element* ExportToXrc(IObject *obj) { wxString name = obj->GetPropertyAsString(_("name")); ObjectToXrcFilter xrc(obj, _("wxStaticText"), name); xrc.AddWindowProperties(); xrc.AddProperty(_("label"),_("label"),XRC_TYPE_TEXT); return xrc.GetXrcObject(); } ticpp::Element* ImportFromXrc( ticpp::Element* xrcObj ) { XrcToXfbFilter filter(xrcObj, _("wxStaticText")); filter.AddWindowProperties(); filter.AddProperty(_("label"),_("label"),XRC_TYPE_TEXT); return filter.GetXfbObject(); } }; class ComboBoxComponent : public ComponentBase { public: wxObject* Create(IObject *obj, wxObject *parent) { wxComboBox *combo = new wxComboBox((wxWindow *)parent,-1, obj->GetPropertyAsString(_("value")), obj->GetPropertyAsPoint(_("pos")), obj->GetPropertyAsSize(_("size")), 0, NULL, obj->GetPropertyAsInteger(_("style")) | obj->GetPropertyAsInteger(_("window_style"))); // choices wxArrayString choices = obj->GetPropertyAsArrayString(_("choices")); for (unsigned int i=0; iAppend(choices[i]); return combo; } ticpp::Element* ExportToXrc(IObject *obj) { ObjectToXrcFilter xrc(obj, _("wxComboBox"), obj->GetPropertyAsString(_("name"))); xrc.AddWindowProperties(); xrc.AddProperty(_("value"),_("value"),XRC_TYPE_TEXT); xrc.AddProperty(_("choices"),_("content"),XRC_TYPE_STRINGLIST); return xrc.GetXrcObject(); } ticpp::Element* ImportFromXrc( ticpp::Element* xrcObj ) { XrcToXfbFilter filter(xrcObj, _("wxComboBox")); filter.AddWindowProperties(); filter.AddProperty(_("value"),_("value"),XRC_TYPE_TEXT); filter.AddProperty(_("content"),_("choices"),XRC_TYPE_STRINGLIST); return filter.GetXfbObject(); } }; class CheckBoxComponent : public ComponentBase { public: wxObject* Create(IObject *obj, wxObject *parent) { wxCheckBox *res = new wxCheckBox((wxWindow *)parent,-1, obj->GetPropertyAsString(_("label")), obj->GetPropertyAsPoint(_("pos")), obj->GetPropertyAsSize(_("size")), obj->GetPropertyAsInteger(_("window_style")) | obj->GetPropertyAsInteger(_T("style"))); res->SetValue(obj->GetPropertyAsInteger(_T("checked")) != 0); res->PushEventHandler( new ComponentEvtHandler( res, GetManager() ) ); return res; } ticpp::Element* ExportToXrc(IObject *obj) { ObjectToXrcFilter xrc(obj, _("wxCheckBox"), obj->GetPropertyAsString(_("name"))); xrc.AddWindowProperties(); xrc.AddProperty(_("label"),_("label"),XRC_TYPE_TEXT); xrc.AddProperty(_("checked"),_("checked"),XRC_TYPE_BOOL); return xrc.GetXrcObject(); } ticpp::Element* ImportFromXrc( ticpp::Element* xrcObj ) { XrcToXfbFilter filter(xrcObj, _("wxCheckBox")); filter.AddWindowProperties(); filter.AddProperty(_("label"),_("label"),XRC_TYPE_TEXT); filter.AddProperty(_("checked"),_("checked"),XRC_TYPE_BOOL); return filter.GetXfbObject(); } }; void ComponentEvtHandler::OnChecked( wxCommandEvent& ) { wxCheckBox* cb = wxDynamicCast( m_window, wxCheckBox ); if ( cb != NULL ) { wxString cbValue; cbValue.Printf( wxT("%i"), cb->GetValue() ); m_manager->ModifyProperty( m_window, _("checked"), cbValue ); cb->SetFocus(); } } class StaticBitmapComponent : public ComponentBase { public: wxObject* Create(IObject *obj, wxObject *parent) { return new wxStaticBitmap((wxWindow *)parent,-1, obj->GetPropertyAsBitmap(_("bitmap")), obj->GetPropertyAsPoint(_("pos")), obj->GetPropertyAsSize(_("size")), obj->GetPropertyAsInteger(_("window_style"))); } ticpp::Element* ExportToXrc(IObject *obj) { ObjectToXrcFilter xrc(obj, _("wxStaticBitmap"), obj->GetPropertyAsString(_("name"))); xrc.AddWindowProperties(); xrc.AddProperty( _("bitmap"), _("bitmap"), XRC_TYPE_BITMAP ); return xrc.GetXrcObject(); } ticpp::Element* ImportFromXrc( ticpp::Element* xrcObj ) { XrcToXfbFilter filter(xrcObj, _("wxStaticBitmap")); filter.AddWindowProperties(); filter.AddProperty(_("bitmap"),_("bitmap"),XRC_TYPE_BITMAP); return filter.GetXfbObject(); } }; class XpmStaticBitmapComponent : public StaticBitmapComponent { }; class StaticLineComponent : public ComponentBase { public: wxObject* Create(IObject *obj, wxObject *parent) { return new wxStaticLine((wxWindow *)parent,-1, obj->GetPropertyAsPoint(_("pos")), obj->GetPropertyAsSize(_("size")), obj->GetPropertyAsInteger(_("style")) | obj->GetPropertyAsInteger(_("window_style"))); } ticpp::Element* ExportToXrc(IObject *obj) { ObjectToXrcFilter xrc(obj, _("wxStaticLine"), obj->GetPropertyAsString(_("name"))); xrc.AddWindowProperties(); return xrc.GetXrcObject(); } ticpp::Element* ImportFromXrc( ticpp::Element* xrcObj ) { XrcToXfbFilter filter(xrcObj, _("wxStaticLine")); filter.AddWindowProperties(); return filter.GetXfbObject(); } }; class ListCtrlComponent : public ComponentBase { public: wxObject* Create(IObject *obj, wxObject *parent) { wxListCtrl *lc = new wxListCtrl((wxWindow*)parent, -1, obj->GetPropertyAsPoint(_("pos")), obj->GetPropertyAsSize(_("size")), (obj->GetPropertyAsInteger(_("style")) | obj->GetPropertyAsInteger(_("window_style"))) & ~wxLC_VIRTUAL); // Refilling int i,j; wxString buf; if ( (lc->GetWindowStyle() & wxLC_REPORT) != 0 ) { for (i=0;i<4;i++) { buf.Printf(wxT("Label %d"),i); lc->InsertColumn(i, buf, wxLIST_FORMAT_LEFT, 80); } } for (j=0;j<10;j++) { long temp; buf.Printf(wxT("Cell (0,%d)"),j); temp = lc->InsertItem(j,buf); if ( (lc->GetWindowStyle() & wxLC_REPORT) != 0 ) { for (i=1;i<4;i++) { buf.Printf(wxT("Cell (%d,%d)"),i,j); lc->SetItem(temp,i,buf); } } } return lc; } ticpp::Element* ExportToXrc(IObject *obj) { ObjectToXrcFilter xrc(obj, _("wxListCtrl"), obj->GetPropertyAsString(_("name"))); xrc.AddWindowProperties(); return xrc.GetXrcObject(); } ticpp::Element* ImportFromXrc( ticpp::Element* xrcObj ) { XrcToXfbFilter filter(xrcObj, _("wxListCtrl")); filter.AddWindowProperties(); return filter.GetXfbObject(); } }; class ListBoxComponent : public ComponentBase { public: wxObject* Create(IObject *obj, wxObject *parent) { wxListBox *listbox = new wxListBox((wxWindow*)parent, -1, obj->GetPropertyAsPoint(_("pos")), obj->GetPropertyAsSize(_("size")), 0, NULL, obj->GetPropertyAsInteger(_("style")) | obj->GetPropertyAsInteger(_("window_style"))); // choices wxArrayString choices = obj->GetPropertyAsArrayString(_("choices")); for (unsigned int i=0; iAppend(choices[i]); return listbox; } ticpp::Element* ExportToXrc(IObject *obj) { ObjectToXrcFilter xrc(obj, _("wxListBox"), obj->GetPropertyAsString(_("name"))); xrc.AddWindowProperties(); xrc.AddProperty(_("choices"), _("content"), XRC_TYPE_STRINGLIST); return xrc.GetXrcObject(); } ticpp::Element* ImportFromXrc( ticpp::Element* xrcObj ) { XrcToXfbFilter filter(xrcObj, _("wxListBox")); filter.AddWindowProperties(); filter.AddProperty(_("content"),_("choices"), XRC_TYPE_STRINGLIST); return filter.GetXfbObject(); } }; class RadioBoxComponent : public ComponentBase, public wxEvtHandler { public: wxObject* Create(IObject *obj, wxObject *parent) { wxArrayString choices = obj->GetPropertyAsArrayString(_("choices")); int count = choices.Count(); if ( 0 == count ) { choices.Add( _("wxRadioBox must have at least one choice") ); count = 1; } int majorDim = obj->GetPropertyAsInteger(_("majorDimension")); if (majorDim < 1) { wxLogWarning(_("majorDimension must be greater than zero.")); majorDim = 1; } wxRadioBox *radiobox = new wxRadioBox((wxWindow*)parent, -1, obj->GetPropertyAsString(_("label")), obj->GetPropertyAsPoint(_("pos")), obj->GetPropertyAsSize(_("size")), choices, majorDim, obj->GetPropertyAsInteger(_("style")) | obj->GetPropertyAsInteger(_("window_style"))); int selection = obj->GetPropertyAsInteger( _("selection") ); if ( selection < count ) { radiobox->SetSelection( selection ); } radiobox->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( RadioBoxComponent::OnRadioBox ), NULL, this ); return radiobox; } void OnRadioBox( wxCommandEvent& event ) { wxRadioBox* window = dynamic_cast< wxRadioBox* >( event.GetEventObject() ); if ( 0 != window ) { wxString value; value.Printf( wxT("%i"), window->GetSelection() ); GetManager()->ModifyProperty( window, _("selection"), value ); window->SetFocus(); GetManager()->SelectObject( window ); } } void Cleanup( wxObject* obj ) { wxRadioBox* window = dynamic_cast< wxRadioBox* >( obj ); if ( 0 != window ) { window->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( RadioBoxComponent::OnRadioBox ), NULL, this ); } ComponentBase::Cleanup( obj ); } ticpp::Element* ExportToXrc(IObject *obj) { ObjectToXrcFilter xrc(obj, _("wxRadioBox"), obj->GetPropertyAsString(_("name"))); xrc.AddWindowProperties(); xrc.AddProperty(_("label"), _("label"), XRC_TYPE_TEXT); xrc.AddProperty(_("selection"), _("selection"), XRC_TYPE_INTEGER ); xrc.AddProperty(_("choices"), _("content"), XRC_TYPE_STRINGLIST); xrc.AddProperty(_("majorDimension"), _("dimension"), XRC_TYPE_INTEGER); return xrc.GetXrcObject(); } ticpp::Element* ImportFromXrc( ticpp::Element* xrcObj ) { XrcToXfbFilter filter(xrcObj, _("wxRadioBox")); filter.AddWindowProperties(); filter.AddProperty(_("label"),_("label"),XRC_TYPE_TEXT); filter.AddProperty(_("selection"), _("selection"), XRC_TYPE_INTEGER ); filter.AddProperty(_("content"),_("choices"), XRC_TYPE_STRINGLIST); filter.AddProperty(_("dimension"), _("majorDimension"), XRC_TYPE_INTEGER); return filter.GetXfbObject(); } }; class RadioButtonComponent : public ComponentBase { public: wxObject* Create(IObject *obj, wxObject *parent) { wxRadioButton *rb = new wxRadioButton((wxWindow *)parent,-1, obj->GetPropertyAsString(_("label")), obj->GetPropertyAsPoint(_("pos")), obj->GetPropertyAsSize(_("size")), obj->GetPropertyAsInteger(_("style")) | obj->GetPropertyAsInteger(_("window_style"))); rb->SetValue( ( obj->GetPropertyAsInteger(_("value")) != 0 ) ); return rb; } ticpp::Element* ExportToXrc(IObject *obj) { ObjectToXrcFilter xrc(obj, _("wxRadioButton"), obj->GetPropertyAsString(_("name"))); xrc.AddWindowProperties(); xrc.AddProperty(_("label"),_("label"), XRC_TYPE_TEXT); xrc.AddProperty(_("value"),_("value"), XRC_TYPE_BOOL); return xrc.GetXrcObject(); } ticpp::Element* ImportFromXrc( ticpp::Element* xrcObj ) { XrcToXfbFilter filter(xrcObj, _("wxRadioButton")); filter.AddWindowProperties(); filter.AddProperty(_("label"),_("label"), XRC_TYPE_TEXT); filter.AddProperty(_("value"),_("value"), XRC_TYPE_BOOL); return filter.GetXfbObject(); } }; class StatusBarComponent : public ComponentBase { public: wxObject* Create(IObject *obj, wxObject *parent) { wxStatusBar *sb = new wxIndependentStatusBar((wxWindow*)parent, -1, obj->GetPropertyAsInteger(_("style")) | obj->GetPropertyAsInteger(_("window_style"))); sb->SetFieldsCount(obj->GetPropertyAsInteger(_("fields"))); #ifndef __WXMSW__ sb->PushEventHandler( new wxLeftDownRedirect( sb, GetManager() ) ); #endif return sb; } ticpp::Element* ExportToXrc(IObject *obj) { ObjectToXrcFilter xrc(obj, _("wxStatusBar"), obj->GetPropertyAsString(_("name"))); xrc.AddWindowProperties(); xrc.AddProperty(_("fields"),_("fields"),XRC_TYPE_INTEGER); return xrc.GetXrcObject(); } ticpp::Element* ImportFromXrc( ticpp::Element* xrcObj ) { XrcToXfbFilter filter(xrcObj, _("wxStatusBar")); filter.AddWindowProperties(); filter.AddProperty(_("fields"),_("fields"),XRC_TYPE_INTEGER); return filter.GetXfbObject(); } }; class MenuBarComponent : public ComponentBase { public: wxObject* Create(IObject *obj, wxObject* /*parent*/) { wxMenuBar *mb = new wxMenuBar(obj->GetPropertyAsInteger(_("style")) | obj->GetPropertyAsInteger(_("window_style"))); return mb; } ticpp::Element* ExportToXrc(IObject *obj) { ObjectToXrcFilter xrc(obj, _("wxMenuBar"), obj->GetPropertyAsString(_("name"))); xrc.AddProperty(_("label"),_("label"),XRC_TYPE_TEXT); return xrc.GetXrcObject(); } ticpp::Element* ImportFromXrc( ticpp::Element* xrcObj ) { XrcToXfbFilter filter(xrcObj, _("wxMenuBar")); filter.AddProperty(_("label"),_("label"),XRC_TYPE_TEXT); return filter.GetXfbObject(); } }; class MenuComponent : public ComponentBase { public: ticpp::Element* ExportToXrc(IObject *obj) { ObjectToXrcFilter xrc(obj, _("wxMenu"), obj->GetPropertyAsString(_("name"))); xrc.AddProperty(_("label"),_("label"),XRC_TYPE_TEXT); return xrc.GetXrcObject(); } ticpp::Element* ImportFromXrc( ticpp::Element* xrcObj ) { XrcToXfbFilter filter(xrcObj, _("wxMenu")); filter.AddProperty(_("label"),_("label"),XRC_TYPE_TEXT); return filter.GetXfbObject(); } }; class SubMenuComponent : public ComponentBase { public: ticpp::Element* ExportToXrc(IObject *obj) { ObjectToXrcFilter xrc(obj, _("wxMenu"), obj->GetPropertyAsString(_("name"))); xrc.AddProperty(_("label"),_("label"),XRC_TYPE_TEXT); return xrc.GetXrcObject(); } ticpp::Element* ImportFromXrc( ticpp::Element* xrcObj ) { XrcToXfbFilter filter(xrcObj, _("submenu")); filter.AddProperty(_("label"),_("label"),XRC_TYPE_TEXT); return filter.GetXfbObject(); } }; class MenuItemComponent : public ComponentBase { public: ticpp::Element* ExportToXrc(IObject *obj) { ObjectToXrcFilter xrc(obj, _("wxMenuItem"), obj->GetPropertyAsString(_("name"))); wxString shortcut = obj->GetPropertyAsString(_("shortcut")); wxString label; if (shortcut.IsEmpty()) label = obj->GetPropertyAsString(_("label")); else label = obj->GetPropertyAsString(_("label")) + wxT("\\t") + shortcut; xrc.AddPropertyValue(_("label"), label, true); xrc.AddProperty(_("help"),_("help"),XRC_TYPE_TEXT); if (!obj->IsNull(_("bitmap"))) xrc.AddProperty(_("bitmap"),_("bitmap"),XRC_TYPE_BITMAP); int kind = obj->GetPropertyAsInteger(_("kind")); if (obj->GetPropertyAsInteger(_("checked")) && (kind == wxITEM_RADIO || kind == wxITEM_CHECK)) xrc.AddProperty(_("checked"), _("checked"), XRC_TYPE_BOOL); if (obj->GetPropertyAsInteger(_("enabled")) == 0) xrc.AddProperty(_("enabled"), _("enabled"), XRC_TYPE_BOOL); switch (kind) { case wxITEM_CHECK: xrc.AddPropertyValue(_("checkable"), _("1")); break; case wxITEM_RADIO: xrc.AddPropertyValue(_("radio"), _("1")); break; } return xrc.GetXrcObject(); } ticpp::Element* ImportFromXrc( ticpp::Element* xrcObj ) { XrcToXfbFilter filter(xrcObj, _("wxMenuItem")); try { ticpp::Element *labelElement = xrcObj->FirstChildElement("label"); wxString label( labelElement->GetText().c_str(), wxConvUTF8 ); wxString shortcut; int pos = label.Find( wxT("\\t") ); if ( pos >= 0 ) { shortcut = label.Mid( pos + 2 ); label = label.Left( pos ); } filter.AddPropertyValue( _("label"), label, true ); filter.AddPropertyValue( _("shortcut"), shortcut ); } catch( ticpp::Exception& ) { } filter.AddProperty(_("help"),_("help"),XRC_TYPE_TEXT); filter.AddProperty(_("bitmap"),_("bitmap"),XRC_TYPE_BITMAP); return filter.GetXfbObject(); } }; class SeparatorComponent : public ComponentBase { public: ticpp::Element* ExportToXrc(IObject *obj) { ObjectToXrcFilter xrc(obj, _("separator")); return xrc.GetXrcObject(); } ticpp::Element* ImportFromXrc( ticpp::Element* xrcObj ) { XrcToXfbFilter filter(xrcObj, _("separator")); return filter.GetXfbObject(); } }; class ToolBarComponent : public ComponentBase { public: wxObject* Create(IObject *obj, wxObject *parent) { wxToolBar *tb = new wxToolBar((wxWindow*)parent, -1, obj->GetPropertyAsPoint(_("pos")), obj->GetPropertyAsSize(_("size")), obj->GetPropertyAsInteger(_("style")) | obj->GetPropertyAsInteger(_("window_style")) | wxTB_NOALIGN | wxTB_NODIVIDER | wxNO_BORDER); if (!obj->IsNull(_("bitmapsize"))) tb->SetToolBitmapSize(obj->GetPropertyAsSize(_("bitmapsize"))); if (!obj->IsNull(_("margins"))) { wxSize margins(obj->GetPropertyAsSize(_("margins"))); tb->SetMargins(margins.GetWidth(), margins.GetHeight()); } if (!obj->IsNull(_("packing"))) tb->SetToolPacking(obj->GetPropertyAsInteger(_("packing"))); if (!obj->IsNull(_("separation"))) tb->SetToolSeparation(obj->GetPropertyAsInteger(_("separation"))); tb->PushEventHandler( new ComponentEvtHandler( tb, GetManager() ) ); return tb; } void OnCreated( wxObject* wxobject, wxWindow* /*wxparent*/ ) { wxToolBar* tb = wxDynamicCast( wxobject, wxToolBar ); if ( NULL == tb ) { // very very strange return; } size_t count = GetManager()->GetChildCount( wxobject ); for ( size_t i = 0; i < count; ++i ) { wxObject* child = GetManager()->GetChild( wxobject, i ); IObject* childObj = GetManager()->GetIObject( child ); if ( wxT("tool") == childObj->GetClassName() ) { tb->AddTool( wxID_ANY, childObj->GetPropertyAsString( _("label") ), childObj->GetPropertyAsBitmap( _("bitmap") ), wxNullBitmap, (wxItemKind)childObj->GetPropertyAsInteger( _("kind") ), childObj->GetPropertyAsString( _("help") ), wxEmptyString, child ); } else if ( wxT("toolSeparator") == childObj->GetClassName() ) { tb->AddSeparator(); } else { wxControl* control = wxDynamicCast( child, wxControl ); if ( NULL != control ) { tb->AddControl( control ); } } } tb->Realize(); } ticpp::Element* ExportToXrc(IObject *obj) { ObjectToXrcFilter xrc(obj, _("wxToolBar"), obj->GetPropertyAsString(_("name"))); xrc.AddWindowProperties(); xrc.AddProperty(_("bitmapsize"), _("bitmapsize"), XRC_TYPE_SIZE); xrc.AddProperty(_("margins"), _("margins"), XRC_TYPE_SIZE); xrc.AddProperty(_("packing"), _("packing"), XRC_TYPE_INTEGER); xrc.AddProperty(_("separation"), _("separation"), XRC_TYPE_INTEGER); return xrc.GetXrcObject(); } ticpp::Element* ImportFromXrc( ticpp::Element* xrcObj ) { XrcToXfbFilter filter(xrcObj, _("wxToolBar")); filter.AddWindowProperties(); filter.AddProperty(_("bitmapsize"), _("bitmapsize"), XRC_TYPE_SIZE); filter.AddProperty(_("margins"), _("margins"), XRC_TYPE_SIZE); filter.AddProperty(_("packing"), _("packing"), XRC_TYPE_INTEGER); filter.AddProperty(_("separation"), _("separation"), XRC_TYPE_INTEGER); return filter.GetXfbObject(); } }; void ComponentEvtHandler::OnTool( wxCommandEvent& event ) { wxToolBar* tb = wxDynamicCast( event.GetEventObject(), wxToolBar ); if ( NULL == tb ) { // very very strange return; } wxObject* wxobject = tb->GetToolClientData( event.GetId() ); if ( NULL != wxobject ) { m_manager->SelectObject( wxobject ); } } class ToolComponent : public ComponentBase { public: ticpp::Element* ExportToXrc(IObject *obj) { ObjectToXrcFilter xrc(obj, _("tool"), obj->GetPropertyAsString(_("name"))); xrc.AddProperty(_("label"), _("label"), XRC_TYPE_TEXT); xrc.AddProperty(_("tooltip"), _("tooltip"), XRC_TYPE_TEXT); xrc.AddProperty(_("statusbar"), _("longhelp"), XRC_TYPE_TEXT); xrc.AddProperty(_("bitmap"), _("bitmap"), XRC_TYPE_BITMAP); wxItemKind kind = (wxItemKind)obj->GetPropertyAsInteger(_("kind")); if ( wxITEM_CHECK == kind ) { xrc.AddPropertyValue( wxT("toggle"), wxT("1") ); } else if ( wxITEM_RADIO == kind ) { xrc.AddPropertyValue( wxT("radio"), wxT("1") ); } return xrc.GetXrcObject(); } ticpp::Element* ImportFromXrc( ticpp::Element* xrcObj ) { XrcToXfbFilter filter(xrcObj, _("tool")); filter.AddProperty(_("longhelp"), _("statusbar"), XRC_TYPE_TEXT); filter.AddProperty(_("tooltip"), _("tooltip"), XRC_TYPE_TEXT); filter.AddProperty(_("label"), _("label"), XRC_TYPE_TEXT); filter.AddProperty(_("bitmap"), _("bitmap"), XRC_TYPE_BITMAP); bool gotToggle = false; bool gotRadio = false; ticpp::Element* toggle = xrcObj->FirstChildElement( "toggle", false ); if ( toggle ) { toggle->GetTextOrDefault( &gotToggle, false ); if ( gotToggle ) { filter.AddPropertyValue( _("kind"), wxT("wxITEM_CHECK") ); } } if ( !gotToggle ) { ticpp::Element* radio = xrcObj->FirstChildElement( "radio", false ); if ( radio ) { radio->GetTextOrDefault( &gotRadio, false ); if ( gotRadio ) { filter.AddPropertyValue( _("kind"), wxT("wxITEM_RADIO") ); } } } if ( !(gotToggle || gotRadio) ) { filter.AddPropertyValue( _("kind"), wxT("wxITEM_NORMAL") ); } return filter.GetXfbObject(); } }; class ToolSeparatorComponent : public ComponentBase { public: ticpp::Element* ExportToXrc(IObject *obj) { ObjectToXrcFilter xrc( obj, _("separator") ); return xrc.GetXrcObject(); } ticpp::Element* ImportFromXrc( ticpp::Element* xrcObj ) { XrcToXfbFilter filter( xrcObj, _("toolSeparator") ); return filter.GetXfbObject(); } }; class ChoiceComponent : public ComponentBase { public: wxObject* Create(IObject *obj, wxObject *parent) { wxArrayString choices = obj->GetPropertyAsArrayString(_("choices")); wxString *strings = new wxString[choices.Count()]; for (unsigned int i=0; i < choices.Count(); i++) strings[i] = choices[i]; wxChoice *choice = new wxChoice((wxWindow*)parent, -1, obj->GetPropertyAsPoint(_("pos")), obj->GetPropertyAsSize(_("size")), (int)choices.Count(), strings, obj->GetPropertyAsInteger(_("window_style"))); choice->SetSelection(obj->GetPropertyAsInteger(_("selection"))); delete []strings; choice->PushEventHandler( new ComponentEvtHandler( choice, GetManager() ) ); return choice; } ticpp::Element* ExportToXrc(IObject *obj) { ObjectToXrcFilter xrc(obj, _("wxChoice"), obj->GetPropertyAsString(_("name"))); xrc.AddWindowProperties(); xrc.AddProperty(_("selection"), _("selection"), XRC_TYPE_INTEGER); xrc.AddProperty(_("choices"), _("content"), XRC_TYPE_STRINGLIST); return xrc.GetXrcObject(); } ticpp::Element* ImportFromXrc( ticpp::Element* xrcObj ) { XrcToXfbFilter filter(xrcObj, _("wxChoice")); filter.AddWindowProperties(); filter.AddProperty(_("selection"), _("selection"), XRC_TYPE_INTEGER); filter.AddProperty(_("content"),_("choices"), XRC_TYPE_STRINGLIST); return filter.GetXfbObject(); } }; void ComponentEvtHandler::OnChoice( wxCommandEvent& ) { wxChoice* window = wxDynamicCast( m_window, wxChoice ); if ( window != NULL ) { wxString value; value.Printf( wxT("%i"), window->GetSelection() ); m_manager->ModifyProperty( m_window, _("selection"), value ); window->SetFocus(); } } class SliderComponent : public ComponentBase { public: wxObject* Create(IObject *obj, wxObject *parent) { return new wxSlider((wxWindow *)parent,-1, obj->GetPropertyAsInteger(_("value")), obj->GetPropertyAsInteger(_("minValue")), obj->GetPropertyAsInteger(_("maxValue")), obj->GetPropertyAsPoint(_("pos")), obj->GetPropertyAsSize(_("size")), obj->GetPropertyAsInteger(_("style")) | obj->GetPropertyAsInteger(_("window_style")) | obj->GetPropertyAsInteger(_("window_style"))); } ticpp::Element* ExportToXrc(IObject *obj) { ObjectToXrcFilter xrc(obj, _("wxSlider"), obj->GetPropertyAsString(_("name"))); xrc.AddWindowProperties(); xrc.AddProperty(_("value"), _("value"), XRC_TYPE_INTEGER); xrc.AddProperty( _("minValue"), _("min"), XRC_TYPE_INTEGER); xrc.AddProperty( _("maxValue"), _("max"), XRC_TYPE_INTEGER); return xrc.GetXrcObject(); } ticpp::Element* ImportFromXrc( ticpp::Element* xrcObj ) { XrcToXfbFilter filter(xrcObj, _("wxSlider")); filter.AddWindowProperties(); filter.AddProperty(_("value"), _("value"), XRC_TYPE_INTEGER); filter.AddProperty(_("min"), _("minValue"), XRC_TYPE_INTEGER); filter.AddProperty(_("max"), _("maxValue"), XRC_TYPE_INTEGER); return filter.GetXfbObject(); } }; class GaugeComponent : public ComponentBase { public: wxObject* Create(IObject *obj, wxObject *parent) { wxGauge *gauge = new wxGauge((wxWindow *)parent,-1, obj->GetPropertyAsInteger(_("range")), obj->GetPropertyAsPoint(_("pos")), obj->GetPropertyAsSize(_("size")), obj->GetPropertyAsInteger(_("style")) | obj->GetPropertyAsInteger(_("window_style"))); gauge->SetValue(obj->GetPropertyAsInteger(_("value"))); return gauge; } ticpp::Element* ExportToXrc(IObject *obj) { ObjectToXrcFilter xrc(obj, _("wxGauge"), obj->GetPropertyAsString(_("name"))); xrc.AddWindowProperties(); xrc.AddProperty(_("range"), _("range"), XRC_TYPE_INTEGER); xrc.AddProperty(_("value"), _("value"), XRC_TYPE_INTEGER); return xrc.GetXrcObject(); } ticpp::Element* ImportFromXrc( ticpp::Element* xrcObj ) { XrcToXfbFilter filter(xrcObj, _("wxGauge")); filter.AddWindowProperties(); filter.AddProperty(_("range"), _("range"), XRC_TYPE_INTEGER); filter.AddProperty(_("value"), _("value"), XRC_TYPE_INTEGER); return filter.GetXfbObject(); } }; /////////////////////////////////////////////////////////////////////////////// BEGIN_LIBRARY() // forms aren't considered as windows ! ABSTRACT_COMPONENT("Frame",FrameFormComponent) ABSTRACT_COMPONENT("Panel",PanelFormComponent) ABSTRACT_COMPONENT("Dialog",DialogFormComponent) WINDOW_COMPONENT("wxButton",ButtonComponent) WINDOW_COMPONENT("wxBitmapButton",BitmapButtonComponent) WINDOW_COMPONENT("wxTextCtrl",TextCtrlComponent) WINDOW_COMPONENT("wxStaticText",StaticTextComponent) WINDOW_COMPONENT("wxComboBox", ComboBoxComponent) WINDOW_COMPONENT("wxListBox", ListBoxComponent) WINDOW_COMPONENT("wxRadioBox", RadioBoxComponent) WINDOW_COMPONENT("wxRadioButton",RadioButtonComponent) WINDOW_COMPONENT("wxCheckBox", CheckBoxComponent) WINDOW_COMPONENT("wxStaticBitmap", StaticBitmapComponent) WINDOW_COMPONENT("wxStaticLine", StaticLineComponent) WINDOW_COMPONENT("wxMenuBar", MenuBarComponent) WINDOW_COMPONENT("wxMenu", MenuComponent) WINDOW_COMPONENT("submenu", SubMenuComponent) WINDOW_COMPONENT("wxMenuItem", MenuItemComponent) WINDOW_COMPONENT("separator", SeparatorComponent) WINDOW_COMPONENT("wxListCtrl", ListCtrlComponent) WINDOW_COMPONENT("wxStatusBar", StatusBarComponent) WINDOW_COMPONENT("wxToolBar", ToolBarComponent) ABSTRACT_COMPONENT("tool", ToolComponent) ABSTRACT_COMPONENT("toolSeparator", ToolSeparatorComponent) WINDOW_COMPONENT("wxChoice", ChoiceComponent) WINDOW_COMPONENT("wxSlider", SliderComponent) WINDOW_COMPONENT("wxGauge", GaugeComponent) // wxWindow style macros MACRO(wxSIMPLE_BORDER) MACRO(wxDOUBLE_BORDER) MACRO(wxSUNKEN_BORDER) MACRO(wxRAISED_BORDER) MACRO(wxSTATIC_BORDER) MACRO(wxNO_BORDER) MACRO(wxTRANSPARENT_WINDOW) MACRO(wxTAB_TRAVERSAL) MACRO(wxWANTS_CHARS) MACRO(wxVSCROLL) MACRO(wxHSCROLL) MACRO(wxALWAYS_SHOW_SB) MACRO(wxCLIP_CHILDREN) MACRO(wxFULL_REPAINT_ON_RESIZE) MACRO(wxWS_EX_VALIDATE_RECURSIVELY) MACRO(wxWS_EX_BLOCK_EVENTS) MACRO(wxWS_EX_TRANSIENT) MACRO(wxWS_EX_PROCESS_IDLE) MACRO(wxWS_EX_PROCESS_UI_UPDATES) // wxFrame style macros MACRO(wxDEFAULT_FRAME_STYLE) MACRO(wxICONIZE) MACRO(wxCAPTION) MACRO(wxMINIMIZE) MACRO(wxMINIMIZE_BOX) MACRO(wxMAXIMIZE) MACRO(wxMAXIMIZE_BOX) MACRO(wxCLOSE_BOX) MACRO(wxSTAY_ON_TOP) MACRO(wxSYSTEM_MENU) MACRO(wxRESIZE_BORDER) MACRO(wxFRAME_TOOL_WINDOW) MACRO(wxFRAME_NO_TASKBAR) MACRO(wxFRAME_FLOAT_ON_PARENT) MACRO(wxFRAME_SHAPED) MACRO(wxFRAME_EX_CONTEXTHELP) MACRO(wxFRAME_EX_METAL) // wxDialog style macros MACRO(wxCAPTION) MACRO(wxDEFAULT_DIALOG_STYLE) MACRO(wxRESIZE_BORDER) MACRO(wxSYSTEM_MENU) MACRO(wxCLOSE_BOX) MACRO(wxMAXIMIZE_BOX) MACRO(wxMINIMIZE_BOX) MACRO(wxSTAY_ON_TOP) MACRO(wxDIALOG_NO_PARENT) // wxButton MACRO(wxBU_LEFT) MACRO(wxBU_TOP) MACRO(wxBU_RIGHT) MACRO(wxBU_BOTTOM) MACRO(wxBU_EXACTFIT) MACRO(wxBU_AUTODRAW) // wxStaticText MACRO(wxALIGN_LEFT) MACRO(wxALIGN_CENTRE) MACRO(wxALIGN_RIGHT) MACRO(wxST_NO_AUTORESIZE) // wxTextCtrl MACRO(wxTE_MULTILINE) MACRO(wxTE_READONLY) MACRO(wxTE_RICH) MACRO(wxTE_AUTO_URL) MACRO(wxTE_CAPITALIZE) MACRO(wxTE_CENTRE) MACRO(wxTE_CHARWRAP) MACRO(wxTE_DONTWRAP) MACRO(wxTE_LEFT) MACRO(wxTE_NOHIDESEL) MACRO(wxTE_PASSWORD) MACRO(wxTE_PROCESS_ENTER) MACRO(wxTE_PROCESS_TAB) MACRO(wxTE_RICH2) MACRO(wxTE_RIGHT) MACRO(wxTE_WORDWRAP) // wxStaticLine MACRO(wxLI_HORIZONTAL) MACRO(wxLI_VERTICAL) // wxListCtrl MACRO(wxLC_LIST) MACRO(wxLC_REPORT) MACRO(wxLC_VIRTUAL) MACRO(wxLC_ICON) MACRO(wxLC_SMALL_ICON) MACRO(wxLC_ALIGN_TOP) MACRO(wxLC_ALIGN_LEFT) MACRO(wxLC_AUTOARRANGE) MACRO(wxLC_EDIT_LABELS) MACRO(wxLC_NO_SORT_HEADER) MACRO(wxLC_NO_HEADER) MACRO(wxLC_SINGLE_SEL) MACRO(wxLC_SORT_ASCENDING) MACRO(wxLC_SORT_DESCENDING) MACRO(wxLC_HRULES) MACRO(wxLC_VRULES) // wxListBox MACRO(wxLB_SINGLE) MACRO(wxLB_MULTIPLE) MACRO(wxLB_EXTENDED) MACRO(wxLB_HSCROLL) MACRO(wxLB_ALWAYS_SB) MACRO(wxLB_NEEDED_SB) MACRO(wxLB_SORT) // wxRadioBox MACRO(wxRA_SPECIFY_ROWS) MACRO(wxRA_SPECIFY_COLS) MACRO(wxRA_USE_CHECKBOX) // wxRadioButton MACRO(wxRB_GROUP) MACRO(wxRB_SINGLE) MACRO(wxRB_USE_CHECKBOX) // wxStatusBar MACRO(wxST_SIZEGRIP) // wxMenuBar MACRO(wxMB_DOCKABLE) // wxMenuItem MACRO(wxITEM_NORMAL) MACRO(wxITEM_CHECK) MACRO(wxITEM_RADIO) // wxToolBar MACRO(wxTB_FLAT) MACRO(wxTB_DOCKABLE) MACRO(wxTB_HORIZONTAL) MACRO(wxTB_VERTICAL) MACRO(wxTB_TEXT) MACRO(wxTB_NOICONS) MACRO(wxTB_NODIVIDER) MACRO(wxTB_NOALIGN) MACRO(wxTB_HORZ_LAYOUT) MACRO(wxTB_HORZ_TEXT) // wxTool MACRO(wxITEM_NORMAL) MACRO(wxITEM_CHECK) MACRO(wxITEM_RADIO) // wxSlider MACRO(wxSL_AUTOTICKS) MACRO(wxSL_BOTTOM) MACRO(wxSL_HORIZONTAL) MACRO(wxSL_INVERSE) MACRO(wxSL_LABELS) MACRO(wxSL_LEFT) MACRO(wxSL_RIGHT) MACRO(wxSL_SELRANGE) MACRO(wxSL_TOP) MACRO(wxSL_VERTICAL) MACRO(wxSL_BOTH) // wxComboBox MACRO(wxCB_DROPDOWN) MACRO(wxCB_READONLY) MACRO(wxCB_SIMPLE) MACRO(wxCB_SORT) // wxCheckBox MACRO(wxCHK_2STATE) MACRO(wxCHK_3STATE) MACRO(wxCHK_ALLOW_3RD_STATE_FOR_USER) // wxGauge MACRO(wxGA_HORIZONTAL) MACRO(wxGA_SMOOTH) MACRO(wxGA_VERTICAL) //wxDialog MACRO(wxBOTH) SYNONYMOUS(1,wxBOTH) END_LIBRARY() wxformbuilder-3.1.59/plugins/common/premake.lua0000644000175000017500000002206311143440026022052 0ustar rrmulderrrmulder--***************************************************************************** --* Author: RJP Computing --* Date: 12/15/2006 --* Version: 1.00 --* Copyright (C) 2006 RJP Computing --* --* This program is free software; you can redistribute it and/or --* modify it under the terms of the GNU General Public License --* as published by the Free Software Foundation; either version 2 --* of the License, or (at your option) any later version. --* --* This program is distributed in the hope that it will be useful, --* but WITHOUT ANY WARRANTY; without even the implied warranty of --* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --* GNU General Public License for more details. --* --* You should have received a copy of the GNU General Public License --* along with this program; if not, write to the Free Software --* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --* --* NOTES: --* - use the '/' slash for all paths. --***************************************************************************** -- wxWidgets version local wx_ver = "28" --******* Initial Setup ************ --* Most of the setting are set here. --********************************** -- Set the name of your package. package.name = "common-components-plugin" -- Set this if you want a different name for your target than the package's name. local targetName = "common" -- Set the kind of package you want to create. -- Options: exe | winexe | lib | dll package.kind = "dll" -- Set the files to include. package.files = { matchrecursive( "*.cpp", "*.h", "*.rc" ) } -- Set the include paths. package.includepaths = { "../../sdk/tinyxml", "../../sdk/plugin_interface" } -- Set the libraries it links to. package.links = { "plugin-interface", "TiCPP" } -- Setup the output directory options. -- Note: Use 'libdir' for "lib" kind only. if ( windows ) then package.bindir = "../../output/plugins/common" else package.bindir = "../../output/lib/wxformbuilder" end --package.libdir = "../../lib" -- Set the defines. package.defines = { "BUILD_DLL", "TIXML_USE_TICPP" } -- Hack the dll output to prefix 'lib' to the begining. package.targetprefix = "lib" --------------------------- DO NOT EDIT BELOW ---------------------------------- --******* GENAERAL SETUP ********** --* Settings that are not dependant --* on the operating system. --********************************* -- Package options addoption( "unicode", "Use the Unicode character set" ) addoption( "with-wx-shared", "Link against wxWidgets as a shared library" ) if ( not windows ) then addoption( "disable-wx-debug", "Compile against a wxWidgets library without debugging" ) end -- Common setup package.language = "c++" -- Set object output directory. if ( options["unicode"] ) then package.config["Debug"].objdir = ".objsud" package.config["Release"].objdir = ".objsu" else package.config["Debug"].objdir = ".objsd" package.config["Release"].objdir = ".objs" end -- Set debug flags if ( options["disable-wx-debug"] and ( not windows ) ) then debug_option = "--debug=no" debug_macro = { "NDEBUG", "__WXFB_DEBUG__" } else debug_option = "--debug=yes" debug_macro = { "DEBUG", "_DEBUG", "__WXDEBUG__", "__WXFB_DEBUG__" } end -- Set the default targetName if none is specified. if ( string.len( targetName ) == 0 ) then targetName = package.name end -- Set the targets. package.config["Release"].target = targetName package.config["Debug"].target = targetName.."d" -- Set the build options. package.buildflags = { "extra-warnings" } package.config["Release"].buildflags = { "no-symbols", "optimize-speed" } if ( options["unicode"] ) then table.insert( package.buildflags, "unicode" ) end if ( string.find( target or "", ".*-gcc" ) or target == "gnu" ) then table.insert( package.buildflags, "no-import-lib" ) table.insert( package.config["Debug"].buildoptions, "-O0" ) table.insert( package.config["Release"].buildoptions, "-fno-strict-aliasing" ) end -- Set the defines. if ( options["with-wx-shared"] ) then table.insert( package.defines, "WXUSINGDLL" ) end if ( options["unicode"] ) then table.insert( package.defines, { "UNICODE", "_UNICODE" } ) end table.insert( package.defines, "__WX__" ) table.insert( package.config["Debug"].defines, debug_macro ) table.insert( package.config["Release"].defines, "NDEBUG" ) if ( windows ) then --******* WINDOWS SETUP *********** --* Settings that are Windows specific. --********************************* -- Set wxWidgets include paths if ( target == "cb-gcc" ) then table.insert( package.includepaths, "$(#WX.include)" ) else table.insert( package.includepaths, "$(WXWIN)/include" ) end -- Set the correct 'setup.h' include path. if ( options["with-wx-shared"] ) then if ( options["unicode"] ) then if ( target == "cb-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(#WX.lib)/gcc_dll/mswud" ) table.insert( package.config["Release"].includepaths, "$(#WX.lib)/gcc_dll/mswu" ) elseif ( target == "gnu" or target == "cl-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/gcc_dll/mswud" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/gcc_dll/mswu" ) else table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/vc_dll/mswud" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/vc_dll/mswu" ) end else if ( target == "cb-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(#WX.lib)/gcc_dll/mswd" ) table.insert( package.config["Release"].includepaths, "$(#WX.lib)/gcc_dll/msw" ) elseif ( target == "gnu" or target == "cl-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/gcc_dll/mswd" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/gcc_dll/msw" ) else table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/vc_dll/mswd" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/vc_dll/msw" ) end end else if ( options["unicode"] ) then if ( target == "cb-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(#WX.lib)/gcc_lib/mswud" ) table.insert( package.config["Release"].includepaths, "$(#WX.lib)/gcc_lib/mswu" ) elseif ( target == "gnu" or target == "cl-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/gcc_lib/mswud" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/gcc_lib/mswu" ) else table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/vc_lib/mswud" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/vc_lib/mswu" ) end else if ( target == "cb-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(#WX.lib)/gcc_lib/mswd" ) table.insert( package.config["Release"].includepaths, "$(#WX.lib)/gcc_lib/msw" ) elseif ( target == "gnu" or target == "cl-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/gcc_lib/mswd" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/gcc_lib/msw" ) else table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/vc_lib/mswd" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/vc_lib/msw" ) end end end -- Set the linker options. if ( options["with-wx-shared"] ) then if ( target == "cb-gcc" ) then table.insert( package.libpaths, "$(#WX.lib)/gcc_dll" ) elseif ( target == "gnu" or target == "cl-gcc" ) then table.insert( package.libpaths, "$(WXWIN)/lib/gcc_dll" ) else table.insert( package.libpaths, "$(WXWIN)/lib/vc_dll" ) end else if ( target == "cb-gcc" ) then table.insert( package.libpaths, "$(#WX.lib)/gcc_lib" ) elseif ( target == "gnu" or target == "cl-gcc" ) then table.insert( package.libpaths, "$(WXWIN)/lib/gcc_lib" ) else table.insert( package.libpaths, "$(WXWIN)/lib/vc_lib" ) end end -- Set wxWidgets libraries to link. if ( options["unicode"] ) then table.insert( package.config["Release"].links, "wxmsw"..wx_ver.."u" ) table.insert( package.config["Debug"].links, "wxmsw"..wx_ver.."ud" ) else table.insert( package.config["Release"].links, "wxmsw"..wx_ver ) table.insert( package.config["Debug"].links, "wxmsw"..wx_ver.."d" ) end -- Set the Windows defines. table.insert( package.defines, { "__WXMSW__", "WIN32", "_WINDOWS" } ) else --******* LINUX/MAC SETUP ************* --* Settings that are Linux/Mac specific. --************************************* -- Ignore resource files in Linux/Mac. table.insert( package.excludes, matchrecursive( "*.rc" ) ) table.insert( package.buildoptions, "-fPIC" ) -- Add buildflag for proper dll building. if ( macosx ) then table.insert( package.buildflags, "dylib" ) end -- Set wxWidgets build options. table.insert( package.config["Debug"].buildoptions, "`wx-config "..debug_option.." --cflags`" ) table.insert( package.config["Release"].buildoptions, "`wx-config --debug=no --cflags`" ) -- Set the wxWidgets link options. table.insert( package.config["Debug"].linkoptions, "`wx-config "..debug_option.." --libs`" ) table.insert( package.config["Release"].linkoptions, "`wx-config --libs`" ) end wxformbuilder-3.1.59/plugins/common/Makefile0000644000175000017500000000673411143440026021372 0ustar rrmulderrrmulder# C++ Shared Library Makefile autogenerated by premake # Don't edit this file! Instead edit `premake.lua` then rerun `make` ifndef CONFIG CONFIG=Release endif ifeq ($(CONFIG),Release) BINDIR := ../../output/lib/wxformbuilder LIBDIR := ../.. OBJDIR := .objsu OUTDIR := ../../output/lib/wxformbuilder CPPFLAGS := -MMD -D "BUILD_DLL" -D "TIXML_USE_TICPP" -D "WXUSINGDLL" -D "UNICODE" -D "_UNICODE" -D "__WX__" -D "NDEBUG" -I "../../sdk/tinyxml" -I "../../sdk/plugin_interface" CFLAGS += $(CPPFLAGS) $(TARGET_ARCH) -fPIC -O3 -Wall -fPIC -fno-strict-aliasing `wx-config --debug=no --cflags` CXXFLAGS := $(CFLAGS) LDFLAGS += -L$(BINDIR) -L$(LIBDIR) -shared -s `wx-config --libs` -L../../sdk/lib -lfbPluginInterface -L../../sdk/lib -lticpp LDDEPS := ../../sdk/lib/libfbPluginInterface.a ../../sdk/lib/libticpp.a RESFLAGS := -D "BUILD_DLL" -D "TIXML_USE_TICPP" -D "WXUSINGDLL" -D "UNICODE" -D "_UNICODE" -D "__WX__" -D "NDEBUG" -I "../../sdk/tinyxml" -I "../../sdk/plugin_interface" TARGET := libcommon.so BLDCMD = $(CXX) -o $(OUTDIR)/$(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(TARGET_ARCH) endif ifeq ($(CONFIG),Debug) BINDIR := ../../output/lib/wxformbuilder LIBDIR := ../.. OBJDIR := .objsud OUTDIR := ../../output/lib/wxformbuilder CPPFLAGS := -MMD -D "BUILD_DLL" -D "TIXML_USE_TICPP" -D "WXUSINGDLL" -D "UNICODE" -D "_UNICODE" -D "__WX__" -D "NDEBUG" -D "__WXFB_DEBUG__" -I "../../sdk/tinyxml" -I "../../sdk/plugin_interface" CFLAGS += $(CPPFLAGS) $(TARGET_ARCH) -fPIC -g -Wall -fPIC -O0 `wx-config --debug=no --cflags` CXXFLAGS := $(CFLAGS) LDFLAGS += -L$(BINDIR) -L$(LIBDIR) -shared `wx-config --debug=no --libs` -L../../sdk/lib -lfbPluginInterfaced -L../../sdk/lib -lticppd LDDEPS := ../../sdk/lib/libfbPluginInterfaced.a ../../sdk/lib/libticppd.a RESFLAGS := -D "BUILD_DLL" -D "TIXML_USE_TICPP" -D "WXUSINGDLL" -D "UNICODE" -D "_UNICODE" -D "__WX__" -D "NDEBUG" -D "__WXFB_DEBUG__" -I "../../sdk/tinyxml" -I "../../sdk/plugin_interface" TARGET := libcommond.so BLDCMD = $(CXX) -o $(OUTDIR)/$(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(TARGET_ARCH) endif OBJECTS := \ $(OBJDIR)/common.o \ MKDIR_TYPE := msdos CMD := $(subst \,\\,$(ComSpec)$(COMSPEC)) ifeq (,$(CMD)) MKDIR_TYPE := posix endif ifeq (/bin/sh.exe,$(SHELL)) MKDIR_TYPE := posix endif ifeq ($(MKDIR_TYPE),posix) CMD_MKBINDIR := mkdir -p $(BINDIR) CMD_MKLIBDIR := mkdir -p $(LIBDIR) CMD_MKOUTDIR := mkdir -p $(OUTDIR) CMD_MKOBJDIR := mkdir -p $(OBJDIR) else CMD_MKBINDIR := $(CMD) /c if not exist $(subst /,\\,$(BINDIR)) mkdir $(subst /,\\,$(BINDIR)) CMD_MKLIBDIR := $(CMD) /c if not exist $(subst /,\\,$(LIBDIR)) mkdir $(subst /,\\,$(LIBDIR)) CMD_MKOUTDIR := $(CMD) /c if not exist $(subst /,\\,$(OUTDIR)) mkdir $(subst /,\\,$(OUTDIR)) CMD_MKOBJDIR := $(CMD) /c if not exist $(subst /,\\,$(OBJDIR)) mkdir $(subst /,\\,$(OBJDIR)) endif .PHONY: clean $(OUTDIR)/$(TARGET): $(OBJECTS) $(LDDEPS) $(RESOURCES) @echo Linking common-components-plugin -@$(CMD_MKBINDIR) -@$(CMD_MKLIBDIR) -@$(CMD_MKOUTDIR) @$(BLDCMD) clean: @echo Cleaning common-components-plugin ifeq ($(MKDIR_TYPE),posix) -@rm -f $(OUTDIR)/$(TARGET) -@rm -rf $(OBJDIR) else -@if exist $(subst /,\,$(OUTDIR)/$(TARGET)) del /q $(subst /,\,$(OUTDIR)/$(TARGET)) -@if exist $(subst /,\,$(OBJDIR)) del /q $(subst /,\,$(OBJDIR)) -@if exist $(subst /,\,$(OBJDIR)) rmdir /s /q $(subst /,\,$(OBJDIR)) endif $(OBJDIR)/common.o: common.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -include $(OBJECTS:%.o=%.d) wxformbuilder-3.1.59/plugins/layout/premake.lua0000644000175000017500000002207311143440026022100 0ustar rrmulderrrmulder--***************************************************************************** --* Author: RJP Computing --* Date: 12/15/2006 --* Version: 1.00 --* Copyright (C) 2006 RJP Computing --* --* This program is free software; you can redistribute it and/or --* modify it under the terms of the GNU General Public License --* as published by the Free Software Foundation; either version 2 --* of the License, or (at your option) any later version. --* --* This program is distributed in the hope that it will be useful, --* but WITHOUT ANY WARRANTY; without even the implied warranty of --* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --* GNU General Public License for more details. --* --* You should have received a copy of the GNU General Public License --* along with this program; if not, write to the Free Software --* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --* --* NOTES: --* - use the '/' slash for all paths. --***************************************************************************** -- wxWidgets version local wx_ver = "28" --******* Initial Setup ************ --* Most of the setting are set here. --********************************** -- Set the name of your package. package.name = "layout-components-plugin" -- Set this if you want a different name for your target than the package's name. local targetName = "layout" -- Set the kind of package you want to create. -- Options: exe | winexe | lib | dll package.kind = "dll" -- Set the files to include. package.files = { matchrecursive( "*.cpp", "*.h", "*.rc" ) } -- Set the include paths. package.includepaths = { "../../sdk/tinyxml", "../../sdk/plugin_interface" } -- Set the libraries it links to. package.links = { "plugin-interface", "TiCPP" } -- Setup the output directory options. -- Note: Use 'libdir' for "lib" kind only. if ( windows ) then package.bindir = "../../output/plugins/layout" else package.bindir = "../../output/lib/wxformbuilder" end --package.libdir = "../../lib" -- Set the defines. package.defines = { "BUILD_DLL", "TIXML_USE_TICPP" } -- Hack the dll output to prefix 'lib' to the begining. package.targetprefix = "lib" --------------------------- DO NOT EDIT BELOW ---------------------------------- --******* GENAERAL SETUP ********** --* Settings that are not dependant --* on the operating system. --********************************* -- Package options addoption( "unicode", "Use the Unicode character set" ) addoption( "with-wx-shared", "Link against wxWidgets as a shared library" ) if ( not windows ) then addoption( "disable-wx-debug", "Compile against a wxWidgets library without debugging" ) end -- Common setup package.language = "c++" -- Set object output directory. if ( options["unicode"] ) then package.config["Debug"].objdir = ".objsud" package.config["Release"].objdir = ".objsu" else package.config["Debug"].objdir = ".objsd" package.config["Release"].objdir = ".objs" end -- Set debug flags if ( options["disable-wx-debug"] and ( not windows ) ) then debug_option = "--debug=no" debug_macro = { "NDEBUG", "__WXFB_DEBUG__" } else debug_option = "--debug=yes" debug_macro = { "DEBUG", "_DEBUG", "__WXDEBUG__", "__WXFB_DEBUG__" } end -- Set the default targetName if none is specified. if ( string.len( targetName ) == 0 ) then targetName = package.name end -- Set the targets. package.config["Release"].target = targetName package.config["Debug"].target = targetName.."d" -- Set the build options. package.buildflags = { "extra-warnings" } package.config["Release"].buildflags = { "no-symbols", "optimize-speed" } if ( options["unicode"] ) then table.insert( package.buildflags, "unicode" ) end if ( string.find( target or "", ".*-gcc" ) or target == "gnu" ) then table.insert( package.buildflags, "no-import-lib" ) table.insert( package.config["Debug"].buildoptions, "-O0" ) table.insert( package.config["Release"].buildoptions, "-fno-strict-aliasing" ) end -- Set the defines. if ( options["with-wx-shared"] ) then table.insert( package.defines, "WXUSINGDLL" ) end if ( options["unicode"] ) then table.insert( package.defines, { "UNICODE", "_UNICODE" } ) end table.insert( package.defines, "__WX__" ) table.insert( package.config["Debug"].defines, debug_macro ) table.insert( package.config["Release"].defines, "NDEBUG" ) if ( OS == "windows" ) then --******* WINDOWS SETUP *********** --* Settings that are Windows specific. --********************************* -- Set wxWidgets include paths if ( target == "cb-gcc" ) then table.insert( package.includepaths, "$(#WX.include)" ) else table.insert( package.includepaths, "$(WXWIN)/include" ) end -- Set the correct 'setup.h' include path. if ( options["with-wx-shared"] ) then if ( options["unicode"] ) then if ( target == "cb-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(#WX.lib)/gcc_dll/mswud" ) table.insert( package.config["Release"].includepaths, "$(#WX.lib)/gcc_dll/mswu" ) elseif ( target == "gnu" or target == "cl-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/gcc_dll/mswud" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/gcc_dll/mswu" ) else table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/vc_dll/mswud" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/vc_dll/mswu" ) end else if ( target == "cb-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(#WX.lib)/gcc_dll/mswd" ) table.insert( package.config["Release"].includepaths, "$(#WX.lib)/gcc_dll/msw" ) elseif ( target == "gnu" or target == "cl-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/gcc_dll/mswd" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/gcc_dll/msw" ) else table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/vc_dll/mswd" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/vc_dll/msw" ) end end else if ( options["unicode"] ) then if ( target == "cb-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(#WX.lib)/gcc_lib/mswud" ) table.insert( package.config["Release"].includepaths, "$(#WX.lib)/gcc_lib/mswu" ) elseif ( target == "gnu" or target == "cl-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/gcc_lib/mswud" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/gcc_lib/mswu" ) else table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/vc_lib/mswud" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/vc_lib/mswu" ) end else if ( target == "cb-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(#WX.lib)/gcc_lib/mswd" ) table.insert( package.config["Release"].includepaths, "$(#WX.lib)/gcc_lib/msw" ) elseif ( target == "gnu" or target == "cl-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/gcc_lib/mswd" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/gcc_lib/msw" ) else table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/vc_lib/mswd" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/vc_lib/msw" ) end end end -- Set the linker options. if ( options["with-wx-shared"] ) then if ( target == "cb-gcc" ) then table.insert( package.libpaths, "$(#WX.lib)/gcc_dll" ) elseif ( target == "gnu" or target == "cl-gcc" ) then table.insert( package.libpaths, "$(WXWIN)/lib/gcc_dll" ) else table.insert( package.libpaths, "$(WXWIN)/lib/vc_dll" ) end else if ( target == "cb-gcc" ) then table.insert( package.libpaths, "$(#WX.lib)/gcc_lib" ) elseif ( target == "gnu" or target == "cl-gcc" ) then table.insert( package.libpaths, "$(WXWIN)/lib/gcc_lib" ) else table.insert( package.libpaths, "$(WXWIN)/lib/vc_lib" ) end end -- Set wxWidgets libraries to link. if ( options["unicode"] ) then table.insert( package.config["Release"].links, "wxmsw"..wx_ver.."u" ) table.insert( package.config["Debug"].links, "wxmsw"..wx_ver.."ud" ) else table.insert( package.config["Release"].links, "wxmsw"..wx_ver ) table.insert( package.config["Debug"].links, "wxmsw"..wx_ver.."d" ) end -- Set the Windows defines. table.insert( package.defines, { "__WXMSW__", "WIN32", "_WINDOWS" } ) else --******* LINUX/MAC SETUP ************* --* Settings that are Linux/Mac specific. --************************************* -- Ignore resource files in Linux/Mac. table.insert( package.excludes, matchrecursive( "*.rc" ) ) table.insert( package.buildoptions, "-fPIC" ) -- Add buildflag for proper dll building. if ( macosx ) then table.insert( package.buildflags, "dylib" ) end -- Set wxWidgets build options. table.insert( package.config["Debug"].buildoptions, "`wx-config "..debug_option.." --cflags`" ) table.insert( package.config["Release"].buildoptions, "`wx-config --debug=no --cflags`" ) -- Set the wxWidgets link options. table.insert( package.config["Debug"].linkoptions, "`wx-config "..debug_option.." --libs`" ) table.insert( package.config["Release"].linkoptions, "`wx-config --libs`" ) end wxformbuilder-3.1.59/plugins/layout/Makefile0000644000175000017500000000673411143440026021417 0ustar rrmulderrrmulder# C++ Shared Library Makefile autogenerated by premake # Don't edit this file! Instead edit `premake.lua` then rerun `make` ifndef CONFIG CONFIG=Release endif ifeq ($(CONFIG),Release) BINDIR := ../../output/lib/wxformbuilder LIBDIR := ../.. OBJDIR := .objsu OUTDIR := ../../output/lib/wxformbuilder CPPFLAGS := -MMD -D "BUILD_DLL" -D "TIXML_USE_TICPP" -D "WXUSINGDLL" -D "UNICODE" -D "_UNICODE" -D "__WX__" -D "NDEBUG" -I "../../sdk/tinyxml" -I "../../sdk/plugin_interface" CFLAGS += $(CPPFLAGS) $(TARGET_ARCH) -fPIC -O3 -Wall -fPIC -fno-strict-aliasing `wx-config --debug=no --cflags` CXXFLAGS := $(CFLAGS) LDFLAGS += -L$(BINDIR) -L$(LIBDIR) -shared -s `wx-config --libs` -L../../sdk/lib -lfbPluginInterface -L../../sdk/lib -lticpp LDDEPS := ../../sdk/lib/libfbPluginInterface.a ../../sdk/lib/libticpp.a RESFLAGS := -D "BUILD_DLL" -D "TIXML_USE_TICPP" -D "WXUSINGDLL" -D "UNICODE" -D "_UNICODE" -D "__WX__" -D "NDEBUG" -I "../../sdk/tinyxml" -I "../../sdk/plugin_interface" TARGET := liblayout.so BLDCMD = $(CXX) -o $(OUTDIR)/$(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(TARGET_ARCH) endif ifeq ($(CONFIG),Debug) BINDIR := ../../output/lib/wxformbuilder LIBDIR := ../.. OBJDIR := .objsud OUTDIR := ../../output/lib/wxformbuilder CPPFLAGS := -MMD -D "BUILD_DLL" -D "TIXML_USE_TICPP" -D "WXUSINGDLL" -D "UNICODE" -D "_UNICODE" -D "__WX__" -D "NDEBUG" -D "__WXFB_DEBUG__" -I "../../sdk/tinyxml" -I "../../sdk/plugin_interface" CFLAGS += $(CPPFLAGS) $(TARGET_ARCH) -fPIC -g -Wall -fPIC -O0 `wx-config --debug=no --cflags` CXXFLAGS := $(CFLAGS) LDFLAGS += -L$(BINDIR) -L$(LIBDIR) -shared `wx-config --debug=no --libs` -L../../sdk/lib -lfbPluginInterfaced -L../../sdk/lib -lticppd LDDEPS := ../../sdk/lib/libfbPluginInterfaced.a ../../sdk/lib/libticppd.a RESFLAGS := -D "BUILD_DLL" -D "TIXML_USE_TICPP" -D "WXUSINGDLL" -D "UNICODE" -D "_UNICODE" -D "__WX__" -D "NDEBUG" -D "__WXFB_DEBUG__" -I "../../sdk/tinyxml" -I "../../sdk/plugin_interface" TARGET := liblayoutd.so BLDCMD = $(CXX) -o $(OUTDIR)/$(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(TARGET_ARCH) endif OBJECTS := \ $(OBJDIR)/layout.o \ MKDIR_TYPE := msdos CMD := $(subst \,\\,$(ComSpec)$(COMSPEC)) ifeq (,$(CMD)) MKDIR_TYPE := posix endif ifeq (/bin/sh.exe,$(SHELL)) MKDIR_TYPE := posix endif ifeq ($(MKDIR_TYPE),posix) CMD_MKBINDIR := mkdir -p $(BINDIR) CMD_MKLIBDIR := mkdir -p $(LIBDIR) CMD_MKOUTDIR := mkdir -p $(OUTDIR) CMD_MKOBJDIR := mkdir -p $(OBJDIR) else CMD_MKBINDIR := $(CMD) /c if not exist $(subst /,\\,$(BINDIR)) mkdir $(subst /,\\,$(BINDIR)) CMD_MKLIBDIR := $(CMD) /c if not exist $(subst /,\\,$(LIBDIR)) mkdir $(subst /,\\,$(LIBDIR)) CMD_MKOUTDIR := $(CMD) /c if not exist $(subst /,\\,$(OUTDIR)) mkdir $(subst /,\\,$(OUTDIR)) CMD_MKOBJDIR := $(CMD) /c if not exist $(subst /,\\,$(OBJDIR)) mkdir $(subst /,\\,$(OBJDIR)) endif .PHONY: clean $(OUTDIR)/$(TARGET): $(OBJECTS) $(LDDEPS) $(RESOURCES) @echo Linking layout-components-plugin -@$(CMD_MKBINDIR) -@$(CMD_MKLIBDIR) -@$(CMD_MKOUTDIR) @$(BLDCMD) clean: @echo Cleaning layout-components-plugin ifeq ($(MKDIR_TYPE),posix) -@rm -f $(OUTDIR)/$(TARGET) -@rm -rf $(OBJDIR) else -@if exist $(subst /,\,$(OUTDIR)/$(TARGET)) del /q $(subst /,\,$(OUTDIR)/$(TARGET)) -@if exist $(subst /,\,$(OBJDIR)) del /q $(subst /,\,$(OBJDIR)) -@if exist $(subst /,\,$(OBJDIR)) rmdir /s /q $(subst /,\,$(OBJDIR)) endif $(OBJDIR)/layout.o: layout.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -include $(OBJECTS:%.o=%.d) wxformbuilder-3.1.59/plugins/layout/layout.cpp0000644000175000017500000005243411143440026021776 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include #include #ifdef __WX24__ #define wxFIXED_MINSIZE wxADJUST_MINSIZE #endif class SpacerComponent : public ComponentBase { public: // ImportFromXRC is handled in sizeritem components ticpp::Element* ExportToXrc(IObject *obj) { ObjectToXrcFilter xrc(obj, _("spacer")); xrc.AddPropertyPair( _("width"), _("height"), _("size") ); return xrc.GetXrcObject(); } }; class GBSizerItemComponent : public ComponentBase { public: ticpp::Element* ExportToXrc(IObject *obj) { ObjectToXrcFilter xrc(obj, _("sizeritem")); xrc.AddPropertyPair( _("row"), _("column"), _("cellpos") ); xrc.AddPropertyPair( _("rowspan"), _("colspan"), _("cellspan") ); xrc.AddProperty(_("flag"), _("flag"), XRC_TYPE_BITLIST); xrc.AddProperty(_("border"), _("border"), XRC_TYPE_INTEGER); return xrc.GetXrcObject(); } ticpp::Element* ImportFromXrc( ticpp::Element* xrcObj ) { // XrcLoader::GetObject imports spacers as sizeritems XrcToXfbFilter filter(xrcObj, _("gbsizeritem")); filter.AddPropertyPair( "cellpos", _("row"), _("column") ); filter.AddPropertyPair( "cellspan", _("rowspan"), _("colspan") ); filter.AddProperty(_("flag"), _("flag"), XRC_TYPE_BITLIST); filter.AddProperty(_("border"), _("border"), XRC_TYPE_INTEGER); ticpp::Element* sizeritem = filter.GetXfbObject(); // XrcLoader::GetObject imports spacers as sizeritems, so check for a spacer if ( xrcObj->FirstChildElement( "size", false ) && !xrcObj->FirstChildElement( "object", false ) ) { // it is a spacer XrcToXfbFilter spacer( xrcObj, _("spacer") ); spacer.AddPropertyPair( "size", _("width"), _("height") ); sizeritem->LinkEndChild( spacer.GetXfbObject() ); } return sizeritem; } }; class SizerItemComponent : public ComponentBase { public: void OnCreated( wxObject* wxobject, wxWindow* /*wxparent*/ ) { // Get parent sizer wxObject* parent = GetManager()->GetParent( wxobject ); wxSizer* sizer = wxDynamicCast( parent, wxSizer ); if ( NULL == sizer ) { wxLogError( wxT("The parent of a SizerItem is either missing or not a wxSizer - this should not be possible!") ); return; } // Get child window wxObject* child = GetManager()->GetChild( wxobject, 0 ); if ( NULL == child ) { wxLogError( wxT("The SizerItem component has no child - this should not be possible!") ); return; } // Get IObject for property access IObject* obj = GetManager()->GetIObject( wxobject ); IObject* childObj = GetManager()->GetIObject( child ); // Add the spacer if ( _("spacer") == childObj->GetClassName() ) { sizer->Add( childObj->GetPropertyAsInteger( _("width") ), childObj->GetPropertyAsInteger( _("height") ), obj->GetPropertyAsInteger(_("proportion")), obj->GetPropertyAsInteger(_("flag")), obj->GetPropertyAsInteger(_("border")) ); return; } // Add the child ( window or sizer ) to the sizer wxWindow* windowChild = wxDynamicCast( child, wxWindow ); wxSizer* sizerChild = wxDynamicCast( child, wxSizer ); if ( windowChild != NULL ) { sizer->Add( windowChild, obj->GetPropertyAsInteger(_("proportion")), obj->GetPropertyAsInteger(_("flag")), obj->GetPropertyAsInteger(_("border"))); } else if ( sizerChild != NULL ) { sizer->Add( sizerChild, obj->GetPropertyAsInteger(_("proportion")), obj->GetPropertyAsInteger(_("flag")), obj->GetPropertyAsInteger(_("border"))); } else { wxLogError( wxT("The SizerItem component's child is not a wxWindow or a wxSizer or a spacer - this should not be possible!") ); } } ticpp::Element* ExportToXrc(IObject *obj) { ObjectToXrcFilter xrc(obj, _("sizeritem")); xrc.AddProperty(_("proportion"), _("option"), XRC_TYPE_INTEGER); xrc.AddProperty(_("flag"), _("flag"), XRC_TYPE_BITLIST); xrc.AddProperty(_("border"), _("border"), XRC_TYPE_INTEGER); return xrc.GetXrcObject(); } ticpp::Element* ImportFromXrc( ticpp::Element* xrcObj ) { XrcToXfbFilter filter(xrcObj, _("sizeritem")); filter.AddProperty(_("option"), _("proportion"), XRC_TYPE_INTEGER); filter.AddProperty(_("flag"), _("flag"), XRC_TYPE_BITLIST); filter.AddProperty(_("border"), _("border"), XRC_TYPE_INTEGER); ticpp::Element* sizeritem = filter.GetXfbObject(); // XrcLoader::GetObject imports spacers as sizeritems, so check for a spacer if ( xrcObj->FirstChildElement("size", false ) && !xrcObj->FirstChildElement("object", false ) ) { // it is a spacer XrcToXfbFilter spacer( xrcObj, _("spacer") ); spacer.AddPropertyPair( "size", _("width"), _("height") ); sizeritem->LinkEndChild( spacer.GetXfbObject() ); } return sizeritem; } }; class BoxSizerComponent : public ComponentBase { public: wxObject* Create(IObject *obj, wxObject * /*parent*/) { return new wxBoxSizer(obj->GetPropertyAsInteger(_("orient"))); } ticpp::Element* ExportToXrc(IObject *obj) { ObjectToXrcFilter xrc(obj, _("wxBoxSizer")); xrc.AddProperty(_("orient"), _("orient"), XRC_TYPE_TEXT); return xrc.GetXrcObject(); } ticpp::Element* ImportFromXrc( ticpp::Element* xrcObj ) { XrcToXfbFilter filter(xrcObj, _("wxBoxSizer")); filter.AddProperty(_("orient"),_("orient"),XRC_TYPE_TEXT); return filter.GetXfbObject(); } }; class StaticBoxSizerComponent : public ComponentBase { public: int m_count; StaticBoxSizerComponent() { m_count = 0; } wxObject* Create(IObject *obj, wxObject *parent) { m_count++; wxStaticBox* box = new wxStaticBox((wxWindow *)parent, -1, obj->GetPropertyAsString(_("label"))); wxStaticBoxSizer* sizer = new wxStaticBoxSizer(box, obj->GetPropertyAsInteger(_("orient"))); return sizer; } ticpp::Element* ExportToXrc(IObject *obj) { ObjectToXrcFilter xrc(obj, _("wxStaticBoxSizer")); xrc.AddProperty(_("orient"), _("orient"), XRC_TYPE_TEXT); xrc.AddProperty(_("label"), _("label"), XRC_TYPE_TEXT); return xrc.GetXrcObject(); } ticpp::Element* ImportFromXrc( ticpp::Element* xrcObj ) { XrcToXfbFilter filter(xrcObj, _("wxStaticBoxSizer")); filter.AddProperty(_("orient"),_("orient"),XRC_TYPE_TEXT); filter.AddProperty(_("label"),_("label"),XRC_TYPE_TEXT); return filter.GetXfbObject(); } }; class GridSizerComponent : public ComponentBase { public: wxObject* Create(IObject *obj, wxObject * /*parent*/) { return new wxGridSizer( obj->GetPropertyAsInteger(_("rows")), obj->GetPropertyAsInteger(_("cols")), obj->GetPropertyAsInteger(_("vgap")), obj->GetPropertyAsInteger(_("hgap"))); } ticpp::Element* ExportToXrc(IObject *obj) { ObjectToXrcFilter xrc(obj, _("wxGridSizer")); xrc.AddProperty(_("rows"), _("rows"), XRC_TYPE_INTEGER); xrc.AddProperty(_("cols"), _("cols"), XRC_TYPE_INTEGER); xrc.AddProperty(_("vgap"), _("vgap"), XRC_TYPE_INTEGER); xrc.AddProperty(_("hgap"), _("hgap"), XRC_TYPE_INTEGER); return xrc.GetXrcObject(); } ticpp::Element* ImportFromXrc( ticpp::Element* xrcObj ) { XrcToXfbFilter filter(xrcObj, _("wxGridSizer")); filter.AddProperty(_("rows"), _("rows"), XRC_TYPE_INTEGER); filter.AddProperty(_("cols"), _("cols"), XRC_TYPE_INTEGER); filter.AddProperty(_("vgap"), _("vgap"), XRC_TYPE_INTEGER); filter.AddProperty(_("hgap"), _("hgap"), XRC_TYPE_INTEGER); return filter.GetXfbObject(); } }; class FlexGridSizerBase : public ComponentBase { public: void AddProperties( IObject* obj, wxFlexGridSizer* sizer ) { wxArrayInt gcols, grows; gcols = obj->GetPropertyAsArrayInt(_("growablecols")); grows = obj->GetPropertyAsArrayInt(_("growablerows")); unsigned int i; for (i=0; i < gcols.GetCount() ; i++) sizer->AddGrowableCol(gcols[i]); for (i=0; i < grows.GetCount() ; i++) sizer->AddGrowableRow(grows[i]); sizer->SetFlexibleDirection( obj->GetPropertyAsInteger(_("flexible_direction")) ); sizer->SetNonFlexibleGrowMode( (wxFlexSizerGrowMode )obj->GetPropertyAsInteger(_("non_flexible_grow_mode")) ); } void ExportXRCProperties( ObjectToXrcFilter* xrc, IObject* obj ) { xrc->AddProperty(_("vgap"), _("vgap"), XRC_TYPE_INTEGER); xrc->AddProperty(_("hgap"), _("hgap"), XRC_TYPE_INTEGER); xrc->AddPropertyValue(_("growablecols"), obj->GetPropertyAsString(_("growablecols"))); xrc->AddPropertyValue(_("growablerows"), obj->GetPropertyAsString(_("growablerows"))); } void ImportXRCProperties( XrcToXfbFilter* filter ) { filter->AddProperty(_("vgap"), _("vgap"), XRC_TYPE_INTEGER); filter->AddProperty(_("hgap"), _("hgap"), XRC_TYPE_INTEGER); filter->AddProperty(_("growablecols"),_("growablecols"),XRC_TYPE_TEXT); filter->AddProperty(_("growablerows"),_("growablerows"),XRC_TYPE_TEXT); } }; class FlexGridSizerComponent : public FlexGridSizerBase { public: wxObject* Create(IObject *obj, wxObject * /*parent*/) { wxFlexGridSizer *sizer = new wxFlexGridSizer( obj->GetPropertyAsInteger(_("rows")), obj->GetPropertyAsInteger(_("cols")), obj->GetPropertyAsInteger(_("vgap")), obj->GetPropertyAsInteger(_("hgap"))); AddProperties( obj, sizer ); return sizer; } ticpp::Element* ExportToXrc(IObject *obj) { ObjectToXrcFilter xrc(obj, _("wxFlexGridSizer")); xrc.AddProperty(_("rows"), _("rows"), XRC_TYPE_INTEGER); xrc.AddProperty(_("cols"), _("cols"), XRC_TYPE_INTEGER); ExportXRCProperties( &xrc, obj ); return xrc.GetXrcObject(); } ticpp::Element* ImportFromXrc( ticpp::Element* xrcObj ) { XrcToXfbFilter filter(xrcObj, _("wxFlexGridSizer")); filter.AddProperty(_("rows"), _("rows"), XRC_TYPE_INTEGER); filter.AddProperty(_("cols"), _("cols"), XRC_TYPE_INTEGER); ImportXRCProperties( &filter ); return filter.GetXfbObject(); } }; class GridBagSizerComponent : public FlexGridSizerBase { private: wxGBSizerItem* GetGBSizerItem( IObject* sizeritem, const wxGBPosition& position, const wxGBSpan& span, wxObject* child ) { IObject* childObj = GetManager()->GetIObject( child ); if ( _("spacer") == childObj->GetClassName() ) { return new wxGBSizerItem( childObj->GetPropertyAsInteger( _("width") ), childObj->GetPropertyAsInteger( _("height") ), position, span, sizeritem->GetPropertyAsInteger(_("flag")), sizeritem->GetPropertyAsInteger(_("border")), NULL ); } // Add the child ( window or sizer ) to the sizer wxWindow* windowChild = wxDynamicCast( child, wxWindow ); wxSizer* sizerChild = wxDynamicCast( child, wxSizer ); if ( windowChild != NULL ) { return new wxGBSizerItem( windowChild, position, span, sizeritem->GetPropertyAsInteger(_("flag")), sizeritem->GetPropertyAsInteger(_("border")), NULL ); } else if ( sizerChild != NULL ) { return new wxGBSizerItem( sizerChild, position, span, sizeritem->GetPropertyAsInteger(_("flag")), sizeritem->GetPropertyAsInteger(_("border")), NULL ); } else { wxLogError( wxT("The GBSizerItem component's child is not a wxWindow or a wxSizer or a Spacer - this should not be possible!") ); return NULL; } } public: wxObject* Create(IObject *obj, wxObject * /*parent*/) { wxGridBagSizer* sizer = new wxGridBagSizer( obj->GetPropertyAsInteger(_("vgap")), obj->GetPropertyAsInteger(_("hgap"))); AddProperties( obj, sizer ); if ( !obj->IsNull( _("empty_cell_size") ) ) { sizer->SetEmptyCellSize( obj->GetPropertyAsSize( _("empty_cell_size") ) ); } return sizer; } void OnCreated( wxObject* wxobject, wxWindow* /*wxparent*/ ) { // For storing objects whose postion needs to be determined std::vector< std::pair< wxObject*, wxGBSizerItem* > > newObjects; wxGBPosition lastPosition( 0, 0 ); // Get sizer wxGridBagSizer* sizer = wxDynamicCast( wxobject, wxGridBagSizer ); if ( NULL == sizer ) { wxLogError( wxT("This should be a wxGridBagSizer!") ); return; } // Add the children IManager* manager = GetManager(); size_t count = manager->GetChildCount( wxobject ); if ( 0 == count ) { // wxGridBagSizer gets upset sometimes without children sizer->Add( 0, 0, wxGBPosition( 0, 0 ) ); return; } for ( size_t i = 0; i < count; ++i ) { // Should be a GBSizerItem wxObject* wxsizerItem = manager->GetChild( wxobject, i ); IObject* isizerItem = manager->GetIObject( wxsizerItem ); // Get the location of the item wxGBSpan span( isizerItem->GetPropertyAsInteger( _("rowspan") ), isizerItem->GetPropertyAsInteger( _("colspan") ) ); int column = isizerItem->GetPropertyAsInteger( _("column") ); if ( column < 0 ) { // Needs to be auto positioned after the other children are added wxGBSizerItem* item = GetGBSizerItem( isizerItem, lastPosition, span, manager->GetChild( wxsizerItem, 0 ) ); if ( item != NULL ) { newObjects.push_back( std::pair< wxObject*, wxGBSizerItem* >( wxsizerItem, item ) ); } continue; } wxGBPosition position( isizerItem->GetPropertyAsInteger( _("row") ), column ); // Check for intersection if ( sizer->CheckForIntersection( position, span ) ) { continue; } lastPosition = position; // Add the child to the sizer wxGBSizerItem* item = GetGBSizerItem( isizerItem, position, span, manager->GetChild( wxsizerItem, 0 ) ); if ( item != NULL ) { sizer->Add( item ); } } std::vector< std::pair< wxObject*, wxGBSizerItem* > >::iterator it; for ( it = newObjects.begin(); it != newObjects.end(); ++it ) { wxGBPosition position = it->second->GetPos(); wxGBSpan span = it->second->GetSpan(); int column = position.GetCol(); while ( sizer->CheckForIntersection( position, span ) ) { column++; position.SetCol( column ); } it->second->SetPos( position ); sizer->Add( it->second ); GetManager()->ModifyProperty( it->first, _("row"), wxString::Format( wxT("%i"), position.GetRow() ), false ); GetManager()->ModifyProperty( it->first, _("column"), wxString::Format( wxT("%i"), column ), false ); } } ticpp::Element* ExportToXrc(IObject *obj) { ObjectToXrcFilter xrc(obj, _("wxGridBagSizer")); ExportXRCProperties( &xrc, obj ); return xrc.GetXrcObject(); } ticpp::Element* ImportFromXrc( ticpp::Element* xrcObj ) { XrcToXfbFilter filter(xrcObj, _("wxGridBagSizer")); ImportXRCProperties( &filter ); return filter.GetXfbObject(); } }; class StdDialogButtonSizerComponent : public ComponentBase { private: void AddXRCButton( ticpp::Element* sizer, const std::string& id, const std::string& label ) { try { ticpp::Element button( "object" ); button.SetAttribute( "class", "button" ); ticpp::Element flag( "flag" ); flag.SetText( "wxALIGN_CENTER_HORIZONTAL|wxALL" ); button.LinkEndChild( &flag ); ticpp::Element border( "border" ); border.SetText( "5" ); button.LinkEndChild( &border ); ticpp::Element wxbutton( "object" ); wxbutton.SetAttribute( "class", "wxButton" ); wxbutton.SetAttribute( "name", id ); ticpp::Element labelEl( "label" ); labelEl.SetText( label ); wxbutton.LinkEndChild( &labelEl ); button.LinkEndChild( &wxbutton ); sizer->LinkEndChild( &button ); } catch( ticpp::Exception& ex ) { wxLogError( wxString( ex.m_details.c_str(), wxConvUTF8 ) ); } } public: wxObject* Create(IObject *obj, wxObject *parent) { wxStdDialogButtonSizer* sizer = new wxStdDialogButtonSizer(); if ( obj->GetPropertyAsInteger( _("OK") ) ) { sizer->AddButton( new wxButton( (wxWindow*)parent, wxID_OK ) ); } if ( obj->GetPropertyAsInteger( _("Yes") ) ) { sizer->AddButton( new wxButton( (wxWindow*)parent, wxID_YES ) ); } if ( obj->GetPropertyAsInteger( _("Save") ) ) { sizer->AddButton( new wxButton( (wxWindow*)parent, wxID_SAVE ) ); } if ( obj->GetPropertyAsInteger( _("Apply") ) ) { sizer->AddButton( new wxButton( (wxWindow*)parent, wxID_APPLY ) ); } if ( obj->GetPropertyAsInteger( _("No") ) ) { sizer->AddButton( new wxButton( (wxWindow*)parent, wxID_NO ) ); } if ( obj->GetPropertyAsInteger( _("Cancel") ) ) { sizer->AddButton( new wxButton( (wxWindow*)parent, wxID_CANCEL ) ); } if ( obj->GetPropertyAsInteger( _("Help") ) ) { sizer->AddButton( new wxButton( (wxWindow*)parent, wxID_HELP ) ); } if ( obj->GetPropertyAsInteger( _("ContextHelp") ) ) { sizer->AddButton( new wxButton( (wxWindow*)parent, wxID_CONTEXT_HELP ) ); } sizer->Realize(); return sizer; } ticpp::Element* ExportToXrc(IObject *obj) { ObjectToXrcFilter xrc(obj, _("wxStdDialogButtonSizer")); ticpp::Element* sizer = xrc.GetXrcObject(); if ( obj->GetPropertyAsInteger( _("OK") ) ) { AddXRCButton( sizer, "wxID_OK", "&OK" ); } if ( obj->GetPropertyAsInteger( _("Yes") ) ) { AddXRCButton( sizer, "wxID_YES", "&Yes" ); } if ( obj->GetPropertyAsInteger( _("Save") ) ) { AddXRCButton( sizer, "wxID_SAVE", "&Save" ); } if ( obj->GetPropertyAsInteger( _("Apply") ) ) { AddXRCButton( sizer, "wxID_APPLY", "&Apply" ); } if ( obj->GetPropertyAsInteger( _("No") ) ) { AddXRCButton( sizer, "wxID_NO", "&No" ); } if ( obj->GetPropertyAsInteger( _("Cancel") ) ) { AddXRCButton( sizer, "wxID_CANCEL", "&Cancel" ); } if ( obj->GetPropertyAsInteger( _("Help") ) ) { AddXRCButton( sizer, "wxID_HELP", "&Help" ); } if ( obj->GetPropertyAsInteger( _("ContextHelp") ) ) { AddXRCButton( sizer, "wxID_CONTEXT_HELP", "" ); } return sizer; } ticpp::Element* ImportFromXrc( ticpp::Element* xrcObj ) { std::map< wxString, wxString > buttons; buttons[ _("OK") ] = wxT("0"); buttons[ _("Yes") ] = wxT("0"); buttons[ _("Save") ] = wxT("0"); buttons[ _("Apply") ] = wxT("0"); buttons[ _("No") ] = wxT("0"); buttons[ _("Cancel") ] = wxT("0"); buttons[ _("Help") ] = wxT("0"); buttons[ _("ContextHelp") ] = wxT("0"); XrcToXfbFilter filter(xrcObj, _("wxStdDialogButtonSizer")); ticpp::Element* button = xrcObj->FirstChildElement( "object", false ); for ( ; button != 0; button = button->NextSiblingElement( "object", false ) ) { try { std::string button_class; button->GetAttribute( "class", &button_class ); if ( std::string("button") != button_class ) { continue; } ticpp::Element* wxbutton = button->FirstChildElement( "object" ); std::string wxbutton_class; wxbutton->GetAttribute( "class", &wxbutton_class ); if ( std::string("wxButton") != wxbutton_class ) { continue; } std::string name; wxbutton->GetAttribute( "name", &name ); if ( name == "wxID_OK" ) { buttons[ _("OK") ] = wxT("1"); } else if ( name == "wxID_YES" ) { buttons[ _("Yes") ] = wxT("1"); } else if ( name == "wxID_SAVE" ) { buttons[ _("Save") ] = wxT("1"); } else if ( name == "wxID_APPLY" ) { buttons[ _("Apply") ] = wxT("1"); } else if ( name == "wxID_NO" ) { buttons[ _("No") ] = wxT("1"); } else if ( name == "wxID_CANCEL" ) { buttons[ _("Cancel") ] = wxT("1"); } else if ( name == "wxID_HELP" ) { buttons[ _("Help") ] = wxT("1"); } else if ( name == "wxID_CONTEXT_HELP" ) { buttons[ _("ContextHelp") ] = wxT("1"); } } catch( ticpp::Exception& ) { continue; } } std::map< wxString, wxString >::iterator prop; for ( prop = buttons.begin(); prop != buttons.end(); ++prop ) { filter.AddPropertyValue( prop->first, prop->second ); } xrcObj->Clear(); return filter.GetXfbObject(); } }; /////////////////////////////////////////////////////////////////////////////// BEGIN_LIBRARY() ABSTRACT_COMPONENT("spacer",SpacerComponent) ABSTRACT_COMPONENT("sizeritem",SizerItemComponent) ABSTRACT_COMPONENT("gbsizeritem",GBSizerItemComponent) SIZER_COMPONENT("wxBoxSizer",BoxSizerComponent) SIZER_COMPONENT("wxStaticBoxSizer",StaticBoxSizerComponent) SIZER_COMPONENT("wxGridSizer",GridSizerComponent) SIZER_COMPONENT("wxFlexGridSizer",FlexGridSizerComponent) SIZER_COMPONENT("wxGridBagSizer",GridBagSizerComponent) SIZER_COMPONENT("wxStdDialogButtonSizer",StdDialogButtonSizerComponent) // wxBoxSizer MACRO(wxHORIZONTAL) MACRO(wxVERTICAL) // wxFlexGridSizer MACRO(wxBOTH) MACRO(wxFLEX_GROWMODE_NONE) MACRO(wxFLEX_GROWMODE_SPECIFIED) MACRO(wxFLEX_GROWMODE_ALL) // Add MACRO(wxALL) MACRO(wxLEFT) MACRO(wxRIGHT) MACRO(wxTOP) MACRO(wxBOTTOM) MACRO(wxEXPAND) MACRO(wxALIGN_BOTTOM) MACRO(wxALIGN_CENTER) MACRO(wxALIGN_CENTER_HORIZONTAL) MACRO(wxALIGN_CENTER_VERTICAL) MACRO(wxSHAPED) MACRO(wxFIXED_MINSIZE) SYNONYMOUS(wxGROW, wxEXPAND) END_LIBRARY() wxformbuilder-3.1.59/plugins/wxAdditions/wxAdditions_mini.cpp0000644000175000017500000005743511143440026024760 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// // wxFormBuilder SDK #include "component.h" #include "plugin.h" #include "xrcconv.h" #include // wxFlatNotebook #include #include // wxPropertyGrid #include #include #include // wxScintilla #include // wxWidgets #include /////////////////////////////////////////////////////////////////////////////// /** Event handler for events generated by controls in this plugin */ class ComponentEvtHandler : public wxEvtHandler { private: wxWindow* m_window; IManager* m_manager; public: ComponentEvtHandler( wxWindow* win, IManager* manager ) : m_window( win ), m_manager( manager ) {} protected: // Enable folding for wxScintilla void OnMarginClick ( wxScintillaEvent& event ); void OnFlatNotebookPageChanged( wxFlatNotebookEvent& event ) { // Only handle events from this book - prevents problems with nested books, because OnSelected is fired on an // object and all of its parents if ( m_window != event.GetEventObject() ) { return; } int selPage = event.GetSelection(); if ( selPage < 0 ) { return; } size_t count = m_manager->GetChildCount( m_window ); for ( size_t i = 0; i < count; i++ ) { wxObject* wxChild = m_manager->GetChild( m_window, i ); IObject* iChild = m_manager->GetIObject( wxChild ); if ( iChild ) { if ( (int)i == selPage && !iChild->GetPropertyAsInteger( _("select") ) ) { m_manager->ModifyProperty( wxChild, _("select"), wxT("1"), false ); } else if ( (int)i != selPage && iChild->GetPropertyAsInteger( _("select") ) ) { m_manager->ModifyProperty( wxChild, _("select"), wxT("0"), false ); } } } // Select the corresponding panel in the object tree wxFlatNotebook* book = wxDynamicCast( m_window, wxFlatNotebook ); if ( NULL != book ) { m_manager->SelectObject( book->GetPage( selPage ) ); } } void OnFlatNotebookPageClosing( wxFlatNotebookEvent& event ) { wxMessageBox( wxT("wxFlatNotebook pages can normally be closed.\nHowever, it is difficult to design a page that has been closed, so this action has been vetoed."), wxT("Page Close Vetoed!"), wxICON_INFORMATION, NULL ); event.Veto(); } DECLARE_EVENT_TABLE() }; BEGIN_EVENT_TABLE( ComponentEvtHandler, wxEvtHandler ) EVT_FLATNOTEBOOK_PAGE_CHANGED( -1, ComponentEvtHandler::OnFlatNotebookPageChanged ) EVT_FLATNOTEBOOK_PAGE_CLOSING( -1, ComponentEvtHandler::OnFlatNotebookPageClosing ) EVT_SCI_MARGINCLICK( -1, ComponentEvtHandler::OnMarginClick ) END_EVENT_TABLE() /////////////////////////////////////////////////////////////////////////////// class PropertyGridComponent : public ComponentBase { public: wxObject* Create(IObject *obj, wxObject *parent) { wxPropertyGrid* pg = new wxPropertyGrid((wxWindow *)parent,-1, obj->GetPropertyAsPoint(_("pos")), obj->GetPropertyAsSize(_("size")), obj->GetPropertyAsInteger(_("style")) | obj->GetPropertyAsInteger(_("window_style"))); if ( !obj->GetPropertyAsString(_("extra_style")).empty() ) { pg->SetExtraStyle( obj->GetPropertyAsInteger( _("extra_style") ) ); } pg->AppendCategory(wxT("Sample Category")); // Add string property pg->Append( wxStringProperty(wxT("Label"),wxT("Name"),wxT("Initial Value")) ); // Add int property pg->Append ( wxIntProperty ( wxT("IntProperty"), wxPG_LABEL, 12345678 ) ); // Add float property (value type is actually double) pg->Append ( wxFloatProperty ( wxT("FloatProperty"), wxPG_LABEL, 12345.678 ) ); // Add a bool property pg->Append ( wxBoolProperty ( wxT("BoolProperty"), wxPG_LABEL, false ) ); pg->Append ( wxBoolProperty ( wxT("BoolPropertyAsCheckbox"), wxPG_LABEL, true ) ); pg->SetPropertyAttribute( wxT("BoolPropertyAsCheckbox"), wxPG_BOOL_USE_CHECKBOX, (long)1); // A string property that can be edited in a separate editor dialog. pg->Append ( wxLongStringProperty (wxT("LongStringProperty"), wxPG_LABEL, wxT("This is much longer string than the ") wxT("first one. Edit it by clicking the button."))); // String editor with dir selector button. pg->Append ( wxDirProperty( wxT("DirProperty"), wxPG_LABEL, ::wxGetUserHome()) ); // A file selector property. wxPGId fid = pg->Append ( wxFileProperty( wxT("FileProperty"), wxPG_LABEL, wxEmptyString ) ); pg->AppendCategory( wxT("Sample Parent Property") ); wxPGId pid = pg->Append( wxParentProperty(wxT("Car"),wxPG_LABEL) ); pg->AppendIn( pid, wxStringProperty(wxT("Model"), wxPG_LABEL,wxT("Lamborghini Diablo SV")) ); pg->AppendIn( pid, wxIntProperty(wxT("Engine Size (cc)"), wxPG_LABEL, 5707) ); wxPGId speedId = pg->AppendIn( pid, wxParentProperty(wxT("Speeds"),wxPG_LABEL) ); pg->AppendIn( speedId, wxIntProperty(wxT("Max. Speed (mph)"),wxPG_LABEL,300) ); pg->AppendIn( speedId, wxFloatProperty(wxT("0-100 mph (sec)"),wxPG_LABEL,3.9) ); pg->AppendIn( speedId, wxFloatProperty(wxT("1/4 mile (sec)"),wxPG_LABEL,8.6) ); pg->AppendIn( pid, wxIntProperty(wxT("Price ($)"), wxPG_LABEL, 300000) ); if ( obj->GetPropertyAsInteger( wxT("include_advanced") ) ) { pg->AppendCategory( wxT("Advanced Properties") ); // wxArrayStringProperty embeds a wxArrayString. pg->Append ( wxArrayStringProperty( wxT("Example of ArrayStringProperty"), wxT("ArrayStringProp") ) ); // Image file property. Wildcard is auto-generated from available // image handlers, so it is not set this time. pg->Append ( wxImageFileProperty(wxT("Example of ImageFileProperty"), wxT("ImageFileProp"))); // Font property has sub-properties. pg->Append ( wxFontProperty(wxT("Font"), wxPG_LABEL, wxFontPropertyValue()) ); // Colour property with arbitrary colour. pg->Append ( wxColourProperty(wxT("My Colour 1"), wxPG_LABEL, wxColour(242,109,0) ) ); // System colour property. pg->Append ( wxSystemColourProperty (wxT("My SysColour 1"), wxPG_LABEL, wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW)) ); // System colour property with custom colour. pg->Append ( wxSystemColourProperty (wxT("My SysColour 2"), wxPG_LABEL, wxColour(0,200,160) ) ); // Cursor property pg->Append ( wxCursorProperty (wxT("My Cursor"), wxPG_LABEL, wxCURSOR_ARROW)); } return pg; } void Cleanup( wxObject* ) { // Prevent assert for missing event handler } }; class PropertyGridManagerComponent : public ComponentBase { public: wxObject* Create(IObject *obj, wxObject *parent) { wxPropertyGridManager* pg = new wxPropertyGridManager((wxWindow *)parent, -1, obj->GetPropertyAsPoint(_("pos")), obj->GetPropertyAsSize(_("size")), obj->GetPropertyAsInteger(_("style")) | obj->GetPropertyAsInteger(_("window_style"))); if ( !obj->GetPropertyAsString(_("extra_style")).empty() ) { pg->SetExtraStyle( obj->GetPropertyAsInteger( _("extra_style") ) ); } // Adding a page sets target page to the one added, so // we don't have to call SetTargetPage if we are filling // it right after adding. pg->AddPage(wxT("First Page")); pg->AppendCategory( wxT("Sample Category") ); // Add string property wxPGId id = pg->Append( wxStringProperty(wxT("Label"),wxT("Name"),wxT("Initial Value")) ); pg->SetPropertyHelpString( id, wxT("A string property") ); // Add int property pg->Append ( wxIntProperty ( wxT("IntProperty"), wxPG_LABEL, 12345678 ) ); // Add float property (value type is actually double) pg->Append ( wxFloatProperty ( wxT("FloatProperty"), wxPG_LABEL, 12345.678 ) ); // Add a bool property pg->Append ( wxBoolProperty ( wxT("BoolProperty"), wxPG_LABEL, false ) ); pg->Append ( wxBoolProperty ( wxT("BoolPropertyAsCheckbox"), wxPG_LABEL, true ) ); pg->SetPropertyAttribute( wxT("BoolPropertyAsCheckbox"), wxPG_BOOL_USE_CHECKBOX, (long)1); // Add an enum property wxArrayString strings; strings.Add(wxT("Herbivore")); strings.Add(wxT("Carnivore")); strings.Add(wxT("Omnivore")); pg->Append( wxEnumProperty(wxT("EnumProperty"), wxPG_LABEL, strings) ); pg->AppendCategory( wxT("Low Priority Properties") ); // A string property that can be edited in a separate editor dialog. pg->TogglePropertyPriority( pg->Append ( wxLongStringProperty (wxT("LongStringProperty"), wxPG_LABEL, wxT("This is much longer string than the ") wxT("first one. Edit it by clicking the button.")))); // String editor with dir selector button. pg->TogglePropertyPriority( pg->Append ( wxDirProperty( wxT("DirProperty"), wxPG_LABEL, ::wxGetUserHome()) )); // A file selector property. pg->TogglePropertyPriority( pg->Append ( wxFileProperty( wxT("FileProperty"), wxPG_LABEL, wxEmptyString ) )); pg->AddPage(wxT("Second Page")); pg->AppendCategory( wxT("Sample Parent Property") ); wxPGId pid = pg->Append( wxParentProperty(wxT("Car"),wxPG_LABEL) ); pg->AppendIn( pid, wxStringProperty(wxT("Model"), wxPG_LABEL,wxT("Lamborghini Diablo SV")) ); pg->AppendIn( pid, wxIntProperty(wxT("Engine Size (cc)"), wxPG_LABEL, 5707) ); wxPGId speedId = pg->AppendIn( pid, wxParentProperty(wxT("Speeds"),wxPG_LABEL) ); pg->AppendIn( speedId, wxIntProperty(wxT("Max. Speed (mph)"),wxPG_LABEL,300) ); pg->AppendIn( speedId, wxFloatProperty(wxT("0-100 mph (sec)"),wxPG_LABEL,3.9) ); pg->AppendIn( speedId, wxFloatProperty(wxT("1/4 mile (sec)"),wxPG_LABEL,8.6) ); pg->AppendIn( pid, wxIntProperty(wxT("Price ($)"), wxPG_LABEL, 300000) ); if ( obj->GetPropertyAsInteger( wxT("include_advanced") ) ) { pg->AppendCategory( wxT("Advanced Properties") ); // wxArrayStringProperty embeds a wxArrayString. pg->Append ( wxArrayStringProperty(wxT("Example of ArrayStringProperty"), wxT("ArrayStringProp"))); // Image file property. Wildcard is auto-generated from available // image handlers, so it is not set this time. pg->Append ( wxImageFileProperty(wxT("Example of ImageFileProperty"), wxT("ImageFileProp"))); // Font property has sub-properties. pg->Append ( wxFontProperty(wxT("Font"), wxPG_LABEL, wxFontPropertyValue()) ); // Colour property with arbitrary colour. pg->Append ( wxColourProperty(wxT("My Colour 1"), wxPG_LABEL, wxColour(242,109,0) ) ); // System colour property. pg->Append ( wxSystemColourProperty (wxT("My SysColour 1"), wxPG_LABEL, wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW)) ); // System colour property with custom colour. pg->Append ( wxSystemColourProperty (wxT("My SysColour 2"), wxPG_LABEL, wxColour(0,200,160) ) ); // Cursor property pg->Append ( wxCursorProperty (wxT("My Cursor"), wxPG_LABEL, wxCURSOR_ARROW)); } // For total safety, finally reset the target page. pg->SetTargetPage(0); return pg; } void Cleanup( wxObject* ) { // Prevent assert for missing event handler } }; /////////////////////////////////////////////////////////////////////////////// class FlatNotebookComponent : public ComponentBase { public: wxObject* Create(IObject *obj, wxObject *parent) { wxFlatNotebook* book = new wxFlatNotebook((wxWindow *)parent,-1, obj->GetPropertyAsPoint(_("pos")), obj->GetPropertyAsSize(_("size")), obj->GetPropertyAsInteger(_("style")) | obj->GetPropertyAsInteger(_("window_style"))); if ( obj->GetPropertyAsInteger( _("has_images") ) != 0 ) { wxFlatNotebookImageList* images = new wxFlatNotebookImageList(); book->SetImageList( images ); } book->SetCustomizeOptions( obj->GetPropertyAsInteger( _("customize_options") ) ); book->PushEventHandler( new ComponentEvtHandler( book, GetManager() ) ); return book; } ticpp::Element* ExportToXrc(IObject *obj) { ObjectToXrcFilter xrc(obj, _("wxFlatNotebook"), obj->GetPropertyAsString(_("name"))); xrc.AddWindowProperties(); return xrc.GetXrcObject(); } ticpp::Element* ImportFromXrc( ticpp::Element* xrcObj ) { XrcToXfbFilter filter(xrcObj, _("wxFlatNotebook")); filter.AddWindowProperties(); return filter.GetXfbObject(); } }; class FlatNotebookPageComponent : public ComponentBase { public: void OnCreated( wxObject* wxobject, wxWindow* wxparent ) { // Easy read-only property access IObject* obj = GetManager()->GetIObject( wxobject ); wxFlatNotebook* book = wxDynamicCast( wxparent, wxFlatNotebook ); wxWindow* page = wxDynamicCast( GetManager()->GetChild( wxobject, 0 ), wxWindow ); // Error checking if ( !( obj && book && page ) ) { wxLogError( _("FlatNotebookPageComponent is missing its wxFormBuilder object(%i), its parent(%i), or its child(%i)"), obj, book, page ); return; } // Prevent events during construction - two event handlers have been pushed onto the stack // VObjEvtHandler and Component Event handler wxEvtHandler* vobjEvtHandler = book->PopEventHandler(); wxEvtHandler* bookEvtHandler = book->PopEventHandler(); int selection = book->GetSelection(); // Apply image to page IObject* parentObj = GetManager()->GetIObject( wxparent ); if ( parentObj->GetPropertyAsInteger( _("has_images") ) != 0 ) { if ( !obj->GetPropertyAsString( _("bitmap") ).empty() ) { wxFlatNotebookImageList* imageList = book->GetImageList(); if ( parentObj->GetPropertyAsInteger( _("auto_scale_images") ) != 0 ) { wxImage image = obj->GetPropertyAsBitmap( _("bitmap") ).ConvertToImage(); imageList->Add( image.Scale( 16, 16 ) ); } else { imageList->Add( obj->GetPropertyAsBitmap( _("bitmap") ) ); } book->AddPage( page, obj->GetPropertyAsString( _("label") ), false, imageList->GetCount() - 1 ); } else { book->AddPage(page,obj->GetPropertyAsString(_("label"))); } } else { book->AddPage(page,obj->GetPropertyAsString(_("label"))); } if ( obj->GetPropertyAsString( _("select") ) == wxT("0") && selection >= 0 ) { book->SetSelection( selection) ; } else { book->SetSelection( book->GetPageCount() - 1 ); } // Restore event handling book->PushEventHandler( bookEvtHandler ); book->PushEventHandler( vobjEvtHandler ); } void OnSelected( wxObject* wxobject ) { // Get actual page - first child wxObject* page = GetManager()->GetChild( wxobject, 0 ); if ( NULL == page ) { return; } wxFlatNotebook* book = wxDynamicCast( GetManager()->GetParent( wxobject ), wxFlatNotebook ); if ( book ) { for ( int i = 0; i < book->GetPageCount(); ++i ) { if ( book->GetPage( i ) == page ) { // Prevent infinite event loop wxEvtHandler* bookEvtHandler = book->PopEventHandler(); wxEvtHandler* vobjEvtHandler = book->PopEventHandler(); // Select Page book->SetSelection( i ); // Restore event handling book->PushEventHandler( vobjEvtHandler ); book->PushEventHandler( bookEvtHandler ); } } } } ticpp::Element* ExportToXrc(IObject *obj) { ObjectToXrcFilter xrc( obj, _("notebookpage") ); xrc.AddProperty( _("label"), _("label"), XRC_TYPE_TEXT ); xrc.AddProperty( _("selected"), _("selected"), XRC_TYPE_BOOL ); if ( !obj->IsNull( _("bitmap") ) ) { xrc.AddProperty( _("bitmap"), _("bitmap"), XRC_TYPE_BITMAP ); } return xrc.GetXrcObject(); } ticpp::Element* ImportFromXrc( ticpp::Element* xrcObj ) { XrcToXfbFilter filter( xrcObj, _("notebookpage") ); filter.AddWindowProperties(); filter.AddProperty( _("selected"), _("selected"), XRC_TYPE_BOOL ); filter.AddProperty( _("label"), _("label"), XRC_TYPE_TEXT ); filter.AddProperty( _("bitmap"), _("bitmap"), XRC_TYPE_BITMAP ); return filter.GetXfbObject(); } }; /////////////////////////////////////////////////////////////////////////////// class ScintillaComponent : public ComponentBase { public: wxObject* Create( IObject* obj, wxObject* parent ) { wxScintilla* m_code = new wxScintilla( (wxWindow *)parent, -1, obj->GetPropertyAsPoint(_("pos")), obj->GetPropertyAsSize(_("size")), obj->GetPropertyAsInteger(_("window_style")), obj->GetPropertyAsString(_("name")) ); // Line Numbers if ( 0 != obj->GetPropertyAsInteger(_("line_numbers") ) ) { m_code->SetMarginType( 0, wxSCI_MARGIN_NUMBER ); m_code->SetMarginWidth( 0, m_code->TextWidth (wxSCI_STYLE_LINENUMBER, wxT("_99999")) ); } else { m_code->SetMarginWidth( 0, 0 ); } // markers m_code->MarkerDefine (wxSCI_MARKNUM_FOLDER, wxSCI_MARK_BOXPLUS); m_code->MarkerSetBackground (wxSCI_MARKNUM_FOLDER, wxColour (wxT("BLACK"))); m_code->MarkerSetForeground (wxSCI_MARKNUM_FOLDER, wxColour (wxT("WHITE"))); m_code->MarkerDefine (wxSCI_MARKNUM_FOLDEROPEN, wxSCI_MARK_BOXMINUS); m_code->MarkerSetBackground (wxSCI_MARKNUM_FOLDEROPEN, wxColour (wxT("BLACK"))); m_code->MarkerSetForeground (wxSCI_MARKNUM_FOLDEROPEN, wxColour (wxT("WHITE"))); m_code->MarkerDefine (wxSCI_MARKNUM_FOLDERSUB, wxSCI_MARK_EMPTY); m_code->MarkerDefine (wxSCI_MARKNUM_FOLDEREND, wxSCI_MARK_BOXPLUS); m_code->MarkerSetBackground (wxSCI_MARKNUM_FOLDEREND, wxColour (wxT("BLACK"))); m_code->MarkerSetForeground (wxSCI_MARKNUM_FOLDEREND, wxColour (wxT("WHITE"))); m_code->MarkerDefine (wxSCI_MARKNUM_FOLDEROPENMID, wxSCI_MARK_BOXMINUS); m_code->MarkerSetBackground (wxSCI_MARKNUM_FOLDEROPENMID, wxColour (wxT("BLACK"))); m_code->MarkerSetForeground (wxSCI_MARKNUM_FOLDEROPENMID, wxColour (wxT("WHITE"))); m_code->MarkerDefine (wxSCI_MARKNUM_FOLDERMIDTAIL, wxSCI_MARK_EMPTY); m_code->MarkerDefine (wxSCI_MARKNUM_FOLDERTAIL, wxSCI_MARK_EMPTY); // folding if ( 0 != obj->GetPropertyAsInteger(_("folding") ) ) { m_code->SetMarginType (1, wxSCI_MARGIN_SYMBOL); m_code->SetMarginMask (1, wxSCI_MASK_FOLDERS); m_code->SetMarginWidth (1, 16); m_code->SetMarginSensitive (1, true); m_code->SetProperty( wxT("fold"), wxT("1") ); m_code->SetFoldFlags( wxSCI_FOLDFLAG_LINEBEFORE_CONTRACTED | wxSCI_FOLDFLAG_LINEAFTER_CONTRACTED ); } else { m_code->SetMarginWidth( 1, 0 ); } m_code->SetIndentationGuides( ( 0 != obj->GetPropertyAsInteger( _("indentation_guides") ) ) ); m_code->SetMarginWidth( 2, 0 ); m_code->SetLexer(wxSCI_LEX_CPP); m_code->SetKeyWords(0, wxT("asm auto bool break case catch char class const const_cast \ continue default delete do double dynamic_cast else enum explicit \ export extern false float for friend goto if inline int long \ mutable namespace new operator private protected public register \ reinterpret_cast return short signed sizeof static static_cast \ struct switch template this throw true try typedef typeid \ typename union unsigned using virtual void volatile wchar_t \ while")); wxFont font(10, wxMODERN, wxNORMAL, wxNORMAL); if ( !obj->GetPropertyAsString(_("font")).empty() ) { font = obj->GetPropertyAsFont(_("font")); } m_code->StyleSetFont(wxSCI_STYLE_DEFAULT, font ); m_code->StyleClearAll(); m_code->StyleSetBold(wxSCI_C_WORD, true); m_code->StyleSetForeground(wxSCI_C_WORD, *wxBLUE); m_code->StyleSetForeground(wxSCI_C_STRING, *wxRED); m_code->StyleSetForeground(wxSCI_C_STRINGEOL, *wxRED); m_code->StyleSetForeground(wxSCI_C_PREPROCESSOR, wxColour(49, 106, 197)); m_code->StyleSetForeground(wxSCI_C_COMMENT, wxColour(0, 128, 0)); m_code->StyleSetForeground(wxSCI_C_COMMENTLINE, wxColour(0, 128, 0)); m_code->StyleSetForeground(wxSCI_C_COMMENTDOC, wxColour(0, 128, 0)); m_code->StyleSetForeground(wxSCI_C_COMMENTLINEDOC, wxColour(0, 128, 0)); m_code->StyleSetForeground(wxSCI_C_NUMBER, *wxBLUE ); m_code->SetUseTabs( ( 0 != obj->GetPropertyAsInteger( _("use_tabs") ) ) ); m_code->SetTabWidth( obj->GetPropertyAsInteger( _("tab_width") ) ); m_code->SetTabIndents( ( 0 != obj->GetPropertyAsInteger( _("tab_indents") ) ) ); m_code->SetBackSpaceUnIndents( ( 0 != obj->GetPropertyAsInteger( _("backspace_unindents") ) ) ); m_code->SetIndent( obj->GetPropertyAsInteger( _("tab_width") ) ); m_code->SetSelBackground(true, wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT)); m_code->SetSelForeground(true, wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT)); m_code->SetViewEOL( ( 0 != obj->GetPropertyAsInteger( _("view_eol") ) ) ); m_code->SetViewWhiteSpace( ( 0 != obj->GetPropertyAsInteger( _("view_whitespace") ) ) ); m_code->SetCaretWidth(2); m_code->SetText( wxT( "/** Sample Class to Display wxScintilla */\n" ) wxT( "class ScintillaSampleCode\n" ) wxT( "{\n" ) wxT( "private:\n" ) wxT( "\tint m_privateMember;\n\n" ) wxT( "public:\n\n" ) wxT( "\t// Sample Member Function\n" ) wxT( "\tint SampleFunction( int sample = 0 )\n" ) wxT( "\t{\n" ) wxT( "\t\treturn sample;\n" ) wxT( "\t}\n" ) wxT( "};\n" ) ); m_code->PushEventHandler( new ComponentEvtHandler( m_code, GetManager() ) ); return m_code; } }; void ComponentEvtHandler::OnMarginClick( wxScintillaEvent& event ) { wxScintilla* scintilla = wxDynamicCast( m_window, wxScintilla ); if ( scintilla != NULL ) { if ( event.GetMargin() == 1 ) { int lineClick = scintilla->LineFromPosition( event.GetPosition() ); int levelClick = scintilla->GetFoldLevel( lineClick ); if ( ( levelClick & wxSCI_FOLDLEVELHEADERFLAG ) > 0 ) { scintilla->ToggleFold( lineClick ); } } } event.Skip(); } /////////////////////////////////////////////////////////////////////////////// BEGIN_LIBRARY() // Load additional XRC handlers // This code is actually in the entry point of the plugin - the function GetComponentLibrary() // I know this looks funky, but it is perfectly valid wxXmlResource *res = wxXmlResource::Get(); res->AddHandler( new wxFlatNotebookXmlHandler ); // wxPropertyGrid WINDOW_COMPONENT("wxPropertyGrid", PropertyGridComponent) MACRO(wxPG_AUTO_SORT) MACRO(wxPG_HIDE_CATEGORIES) MACRO(wxPG_ALPHABETIC_MODE) MACRO(wxPG_BOLD_MODIFIED) MACRO(wxPG_SPLITTER_AUTO_CENTER) MACRO(wxPG_TOOLTIPS) MACRO(wxPG_HIDE_MARGIN) MACRO(wxPG_STATIC_SPLITTER) MACRO(wxPG_STATIC_LAYOUT) MACRO(wxPG_LIMITED_EDITING) MACRO(wxPG_EX_INIT_NOCAT) MACRO(wxPG_DEFAULT_STYLE) MACRO(wxTAB_TRAVERSAL) // wxPropertyGridManager WINDOW_COMPONENT("wxPropertyGridManager", PropertyGridManagerComponent) MACRO(wxPG_EX_NO_FLAT_TOOLBAR) MACRO(wxPG_EX_MODE_BUTTONS) MACRO(wxPG_COMPACTOR) MACRO(wxPGMAN_DEFAULT_STYLE) MACRO(wxPG_DESCRIPTION) MACRO(wxPG_TOOLBAR) // wxFlatNotebook WINDOW_COMPONENT("wxFlatNotebook",FlatNotebookComponent) ABSTRACT_COMPONENT("flatnotebookpage",FlatNotebookPageComponent) MACRO(wxFNB_VC71) MACRO(wxFNB_FANCY_TABS) MACRO(wxFNB_TABS_BORDER_SIMPLE) MACRO(wxFNB_NO_X_BUTTON) MACRO(wxFNB_NO_NAV_BUTTONS) MACRO(wxFNB_MOUSE_MIDDLE_CLOSES_TABS) MACRO(wxFNB_BOTTOM) MACRO(wxFNB_NODRAG) MACRO(wxFNB_VC8) MACRO(wxFNB_X_ON_TAB) MACRO(wxFNB_BACKGROUND_GRADIENT) MACRO(wxFNB_COLORFUL_TABS) MACRO(wxFNB_DCLICK_CLOSES_TABS) MACRO(wxFNB_SMART_TABS) MACRO(wxFNB_DROPDOWN_TABS_LIST) MACRO(wxFNB_ALLOW_FOREIGN_DND) MACRO(wxFNB_FF2) MACRO(wxFNB_CUSTOM_DLG) // wxFNB Customizatio Options MACRO(wxFNB_CUSTOM_TAB_LOOK) MACRO(wxFNB_CUSTOM_ORIENTATION) MACRO(wxFNB_CUSTOM_FOREIGN_DRAG) MACRO(wxFNB_CUSTOM_LOCAL_DRAG) MACRO(wxFNB_CUSTOM_CLOSE_BUTTON) MACRO(wxFNB_CUSTOM_ALL) // wxScintilla WINDOW_COMPONENT("wxScintilla", ScintillaComponent ) END_LIBRARY() wxformbuilder-3.1.59/plugins/wxAdditions/premake.lua0000644000175000017500000002403511143440026023060 0ustar rrmulderrrmulder--***************************************************************************** --* Author: RJP Computing --* Date: 12/15/2006 --* Version: 1.00 --* Copyright (C) 2006 RJP Computing --* --* This program is free software; you can redistribute it and/or --* modify it under the terms of the GNU General Public License --* as published by the Free Software Foundation; either version 2 --* of the License, or (at your option) any later version. --* --* This program is distributed in the hope that it will be useful, --* but WITHOUT ANY WARRANTY; without even the implied warranty of --* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --* GNU General Public License for more details. --* --* You should have received a copy of the GNU General Public License --* along with this program; if not, write to the Free Software --* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --* --* NOTES: --* - use the '/' slash for all paths. --***************************************************************************** -- wxWidgets version local wx_ver = "28" --******* Initial Setup ************ --* Most of the setting are set here. --********************************** -- Set the name of your package. package.name = "wxadditions-mini-plugin" -- Set this if you want a different name for your target than the package's name. local targetName = "wxadditions-mini" -- Set the kind of package you want to create. -- Options: exe | winexe | lib | dll package.kind = "dll" -- Set the files to include. package.files = { matchrecursive( "*.cpp", "*.h", "*.rc" ) } -- Set the include paths. package.includepaths = { "../../src/controls/include", "../../sdk/tinyxml", "../../sdk/plugin_interface" } -- Setup the output directory options. -- Note: Use 'libdir' for "lib" kind only. if ( windows ) then package.bindir = "../../output/plugins/wxAdditions" else package.bindir = "../../output/lib/wxformbuilder" end -- Set the defines. package.defines = { "BUILD_DLL", "TIXML_USE_TICPP", "SCI_NAMESPACE" } -- Hack the dll output to prefix 'lib' to the begining. package.targetprefix = "lib" -- Set the linker include paths if ( windows ) then package.libpaths = { "../../output" } else package.libpaths = { "../../output/lib/wxformbuilder" } end -- Set the libraries it links to. package.links = { "wxFlatNotebook", "wxPropGrid", "wxScintilla", "plugin-interface", "TiCPP" } if ( linux ) then addoption("rpath", "Specify the rpath for the compiled binary") if ( options["rpath"] ) then -- need to upgrade premake before this works -- table.insert( package.linkoptions, "-Wl,-rpath," .. options[rpath] ) table.insert( package.linkoptions, "-Wl,-rpath,/usr/lib/wxformbuilder" ) else if ( target == "cb-gcc" ) then table.insert( package.linkoptions, "-Wl,-rpath,$``ORIGIN" ) else table.insert( package.linkoptions, "-Wl,-rpath,$$``ORIGIN" ) end end end --------------------------- DO NOT EDIT BELOW ---------------------------------- --******* GENAERAL SETUP ********** --* Settings that are not dependant --* on the operating system. --********************************* -- Package options addoption( "unicode", "Use the Unicode character set" ) addoption( "with-wx-shared", "Link against wxWidgets as a shared library" ) if ( not windows ) then addoption( "disable-wx-debug", "Compile against a wxWidgets library without debugging" ) end -- Common setup package.language = "c++" -- Set object output directory. if ( options["unicode"] ) then package.config["Debug"].objdir = ".objsud" package.config["Release"].objdir = ".objsu" else package.config["Debug"].objdir = ".objsd" package.config["Release"].objdir = ".objs" end -- Set debug flags if ( options["disable-wx-debug"] and ( not windows ) ) then debug_option = "--debug=no" debug_macro = { "NDEBUG", "__WXFB_DEBUG__" } else debug_option = "--debug=yes" debug_macro = { "DEBUG", "_DEBUG", "__WXDEBUG__", "__WXFB_DEBUG__" } end -- Set the default targetName if none is specified. if ( string.len( targetName ) == 0 ) then targetName = package.name end -- Set the targets. package.config["Release"].target = targetName package.config["Debug"].target = targetName.."d" -- Set the build options. package.buildflags = { "extra-warnings" } package.config["Release"].buildflags = { "no-symbols", "optimize-speed" } if ( options["unicode"] ) then table.insert( package.buildflags, "unicode" ) end if ( string.find( target or "", ".*-gcc" ) or target == "gnu" ) then table.insert( package.buildflags, "no-import-lib" ) table.insert( package.config["Debug"].buildoptions, "-O0" ) table.insert( package.config["Release"].buildoptions, "-fno-strict-aliasing" ) end -- Set the defines. if ( options["with-wx-shared"] ) then table.insert( package.defines, "WXUSINGDLL" ) end if ( options["unicode"] ) then table.insert( package.defines, { "UNICODE", "_UNICODE" } ) end table.insert( package.defines, "__WX__" ) table.insert( package.config["Debug"].defines, debug_macro ) table.insert( package.config["Release"].defines, "NDEBUG" ) if ( windows ) then --******* WINDOWS SETUP *********** --* Settings that are Windows specific. --********************************* -- Set wxWidgets include paths if ( target == "cb-gcc" ) then table.insert( package.includepaths, "$(#WX.include)" ) else table.insert( package.includepaths, "$(WXWIN)/include" ) end -- Set the correct 'setup.h' include path. if ( options["with-wx-shared"] ) then if ( options["unicode"] ) then if ( target == "cb-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(#WX.lib)/gcc_dll/mswud" ) table.insert( package.config["Release"].includepaths, "$(#WX.lib)/gcc_dll/mswu" ) elseif ( target == "gnu" or target == "cl-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/gcc_dll/mswud" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/gcc_dll/mswu" ) else table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/vc_dll/mswud" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/vc_dll/mswu" ) end else if ( target == "cb-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(#WX.lib)/gcc_dll/mswd" ) table.insert( package.config["Release"].includepaths, "$(#WX.lib)/gcc_dll/msw" ) elseif ( target == "gnu" or target == "cl-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/gcc_dll/mswd" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/gcc_dll/msw" ) else table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/vc_dll/mswd" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/vc_dll/msw" ) end end else if ( options["unicode"] ) then if ( target == "cb-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(#WX.lib)/gcc_lib/mswud" ) table.insert( package.config["Release"].includepaths, "$(#WX.lib)/gcc_lib/mswu" ) elseif ( target == "gnu" or target == "cl-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/gcc_lib/mswud" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/gcc_lib/mswu" ) else table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/vc_lib/mswud" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/vc_lib/mswu" ) end else if ( target == "cb-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(#WX.lib)/gcc_lib/mswd" ) table.insert( package.config["Release"].includepaths, "$(#WX.lib)/gcc_lib/msw" ) elseif ( target == "gnu" or target == "cl-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/gcc_lib/mswd" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/gcc_lib/msw" ) else table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/vc_lib/mswd" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/vc_lib/msw" ) end end end -- Set the linker options. if ( options["with-wx-shared"] ) then if ( target == "cb-gcc" ) then table.insert( package.libpaths, "$(#WX.lib)/gcc_dll" ) elseif ( target == "gnu" or target == "cl-gcc" ) then table.insert( package.libpaths, "$(WXWIN)/lib/gcc_dll" ) else table.insert( package.libpaths, "$(WXWIN)/lib/vc_dll" ) end else if ( target == "cb-gcc" ) then table.insert( package.libpaths, "$(#WX.lib)/gcc_lib" ) elseif ( target == "gnu" or target == "cl-gcc" ) then table.insert( package.libpaths, "$(WXWIN)/lib/gcc_lib" ) else table.insert( package.libpaths, "$(WXWIN)/lib/vc_lib" ) end end -- Set wxWidgets libraries to link. if ( options["unicode"] ) then table.insert( package.config["Release"].links, "wxmsw"..wx_ver.."u" ) table.insert( package.config["Debug"].links, "wxmsw"..wx_ver.."ud" ) else table.insert( package.config["Release"].links, "wxmsw"..wx_ver ) table.insert( package.config["Debug"].links, "wxmsw"..wx_ver.."d" ) end -- Set the Windows defines. table.insert( package.defines, { "__WXMSW__", "WIN32", "_WINDOWS" } ) else --******* LINUX/MAC SETUP ************* --* Settings that are Linux/Mac specific. --************************************* -- Ignore resource files in Linux/Mac. table.insert( package.excludes, matchrecursive( "*.rc" ) ) table.insert( package.buildoptions, "-fPIC" ) -- Add buildflag for proper dll building. if ( macosx ) then table.insert( package.buildflags, "dylib" ) end -- Set wxWidgets build options. table.insert( package.config["Debug"].buildoptions, "`wx-config "..debug_option.." --cflags`" ) table.insert( package.config["Release"].buildoptions, "`wx-config --debug=no --cflags`" ) -- Set the wxWidgets link options. table.insert( package.config["Debug"].linkoptions, "`wx-config "..debug_option.." --libs`" ) table.insert( package.config["Release"].linkoptions, "`wx-config --libs`" ) end wxformbuilder-3.1.59/plugins/wxAdditions/Makefile0000644000175000017500000001064411143440026022372 0ustar rrmulderrrmulder# C++ Shared Library Makefile autogenerated by premake # Don't edit this file! Instead edit `premake.lua` then rerun `make` ifndef CONFIG CONFIG=Release endif ifeq ($(CONFIG),Release) BINDIR := ../../output/lib/wxformbuilder LIBDIR := ../.. OBJDIR := .objsu OUTDIR := ../../output/lib/wxformbuilder CPPFLAGS := -MMD -D "BUILD_DLL" -D "TIXML_USE_TICPP" -D "SCI_NAMESPACE" -D "WXUSINGDLL" -D "UNICODE" -D "_UNICODE" -D "__WX__" -D "NDEBUG" -I "../../src/controls/include" -I "../../sdk/tinyxml" -I "../../sdk/plugin_interface" CFLAGS += $(CPPFLAGS) $(TARGET_ARCH) -fPIC -O3 -Wall -fPIC -fno-strict-aliasing `wx-config --debug=no --cflags` CXXFLAGS := $(CFLAGS) LDFLAGS += -L$(BINDIR) -L$(LIBDIR) -shared -s -Wl,-rpath,/usr/lib/wxformbuilder `wx-config --libs` -L"../../output/lib/wxformbuilder" -lwx_gtk2u_flatnotebook-2.8_wxfb -lwx_gtk2u_propgrid-2.8_wxfb -lwx_gtk2u_scintilla-2.8_wxfb -L../../sdk/lib -lfbPluginInterface -L../../sdk/lib -lticpp LDDEPS := ../../output/lib/wxformbuilder/libwx_gtk2u_flatnotebook-2.8_wxfb.so ../../output/lib/wxformbuilder/libwx_gtk2u_propgrid-2.8_wxfb.so ../../output/lib/wxformbuilder/libwx_gtk2u_scintilla-2.8_wxfb.so ../../sdk/lib/libfbPluginInterface.a ../../sdk/lib/libticpp.a RESFLAGS := -D "BUILD_DLL" -D "TIXML_USE_TICPP" -D "SCI_NAMESPACE" -D "WXUSINGDLL" -D "UNICODE" -D "_UNICODE" -D "__WX__" -D "NDEBUG" -I "../../src/controls/include" -I "../../sdk/tinyxml" -I "../../sdk/plugin_interface" TARGET := libwxadditions-mini.so BLDCMD = $(CXX) -o $(OUTDIR)/$(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(TARGET_ARCH) endif ifeq ($(CONFIG),Debug) BINDIR := ../../output/lib/wxformbuilder LIBDIR := ../.. OBJDIR := .objsud OUTDIR := ../../output/lib/wxformbuilder CPPFLAGS := -MMD -D "BUILD_DLL" -D "TIXML_USE_TICPP" -D "SCI_NAMESPACE" -D "WXUSINGDLL" -D "UNICODE" -D "_UNICODE" -D "__WX__" -D "NDEBUG" -D "__WXFB_DEBUG__" -I "../../src/controls/include" -I "../../sdk/tinyxml" -I "../../sdk/plugin_interface" CFLAGS += $(CPPFLAGS) $(TARGET_ARCH) -fPIC -g -Wall -fPIC -O0 `wx-config --debug=no --cflags` CXXFLAGS := $(CFLAGS) LDFLAGS += -L$(BINDIR) -L$(LIBDIR) -shared -Wl,-rpath,/usr/lib/wxformbuilder `wx-config --debug=no --libs` -L"../../output/lib/wxformbuilder" -lwx_gtk2u_flatnotebook-2.8_wxfb -lwx_gtk2u_propgrid-2.8_wxfb -lwx_gtk2u_scintilla-2.8_wxfb -L../../sdk/lib -lfbPluginInterfaced -L../../sdk/lib -lticppd LDDEPS := ../../output/lib/wxformbuilder/libwx_gtk2u_flatnotebook-2.8_wxfb.so ../../output/lib/wxformbuilder/libwx_gtk2u_propgrid-2.8_wxfb.so ../../output/lib/wxformbuilder/libwx_gtk2u_scintilla-2.8_wxfb.so ../../sdk/lib/libfbPluginInterfaced.a ../../sdk/lib/libticppd.a RESFLAGS := -D "BUILD_DLL" -D "TIXML_USE_TICPP" -D "SCI_NAMESPACE" -D "WXUSINGDLL" -D "UNICODE" -D "_UNICODE" -D "__WX__" -D "NDEBUG" -D "__WXFB_DEBUG__" -I "../../src/controls/include" -I "../../sdk/tinyxml" -I "../../sdk/plugin_interface" TARGET := libwxadditions-minid.so BLDCMD = $(CXX) -o $(OUTDIR)/$(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(TARGET_ARCH) endif OBJECTS := \ $(OBJDIR)/wxAdditions_mini.o \ MKDIR_TYPE := msdos CMD := $(subst \,\\,$(ComSpec)$(COMSPEC)) ifeq (,$(CMD)) MKDIR_TYPE := posix endif ifeq (/bin/sh.exe,$(SHELL)) MKDIR_TYPE := posix endif ifeq ($(MKDIR_TYPE),posix) CMD_MKBINDIR := mkdir -p $(BINDIR) CMD_MKLIBDIR := mkdir -p $(LIBDIR) CMD_MKOUTDIR := mkdir -p $(OUTDIR) CMD_MKOBJDIR := mkdir -p $(OBJDIR) else CMD_MKBINDIR := $(CMD) /c if not exist $(subst /,\\,$(BINDIR)) mkdir $(subst /,\\,$(BINDIR)) CMD_MKLIBDIR := $(CMD) /c if not exist $(subst /,\\,$(LIBDIR)) mkdir $(subst /,\\,$(LIBDIR)) CMD_MKOUTDIR := $(CMD) /c if not exist $(subst /,\\,$(OUTDIR)) mkdir $(subst /,\\,$(OUTDIR)) CMD_MKOBJDIR := $(CMD) /c if not exist $(subst /,\\,$(OBJDIR)) mkdir $(subst /,\\,$(OBJDIR)) endif .PHONY: clean $(OUTDIR)/$(TARGET): $(OBJECTS) $(LDDEPS) $(RESOURCES) @echo Linking wxadditions-mini-plugin -@$(CMD_MKBINDIR) -@$(CMD_MKLIBDIR) -@$(CMD_MKOUTDIR) @$(BLDCMD) clean: @echo Cleaning wxadditions-mini-plugin ifeq ($(MKDIR_TYPE),posix) -@rm -f $(OUTDIR)/$(TARGET) -@rm -rf $(OBJDIR) else -@if exist $(subst /,\,$(OUTDIR)/$(TARGET)) del /q $(subst /,\,$(OUTDIR)/$(TARGET)) -@if exist $(subst /,\,$(OBJDIR)) del /q $(subst /,\,$(OBJDIR)) -@if exist $(subst /,\,$(OBJDIR)) rmdir /s /q $(subst /,\,$(OBJDIR)) endif $(OBJDIR)/wxAdditions_mini.o: wxAdditions_mini.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -include $(OBJECTS:%.o=%.d) wxformbuilder-3.1.59/plugins/containers/premake.lua0000644000175000017500000002245511143440026022734 0ustar rrmulderrrmulder--***************************************************************************** --* Author: RJP Computing --* Date: 12/15/2006 --* Version: 1.00 --* Copyright (C) 2006 RJP Computing --* --* This program is free software; you can redistribute it and/or --* modify it under the terms of the GNU General Public License --* as published by the Free Software Foundation; either version 2 --* of the License, or (at your option) any later version. --* --* This program is distributed in the hope that it will be useful, --* but WITHOUT ANY WARRANTY; without even the implied warranty of --* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --* GNU General Public License for more details. --* --* You should have received a copy of the GNU General Public License --* along with this program; if not, write to the Free Software --* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --* --* NOTES: --* - use the '/' slash for all paths. --***************************************************************************** -- wxWidgets version local wx_ver = "28" --******* Initial Setup ************ --* Most of the setting are set here. --********************************** -- Set the name of your package. package.name = "containers-components-plugin" -- Set this if you want a different name for your target than the package's name. local targetName = "containers" -- Set the kind of package you want to create. -- Options: exe | winexe | lib | dll package.kind = "dll" -- Set the files to include. package.files = { matchrecursive( "*.cpp", "*.h", "*.rc" ) } -- Set the include paths. package.includepaths = { "../../sdk/tinyxml", "../../sdk/plugin_interface" } -- Set the libraries it links to. package.links = { "plugin-interface", "TiCPP" } -- Setup the output directory options. -- Note: Use 'libdir' for "lib" kind only. if ( windows ) then package.bindir = "../../output/plugins/containers" else package.bindir = "../../output/lib/wxformbuilder" end --package.libdir = "../../lib" -- Set the defines. package.defines = { "BUILD_DLL", "TIXML_USE_TICPP" } -- Hack the dll output to prefix 'lib' to the begining. package.targetprefix = "lib" --------------------------- DO NOT EDIT BELOW ---------------------------------- --******* GENAERAL SETUP ********** --* Settings that are not dependant --* on the operating system. --********************************* -- Package options addoption( "unicode", "Use the Unicode character set" ) addoption( "with-wx-shared", "Link against wxWidgets as a shared library" ) if ( not windows ) then addoption( "disable-wx-debug", "Compile against a wxWidgets library without debugging" ) end -- Common setup package.language = "c++" -- Set object output directory. if ( options["unicode"] ) then package.config["Debug"].objdir = ".objsud" package.config["Release"].objdir = ".objsu" else package.config["Debug"].objdir = ".objsd" package.config["Release"].objdir = ".objs" end -- Set debug flags if ( options["disable-wx-debug"] and ( not windows ) ) then debug_option = "--debug=no" debug_macro = { "NDEBUG", "__WXFB_DEBUG__" } else debug_option = "--debug=yes" debug_macro = { "DEBUG", "_DEBUG", "__WXDEBUG__", "__WXFB_DEBUG__" } end -- Set the default targetName if none is specified. if ( string.len( targetName ) == 0 ) then targetName = package.name end -- Set the targets. package.config["Release"].target = targetName package.config["Debug"].target = targetName.."d" -- Set the build options. package.buildflags = { "extra-warnings" } package.config["Release"].buildflags = { "no-symbols", "optimize-speed" } if ( options["unicode"] ) then table.insert( package.buildflags, "unicode" ) end if ( string.find( target or "", ".*-gcc" ) or target == "gnu" ) then table.insert( package.buildflags, "no-import-lib" ) table.insert( package.config["Debug"].buildoptions, "-O0" ) table.insert( package.config["Release"].buildoptions, "-fno-strict-aliasing" ) end -- Set the defines. if ( options["with-wx-shared"] ) then table.insert( package.defines, "WXUSINGDLL" ) end if ( options["unicode"] ) then table.insert( package.defines, { "UNICODE", "_UNICODE" } ) end table.insert( package.defines, "__WX__" ) table.insert( package.config["Debug"].defines, debug_macro ) table.insert( package.config["Release"].defines, "NDEBUG" ) if ( windows ) then --******* WINDOWS SETUP *********** --* Settings that are Windows specific. --********************************* -- Set wxWidgets include paths if ( target == "cb-gcc" ) then table.insert( package.includepaths, "$(#WX.include)" ) else table.insert( package.includepaths, "$(WXWIN)/include" ) end -- Set the correct 'setup.h' include path. if ( options["with-wx-shared"] ) then if ( options["unicode"] ) then if ( target == "cb-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(#WX.lib)/gcc_dll/mswud" ) table.insert( package.config["Release"].includepaths, "$(#WX.lib)/gcc_dll/mswu" ) elseif ( target == "gnu" or target == "cl-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/gcc_dll/mswud" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/gcc_dll/mswu" ) else table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/vc_dll/mswud" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/vc_dll/mswu" ) end else if ( target == "cb-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(#WX.lib)/gcc_dll/mswd" ) table.insert( package.config["Release"].includepaths, "$(#WX.lib)/gcc_dll/msw" ) elseif ( target == "gnu" or target == "cl-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/gcc_dll/mswd" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/gcc_dll/msw" ) else table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/vc_dll/mswd" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/vc_dll/msw" ) end end else if ( options["unicode"] ) then if ( target == "cb-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(#WX.lib)/gcc_lib/mswud" ) table.insert( package.config["Release"].includepaths, "$(#WX.lib)/gcc_lib/mswu" ) elseif ( target == "gnu" or target == "cl-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/gcc_lib/mswud" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/gcc_lib/mswu" ) else table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/vc_lib/mswud" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/vc_lib/mswu" ) end else if ( target == "cb-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(#WX.lib)/gcc_lib/mswd" ) table.insert( package.config["Release"].includepaths, "$(#WX.lib)/gcc_lib/msw" ) elseif ( target == "gnu" or target == "cl-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/gcc_lib/mswd" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/gcc_lib/msw" ) else table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/vc_lib/mswd" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/vc_lib/msw" ) end end end -- Set the linker options. if ( options["with-wx-shared"] ) then if ( target == "cb-gcc" ) then table.insert( package.libpaths, "$(#WX.lib)/gcc_dll" ) elseif ( target == "gnu" or target == "cl-gcc" ) then table.insert( package.libpaths, "$(WXWIN)/lib/gcc_dll" ) else table.insert( package.libpaths, "$(WXWIN)/lib/vc_dll" ) end else if ( target == "cb-gcc" ) then table.insert( package.libpaths, "$(#WX.lib)/gcc_lib" ) elseif ( target == "gnu" or target == "cl-gcc" ) then table.insert( package.libpaths, "$(WXWIN)/lib/gcc_lib" ) else table.insert( package.libpaths, "$(WXWIN)/lib/vc_lib" ) end end -- Set wxWidgets libraries to link. if ( options["unicode"] ) then table.insert( package.config["Release"].links, "wxmsw"..wx_ver.."u" ) table.insert( package.config["Debug"].links, "wxmsw"..wx_ver.."ud" ) else table.insert( package.config["Release"].links, "wxmsw"..wx_ver ) table.insert( package.config["Debug"].links, "wxmsw"..wx_ver.."d" ) end -- Set the Windows defines. table.insert( package.defines, { "__WXMSW__", "WIN32", "_WINDOWS" } ) else --******* LINUX/MAC SETUP ************* --* Settings that are Linux/Mac specific. --************************************* -- Ignore resource files in Linux/Mac. table.insert( package.excludes, matchrecursive( "*.rc" ) ) table.insert( package.buildoptions, "-fPIC" ) -- Add buildflag for proper dll building. if ( macosx ) then table.insert( package.buildflags, "dylib" ) end -- Set wxWidgets build options. table.insert( package.config["Debug"].buildoptions, "`wx-config "..debug_option.." --cflags`" ) table.insert( package.config["Release"].buildoptions, "`wx-config --debug=no --cflags`" ) -- Set the wxWidgets link options. table.insert( package.config["Debug"].linkoptions, "`wx-config "..debug_option.." --libs`" ) table.insert( package.config["Release"].linkoptions, "`wx-config --libs`" ) end wxformbuilder-3.1.59/plugins/containers/containers.cpp0000644000175000017500000006133311143440026023454 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include // Includes notebook, listbook, choicebook, auibook #include "bookutils.h" /////////////////////////////////////////////////////////////////////////////// /** Event handler for events generated by controls in this plugin */ class ComponentEvtHandler : public wxEvtHandler { private: wxWindow* m_window; IManager* m_manager; public: ComponentEvtHandler( wxWindow* win, IManager* manager ) : m_window( win ), m_manager( manager ) { } protected: void OnNotebookPageChanged( wxNotebookEvent& event ); void OnListbookPageChanged( wxListbookEvent& event ); void OnChoicebookPageChanged( wxChoicebookEvent& event ); void OnAuiNotebookPageChanged( wxAuiNotebookEvent& event ); void OnSplitterSashChanged( wxSplitterEvent& event ); template < class T > void OnBookPageChanged( int selPage, wxEvent* event ) { // Only handle events from this book - prevents problems with nested books, because OnSelected is fired on an // object and all of its parents if ( m_window != event->GetEventObject() ) { return; } if ( selPage < 0 ) { return; } size_t count = m_manager->GetChildCount( m_window ); for ( size_t i = 0; i < count; i++ ) { wxObject* wxChild = m_manager->GetChild( m_window, i ); IObject* iChild = m_manager->GetIObject( wxChild ); if ( iChild ) { if ( (int)i == selPage && !iChild->GetPropertyAsInteger( _("select") ) ) { m_manager->ModifyProperty( wxChild, _("select"), wxT("1"), false ); } else if ( (int)i != selPage && iChild->GetPropertyAsInteger( _("select") ) ) { m_manager->ModifyProperty( wxChild, _("select"), wxT("0"), false ); } } } // Select the corresponding panel in the object tree T* book = wxDynamicCast( m_window, T ); if ( NULL != book ) { m_manager->SelectObject( book->GetPage( selPage ) ); } } void OnAuiNotebookPageClosed( wxAuiNotebookEvent& event ) { wxMessageBox( wxT("wxAuiNotebook pages can normally be closed.\nHowever, it is difficult to design a page that has been closed, so this action has been vetoed."), wxT("Page Close Vetoed!"), wxICON_INFORMATION, NULL ); event.Veto(); } void OnAuiNotebookAllowDND( wxAuiNotebookEvent& event ) { wxMessageBox( wxT("wxAuiNotebook pages can be dragged to other wxAuiNotebooks if the wxEVT_COMMAND_AUINOTEBOOK_ALLOW_DND event is caught and allowed.\nHowever, it is difficult to design a page that has been moved, so this action was not allowed."), wxT("Page Move Not Allowed!"), wxICON_INFORMATION, NULL ); event.Veto(); } DECLARE_EVENT_TABLE() }; BEGIN_EVENT_TABLE( ComponentEvtHandler, wxEvtHandler ) EVT_NOTEBOOK_PAGE_CHANGED( -1, ComponentEvtHandler::OnNotebookPageChanged ) EVT_LISTBOOK_PAGE_CHANGED( -1, ComponentEvtHandler::OnListbookPageChanged ) EVT_CHOICEBOOK_PAGE_CHANGED( -1, ComponentEvtHandler::OnChoicebookPageChanged ) EVT_AUINOTEBOOK_PAGE_CHANGED( -1, ComponentEvtHandler::OnAuiNotebookPageChanged ) EVT_AUINOTEBOOK_PAGE_CLOSE( -1, ComponentEvtHandler::OnAuiNotebookPageClosed ) EVT_AUINOTEBOOK_ALLOW_DND( -1, ComponentEvtHandler::OnAuiNotebookAllowDND ) EVT_SPLITTER_SASH_POS_CHANGED( -1, ComponentEvtHandler::OnSplitterSashChanged ) END_EVENT_TABLE() /////////////////////////////////////////////////////////////////////////////// class wxCustomSplitterWindow : public wxSplitterWindow { public: wxCustomSplitterWindow(wxWindow* parent, wxWindowID id, const wxPoint& point = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style=wxSP_3D) : wxSplitterWindow( parent, id, point, size, style ), m_customSashPos( 0 ), m_customMinPaneSize( 0 ) { } int m_customSashPos; int m_customMinPaneSize; int m_initialSashPos; // Used to ensure sash position is correct void OnIdle( wxIdleEvent& ) { Disconnect( wxEVT_IDLE, wxIdleEventHandler( wxCustomSplitterWindow::OnIdle ) ); // So the selection of the sizer at its initial position is cleared, then shown at the correct position Freeze(); SetSashPosition( m_initialSashPos ); Layout(); Refresh(); Update(); Thaw(); } private: bool OnSashPositionChange( int newSashPosition ) { m_customSashPos = newSashPosition; return wxSplitterWindow::OnSashPositionChange( newSashPosition ); } void OnDoubleClickSash( int, int ) { if ( 0 == m_customMinPaneSize ) { wxMessageBox( wxT("Double-clicking a wxSplitterWindow sash with the minimum pane size set to 0 would normally unsplit it.\nHowever, it is difficult to design a pane that has been closed, so this action has been vetoed."), wxT("Unsplit Vetoed!"), wxICON_INFORMATION, NULL ); } } }; // Since wxGTK 2.8, wxNotebook has been sending page changed events in its destructor - this causes strange behavior #if defined( __WXGTK__ ) && wxCHECK_VERSION( 2, 8, 0 ) class wxCustomNotebook : public wxNotebook { public: wxCustomNotebook( wxWindow* parent, wxWindowID id, const wxPoint& point = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0 ) : wxNotebook( parent, id, point, size, style ) { } ~wxCustomNotebook() { while ( GetEventHandler() != this ) { // Remove and delete extra event handlers PopEventHandler( true ); } } }; #else typedef wxNotebook wxCustomNotebook; #endif /////////////////////////////////////////////////////////////////////////////// class PanelComponent : public ComponentBase { public: wxObject* Create(IObject *obj, wxObject *parent) { wxPanel* panel = new wxPanel((wxWindow *)parent,-1, obj->GetPropertyAsPoint(_("pos")), obj->GetPropertyAsSize(_("size")), obj->GetPropertyAsInteger(_("style")) | obj->GetPropertyAsInteger(_("window_style"))); return panel; } ticpp::Element* ExportToXrc(IObject *obj) { ObjectToXrcFilter xrc(obj, _("wxPanel"), obj->GetPropertyAsString(_("name"))); xrc.AddWindowProperties(); return xrc.GetXrcObject(); } ticpp::Element* ImportFromXrc( ticpp::Element* xrcObj ) { XrcToXfbFilter filter(xrcObj, _("wxPanel")); filter.AddWindowProperties(); return filter.GetXfbObject(); } }; class SplitterWindowComponent : public ComponentBase { wxObject* Create(IObject *obj, wxObject *parent) { wxCustomSplitterWindow *splitter = new wxCustomSplitterWindow((wxWindow *)parent,-1, obj->GetPropertyAsPoint(_("pos")), obj->GetPropertyAsSize(_("size")), (obj->GetPropertyAsInteger(_("style")) | obj->GetPropertyAsInteger(_("window_style"))) & ~wxSP_PERMIT_UNSPLIT ); if ( !obj->IsNull( _("sashgravity") ) ) { float gravity = obj->GetPropertyAsFloat( _("sashgravity") ); gravity = ( gravity < 0.0 ? 0.0 : gravity ); gravity = ( gravity > 1.0 ? 1.0 : gravity ); splitter->SetSashGravity( gravity ); } if ( !obj->IsNull( _("sashsize") ) ) { splitter->SetSashSize( obj->GetPropertyAsInteger( _("sashsize") ) ); } if ( !obj->IsNull( _("min_pane_size") ) ) { int minPaneSize = obj->GetPropertyAsInteger( _("min_pane_size") ); splitter->m_customMinPaneSize = minPaneSize; minPaneSize = ( minPaneSize < 1 ? 1 : minPaneSize ); splitter->SetMinimumPaneSize( minPaneSize ); } // Always have a child so it is drawn consistently splitter->Initialize( new wxPanel( splitter ) ); // Used to ensure sash position is correct splitter->m_initialSashPos = obj->GetPropertyAsInteger( _("sashpos") ); splitter->Connect( wxEVT_IDLE, wxIdleEventHandler( wxCustomSplitterWindow::OnIdle ) ); return splitter; } ticpp::Element* ExportToXrc(IObject *obj) { ObjectToXrcFilter xrc(obj, _("wxSplitterWindow"), obj->GetPropertyAsString(_("name"))); xrc.AddWindowProperties(); xrc.AddProperty(_("sashpos"),_("sashpos"),XRC_TYPE_INTEGER); xrc.AddProperty(_("sashgravity"),_("gravity"),XRC_TYPE_FLOAT); xrc.AddProperty(_("min_pane_size"),_("minsize"),XRC_TYPE_INTEGER); if (obj->GetPropertyAsString(_("splitmode")) == wxT("wxSPLIT_VERTICAL")) xrc.AddPropertyValue(_("orientation"),wxT("vertical")); else xrc.AddPropertyValue(_("orientation"),wxT("horizontal")); return xrc.GetXrcObject(); } ticpp::Element* ImportFromXrc( ticpp::Element* xrcObj ) { XrcToXfbFilter filter(xrcObj, _("wxSplitterWindow")); filter.AddWindowProperties(); filter.AddProperty(_("sashpos"),_("sashpos"),XRC_TYPE_INTEGER); filter.AddProperty(_("gravity"),_("sashgravity"),XRC_TYPE_FLOAT); filter.AddProperty(_("minsize"),_("min_pane_size"),XRC_TYPE_INTEGER); try { ticpp::Element *splitmode = xrcObj->FirstChildElement("orientation"); std::string value = splitmode->GetText(); if (value == "vertical") filter.AddPropertyValue(wxT("splitmode"),wxT("wxSPLIT_VERTICAL")); else filter.AddPropertyValue(wxT("splitmode"),wxT("wxSPLIT_HORIZONTAL")); } catch( ticpp::Exception& ) { } return filter.GetXfbObject(); } void OnCreated( wxObject* wxobject, wxWindow* /*wxparent*/ ) { wxCustomSplitterWindow* splitter = wxDynamicCast( wxobject, wxCustomSplitterWindow ); if ( NULL == splitter ) { wxLogError( _("This should be a wxSplitterWindow") ); return; } // Remove default panel wxWindow* firstChild = splitter->GetWindow1(); size_t childCount = GetManager()->GetChildCount( wxobject ); switch ( childCount ) { case 1: { // The child should be a splitteritem wxObject* splitterItem = GetManager()->GetChild( wxobject, 0 ); // This one should be the actual wxWindow wxWindow* subwindow = wxDynamicCast( GetManager()->GetChild( splitterItem, 0 ), wxWindow ); if ( NULL == subwindow ) { wxLogError( _("A SplitterItem is abstract and must have a child!") ); return; } if ( firstChild ) { splitter->ReplaceWindow( firstChild, subwindow ); firstChild->Destroy(); } else { splitter->Initialize( subwindow ); } splitter->PushEventHandler( new ComponentEvtHandler( splitter, GetManager() ) ); break; } case 2: { // The child should be a splitteritem wxObject* splitterItem0 = GetManager()->GetChild( wxobject, 0 ); wxObject* splitterItem1 = GetManager()->GetChild( wxobject, 1 ); // This one should be the actual wxWindow wxWindow* subwindow0 = wxDynamicCast( GetManager()->GetChild( splitterItem0, 0 ), wxWindow ); wxWindow* subwindow1 = wxDynamicCast( GetManager()->GetChild( splitterItem1, 0 ), wxWindow ); if ( NULL == subwindow0 || NULL == subwindow1 ) { wxLogError( _("A SplitterItem is abstract and must have a child!") ); return; } // Get the split mode and sash position IObject* obj = GetManager()->GetIObject( wxobject ); if ( obj == NULL ) { return; } int sashPos = obj->GetPropertyAsInteger(_("sashpos")); int splitmode = obj->GetPropertyAsInteger(_("splitmode")); if ( firstChild ) { splitter->ReplaceWindow( firstChild, subwindow0 ); firstChild->Destroy(); } if ( splitmode == wxSPLIT_VERTICAL ) { splitter->SplitVertically( subwindow0, subwindow1, sashPos ); } else { splitter->SplitHorizontally( subwindow0, subwindow1, sashPos ); } splitter->PushEventHandler( new ComponentEvtHandler( splitter, GetManager() ) ); break; } default: return; } } }; void ComponentEvtHandler::OnSplitterSashChanged( wxSplitterEvent& ) { wxCustomSplitterWindow* window = wxDynamicCast( m_window, wxCustomSplitterWindow ); if ( window != NULL ) { if ( window->m_customSashPos != 0 ) { m_manager->ModifyProperty( window, _("sashpos"), wxString::Format( wxT("%i"), window->GetSashPosition() ) ); } } } class SplitterItemComponent : public ComponentBase { ticpp::Element* ExportToXrc(IObject *obj) { // A __dummyitem__ will be ignored... ObjectToXrcFilter xrc(obj, _("__dummyitem__"),wxT("")); return xrc.GetXrcObject(); } }; class ScrolledWindowComponent : public ComponentBase { public: wxObject* Create(IObject *obj, wxObject *parent) { wxScrolledWindow *sw = new wxScrolledWindow((wxWindow *)parent, -1, obj->GetPropertyAsPoint(_("pos")), obj->GetPropertyAsSize(_("size")), obj->GetPropertyAsInteger(_("style")) | obj->GetPropertyAsInteger(_("window_style"))); sw->SetScrollRate( obj->GetPropertyAsInteger(_("scroll_rate_x")), obj->GetPropertyAsInteger(_("scroll_rate_y"))); return sw; } ticpp::Element* ExportToXrc(IObject *obj) { ObjectToXrcFilter xrc(obj, _("wxScrolledWindow"), obj->GetPropertyAsString(_("name"))); xrc.AddWindowProperties(); return xrc.GetXrcObject(); } ticpp::Element* ImportFromXrc( ticpp::Element* xrcObj ) { XrcToXfbFilter filter(xrcObj, _("wxScrolledWindow")); filter.AddWindowProperties(); return filter.GetXfbObject(); } }; class NotebookComponent : public ComponentBase { public: wxObject* Create(IObject *obj, wxObject *parent) { wxNotebook* book = new wxCustomNotebook((wxWindow *)parent,-1, obj->GetPropertyAsPoint(_("pos")), obj->GetPropertyAsSize(_("size")), obj->GetPropertyAsInteger(_("style")) | obj->GetPropertyAsInteger(_("window_style"))); BookUtils::AddImageList( obj, book ); book->PushEventHandler( new ComponentEvtHandler( book, GetManager() ) ); return book; } ticpp::Element* ExportToXrc(IObject *obj) { ObjectToXrcFilter xrc(obj, _("wxNotebook"), obj->GetPropertyAsString(_("name"))); xrc.AddWindowProperties(); return xrc.GetXrcObject(); } ticpp::Element* ImportFromXrc( ticpp::Element* xrcObj ) { XrcToXfbFilter filter(xrcObj, _("wxNotebook")); filter.AddWindowProperties(); return filter.GetXfbObject(); } }; void ComponentEvtHandler::OnNotebookPageChanged( wxNotebookEvent& event ) { OnBookPageChanged< wxNotebook >( event.GetSelection(), &event ); event.Skip(); } class NotebookPageComponent : public ComponentBase { public: void OnCreated( wxObject* wxobject, wxWindow* wxparent ) { BookUtils::OnCreated< wxNotebook >( wxobject, wxparent, GetManager(), _("NotebookPageComponent") ); } void OnSelected( wxObject* wxobject ) { BookUtils::OnSelected< wxNotebook >( wxobject, GetManager() ); } ticpp::Element* ExportToXrc(IObject *obj) { ObjectToXrcFilter xrc(obj, _("notebookpage")); xrc.AddProperty(_("label"),_("label"),XRC_TYPE_TEXT); xrc.AddProperty(_("select"),_("selected"),XRC_TYPE_BOOL); return xrc.GetXrcObject(); } ticpp::Element* ImportFromXrc( ticpp::Element* xrcObj ) { XrcToXfbFilter filter(xrcObj, _("notebookpage")); filter.AddWindowProperties(); filter.AddProperty(_("selected"),_("select"),XRC_TYPE_BOOL); filter.AddProperty(_("label"),_("label"),XRC_TYPE_TEXT); return filter.GetXfbObject(); } }; class ListbookComponent : public ComponentBase { public: wxObject* Create(IObject *obj, wxObject *parent) { wxListbook* book = new wxListbook((wxWindow *)parent,-1, obj->GetPropertyAsPoint(_("pos")), obj->GetPropertyAsSize(_("size")), obj->GetPropertyAsInteger(_("style")) | obj->GetPropertyAsInteger(_("window_style"))); BookUtils::AddImageList( obj, book ); book->PushEventHandler( new ComponentEvtHandler( book, GetManager() ) ); return book; } // Small icon style not supported by GTK #ifndef __WXGTK__ void OnCreated( wxObject* wxobject, wxWindow* wxparent ) { wxListbook* book = wxDynamicCast( wxparent, wxListbook ); if ( book ) { // Small icon style if bitmapsize is not set IObject* obj = GetManager()->GetIObject( wxobject ); if ( obj->GetPropertyAsString( _("bitmapsize") ).empty() ) { wxListView* tmpListView = book->GetListView(); long flags = tmpListView->GetWindowStyleFlag(); flags = (flags & ~wxLC_ICON) | wxLC_SMALL_ICON; tmpListView->SetWindowStyleFlag( flags ); } } } #endif ticpp::Element* ExportToXrc(IObject *obj) { ObjectToXrcFilter xrc(obj, _("wxListbook"), obj->GetPropertyAsString(_("name"))); xrc.AddWindowProperties(); return xrc.GetXrcObject(); } ticpp::Element* ImportFromXrc( ticpp::Element* xrcObj ) { XrcToXfbFilter filter(xrcObj, _("wxListbook")); filter.AddWindowProperties(); return filter.GetXfbObject(); } }; void ComponentEvtHandler::OnListbookPageChanged( wxListbookEvent& event ) { OnBookPageChanged< wxListbook >( event.GetSelection(), &event ); event.Skip(); } class ListbookPageComponent : public ComponentBase { public: void OnCreated( wxObject* wxobject, wxWindow* wxparent ) { BookUtils::OnCreated< wxListbook >( wxobject, wxparent, GetManager(), _("ListbookPageComponent") ); } void OnSelected( wxObject* wxobject ) { BookUtils::OnSelected< wxListbook >( wxobject, GetManager() ); } ticpp::Element* ExportToXrc(IObject *obj) { ObjectToXrcFilter xrc(obj, _("listbookpage")); xrc.AddProperty(_("label"),_("label"),XRC_TYPE_TEXT); xrc.AddProperty(_("select"),_("selected"),XRC_TYPE_BOOL); return xrc.GetXrcObject(); } ticpp::Element* ImportFromXrc( ticpp::Element* xrcObj ) { XrcToXfbFilter filter(xrcObj, _("listbookpage")); filter.AddWindowProperties(); filter.AddProperty(_("selected"),_("select"),XRC_TYPE_BOOL); filter.AddProperty(_("label"),_("label"),XRC_TYPE_TEXT); return filter.GetXfbObject(); } }; class ChoicebookComponent : public ComponentBase { public: wxObject* Create(IObject *obj, wxObject *parent) { wxChoicebook* book = new wxChoicebook((wxWindow *)parent,-1, obj->GetPropertyAsPoint(_("pos")), obj->GetPropertyAsSize(_("size")), obj->GetPropertyAsInteger(_("style")) | obj->GetPropertyAsInteger(_("window_style"))); book->PushEventHandler( new ComponentEvtHandler( book, GetManager() ) ); return book; } ticpp::Element* ExportToXrc(IObject *obj) { ObjectToXrcFilter xrc(obj, _("wxChoicebook"), obj->GetPropertyAsString(_("name"))); xrc.AddWindowProperties(); return xrc.GetXrcObject(); } ticpp::Element* ImportFromXrc( ticpp::Element* xrcObj ) { XrcToXfbFilter filter(xrcObj, _("wxChoicebook")); filter.AddWindowProperties(); return filter.GetXfbObject(); } }; void ComponentEvtHandler::OnChoicebookPageChanged( wxChoicebookEvent& event ) { OnBookPageChanged< wxChoicebook >( event.GetSelection(), &event ); event.Skip(); } class ChoicebookPageComponent : public ComponentBase { public: void OnCreated( wxObject* wxobject, wxWindow* wxparent ) { BookUtils::OnCreated< wxChoicebook >( wxobject, wxparent, GetManager(), _("ChoicebookPageComponent") ); } void OnSelected( wxObject* wxobject ) { BookUtils::OnSelected< wxChoicebook >( wxobject, GetManager() ); } ticpp::Element* ExportToXrc(IObject *obj) { ObjectToXrcFilter xrc(obj, _("choicebookpage")); xrc.AddProperty(_("label"),_("label"),XRC_TYPE_TEXT); xrc.AddProperty(_("select"),_("selected"),XRC_TYPE_BOOL); return xrc.GetXrcObject(); } ticpp::Element* ImportFromXrc( ticpp::Element* xrcObj ) { XrcToXfbFilter filter(xrcObj, _("choicebookpage")); filter.AddWindowProperties(); filter.AddProperty(_("selected"),_("select"),XRC_TYPE_BOOL); filter.AddProperty(_("label"),_("label"),XRC_TYPE_TEXT); return filter.GetXfbObject(); } }; class AuiNotebookComponent : public ComponentBase { public: wxObject* Create(IObject *obj, wxObject *parent) { wxAuiNotebook* book = new wxAuiNotebook((wxWindow *)parent,-1, obj->GetPropertyAsPoint(_("pos")), obj->GetPropertyAsSize(_("size")), obj->GetPropertyAsInteger(_("style")) | obj->GetPropertyAsInteger(_("window_style"))); book->SetTabCtrlHeight( obj->GetPropertyAsInteger( _("tab_ctrl_height") ) ); book->SetUniformBitmapSize( obj->GetPropertyAsSize( _("uniform_bitmap_size") ) ); book->PushEventHandler( new ComponentEvtHandler( book, GetManager() ) ); return book; } /* ticpp::Element* ExportToXrc(IObject *obj) { ObjectToXrcFilter xrc(obj, _("wxAuiNotebook"), obj->GetPropertyAsString(_("name"))); xrc.AddWindowProperties(); return xrc.GetXrcObject(); } ticpp::Element* ImportFromXrc( ticpp::Element* xrcObj ) { XrcToXfbFilter filter(xrcObj, _("wxAuiNotebook")); filter.AddWindowProperties(); return filter.GetXfbObject(); } */ }; void ComponentEvtHandler::OnAuiNotebookPageChanged( wxAuiNotebookEvent& event ) { OnBookPageChanged< wxAuiNotebook >( event.GetSelection(), &event ); event.Skip(); } class AuiNotebookPageComponent : public ComponentBase { public: void OnCreated( wxObject* wxobject, wxWindow* wxparent ) { // Easy read-only property access IObject* obj = GetManager()->GetIObject( wxobject ); wxAuiNotebook* book = wxDynamicCast( wxparent, wxAuiNotebook ); //This wouldn't compile in MinGW - strange ///wxWindow* page = wxDynamicCast( manager->GetChild( wxobject, 0 ), wxWindow ); // Do this instead wxObject* child = GetManager()->GetChild( wxobject, 0 ); wxWindow* page = NULL; if ( child->IsKindOf(CLASSINFO(wxWindow))) { page = (wxWindow*)child; } // Error checking if ( !( obj && book && page ) ) { wxLogError( _("AuiNotebookPageComponent is missing its wxFormBuilder object(%i), its parent(%i), or its child(%i)"), obj, book, page ); return; } // Prevent event handling by wxFB - these aren't user generated events SuppressEventHandlers suppress( book ); // Save selection int selection = book->GetSelection(); const wxBitmap& bitmap = obj->IsNull( _("bitmap") ) ? wxNullBitmap : obj->GetPropertyAsBitmap( _("bitmap") ); book->AddPage( page, obj->GetPropertyAsString( _("label") ), false, bitmap ); if ( obj->GetPropertyAsString( _("select") ) == wxT("0") && selection >= 0 ) { book->SetSelection(selection); } else { book->SetSelection( book->GetPageCount() - 1 ); } } void OnSelected( wxObject* wxobject ) { BookUtils::OnSelected< wxAuiNotebook >( wxobject, GetManager() ); } /* ticpp::Element* ExportToXrc(IObject *obj) { ObjectToXrcFilter xrc(obj, _("auinotebookpage")); xrc.AddProperty(_("label"),_("label"),XRC_TYPE_TEXT); xrc.AddProperty(_("selected"),_("selected"),XRC_TYPE_BOOL); return xrc.GetXrcObject(); } ticpp::Element* ImportFromXrc( ticpp::Element* xrcObj ) { XrcToXfbFilter filter(xrcObj, _("auinotebookpage")); filter.AddWindowProperties(); filter.AddProperty(_("selected"),_("selected"),XRC_TYPE_BOOL); filter.AddProperty(_("label"),_("label"),XRC_TYPE_TEXT); return filter.GetXfbObject(); } */ }; /////////////////////////////////////////////////////////////////////////////// BEGIN_LIBRARY() WINDOW_COMPONENT("wxPanel",PanelComponent) WINDOW_COMPONENT("wxSplitterWindow",SplitterWindowComponent) ABSTRACT_COMPONENT("splitteritem",SplitterItemComponent) WINDOW_COMPONENT("wxScrolledWindow",ScrolledWindowComponent) WINDOW_COMPONENT("wxNotebook", NotebookComponent) ABSTRACT_COMPONENT("notebookpage",NotebookPageComponent) WINDOW_COMPONENT("wxListbook", ListbookComponent) ABSTRACT_COMPONENT("listbookpage", ListbookPageComponent) WINDOW_COMPONENT("wxChoicebook", ChoicebookComponent) ABSTRACT_COMPONENT("choicebookpage", ChoicebookPageComponent) WINDOW_COMPONENT("wxAuiNotebook", AuiNotebookComponent) ABSTRACT_COMPONENT("auinotebookpage", AuiNotebookPageComponent) // wxSplitterWindow MACRO(wxSP_3D) MACRO(wxSP_3DSASH) MACRO(wxSP_3DBORDER) MACRO(wxSP_BORDER) MACRO(wxSP_NOBORDER) MACRO(wxSP_NO_XP_THEME) MACRO(wxSP_PERMIT_UNSPLIT) MACRO(wxSP_LIVE_UPDATE) MACRO(wxSPLIT_VERTICAL) MACRO(wxSPLIT_HORIZONTAL) // wxScrolledWindow MACRO(wxHSCROLL); MACRO(wxVSCROLL); // wxNotebook MACRO(wxNB_TOP) MACRO(wxNB_LEFT) MACRO(wxNB_RIGHT) MACRO(wxNB_BOTTOM) MACRO(wxNB_FIXEDWIDTH) MACRO(wxNB_MULTILINE) MACRO(wxNB_NOPAGETHEME) MACRO(wxNB_FLAT) // wxListbook MACRO(wxLB_TOP) MACRO(wxLB_LEFT) MACRO(wxLB_RIGHT) MACRO(wxLB_BOTTOM) MACRO(wxLB_DEFAULT) // wxChoicebook MACRO(wxCHB_TOP) MACRO(wxCHB_LEFT) MACRO(wxCHB_RIGHT) MACRO(wxCHB_BOTTOM) MACRO(wxCHB_DEFAULT) // wxAuiNotebook MACRO(wxAUI_NB_DEFAULT_STYLE) MACRO(wxAUI_NB_TAB_SPLIT) MACRO(wxAUI_NB_TAB_MOVE) MACRO(wxAUI_NB_TAB_EXTERNAL_MOVE) MACRO(wxAUI_NB_TAB_FIXED_WIDTH) MACRO(wxAUI_NB_SCROLL_BUTTONS) MACRO(wxAUI_NB_WINDOWLIST_BUTTON) MACRO(wxAUI_NB_CLOSE_BUTTON) MACRO(wxAUI_NB_CLOSE_ON_ACTIVE_TAB) MACRO(wxAUI_NB_CLOSE_ON_ALL_TABS) END_LIBRARY() wxformbuilder-3.1.59/plugins/containers/Makefile0000644000175000017500000000677011143440026022247 0ustar rrmulderrrmulder# C++ Shared Library Makefile autogenerated by premake # Don't edit this file! Instead edit `premake.lua` then rerun `make` ifndef CONFIG CONFIG=Release endif ifeq ($(CONFIG),Release) BINDIR := ../../output/lib/wxformbuilder LIBDIR := ../.. OBJDIR := .objsu OUTDIR := ../../output/lib/wxformbuilder CPPFLAGS := -MMD -D "BUILD_DLL" -D "TIXML_USE_TICPP" -D "WXUSINGDLL" -D "UNICODE" -D "_UNICODE" -D "__WX__" -D "NDEBUG" -I "../../sdk/tinyxml" -I "../../sdk/plugin_interface" CFLAGS += $(CPPFLAGS) $(TARGET_ARCH) -fPIC -O3 -Wall -fPIC -fno-strict-aliasing `wx-config --debug=no --cflags` CXXFLAGS := $(CFLAGS) LDFLAGS += -L$(BINDIR) -L$(LIBDIR) -shared -s `wx-config --libs` -L../../sdk/lib -lfbPluginInterface -L../../sdk/lib -lticpp LDDEPS := ../../sdk/lib/libfbPluginInterface.a ../../sdk/lib/libticpp.a RESFLAGS := -D "BUILD_DLL" -D "TIXML_USE_TICPP" -D "WXUSINGDLL" -D "UNICODE" -D "_UNICODE" -D "__WX__" -D "NDEBUG" -I "../../sdk/tinyxml" -I "../../sdk/plugin_interface" TARGET := libcontainers.so BLDCMD = $(CXX) -o $(OUTDIR)/$(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(TARGET_ARCH) endif ifeq ($(CONFIG),Debug) BINDIR := ../../output/lib/wxformbuilder LIBDIR := ../.. OBJDIR := .objsud OUTDIR := ../../output/lib/wxformbuilder CPPFLAGS := -MMD -D "BUILD_DLL" -D "TIXML_USE_TICPP" -D "WXUSINGDLL" -D "UNICODE" -D "_UNICODE" -D "__WX__" -D "NDEBUG" -D "__WXFB_DEBUG__" -I "../../sdk/tinyxml" -I "../../sdk/plugin_interface" CFLAGS += $(CPPFLAGS) $(TARGET_ARCH) -fPIC -g -Wall -fPIC -O0 `wx-config --debug=no --cflags` CXXFLAGS := $(CFLAGS) LDFLAGS += -L$(BINDIR) -L$(LIBDIR) -shared `wx-config --debug=no --libs` -L../../sdk/lib -lfbPluginInterfaced -L../../sdk/lib -lticppd LDDEPS := ../../sdk/lib/libfbPluginInterfaced.a ../../sdk/lib/libticppd.a RESFLAGS := -D "BUILD_DLL" -D "TIXML_USE_TICPP" -D "WXUSINGDLL" -D "UNICODE" -D "_UNICODE" -D "__WX__" -D "NDEBUG" -D "__WXFB_DEBUG__" -I "../../sdk/tinyxml" -I "../../sdk/plugin_interface" TARGET := libcontainersd.so BLDCMD = $(CXX) -o $(OUTDIR)/$(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(TARGET_ARCH) endif OBJECTS := \ $(OBJDIR)/containers.o \ MKDIR_TYPE := msdos CMD := $(subst \,\\,$(ComSpec)$(COMSPEC)) ifeq (,$(CMD)) MKDIR_TYPE := posix endif ifeq (/bin/sh.exe,$(SHELL)) MKDIR_TYPE := posix endif ifeq ($(MKDIR_TYPE),posix) CMD_MKBINDIR := mkdir -p $(BINDIR) CMD_MKLIBDIR := mkdir -p $(LIBDIR) CMD_MKOUTDIR := mkdir -p $(OUTDIR) CMD_MKOBJDIR := mkdir -p $(OBJDIR) else CMD_MKBINDIR := $(CMD) /c if not exist $(subst /,\\,$(BINDIR)) mkdir $(subst /,\\,$(BINDIR)) CMD_MKLIBDIR := $(CMD) /c if not exist $(subst /,\\,$(LIBDIR)) mkdir $(subst /,\\,$(LIBDIR)) CMD_MKOUTDIR := $(CMD) /c if not exist $(subst /,\\,$(OUTDIR)) mkdir $(subst /,\\,$(OUTDIR)) CMD_MKOBJDIR := $(CMD) /c if not exist $(subst /,\\,$(OBJDIR)) mkdir $(subst /,\\,$(OBJDIR)) endif .PHONY: clean $(OUTDIR)/$(TARGET): $(OBJECTS) $(LDDEPS) $(RESOURCES) @echo Linking containers-components-plugin -@$(CMD_MKBINDIR) -@$(CMD_MKLIBDIR) -@$(CMD_MKOUTDIR) @$(BLDCMD) clean: @echo Cleaning containers-components-plugin ifeq ($(MKDIR_TYPE),posix) -@rm -f $(OUTDIR)/$(TARGET) -@rm -rf $(OBJDIR) else -@if exist $(subst /,\,$(OUTDIR)/$(TARGET)) del /q $(subst /,\,$(OUTDIR)/$(TARGET)) -@if exist $(subst /,\,$(OBJDIR)) del /q $(subst /,\,$(OBJDIR)) -@if exist $(subst /,\,$(OBJDIR)) rmdir /s /q $(subst /,\,$(OBJDIR)) endif $(OBJDIR)/containers.o: containers.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -include $(OBJECTS:%.o=%.d) wxformbuilder-3.1.59/plugins/containers/bookutils.h0000644000175000017500000001147111143440026022765 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // Ryan Mulder - rjmyst3@gmail.com // /////////////////////////////////////////////////////////////////////////////// #ifndef BOOKUTILS #define BOOKUTILS #include #include #include #include #include #include #include #include class SuppressEventHandlers { private: std::vector< wxEvtHandler* > m_handlers; wxWindow* m_window; public: SuppressEventHandlers( wxWindow* window ) : m_window( window ) { while ( window->GetEventHandler() != window ) { m_handlers.push_back( window->PopEventHandler() ); } } ~SuppressEventHandlers() { std::vector< wxEvtHandler* >::reverse_iterator handler; for ( handler = m_handlers.rbegin(); handler != m_handlers.rend(); ++handler ) { m_window->PushEventHandler( *handler ); } } }; namespace BookUtils { template < class T > void AddImageList( IObject* obj, T* book ) { if ( !obj->GetPropertyAsString( _("bitmapsize") ).empty() ) { wxSize imageSize = obj->GetPropertyAsSize(_("bitmapsize")); wxImageList* images = new wxImageList( imageSize.GetWidth(), imageSize.GetHeight() ); wxImage image = wxBitmap( default_xpm ).ConvertToImage(); images->Add( image.Scale( imageSize.GetWidth(), imageSize.GetHeight() ) ); book->AssignImageList( images ); } } template < class T > void OnCreated( wxObject* wxobject, wxWindow* wxparent, IManager* manager, wxString name ) { // Easy read-only property access IObject* obj = manager->GetIObject( wxobject ); T* book = wxDynamicCast( wxparent, T ); //This wouldn't compile in MinGW - strange ///wxWindow* page = wxDynamicCast( manager->GetChild( wxobject, 0 ), wxWindow ); // Do this instead wxObject* child = manager->GetChild( wxobject, 0 ); wxWindow* page = NULL; if ( child->IsKindOf(CLASSINFO(wxWindow))) { page = (wxWindow*)child; } // Error checking if ( !( obj && book && page ) ) { wxLogError( _("%s is missing its wxFormBuilder object(%i), its parent(%i), or its child(%i)"), name.c_str(), obj, book, page ); return; } // Prevent event handling by wxFB - these aren't user generated events SuppressEventHandlers suppress( book ); // Save selection int selection = book->GetSelection(); book->AddPage( page, obj->GetPropertyAsString( _("label") ) ); // Apply image to page IObject* parentObj = manager->GetIObject( wxparent ); if ( !parentObj ) { wxLogError( _("%s's parent is missing its wxFormBuilder object"), name.c_str() ); return; } if ( !parentObj->GetPropertyAsString( _("bitmapsize") ).empty() ) { if ( !obj->GetPropertyAsString( _("bitmap") ).empty() ) { wxSize imageSize = parentObj->GetPropertyAsSize( _("bitmapsize") ); int width = imageSize.GetWidth(); int height = imageSize.GetHeight(); if ( width > 0 && height > 0 ) { wxImageList* imageList = book->GetImageList(); if ( imageList != NULL ) { wxImage image = obj->GetPropertyAsBitmap( _("bitmap") ).ConvertToImage(); imageList->Add( image.Scale( width, height ) ); book->SetPageImage( book->GetPageCount() - 1, imageList->GetImageCount() - 1 ); } } } } if ( obj->GetPropertyAsString( _("select") ) == wxT("0") && selection >= 0 ) { book->SetSelection(selection); } else { book->SetSelection( book->GetPageCount() - 1 ); } } template < class T > void OnSelected( wxObject* wxobject, IManager* manager ) { // Get actual page - first child wxObject* page = manager->GetChild( wxobject, 0 ); if ( NULL == page ) { return; } T* book = wxDynamicCast( manager->GetParent( wxobject ), T ); if ( book ) { for ( size_t i = 0; i < book->GetPageCount(); ++i ) { if ( book->GetPage( i ) == page ) { // Prevent infinite event loop SuppressEventHandlers suppress( book ); // Select Page book->SetSelection( i ); } } } } } #endif //BOOKUTILS wxformbuilder-3.1.59/src/rad/dataobject/dataobject.h0000644000175000017500000000355411143440026022664 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // Ryan Mulder - rjmyst3@gmail.com // /////////////////////////////////////////////////////////////////////////////// #ifndef __DATA_OBJECT__ #define __DATA_OBJECT__ #include #include #include #include "utils/wxfbdefs.h" #define wxFBDataObjectFormat wxDataFormat( wxT("wxFormBuilderDataFormat") ) class wxFBDataObject : public wxDataObject { private: std::string m_data; public: wxFBDataObject( PObjectBase obj = PObjectBase() ); ~wxFBDataObject(); void GetAllFormats( wxDataFormat* formats, Direction dir = Get ) const; bool GetDataHere( const wxDataFormat& format, void* buf ) const; size_t GetDataSize(const wxDataFormat& format ) const; size_t GetFormatCount( Direction dir = Get ) const; wxDataFormat GetPreferredFormat( Direction dir = Get ) const; bool SetData( const wxDataFormat& format, size_t len, const void *buf ); PObjectBase GetObj(); }; #endif //__DATA_OBJECT__ wxformbuilder-3.1.59/src/rad/dataobject/dataobject.cpp0000644000175000017500000001012411143440026023206 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // Ryan Mulder - rjmyst3@gmail.com // /////////////////////////////////////////////////////////////////////////////// #include "dataobject.h" #include "model/objectbase.h" #include "utils/typeconv.h" #include #include #include "rad/appdata.h" #include #include wxFBDataObject::wxFBDataObject( PObjectBase obj ) : wxDataObject() { if ( obj ) { // create xml representation of ObjectBase ticpp::Element element; obj->SerializeObject( &element ); // add version info to xml data, just in case it is pasted into a different version of wxFB element.SetAttribute( "fbp_version_major", AppData()->m_fbpVerMajor ); element.SetAttribute( "fbp_version_minor", AppData()->m_fbpVerMinor ); ticpp::Document doc; doc.LinkEndChild( &element ); TiXmlPrinter printer; printer.SetIndent( "\t" ); #if defined( __WXMSW__ ) printer.SetLineBreak( "\r\n" ); #elif defined( __WXMAC__ ) printer.SetLineBreak( "\r" ); #else printer.SetLineBreak( "\n" ); #endif doc.Accept( &printer ); m_data = printer.Str(); } } wxFBDataObject::~wxFBDataObject() { } void wxFBDataObject::GetAllFormats( wxDataFormat* formats, Direction dir ) const { switch ( dir ) { case Get: formats[0] = wxFBDataObjectFormat; formats[1] = wxDF_TEXT; break; case Set: formats[0] = wxFBDataObjectFormat; break; default: break; } } bool wxFBDataObject::GetDataHere( const wxDataFormat&, void* buf ) const { if ( NULL == buf ) { return false; } memcpy( (char*)buf, m_data.c_str(), m_data.length() ); return true; } size_t wxFBDataObject::GetDataSize( const wxDataFormat& /*format*/ ) const { return m_data.length(); } size_t wxFBDataObject::GetFormatCount( Direction dir ) const { switch ( dir ) { case Get: return 2; case Set: return 1; default: return 0; } } wxDataFormat wxFBDataObject::GetPreferredFormat( Direction /*dir*/ ) const { return wxFBDataObjectFormat; } bool wxFBDataObject::SetData( const wxDataFormat& format, size_t len, const void *buf ) { if ( format != wxFBDataObjectFormat ) { return false; } m_data.assign( reinterpret_cast< const char* >( buf ), len ); return true; } PObjectBase wxFBDataObject::GetObj() { if ( m_data.empty() ) { return PObjectBase(); } // Read Object from xml try { ticpp::Document doc; doc.Parse( m_data, true, TIXML_ENCODING_UTF8 ); ticpp::Element* element = doc.FirstChildElement(); int major, minor; element->GetAttribute( "fbp_version_major", &major ); element->GetAttribute( "fbp_version_minor", &minor ); if ( major > AppData()->m_fbpVerMajor || ( AppData()->m_fbpVerMajor == major && minor > AppData()->m_fbpVerMinor ) ) { wxLogError( _("This object cannot be pasted because it is from a newer version of wxFormBuilder") ); } if ( major < AppData()->m_fbpVerMajor || ( AppData()->m_fbpVerMajor == major && minor < AppData()->m_fbpVerMinor ) ) { AppData()->ConvertObject( element, major, minor ); } PObjectDatabase db = AppData()->GetObjectDatabase(); return db->CreateObject( element ); } catch( ticpp::Exception& ex ) { wxLogError( _WXSTR( ex.m_details ) ); return PObjectBase(); } } wxformbuilder-3.1.59/src/rad/geninheritclass/geninhertclass_gui.h0000644000175000017500000000555211143440026025523 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // C++ code generated with wxFormBuilder (version Dec 17 2007) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! /////////////////////////////////////////////////////////////////////////// #ifndef __geninhertclass_gui__ #define __geninhertclass_gui__ #include #include #include #include #include #include #include #include #include #include #include #include /////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// /// Class GenInheritedClassDlgBase /////////////////////////////////////////////////////////////////////////////// class GenInheritedClassDlgBase : public wxDialog { private: protected: enum { ID_FORMS_CHECK_LIST = 1000, ID_CLASS_NAME_TEXT_CTRL, ID_FILE_NAME_TEXT_CTRL, }; wxStaticText* m_instructionsStaticText; wxCheckListBox* m_formsCheckList; wxStaticText* m_classNameStaticText; wxTextCtrl* m_classNameTextCtrl; wxStaticText* m_fileNameStaticText; wxTextCtrl* m_fileNameTextCtrl; wxStdDialogButtonSizer* m_sdbSizer; wxButton* m_sdbSizerOK; wxButton* m_sdbSizerCancel; // Virtual event handlers, overide them in your derived class virtual void OnFormsSelected( wxCommandEvent& event ){ event.Skip(); } virtual void OnFormsToggle( wxCommandEvent& event ){ event.Skip(); } virtual void OnClassNameChange( wxCommandEvent& event ){ event.Skip(); } virtual void OnFileNameChange( wxCommandEvent& event ){ event.Skip(); } public: GenInheritedClassDlgBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("Generate Inherited Class"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE ); ~GenInheritedClassDlgBase(); }; #endif //__geninhertclass_gui__ wxformbuilder-3.1.59/src/rad/geninheritclass/GenInheritedDlg.fbp0000644000175000017500000007164311143440026025166 0ustar rrmulderrrmulder C++ UTF-8 connect geninhertclass_gui 1000 none 0 GenInheretedClass . 1 1 0 wxBOTH 1 0 wxID_ANY GenInheritedClassDlgBase -1,-1 wxDEFAULT_DIALOG_STYLE Generate Inherited Class -1,-1 mainSizer wxVERTICAL none 5 wxTOP|wxRIGHT|wxLEFT|wxEXPAND 0 wxID_ANY Instructions instructionsSbSizer wxVERTICAL none 5 wxALL|wxEXPAND 0 1 0 wxID_ANY 1. Check the forms you would like to create the inherited class for. 2. You can edit individual class details by clicking on their names in the list and then: 2a. Edit the 'Class Name:' as required. 2b. Edit the 'File Names: (.h/.cpp)' as required. 3. Click 'OK'. m_instructionsStaticText protected wxST_NO_AUTORESIZE -1 5 wxALL|wxEXPAND 0 1 0 ID_FORMS_CHECK_LIST -1,-1 350,150 m_formsCheckList protected OnFormsSelected OnFormsToggle 5 wxEXPAND|wxRIGHT|wxLEFT 0 wxID_ANY Class Details classDescriptionSbSizer wxVERTICAL none 5 wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT 0 1 0 wxID_ANY Class Name: -1,-1 m_classNameStaticText protected -1 5 wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND 0 1 0 ID_CLASS_NAME_TEXT_CTRL 0 m_classNameTextCtrl protected OnClassNameChange 5 wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT 0 1 0 wxID_ANY File Names: (.cpp/.h) -1,-1 m_fileNameStaticText protected -1 5 wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND 0 1 0 ID_FILE_NAME_TEXT_CTRL 0 m_fileNameTextCtrl protected OnFileNameChange 5 wxALL|wxALIGN_RIGHT 0 0 1 0 0 0 1 0 0 m_sdbSizer protected wxformbuilder-3.1.59/src/rad/geninheritclass/geninhertclass.h0000644000175000017500000000537011143440026024655 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #ifndef __GENINHERTCLASS_IMP__ #define __GENINHERTCLASS_IMP__ /** @file Helper dialog that helps users to generate the needed class that inherits from the wxFormBuilder GUI code. @author Ryan Pusztai @date 01/14/2007 */ #include "geninhertclass_gui.h" #include #include "utils/wxfbdefs.h" /** Holds the details of the class to generate. */ class GenClassDetails { public: /** Default Constructor. */ GenClassDetails() {} /** Constructor. @param form Form object. @param className Name of the class to generate. @param fileName File name of the output files the at generated class will be in. @param isSelected If true then the class is selected, else it is not. */ GenClassDetails( PObjectBase form, const wxString& className, const wxString& fileName, bool isSelected = false ) : m_form( form ), m_className( className ), m_fileName( fileName ), m_isSelected( isSelected ) { } PObjectBase m_form; /**< Form object. */ wxString m_className; /**< Name of the class to generate. */ wxString m_fileName; /**< File name to generate the class in. */ bool m_isSelected; /**< Holds if the checkbox is selected for the form. */ }; /** */ class GenInheritedClassDlg : public GenInheritedClassDlgBase { public: GenInheritedClassDlg( wxWindow* parent, PObjectBase project ); void GetFormsSelected( std::vector< GenClassDetails >* forms ); private: std::vector< GenClassDetails > m_classDetails; void OnFormsSelected( wxCommandEvent& event ); void OnFormsToggle( wxCommandEvent& event ); void OnClassNameChange( wxCommandEvent& event ); void OnFileNameChange( wxCommandEvent& event ); }; #endif //__GENINHERTCLASS_IMP__ wxformbuilder-3.1.59/src/rad/geninheritclass/geninhertclass.cpp0000644000175000017500000000640211143440026025205 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #include "geninhertclass.h" #include "model/objectbase.h" GenInheritedClassDlg::GenInheritedClassDlg( wxWindow* parent, PObjectBase project ) : GenInheritedClassDlgBase( parent ) { const wxString& projectName = project->GetPropertyAsString( _("name") ); // Setup the initial values for the maps of class names and file names. for ( unsigned int i = 0; i < project->GetChildCount(); ++i ) { PObjectBase child = project->GetChild( i ); const wxString& formName = child->GetPropertyAsString( _("name") ); const wxString& name = projectName + formName; m_classDetails.push_back( GenClassDetails( child, name, name ) ); // Add the forms to the listctrl. m_formsCheckList->AppendString( formName ); } // Disable the controls till the check listbox is selected. m_classNameTextCtrl->Disable(); m_fileNameTextCtrl->Disable(); } void GenInheritedClassDlg::GetFormsSelected( std::vector< GenClassDetails >* forms ) { // Clear the selected forms array. forms->clear(); for ( size_t i = 0; i < m_classDetails.size(); ++i ) { if ( m_classDetails[i].m_isSelected ) { forms->push_back( m_classDetails[i] ); } } } void GenInheritedClassDlg::OnFormsSelected( wxCommandEvent& ) { // Enable controls because an item is selected. int selection = m_formsCheckList->GetSelection(); if ( wxNOT_FOUND == selection ) { m_classNameTextCtrl->Disable(); m_fileNameTextCtrl->Disable(); return; } m_classNameTextCtrl->Enable(); m_fileNameTextCtrl->Enable(); // Set the values of the controls GenClassDetails& details = m_classDetails[ selection ]; m_classNameTextCtrl->SetValue( details.m_className ); m_fileNameTextCtrl->SetValue( details.m_fileName ); } void GenInheritedClassDlg::OnFormsToggle( wxCommandEvent& event ) { int selection = event.GetSelection(); m_classDetails[ selection ].m_isSelected = m_formsCheckList->IsChecked( selection ); } void GenInheritedClassDlg::OnClassNameChange( wxCommandEvent& ) { m_classDetails[ m_formsCheckList->GetSelection() ].m_className = m_classNameTextCtrl->GetValue(); } void GenInheritedClassDlg::OnFileNameChange( wxCommandEvent& ) { m_classDetails[ m_formsCheckList->GetSelection() ].m_fileName = m_fileNameTextCtrl->GetValue(); } wxformbuilder-3.1.59/src/rad/geninheritclass/geninhertclass_gui.cpp0000644000175000017500000001255611143440026026060 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // C++ code generated with wxFormBuilder (version Dec 17 2007) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! /////////////////////////////////////////////////////////////////////////// #include "geninhertclass_gui.h" /////////////////////////////////////////////////////////////////////////// GenInheritedClassDlgBase::GenInheritedClassDlgBase( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) { this->SetSizeHints( wxDefaultSize, wxDefaultSize ); wxBoxSizer* mainSizer; mainSizer = new wxBoxSizer( wxVERTICAL ); wxStaticBoxSizer* instructionsSbSizer; instructionsSbSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxT("Instructions") ), wxVERTICAL ); m_instructionsStaticText = new wxStaticText( this, wxID_ANY, wxT("1. Check the forms you would like to create the inherited class for.\n2. You can edit individual class details by clicking on their names in the list\nand then:\n\t2a. Edit the 'Class Name:' as required.\n\t2b. Edit the 'File Names: (.h/.cpp)' as required.\n3. Click 'OK'."), wxDefaultPosition, wxDefaultSize, wxST_NO_AUTORESIZE ); m_instructionsStaticText->Wrap( -1 ); instructionsSbSizer->Add( m_instructionsStaticText, 0, wxALL|wxEXPAND, 5 ); mainSizer->Add( instructionsSbSizer, 0, wxTOP|wxRIGHT|wxLEFT|wxEXPAND, 5 ); wxArrayString m_formsCheckListChoices; m_formsCheckList = new wxCheckListBox( this, ID_FORMS_CHECK_LIST, wxDefaultPosition, wxDefaultSize, m_formsCheckListChoices, 0 ); m_formsCheckList->SetMinSize( wxSize( 350,150 ) ); mainSizer->Add( m_formsCheckList, 0, wxALL|wxEXPAND, 5 ); wxStaticBoxSizer* classDescriptionSbSizer; classDescriptionSbSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxT("Class Details") ), wxVERTICAL ); m_classNameStaticText = new wxStaticText( this, wxID_ANY, wxT("Class Name:"), wxDefaultPosition, wxDefaultSize, 0 ); m_classNameStaticText->Wrap( -1 ); classDescriptionSbSizer->Add( m_classNameStaticText, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 5 ); m_classNameTextCtrl = new wxTextCtrl( this, ID_CLASS_NAME_TEXT_CTRL, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); classDescriptionSbSizer->Add( m_classNameTextCtrl, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); m_fileNameStaticText = new wxStaticText( this, wxID_ANY, wxT("File Names: (.cpp/.h)"), wxDefaultPosition, wxDefaultSize, 0 ); m_fileNameStaticText->Wrap( -1 ); classDescriptionSbSizer->Add( m_fileNameStaticText, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 5 ); m_fileNameTextCtrl = new wxTextCtrl( this, ID_FILE_NAME_TEXT_CTRL, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); classDescriptionSbSizer->Add( m_fileNameTextCtrl, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); mainSizer->Add( classDescriptionSbSizer, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 ); m_sdbSizer = new wxStdDialogButtonSizer(); m_sdbSizerOK = new wxButton( this, wxID_OK ); m_sdbSizer->AddButton( m_sdbSizerOK ); m_sdbSizerCancel = new wxButton( this, wxID_CANCEL ); m_sdbSizer->AddButton( m_sdbSizerCancel ); m_sdbSizer->Realize(); mainSizer->Add( m_sdbSizer, 0, wxALL|wxALIGN_RIGHT, 5 ); this->SetSizer( mainSizer ); this->Layout(); mainSizer->Fit( this ); this->Centre( wxBOTH ); // Connect Events m_formsCheckList->Connect( wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler( GenInheritedClassDlgBase::OnFormsSelected ), NULL, this ); m_formsCheckList->Connect( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, wxCommandEventHandler( GenInheritedClassDlgBase::OnFormsToggle ), NULL, this ); m_classNameTextCtrl->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( GenInheritedClassDlgBase::OnClassNameChange ), NULL, this ); m_fileNameTextCtrl->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( GenInheritedClassDlgBase::OnFileNameChange ), NULL, this ); } GenInheritedClassDlgBase::~GenInheritedClassDlgBase() { // Disconnect Events m_formsCheckList->Disconnect( wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler( GenInheritedClassDlgBase::OnFormsSelected ), NULL, this ); m_formsCheckList->Disconnect( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, wxCommandEventHandler( GenInheritedClassDlgBase::OnFormsToggle ), NULL, this ); m_classNameTextCtrl->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( GenInheritedClassDlgBase::OnClassNameChange ), NULL, this ); m_fileNameTextCtrl->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( GenInheritedClassDlgBase::OnFileNameChange ), NULL, this ); } wxformbuilder-3.1.59/src/rad/inspector/objinspect.cpp0000644000175000017500000012361711143440026023170 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #include "objinspect.h" #include "model/objectbase.h" #include "utils/debug.h" #include "utils/typeconv.h" #include "utils/wxfbdefs.h" #include "rad/bitmaps.h" #include "rad/wxfbevent.h" #include "rad/appdata.h" #include "model/objectbase.h" #include #include #define WXFB_PROPERTY_GRID 1000 #define WXFB_EVENT_GRID 1001 // ----------------------------------------------------------------------- // wxSlider-based property editor // ----------------------------------------------------------------------- #if wxUSE_SLIDER // // Implement an editor control that allows using wxSlider to edit value of // wxFloatProperty (and similar). // // Note that new editor classes needs to be registered before use. // This can be accomplished using wxPGRegisterEditorClass macro. // Registeration can also be performed in a constructor of a // property that is likely to require the editor in question. // #include class wxPGSliderEditor : public wxPGEditor { WX_PG_DECLARE_EDITOR_CLASS() private: int m_max; public: wxPGSliderEditor() : m_max( 10000 ) { } virtual ~wxPGSliderEditor(); // See below for short explanations of what these are suppposed to do. wxPG_DECLARE_CREATECONTROLS virtual void UpdateControl( wxPGProperty* property, wxWindow* wnd ) const; virtual bool OnEvent( wxPropertyGrid* propgrid, wxPGProperty* property, wxWindow* wnd, wxEvent& event ) const; virtual bool CopyValueFromControl( wxPGProperty* property, wxWindow* wnd ) const; virtual void SetValueToUnspecified( wxWindow* wnd ) const; }; // This macro also defines global wxPGEditor_Slider for storing // the singleton class instance. WX_PG_IMPLEMENT_EDITOR_CLASS(Slider,wxPGSliderEditor,wxPGEditor) // Trivial destructor. wxPGSliderEditor::~wxPGSliderEditor() { } #ifndef __WXPYTHON__ wxWindow* wxPGSliderEditor::CreateControls( wxPropertyGrid* propgrid, wxPGProperty* property, const wxPoint& pos, const wxSize& sz, wxWindow** ) const #else wxPGWindowPair wxPGSliderEditor::CreateControls( wxPropertyGrid* propgrid, wxPGProperty* property, const wxPoint& pos, const wxSize& sz ) const #endif { wxCHECK_MSG( property->IsKindOf(WX_PG_CLASSINFO(wxFloatProperty)), NULL, wxT("Slider editor can only be used with wxFloatProperty or derivative.") ); // Use two stage creation to allow cleaner display on wxMSW wxSlider* ctrl = new wxSlider(); #ifdef __WXMSW__ ctrl->Hide(); #endif wxString s = property->GetValueAsString(); double v_d = 0; if ( s.ToDouble(&v_d) ) { if ( v_d < 0 ) v_d = 0; else if ( v_d > 1 ) v_d = 1; } ctrl->Create(propgrid, wxPG_SUBID1, (int)(v_d * m_max), 0, m_max, pos, sz, wxSL_HORIZONTAL); // Connect all required events to grid's OnCustomEditorEvent // (all relevenat wxTextCtrl, wxComboBox and wxButton events are // already connected) propgrid->Connect( wxPG_SUBID1, wxEVT_SCROLL_THUMBTRACK, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) &wxPropertyGrid::OnCustomEditorEvent, NULL, propgrid ); #ifdef __WXMSW__ ctrl->Show(); #endif return ctrl; } // Copies value from property to control void wxPGSliderEditor::UpdateControl( wxPGProperty* property, wxWindow* wnd ) const { wxSlider* ctrl = wxDynamicCast( wnd, wxSlider ); if ( ctrl ) { double val = wxPGVariantToDouble( property->DoGetValue() ); if ( val < 0 ) val = 0; else if ( val > 1 ) val = 1; ctrl->SetValue( (int)(val * m_max) ); } } // Control's events are redirected here bool wxPGSliderEditor::OnEvent( wxPropertyGrid* WXUNUSED(propgrid), wxPGProperty* WXUNUSED(property), wxWindow* WXUNUSED(wnd), wxEvent& event ) const { if ( event.GetEventType() == wxEVT_SCROLL_THUMBTRACK ) { return true; } return false; } bool wxPGSliderEditor::CopyValueFromControl( wxPGProperty* property, wxWindow* wnd ) const { wxSlider* ctrl = wxDynamicCast( wnd, wxSlider ); if ( ctrl ) { property->DoSetValue( wxPGVariant( (double)(ctrl->GetValue())/(double)(m_max) ) ); } return true; } void wxPGSliderEditor::SetValueToUnspecified( wxWindow* WXUNUSED(wnd) ) const { // TODO? //wxDateProperty* prop = (wxDateProperty*) property; //ctrl->SetValue(?); } #endif // wxUSE_SLIDER // ----------------------------------------------------------------------- // fbColourProperty // ----------------------------------------------------------------------- // Colour labels. Last (before NULL, if any) must be Custom. static const wxChar* fbcolprop_labels[] = { wxT("Default"), wxT("AppWorkspace"), wxT("ActiveBorder"), wxT("ActiveCaption"), wxT("ButtonFace"), wxT("ButtonHighlight"), wxT("ButtonShadow"), wxT("ButtonText"), wxT("CaptionText"), wxT("ControlDark"), wxT("ControlLight"), wxT("Desktop"), wxT("GrayText"), wxT("Highlight"), wxT("HighlightText"), wxT("InactiveBorder"), wxT("InactiveCaption"), wxT("InactiveCaptionText"), wxT("Menu"), wxT("Scrollbar"), wxT("Tooltip"), wxT("TooltipText"), wxT("Window"), wxT("WindowFrame"), wxT("WindowText"), wxT("Custom"), (const wxChar*) NULL }; static long fbcolprop_colours[] = { wxSYS_COLOUR_MAX, wxSYS_COLOUR_APPWORKSPACE, wxSYS_COLOUR_ACTIVEBORDER, wxSYS_COLOUR_ACTIVECAPTION, wxSYS_COLOUR_BTNFACE, wxSYS_COLOUR_BTNHIGHLIGHT, wxSYS_COLOUR_BTNSHADOW, wxSYS_COLOUR_BTNTEXT , wxSYS_COLOUR_CAPTIONTEXT, wxSYS_COLOUR_3DDKSHADOW, wxSYS_COLOUR_3DLIGHT, wxSYS_COLOUR_BACKGROUND, wxSYS_COLOUR_GRAYTEXT, wxSYS_COLOUR_HIGHLIGHT, wxSYS_COLOUR_HIGHLIGHTTEXT, wxSYS_COLOUR_INACTIVEBORDER, wxSYS_COLOUR_INACTIVECAPTION, wxSYS_COLOUR_INACTIVECAPTIONTEXT, wxSYS_COLOUR_MENU, wxSYS_COLOUR_SCROLLBAR, wxSYS_COLOUR_INFOBK, wxSYS_COLOUR_INFOTEXT, wxSYS_COLOUR_WINDOW, wxSYS_COLOUR_WINDOWFRAME, wxSYS_COLOUR_WINDOWTEXT, wxPG_COLOUR_CUSTOM }; class fbColourPropertyClass : public wxSystemColourPropertyClass { WX_PG_DECLARE_DERIVED_PROPERTY_CLASS() public: fbColourPropertyClass( const wxString& label, const wxString& name, const wxColourPropertyValue& value ); virtual ~fbColourPropertyClass (); virtual long GetColour ( int index ); }; static wxPGChoices gs_fbColourProperty_choicesCache; WX_PG_IMPLEMENT_DERIVED_PROPERTY_CLASS(fbColourProperty, wxSystemColourProperty, const wxColourPropertyValue&) fbColourPropertyClass::fbColourPropertyClass( const wxString& label, const wxString& name, const wxColourPropertyValue& value ) : wxPG_PROPCLASS(wxSystemColourProperty)( label, name, fbcolprop_labels, fbcolprop_colours, &gs_fbColourProperty_choicesCache, value ) { wxPG_INIT_REQUIRED_TYPE(wxColourPropertyValue) m_flags |= wxPG_PROP_TRANSLATE_CUSTOM; DoSetValue ( &m_value ); } fbColourPropertyClass::~fbColourPropertyClass () { } long fbColourPropertyClass::GetColour ( int index ) { if ( index == wxSYS_COLOUR_MAX ) return wxPG_COLOUR(255, 255, 255); else return wxSystemColourPropertyClass::GetColour( index ); } // ----------------------------------------------------------------------- // wxSizeProperty // ----------------------------------------------------------------------- WX_PG_IMPLEMENT_VALUE_TYPE_VOIDP(wxSize,wxSizeProperty,wxSize(0,0)) class wxSizePropertyClass : public wxPGPropertyWithChildren { WX_PG_DECLARE_PROPERTY_CLASS() public: wxSizePropertyClass ( const wxString& label, const wxString& name, const wxSize& value ); virtual ~wxSizePropertyClass (); WX_PG_DECLARE_PARENTAL_TYPE_METHODS() WX_PG_DECLARE_PARENTAL_METHODS() protected: wxSize m_value; }; WX_PG_IMPLEMENT_PROPERTY_CLASS(wxSizeProperty,wxBaseParentProperty,wxSize,const wxSize&,TextCtrl) wxSizePropertyClass::wxSizePropertyClass ( const wxString& label, const wxString& name, const wxSize& value) : wxPGPropertyWithChildren(label,name) { wxPG_INIT_REQUIRED_TYPE(wxSize) AddChild( wxIntProperty(wxT("Width"),wxPG_LABEL,value.GetWidth()) ); AddChild( wxIntProperty(wxT("Height"),wxPG_LABEL,value.GetHeight()) ); DoSetValue((void*)&value); // Only allow editing from the children m_flags |= wxPG_PROP_NOEDITOR; } wxSizePropertyClass::~wxSizePropertyClass () { } void wxSizePropertyClass::DoSetValue ( wxPGVariant value ) { wxSize* pObj = (wxSize*)wxPGVariantToVoidPtr(value); m_value = *pObj; RefreshChildren(); } wxPGVariant wxSizePropertyClass::DoGetValue () const { return wxPGVariant((void*)&m_value); } void wxSizePropertyClass::RefreshChildren() { Item(0)->DoSetValue( (long)m_value.GetWidth() ); Item(1)->DoSetValue( (long)m_value.GetHeight() ); } void wxSizePropertyClass::ChildChanged ( wxPGProperty* p ) { switch ( p->GetIndexInParent() ) { case 0: m_value.SetWidth( p->DoGetValue().GetLong() ); break; case 1: m_value.SetHeight( p->DoGetValue().GetLong() ); break; } } // ----------------------------------------------------------------------- // wxPointProperty // ----------------------------------------------------------------------- WX_PG_IMPLEMENT_VALUE_TYPE_VOIDP(wxPoint,wxPointProperty,wxPoint(0,0)) class wxPointPropertyClass : public wxPGPropertyWithChildren { WX_PG_DECLARE_PROPERTY_CLASS() public: wxPointPropertyClass( const wxString& label, const wxString& name, const wxPoint& value ); virtual ~wxPointPropertyClass (); WX_PG_DECLARE_PARENTAL_TYPE_METHODS() WX_PG_DECLARE_PARENTAL_METHODS() protected: wxPoint m_value; }; WX_PG_IMPLEMENT_PROPERTY_CLASS(wxPointProperty,wxBaseParentProperty,wxPoint,const wxPoint&,TextCtrl) wxPointPropertyClass::wxPointPropertyClass ( const wxString& label, const wxString& name, const wxPoint& value) : wxPGPropertyWithChildren(label,name) { wxPG_INIT_REQUIRED_TYPE(wxPoint) DoSetValue((void*)&value); AddChild( wxIntProperty(wxT("X"),wxPG_LABEL,value.x) ); AddChild( wxIntProperty(wxT("Y"),wxPG_LABEL,value.y) ); // Only allow editing from the children m_flags |= wxPG_PROP_NOEDITOR; } wxPointPropertyClass::~wxPointPropertyClass () { } void wxPointPropertyClass::DoSetValue ( wxPGVariant value ) { wxPoint* pObj = (wxPoint*)wxPGVariantToVoidPtr(value); m_value = *pObj; RefreshChildren(); } wxPGVariant wxPointPropertyClass::DoGetValue () const { return wxPGVariant((void*)&m_value); } void wxPointPropertyClass::RefreshChildren() { if ( !GetCount() ) return; Item(0)->DoSetValue( m_value.x ); Item(1)->DoSetValue( m_value.y ); } void wxPointPropertyClass::ChildChanged ( wxPGProperty* p ) { switch ( p->GetIndexInParent() ) { case 0: m_value.x = p->DoGetValue().GetLong(); break; case 1: m_value.y = p->DoGetValue().GetLong(); break; } } // ----------------------------------------------------------------------- // wxBitmapWithResourcePropertyClass // ----------------------------------------------------------------------- static long g_imageFilterIndex = -1; static wxString g_imageInitialPath = wxEmptyString; class wxBitmapWithResourcePropertyClass : public wxPGPropertyWithChildren { WX_PG_DECLARE_PROPERTY_CLASS() public: wxBitmapWithResourcePropertyClass( const wxString& label, const wxString& name, const wxString& value ); virtual ~wxBitmapWithResourcePropertyClass(); WX_PG_DECLARE_PARENTAL_TYPE_METHODS() WX_PG_DECLARE_PARENTAL_METHODS() protected: wxString m_image; wxString m_source; wxSize m_icoSize; wxArrayString m_strings; private: enum { SOURCE_FILE = 0, SOURCE_RESOURCE, SOURCE_ICON_RESOURCE }; enum { ITEM_FILE_OR_RESOURCE = 0, ITEM_SOURCE }; }; WX_PG_IMPLEMENT_PROPERTY_CLASS(wxBitmapWithResourceProperty,wxBaseParentProperty,wxString,const wxString&,TextCtrl) wxBitmapWithResourcePropertyClass::wxBitmapWithResourcePropertyClass ( const wxString& label, const wxString& name, const wxString& value ) : wxPGPropertyWithChildren(label,name) { // Add the options m_strings.Add(wxT("Load From File")); m_strings.Add(wxT("Load From Resource")); m_strings.Add(wxT("Load From Icon Resource")); // Parse default value, ( sets m_image and m_source based on 'value' ) DoSetValue( (void*)&value ); // Add the appropriate child if ( m_source == wxT("Load From File") ) { wxPGProperty* child = wxImageFileProperty( wxT("file_path"), wxPG_LABEL, m_image ); AddChild( child ); child->SetHelpString( wxT("Path to the image file.") ); if ( g_imageFilterIndex >= 0 ) { wxVariant filterIndex( g_imageFilterIndex ); child->SetAttribute( wxPG_FILE_FILTER_INDEX, filterIndex ); } if ( !g_imageInitialPath.empty() ) { wxVariant initialPath( g_imageInitialPath ); child->SetAttribute( wxPG_FILE_INITIAL_PATH, initialPath ); } } else { wxPGProperty* child = wxStringProperty( wxT("resource_name"), wxPG_LABEL, m_image ); AddChild( child ); child->SetHelpString( wxT("Windows Only. Name of the resource in the .rc file.") ); } wxPGProperty* child2 = wxEnumProperty(wxT("source"), wxPG_LABEL, m_strings, m_strings.Index( m_source ) ); AddChild( child2 ); child2->SetHelpString( wxT("Load From File:\n") wxT("Load the image from a file on disk.\n\n") wxT("Load From Resource:\n") wxT("Windows Only. Load the image from a BITMAP resource in a .rc file\n\n") wxT("Load From Icon Resource:\n") wxT("Windows Only. Load the image from a ICON resource in a .rc file\n\n") ); if ( m_source == wxT("Load From Icon Resource") ) { wxPGProperty* child3 = wxSizeProperty(wxT("ico_size"), wxPG_LABEL, wxDefaultSize); AddChild( child3 ); child3->SetHelpString( wxT("The size of the icon to use from a ICON resource with multiple icons in it.") ); } RefreshChildren(); } wxBitmapWithResourcePropertyClass::~wxBitmapWithResourcePropertyClass() { } void wxBitmapWithResourcePropertyClass::DoSetValue ( wxPGVariant value ) { wxString* pObj = (wxString*)wxPGVariantToVoidPtr( value ); wxString newValue = *pObj; TypeConv::ParseBitmapWithResource( newValue, &m_image, &m_source, &m_icoSize ); if ( wxNOT_FOUND == m_strings.Index( m_source.c_str() ) ) { m_source = wxT("Load From File"); } RefreshChildren(); } wxPGVariant wxBitmapWithResourcePropertyClass::DoGetValue() const { wxString value; value.Printf( wxT("%s; %s [%i; %i]"), m_image.c_str(), m_source.c_str(), m_icoSize.GetWidth(), m_icoSize.GetHeight() ); return wxPGVariant( (void*)&value ); } void wxBitmapWithResourcePropertyClass::RefreshChildren() { size_t count = GetCount(); if ( 0 == count ) { return; } Item( ITEM_FILE_OR_RESOURCE )->DoSetValue( m_image ); Item( ITEM_SOURCE )->DoSetValue( m_strings.Index( m_source ) ); if ( 3 == count ) { Item( 2 )->DoSetValue( m_icoSize ); } } void wxBitmapWithResourcePropertyClass::ChildChanged( wxPGProperty* p ) { wxImageFilePropertyClass* prop = dynamic_cast< wxImageFilePropertyClass* >( p ); if ( prop ) { g_imageFilterIndex = prop->GetFilterIndex(); wxPGVariant path = prop->DoGetValue(); wxFileName imgPath( path.GetString() ); g_imageInitialPath = imgPath.GetPath(); } } // ----------------------------------------------------------------------- // ObjectInspector // ----------------------------------------------------------------------- DECLARE_EVENT_TYPE( RECREATE_GRID_EVENT, -1 ) DEFINE_EVENT_TYPE( RECREATE_GRID_EVENT ) BEGIN_EVENT_TABLE(ObjectInspector, wxPanel) EVT_PG_CHANGED(WXFB_PROPERTY_GRID, ObjectInspector::OnPropertyGridChange) EVT_PG_CHANGED(WXFB_EVENT_GRID, ObjectInspector::OnEventGridChange) EVT_PG_ITEM_COLLAPSED(WXFB_PROPERTY_GRID, ObjectInspector::OnPropertyGridExpand) EVT_PG_ITEM_EXPANDED (WXFB_PROPERTY_GRID, ObjectInspector::OnPropertyGridExpand) EVT_COMMAND( wxID_ANY, RECREATE_GRID_EVENT, ObjectInspector::OnReCreateGrid ) EVT_FB_OBJECT_SELECTED( ObjectInspector::OnObjectSelected ) EVT_FB_PROJECT_REFRESH( ObjectInspector::OnProjectRefresh ) EVT_FB_PROPERTY_MODIFIED( ObjectInspector::OnPropertyModified ) EVT_FB_EVENT_HANDLER_MODIFIED( ObjectInspector::OnEventHandlerModified ) END_EVENT_TABLE() ObjectInspector::ObjectInspector( wxWindow* parent, int id, int style ) : wxPanel(parent,id), m_style(style) { AppData()->AddHandler( this->GetEventHandler() ); m_currentSel = PObjectBase(); long nbStyle; wxConfigBase* config = wxConfigBase::Get(); config->Read( wxT("/mainframe/objectInspector/notebook_style"), &nbStyle, wxFNB_NO_X_BUTTON | wxFNB_NO_NAV_BUTTONS | wxFNB_NODRAG | wxFNB_DROPDOWN_TABS_LIST | wxFNB_FF2 | wxFNB_CUSTOM_DLG ); m_nb = new wxFlatNotebook( this, -1, wxDefaultPosition, wxDefaultSize, FNB_STYLE_OVERRIDES( nbStyle ) ); m_nb->SetCustomizeOptions( wxFNB_CUSTOM_TAB_LOOK | wxFNB_CUSTOM_ORIENTATION | wxFNB_CUSTOM_LOCAL_DRAG ); // the colour of property grid description looks ugly if we don't set this // colour m_nb->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE)); // Register the slider editor #if wxUSE_SLIDER wxPGRegisterEditorClass( Slider ); #endif m_pg = CreatePropertyGridManager(m_nb, WXFB_PROPERTY_GRID); m_eg = CreatePropertyGridManager(m_nb, WXFB_EVENT_GRID); m_nb->AddPage(m_pg,wxT("Properties"),false); m_nb->AddPage(m_eg,wxT("Events"),false); wxBoxSizer* topSizer = new wxBoxSizer( wxVERTICAL ); topSizer->Add( m_nb, 1, wxALL | wxEXPAND, 0 ); SetSizer( topSizer ); } ObjectInspector::~ObjectInspector() { AppData()->RemoveHandler( this->GetEventHandler() ); } void ObjectInspector::SavePosition() { // Save Layout wxConfigBase* config = wxConfigBase::Get(); config->Write( wxT("/mainframe/objectInspector/DescBoxHeight" ), m_pg->GetDescBoxHeight() ); config->Write( wxT("/mainframe/objectInspector/notebook_style"), m_nb->GetWindowStyleFlag() ); } void ObjectInspector::Create( bool force ) { PObjectBase sel_obj = AppData()->GetSelectedObject(); if ( sel_obj && ( sel_obj != m_currentSel || force ) ) { Freeze(); m_currentSel = sel_obj; int pageNumber = m_pg->GetSelectedPage(); wxString pageName; if ( pageNumber != wxNOT_FOUND ) { pageName = m_pg->GetPageName( pageNumber ); } // Clear Property Grid Manager int pageCount = (int)m_pg->GetPageCount(); if ( pageCount > 0 ) { for ( int pageIndex = pageCount - 1; pageIndex >= 0; --pageIndex ) { m_pg->RemovePage( pageIndex ); } } // now we do the same thing for event grid... pageCount = (int)m_eg->GetPageCount(); if ( pageCount > 0) { for ( int pageIndex = pageCount - 1; pageIndex >= 0; --pageIndex) { m_eg->RemovePage( pageIndex ); } } m_propMap.clear(); m_eventMap.clear(); PObjectInfo obj_desc = sel_obj->GetObjectInfo(); if (obj_desc) { PropertyMap propMap, dummyPropMap; EventMap eventMap, dummyEventMap; // We create the categories with the properties of the object organized by "classes" CreateCategory( obj_desc->GetClassName(), sel_obj, obj_desc, propMap, false ); CreateCategory( obj_desc->GetClassName(), sel_obj, obj_desc, eventMap, true ); for (unsigned int i=0; iGetBaseClassCount() ; i++) { PObjectInfo info_base = obj_desc->GetBaseClass(i); CreateCategory( info_base->GetClassName(), sel_obj, info_base, propMap, false ); CreateCategory( info_base->GetClassName(), sel_obj, info_base, eventMap, true ); } PObjectBase parent = sel_obj->GetParent(); if ( parent ) { PObjectInfo parent_desc = parent->GetObjectInfo(); if ( parent_desc->GetObjectType()->IsItem()) { CreateCategory( parent_desc->GetClassName(), parent, parent_desc, dummyPropMap, false ); CreateCategory( parent_desc->GetClassName(), parent, parent_desc, dummyEventMap, true ); for (unsigned int i=0; iGetBaseClassCount() ; i++) { PObjectInfo info_base = parent_desc->GetBaseClass(i); CreateCategory( info_base->GetClassName(), parent, info_base, dummyPropMap, false ); CreateCategory( info_base->GetClassName(), parent, info_base, dummyEventMap, true ); } } } // Select previously selected page, or first page if ( m_pg->GetPageCount() > 0 ) { int pageIndex = m_pg->GetPageByName( pageName ); if ( wxNOT_FOUND != pageIndex ) { m_pg->SelectPage( pageIndex ); } else { m_pg->SelectPage( 0 ); } } } m_pg->Refresh(); m_pg->Update(); m_eg->Refresh(); m_eg->Update(); Thaw(); } } int ObjectInspector::StringToBits(const wxString& strVal, wxPGChoices& constants) { wxStringTokenizer strTok(strVal, wxT(" |")); int val = 0; while (strTok.HasMoreTokens()) { wxString token = strTok.GetNextToken(); unsigned int i = 0; bool done = false; while (i < constants.GetCount() && !done) { if (constants.GetLabel(i) == token) { val |= constants.GetValue(i); done = true; } i++; } } return val; } wxPGProperty* ObjectInspector::GetProperty(PProperty prop) { wxPGProperty *result; PropertyType type = prop->GetType(); wxString name = prop->GetName(); wxVariant vTrue = wxVariant( true, wxT("true") ); if (type == PT_MACRO) { result = wxStringProperty(name, wxPG_LABEL, prop->GetValueAsString()); } else if (type == PT_INT) { result = wxIntProperty(name, wxPG_LABEL, prop->GetValueAsInteger()); } else if (type == PT_UINT) { result = wxUIntProperty(name, wxPG_LABEL, (unsigned)prop->GetValueAsInteger()); } else if (type == PT_WXSTRING || type == PT_WXSTRING_I18N) { result = wxLongStringProperty(name, wxPG_LABEL, prop->GetValueAsText()); } else if (type == PT_TEXT) { result = wxLongStringProperty(name, wxPG_LABEL, prop->GetValueAsString()); result->SetFlag( wxPG_PROP_NO_ESCAPE ); } else if (type == PT_BOOL) { result = wxBoolProperty(name, wxPG_LABEL, prop->GetValue() == wxT("1")); } else if (type == PT_BITLIST) { PPropertyInfo prop_desc = prop->GetPropertyInfo(); POptionList opt_list = prop_desc->GetOptionList(); assert(opt_list && opt_list->GetOptionCount() > 0); wxPGChoices constants; const std::map< wxString, wxString > options = opt_list->GetOptions(); std::map< wxString, wxString >::const_iterator it; unsigned int i = 0; for( it = options.begin(); it != options.end(); ++it ) { constants.Add( it->first, 1 << i++ ); } int val = StringToBits(prop->GetValueAsString(), constants); result = wxFlagsProperty(name, wxPG_LABEL, constants, val); // Workaround to set the help strings for individual members of a wxFlagsProperty wxFlagsPropertyClass* flagsProp = dynamic_cast(result); if ( NULL != flagsProp ) { for ( size_t i = 0; i < flagsProp->GetCount(); i++ ) { wxPGProperty* prop = flagsProp->Item( i ); std::map< wxString, wxString >::const_iterator option = options.find( prop->GetLabel() ); if ( option != options.end() ) { m_pg->SetPropertyHelpString( prop, option->second ); } } } } else if (type == PT_INTLIST || type == PT_UINTLIST) { result = wxStringProperty(name, wxPG_LABEL, IntList( prop->GetValueAsString(), type == PT_UINTLIST ).ToString()); } else if (type == PT_OPTION) { PPropertyInfo prop_desc = prop->GetPropertyInfo(); POptionList opt_list = prop_desc->GetOptionList(); assert(opt_list && opt_list->GetOptionCount() > 0); wxString value = prop->GetValueAsString(); wxString help; wxPGChoices constants; const std::map< wxString, wxString > options = opt_list->GetOptions(); std::map< wxString, wxString >::const_iterator it; unsigned int i = 0; for( it = options.begin(); it != options.end(); ++it ) { constants.Add( it->first, i++ ); if ( it->first == value ) { // Save help help = it->second; } } result = wxEnumProperty(name, wxPG_LABEL, constants); result->SetValueFromString(value, 0); wxString desc = prop_desc->GetDescription(); if ( desc.empty() ) { desc = value + wxT(":\n") + help; } else { desc += wxT("\n\n") + value + wxT(":\n") + help; } result->SetHelpString( desc ); } else if (type == PT_WXPOINT) { result = wxPointProperty(name, wxPG_LABEL, prop->GetValueAsPoint()); } else if (type == PT_WXSIZE) { result = wxSizeProperty(name, wxPG_LABEL, prop->GetValueAsSize()); } else if (type == PT_WXFONT) { wxFontContainer font = TypeConv::StringToFont( prop->GetValueAsString() ); result = wxFontProperty(name, wxPG_LABEL, wxFontPropertyValue( font.m_pointSize, font.m_family, font.m_style, font.m_weight, font.m_underlined, font.m_faceName ) ); } else if (type == PT_WXCOLOUR) { wxString value = prop->GetValueAsString(); if ( value.empty() ) // Default Colour { wxColourPropertyValue def; def.m_type = wxSYS_COLOUR_MAX; result = fbColourProperty( name, wxPG_LABEL, def ); } else { if ( value.find_first_of( wxT("wx") ) == 0 ) { // System Colour wxColourPropertyValue def; def.m_type = TypeConv::StringToSystemColour( value ); result = fbColourProperty( name, wxPG_LABEL, def ); } else { result = fbColourProperty( name, wxPG_LABEL, prop->GetValueAsColour() ); } } } else if (type == PT_PATH) { result = wxDirProperty(name, wxPG_LABEL, prop->GetValueAsString()); } else if (type == PT_BITMAP) { result = wxBitmapWithResourceProperty( name, wxPG_LABEL, prop->GetValueAsString() ); } else if (type == PT_STRINGLIST) { result = wxArrayStringProperty(name, wxPG_LABEL,prop->GetValueAsArrayString()); } else if (type == PT_FLOAT) { result = wxFloatProperty(name, wxPG_LABEL,prop->GetValueAsFloat()); } else if ( type == PT_PARENT ) { wxParentPropertyClass* parent = new wxParentPropertyClass ( name, wxPG_LABEL ); PPropertyInfo prop_desc = prop->GetPropertyInfo(); std::list< PropertyChild >* children = prop_desc->GetChildren(); std::list< PropertyChild >::iterator it; for( it = children->begin(); it != children->end(); ++it ) { wxPGProperty* child = wxStringProperty( it->m_name, wxPG_LABEL, wxEmptyString ); parent->AddChild( child ); m_pg->SetPropertyHelpString( child, it->m_description ); } parent->SetValueFromString( prop->GetValueAsString(), wxPG_FULL_VALUE ); result = parent; } else // propiedad desconocida { result = wxStringProperty(name, wxPG_LABEL, prop->GetValueAsString()); result->SetAttribute(wxPG_BOOL_USE_DOUBLE_CLICK_CYCLING, vTrue); wxLogError(wxT("Property type Unknown")); } return result; } void ObjectInspector::AddItems( const wxString& name, PObjectBase obj, PObjectInfo obj_info, PPropertyCategory category, PropertyMap &properties ) { size_t propCount = category->GetPropertyCount(); for ( size_t i = 0; i < propCount; i++ ) { wxString propName = category->GetPropertyName( i ); PProperty prop = obj->GetProperty( propName ); if ( !prop ) continue; PPropertyInfo propInfo = prop->GetPropertyInfo(); // we do not want to duplicate inherited properties if ( properties.find( propName ) == properties.end() ) { wxPGId id = m_pg->Append( GetProperty( prop ) ); if ( prop->GetType() != PT_OPTION ) { m_pg->SetPropertyHelpString( id, propInfo->GetDescription() ); } wxString customEditor = propInfo->GetCustomEditor(); if ( !customEditor.empty() ) { wxPGEditor* editor = m_pg->GetEditorByName( customEditor ); if ( editor ) { m_pg->SetPropertyEditor( id, editor ); } } if (m_style != wxFB_OI_MULTIPAGE_STYLE) { // Most common classes will be showed with a slightly different // colour. if (name == wxT("wxWindow")) m_pg->SetPropertyColour(id,wxColour(255,255,205)); // yellow else if (name == wxT("sizeritem") || name == wxT("gbsizeritem") || name == wxT("sizeritembase") ) m_pg->SetPropertyColour(id,wxColour(220,255,255)); // cyan } ExpandMap::iterator it = m_isExpanded.find( propName ); if ( it != m_isExpanded.end() ) { if ( it->second ) { m_pg->Expand( id ); } else { m_pg->Collapse( id ); } } properties.insert( PropertyMap::value_type( propName, prop ) ); m_propMap.insert( ObjInspectorPropertyMap::value_type( id.GetPropertyPtr(), prop ) ); } } size_t catCount = category->GetCategoryCount(); for ( size_t i = 0; i < catCount; i++ ) { PPropertyCategory nextCat = category->GetCategory( i ); if ( 0 == nextCat->GetCategoryCount() && 0 == nextCat->GetPropertyCount() ) { continue; } wxPGId catId = m_pg->AppendIn( category->GetName(), wxPropertyCategory( nextCat->GetName() ) ); ExpandMap::iterator it = m_isExpanded.find( nextCat->GetName() ); if ( it != m_isExpanded.end() ) { if ( it->second ) { m_pg->Expand( catId ); } else { m_pg->Collapse( catId ); } } AddItems( name, obj, obj_info, nextCat, properties ); } } void ObjectInspector::AddItems( const wxString& name, PObjectBase obj, PObjectInfo obj_info, PPropertyCategory category, EventMap &events ) { size_t eventCount = category->GetEventCount(); for ( size_t i = 0; i < eventCount; i++ ) { wxString eventName = category->GetEventName( i ); PEvent event = obj->GetEvent( eventName ); if ( !event ) continue; PEventInfo eventInfo = event->GetEventInfo(); // we do not want to duplicate inherited events if ( events.find( eventName ) == events.end() ) { wxPGProperty *pgProp = wxStringProperty( eventInfo->GetName(), wxPG_LABEL, event->GetValue() ); wxPGId id = m_eg->Append( pgProp ); m_eg->SetPropertyHelpString( id, eventInfo->GetDescription() ); if (m_style != wxFB_OI_MULTIPAGE_STYLE) { // Most common classes will be showed with a slightly different // colour. if (name == wxT("wxWindow")) m_eg->SetPropertyColour(id,wxColour(255,255,205)); // yellow else if (name == wxT("sizeritem") || name == wxT("gbsizeritem") || name == wxT("sizeritembase") ) m_eg->SetPropertyColour(id,wxColour(220,255,255)); // cyan } events.insert( EventMap::value_type( eventName, event ) ); m_eventMap.insert( ObjInspectorEventMap::value_type( id.GetPropertyPtr(), event) ); } } size_t catCount = category->GetCategoryCount(); for ( size_t i = 0; i < catCount; i++ ) { PPropertyCategory nextCat = category->GetCategory( i ); if ( 0 == nextCat->GetCategoryCount() && 0 == nextCat->GetEventCount() ) { continue; } m_eg->AppendIn( category->GetName(), wxPropertyCategory( nextCat->GetName() ) ); AddItems( name, obj, obj_info, nextCat, events ); } } void ObjectInspector::OnPropertyGridChange( wxPropertyGridEvent& event ) { wxPGProperty* propPtr = event.GetPropertyPtr(); ObjInspectorPropertyMap::iterator it = m_propMap.find( propPtr ); if ( m_propMap.end() == it ) { // Could be a child property propPtr = propPtr->GetParent(); it = m_propMap.find( propPtr ); } if ( it != m_propMap.end() ) { PProperty prop = it->second; switch ( prop->GetType() ) { case PT_FLOAT: { // use typeconv to properly handle locale double val = event.GetPropertyValueAsDouble(); AppData()->ModifyProperty( prop, TypeConv::FloatToString( val ) ); break; } case PT_TEXT: case PT_MACRO: case PT_INT: case PT_UINT: { AppData()->ModifyProperty( prop, event.GetPropertyValueAsString() ); break; } case PT_OPTION: { wxString value = event.GetPropertyValueAsString(); AppData()->ModifyProperty( prop, value ); // Update displayed description for the new selection PPropertyInfo prop_desc = prop->GetPropertyInfo(); POptionList opt_list = prop_desc->GetOptionList(); wxString helpString = prop_desc->GetDescription(); if ( opt_list && opt_list->GetOptionCount() > 0 ) { const std::map< wxString, wxString > options = opt_list->GetOptions(); std::map< wxString, wxString >::const_iterator option = options.find( value ); if ( option != options.end() ) { if ( helpString.empty() ) { helpString = value + wxT(":\n") + option->second; } else { helpString += wxT("\n\n") + value + wxT(":\n") + option->second; } } } m_pg->SetPropertyHelpString( propPtr, helpString ); m_pg->SetDescription( propPtr->GetLabel(), helpString ); break; } case PT_PARENT: { AppData()->ModifyProperty( prop, propPtr->GetValueAsString( wxPG_FULL_VALUE ) ); break; } case PT_WXSTRING: case PT_WXSTRING_I18N: { // las cadenas de texto del inspector son formateadas wxString value = TypeConv::TextToString( event.GetPropertyValueAsString() ); AppData()->ModifyProperty( prop, value ); break; } case PT_BOOL: { AppData()->ModifyProperty( prop, event.GetPropertyValueAsBool() ? wxT("1") : wxT("0") ); break; } case PT_BITLIST: { wxString aux = event.GetPropertyValueAsString(); aux.Replace( wxT(" "), wxT("") ); aux.Replace( wxT(","), wxT("|") ); AppData()->ModifyProperty( prop, aux ); break; } case PT_WXPOINT: { wxPoint point = event.GetPropertyValueAsPoint (); AppData()->ModifyProperty( prop, wxString::Format( wxT("%i,%i"), point.x, point.y ) ); break; } case PT_WXSIZE: { wxSize size = event.GetPropertyValueAsSize(); AppData()->ModifyProperty( prop, wxString::Format( wxT("%i,%i"), size.GetWidth(), size.GetHeight() ) ); break; } case PT_WXFONT: { wxFontPropertyValue* fontVal = wxPGVariantToWxObjectPtr( event.GetPropertyPtr()->DoGetValue(), wxFontPropertyValue ); wxFontContainer font( fontVal->m_pointSize, fontVal->m_family, fontVal->m_style, fontVal->m_weight, fontVal->m_underlined, fontVal->m_faceName ); AppData()->ModifyProperty( prop, TypeConv::FontToString( font ) ); break; } case PT_WXCOLOUR: { wxColourPropertyValue* colour = wxDynamicCast( event.GetPropertyValueAsWxObjectPtr(), wxColourPropertyValue ); switch ( colour->m_type ) { case wxSYS_COLOUR_MAX: AppData()->ModifyProperty( prop, _T("") ); break; case wxPG_COLOUR_CUSTOM: AppData()->ModifyProperty( prop, TypeConv::ColourToString( colour->m_colour ) ); break; default: AppData()->ModifyProperty( prop, TypeConv::SystemColourToString( colour->m_type ) ); } break; } case PT_INTLIST: case PT_UINTLIST: { IntList il( event.GetPropertyValueAsString(), PT_UINTLIST == prop->GetType() ); AppData()->ModifyProperty( prop, il.ToString() ); break; } case PT_BITMAP: { // Get property value wxString path = event.GetPropertyValueAsString(); size_t semicolon_index = path.find_first_of( wxT(";") ); if ( semicolon_index != path.npos ) { path = TypeConv::MakeRelativeURL( path.substr( 0, semicolon_index ), AppData()->GetProjectPath() ) + path.substr( semicolon_index ); } // Save state from old property to use after grid is recreated wxPGPropertyWithChildren* pwc = dynamic_cast< wxPGPropertyWithChildren* >( event.GetPropertyPtr() ); bool expanded = false; if ( pwc ) { expanded = pwc->IsExpanded(); } wxString name = event.GetPropertyName(); // Respond to property modification AppData()->ModifyProperty( prop, path ); // It is bad to delete the property while handling an event from it! wxCommandEvent e( RECREATE_GRID_EVENT ); e.SetString( name ); e.SetInt( expanded ? 1 : 0 ); AddPendingEvent( e ); break; } default: AppData()->ModifyProperty( prop, event.GetPropertyValueAsString() ); } } } void ObjectInspector::OnReCreateGrid( wxCommandEvent& event ) { // Recreate grid, the bitmap property may need to change Create( true ); // Re-expand the bitmap property, if it was expanded wxPGId bitmapProp = m_pg->GetPropertyByName( event.GetString() ); m_pg->SelectProperty( bitmapProp ); if ( event.GetInt() != 0 ) { m_pg->Expand( bitmapProp ); m_pg->Expand( dynamic_cast< wxPGPropertyWithChildren* >( bitmapProp.GetPropertyPtr() )->Last() ); } } void ObjectInspector::OnEventGridChange(wxPropertyGridEvent& event) { ObjInspectorEventMap::iterator it = m_eventMap.find( event.GetPropertyPtr() ); if ( it != m_eventMap.end() ) { PEvent evt = it->second; wxString handler = event.GetPropertyValueAsString(); handler.Trim(); handler.Trim( false ); AppData()->ModifyEventHandler( evt, handler ); } } void ObjectInspector::OnPropertyGridExpand(wxPropertyGridEvent& event) { m_isExpanded[event.GetPropertyName()] = m_pg->IsPropertyExpanded( event.GetProperty() ); } /////////////////////////////////////////////////////////////////////////////// void ObjectInspector::OnObjectSelected( wxFBObjectEvent& ) { Create(); } void ObjectInspector::OnProjectRefresh( wxFBEvent& ) { Create(true); } void ObjectInspector::OnEventHandlerModified( wxFBEventHandlerEvent& event ) { PEvent e = event.GetFBEventHandler(); m_eg->SetPropertyValue( e->GetName(), e->GetValue() ); m_eg->Refresh(); } void ObjectInspector::OnPropertyModified( wxFBPropertyEvent& event ) { PProperty prop = event.GetFBProperty(); PObjectBase propobj = prop->GetObject(); PObjectBase appobj = AppData()->GetSelectedObject(); bool shouldContinue = ( prop->GetObject() == AppData()->GetSelectedObject() ); if ( !shouldContinue ) { // Item objects cannot be selected - their children are selected instead if ( propobj->GetObjectInfo()->GetObjectType()->IsItem() ) { if ( propobj->GetChildCount() > 0 ) { shouldContinue = ( appobj == propobj->GetChild( 0 ) ); } } } if ( !shouldContinue ) { return; } wxPGId pgid = m_pg->GetPropertyByLabel(prop->GetName()); if (!pgid.IsOk()) return; // Puede que no se esté mostrando ahora esa página wxPGProperty *pgProp = pgid.GetPropertyPtr(); switch (prop->GetType()) { case PT_FLOAT: { // use float instead of string -> typeconv handles locale pgProp->DoSetValue( wxPGVariant( prop->GetValueAsFloat() ) ); break; } case PT_INT: case PT_UINT: { pgProp->SetValueFromString(prop->GetValueAsString(), 0); break; } case PT_TEXT: pgProp->SetValueFromString(prop->GetValueAsString(), 0); break; case PT_MACRO: case PT_OPTION: case PT_PARENT: case PT_WXSTRING: pgProp->SetValueFromString(prop->GetValueAsText(), 0); break; case PT_WXSTRING_I18N: pgProp->SetValueFromString(prop->GetValueAsText(), 0); break; case PT_BOOL: pgProp->SetValueFromInt(prop->GetValueAsString() == wxT("0") ? 0 : 1, 0); break; case PT_BITLIST: { wxString aux = prop->GetValueAsString(); aux.Replace(wxT("|"), wxT(", ")); if (aux == wxT("0")) aux = wxT(""); pgProp->SetValueFromString(aux, 0); } break; case PT_WXPOINT: m_pg->SetPropertyValue(pgid, prop->GetValueAsPoint()); break; case PT_WXSIZE: m_pg->SetPropertyValue(pgid, prop->GetValueAsSize()); break; case PT_WXFONT: { wxFontContainer font = TypeConv::StringToFont( prop->GetValueAsString() ); wxFontPropertyValue val( font.m_pointSize, font.m_family, font.m_style, font.m_weight, font.m_underlined, font.m_faceName ); pgProp->DoSetValue((void*)&val); } break; case PT_WXCOLOUR: { wxString value = prop->GetValueAsString(); if ( value.empty() ) // Default Colour { wxColourPropertyValue def( wxSYS_COLOUR_MAX, wxColour( 255, 255, 255 ) ); m_pg->SetPropertyValue( pgid, def ); } else { if ( value.find_first_of( wxT("wx") ) == 0 ) { // System Colour wxColourPropertyValue def; def.m_type = TypeConv::StringToSystemColour( value ); def.m_colour = prop->GetValueAsColour(); m_pg->SetPropertyValue( pgid, def ); } else { wxColourPropertyValue def( wxPG_COLOUR_CUSTOM, prop->GetValueAsColour() ); m_pg->SetPropertyValue( pgid, def ); } } } break; case PT_BITMAP: break; default: pgProp->SetValueFromString(prop->GetValueAsString(), wxPG_FULL_VALUE); } m_pg->Refresh(); } wxPropertyGridManager* ObjectInspector::CreatePropertyGridManager(wxWindow *parent, wxWindowID id) { int pgStyle; int defaultDescBoxHeight; switch (m_style) { case wxFB_OI_MULTIPAGE_STYLE: pgStyle = wxPG_BOLD_MODIFIED | wxPG_SPLITTER_AUTO_CENTER | wxPG_TOOLBAR | wxPG_DESCRIPTION | wxPGMAN_DEFAULT_STYLE; defaultDescBoxHeight = 50; break; case wxFB_OI_DEFAULT_STYLE: case wxFB_OI_SINGLE_PAGE_STYLE: default: pgStyle = wxPG_BOLD_MODIFIED | wxPG_SPLITTER_AUTO_CENTER | wxPG_DESCRIPTION | wxPGMAN_DEFAULT_STYLE; defaultDescBoxHeight = 150; break; } int descBoxHeight; wxConfigBase* config = wxConfigBase::Get(); config->Read( wxT( "/mainframe/objectInspector/DescBoxHeight" ), &descBoxHeight, defaultDescBoxHeight ); if ( -1 == descBoxHeight ) { descBoxHeight = defaultDescBoxHeight; } wxPropertyGridManager* pg; pg = new wxPropertyGridManager( parent, id, wxDefaultPosition, wxDefaultSize, pgStyle ); pg->SetDescBoxHeight( descBoxHeight ); pg->SetExtraStyle( wxPG_EX_NATIVE_DOUBLE_BUFFERING ); pg->SetExtraStyle( wxPG_EX_PROCESS_EVENTS_IMMEDIATELY ); return pg; } wxformbuilder-3.1.59/src/rad/inspector/objinspect.h0000644000175000017500000001220511143440026022623 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #ifndef __OBJ_INSPECT__ #define __OBJ_INSPECT__ #include "wx/wx.h" #include #include #include #include #include #include "utils/wxfbdefs.h" #include "model/objectbase.h" #if wxUSE_SLIDER WX_PG_DECLARE_EDITOR_WITH_DECL(Slider,WXDLLIMPEXP_PG) #endif // ----------------------------------------------------------------------- WX_PG_DECLARE_CUSTOM_COLOUR_PROPERTY(fbColourProperty) // ----------------------------------------------------------------------- WX_PG_DECLARE_VALUE_TYPE_VOIDP(wxPoint) WX_PG_DECLARE_PROPERTY(wxPointProperty,const wxPoint&,wxPoint(0,0)) // ----------------------------------------------------------------------- WX_PG_DECLARE_VALUE_TYPE_VOIDP(wxSize) WX_PG_DECLARE_PROPERTY(wxSizeProperty,const wxSize&,wxSize(0,0)) // ----------------------------------------------------------------------- WX_PG_DECLARE_PROPERTY( wxBitmapWithResourceProperty, const wxString&, wxEmptyString ) // ----------------------------------------------------------------------- class wxFBEventHandlerEvent; class wxFBPropertyEvent; class wxFBObjectEvent; class wxFBEvent; enum { wxFB_OI_DEFAULT_STYLE, wxFB_OI_MULTIPAGE_STYLE, wxFB_OI_SINGLE_PAGE_STYLE }; class ObjectInspector : public wxPanel { private: typedef std::map< wxPGProperty*, PProperty> ObjInspectorPropertyMap; typedef std::map< wxPGProperty*, PEvent> ObjInspectorEventMap; ObjInspectorPropertyMap m_propMap; ObjInspectorEventMap m_eventMap; PObjectBase m_currentSel; wxFlatNotebook* m_nb; wxPropertyGridManager* m_pg; wxPropertyGridManager* m_eg; int m_style; int StringToBits(const wxString& strVal, wxPGChoices& constants); typedef std::map< wxString, bool > ExpandMap; ExpandMap m_isExpanded; template < class ValueT > void CreateCategory( const wxString& name, PObjectBase obj, PObjectInfo obj_info, std::map< wxString, ValueT >& itemMap, bool addingEvents ) { // Get Category PPropertyCategory category = obj_info->GetCategory(); if ( !category ) { return; } // Prevent page creation if there are no properties if ( 0 == category->GetCategoryCount() && 0 == ( addingEvents ? category->GetEventCount() : category->GetPropertyCount() ) ) { return; } wxString pageName; if (m_style == wxFB_OI_MULTIPAGE_STYLE) pageName = name; else pageName = wxT("default"); wxPropertyGridManager* pg = ( addingEvents ? m_eg : m_pg ); int pageIndex = pg->GetPageByName( pageName ); if ( wxNOT_FOUND == pageIndex ) { pg->AddPage( pageName, obj_info->GetSmallIconFile() ); } const wxString& catName = category->GetName(); wxPGId id = pg->AppendCategory( catName ); ExpandMap::iterator it = m_isExpanded.find( catName ); if ( it != m_isExpanded.end() ) { if ( it->second ) { m_pg->Expand( id ); } else { m_pg->Collapse( id ); } } AddItems( name, obj, obj_info, category, itemMap ); pg->SetPropertyAttributeAll( wxPG_BOOL_USE_CHECKBOX, (long)1 ); } void AddItems( const wxString& name, PObjectBase obj, PObjectInfo obj_info, PPropertyCategory category, PropertyMap& map ); void AddItems( const wxString& name, PObjectBase obj, PObjectInfo obj_info, PPropertyCategory category, EventMap& map ); wxPGProperty* GetProperty(PProperty prop); void Create(bool force = false); void OnPropertyGridChange(wxPropertyGridEvent& event); void OnEventGridChange(wxPropertyGridEvent& event); void OnPropertyGridExpand(wxPropertyGridEvent& event); void OnReCreateGrid( wxCommandEvent& event ); protected: public: ObjectInspector(wxWindow *parent, int id, int style = wxFB_OI_DEFAULT_STYLE); ~ObjectInspector(); void OnObjectSelected( wxFBObjectEvent& event ); void OnProjectRefresh( wxFBEvent& event ); void OnPropertyModified( wxFBPropertyEvent& event ); void OnEventHandlerModified( wxFBEventHandlerEvent& event ); wxPropertyGridManager* CreatePropertyGridManager(wxWindow *parent, wxWindowID id); void SavePosition(); DECLARE_EVENT_TABLE() }; #endif //__OBJ_INSPECT__ wxformbuilder-3.1.59/src/rad/objecttree/objecttree.cpp0000644000175000017500000003754511143440026023302 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #include "objecttree.h" #include "rad/bitmaps.h" #include "utils/debug.h" #include #include #include "rad/menueditor.h" #include "utils/typeconv.h" #include "rad/wxfbevent.h" #include #include "model/objectbase.h" #include BEGIN_EVENT_TABLE( ObjectTree, wxPanel ) EVT_TREE_SEL_CHANGED( -1, ObjectTree::OnSelChanged ) EVT_TREE_ITEM_RIGHT_CLICK( -1, ObjectTree::OnRightClick ) EVT_TREE_BEGIN_DRAG( -1, ObjectTree::OnBeginDrag ) EVT_TREE_END_DRAG( -1, ObjectTree::OnEndDrag ) EVT_FB_PROJECT_LOADED( ObjectTree::OnProjectLoaded ) EVT_FB_PROJECT_SAVED( ObjectTree::OnProjectSaved ) EVT_FB_OBJECT_CREATED( ObjectTree::OnObjectCreated ) EVT_FB_OBJECT_REMOVED( ObjectTree::OnObjectRemoved ) EVT_FB_PROPERTY_MODIFIED( ObjectTree::OnPropertyModified ) EVT_FB_PROJECT_REFRESH( ObjectTree::OnProjectRefresh ) END_EVENT_TABLE() ObjectTree::ObjectTree( wxWindow *parent, int id ) : wxPanel( parent, id ) { AppData()->AddHandler( this->GetEventHandler() ); m_tcObjects = new wxTreeCtrl(this, -1, wxDefaultPosition, wxDefaultSize, wxTR_HAS_BUTTONS|wxTR_LINES_AT_ROOT|wxTR_DEFAULT_STYLE|wxSIMPLE_BORDER); wxBoxSizer* sizer_1 = new wxBoxSizer(wxVERTICAL); sizer_1->Add(m_tcObjects, 1, wxEXPAND, 0); SetAutoLayout(true); SetSizer(sizer_1); sizer_1->Fit(this); sizer_1->SetSizeHints(this); Connect( wxID_ANY, wxEVT_FB_OBJECT_EXPANDED, wxFBObjectEventHandler( ObjectTree::OnObjectExpanded ) ); Connect( wxID_ANY, wxEVT_FB_OBJECT_SELECTED, wxFBObjectEventHandler( ObjectTree::OnObjectSelected ) ); Connect( wxID_ANY, wxEVT_COMMAND_TREE_ITEM_EXPANDED, wxTreeEventHandler( ObjectTree::OnExpansionChange ) ); Connect( wxID_ANY, wxEVT_COMMAND_TREE_ITEM_COLLAPSED, wxTreeEventHandler( ObjectTree::OnExpansionChange ) ); } ObjectTree::~ObjectTree() { AppData()->RemoveHandler( this->GetEventHandler() ); } PObjectBase ObjectTree::GetObjectFromTreeItem( wxTreeItemId item ) { if ( item.IsOk() ) { wxTreeItemData* item_data = m_tcObjects->GetItemData( item ); if ( item_data ) { PObjectBase obj( ((ObjectTreeItemData* )item_data)->GetObject() ); return obj; } } return PObjectBase( (ObjectBase*)NULL ); } void ObjectTree::RebuildTree() { m_tcObjects->Freeze(); Disconnect( wxID_ANY, wxEVT_COMMAND_TREE_ITEM_EXPANDED, wxTreeEventHandler( ObjectTree::OnExpansionChange ) ); Disconnect( wxID_ANY, wxEVT_COMMAND_TREE_ITEM_COLLAPSED, wxTreeEventHandler( ObjectTree::OnExpansionChange ) ); PObjectBase project = AppData()->GetProjectData(); // Clear the old tree and map m_tcObjects->DeleteAllItems(); m_map.clear(); if (project) { wxTreeItemId dummy; AddChildren(project, dummy, true ); // Expand items that were previously expanded RestoreItemStatus(project); } Connect( wxID_ANY, wxEVT_COMMAND_TREE_ITEM_COLLAPSED, wxTreeEventHandler( ObjectTree::OnExpansionChange ) ); Connect( wxID_ANY, wxEVT_COMMAND_TREE_ITEM_EXPANDED, wxTreeEventHandler( ObjectTree::OnExpansionChange ) ); m_tcObjects->Thaw(); } void ObjectTree::OnSelChanged(wxTreeEvent &event) { wxTreeItemId id = event.GetItem(); if (!id.IsOk()) return; // Make selected items bold wxTreeItemId oldId = event.GetOldItem(); if ( oldId.IsOk() ) { m_tcObjects->SetItemBold( oldId, false ); } m_tcObjects->SetItemBold( id ); wxTreeItemData *item_data = m_tcObjects->GetItemData(id); if (item_data) { PObjectBase obj(((ObjectTreeItemData *)item_data)->GetObject()); assert(obj); Disconnect( wxID_ANY, wxEVT_FB_OBJECT_SELECTED, wxFBObjectEventHandler( ObjectTree::OnObjectSelected ) ); AppData()->SelectObject(obj); Connect( wxID_ANY, wxEVT_FB_OBJECT_SELECTED, wxFBObjectEventHandler( ObjectTree::OnObjectSelected ) ); } } void ObjectTree::OnRightClick(wxTreeEvent &event) { wxTreeItemId id = event.GetItem(); wxTreeItemData *item_data = m_tcObjects->GetItemData(id); if (item_data) { PObjectBase obj(((ObjectTreeItemData *)item_data)->GetObject()); assert(obj); wxMenu * menu = new ItemPopupMenu(obj); wxPoint pos = event.GetPoint(); menu->UpdateUI(menu); PopupMenu(menu,pos.x, pos.y); } } void ObjectTree::OnBeginDrag(wxTreeEvent &event) { // need to explicitly allow drag if ( event.GetItem() == m_tcObjects->GetRootItem() ) { return; } m_draggedItem = event.GetItem(); event.Allow(); } void ObjectTree::OnEndDrag(wxTreeEvent& event) { bool copy = ::wxGetKeyState( WXK_CONTROL ); wxTreeItemId itemSrc = m_draggedItem, itemDst = event.GetItem(); m_draggedItem = (wxTreeItemId)0l; // ensure that itemDst is not itemSrc or a child of itemSrc wxTreeItemId item = itemDst; while ( item.IsOk() ) { if ( item == itemSrc ) { return; } item = m_tcObjects->GetItemParent( item ); } PObjectBase objSrc = GetObjectFromTreeItem( itemSrc ); if ( !objSrc ) { return; } PObjectBase objDst = GetObjectFromTreeItem( itemDst ); if ( !objDst ) { return; } // backup clipboard PObjectBase clipboard = AppData()->GetClipboardObject(); // set object to clipboard if ( copy ) { AppData()->CopyObject( objSrc ); } else { AppData()->CutObject( objSrc ); } if ( !AppData()->PasteObject( objDst ) && !copy ) { AppData()->Undo(); } AppData()->SetClipboardObject( clipboard ); } void ObjectTree::OnExpansionChange(wxTreeEvent &event) { wxTreeItemId id = event.GetItem(); wxTreeItemData *item_data = m_tcObjects->GetItemData(id); if (item_data) { PObjectBase obj(((ObjectTreeItemData *)item_data)->GetObject()); assert(obj); Disconnect( wxID_ANY, wxEVT_FB_OBJECT_EXPANDED, wxFBObjectEventHandler( ObjectTree::OnObjectExpanded ) ); AppData()->ExpandObject( obj, m_tcObjects->IsExpanded( id ) ); Connect( wxID_ANY, wxEVT_FB_OBJECT_EXPANDED, wxFBObjectEventHandler( ObjectTree::OnObjectExpanded ) ); } } void ObjectTree::AddChildren(PObjectBase obj, wxTreeItemId &parent, bool is_root) { if (obj->GetObjectInfo()->GetObjectType()->IsItem()) { if (obj->GetChildCount() > 0) AddChildren(obj->GetChild(0),parent); else { // Si hemos llegado aquí ha sido porque el arbol no está bien formado // y habrá que revisar cómo se ha creado. wxString msg; PObjectBase itemParent = obj->GetParent(); assert(parent); msg = wxString::Format(wxT("Item without object as child of \'%s:%s\'"), itemParent->GetPropertyAsString(wxT("name")).c_str(), itemParent->GetClassName().c_str()); wxLogError(msg); } } else { wxTreeItemId new_parent; ObjectTreeItemData *item_data = new ObjectTreeItemData(obj); if (is_root) new_parent = m_tcObjects->AddRoot(wxT(""),-1,-1,item_data); else new_parent = m_tcObjects->AppendItem(parent,wxT(""),-1,-1,item_data); // Add the item to the map m_map.insert( ObjectItemMap::value_type( obj, new_parent ) ); // Set the image int image_idx = GetImageIndex( obj->GetObjectInfo()->GetClassName() ); m_tcObjects->SetItemImage(new_parent,image_idx); // Set the name UpdateItem( new_parent, obj ); // Add the rest of the children unsigned int count = obj->GetChildCount(); unsigned int i; for (i = 0; i < count ; i++) { PObjectBase child = obj->GetChild(i); AddChildren(child, new_parent); } } } int ObjectTree::GetImageIndex (wxString name) { int index = 0; //default icon IconIndexMap::iterator it = m_iconIdx.find(name); if (it != m_iconIdx.end()) index = it->second; return index; } void ObjectTree::UpdateItem(wxTreeItemId id, PObjectBase obj) { // mostramos el nombre wxString class_name( obj->GetClassName() ); PProperty prop = obj->GetProperty( wxT("name") ); wxString obj_name; if (prop) { obj_name =prop->GetValue(); } wxString text = obj_name + wxT(" : ") + class_name; // actualizamos el item m_tcObjects->SetItemText(id,text); } void ObjectTree::Create() { // Cramos la lista de iconos obteniendo los iconos de los paquetes. unsigned int index = 0; m_iconList = new wxImageList(ICON_SIZE,ICON_SIZE); { wxBitmap icon = AppBitmaps::GetBitmap(wxT("project"), ICON_SIZE); m_iconList->Add(icon); m_iconIdx.insert(IconIndexMap::value_type( wxT("_default_"),index++)); } unsigned int pkg_count = AppData()->GetPackageCount(); for (unsigned int i = 0; i< pkg_count;i++) { PObjectPackage pkg = AppData()->GetPackage(i); unsigned int j; for (j=0;jGetObjectCount();j++) { wxString comp_name(pkg->GetObjectInfo(j)->GetClassName()); m_iconList->Add( pkg->GetObjectInfo(j)->GetIconFile() ); m_iconIdx.insert(IconIndexMap::value_type(comp_name,index++)); } } m_tcObjects->AssignImageList(m_iconList); } void ObjectTree::RestoreItemStatus(PObjectBase obj) { ObjectItemMap::iterator item_it = m_map.find(obj); if (item_it != m_map.end()) { wxTreeItemId id = item_it->second; if ( obj->GetExpanded() ) m_tcObjects->Expand(id); else m_tcObjects->Collapse(id); } unsigned int i,count = obj->GetChildCount(); for (i = 0; iGetChild(i)); } ///////////////////////////////////////////////////////////////////////////// // wxFormBuilder Event Handlers ///////////////////////////////////////////////////////////////////////////// void ObjectTree::OnProjectLoaded ( wxFBEvent &) { RebuildTree(); } void ObjectTree::OnProjectSaved ( wxFBEvent &) { } void ObjectTree::OnObjectExpanded( wxFBObjectEvent& event ) { PObjectBase obj = event.GetFBObject(); ObjectItemMap::iterator it = m_map.find( obj ); if ( it != m_map.end() ) { if ( m_tcObjects->IsExpanded( it->second ) != obj->GetExpanded() ) { if ( obj->GetExpanded() ) { m_tcObjects->Expand( it->second ); } else { m_tcObjects->Collapse( it->second ); } } } } void ObjectTree::OnObjectSelected( wxFBObjectEvent &event ) { PObjectBase obj = event.GetFBObject(); // Find the tree item associated with the object and select it ObjectItemMap::iterator it = m_map.find(obj); if ( it != m_map.end() ) { // Ignore expand/collapse events Disconnect( wxID_ANY, wxEVT_COMMAND_TREE_ITEM_EXPANDED, wxTreeEventHandler( ObjectTree::OnExpansionChange ) ); Disconnect( wxID_ANY, wxEVT_COMMAND_TREE_ITEM_COLLAPSED, wxTreeEventHandler( ObjectTree::OnExpansionChange ) ); m_tcObjects->EnsureVisible( it->second ); m_tcObjects->SelectItem( it->second ); // Restore event handling Connect( wxID_ANY, wxEVT_COMMAND_TREE_ITEM_EXPANDED, wxTreeEventHandler( ObjectTree::OnExpansionChange ) ); Connect( wxID_ANY, wxEVT_COMMAND_TREE_ITEM_COLLAPSED, wxTreeEventHandler( ObjectTree::OnExpansionChange ) ); } else { wxLogError( wxT("There is no tree item associated with this object.\n\tClass: %s\n\tName: %s"), obj->GetClassName().c_str(), obj->GetPropertyAsString(wxT("name")).c_str() ); } } void ObjectTree::OnObjectCreated ( wxFBObjectEvent &) { RebuildTree(); } void ObjectTree::OnObjectRemoved ( wxFBObjectEvent &) { RebuildTree(); } void ObjectTree::OnPropertyModified ( wxFBPropertyEvent &event ) { PProperty prop = event.GetFBProperty(); if (prop->GetName() == wxT("name") ) { ObjectItemMap::iterator it = m_map.find(prop->GetObject()); if (it != m_map.end()) { UpdateItem(it->second,it->first); } }; } void ObjectTree::OnProjectRefresh ( wxFBEvent &) { RebuildTree(); } /////////////////////////////////////////////////////////////////////////////// ObjectTreeItemData::ObjectTreeItemData(PObjectBase obj) : m_object(obj) {} /////////////////////////////////////////////////////////////////////////////// #define MENU_MOVE_UP 100 #define MENU_MOVE_DOWN 101 #define MENU_MOVE_RIGHT 102 #define MENU_MOVE_LEFT 103 #define MENU_CUT 104 #define MENU_PASTE 105 #define MENU_EDIT_MENUS 106 #define MENU_COPY 107 #define MENU_MOVE_NEW_BOXSIZER 108 #define MENU_DELETE 109 BEGIN_EVENT_TABLE(ItemPopupMenu,wxMenu) EVT_MENU(-1, ItemPopupMenu::OnMenuEvent) EVT_UPDATE_UI(-1, ItemPopupMenu::OnUpdateEvent) END_EVENT_TABLE() ItemPopupMenu::ItemPopupMenu(PObjectBase obj) : wxMenu(), m_object(obj) { Append(MENU_CUT, wxT("Cut\tCtrl+X")); Append(MENU_COPY, wxT("Copy\tCtrl+C")); Append(MENU_PASTE, wxT("Paste\tCtrl+V")); AppendSeparator(); Append(MENU_DELETE, wxT("Delete\tCtrl+D")); AppendSeparator(); Append(MENU_MOVE_UP, wxT("Move Up\tAlt+Up")); Append(MENU_MOVE_DOWN, wxT("Move Down\tAlt+Down")); Append(MENU_MOVE_LEFT, wxT("Move Left\tAlt+Left")); Append(MENU_MOVE_RIGHT, wxT("Move Right\tAlt+Right")); AppendSeparator(); Append(MENU_MOVE_NEW_BOXSIZER, wxT("Move into a new wxBoxSizer")); AppendSeparator(); Append(MENU_EDIT_MENUS, wxT("Menu Editor...")); } void ItemPopupMenu::OnMenuEvent (wxCommandEvent & event) { int id = event.GetId(); switch (id) { case MENU_CUT: AppData()->CutObject(m_object); break; case MENU_COPY: AppData()->CopyObject(m_object); break; case MENU_PASTE: AppData()->PasteObject(m_object); break; case MENU_DELETE: AppData()->RemoveObject(m_object); break; case MENU_MOVE_UP: AppData()->MovePosition(m_object,false); break; case MENU_MOVE_DOWN: AppData()->MovePosition(m_object,true); break; case MENU_MOVE_RIGHT: AppData()->MoveHierarchy(m_object,false); break; case MENU_MOVE_LEFT: AppData()->MoveHierarchy(m_object,true); break; case MENU_MOVE_NEW_BOXSIZER: AppData()->CreateBoxSizerWithObject(m_object); break; case MENU_EDIT_MENUS: { PObjectBase obj = m_object; if (obj && (obj->GetClassName() == wxT("wxMenuBar") || obj->GetClassName() == wxT("Frame") ) ) { MenuEditor me(NULL); if (obj->GetClassName() == wxT("Frame") ) { bool found = false; PObjectBase menubar; for (unsigned int i = 0; i < obj->GetChildCount() && !found; i++) { menubar = obj->GetChild(i); found = menubar->GetClassName() == wxT("wxMenuBar"); } if (found) obj = menubar; } if (obj->GetClassName() == wxT("wxMenuBar")) me.Populate(obj); if (me.ShowModal() == wxID_OK) { if (obj->GetClassName() == wxT("wxMenuBar")) { PObjectBase menubar = me.GetMenubar(AppData()->GetObjectDatabase()); while (obj->GetChildCount() > 0) { PObjectBase child = obj->GetChild(0); obj->RemoveChild(0); child->SetParent(PObjectBase()); } for (unsigned int i = 0; i < menubar->GetChildCount(); i++) { PObjectBase child = menubar->GetChild(i); AppData()->InsertObject(child,obj); } } else AppData()->InsertObject(me.GetMenubar(AppData()->GetObjectDatabase()),AppData()->GetSelectedForm()); } } } break; default: break; } } void ItemPopupMenu::OnUpdateEvent(wxUpdateUIEvent& e) { switch (e.GetId()) { case MENU_EDIT_MENUS: e.Enable(m_object && (m_object->GetClassName() == wxT("wxMenuBar" ) || m_object->GetClassName() == wxT("Frame"))); break; case MENU_CUT: case MENU_COPY: case MENU_DELETE: case MENU_MOVE_UP: case MENU_MOVE_DOWN: case MENU_MOVE_LEFT: case MENU_MOVE_RIGHT: case MENU_MOVE_NEW_BOXSIZER: e.Enable(AppData()->CanCopyObject()); break; case MENU_PASTE: e.Enable(AppData()->CanPasteObject()); break; } } wxformbuilder-3.1.59/src/rad/objecttree/objecttree.h0000644000175000017500000000702411143440026022734 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #ifndef __OBJECT_TREE__ #define __OBJECT_TREE__ #include "utils/wxfbdefs.h" #include #include "rad/customkeys.h" #include class wxFBEvent; class wxFBPropertyEvent; class wxFBObjectEvent; class ObjectTree : public wxPanel { private: typedef std::map< PObjectBase, wxTreeItemId> ObjectItemMap; typedef std::map IconIndexMap; ObjectItemMap m_map; wxImageList *m_iconList; IconIndexMap m_iconIdx; wxTextCtrl* m_txtSelected; wxTreeCtrl* m_tcObjects; wxTreeItemId m_draggedItem; /** * Crea el arbol completamente. */ void RebuildTree(); void AddChildren(PObjectBase child, wxTreeItemId &parent, bool is_root = false); int GetImageIndex (wxString type); void UpdateItem(wxTreeItemId id, PObjectBase obj); void RestoreItemStatus(PObjectBase obj); PObjectBase GetObjectFromTreeItem( wxTreeItemId item ); DECLARE_EVENT_TABLE() public: ObjectTree(wxWindow *parent, int id); ~ObjectTree(); void Create(); void OnSelChanged(wxTreeEvent &event); void OnRightClick(wxTreeEvent &event); void OnBeginDrag(wxTreeEvent &event); void OnEndDrag(wxTreeEvent &event); void OnExpansionChange(wxTreeEvent &event); void OnProjectLoaded ( wxFBEvent &event ); void OnProjectSaved ( wxFBEvent &event ); void OnObjectExpanded( wxFBObjectEvent& event ); void OnObjectSelected( wxFBObjectEvent &event ); void OnObjectCreated ( wxFBObjectEvent &event ); void OnObjectRemoved ( wxFBObjectEvent &event ); void OnPropertyModified ( wxFBPropertyEvent &event ); void OnProjectRefresh ( wxFBEvent &event); void AddCustomKeysHandler(CustomKeysEvtHandler *h) { m_tcObjects->PushEventHandler(h); }; }; /** * Gracias a que podemos asociar un objeto a cada item, esta clase nos va * a facilitar obtener el objeto (ObjectBase) asociado a un item para * seleccionarlo pinchando en el item. */ class ObjectTreeItemData : public wxTreeItemData { private: PObjectBase m_object; public: ObjectTreeItemData(PObjectBase obj); PObjectBase GetObject() { return m_object; } }; /** * Menu popup asociado a cada item del arbol. * * Este objeto ejecuta los comandos incluidos en el menu referentes al objeto * seleccionado. */ class ItemPopupMenu : public wxMenu { private: PObjectBase m_object; DECLARE_EVENT_TABLE() public: void OnUpdateEvent(wxUpdateUIEvent& e); ItemPopupMenu(PObjectBase obj); void OnMenuEvent (wxCommandEvent & event); }; #endif //__OBJECT_TREE__ wxformbuilder-3.1.59/src/rad/xrcpanel/xrcpanel.h0000644000175000017500000000344411143440026022112 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #ifndef __XRC_PANEL__ #define __XRC_PANEL__ #include #include "utils/wxfbdefs.h" class CodeEditor; class wxFBEvent; class wxFBPropertyEvent; class wxFBObjectEvent; class wxScintilla; class wxFindDialogEvent; class XrcPanel : public wxPanel { private: CodeEditor* m_xrcPanel; PTCCodeWriter m_cw; void InitStyledTextCtrl( wxScintilla* stc ); public: XrcPanel( wxWindow *parent, int id ); ~XrcPanel(); void OnPropertyModified( wxFBPropertyEvent& event ); void OnProjectRefresh( wxFBEvent& event ); void OnCodeGeneration( wxFBEvent& event ); void OnObjectChange( wxFBObjectEvent& event ); void OnFind( wxFindDialogEvent& event ); DECLARE_EVENT_TABLE() }; #endif //__XRC_PANEL__ wxformbuilder-3.1.59/src/rad/xrcpanel/xrcpanel.cpp0000644000175000017500000001474611143440026022454 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // Modified by // Michal Bliznak // /////////////////////////////////////////////////////////////////////////////// #include "xrcpanel.h" #include "codegen/xrccg.h" #include "codegen/codewriter.h" #include "rad/codeeditor/codeeditor.h" #include "rad/bitmaps.h" #include "rad/wxfbevent.h" #include "rad/appdata.h" #include "model/objectbase.h" #include "utils/typeconv.h" #include "utils/wxfbexception.h" #include #include #include BEGIN_EVENT_TABLE( XrcPanel, wxPanel ) EVT_FB_CODE_GENERATION( XrcPanel::OnCodeGeneration ) EVT_FB_PROJECT_REFRESH( XrcPanel::OnProjectRefresh ) EVT_FB_PROPERTY_MODIFIED( XrcPanel::OnPropertyModified ) EVT_FB_OBJECT_CREATED( XrcPanel::OnObjectChange ) EVT_FB_OBJECT_REMOVED( XrcPanel::OnObjectChange ) EVT_FB_OBJECT_SELECTED( XrcPanel::OnObjectChange ) EVT_FIND( wxID_ANY, XrcPanel::OnFind ) EVT_FIND_NEXT( wxID_ANY, XrcPanel::OnFind ) END_EVENT_TABLE() XrcPanel::XrcPanel( wxWindow *parent, int id ) : wxPanel ( parent, id ) { AppData()->AddHandler( this->GetEventHandler() ); wxBoxSizer *top_sizer = new wxBoxSizer( wxVERTICAL ); m_xrcPanel = new CodeEditor( this, -1 ); InitStyledTextCtrl( m_xrcPanel->GetTextCtrl() ); top_sizer->Add( m_xrcPanel, 1, wxEXPAND, 0 ); SetSizer( top_sizer ); SetAutoLayout( true ); //top_sizer->SetSizeHints( this ); top_sizer->Fit( this ); top_sizer->Layout(); m_cw = PTCCodeWriter( new TCCodeWriter( m_xrcPanel->GetTextCtrl() ) ); } XrcPanel::~XrcPanel() { AppData()->RemoveHandler( this->GetEventHandler() ); } void XrcPanel::InitStyledTextCtrl( wxScintilla *stc ) { stc->SetLexer( wxSCI_LEX_XML ); #ifdef __WXGTK__ // Debe haber un bug en wxGTK ya que la familia wxMODERN no es de ancho fijo. wxFont font( 8, wxMODERN, wxNORMAL, wxNORMAL ); font.SetFaceName( wxT( "Monospace" ) ); #else wxFont font( 10, wxMODERN, wxNORMAL, wxNORMAL ); #endif stc->StyleSetFont( wxSCI_STYLE_DEFAULT, font ); stc->StyleClearAll(); stc->StyleSetForeground( wxSCI_H_DOUBLESTRING, *wxRED ); stc->StyleSetForeground( wxSCI_H_TAG, wxColour( 0, 0, 128 ) ); stc->StyleSetForeground( wxSCI_H_ATTRIBUTE, wxColour( 128, 0, 128 ) ); stc->SetUseTabs( false ); stc->SetTabWidth( 4 ); stc->SetTabIndents( true ); stc->SetBackSpaceUnIndents( true ); stc->SetIndent( 4 ); stc->SetSelBackground( true, wxSystemSettings::GetColour( wxSYS_COLOUR_HIGHLIGHT ) ); stc->SetSelForeground( true, wxSystemSettings::GetColour( wxSYS_COLOUR_HIGHLIGHTTEXT ) ); stc->SetCaretWidth( 2 ); stc->SetReadOnly( true ); } void XrcPanel::OnFind( wxFindDialogEvent& event ) { wxFlatNotebook* notebook = wxDynamicCast( this->GetParent(), wxFlatNotebook ); if ( NULL == notebook ) { return; } int selection = notebook->GetSelection(); if ( selection < 0 ) { return; } wxString text = notebook->GetPageText( selection ); if ( wxT("XRC") == text ) { m_xrcPanel->ProcessEvent( event ); } } void XrcPanel::OnPropertyModified( wxFBPropertyEvent& event ) { // Generate code to the panel only event.SetId( 1 ); OnCodeGeneration( event ); } void XrcPanel::OnProjectRefresh( wxFBEvent& event ) { // Generate code to the panel only event.SetId( 1 ); OnCodeGeneration( event ); } void XrcPanel::OnObjectChange( wxFBObjectEvent& event ) { // Generate code to the panel only event.SetId( 1 ); OnCodeGeneration( event ); } void XrcPanel::OnCodeGeneration( wxFBEvent& event ) { PObjectBase project; // Using the previously unused Id field in the event to carry a boolean bool panelOnly = ( event.GetId() != 0 ); // For code preview generate only code relevant to selected form, // otherwise generate full project code. if(panelOnly) { project = AppData()->GetSelectedForm(); } if(!panelOnly || !project) { project = AppData()->GetProjectData(); } //PObjectBase project = AppData()->GetProjectData(); if(!project)return; // Generate code in the panel if the panel is active if ( IsShown() ) { Freeze(); wxScintilla* editor = m_xrcPanel->GetTextCtrl(); editor->SetReadOnly( false ); int line = editor->GetFirstVisibleLine() + editor->LinesOnScreen() - 1; int xOffset = editor->GetXOffset(); XrcCodeGenerator codegen; codegen.SetWriter( m_cw ); codegen.GenerateCode( project ); editor->SetReadOnly( true ); editor->GotoLine( line ); editor->SetXOffset( xOffset ); editor->SetAnchor( 0 ); editor->SetCurrentPos( 0 ); Thaw(); } if ( panelOnly ) { return; } PProperty pCodeGen = project->GetProperty( wxT("code_generation") ); if ( pCodeGen ) { if ( !TypeConv::FlagSet ( wxT("XRC"), pCodeGen->GetValue() ) ) { return; } } // And now in the file. { XrcCodeGenerator codegen; wxString file, pathEntry; bool useRelativePath = false; // Determine if the path is absolute or relative PProperty pRelPath = project->GetProperty( wxT( "relative_path" ) ); if ( pRelPath ) useRelativePath = ( pRelPath->GetValueAsInteger() ? true : false ); wxString path; try { // Get the output path path = AppData()->GetOutputPath(); PProperty pfile = project->GetProperty( wxT( "file" ) ); if ( pfile ) file = pfile->GetValue(); if ( file.empty() ) { file = wxT( "noname" ); } wxString filePath; filePath << path << file << wxT( ".xrc" ); PCodeWriter cw( new FileCodeWriter( filePath ) ); codegen.SetWriter( cw ); codegen.GenerateCode( project ); wxLogStatus( wxT( "Code generated on \'%s\'." ), path.c_str() ); } catch ( wxFBException& ex ) { wxLogError( ex.what() ); } } } wxformbuilder-3.1.59/src/rad/xrcpreview/xrcpreview.cpp0000644000175000017500000001436711143440026023417 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // Ryan Mulder - rjmyst3@gmail.com // /////////////////////////////////////////////////////////////////////////////// #include "rad/xrcpreview/xrcpreview.h" #include "model/objectbase.h" #include "codegen/xrccg.h" #include "codegen/codewriter.h" #include "utils/annoyingdialog.h" #include "utils/wxfbexception.h" #include "utils/typeconv.h" #include #include #define MENU_DELETE 109 class XrcPreviewPopupMenu : public wxMenu { DECLARE_EVENT_TABLE() private: wxWindow* m_window; public: XrcPreviewPopupMenu( wxWindow* window ) : wxMenu(), m_window( window ) { Append( MENU_DELETE, wxT("Close Preview") ); } void OnMenuEvent ( wxCommandEvent& event ) { int id = event.GetId(); switch ( id ) { case MENU_DELETE: m_window->Close(); break; default: break; } } }; BEGIN_EVENT_TABLE( XrcPreviewPopupMenu, wxMenu ) EVT_MENU( wxID_ANY, XrcPreviewPopupMenu::OnMenuEvent ) END_EVENT_TABLE() class XRCPreviewEvtHandler : public wxEvtHandler { private: wxWindow* m_window; public: XRCPreviewEvtHandler( wxWindow* win ) : m_window( win ) { } protected: void OnKeyUp( wxKeyEvent& event ) { if ( event.GetKeyCode() == WXK_ESCAPE ) { m_window->Close(); } } void OnRightDown( wxMouseEvent& event ) { wxMenu* menu = new XrcPreviewPopupMenu( m_window ); wxPoint pos = event.GetPosition(); m_window->PopupMenu( menu, pos.x, pos.y ); } void RemoveEventHandler( wxWindow* window ) { const wxWindowList& children = window->GetChildren(); for ( size_t i = 0; i < children.GetCount(); ++i ) { RemoveEventHandler( children.Item( i )->GetData() ); } wxEvtHandler* handler = window->PopEventHandler(); if ( handler != this ) { delete handler; } } void OnClose( wxCloseEvent& ) { RemoveEventHandler( m_window ); m_window->Destroy(); delete this; } DECLARE_EVENT_TABLE() }; BEGIN_EVENT_TABLE( XRCPreviewEvtHandler, wxEvtHandler ) EVT_KEY_UP( XRCPreviewEvtHandler::OnKeyUp ) EVT_RIGHT_DOWN( XRCPreviewEvtHandler::OnRightDown ) EVT_CLOSE ( XRCPreviewEvtHandler::OnClose ) END_EVENT_TABLE() void XRCPreview::Show( PObjectBase form, const wxString& projectPath ) { AnnoyingDialog dlg(_("WARNING - For XRC Developers ONLY!!"), wxGetTranslation( wxT("The XRC language is not as powerful as C++.\n") wxT("It has limitations that will affect the GUI\n") wxT("layout. This preview will ONLY show how the\n") wxT("generated XRC will look, and it will probably\n") wxT("be different from the Designer.\n\n") wxT("If you are not using XRC, do NOT use the XRC\n") wxT("preview, it will only confuse you.") ), wxART_WARNING, AnnoyingDialog::OK_CANCEL, wxID_CANCEL); if ( wxID_CANCEL == dlg.ShowModal() ) { return; } wxString className = form->GetClassName(); PStringCodeWriter cw( new StringCodeWriter ); try { XrcCodeGenerator codegen; codegen.SetWriter( cw ); codegen.GenerateCode( form ); } catch ( wxFBException& ex ) { wxLogError( ex.what() ); return; } wxString workingDir = ::wxGetCwd(); // We change the current directory so that the relative paths work properly ::wxSetWorkingDirectory( projectPath ); wxXmlResource *res = wxXmlResource::Get(); res->InitAllHandlers(); const std::string& data = _STDSTR( cw->GetString() ); wxMemoryFSHandler::AddFile(wxT("xrcpreview.xrc"), data.c_str(), data.size() ); res->Load( wxT("memory:xrcpreview.xrc") ); wxWindow* window = NULL; if ( className == wxT( "Frame" ) ) { wxFrame* frame = new wxFrame(); res->LoadFrame( frame, wxTheApp->GetTopWindow(), form->GetPropertyAsString( wxT( "name" ) ) ); // Prevent events from propagating up to wxFB's frame frame->SetExtraStyle( frame->GetExtraStyle() | wxWS_EX_BLOCK_EVENTS ); frame->Show(); window = frame; } else if ( className == wxT( "Dialog" ) ) { wxDialog* dialog = new wxDialog; res->LoadDialog( dialog, wxTheApp->GetTopWindow(), form->GetPropertyAsString( wxT( "name" ) ) ); // Prevent events from propagating up to wxFB's frame dialog->SetExtraStyle( dialog->GetExtraStyle() | wxWS_EX_BLOCK_EVENTS ); dialog->Show(); window = dialog; } else if ( className == wxT( "Panel" ) ) { wxDialog* dialog = new wxDialog( wxTheApp->GetTopWindow(), -1, wxT( "Dialog" ), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER ); // Prevent events from propagating up to wxFB's frame dialog->SetExtraStyle( wxWS_EX_BLOCK_EVENTS ); wxPanel *panel = new wxPanel(); res->LoadPanel( panel, dialog, form->GetPropertyAsString( wxT( "name" ) ) ); dialog->SetClientSize( panel->GetSize() ); dialog->SetSize( form->GetPropertyAsSize( wxT( "size" ) ) ); dialog->CenterOnScreen(); dialog->Show(); window = dialog; } if ( window ) { AddEventHandler( window, window ); } ::wxSetWorkingDirectory( workingDir ); #if wxCHECK_VERSION( 2, 6, 3 ) res->Unload( wxT("memory:xrcpreview.xrc") ); #endif wxMemoryFSHandler::RemoveFile( wxT("xrcpreview.xrc") ); } void XRCPreview::AddEventHandler( wxWindow* window, wxWindow* form ) { const wxWindowList& children = window->GetChildren(); for ( size_t i = 0; i < children.GetCount(); ++i ) { AddEventHandler( children.Item( i )->GetData(), form ); } window->PushEventHandler( ( new XRCPreviewEvtHandler( form ) ) ); } wxformbuilder-3.1.59/src/rad/xrcpreview/xrcpreview.h0000644000175000017500000000235211143440026023053 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // Ryan Mulder - rjmyst3@gmail.com // /////////////////////////////////////////////////////////////////////////////// #include "utils/wxfbdefs.h" class wxWindow; class XRCPreview { private: static void AddEventHandler( wxWindow* window, wxWindow* form ); public: static void Show( PObjectBase form, const wxString& projectpath ); }; wxformbuilder-3.1.59/src/rad/cpppanel/cpppanel.cpp0000644000175000017500000003022211143440026022413 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // Modified by // Michal Bliznak // /////////////////////////////////////////////////////////////////////////////// #include "cpppanel.h" #include "rad/codeeditor/codeeditor.h" #include "rad/wxfbevent.h" #include "rad/bitmaps.h" #include "rad/appdata.h" #include "utils/wxfbdefs.h" #include "utils/typeconv.h" #include "utils/encodingutils.h" #include "utils/wxfbexception.h" #include "model/objectbase.h" #include "codegen/codewriter.h" #include "codegen/cppcg.h" #include #include #include #include BEGIN_EVENT_TABLE ( CppPanel, wxPanel ) EVT_FB_CODE_GENERATION( CppPanel::OnCodeGeneration ) EVT_FB_PROJECT_REFRESH( CppPanel::OnProjectRefresh ) EVT_FB_PROPERTY_MODIFIED( CppPanel::OnPropertyModified ) EVT_FB_OBJECT_CREATED( CppPanel::OnObjectChange ) EVT_FB_OBJECT_REMOVED( CppPanel::OnObjectChange ) EVT_FB_OBJECT_SELECTED( CppPanel::OnObjectChange ) EVT_FB_EVENT_HANDLER_MODIFIED( CppPanel::OnEventHandlerModified ) EVT_FIND( wxID_ANY, CppPanel::OnFind ) EVT_FIND_NEXT( wxID_ANY, CppPanel::OnFind ) END_EVENT_TABLE() CppPanel::CppPanel( wxWindow *parent, int id ) : wxPanel( parent, id ), m_icons( new wxFlatNotebookImageList ) { AppData()->AddHandler( this->GetEventHandler() ); wxBoxSizer *top_sizer = new wxBoxSizer( wxVERTICAL ); long nbStyle; wxConfigBase* config = wxConfigBase::Get(); config->Read( wxT("/mainframe/editor/cpp/notebook_style"), &nbStyle, wxFNB_NO_X_BUTTON | wxFNB_NO_NAV_BUTTONS | wxFNB_NODRAG | wxFNB_FF2 | wxFNB_CUSTOM_DLG ); m_notebook = new wxFlatNotebook( this, -1, wxDefaultPosition, wxDefaultSize, FNB_STYLE_OVERRIDES( nbStyle ) ); m_notebook->SetCustomizeOptions( wxFNB_CUSTOM_TAB_LOOK | wxFNB_CUSTOM_ORIENTATION | wxFNB_CUSTOM_LOCAL_DRAG ); // Set notebook icons m_icons->Add( AppBitmaps::GetBitmap( wxT( "cpp" ), 16 ) ); m_icons->Add( AppBitmaps::GetBitmap( wxT( "h" ), 16 ) ); m_notebook->SetImageList( m_icons ); m_cppPanel = new CodeEditor( m_notebook, -1 ); InitStyledTextCtrl( m_cppPanel->GetTextCtrl() ); m_notebook->AddPage( m_cppPanel, wxT( "cpp" ), false, 0 ); m_hPanel = new CodeEditor( m_notebook, -1 ); InitStyledTextCtrl( m_hPanel->GetTextCtrl() ); m_notebook->AddPage( m_hPanel, wxT( "h" ), false, 1 ); top_sizer->Add( m_notebook, 1, wxEXPAND, 0 ); SetSizer( top_sizer ); SetAutoLayout( true ); //top_sizer->SetSizeHints( this ); top_sizer->Fit( this ); top_sizer->Layout(); m_hCW = PTCCodeWriter( new TCCodeWriter( m_hPanel->GetTextCtrl() ) ); m_cppCW = PTCCodeWriter( new TCCodeWriter( m_cppPanel->GetTextCtrl() ) ); } CppPanel::~CppPanel() { delete m_icons; AppData()->RemoveHandler( this->GetEventHandler() ); wxConfigBase *config = wxConfigBase::Get(); config->Write( wxT("/mainframe/editor/cpp/notebook_style"), m_notebook->GetWindowStyleFlag() ); } void CppPanel::InitStyledTextCtrl( wxScintilla *stc ) { stc->SetLexer( wxSCI_LEX_CPP ); stc->SetKeyWords( 0, wxT( "asm auto bool break case catch char class const const_cast \ continue default delete do double dynamic_cast else enum explicit \ export extern false float for friend goto if inline int long \ mutable namespace new operator private protected public register \ reinterpret_cast return short signed sizeof static static_cast \ struct switch template this throw true try typedef typeid \ typename union unsigned using virtual void volatile wchar_t \ while" ) ); #ifdef __WXGTK__ // Debe haber un bug en wxGTK ya que la familia wxMODERN no es de ancho fijo. wxFont font( 8, wxMODERN, wxNORMAL, wxNORMAL ); font.SetFaceName( wxT( "Monospace" ) ); #else wxFont font( 10, wxMODERN, wxNORMAL, wxNORMAL ); #endif stc->StyleSetFont( wxSCI_STYLE_DEFAULT, font ); stc->StyleClearAll(); stc->StyleSetBold( wxSCI_C_WORD, true ); stc->StyleSetForeground( wxSCI_C_WORD, *wxBLUE ); stc->StyleSetForeground( wxSCI_C_STRING, *wxRED ); stc->StyleSetForeground( wxSCI_C_STRINGEOL, *wxRED ); stc->StyleSetForeground( wxSCI_C_PREPROCESSOR, wxColour( 49, 106, 197 ) ); stc->StyleSetForeground( wxSCI_C_COMMENT, wxColour( 0, 128, 0 ) ); stc->StyleSetForeground( wxSCI_C_COMMENTLINE, wxColour( 0, 128, 0 ) ); stc->StyleSetForeground( wxSCI_C_COMMENTDOC, wxColour( 0, 128, 0 ) ); stc->StyleSetForeground( wxSCI_C_COMMENTLINEDOC, wxColour( 0, 128, 0 ) ); stc->StyleSetForeground( wxSCI_C_NUMBER, *wxBLUE ); stc->SetUseTabs( true ); stc->SetTabWidth( 4 ); stc->SetTabIndents( true ); stc->SetBackSpaceUnIndents( true ); stc->SetIndent( 4 ); stc->SetSelBackground( true, wxSystemSettings::GetColour( wxSYS_COLOUR_HIGHLIGHT ) ); stc->SetSelForeground( true, wxSystemSettings::GetColour( wxSYS_COLOUR_HIGHLIGHTTEXT ) ); stc->SetCaretWidth( 2 ); stc->SetReadOnly( true ); } void CppPanel::OnFind( wxFindDialogEvent& event ) { wxFlatNotebook* languageBook = wxDynamicCast( this->GetParent(), wxFlatNotebook ); if ( NULL == languageBook ) { return; } int languageSelection = languageBook->GetSelection(); if ( languageSelection < 0 ) { return; } wxString languageText = languageBook->GetPageText( languageSelection ); if ( wxT("C++") != languageText ) { return; } wxFlatNotebook* notebook = wxDynamicCast( m_cppPanel->GetParent(), wxFlatNotebook ); if ( NULL == notebook ) { return; } int selection = notebook->GetSelection(); if ( selection < 0 ) { return; } wxString text = notebook->GetPageText( selection ); if ( wxT("cpp") == text ) { m_cppPanel->ProcessEvent( event ); } else if ( wxT("h") == text ) { m_hPanel->ProcessEvent( event ); } } void CppPanel::OnPropertyModified( wxFBPropertyEvent& event ) { // Generate code to the panel only event.SetId( 1 ); OnCodeGeneration( event ); } void CppPanel::OnProjectRefresh( wxFBEvent& event ) { // Generate code to the panel only event.SetId( 1 ); OnCodeGeneration( event ); } void CppPanel::OnObjectChange( wxFBObjectEvent& event ) { // Generate code to the panel only event.SetId( 1 ); OnCodeGeneration( event ); } void CppPanel::OnEventHandlerModified( wxFBEventHandlerEvent& event ) { // Generate code to the panel only event.SetId( 1 ); OnCodeGeneration( event ); } void CppPanel::OnCodeGeneration( wxFBEvent& event ) { PObjectBase objectToGenerate; // Generate code in the panel if the panel is active bool doPanel = IsShown(); // Using the previously unused Id field in the event to carry a boolean bool panelOnly = ( event.GetId() != 0 ); // Only generate to panel + panel is not shown = do nothing if ( panelOnly && !doPanel ) { return; } // For code preview generate only code relevant to selected form, // otherwise generate full project code. // Create copy of the original project due to possible temporary modifications PObjectBase project = PObjectBase(new ObjectBase(*AppData()->GetProjectData())); if(panelOnly) { objectToGenerate = AppData()->GetSelectedForm(); } if(!panelOnly || !objectToGenerate) { objectToGenerate = project; } // If only one project item should be generated then remove the rest items // from the temporary project if(doPanel && panelOnly && (objectToGenerate != project)) { if( project->GetChildCount() > 0) { unsigned int i = 0; while( project->GetChildCount() > 1 ) { if(project->GetChild( i ) != objectToGenerate) { project->RemoveChild( i ); } else i++; } } } if(!project || !objectToGenerate)return; // Get C++ properties from the project // If C++ generation is not enabled, do not generate the file bool doFile = false; PProperty pCodeGen = project->GetProperty( wxT( "code_generation" ) ); if ( pCodeGen ) { doFile = TypeConv::FlagSet( wxT("C++"), pCodeGen->GetValue() ) && !panelOnly; } if ( !(doPanel || doFile ) ) { return; } // Get First ID from Project File unsigned int firstID = 1000; PProperty pFirstID = project->GetProperty( wxT("first_id") ); if ( pFirstID ) { firstID = pFirstID->GetValueAsInteger(); } // Get the file name wxString file; PProperty pfile = project->GetProperty( wxT( "file" ) ); if ( pfile ) { file = pfile->GetValue(); } if ( file.empty() ) { file = wxT("noname"); } // Determine if the path is absolute or relative bool useRelativePath = false; PProperty pRelPath = project->GetProperty( wxT( "relative_path" ) ); if ( pRelPath ) { useRelativePath = ( pRelPath->GetValueAsInteger() ? true : false ); } // Get the output path wxString path; try { path = AppData()->GetOutputPath(); } catch ( wxFBException& ex ) { if ( doFile ) { path = wxEmptyString; wxLogWarning( ex.what() ); return; } } // Generate code in the panel if ( doPanel ) { CppCodeGenerator codegen; codegen.UseRelativePath( useRelativePath, path ); if ( pFirstID ) { codegen.SetFirstID( firstID ); } codegen.SetHeaderWriter( m_hCW ); codegen.SetSourceWriter( m_cppCW ); Freeze(); wxScintilla* cppEditor = m_cppPanel->GetTextCtrl(); cppEditor->SetReadOnly( false ); int cppLine = cppEditor->GetFirstVisibleLine() + cppEditor->LinesOnScreen() - 1; int cppXOffset = cppEditor->GetXOffset(); wxScintilla* hEditor = m_hPanel->GetTextCtrl(); hEditor->SetReadOnly( false ); int hLine = hEditor->GetFirstVisibleLine() + hEditor->LinesOnScreen() - 1; int hXOffset = hEditor->GetXOffset(); codegen.GenerateCode( project ); cppEditor->SetReadOnly( true ); cppEditor->GotoLine( cppLine ); cppEditor->SetXOffset( cppXOffset ); cppEditor->SetAnchor( 0 ); cppEditor->SetCurrentPos( 0 ); hEditor->SetReadOnly( true ); hEditor->GotoLine( hLine ); hEditor->SetXOffset( hXOffset ); hEditor->SetAnchor( 0 ); hEditor->SetCurrentPos( 0 ); Thaw(); } // Generate code in the file if ( doFile ) { try { CppCodeGenerator codegen; codegen.UseRelativePath( useRelativePath, path ); if ( pFirstID ) { codegen.SetFirstID( firstID ); } // Determin if Microsoft BOM should be used bool useMicrosoftBOM = false; PProperty pUseMicrosoftBOM = project->GetProperty( wxT( "use_microsoft_bom" ) ); if ( pUseMicrosoftBOM ) { useMicrosoftBOM = ( pUseMicrosoftBOM->GetValueAsInteger() != 0 ); } // Determine if Utf8 or Ansi is to be created bool useUtf8 = false; PProperty pUseUtf8 = project->GetProperty( _("encoding") ); if ( pUseUtf8 ) { useUtf8 = ( pUseUtf8->GetValueAsString() != wxT("ANSI") ); } PCodeWriter h_cw( new FileCodeWriter( path + file + wxT( ".h" ), useMicrosoftBOM, useUtf8 ) ); PCodeWriter cpp_cw( new FileCodeWriter( path + file + wxT( ".cpp" ), useMicrosoftBOM, useUtf8 ) ); codegen.SetHeaderWriter( h_cw ); codegen.SetSourceWriter( cpp_cw ); codegen.GenerateCode( project ); wxLogStatus( wxT( "Code generated on \'%s\'." ), path.c_str() ); // check if we have to convert to ANSI encoding if (project->GetPropertyAsString(wxT("encoding")) == wxT("ANSI")) { UTF8ToAnsi(path + file + wxT( ".h" )); UTF8ToAnsi(path + file + wxT( ".cpp" )); } } catch ( wxFBException& ex ) { wxLogError( ex.what() ); } } } wxformbuilder-3.1.59/src/rad/cpppanel/cpppanel.h0000644000175000017500000000404311143440026022062 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #ifndef __CPP_PANEL__ #define __CPP_PANEL__ #include #include "utils/wxfbdefs.h" class CodeEditor; class wxScintilla; class wxFlatNotebook; class wxFlatNotebookImageList; class wxFindDialogEvent; class wxFBEvent; class wxFBPropertyEvent; class wxFBObjectEvent; class wxFBEventHandlerEvent; class CppPanel : public wxPanel { private: CodeEditor* m_cppPanel; CodeEditor* m_hPanel; PTCCodeWriter m_hCW; PTCCodeWriter m_cppCW; wxFlatNotebookImageList* m_icons; wxFlatNotebook* m_notebook; void InitStyledTextCtrl( wxScintilla* stc ); public: CppPanel( wxWindow *parent, int id ); ~CppPanel(); void OnPropertyModified( wxFBPropertyEvent& event ); void OnProjectRefresh( wxFBEvent& event ); void OnCodeGeneration( wxFBEvent& event ); void OnObjectChange( wxFBObjectEvent& event ); void OnEventHandlerModified( wxFBEventHandlerEvent& event ); void OnFind( wxFindDialogEvent& event ); DECLARE_EVENT_TABLE() }; #endif //__CPP_PANEL__ wxformbuilder-3.1.59/src/rad/codeeditor/codeeditor.cpp0000644000175000017500000001170411143440026023255 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #include "codeeditor.h" #include #include #include BEGIN_EVENT_TABLE ( CodeEditor, wxPanel ) EVT_SCI_MARGINCLICK( wxID_ANY, CodeEditor::OnMarginClick ) EVT_FIND( wxID_ANY, CodeEditor::OnFind ) EVT_FIND_NEXT( wxID_ANY, CodeEditor::OnFind ) END_EVENT_TABLE() CodeEditor::CodeEditor( wxWindow *parent, int id ) : wxPanel( parent, id ) { wxBoxSizer *sizer = new wxBoxSizer( wxVERTICAL ); m_code = new wxScintilla( this, -1 ); // Line Numbers m_code->SetMarginType( 0, wxSCI_MARGIN_NUMBER ); m_code->SetMarginWidth( 0, m_code->TextWidth ( wxSCI_STYLE_LINENUMBER, wxT( "_99999" ) ) ); // markers m_code->MarkerDefine ( wxSCI_MARKNUM_FOLDER, wxSCI_MARK_BOXPLUS ); m_code->MarkerSetBackground ( wxSCI_MARKNUM_FOLDER, wxColour ( wxT( "BLACK" ) ) ); m_code->MarkerSetForeground ( wxSCI_MARKNUM_FOLDER, wxColour ( wxT( "WHITE" ) ) ); m_code->MarkerDefine ( wxSCI_MARKNUM_FOLDEROPEN, wxSCI_MARK_BOXMINUS ); m_code->MarkerSetBackground ( wxSCI_MARKNUM_FOLDEROPEN, wxColour ( wxT( "BLACK" ) ) ); m_code->MarkerSetForeground ( wxSCI_MARKNUM_FOLDEROPEN, wxColour ( wxT( "WHITE" ) ) ); m_code->MarkerDefine ( wxSCI_MARKNUM_FOLDERSUB, wxSCI_MARK_EMPTY ); m_code->MarkerDefine ( wxSCI_MARKNUM_FOLDEREND, wxSCI_MARK_BOXPLUS ); m_code->MarkerSetBackground ( wxSCI_MARKNUM_FOLDEREND, wxColour ( wxT( "BLACK" ) ) ); m_code->MarkerSetForeground ( wxSCI_MARKNUM_FOLDEREND, wxColour ( wxT( "WHITE" ) ) ); m_code->MarkerDefine ( wxSCI_MARKNUM_FOLDEROPENMID, wxSCI_MARK_BOXMINUS ); m_code->MarkerSetBackground ( wxSCI_MARKNUM_FOLDEROPENMID, wxColour ( wxT( "BLACK" ) ) ); m_code->MarkerSetForeground ( wxSCI_MARKNUM_FOLDEROPENMID, wxColour ( wxT( "WHITE" ) ) ); m_code->MarkerDefine ( wxSCI_MARKNUM_FOLDERMIDTAIL, wxSCI_MARK_EMPTY ); m_code->MarkerDefine ( wxSCI_MARKNUM_FOLDERTAIL, wxSCI_MARK_EMPTY ); // folding m_code->SetMarginType ( 1, wxSCI_MARGIN_SYMBOL ); m_code->SetMarginMask ( 1, wxSCI_MASK_FOLDERS ); m_code->SetMarginWidth ( 1, 16 ); m_code->SetMarginSensitive ( 1, true ); m_code->SetProperty( wxT( "fold" ), wxT( "1" ) ); m_code->SetProperty( wxT( "fold.comment" ), wxT( "1" ) ); m_code->SetProperty( wxT( "fold.compact" ), wxT( "1" ) ); m_code->SetProperty( wxT( "fold.preprocessor" ), wxT( "1" ) ); m_code->SetProperty( wxT( "fold.html" ), wxT( "1" ) ); m_code->SetProperty( wxT( "fold.html.preprocessor" ), wxT( "1" ) ); m_code->SetFoldFlags( wxSCI_FOLDFLAG_LINEBEFORE_CONTRACTED | wxSCI_FOLDFLAG_LINEAFTER_CONTRACTED ); m_code->SetIndentationGuides( true ); m_code->SetMarginWidth( 2, 0 ); sizer->Add( m_code, 1, wxEXPAND | wxALL ); SetSizer( sizer ); } void CodeEditor::OnMarginClick ( wxScintillaEvent &event ) { if ( event.GetMargin() == 1 ) { int lineClick = m_code->LineFromPosition ( event.GetPosition() ); int levelClick = m_code->GetFoldLevel ( lineClick ); if ( ( levelClick & wxSCI_FOLDLEVELHEADERFLAG ) > 0 ) { m_code->ToggleFold ( lineClick ); } } } wxScintilla* CodeEditor::GetTextCtrl() { return m_code; } void CodeEditor::OnFind( wxFindDialogEvent& event ) { int wxflags = event.GetFlags(); int sciflags = 0; if ( (wxflags & wxFR_WHOLEWORD) != 0 ) { sciflags |= wxSCI_FIND_WHOLEWORD; } if ( (wxflags & wxFR_MATCHCASE) != 0 ) { sciflags |= wxSCI_FIND_MATCHCASE; } int result; if ( (wxflags & wxFR_DOWN) != 0 ) { m_code->SetSelectionStart( m_code->GetSelectionEnd() ); m_code->SearchAnchor(); result = m_code->SearchNext( sciflags, event.GetFindString() ); } else { m_code->SetSelectionEnd( m_code->GetSelectionStart() ); m_code->SearchAnchor(); result = m_code->SearchPrev( sciflags, event.GetFindString() ); } if ( wxSCI_INVALID_POSITION == result ) { wxMessageBox( wxString::Format( _("\"%s\" not found!"), event.GetFindString().c_str() ), _("Not Found!"), wxICON_ERROR, (wxWindow*)event.GetClientData() ); } else { m_code->EnsureCaretVisible(); } } wxformbuilder-3.1.59/src/rad/codeeditor/codeeditor.h0000644000175000017500000000301311143440026022714 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #ifndef __CODE_EDITOR__ #define __CODE_EDITOR__ #include class wxScintilla; class wxScintillaEvent; class wxFindDialogEvent; class CodeEditor : public wxPanel { private: wxScintilla* m_code; void OnMarginClick( wxScintillaEvent& event ); DECLARE_EVENT_TABLE() public: CodeEditor( wxWindow *parent, int id ); wxScintilla* GetTextCtrl(); void OnFind( wxFindDialogEvent& event ); }; #endif //__CODE_EDITOR__ wxformbuilder-3.1.59/src/rad/designer/resizablepanel.h0000644000175000017500000000464011143440026023261 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #ifndef RESIZABLEPANEL_H #define RESIZABLEPANEL_H #include #ifdef __BORLANDC__ #pragma hdrstop #endif #ifndef WX_PRECOMP #include #endif #include class ResizablePanel : public wxPanel { enum{ NONE, RIGHTBOTTOM, RIGHT, BOTTOM } m_sizing; int m_curX, m_curY, m_difX, m_difY; int m_resizeBorder; wxSize m_minSize; public: ResizablePanel(wxWindow *parent, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL); void SetResizeBorder(int border); int GetResizeBorder(); void SetMinSize(const wxSize& size); wxSize GetMinSize(); void OnMouseMotion(wxMouseEvent& e); void OnLeftDown(wxMouseEvent& e); void OnSetCursor(wxSetCursorEvent& e); void OnLeftUp(wxMouseEvent& e); //void OnSize(wxSizeEvent& e); void OnPanelResized(wxSizeEvent &e); DECLARE_EVENT_TABLE() }; BEGIN_DECLARE_EVENT_TYPES() DECLARE_LOCAL_EVENT_TYPE(wxEVT_PANEL_RESIZED, 6000) END_DECLARE_EVENT_TYPES() #define EVT_PANEL_RESIZED(id, fn) \ DECLARE_EVENT_TABLE_ENTRY( \ wxEVT_PANEL_RESIZED, id, wxID_ANY, \ (wxObjectEventFunction)(wxEventFunction) wxStaticCastEvent( wxCommandEventFunction, &fn ), \ (wxObject *) NULL \ ), #endif wxformbuilder-3.1.59/src/rad/designer/window_buttons.h0000644000175000017500000001002111143440026023334 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// /* XPM */ static const char * minimize_xpm[] = { "17 15 6 1", " c None", ". c #FFFFFF", "+ c #404040", "@ c #D4D0C8", "# c #808080", "$ c #000000", "................+", ".@@@@@@@@@@@@@@#+", ".@@@@@@@@@@@@@@#+", ".@@@@@@@@@@@@@@#+", ".@@@@@@@@@@@@@@#+", ".@@@@@@@@@@@@@@#+", ".@@@@@@@@@@@@@@#+", ".@@@@@@@@@@@@@@#+", ".@@@@@@@@@@@@@@#+", ".@@@@@@@@@@@@@@#+", ".@@@$$$$$$$@@@@#+", ".@@@$$$$$$$@@@@#+", ".@@@@@@@@@@@@@@#+", ".###############+", "+++++++++++++++++"}; static const char * minimize_disabled_xpm[] = { "17 15 6 1", " c None", ". c #FFFFFF", "+ c #404040", "@ c #D4D0C8", "# c #808080", "$ c #A0A0A4", "................+", ".@@@@@@@@@@@@@@#+", ".@@@@@@@@@@@@@@#+", ".@@@@@@@@@@@@@@#+", ".@@@@@@@@@@@@@@#+", ".@@@@@@@@@@@@@@#+", ".@@@@@@@@@@@@@@#+", ".@@@@@@@@@@@@@@#+", ".@@@@@@@@@@@@@@#+", ".@@@@@@@@@@@@@@#+", ".@@@$$$$$$$@@@@#+", ".@@@$$$$$$$@@@@#+", ".@@@@@@@@@@@@@@#+", ".###############+", "+++++++++++++++++"}; static const char * maximize_xpm[] = { "18 15 6 1", " c None", ". c #FFFFFF", "+ c #404040", "@ c #D4D0C8", "# c #808080", "$ c #000000", " ................+", " .@@@@@@@@@@@@@@#+", " .@@@@@@@@@@@@@@#+", " .@@$$$$$$$$$@@@#+", " .@@$$$$$$$$$@@@#+", " .@@$@@@@@@@$@@@#+", " .@@$@@@@@@@$@@@#+", " .@@$@@@@@@@$@@@#+", " .@@$@@@@@@@$@@@#+", " .@@$@@@@@@@$@@@#+", " .@@$@@@@@@@$@@@#+", " .@@$$$$$$$$$@@@#+", " .@@@@@@@@@@@@@@#+", " .###############+", " +++++++++++++++++"}; static const char * maximize_disabled_xpm[] = { "18 15 6 1", " c None", ". c #FFFFFF", "+ c #404040", "@ c #D4D0C8", "# c #808080", "$ c #A0A0A4", " ................+", " .@@@@@@@@@@@@@@#+", " .@@@@@@@@@@@@@@#+", " .@@$$$$$$$$$@@@#+", " .@@$$$$$$$$$@@@#+", " .@@$@@@@@@@$@@@#+", " .@@$@@@@@@@$@@@#+", " .@@$@@@@@@@$@@@#+", " .@@$@@@@@@@$@@@#+", " .@@$@@@@@@@$@@@#+", " .@@$@@@@@@@$@@@#+", " .@@$$$$$$$$$@@@#+", " .@@@@@@@@@@@@@@#+", " .###############+", " +++++++++++++++++"}; static const char * close_xpm[] = { "18 15 6 1", " c None", ". c #FFFFFF", "+ c #404040", "@ c #D4D0C8", "# c #808080", "$ c #000000", " ................+", " .@@@@@@@@@@@@@@#+", " .@@@@@@@@@@@@@@#+", " .@@@$$@@@@$$@@@#+", " .@@@$$$@@$$$@@@#+", " .@@@@$$$$$$@@@@#+", " .@@@@@$$$$@@@@@#+", " .@@@@@$$$$@@@@@#+", " .@@@@$$$$$$@@@@#+", " .@@@$$$@@$$$@@@#+", " .@@@$$@@@@$$@@@#+", " .@@@@@@@@@@@@@@#+", " .@@@@@@@@@@@@@@#+", " .###############+", " +++++++++++++++++"}; static const char * close_disabled_xpm[] = { "18 15 6 1", " c None", ". c #FFFFFF", "+ c #404040", "@ c #D4D0C8", "# c #808080", "$ c #A0A0A4", " ................+", " .@@@@@@@@@@@@@@#+", " .@@@@@@@@@@@@@@#+", " .@@@$$@@@@$$@@@#+", " .@@@$$$@@$$$@@@#+", " .@@@@$$$$$$@@@@#+", " .@@@@@$$$$@@@@@#+", " .@@@@@$$$$@@@@@#+", " .@@@@$$$$$$@@@@#+", " .@@@$$$@@$$$@@@#+", " .@@@$$@@@@$$@@@#+", " .@@@@@@@@@@@@@@#+", " .@@@@@@@@@@@@@@#+", " .###############+", " +++++++++++++++++"}; wxformbuilder-3.1.59/src/rad/designer/visualobj.h0000644000175000017500000000330111143440026022250 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #ifndef __VISUAL_OBJS__ #define __VISUAL_OBJS__ #include "wx/wx.h" #include "utils/wxfbdefs.h" /** * Processes events from visual objects. */ class VObjEvtHandler : public wxEvtHandler { private: WPObjectBase m_object; wxWindow *m_window; VObjEvtHandler() {}; protected: DECLARE_EVENT_TABLE() public: VObjEvtHandler(wxWindow *win, PObjectBase obj); void OnLeftClick(wxMouseEvent &event); void OnPaint(wxPaintEvent &event); void OnSetCursor(wxSetCursorEvent &event); }; /////////////////////////////////////////////////////////////////////////////// #endif //__VISUAL_OBJS__ wxformbuilder-3.1.59/src/rad/designer/innerframe.cpp0000644000175000017500000003222011143440026022735 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #include "innerframe.h" #include "window_buttons.h" #include #include DEFINE_EVENT_TYPE( wxEVT_INNER_FRAME_RESIZED ) class wxInnerFrame::TitleBar : public wxPanel { private: DECLARE_EVENT_TABLE() void DrawTitleBar ( wxDC &dc ); wxBitmap m_minimize; wxBitmap m_minimizeDisabled; wxBitmap m_maximize; wxBitmap m_maximizeDisabled; wxBitmap m_close; wxBitmap m_closeDisabled; wxColour m_colour1, m_colour2; wxString m_titleText; long m_style; protected: wxSize DoGetBestSize() const { return wxSize( 100, 19 ); } public: TitleBar ( wxWindow *parent, wxWindowID id, const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, long style = 0 ); void OnPaint( wxPaintEvent &event ); void OnSize( wxSizeEvent &event ); void OnLeftClick ( wxMouseEvent &event ); void SetTitle( const wxString &title ) { m_titleText = title; } wxString GetTitle() { return m_titleText; } void SetStyle( long style ) { m_style = style; } }; BEGIN_EVENT_TABLE( wxInnerFrame::TitleBar, wxPanel ) EVT_LEFT_DOWN( wxInnerFrame::TitleBar::OnLeftClick ) EVT_PAINT( wxInnerFrame::TitleBar::OnPaint ) EVT_SIZE( wxInnerFrame::TitleBar::OnSize ) END_EVENT_TABLE() wxInnerFrame::TitleBar::TitleBar ( wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, long style ) : wxPanel( parent, id, pos, size, 0/*wxFULL_REPAINT_ON_RESIZE*/ ), m_minimize( minimize_xpm ), m_minimizeDisabled( minimize_disabled_xpm ), m_maximize( maximize_xpm ), m_maximizeDisabled( maximize_disabled_xpm ), m_close( close_xpm ), m_closeDisabled( close_disabled_xpm ), m_style( style ) { //m_colour1 = wxColour(10,36,106); //m_colour2 = wxColour(166,202,240); m_colour1 = wxSystemSettings::GetColour( wxSYS_COLOUR_ACTIVECAPTION ); int r, g, b; r = wxMin( 255, m_colour1.Red() + 30 ); g = wxMin( 255, m_colour1.Green() + 30 ); b = wxMin( 255, m_colour1.Blue() + 30 ); m_colour2 = wxColour( r, g, b ); m_titleText = wxT( "wxFormBuilder rocks!" ); SetMinSize( wxSize( 100, 19 ) ); } void wxInnerFrame::TitleBar::OnLeftClick ( wxMouseEvent &event ) { GetParent()->GetEventHandler()->ProcessEvent( event ); } void wxInnerFrame::TitleBar::OnSize ( wxSizeEvent& ) { wxClientDC dc( this ); wxBufferedDC bdc( &dc, GetClientSize() ); DrawTitleBar( bdc ); } void wxInnerFrame::TitleBar::OnPaint ( wxPaintEvent& ) { wxPaintDC dc( this ); wxBufferedDC bdc( &dc, GetClientSize() ); DrawTitleBar( bdc ); } void wxInnerFrame::TitleBar::DrawTitleBar( wxDC &dc ) { static const int margin = 2; int tbPosX, tbPosY; // title bar int tbWidth, tbHeight; int wbPosX, wbPosY; // window buttons int wbWidth, wbHeight; int txtPosX, txtPosY; // title text position int txtWidth, txtHeight; // setup all variables wxSize clientSize( GetClientSize() ); //wxSize clientSize(500,100); tbPosX = tbPosY = 0; tbHeight = m_close.GetHeight() + margin * 2; tbWidth = clientSize.GetWidth(); wbHeight = m_close.GetHeight(); wbWidth = m_close.GetWidth(); wbPosX = tbPosX + tbWidth - wbWidth - 2 * margin; wbPosY = tbPosX + margin; txtPosY = tbPosY + margin; txtPosX = tbPosX + 15 + 2 * margin; txtHeight = tbHeight - 2 * margin + 1; txtWidth = wbPosX - 2 * margin - txtPosX; // Draw title background with vertical gradient. float incR = ( float )( m_colour2.Red() - m_colour1.Red() ) / tbWidth; float incG = ( float )( m_colour2.Green() - m_colour1.Green() ) / tbWidth; float incB = ( float )( m_colour2.Blue() - m_colour1.Blue() ) / tbWidth; float colourR = m_colour1.Red(); float colourG = m_colour1.Green(); float colourB = m_colour1.Blue(); wxColour colour; wxPen pen; for ( int i = 0; i < tbWidth; i++ ) { colour.Set( ( unsigned char )colourR, ( unsigned char )colourG, ( unsigned char )colourB ); pen.SetColour( colour ); dc.SetPen( pen ); dc.DrawLine( tbPosX + i, tbPosY, tbPosX + i, tbPosY + tbHeight ); colourR += incR; colourG += incG; colourB += incB; } // Draw title background with horizontal gradient. /*float incR = (float)(m_colour2.Red() - m_colour1.Red()) / tbHeight; float incG = (float)(m_colour2.Green() - m_colour1.Green()) / tbHeight; float incB = (float)(m_colour2.Blue() - m_colour1.Blue()) / tbHeight; float colourR = m_colour1.Red(); float colourG = m_colour1.Green(); float colourB = m_colour1.Blue(); wxColour colour; wxPen pen; for (int i=0; i txtHeight ); dc.DrawLabel( m_titleText, wxRect( txtPosX, txtPosY, tw, th ) ); // Draw Buttons bool hasClose = ( m_style & wxCLOSE_BOX ) != 0; bool hasMinimize = ( m_style & wxMINIMIZE_BOX ) != 0; bool hasMaximize = ( m_style & wxMAXIMIZE_BOX ) != 0; #ifdef __WXMSW__ if ( ( m_style & wxSYSTEM_MENU ) == 0 ) { // On Windows, no buttons are drawn without System Menu return; } dc.DrawBitmap( hasClose ? m_close : m_closeDisabled, wbPosX, wbPosY, true ); wbPosX -= m_close.GetWidth(); if ( hasMaximize ) { dc.DrawBitmap( m_maximize, wbPosX, wbPosY, true ); } else if ( hasMinimize ) { dc.DrawBitmap( m_maximizeDisabled, wbPosX, wbPosY, true ); } wbPosX -= m_maximize.GetWidth(); if ( hasMinimize ) { dc.DrawBitmap( m_minimize, wbPosX, wbPosY, true ); } else if ( hasMaximize ) { dc.DrawBitmap( m_minimizeDisabled, wbPosX, wbPosY, true ); } #else // GTK if ( hasClose ) { dc.DrawBitmap( m_close, wbPosX, wbPosY, true ); wbPosX -= m_close.GetWidth(); } bool hasResizeBorder = ( m_style & wxRESIZE_BORDER ) != 0; if ( hasMaximize && hasResizeBorder ) { dc.DrawBitmap( m_maximize, wbPosX, wbPosY, true ); wbPosX -= m_maximize.GetWidth(); } if ( hasMinimize ) { dc.DrawBitmap( m_minimize, wbPosX, wbPosY, true ); } #endif } ////////////////////////////////////////////////////////////////////////////// BEGIN_EVENT_TABLE( wxInnerFrame, wxPanel ) EVT_MOTION( wxInnerFrame::OnMouseMotion ) EVT_LEFT_DOWN( wxInnerFrame::OnLeftDown ) EVT_LEFT_UP( wxInnerFrame::OnLeftUp ) END_EVENT_TABLE() wxInnerFrame::wxInnerFrame( wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, long style ) : wxPanel( parent, id, pos, size, wxRAISED_BORDER | wxFULL_REPAINT_ON_RESIZE ) { m_sizing = NONE; m_curX = m_curY = -1; m_resizeBorder = 10; m_titleBar = new TitleBar( this, -1, wxDefaultPosition, wxDefaultSize, style ); m_frameContent = new wxPanel( this, -1, wxDefaultPosition, wxDefaultSize ); // Use spacers to create a 1 pixel border on left and top of content panel - this is for drawing the selection box // Use borders to create a 2 pixel border on right and bottom - this is so the back panel can catch mouse events for resizing wxBoxSizer *sizer = new wxBoxSizer( wxVERTICAL ); sizer->Add( m_titleBar, 0, wxGROW | wxRIGHT, 2 ); sizer->AddSpacer( 1 ); wxBoxSizer *horiSizer = new wxBoxSizer( wxHORIZONTAL ); horiSizer->AddSpacer( 1 ); horiSizer->Add( m_frameContent, 1, wxGROW ); sizer->Add( horiSizer, 1, wxGROW | wxBOTTOM | wxRIGHT, 2 ); SetSizer( sizer ); SetAutoLayout( true ); Layout(); m_minSize = m_titleBar->GetMinSize(); m_minSize.x += 8; m_minSize.y += 10; m_baseMinSize = m_minSize; if ( wxDefaultSize == size ) { SetSize( GetBestSize() ); } } wxSize wxInnerFrame::DoGetBestSize() const { wxSize best; best = m_titleBar->GetBestSize(); wxSize content = m_frameContent->GetBestSize(); best.IncBy( 0, content.GetHeight() ); int border = wxSystemSettings::GetMetric( wxSYS_BORDER_X ); best.SetWidth( ( content.GetWidth() + 1 > best.GetWidth() ? content.GetWidth() + 1 : best.GetWidth() ) + 2 + 2 * ( border > 0 ? border : 2 ) ); // spacers and borders best.IncBy( 0, 3 ); return best; } void wxInnerFrame::OnMouseMotion( wxMouseEvent& e ) { if ( m_sizing != NONE ) { wxScreenDC dc; wxPen pen( *wxBLACK, 1, wxDOT ); dc.SetPen( pen ); dc.SetBrush( *wxTRANSPARENT_BRUSH ); dc.SetLogicalFunction( wxINVERT ); //wxPoint pos = ClientToScreen(wxPoint(0, 0)); wxPoint pos = GetParent()->ClientToScreen( GetPosition() ); if ( m_curX >= 0 && m_curY >= 0 ) dc.DrawRectangle( pos.x, pos.y, m_curX, m_curY ); if ( m_sizing == RIGHT || m_sizing == RIGHTBOTTOM ) m_curX = e.GetX() + m_difX; else m_curX = GetSize().x; if ( m_sizing == BOTTOM || m_sizing == RIGHTBOTTOM ) m_curY = e.GetY() + m_difY; else m_curY = GetSize().y; // User min size wxSize minSize = GetMinSize(); if ( m_curX < minSize.x ) m_curX = minSize.x; if ( m_curY < minSize.y ) m_curY = minSize.y; // Internal min size if ( m_curX < m_minSize.x ) m_curX = m_minSize.x; if ( m_curY < m_minSize.y ) m_curY = m_minSize.y; wxSize maxSize = GetMaxSize(); if ( m_curX > maxSize.x && maxSize.x != wxDefaultCoord ) m_curX = maxSize.x; if ( m_curY > maxSize.y && maxSize.y != wxDefaultCoord ) m_curY = maxSize.y; dc.DrawRectangle( pos.x, pos.y, m_curX, m_curY ); dc.SetLogicalFunction( wxCOPY ); dc.SetPen( wxNullPen ); dc.SetBrush( wxNullBrush ); } else { int x, y; GetClientSize( &x, &y ); if ( ( e.GetX() >= x - m_resizeBorder && e.GetY() >= y - m_resizeBorder ) || ( e.GetX() < m_resizeBorder && e.GetY() < m_resizeBorder ) ) { SetCursor( wxCursor( wxCURSOR_SIZENWSE ) ); } else if ( ( e.GetX() < m_resizeBorder && e.GetY() >= y - m_resizeBorder ) || ( e.GetX() > x - m_resizeBorder && e.GetY() < m_resizeBorder ) ) { SetCursor( wxCursor( wxCURSOR_SIZENESW ) ); } else if ( e.GetX() >= x - m_resizeBorder || e.GetX() < m_resizeBorder ) { SetCursor( wxCursor( wxCURSOR_SIZEWE ) ); } else if ( e.GetY() >= y - m_resizeBorder || e.GetY() < m_resizeBorder ) { SetCursor( wxCursor( wxCURSOR_SIZENS ) ); } else { SetCursor( *wxSTANDARD_CURSOR ); } m_titleBar->SetCursor( *wxSTANDARD_CURSOR ); m_frameContent->SetCursor( *wxSTANDARD_CURSOR ); } } void wxInnerFrame::OnLeftDown( wxMouseEvent& e ) { if ( m_sizing == NONE ) { if ( e.GetX() >= GetSize().x - m_resizeBorder && e.GetY() >= GetSize().y - m_resizeBorder ) m_sizing = RIGHTBOTTOM; else if ( e.GetX() >= GetSize().x - m_resizeBorder ) m_sizing = RIGHT; else if ( e.GetY() >= GetSize().y - m_resizeBorder ) m_sizing = BOTTOM; if ( m_sizing != NONE ) { m_difX = GetSize().x - e.GetX(); m_difY = GetSize().y - e.GetY(); CaptureMouse(); OnMouseMotion( e ); } } } void wxInnerFrame::OnLeftUp( wxMouseEvent& ) { if ( m_sizing != NONE ) { m_sizing = NONE; ReleaseMouse(); wxScreenDC dc; wxPen pen( *wxBLACK, 1, wxDOT ); dc.SetPen( pen ); dc.SetBrush( *wxTRANSPARENT_BRUSH ); dc.SetLogicalFunction( wxINVERT ); //wxPoint pos = ClientToScreen(wxPoint(0, 0)); wxPoint pos = GetParent()->ClientToScreen( GetPosition() ); dc.DrawRectangle( pos.x, pos.y, m_curX, m_curY ); dc.SetLogicalFunction( wxCOPY ); dc.SetPen( wxNullPen ); dc.SetBrush( wxNullBrush ); SetSize( m_curX, m_curY ); wxCommandEvent event( wxEVT_INNER_FRAME_RESIZED, GetId() ); event.SetEventObject( this ); GetEventHandler()->ProcessEvent( event ); m_curX = m_curY = -1; } } void wxInnerFrame::ShowTitleBar( bool show ) { m_titleBar->Show( show ); m_minSize = ( show ? m_baseMinSize : wxSize( 10, 10 ) ); Layout(); } void wxInnerFrame::SetToBaseSize() { if ( m_titleBar->IsShown() ) { SetSize( m_baseMinSize ); } else { SetSize( wxSize( 10, 10 ) ); } } bool wxInnerFrame::IsTitleBarShown() { return m_titleBar->IsShown(); } void wxInnerFrame::SetTitle( const wxString &title ) { m_titleBar->SetTitle( title ); } wxString wxInnerFrame::GetTitle() { return m_titleBar->GetTitle(); } void wxInnerFrame::SetTitleStyle( long style ) { m_titleBar->SetStyle( style ); } wxformbuilder-3.1.59/src/rad/designer/innerframe.h0000644000175000017500000000476111143440026022413 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #ifndef __INNER_FRAME__ #define __INNER_FRAME__ #include class wxInnerFrame : public wxPanel { private: DECLARE_EVENT_TABLE() enum{ NONE, RIGHTBOTTOM, RIGHT, BOTTOM } m_sizing; int m_curX, m_curY, m_difX, m_difY; int m_resizeBorder; wxSize m_minSize; wxSize m_baseMinSize; class TitleBar; TitleBar *m_titleBar; wxPanel *m_frameContent; protected: wxSize DoGetBestSize() const; public: wxInnerFrame(wxWindow *parent, wxWindowID id, const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, long style = 0); wxPanel *GetFrameContentPanel() { return m_frameContent; } void OnMouseMotion(wxMouseEvent& e); void OnLeftDown(wxMouseEvent& e); void OnLeftUp(wxMouseEvent& e); void SetTitle(const wxString &title); wxString GetTitle(); void SetTitleStyle( long style ); void ShowTitleBar(bool show = true); void SetToBaseSize(); bool IsTitleBarShown(); }; BEGIN_DECLARE_EVENT_TYPES() DECLARE_LOCAL_EVENT_TYPE(wxEVT_INNER_FRAME_RESIZED, 6000) END_DECLARE_EVENT_TYPES() #define EVT_INNER_FRAME_RESIZED(id, fn) \ DECLARE_EVENT_TABLE_ENTRY( \ wxEVT_INNER_FRAME_RESIZED, id, wxID_ANY, \ (wxObjectEventFunction)(wxEventFunction) wxStaticCastEvent( wxCommandEventFunction, &fn ), \ (wxObject *) NULL \ ), #endif //__INNER_FRAME__ wxformbuilder-3.1.59/src/rad/designer/resizablepanel.cpp0000644000175000017500000001201611143440026023610 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #include "resizablepanel.h" DEFINE_EVENT_TYPE(wxEVT_PANEL_RESIZED) BEGIN_EVENT_TABLE(ResizablePanel, wxPanel) EVT_SET_CURSOR(ResizablePanel::OnSetCursor) EVT_LEFT_DOWN(ResizablePanel::OnLeftDown) EVT_LEFT_UP(ResizablePanel::OnLeftUp) EVT_MOTION(ResizablePanel::OnMouseMotion) //EVT_SIZE(ResizablePanel::OnSize) END_EVENT_TABLE() ResizablePanel::ResizablePanel(wxWindow *parent, const wxPoint& pos, const wxSize& size, long style) : wxPanel(parent, -1, pos, size, style) { m_sizing = NONE; m_curX = m_curY = -1; m_minSize = wxSize(10, 10); m_resizeBorder = 10; } void ResizablePanel::SetResizeBorder(int border) { wxASSERT(border > 0); m_resizeBorder = border; } int ResizablePanel::GetResizeBorder() { return m_resizeBorder; } void ResizablePanel::SetMinSize(const wxSize& size) { m_minSize = size; } wxSize ResizablePanel::GetMinSize() { return m_minSize; } void ResizablePanel::OnSetCursor(wxSetCursorEvent& e) { if (e.GetX() >= GetSize().x - m_resizeBorder && e.GetY() >= GetSize().y - m_resizeBorder) e.SetCursor(wxCursor(wxCURSOR_SIZENWSE)); else if (e.GetX() >= GetSize().x - m_resizeBorder) e.SetCursor(wxCursor(wxCURSOR_SIZEWE)); else if (e.GetY() >= GetSize().y - m_resizeBorder) e.SetCursor(wxCursor(wxCURSOR_SIZENS)); else e.SetCursor(*wxSTANDARD_CURSOR); } void ResizablePanel::OnMouseMotion(wxMouseEvent& e) { if (m_sizing != NONE) { wxScreenDC dc; wxPen pen(*wxBLACK, 1, wxDOT); dc.SetPen(pen); dc.SetBrush(*wxTRANSPARENT_BRUSH); dc.SetLogicalFunction(wxINVERT); //wxPoint pos = ClientToScreen(wxPoint(0, 0)); wxPoint pos = GetParent()->ClientToScreen(GetPosition()); if (m_curX >= 0 && m_curY >= 0) dc.DrawRectangle(pos.x, pos.y, m_curX, m_curY); if (m_sizing == RIGHT || m_sizing == RIGHTBOTTOM) m_curX = e.GetX() + m_difX; else m_curX = GetSize().x; if (m_sizing == BOTTOM || m_sizing == RIGHTBOTTOM) m_curY = e.GetY() + m_difY; else m_curY = GetSize().y; if (m_curX < m_minSize.x) m_curX = m_minSize.x; if (m_curY < m_minSize.y) m_curY = m_minSize.y; dc.DrawRectangle(pos.x, pos.y, m_curX, m_curY); dc.SetLogicalFunction(wxCOPY); dc.SetPen(wxNullPen); dc.SetBrush(wxNullBrush); } } void ResizablePanel::OnLeftDown(wxMouseEvent& e) { if (m_sizing == NONE) { if (e.GetX() >= GetSize().x - m_resizeBorder && e.GetY() >= GetSize().y - m_resizeBorder) m_sizing = RIGHTBOTTOM; else if (e.GetX() >= GetSize().x - m_resizeBorder) m_sizing = RIGHT; else if (e.GetY() >= GetSize().y - m_resizeBorder) m_sizing = BOTTOM; if (m_sizing != NONE) { m_difX = GetSize().x - e.GetX(); m_difY = GetSize().y - e.GetY(); CaptureMouse(); OnMouseMotion(e); } } } void ResizablePanel::OnLeftUp(wxMouseEvent& ) { if (m_sizing != NONE) { m_sizing = NONE; ReleaseMouse(); wxScreenDC dc; wxPen pen(*wxBLACK, 1, wxDOT); dc.SetPen(pen); dc.SetBrush(*wxTRANSPARENT_BRUSH); dc.SetLogicalFunction(wxINVERT); //wxPoint pos = ClientToScreen(wxPoint(0, 0)); wxPoint pos = GetParent()->ClientToScreen(GetPosition()); dc.DrawRectangle(pos.x, pos.y, m_curX, m_curY); dc.SetLogicalFunction(wxCOPY); dc.SetPen(wxNullPen); dc.SetBrush(wxNullBrush); SetSize(m_curX, m_curY); wxCommandEvent event(wxEVT_PANEL_RESIZED, GetId()); event.SetEventObject(this); GetEventHandler()->ProcessEvent(event); m_curX = m_curY = -1; } } /* // Cuando cambie de tamaño el panel no interesa que se genere el evento // Resized. Si el panel cambiaba de tamaño por un SetSize (p.e. cuando estaba // el tamaño por defecto) se actualizaba la propiedad size del form. // void ResizablePanel::OnSize(wxSizeEvent& e) { wxCommandEvent event(wxEVT_PANEL_RESIZED, GetId()); event.SetEventObject(this); GetEventHandler()->ProcessEvent(event); } */ wxformbuilder-3.1.59/src/rad/designer/menubar.h0000644000175000017500000000374311143440026021715 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #ifndef __MENUBAR__ #define __MENUBAR__ #include "wx/wx.h" #include typedef std::vector MenuVector; class Menubar : public wxPanel { public: Menubar(); Menubar(wxWindow *parent, int id, const wxPoint& pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, long style = 0, const wxString &name = wxT("fbmenubar")); ~Menubar(); void AppendMenu(const wxString& name, wxMenu *menu); wxMenu* GetMenu(int i); int GetMenuCount(); wxMenu* Remove(int i); private: MenuVector m_menus; wxBoxSizer *m_sizer; }; class MenuEvtHandler : public wxEvtHandler { public: MenuEvtHandler(wxStaticText *st, wxMenu *menu); void OnMouseEvent(wxMouseEvent& event); DECLARE_EVENT_TABLE() private: wxStaticText *m_label; wxMenu *m_menu; }; #endif wxformbuilder-3.1.59/src/rad/designer/menubar.cpp0000644000175000017500000000631211143440026022243 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #include "menubar.h" #include "wx/debug.h" Menubar::Menubar() : wxPanel() { m_sizer = NULL; } Menubar::Menubar(wxWindow *parent, int id, const wxPoint& pos, const wxSize &size, long style, const wxString &name) : wxPanel(parent, id, pos, size, style, name) { wxBoxSizer *mainSizer = new wxBoxSizer(wxVERTICAL); m_sizer = new wxBoxSizer(wxHORIZONTAL); m_sizer->Add(new wxStaticText(this, -1, wxT(" ")), 0, wxRIGHT | wxLEFT, 0); mainSizer->Add(m_sizer, 1, wxTOP | wxBOTTOM, 3); SetSizer(mainSizer); SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE)); } Menubar::~Menubar() { while (!m_menus.empty()) { wxMenu *menu = m_menus[0]; delete menu; m_menus.erase(m_menus.begin()); } // Delete spawned event handlers wxSizerItemList& labels = m_sizer->GetChildren(); for ( wxSizerItemList::iterator label = labels.begin(); label != labels.end(); ++label ) { wxStaticText* text = dynamic_cast< wxStaticText* >( (*label)->GetWindow() ); if ( text != 0 ) { if ( text->GetEventHandler() != text ) { text->PopEventHandler( true ); } } } } void Menubar::AppendMenu(const wxString& name, wxMenu *menu) { wxStaticText *st = new wxStaticText(this, -1, name); st->PushEventHandler(new MenuEvtHandler(st, menu)); m_sizer->Add(st, 0, wxALIGN_LEFT | wxRIGHT | wxLEFT, 5); Layout(); m_menus.push_back(menu); } wxMenu* Menubar::GetMenu(int i) { wxASSERT(i < int(m_menus.size())); return m_menus[i]; } int Menubar::GetMenuCount() { return (unsigned int)m_menus.size(); } wxMenu* Menubar::Remove(int /*i*/) { return NULL; //TODO: Implementar Menubar::Remove } BEGIN_EVENT_TABLE(MenuEvtHandler, wxEvtHandler) EVT_LEFT_DOWN(MenuEvtHandler::OnMouseEvent) END_EVENT_TABLE() MenuEvtHandler::MenuEvtHandler(wxStaticText *st, wxMenu *menu) { wxASSERT(menu != NULL && st != NULL); m_label = st; m_menu = menu; } void MenuEvtHandler::OnMouseEvent(wxMouseEvent& ) { m_label->PopupMenu(m_menu, 0, m_label->GetSize().y + 3); } wxformbuilder-3.1.59/src/rad/designer/visualeditor.cpp0000644000175000017500000006607511143440026023340 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #include "visualeditor.h" #include "visualeditor.h" #include "visualobj.h" #include "utils/typeconv.h" #include "utils/debug.h" #include "menubar.h" #include "wx/statline.h" #include "rad/designer/resizablepanel.h" #include "rad/wxfbevent.h" #include #include "utils/wxfbexception.h" #include "model/objectbase.h" #ifdef __WX24__ #define wxFULL_REPAINT_ON_RESIZE 0 #endif BEGIN_EVENT_TABLE(VisualEditor,wxScrolledWindow) //EVT_SASH_DRAGGED(-1, VisualEditor::OnResizeBackPanel) //EVT_COMMAND(-1, wxEVT_PANEL_RESIZED, VisualEditor::OnResizeBackPanel) EVT_INNER_FRAME_RESIZED(-1, VisualEditor::OnResizeBackPanel) EVT_FB_PROJECT_LOADED( VisualEditor::OnProjectLoaded ) EVT_FB_PROJECT_SAVED( VisualEditor::OnProjectSaved ) EVT_FB_OBJECT_SELECTED( VisualEditor::OnObjectSelected ) EVT_FB_OBJECT_CREATED( VisualEditor::OnObjectCreated ) EVT_FB_OBJECT_REMOVED( VisualEditor::OnObjectRemoved ) EVT_FB_PROPERTY_MODIFIED( VisualEditor::OnPropertyModified ) EVT_FB_PROJECT_REFRESH( VisualEditor::OnProjectRefresh ) END_EVENT_TABLE() VisualEditor::VisualEditor(wxWindow *parent) : wxScrolledWindow(parent,-1,wxDefaultPosition,wxDefaultSize,wxSUNKEN_BORDER), m_stopSelectedEvent( false ), m_stopModifiedEvent( false ) { AppData()->AddHandler( this->GetEventHandler() ); #ifdef __WXMSW__ SetOwnBackgroundColour(wxColour(150,150,150)); #else SetOwnBackgroundColour(wxColour(192,192,192)); #endif SetScrollRate(5, 5); m_back = new DesignerWindow( this, wxID_ANY, wxPoint(10,10) ); m_back->GetEventHandler()->Connect( wxID_ANY, wxEVT_LEFT_DOWN, wxMouseEventHandler( VisualEditor::OnClickBackPanel ), NULL, this ); } void VisualEditor::DeleteAbstractObjects() { wxObjectMap::iterator it; for ( it = m_wxobjects.begin(); it != m_wxobjects.end(); ++it ) { // The abstract objects are stored as wxNoObject*'s wxNoObject* noobject = dynamic_cast< wxNoObject* >( it->first ); if ( noobject != 0 ) { delete noobject; } else { // Delete push'd visual object event handlers wxWindow* window = dynamic_cast< wxWindow* > ( it->first ); if ( window != 0 ) { window->PopEventHandler( true ); } } } } VisualEditor::~VisualEditor() { AppData()->RemoveHandler( this->GetEventHandler() ); DeleteAbstractObjects(); ClearComponents( m_back->GetFrameContentPanel() ); } void VisualEditor::UpdateVirtualSize() { int w, h, panelW, panelH; GetVirtualSize(&w, &h); m_back->GetSize(&panelW, &panelH); panelW += 20; panelH += 20; if (panelW != w || panelH != h) SetVirtualSize(panelW, panelH); } void VisualEditor::OnClickBackPanel( wxMouseEvent& event ) { if ( m_form ) { AppData()->SelectObject(m_form); } event.Skip(); } void VisualEditor::OnResizeBackPanel (wxCommandEvent &) //(wxSashEvent &event) { /*wxRect rect(event.GetDragRect()); Debug::Print("VisualEditor::OnResizeBackPanel [%d,%d,%d,%d]",rect.x,rect.y,rect.width, rect.height); m_back->SetSize(rect.width,rect.height); m_back->Layout();*/ PObjectBase form (AppData()->GetSelectedForm()); if (form) { PProperty prop(form->GetProperty( wxT("size") )); if (prop) { wxString value(TypeConv::PointToString(wxPoint(m_back->GetSize().x, m_back->GetSize().y))); AppData()->ModifyProperty(prop, value); } } //event.Skip(); } PObjectBase VisualEditor::GetObjectBase( wxObject* wxobject ) { if ( NULL == wxobject ) { wxLogError( _("wxObject was NULL!") ); return PObjectBase(); } wxObjectMap::iterator obj = m_wxobjects.find( wxobject ); if ( obj != m_wxobjects.end() ) { return obj->second; } else { wxLogError( _("No corresponding ObjectBase for wxObject. Name: %s"), wxobject->GetClassInfo()->GetClassName() ); return PObjectBase(); } } wxObject* VisualEditor::GetWxObject( PObjectBase baseobject ) { if ( !baseobject ) { wxLogError( _("baseobject was NULL!") ); return NULL; } ObjectBaseMap::iterator obj = m_baseobjects.find( baseobject.get() ); if ( obj != m_baseobjects.end() ) { return obj->second; } else { wxLogError( _("No corresponding wxObject for ObjectBase. Name: %s"), baseobject->GetClassName().c_str() ); return NULL; } } void VisualEditor::ClearComponents( wxWindow* parent ) { wxLogNull stopTheLogging; const wxWindowList& children = parent->GetChildren(); for ( wxWindowList::const_reverse_iterator child = children.rbegin(); child != children.rend(); ++child ) { ClearComponents( *child ); PObjectBase obj = GetObjectBase( *child ); if ( obj ) { PObjectInfo obj_info = obj->GetObjectInfo(); IComponent* comp = obj_info->GetComponent(); if ( comp ) { comp->Cleanup( *child ); } } } } /** * Crea la vista preliminar borrando la previa. */ void VisualEditor::Create() { if ( IsShown() ) { Freeze(); // Prevent flickering } // Delete objects which had no parent DeleteAbstractObjects(); // Clear selections, delete objects m_back->SetSelectedItem(NULL); m_back->SetSelectedSizer(NULL); m_back->SetSelectedObject(PObjectBase()); ClearComponents( m_back->GetFrameContentPanel() ); m_back->GetFrameContentPanel()->DestroyChildren(); m_back->GetFrameContentPanel()->SetSizer( NULL ); // *!* // Clear all associations between ObjectBase and wxObjects m_wxobjects.clear(); m_baseobjects.clear(); m_form = AppData()->GetSelectedForm(); if ( m_form ) { m_back->Show(true); // --- [1] Configure the size of the form --------------------------- // Get size properties wxSize minSize( m_form->GetPropertyAsSize( wxT("minimum_size") ) ); m_back->SetMinSize( minSize ); wxSize maxSize( m_form->GetPropertyAsSize( wxT("maximum_size") ) ); m_back->SetMaxSize( maxSize ); wxSize size( m_form->GetPropertyAsSize( wxT("size") ) ); // Determine necessary size for back panel wxSize backSize = size; if ( backSize.GetWidth() < minSize.GetWidth() && backSize.GetWidth() != wxDefaultCoord ) { backSize.SetWidth( minSize.GetWidth() ); } if ( backSize.GetHeight() < minSize.GetHeight() && backSize.GetHeight() != wxDefaultCoord ) { backSize.SetHeight( minSize.GetHeight() ); } if ( backSize.GetWidth() > maxSize.GetWidth() && maxSize.GetWidth() != wxDefaultCoord ) { backSize.SetWidth( maxSize.GetWidth() ); } if ( backSize.GetHeight() > maxSize.GetHeight() && maxSize.GetHeight() != wxDefaultCoord ) { backSize.SetHeight( maxSize.GetHeight() ); } // Modify size property to match if ( size != backSize ) { PProperty psize = m_form->GetProperty( wxT("size") ); if ( psize ) { AppData()->ModifyProperty( psize, TypeConv::SizeToString( backSize ) ); } } // --- [2] Set the color of the form ------------------------------- PProperty background( m_form->GetProperty( wxT("bg") ) ); if ( background && !background->GetValue().empty() ) { m_back->GetFrameContentPanel()->SetBackgroundColour( TypeConv::StringToColour( background->GetValue() ) ); } else { if ( m_form->GetClassName() == wxT("Frame") ) { m_back->GetFrameContentPanel()->SetOwnBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_APPWORKSPACE ) ); } else { m_back->GetFrameContentPanel()->SetOwnBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ) ); } } // --- [3] Title bar Setup if ( m_form->GetClassName() == wxT("Frame") || m_form->GetClassName() == wxT("Dialog") ) { m_back->SetTitle( m_form->GetPropertyAsString( wxT("title") ) ); long style = m_form->GetPropertyAsInteger( wxT("style") ); m_back->SetTitleStyle( style ); m_back->ShowTitleBar( (style & wxCAPTION) != 0 ); } else m_back->ShowTitleBar(false); // --- [4] Create the components of the form ------------------------- // Used to save frame objects for later display PObjectBase menubar; wxWindow* statusbar = NULL; wxWindow* toolbar = NULL; for ( unsigned int i = 0; i < m_form->GetChildCount(); i++ ) { PObjectBase child = m_form->GetChild( i ); if (child->GetObjectTypeName() == wxT("menubar") ) { // Create the menubar later menubar = child; } else { // Recursively generate the ObjectTree try { // we have to put the content frame panel as parentObject in order // to SetSizeHints be called. Generate( child, m_back->GetFrameContentPanel(), m_back->GetFrameContentPanel() ); } catch ( wxFBException& ex ) { wxLogError ( ex.what() ); } } // Attach the status bar (if any) to the frame if ( child->GetClassName() == wxT("wxStatusBar") ) { ObjectBaseMap::iterator it = m_baseobjects.find( child.get() ); statusbar = wxDynamicCast( it->second, wxStatusBar ); } // Attach the toolbar (if any) to the frame if (child->GetClassName() == wxT("wxToolBar") ) { ObjectBaseMap::iterator it = m_baseobjects.find( child.get() ); toolbar = wxDynamicCast( it->second, wxToolBar ); } } if ( menubar || statusbar || toolbar ) { m_back->SetFrameWidgets( menubar, toolbar, statusbar ); } m_back->Layout(); if ( backSize.GetHeight() == wxDefaultCoord || backSize.GetWidth() == wxDefaultCoord ) { m_back->GetSizer()->Fit( m_back ); m_back->SetSize( m_back->GetBestSize() ); } // Set size after fitting so if only one dimesion is -1, it still fits that dimension m_back->SetSize( backSize ); PProperty enabled( m_form->GetProperty( wxT("enabled") ) ); if ( enabled ) { m_back->Enable( TypeConv::StringToInt( enabled->GetValue() ) != 0 ); } PProperty hidden( m_form->GetProperty( wxT("hidden") ) ); if ( hidden ) { m_back->Show( TypeConv::StringToInt( hidden->GetValue() ) == 0 ); } } else { // There is no form to display m_back->Show(false); } if ( IsShown() ) { Thaw(); } UpdateVirtualSize(); } /** * Generates wxObjects from ObjectBase * * @param obj ObjectBase to generate. * @param parent wxWindow parent, necessary to instantiate a widget. * @param parentObject ObjectBase parent - not always the same as the wxparent (e.g. an abstract component). */ void VisualEditor::Generate( PObjectBase obj, wxWindow* wxparent, wxObject* parentObject ) { // Get Component PObjectInfo obj_info = obj->GetObjectInfo(); IComponent* comp = obj_info->GetComponent(); if ( NULL == comp ) { THROW_WXFBEX( wxString::Format( wxT("Component for %s not found!"), obj->GetClassName().c_str() ) ); } // Create Object wxObject* createdObject = comp->Create( obj.get(), wxparent ); wxWindow* createdWindow = NULL; wxSizer* createdSizer = NULL; switch ( comp->GetComponentType() ) { case COMPONENT_TYPE_WINDOW: createdWindow = wxDynamicCast( createdObject, wxWindow ); if ( NULL == createdWindow ) { THROW_WXFBEX( wxString::Format( wxT("Component for %s was registered as a window component, but this is not a wxWindow!"), obj->GetClassName().c_str() ) ); } SetupWindow( obj, createdWindow ); // Push event handler in order to respond to Paint and Mouse events createdWindow->PushEventHandler( new VObjEvtHandler( createdWindow, obj ) ); break; case COMPONENT_TYPE_SIZER: createdSizer = wxDynamicCast( createdObject, wxSizer ); if ( NULL == createdSizer ) { THROW_WXFBEX( wxString::Format( wxT("Component for %s was registered as a sizer component, but this is not a wxSizer!"), obj->GetClassName().c_str() ) ); } SetupSizer( obj, createdSizer ); break; default: break; } // Associate the wxObject* with the PObjectBase m_wxobjects.insert( wxObjectMap::value_type( createdObject, obj ) ); m_baseobjects.insert( ObjectBaseMap::value_type( obj.get(), createdObject ) ); // New wxparent for the window's children wxWindow* new_wxparent = ( createdWindow ? createdWindow : wxparent ); // Recursively generate the children for ( unsigned int i = 0; i < obj->GetChildCount(); i++ ) { Generate( obj->GetChild( i ), new_wxparent, createdObject ); } comp->OnCreated( createdObject, new_wxparent ); // If the created object is a sizer and the parent object is a window, set the sizer to the window if ( ( createdSizer != NULL && NULL != wxDynamicCast( parentObject, wxWindow ) ) || ( NULL == parentObject && createdSizer != NULL ) ) { wxparent->SetSizer( createdSizer ); if ( parentObject ) createdSizer->SetSizeHints( wxparent ); wxparent->SetAutoLayout(true); wxparent->Layout(); } } void VisualEditor::SetupSizer( PObjectBase obj, wxSizer* sizer ) { wxSize minsize = obj->GetPropertyAsSize( wxT("minimum_size") ); if ( minsize != wxDefaultSize ) { sizer->SetMinSize( minsize ); sizer->Layout(); } } void VisualEditor::SetupWindow( PObjectBase obj, wxWindow* window ) { // All of the properties of the wxWindow object are applied in this function // Position /* Position does nothing in wxFB - this is pointless wxPoint pos; PProperty ppos = obj->GetProperty( wxT("pos") ); if ( ppos ) { pos = TypeConv::StringToPoint( ppos->GetValue() ); } */ // Size wxSize size = obj->GetPropertyAsSize( wxT("size") ); if ( size != wxDefaultSize ) { window->SetSize( size ); } // Minimum size wxSize minsize = obj->GetPropertyAsSize( wxT("minimum_size") ); if ( minsize != wxDefaultSize ) { window->SetMinSize( minsize ); } // Maximum size wxSize maxsize = obj->GetPropertyAsSize( wxT("maximum_size") ); if ( maxsize != wxDefaultSize ) { window->SetMaxSize( maxsize ); } // Font PProperty pfont = obj->GetProperty( wxT("font") ); if ( pfont && !pfont->GetValue().empty() ) { window->SetFont( TypeConv::StringToFont( pfont->GetValue() ) ); } // Foreground PProperty pfg_colour = obj->GetProperty( wxT("fg") ); if ( pfg_colour && !pfg_colour->GetValue().empty() ) { window->SetForegroundColour( TypeConv::StringToColour( pfg_colour->GetValue() ) ); } // Background PProperty pbg_colour = obj->GetProperty( wxT("bg") ); if ( pbg_colour && !pbg_colour->GetValue().empty() ) { window->SetBackgroundColour( TypeConv::StringToColour( pbg_colour->GetValue() ) ); } // Extra Style PProperty pextra_style = obj->GetProperty( wxT("window_extra_style") ); if ( pextra_style ) { window->SetExtraStyle( TypeConv::StringToInt( pextra_style->GetValue() ) ); } // Enabled PProperty penabled = obj->GetProperty( wxT("enabled") ); if ( penabled ) { window->Enable( ( penabled->GetValueAsInteger() !=0 ) ); } // Hidden PProperty phidden = obj->GetProperty( wxT("hidden") ); if ( phidden ) { window->Show( !phidden->GetValueAsInteger() ); } // Tooltip PProperty ptooltip = obj->GetProperty( wxT("tooltip") ); if ( ptooltip ) { window->SetToolTip( ptooltip->GetValueAsString() ); } } ///////////////////////////////////////////////////////////////////////////// void VisualEditor::PreventOnSelected( bool prevent ) { m_stopSelectedEvent = prevent; } void VisualEditor::PreventOnModified( bool prevent ) { m_stopModifiedEvent = prevent; } void VisualEditor::OnProjectLoaded ( wxFBEvent &) { Create(); } void VisualEditor::OnProjectSaved ( wxFBEvent & ) { //Create(); } void VisualEditor::OnObjectSelected( wxFBObjectEvent &event ) { // It is only necessary to Create() if the selected object is on a different form if ( AppData()->GetSelectedForm() != m_form ) { Create(); } // Get the ObjectBase from the event PObjectBase obj = event.GetFBObject(); if ( !obj ) { // Strange... Debug::Print( wxT("The event object is NULL - why?") ); return; } // Make sure this is a visible object ObjectBaseMap::iterator it = m_baseobjects.find( obj.get() ); if ( m_baseobjects.end() == it ) { m_back->SetSelectedSizer( NULL ); m_back->SetSelectedItem( NULL ); m_back->SetSelectedObject( PObjectBase() ); m_back->SetSelectedPanel( NULL ); m_back->Refresh(); return; } // Save wxobject wxObject* item = it->second; int componentType = COMPONENT_TYPE_ABSTRACT; IComponent *comp = obj->GetObjectInfo()->GetComponent(); if ( comp ) { componentType = comp->GetComponentType(); // Fire selection event in plugin if ( !m_stopSelectedEvent ) { comp->OnSelected( item ); } } if ( componentType != COMPONENT_TYPE_WINDOW && componentType != COMPONENT_TYPE_SIZER ) { item = NULL; } // Fire selection event in plugin for all parents if ( !m_stopSelectedEvent ) { PObjectBase parent = obj->GetParent(); while ( parent ) { IComponent* parentComp = parent->GetObjectInfo()->GetComponent(); if ( parentComp ) { ObjectBaseMap::iterator parentIt = m_baseobjects.find( parent.get() ); if ( parentIt != m_baseobjects.end() ) { parentComp->OnSelected( parentIt->second ); } } parent = parent->GetParent(); } } // Look for the active panel - this is where the boxes will be drawn during OnPaint // This is the closest parent of type COMPONENT_TYPE_WINDOW PObjectBase nextParent = obj->GetParent(); while ( nextParent ) { IComponent* parentComp = nextParent->GetObjectInfo()->GetComponent(); if ( !parentComp ) { nextParent.reset(); break; } if ( parentComp->GetComponentType() == COMPONENT_TYPE_WINDOW ) { break; } nextParent = nextParent->GetParent(); } // Get the panel to draw on wxWindow* selPanel = NULL; if ( nextParent ) { it = m_baseobjects.find( nextParent.get() ); if ( m_baseobjects.end() == it ) { selPanel = m_back->GetFrameContentPanel(); } else { selPanel = wxDynamicCast( it->second, wxWindow ); } } else { selPanel = m_back->GetFrameContentPanel(); } // Find the first COMPONENT_TYPE_WINDOW or COMPONENT_TYPE_SIZER // If it is a sizer, save it wxSizer* sizer = NULL; PObjectBase nextObj = obj->GetParent(); while ( nextObj ) { IComponent* nextComp = nextObj->GetObjectInfo()->GetComponent(); if ( !nextComp ) { break; } if ( nextComp->GetComponentType() == COMPONENT_TYPE_SIZER ) { it = m_baseobjects.find( nextObj.get() ); if ( it != m_baseobjects.end() ) { sizer = wxDynamicCast( it->second, wxSizer ); } break; } else if ( nextComp->GetComponentType() == COMPONENT_TYPE_WINDOW ) { break; } nextObj = nextObj->GetParent(); } m_back->SetSelectedSizer( sizer ); m_back->SetSelectedItem( item ); m_back->SetSelectedObject( obj ); m_back->SetSelectedPanel( selPanel ); m_back->Refresh(); } void VisualEditor::OnObjectCreated( wxFBObjectEvent &) { Create(); } void VisualEditor::OnObjectRemoved( wxFBObjectEvent & ) { Create(); } void VisualEditor::OnPropertyModified( wxFBPropertyEvent &) { if ( !m_stopModifiedEvent ) { PObjectBase aux = m_back->GetSelectedObject(); Create(); if ( aux ) { wxFBObjectEvent objEvent( wxEVT_FB_OBJECT_SELECTED, aux ); this->ProcessEvent( objEvent ); } UpdateVirtualSize(); } } void VisualEditor::OnProjectRefresh( wxFBEvent &) { Create(); } IMPLEMENT_CLASS( DesignerWindow, wxInnerFrame) BEGIN_EVENT_TABLE(DesignerWindow,wxInnerFrame) EVT_PAINT(DesignerWindow::OnPaint) END_EVENT_TABLE() DesignerWindow::DesignerWindow( wxWindow *parent, int id, const wxPoint& pos, const wxSize &size, long style, const wxString & /*name*/ ) : wxInnerFrame(parent, id, pos, size, style) { ShowTitleBar(false); SetGrid( 10, 10 ); m_selSizer = NULL; m_selItem = NULL; m_actPanel = NULL; SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ) ); GetFrameContentPanel()->PushEventHandler(new HighlightPaintHandler(GetFrameContentPanel())); } DesignerWindow::~DesignerWindow() { GetFrameContentPanel()->PopEventHandler( true ); } void DesignerWindow::SetGrid( int x, int y ) { m_x = x; m_y = y; } void DesignerWindow::OnPaint(wxPaintEvent &event) { // This paint event helps draw the selection boxes // when they extend beyond the edges of the content panel wxPaintDC dc(this); if ( m_actPanel == GetFrameContentPanel() ) { wxPoint origin = GetFrameContentPanel()->GetPosition(); dc.SetDeviceOrigin( origin.x, origin.y ); HighlightSelection( dc ); } event.Skip(); } void DesignerWindow::DrawRectangle( wxDC& dc, const wxPoint& point, const wxSize& size, PObjectBase object ) { bool isSizer = ( object->GetObjectInfo()->IsSubclassOf( wxT("sizer") ) ); int min = ( isSizer ? 0 : 1 ); int border = object->GetParent()->GetPropertyAsInteger( wxT("border") ); if ( border == 0 ) { border = min; } int flag = object->GetParent()->GetPropertyAsInteger( wxT("flag") ); int topBorder = ( flag & wxTOP ) == 0 ? min : border; int bottomBorder = ( flag & wxBOTTOM ) == 0 ? min : border; int rightBorder = ( flag & wxRIGHT ) == 0 ? min : border; int leftBorder = ( flag & wxLEFT ) == 0 ? min : border; dc.DrawRectangle( point.x - leftBorder, point.y - topBorder, size.x + leftBorder + rightBorder, size.y + topBorder + bottomBorder ); } void DesignerWindow::HighlightSelection( wxDC& dc ) { wxSize size; PObjectBase object = m_selObj.lock(); if ( m_selSizer ) { wxPoint point = m_selSizer->GetPosition(); size = m_selSizer->GetSize(); wxPen bluePen( *wxBLUE, 1, wxSOLID ); dc.SetPen( bluePen ); dc.SetBrush( *wxTRANSPARENT_BRUSH ); PObjectBase sizerParent = object->FindNearAncestorByBaseClass( wxT("sizer") ); if ( sizerParent && sizerParent->GetParent() ) { DrawRectangle( dc, point, size, sizerParent ); } } if ( m_selItem ) { wxPoint point; bool shown; wxWindow* windowItem = wxDynamicCast( m_selItem, wxWindow ); wxSizer* sizerItem = wxDynamicCast( m_selItem, wxSizer ); if ( NULL != windowItem ) { point = windowItem->GetPosition(); size = windowItem->GetSize(); shown = windowItem->IsShown(); } else if ( NULL != sizerItem ) { point = sizerItem->GetPosition(); size = sizerItem->GetSize(); shown = true; } else { return; } if ( shown ) { wxPen redPen( *wxRED, 1, wxSOLID ); dc.SetPen( redPen ); dc.SetBrush( *wxTRANSPARENT_BRUSH ); DrawRectangle( dc, point, size, object ); } } } wxMenu* DesignerWindow::GetMenuFromObject(PObjectBase menu) { int lastMenuId = wxID_HIGHEST + 1; wxMenu* menuWidget = new wxMenu(); for ( unsigned int j = 0; j < menu->GetChildCount(); j++ ) { PObjectBase menuItem = menu->GetChild( j ); if ( menuItem->GetObjectTypeName() == wxT("submenu") ) { menuWidget->Append( lastMenuId++, menuItem->GetPropertyAsString( wxT("label") ), GetMenuFromObject( menuItem ) ); } else if ( menuItem->GetClassName() == wxT("separator") ) { menuWidget->AppendSeparator(); } else { wxString label = menuItem->GetPropertyAsString( wxT("label") ); wxString shortcut = menuItem->GetPropertyAsString( wxT("shortcut") ); if ( !shortcut.IsEmpty() ) { label = label + wxChar('\t') + shortcut; } wxMenuItem *item = new wxMenuItem( menuWidget, lastMenuId++, label, menuItem->GetPropertyAsString( wxT("help") ), ( wxItemKind ) menuItem->GetPropertyAsInteger( wxT("kind") ) ); if ( !menuItem->GetProperty( wxT("bitmap") )->IsNull() ) { wxBitmap unchecked = wxNullBitmap; if ( !menuItem->GetProperty( wxT("unchecked_bitmap") )->IsNull() ) { unchecked = menuItem->GetPropertyAsBitmap( wxT("unchecked_bitmap") ); } #ifdef __WXMSW__ item->SetBitmaps( menuItem->GetPropertyAsBitmap( wxT("bitmap") ), unchecked ); #elif defined( __WXGTK__ ) item->SetBitmap( menuItem->GetPropertyAsBitmap( wxT("bitmap") ) ); #endif } else { if ( !menuItem->GetProperty( wxT("unchecked_bitmap") )->IsNull() ) { #ifdef __WXMSW__ item->SetBitmaps( wxNullBitmap, menuItem->GetPropertyAsBitmap( wxT("unchecked_bitmap") ) ); #endif } } menuWidget->Append( item ); if ( item->GetKind() == wxITEM_CHECK && menuItem->GetPropertyAsInteger( wxT("checked") ) ) { item->Check( true ); } item->Enable( ( menuItem->GetPropertyAsInteger( wxT("enabled") ) != 0 ) ); } } return menuWidget; } void DesignerWindow::SetFrameWidgets(PObjectBase menubar, wxWindow *toolbar, wxWindow *statusbar) { wxWindow *contentPanel = GetFrameContentPanel(); Menubar *mbWidget = NULL; if ( menubar ) { mbWidget = new Menubar(contentPanel, -1); for ( unsigned int i = 0; i < menubar->GetChildCount(); i++ ) { PObjectBase menu = menubar->GetChild( i ); wxMenu *menuWidget = GetMenuFromObject( menu ); mbWidget->AppendMenu( menu->GetPropertyAsString( wxT("label") ), menuWidget ); } } wxSizer *mainSizer = contentPanel->GetSizer(); contentPanel->SetSizer( NULL, false ); wxSizer *dummySizer = new wxBoxSizer( wxVERTICAL ); if ( mbWidget ) { dummySizer->Add(mbWidget, 0, wxEXPAND | wxTOP | wxBOTTOM, 0); dummySizer->Add(new wxStaticLine(contentPanel, -1), 0, wxEXPAND | wxALL, 0); } wxSizer* contentSizer = dummySizer; if (toolbar) { if ( (toolbar->GetWindowStyle() & wxTB_VERTICAL) != 0 ) { wxSizer* horiz = new wxBoxSizer( wxHORIZONTAL ); horiz->Add(toolbar, 0, wxEXPAND | wxALL, 0); wxSizer* vert = new wxBoxSizer( wxVERTICAL ); horiz->Add( vert, 1, wxEXPAND, 0 ); dummySizer->Add( horiz, 1, wxEXPAND, 0); contentSizer = vert; } else { dummySizer->Add(toolbar, 0, wxEXPAND | wxALL, 0); } } if (mainSizer) { contentSizer->Add(mainSizer, 1, wxEXPAND | wxALL, 0); if ( mainSizer->GetChildren().IsEmpty() ) { // Sizers do not expand if they are empty mainSizer->AddStretchSpacer(1); } } else contentSizer->AddStretchSpacer(1); if (statusbar) { contentSizer->Add(statusbar, 0, wxEXPAND | wxALL, 0); } contentPanel->SetSizer(dummySizer, false); contentPanel->Layout(); } BEGIN_EVENT_TABLE(DesignerWindow::HighlightPaintHandler,wxEvtHandler) EVT_PAINT(DesignerWindow::HighlightPaintHandler::OnPaint) END_EVENT_TABLE() DesignerWindow::HighlightPaintHandler::HighlightPaintHandler(wxWindow *win) { m_window = win; } void DesignerWindow::HighlightPaintHandler::OnPaint(wxPaintEvent &event) { // wxPaintDC dc(this); /* wxSize size = GetSize(); dc.SetPen(*wxBLACK_PEN); for ( int i = 0; i < size.GetWidth(); i += m_x ) { for ( int j = 0; j < size.GetHeight(); j += m_y ) { dc.DrawPoint( i - 1, j - 1 ); } }*/ /*if ( m_actPanel == this) { HighlightSelection( dc ); }*/ wxWindow *aux = m_window; while (!aux->IsKindOf(CLASSINFO(DesignerWindow))) aux = aux->GetParent(); DesignerWindow *dsgnWin = (DesignerWindow*) aux; if (dsgnWin->GetActivePanel() == m_window) { wxPaintDC dc(m_window); dsgnWin->HighlightSelection(dc); } event.Skip(); } wxformbuilder-3.1.59/src/rad/designer/visualobj.cpp0000644000175000017500000000566711143440026022624 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #include "visualobj.h" #include "visualeditor.h" #include "utils/typeconv.h" #include "utils/debug.h" #include "rad/genericpanel.h" #include "model/objectbase.h" #include using namespace TypeConv; /////////////////////////////////////////////////////////////////////////////// BEGIN_EVENT_TABLE( VObjEvtHandler, wxEvtHandler ) EVT_LEFT_DOWN( VObjEvtHandler::OnLeftClick ) EVT_PAINT( VObjEvtHandler::OnPaint ) EVT_SET_CURSOR( VObjEvtHandler::OnSetCursor ) END_EVENT_TABLE() VObjEvtHandler::VObjEvtHandler(wxWindow *win, PObjectBase obj) { m_window = win; m_object = obj; }; void VObjEvtHandler::OnLeftClick(wxMouseEvent &event) { PObjectBase obj = m_object.lock(); if (obj) { if (AppData()->GetSelectedObject() != obj) { AppData()->SelectObject(obj); } else { // *!* Event should be skipped only in the case of the object selected // is the same that the object clicked. You will experiment rare things // in other case. event.Skip(); } } m_window->ClientToScreen(&event.m_x, &event.m_y); m_window->GetParent()->ScreenToClient(&event.m_x, &event.m_y); ::wxPostEvent(m_window->GetParent(), event); } void VObjEvtHandler::OnPaint(wxPaintEvent &event) { PObjectBase wo = boost::shared_dynamic_cast(m_object.lock()); if (wo->IsContainer()) { wxWindow *aux = m_window; while (!aux->IsKindOf(CLASSINFO(DesignerWindow))) aux = aux->GetParent(); DesignerWindow *dsgnWin = (DesignerWindow*) aux; if (dsgnWin->GetActivePanel() == m_window) { wxPaintDC dc(m_window); dsgnWin->HighlightSelection(dc); } } event.Skip(); } void VObjEvtHandler::OnSetCursor(wxSetCursorEvent &event) { wxCoord x = event.GetX(), y = event.GetY(); m_window->ClientToScreen(&x, &y); m_window->GetParent()->ScreenToClient(&x, &y); wxSetCursorEvent sce(x, y); ::wxPostEvent(m_window->GetParent(), sce); } wxformbuilder-3.1.59/src/rad/designer/visualeditor.h0000644000175000017500000001107711143440026022775 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // // wxFormBuilder - A Visual Dialog Editor for wxWidgets. // Copyright (C) 2005 José Antonio Hurtado // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Written by // José Antonio Hurtado - joseantonio.hurtado@gmail.com // Juan Antonio Ortega - jortegalalmolda@gmail.com // /////////////////////////////////////////////////////////////////////////////// #ifndef __VISUAL_EDITOR__ #define __VISUAL_EDITOR__ #include "wx/wx.h" #include "utils/wxfbdefs.h" #include "rad/designer/visualobj.h" //#include "rad/designer/resizablepanel.h" #include #include "innerframe.h" /** * Extends the wxInnerFrame to show the object highlight */ class DesignerWindow : public wxInnerFrame { private: int m_x; int m_y; wxSizer *m_selSizer; wxObject *m_selItem; WPObjectBase m_selObj; wxWindow *m_actPanel; void DrawRectangle(wxDC& dc, const wxPoint& point, const wxSize& size, PObjectBase object); DECLARE_CLASS(DesignerWindow) // Augh!, this class is needed to paint the highlight in the // frame content panel. class HighlightPaintHandler : public wxEvtHandler { DECLARE_EVENT_TABLE() wxWindow *m_window; public: HighlightPaintHandler(wxWindow *win); void OnPaint(wxPaintEvent &event); }; protected: DECLARE_EVENT_TABLE() public: DesignerWindow(wxWindow *parent, int id, const wxPoint& pos, const wxSize &size = wxDefaultSize, long style = 0, const wxString &name = wxT("designer_win")); ~DesignerWindow(); void SetGrid(int x, int y); void SetSelectedSizer(wxSizer *sizer) { m_selSizer = sizer; } void SetSelectedItem(wxObject *item) { m_selItem = item; } void SetSelectedObject(PObjectBase object) { m_selObj = object; } void SetSelectedPanel(wxWindow *actPanel) { m_actPanel = actPanel; } wxSizer *GetSelectedSizer() { return m_selSizer; } wxObject* GetSelectedItem() { return m_selItem; } PObjectBase GetSelectedObject() { return m_selObj.lock(); } wxWindow* GetActivePanel() { return m_actPanel; } wxMenu* GetMenuFromObject(PObjectBase menu); void SetFrameWidgets(PObjectBase menubar, wxWindow *toolbar, wxWindow* statusbar); void HighlightSelection(wxDC& dc); void OnPaint(wxPaintEvent &event); }; class wxFBEvent; class wxFBPropertyEvent; class wxFBObjectEvent; class VisualEditor : public wxScrolledWindow { private: typedef std::map< wxObject*, PObjectBase > wxObjectMap; wxObjectMap m_wxobjects; typedef std::map< ObjectBase*, wxObject* > ObjectBaseMap; ObjectBaseMap m_baseobjects; DesignerWindow *m_back; PObjectBase m_form; // Pointer to last form created // Prevent OnSelected in components bool m_stopSelectedEvent; // Prevent OnModified in components bool m_stopModifiedEvent; DECLARE_EVENT_TABLE() protected: void Generate( PObjectBase obj, wxWindow* parent, wxObject* parentObject ); void SetupWindow( PObjectBase obj, wxWindow* window ); void SetupSizer( PObjectBase obj, wxSizer* sizer ); void Create(); void DeleteAbstractObjects(); public: VisualEditor(wxWindow *parent); ~VisualEditor(); void OnResizeBackPanel (wxCommandEvent &event); void OnClickBackPanel( wxMouseEvent& event ); void PreventOnSelected( bool prevent = true ); void PreventOnModified( bool prevent = true ); void UpdateVirtualSize(); PObjectBase GetObjectBase( wxObject* wxobject ); wxObject* GetWxObject( PObjectBase baseobject ); // Give components an opportunity to cleanup void ClearComponents( wxWindow* parent ); // Events void OnProjectLoaded ( wxFBEvent &event ); void OnProjectSaved ( wxFBEvent &event ); void OnObjectSelected( wxFBObjectEvent &event ); void OnObjectCreated ( wxFBObjectEvent &event ); void OnObjectRemoved ( wxFBObjectEvent &event ); void OnPropertyModified ( wxFBPropertyEvent &event ); void OnProjectRefresh ( wxFBEvent &event); }; #endif //__VISUAL_EDITOR__ wxformbuilder-3.1.59/src/boost/detail/sp_counted_base_w32.hpp0000644000175000017500000000476411143440027024503 0ustar rrmulderrrmulder#ifndef BOOST_DETAIL_SP_COUNTED_BASE_W32_HPP_INCLUDED #define BOOST_DETAIL_SP_COUNTED_BASE_W32_HPP_INCLUDED // MS compatible compilers support #pragma once #if defined(_MSC_VER) && (_MSC_VER >= 1020) # pragma once #endif // // detail/sp_counted_base_w32.hpp // // Copyright (c) 2001, 2002, 2003 Peter Dimov and Multi Media Ltd. // Copyright 2004-2005 Peter Dimov // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // // Lock-free algorithm by Alexander Terekhov // // Thanks to Ben Hitchings for the #weak + (#shared != 0) // formulation // #include #include namespace boost { namespace detail { class sp_counted_base { private: sp_counted_base( sp_counted_base const & ); sp_counted_base & operator= ( sp_counted_base const & ); long use_count_; // #shared long weak_count_; // #weak + (#shared != 0) public: sp_counted_base(): use_count_( 1 ), weak_count_( 1 ) { } virtual ~sp_counted_base() // nothrow { } // dispose() is called when use_count_ drops to zero, to release // the resources managed by *this. virtual void dispose() = 0; // nothrow // destroy() is called when weak_count_ drops to zero. virtual void destroy() // nothrow { delete this; } virtual void * get_deleter( std::type_info const & ti ) = 0; void add_ref_copy() { BOOST_INTERLOCKED_INCREMENT( &use_count_ ); } bool add_ref_lock() // true on success { for( ;; ) { long tmp = static_cast< long const volatile& >( use_count_ ); if( tmp == 0 ) return false; if( BOOST_INTERLOCKED_COMPARE_EXCHANGE( &use_count_, tmp + 1, tmp ) == tmp ) return true; } } void release() // nothrow { if( BOOST_INTERLOCKED_DECREMENT( &use_count_ ) == 0 ) { dispose(); weak_release(); } } void weak_add_ref() // nothrow { BOOST_INTERLOCKED_INCREMENT( &weak_count_ ); } void weak_release() // nothrow { if( BOOST_INTERLOCKED_DECREMENT( &weak_count_ ) == 0 ) { destroy(); } } long use_count() const // nothrow { return static_cast( use_count_ ); } }; } // namespace detail } // namespace boost #endif // #ifndef BOOST_DETAIL_SP_COUNTED_BASE_W32_HPP_INCLUDED wxformbuilder-3.1.59/src/boost/detail/lwm_gcc.hpp0000644000175000017500000000310011143440027022245 0ustar rrmulderrrmulder#ifndef BOOST_DETAIL_LWM_GCC_HPP_INCLUDED #define BOOST_DETAIL_LWM_GCC_HPP_INCLUDED // // boost/detail/lwm_gcc.hpp // // lightweight_mutex for GNU libstdc++ v3 // // http://gcc.gnu.org/onlinedocs/porting/Thread-safety.html // // Copyright (c) 2002 Peter Dimov and Multi Media Ltd. // Copyright (c) 2002 Lars Gullik Bjnnes // // Permission to copy, use, modify, sell and distribute this software // is granted provided this copyright notice appears in all copies. // This software is provided "as is" without express or implied // warranty, and with no claim as to its suitability for any purpose. // #include #include namespace boost { namespace detail { class lightweight_mutex { private: _Atomic_word a_; lightweight_mutex(lightweight_mutex const &); lightweight_mutex & operator=(lightweight_mutex const &); public: lightweight_mutex(): a_(1) { } class scoped_lock; friend class scoped_lock; class scoped_lock { private: lightweight_mutex & m_; scoped_lock(scoped_lock const &); scoped_lock & operator=(scoped_lock const &); public: explicit scoped_lock(lightweight_mutex & m): m_(m) { while( !__exchange_and_add(&m_.a_, -1) ) { __atomic_add(&m_.a_, 1); sched_yield(); } } ~scoped_lock() { __atomic_add(&m_.a_, 1); } }; }; } // namespace detail } // namespace boost #endif // #ifndef BOOST_DETAIL_LWM_GCC_HPP_INCLUDED wxformbuilder-3.1.59/src/boost/detail/typed_in_place_factory.hpp0000644000175000017500000000365111143440027025353 0ustar rrmulderrrmulder// Copyright (C) 2003, Fernando Luis Cacciola Carballal. // // Use, modification, and distribution is subject to the Boost Software // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // See http://www.boost.org/lib/optional for documentation. // // You are welcome to contact the author at: // fernando_cacciola@hotmail.com // #ifndef BOOST_UTILITY_TYPED_INPLACE_FACTORY_25AGO2003_HPP #define BOOST_UTILITY_TYPED_INPLACE_FACTORY_25AGO2003_HPP #include namespace boost { class TypedInPlaceFactoryBase {} ; #define BOOST_DEFINE_TYPED_INPLACE_FACTORY_CLASS(z,n,_) \ template< class T, BOOST_PP_ENUM_PARAMS(BOOST_PP_INC(n),class A) > \ class BOOST_PP_CAT(TypedInPlaceFactory, BOOST_PP_INC(n) ) : public TypedInPlaceFactoryBase \ { \ public: \ \ typedef T value_type ; \ \ BOOST_PP_CAT(TypedInPlaceFactory, BOOST_PP_INC(n) ) ( BOOST_PP_ENUM_BINARY_PARAMS(BOOST_PP_INC(n),A,const& a) ) \ : \ BOOST_PP_ENUM( BOOST_PP_INC(n), BOOST_DEFINE_INPLACE_FACTORY_CLASS_MEMBER_INIT, _ ) \ {} \ \ void apply ( void* address ) const \ { \ new ( address ) T ( BOOST_PP_ENUM_PARAMS( BOOST_PP_INC(n), m_a ) ) ; \ } \ \ BOOST_PP_REPEAT( BOOST_PP_INC(n), BOOST_DEFINE_INPLACE_FACTORY_CLASS_MEMBER_DECL, _) \ } ; \ \ template< class T, BOOST_PP_ENUM_PARAMS(BOOST_PP_INC(n),class A) > \ BOOST_PP_CAT(TypedInPlaceFactory, BOOST_PP_INC(n) ) < T , BOOST_PP_ENUM_PARAMS( BOOST_PP_INC(n), A ) > \ in_place ( BOOST_PP_ENUM_BINARY_PARAMS(BOOST_PP_INC(n),A, const& a) ) \ { \ return BOOST_PP_CAT(TypedInPlaceFactory, BOOST_PP_INC(n) ) < T, BOOST_PP_ENUM_PARAMS( BOOST_PP_INC(n), A ) > \ ( BOOST_PP_ENUM_PARAMS( BOOST_PP_INC(n), a ) ) ; \ } ; \ BOOST_PP_REPEAT( BOOST_MAX_INPLACE_FACTORY_ARITY, BOOST_DEFINE_TYPED_INPLACE_FACTORY_CLASS, BOOST_PP_EMPTY() ) } // namespace boost #include #endif wxformbuilder-3.1.59/src/boost/detail/lwm_win32_nt.hpp0000644000175000017500000000233411143440027023164 0ustar rrmulderrrmulder#ifndef BOOST_DETAIL_LWM_WIN32_NT_HPP_INCLUDED #define BOOST_DETAIL_LWM_WIN32_NT_HPP_INCLUDED #if defined(_MSC_VER) && (_MSC_VER >= 1020) # pragma once #endif // // boost/detail/lwm_win32_nt.hpp // // Copyright (c) 2002, 2003 Peter Dimov // // Permission to copy, use, modify, sell and distribute this software // is granted provided this copyright notice appears in all copies. // This software is provided "as is" without express or implied // warranty, and with no claim as to its suitability for any purpose. // // "No threads" version of lwm_win32.hpp; binary compatible but no-op. // namespace boost { namespace detail { class lightweight_mutex { private: long l_; lightweight_mutex(lightweight_mutex const &); lightweight_mutex & operator=(lightweight_mutex const &); public: lightweight_mutex(): l_(0) { } class scoped_lock; friend class scoped_lock; class scoped_lock { private: scoped_lock(scoped_lock const &); scoped_lock & operator=(scoped_lock const &); public: explicit scoped_lock(lightweight_mutex &) { } }; }; } // namespace detail } // namespace boost #endif // #ifndef BOOST_DETAIL_LWM_WIN32_NT_HPP_INCLUDED wxformbuilder-3.1.59/src/boost/detail/algorithm.hpp0000644000175000017500000001640511143440027022634 0ustar rrmulderrrmulder// (C) Copyright Jeremy Siek 2001. Permission to copy, use, modify, // sell and distribute this software is granted provided this // copyright notice appears in all copies. This software is provided // "as is" without express or implied warranty, and with no claim as // to its suitability for any purpose. /* * * Copyright (c) 1994 * Hewlett-Packard Company * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Hewlett-Packard Company makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. * * * Copyright (c) 1996 * Silicon Graphics Computer Systems, Inc. * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Silicon Graphics makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. */ #ifndef BOOST_ALGORITHM_HPP # define BOOST_ALGORITHM_HPP # include // Algorithms on sequences // // The functions in this file have not yet gone through formal // review, and are subject to change. This is a work in progress. // They have been checked into the detail directory because // there are some graph algorithms that use these functions. #include #include namespace boost { template Iter1 begin(const std::pair& p) { return p.first; } template Iter2 end(const std::pair& p) { return p.second; } template typename boost::detail::iterator_traits::difference_type size(const std::pair& p) { return std::distance(p.first, p.second); } #if 0 // These seem to interfere with the std::pair overloads :( template typename Container::iterator begin(Container& c) { return c.begin(); } template typename Container::const_iterator begin(const Container& c) { return c.begin(); } template typename Container::iterator end(Container& c) { return c.end(); } template typename Container::const_iterator end(const Container& c) { return c.end(); } template typename Container::size_type size(const Container& c) { return c.size(); } #else template typename std::vector::iterator begin(std::vector& c) { return c.begin(); } template typename std::vector::const_iterator begin(const std::vector& c) { return c.begin(); } template typename std::vector::iterator end(std::vector& c) { return c.end(); } template typename std::vector::const_iterator end(const std::vector& c) { return c.end(); } template typename std::vector::size_type size(const std::vector& c) { return c.size(); } #endif template void iota(ForwardIterator first, ForwardIterator last, T value) { for (; first != last; ++first, ++value) *first = value; } template void iota(Container& c, const T& value) { iota(begin(c), end(c), value); } // Also do version with 2nd container? template OutIter copy(const Container& c, OutIter result) { return std::copy(begin(c), end(c), result); } template bool equal(const Container1& c1, const Container2& c2) { if (size(c1) != size(c2)) return false; return std::equal(begin(c1), end(c1), begin(c2)); } template void sort(Container& c) { std::sort(begin(c), end(c)); } template void sort(Container& c, const Predicate& p) { std::sort(begin(c), end(c), p); } template void stable_sort(Container& c) { std::stable_sort(begin(c), end(c)); } template void stable_sort(Container& c, const Predicate& p) { std::stable_sort(begin(c), end(c), p); } template bool any_if(InputIterator first, InputIterator last, Predicate p) { return std::find_if(first, last, p) != last; } template bool any_if(const Container& c, Predicate p) { return any_if(begin(c), end(c), p); } template bool contains(InputIterator first, InputIterator last, T value) { return std::find(first, last, value) != last; } template bool contains(const Container& c, const T& value) { return contains(begin(c), end(c), value); } template bool all(InputIterator first, InputIterator last, Predicate p) { for (; first != last; ++first) if (!p(*first)) return false; return true; } template bool all(const Container& c, Predicate p) { return all(begin(c), end(c), p); } template bool none(InputIterator first, InputIterator last, Predicate p) { return std::find_if(first, last, p) == last; } template bool none(const Container& c, Predicate p) { return none(begin(c), end(c), p); } template std::size_t count(const Container& c, const T& value) { return std::count(begin(c), end(c), value); } template std::size_t count_if(const Container& c, Predicate p) { return std::count_if(begin(c), end(c), p); } template bool is_sorted(ForwardIterator first, ForwardIterator last) { if (first == last) return true; ForwardIterator next = first; for (++next; next != last; first = next, ++next) { if (*next < *first) return false; } return true; } template bool is_sorted(ForwardIterator first, ForwardIterator last, StrictWeakOrdering comp) { if (first == last) return true; ForwardIterator next = first; for (++next; next != last; first = next, ++next) { if (comp(*next, *first)) return false; } return true; } template bool is_sorted(const Container& c) { return is_sorted(begin(c), end(c)); } template bool is_sorted(const Container& c, StrictWeakOrdering comp) { return is_sorted(begin(c), end(c), comp); } } // namespace boost #endif // BOOST_ALGORITHM_HPP wxformbuilder-3.1.59/src/boost/detail/sp_counted_base.hpp0000644000175000017500000000335411143440027024002 0ustar rrmulderrrmulder#ifndef BOOST_DETAIL_SP_COUNTED_BASE_HPP_INCLUDED #define BOOST_DETAIL_SP_COUNTED_BASE_HPP_INCLUDED // MS compatible compilers support #pragma once #if defined(_MSC_VER) && (_MSC_VER >= 1020) # pragma once #endif // // detail/sp_counted_base.hpp // // Copyright 2005 Peter Dimov // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // #include #if defined( BOOST_SP_DISABLE_THREADS ) # include #elif defined( BOOST_SP_USE_PTHREADS ) # include #elif defined( __GNUC__ ) && ( defined( __i386__ ) || defined( __x86_64__ ) ) # include //~ #elif defined( __MWERKS__ ) && ( defined( __i386__ ) || defined( __x86_64__ ) ) //~ # include #elif defined( __GNUC__ ) && defined( __ia64__ ) && !defined( __INTEL_COMPILER ) # include #elif defined( __MWERKS__ ) && defined( __POWERPC__ ) # include #elif defined( __GNUC__ ) && ( defined( __powerpc__ ) || defined( __ppc__ ) ) # include #elif defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ ) # include #elif !defined( BOOST_HAS_THREADS ) # include #elif defined( BOOST_HAS_PTHREADS ) # include #else // Use #define BOOST_DISABLE_THREADS to avoid the error # error Unrecognized threading platform #endif #endif // #ifndef BOOST_DETAIL_SP_COUNTED_BASE_HPP_INCLUDED wxformbuilder-3.1.59/src/boost/detail/dynamic_bitset.hpp0000644000175000017500000001156311143440027023644 0ustar rrmulderrrmulder// -------------------------------------------------- // // (C) Copyright Chuck Allison and Jeremy Siek 2001 - 2002. // (C) Copyright Gennaro Prota 2003 - 2004. // // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // ----------------------------------------------------------- // See http://www.boost.org/libs/dynamic_bitset for documentation. #ifndef BOOST_DETAIL_DYNAMIC_BITSET_HPP #define BOOST_DETAIL_DYNAMIC_BITSET_HPP #include // for std::size_t #include "boost/config.hpp" #include "boost/detail/workaround.hpp" //#include "boost/static_assert.hpp" // gps namespace boost { namespace detail { // Gives (read-)access to the object representation // of an object of type T (3.9p4). CANNOT be used // on a base sub-object // template inline const unsigned char * object_representation (T* p) { return static_cast(static_cast(p)); } // ------- count function implementation -------------- namespace dynamic_bitset_count_impl { typedef unsigned char byte_type; enum mode { access_by_bytes, access_by_blocks }; template struct mode_to_type {}; // the table: wrapped in a class template, so // that it is only instantiated if/when needed // template struct count_table { static const byte_type table[]; }; template <> struct count_table { /* no table */ }; const unsigned int table_width = 8; template const byte_type count_table::table[] = { // Automatically generated by GPTableGen.exe v.1.0 // 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8 }; // overload for access by bytes // template inline std::size_t do_count(Iterator first, std::size_t length, int /*dummy param*/, mode_to_type* ) { std::size_t num = 0; if (length) { const byte_type * p = object_representation(&*first); length *= sizeof(*first); do { num += count_table<>::table[*p]; ++p; --length; } while (length); } return num; } // overload for access by blocks // template inline std::size_t do_count(Iterator first, std::size_t length, ValueType, mode_to_type*) { std::size_t num = 0; while (length){ ValueType value = *first; while (value) { num += count_table<>::table[value & ((1u<>= table_width; } ++first; --length; } return num; } } // dynamic_bitset_count_impl // ------------------------------------------------------- // Some library implementations simply return a dummy // value such as // // size_type(-1) / sizeof(T) // // from vector<>::max_size. This tries to get out more // meaningful info. // template typename T::size_type vector_max_size_workaround(const T & v) { typedef typename T::allocator_type allocator_type; const typename allocator_type::size_type alloc_max = v.get_allocator().max_size(); const typename T::size_type container_max = v.max_size(); return alloc_max < container_max? alloc_max : container_max; } // for static_asserts template struct dynamic_bitset_allowed_block_type { enum { value = T(-1) > 0 }; // ensure T has no sign }; template <> struct dynamic_bitset_allowed_block_type { enum { value = false }; }; } // namespace detail } // namespace boost #endif // include guard wxformbuilder-3.1.59/src/boost/detail/sp_counted_base_cw_ppc.hpp0000644000175000017500000000563111143440027025335 0ustar rrmulderrrmulder#ifndef BOOST_DETAIL_SP_COUNTED_BASE_CW_PPC_HPP_INCLUDED #define BOOST_DETAIL_SP_COUNTED_BASE_CW_PPC_HPP_INCLUDED // MS compatible compilers support #pragma once #if defined(_MSC_VER) && (_MSC_VER >= 1020) # pragma once #endif // // detail/sp_counted_base_cw_ppc.hpp - CodeWarrior on PowerPC // // Copyright (c) 2001, 2002, 2003 Peter Dimov and Multi Media Ltd. // Copyright 2004-2005 Peter Dimov // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // // Lock-free algorithm by Alexander Terekhov // // Thanks to Ben Hitchings for the #weak + (#shared != 0) // formulation // #include namespace boost { namespace detail { inline void atomic_increment( register long * pw ) { register int a; asm { loop: lwarx a, 0, pw addi a, a, 1 stwcx. a, 0, pw bne- loop } } inline long atomic_decrement( register long * pw ) { register int a; asm { sync loop: lwarx a, 0, pw addi a, a, -1 stwcx. a, 0, pw bne- loop isync } return a; } inline long atomic_conditional_increment( register long * pw ) { register int a; asm { loop: lwarx a, 0, pw cmpwi a, 0 beq store addi a, a, 1 store: stwcx. a, 0, pw bne- loop } return a; } class sp_counted_base { private: sp_counted_base( sp_counted_base const & ); sp_counted_base & operator= ( sp_counted_base const & ); long use_count_; // #shared long weak_count_; // #weak + (#shared != 0) public: sp_counted_base(): use_count_( 1 ), weak_count_( 1 ) { } virtual ~sp_counted_base() // nothrow { } // dispose() is called when use_count_ drops to zero, to release // the resources managed by *this. virtual void dispose() = 0; // nothrow // destroy() is called when weak_count_ drops to zero. virtual void destroy() // nothrow { delete this; } virtual void * get_deleter( std::type_info const & ti ) = 0; void add_ref_copy() { atomic_increment( &use_count_ ); } bool add_ref_lock() // true on success { return atomic_conditional_increment( &use_count_ ) != 0; } void release() // nothrow { if( atomic_decrement( &use_count_ ) == 0 ) { dispose(); weak_release(); } } void weak_add_ref() // nothrow { atomic_increment( &weak_count_ ); } void weak_release() // nothrow { if( atomic_decrement( &weak_count_ ) == 0 ) { destroy(); } } long use_count() const // nothrow { return static_cast( use_count_ ); } }; } // namespace detail } // namespace boost #endif // #ifndef BOOST_DETAIL_SP_COUNTED_BASE_CW_PPC_HPP_INCLUDED wxformbuilder-3.1.59/src/boost/detail/sp_counted_base_pt.hpp0000644000175000017500000000551611143440027024507 0ustar rrmulderrrmulder#ifndef BOOST_DETAIL_SP_COUNTED_BASE_PT_HPP_INCLUDED #define BOOST_DETAIL_SP_COUNTED_BASE_PT_HPP_INCLUDED // MS compatible compilers support #pragma once #if defined(_MSC_VER) && (_MSC_VER >= 1020) # pragma once #endif // // detail/sp_counted_base_pt.hpp // // Copyright (c) 2001, 2002, 2003 Peter Dimov and Multi Media Ltd. // Copyright 2004-2005 Peter Dimov // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // #include #include namespace boost { namespace detail { class sp_counted_base { private: sp_counted_base( sp_counted_base const & ); sp_counted_base & operator= ( sp_counted_base const & ); long use_count_; // #shared long weak_count_; // #weak + (#shared != 0) mutable pthread_mutex_t m_; public: sp_counted_base(): use_count_( 1 ), weak_count_( 1 ) { // HPUX 10.20 / DCE has a nonstandard pthread_mutex_init #if defined(__hpux) && defined(_DECTHREADS_) pthread_mutex_init( &m_, pthread_mutexattr_default ); #else pthread_mutex_init( &m_, 0 ); #endif } virtual ~sp_counted_base() // nothrow { pthread_mutex_destroy( &m_ ); } // dispose() is called when use_count_ drops to zero, to release // the resources managed by *this. virtual void dispose() = 0; // nothrow // destroy() is called when weak_count_ drops to zero. virtual void destroy() // nothrow { delete this; } virtual void * get_deleter( std::type_info const & ti ) = 0; void add_ref_copy() { pthread_mutex_lock( &m_ ); ++use_count_; pthread_mutex_unlock( &m_ ); } bool add_ref_lock() // true on success { pthread_mutex_lock( &m_ ); bool r = use_count_ == 0? false: ( ++use_count_, true ); pthread_mutex_unlock( &m_ ); return r; } void release() // nothrow { pthread_mutex_lock( &m_ ); long new_use_count = --use_count_; pthread_mutex_unlock( &m_ ); if( new_use_count == 0 ) { dispose(); weak_release(); } } void weak_add_ref() // nothrow { pthread_mutex_lock( &m_ ); ++weak_count_; pthread_mutex_unlock( &m_ ); } void weak_release() // nothrow { pthread_mutex_lock( &m_ ); long new_weak_count = --weak_count_; pthread_mutex_unlock( &m_ ); if( new_weak_count == 0 ) { destroy(); } } long use_count() const // nothrow { pthread_mutex_lock( &m_ ); long r = use_count_; pthread_mutex_unlock( &m_ ); return r; } }; } // namespace detail } // namespace boost #endif // #ifndef BOOST_DETAIL_SP_COUNTED_BASE_PT_HPP_INCLUDED wxformbuilder-3.1.59/src/boost/detail/shared_ptr_nmt.hpp0000644000175000017500000000726011143440027023656 0ustar rrmulderrrmulder#ifndef BOOST_DETAIL_SHARED_PTR_NMT_HPP_INCLUDED #define BOOST_DETAIL_SHARED_PTR_NMT_HPP_INCLUDED // // detail/shared_ptr_nmt.hpp - shared_ptr.hpp without member templates // // (C) Copyright Greg Colvin and Beman Dawes 1998, 1999. // Copyright (c) 2001, 2002 Peter Dimov // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // See http://www.boost.org/libs/smart_ptr/shared_ptr.htm for documentation. // #include #include #include #include #ifndef BOOST_NO_AUTO_PTR # include // for std::auto_ptr #endif #include // for std::swap #include // for std::less #include // for std::bad_alloc namespace boost { template class shared_ptr { private: typedef detail::atomic_count count_type; public: typedef T element_type; typedef T value_type; explicit shared_ptr(T * p = 0): px(p) { #ifndef BOOST_NO_EXCEPTIONS try // prevent leak if new throws { pn = new count_type(1); } catch(...) { boost::checked_delete(p); throw; } #else pn = new count_type(1); if(pn == 0) { boost::checked_delete(p); boost::throw_exception(std::bad_alloc()); } #endif } ~shared_ptr() { if(--*pn == 0) { boost::checked_delete(px); delete pn; } } shared_ptr(shared_ptr const & r): px(r.px) // never throws { pn = r.pn; ++*pn; } shared_ptr & operator=(shared_ptr const & r) { shared_ptr(r).swap(*this); return *this; } #ifndef BOOST_NO_AUTO_PTR explicit shared_ptr(std::auto_ptr & r) { pn = new count_type(1); // may throw px = r.release(); // fix: moved here to stop leak if new throws } shared_ptr & operator=(std::auto_ptr & r) { shared_ptr(r).swap(*this); return *this; } #endif void reset(T * p = 0) { BOOST_ASSERT(p == 0 || p != px); shared_ptr(p).swap(*this); } T & operator*() const // never throws { BOOST_ASSERT(px != 0); return *px; } T * operator->() const // never throws { BOOST_ASSERT(px != 0); return px; } T * get() const // never throws { return px; } long use_count() const // never throws { return *pn; } bool unique() const // never throws { return *pn == 1; } void swap(shared_ptr & other) // never throws { std::swap(px, other.px); std::swap(pn, other.pn); } private: T * px; // contained pointer count_type * pn; // ptr to reference counter }; template inline bool operator==(shared_ptr const & a, shared_ptr const & b) { return a.get() == b.get(); } template inline bool operator!=(shared_ptr const & a, shared_ptr const & b) { return a.get() != b.get(); } template inline bool operator<(shared_ptr const & a, shared_ptr const & b) { return std::less()(a.get(), b.get()); } template void swap(shared_ptr & a, shared_ptr & b) { a.swap(b); } // get_pointer() enables boost::mem_fn to recognize shared_ptr template inline T * get_pointer(shared_ptr const & p) { return p.get(); } } // namespace boost #endif // #ifndef BOOST_DETAIL_SHARED_PTR_NMT_HPP_INCLUDED wxformbuilder-3.1.59/src/boost/detail/numeric_traits.hpp0000644000175000017500000001515411143440027023676 0ustar rrmulderrrmulder// (C) Copyright David Abrahams 2001, Howard Hinnant 2001. // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // Template class numeric_traits -- // // Supplies: // // typedef difference_type -- a type used to represent the difference // between any two values of Number. // // Support: // 1. Not all specializations are supplied // // 2. Use of specializations that are not supplied will cause a // compile-time error // // 3. Users are free to specialize numeric_traits for any type. // // 4. Right now, specializations are only supplied for integer types. // // 5. On implementations which do not supply compile-time constants in // std::numeric_limits<>, only specializations for built-in integer types // are supplied. // // 6. Handling of numbers whose range of representation is at least as // great as boost::intmax_t can cause some differences to be // unrepresentable in difference_type: // // Number difference_type // ------ --------------- // signed Number // unsigned intmax_t // // template typename numeric_traits::difference_type // numeric_distance(Number x, Number y) // computes (y - x), attempting to avoid overflows. // // See http://www.boost.org for most recent version including documentation. // Revision History // 11 Feb 2001 - Use BOOST_STATIC_CONSTANT (David Abrahams) // 11 Feb 2001 - Rolled back ineffective Borland-specific code // (David Abrahams) // 10 Feb 2001 - Rolled in supposed Borland fixes from John Maddock, but // not seeing any improvement yet (David Abrahams) // 06 Feb 2001 - Factored if_true out into boost/detail/select_type.hpp // (David Abrahams) // 23 Jan 2001 - Fixed logic of difference_type selection, which was // completely wack. In the process, added digit_traits<> // to compute the number of digits in intmax_t even when // not supplied by numeric_limits<>. (David Abrahams) // 21 Jan 2001 - Created (David Abrahams) #ifndef BOOST_NUMERIC_TRAITS_HPP_DWA20001901 # define BOOST_NUMERIC_TRAITS_HPP_DWA20001901 # include # include # include # include # include # include namespace boost { namespace detail { // Template class is_signed -- determine whether a numeric type is signed // Requires that T is constructable from the literals -1 and 0. Compile-time // error results if that requirement is not met (and thus signedness is not // likely to have meaning for that type). template struct is_signed { #if defined(BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS) || defined(BOOST_MSVC) && BOOST_MSVC <= 1300 BOOST_STATIC_CONSTANT(bool, value = (Number(-1) < Number(0))); #else BOOST_STATIC_CONSTANT(bool, value = std::numeric_limits::is_signed); #endif }; # ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS // digit_traits - compute the number of digits in a built-in integer // type. Needed for implementations on which numeric_limits is not specialized // for intmax_t (e.g. VC6). template struct digit_traits_select; // numeric_limits is specialized; just select that version of digits template <> struct digit_traits_select { template struct traits { BOOST_STATIC_CONSTANT(int, digits = std::numeric_limits::digits); }; }; // numeric_limits is not specialized; compute digits from sizeof(T) template <> struct digit_traits_select { template struct traits { BOOST_STATIC_CONSTANT(int, digits = ( sizeof(T) * std::numeric_limits::digits - (is_signed::value ? 1 : 0)) ); }; }; // here's the "usable" template template struct digit_traits { typedef digit_traits_select< ::std::numeric_limits::is_specialized> selector; typedef typename selector::template traits traits; BOOST_STATIC_CONSTANT(int, digits = traits::digits); }; #endif // Template class integer_traits -- traits of various integer types // This should probably be rolled into boost::integer_traits one day, but I // need it to work without template struct integer_traits { # ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS private: typedef Integer integer_type; typedef std::numeric_limits x; # if defined(BOOST_MSVC) && BOOST_MSVC <= 1300 // for some reason, MSVC asserts when it shouldn't unless we make these // local definitions BOOST_STATIC_CONSTANT(bool, is_integer = x::is_integer); BOOST_STATIC_CONSTANT(bool, is_specialized = x::is_specialized); BOOST_STATIC_ASSERT(is_integer); BOOST_STATIC_ASSERT(is_specialized); # endif public: typedef typename if_true<(int(x::is_signed) && (!int(x::is_bounded) // digits is the number of no-sign bits || (int(x::digits) + 1 >= digit_traits::digits)))>::template then< Integer, typename if_true<(int(x::digits) + 1 < digit_traits::digits)>::template then< signed int, typename if_true<(int(x::digits) + 1 < digit_traits::digits)>::template then< signed long, // else intmax_t >::type>::type>::type difference_type; #else BOOST_STATIC_ASSERT(boost::is_integral::value); typedef typename if_true<(sizeof(Integer) >= sizeof(intmax_t))>::template then< typename if_true<(is_signed::value)>::template then< Integer, intmax_t >::type, typename if_true<(sizeof(Integer) < sizeof(std::ptrdiff_t))>::template then< std::ptrdiff_t, intmax_t >::type >::type difference_type; # endif }; // Right now, only supports integers, but should be expanded. template struct numeric_traits { typedef typename integer_traits::difference_type difference_type; }; template typename numeric_traits::difference_type numeric_distance(Number x, Number y) { typedef typename numeric_traits::difference_type difference_type; return difference_type(y) - difference_type(x); } }} #endif // BOOST_NUMERIC_TRAITS_HPP_DWA20001901 wxformbuilder-3.1.59/src/boost/detail/bad_weak_ptr.hpp0000644000175000017500000000256311143440027023270 0ustar rrmulderrrmulder#ifndef BOOST_BAD_WEAK_PTR_HPP_INCLUDED #define BOOST_BAD_WEAK_PTR_HPP_INCLUDED // MS compatible compilers support #pragma once #if defined(_MSC_VER) && (_MSC_VER >= 1020) # pragma once #endif // // detail/bad_weak_ptr.hpp // // Copyright (c) 2001, 2002, 2003 Peter Dimov and Multi Media Ltd. // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // #include #ifdef __BORLANDC__ # pragma warn -8026 // Functions with excep. spec. are not expanded inline #endif namespace boost { // The standard library that comes with Borland C++ 5.5.1, 5.6.4 // defines std::exception and its members as having C calling // convention (-pc). When the definition of bad_weak_ptr // is compiled with -ps, the compiler issues an error. // Hence, the temporary #pragma option -pc below. #if defined(__BORLANDC__) && __BORLANDC__ <= 0x564 # pragma option push -pc #endif class bad_weak_ptr: public std::exception { public: virtual char const * what() const throw() { return "boost::bad_weak_ptr"; } }; #if defined(__BORLANDC__) && __BORLANDC__ <= 0x564 # pragma option pop #endif } // namespace boost #ifdef __BORLANDC__ # pragma warn .8026 // Functions with excep. spec. are not expanded inline #endif #endif // #ifndef BOOST_BAD_WEAK_PTR_HPP_INCLUDED wxformbuilder-3.1.59/src/boost/detail/atomic_count_gcc.hpp0000644000175000017500000000245711143440027024150 0ustar rrmulderrrmulder#ifndef BOOST_DETAIL_ATOMIC_COUNT_GCC_HPP_INCLUDED #define BOOST_DETAIL_ATOMIC_COUNT_GCC_HPP_INCLUDED // // boost/detail/atomic_count_gcc.hpp // // atomic_count for GNU libstdc++ v3 // // http://gcc.gnu.org/onlinedocs/porting/Thread-safety.html // // Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd. // Copyright (c) 2002 Lars Gullik Bjnnes // Copyright 2003-2005 Peter Dimov // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // #include namespace boost { namespace detail { #if defined(__GLIBCXX__) // g++ 3.4+ using __gnu_cxx::__atomic_add; using __gnu_cxx::__exchange_and_add; #endif class atomic_count { public: explicit atomic_count(long v) : value_(v) {} void operator++() { __atomic_add(&value_, 1); } long operator--() { return __exchange_and_add(&value_, -1) - 1; } operator long() const { return __exchange_and_add(&value_, 0); } private: atomic_count(atomic_count const &); atomic_count & operator=(atomic_count const &); mutable _Atomic_word value_; }; } // namespace detail } // namespace boost #endif // #ifndef BOOST_DETAIL_ATOMIC_COUNT_GCC_HPP_INCLUDED wxformbuilder-3.1.59/src/boost/detail/sp_counted_base_nt.hpp0000644000175000017500000000377511143440027024512 0ustar rrmulderrrmulder#ifndef BOOST_DETAIL_SP_COUNTED_BASE_NT_HPP_INCLUDED #define BOOST_DETAIL_SP_COUNTED_BASE_NT_HPP_INCLUDED // MS compatible compilers support #pragma once #if defined(_MSC_VER) && (_MSC_VER >= 1020) # pragma once #endif // // detail/sp_counted_base_nt.hpp // // Copyright (c) 2001, 2002, 2003 Peter Dimov and Multi Media Ltd. // Copyright 2004-2005 Peter Dimov // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // #include namespace boost { namespace detail { class sp_counted_base { private: sp_counted_base( sp_counted_base const & ); sp_counted_base & operator= ( sp_counted_base const & ); long use_count_; // #shared long weak_count_; // #weak + (#shared != 0) public: sp_counted_base(): use_count_( 1 ), weak_count_( 1 ) { } virtual ~sp_counted_base() // nothrow { } // dispose() is called when use_count_ drops to zero, to release // the resources managed by *this. virtual void dispose() = 0; // nothrow // destroy() is called when weak_count_ drops to zero. virtual void destroy() // nothrow { delete this; } virtual void * get_deleter( std::type_info const & ti ) = 0; void add_ref_copy() { ++use_count_; } bool add_ref_lock() // true on success { if( use_count_ == 0 ) return false; ++use_count_; return true; } void release() // nothrow { if( --use_count_ == 0 ) { dispose(); weak_release(); } } void weak_add_ref() // nothrow { ++weak_count_; } void weak_release() // nothrow { if( --weak_count_ == 0 ) { destroy(); } } long use_count() const // nothrow { return use_count_; } }; } // namespace detail } // namespace boost #endif // #ifndef BOOST_DETAIL_SP_COUNTED_BASE_NT_HPP_INCLUDED wxformbuilder-3.1.59/src/boost/detail/workaround.hpp0000644000175000017500000000522211143440027023034 0ustar rrmulderrrmulder// Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #ifndef WORKAROUND_DWA2002126_HPP # define WORKAROUND_DWA2002126_HPP // Compiler/library version workaround macro // // Usage: // // #if BOOST_WORKAROUND(BOOST_MSVC, <= 1200) // ... // workaround code here // #endif // // When BOOST_STRICT_CONFIG is defined, expands to 0. Otherwise, the // first argument must be undefined or expand to a numeric // value. The above expands to: // // (BOOST_MSVC) != 0 && (BOOST_MSVC) <= 1200 // // When used for workarounds that apply to the latest known version // and all earlier versions of a compiler, the following convention // should be observed: // // #if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1301)) // // The version number in this case corresponds to the last version in // which the workaround was known to have been required. When // BOOST_DETECT_OUTDATED_WORKAROUNDS is not the defined, the macro // BOOST_TESTED_AT(x) expands to "!= 0", which effectively activates // the workaround for any version of the compiler. When // BOOST_DETECT_OUTDATED_WORKAROUNDS is defined, a compiler warning or // error will be issued if the compiler version exceeds the argument // to BOOST_TESTED_AT(). This can be used to locate workarounds which // may be obsoleted by newer versions. # ifndef BOOST_STRICT_CONFIG # define BOOST_WORKAROUND(symbol, test) \ ((symbol != 0) && (1 % (( (symbol test) ) + 1))) // ^ ^ ^ ^ // The extra level of parenthesis nesting above, along with the // BOOST_OPEN_PAREN indirection below, is required to satisfy the // broken preprocessor in MWCW 8.3 and earlier. // // The basic mechanism works as follows: // (symbol test) + 1 => if (symbol test) then 2 else 1 // 1 % ((symbol test) + 1) => if (symbol test) then 1 else 0 // // The complication with % is for cooperation with BOOST_TESTED_AT(). // When "test" is BOOST_TESTED_AT(x) and // BOOST_DETECT_OUTDATED_WORKAROUNDS is #defined, // // symbol test => if (symbol <= x) then 1 else -1 // (symbol test) + 1 => if (symbol <= x) then 2 else 0 // 1 % ((symbol test) + 1) => if (symbol <= x) then 1 else divide-by-zero // # ifdef BOOST_DETECT_OUTDATED_WORKAROUNDS # define BOOST_OPEN_PAREN ( # define BOOST_TESTED_AT(value) > value) ?(-1): BOOST_OPEN_PAREN 1 # else # define BOOST_TESTED_AT(value) != ((value)-(value)) # endif # else # define BOOST_WORKAROUND(symbol, test) 0 # endif #endif // WORKAROUND_DWA2002126_HPP wxformbuilder-3.1.59/src/boost/detail/limits.hpp0000644000175000017500000004001311143440027022137 0ustar rrmulderrrmulder/* * Copyright (c) 1997 * Silicon Graphics Computer Systems, Inc. * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Silicon Graphics makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. */ /* NOTE: This is not portable code. Parts of numeric_limits<> are * inherently machine-dependent, and this file is written for the MIPS * architecture and the SGI MIPSpro C++ compiler. Parts of it (in * particular, some of the characteristics of floating-point types) * are almost certainly incorrect for any other platform. */ /* The above comment is almost certainly out of date. This file works * on systems other than SGI MIPSpro C++ now. */ /* * Revision history: * 21 Sep 2001: * Only include if BOOST_NO_CWCHAR is defined. (Darin Adler) * 10 Aug 2001: * Added MIPS (big endian) to the big endian family. (Jens Maurer) * 13 Apr 2001: * Added powerpc to the big endian family. (Jeremy Siek) * 5 Apr 2001: * Added sparc (big endian) processor support (John Maddock). * Initial sub: * Modified by Jens Maurer for gcc 2.95 on x86. */ #ifndef BOOST_SGI_CPP_LIMITS #define BOOST_SGI_CPP_LIMITS #include #include #include #include #ifndef BOOST_NO_CWCHAR #include // for WCHAR_MIN and WCHAR_MAX #endif namespace std { enum float_round_style { round_indeterminate = -1, round_toward_zero = 0, round_to_nearest = 1, round_toward_infinity = 2, round_toward_neg_infinity = 3 }; enum float_denorm_style { denorm_indeterminate = -1, denorm_absent = 0, denorm_present = 1 }; // The C++ standard (section 18.2.1) requires that some of the members of // numeric_limits be static const data members that are given constant- // initializers within the class declaration. On compilers where the // BOOST_NO_INCLASS_MEMBER_INITIALIZATION macro is defined, it is impossible to write // a standard-conforming numeric_limits class. // // There are two possible workarounds: either initialize the data // members outside the class, or change them from data members to // enums. Neither workaround is satisfactory: the former makes it // impossible to use the data members in constant-expressions, and the // latter means they have the wrong type and that it is impossible to // take their addresses. We choose the former workaround. #ifdef BOOST_NO_INCLASS_MEMBER_INITIALIZATION # define BOOST_STL_DECLARE_LIMITS_MEMBER(__mem_type, __mem_name, __mem_value) \ enum { __mem_name = __mem_value } #else /* BOOST_NO_INCLASS_MEMBER_INITIALIZATION */ # define BOOST_STL_DECLARE_LIMITS_MEMBER(__mem_type, __mem_name, __mem_value) \ static const __mem_type __mem_name = __mem_value #endif /* BOOST_NO_INCLASS_MEMBER_INITIALIZATION */ // Base class for all specializations of numeric_limits. template class _Numeric_limits_base { public: BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_specialized, false); static __number min BOOST_PREVENT_MACRO_SUBSTITUTION () throw() { return __number(); } static __number max BOOST_PREVENT_MACRO_SUBSTITUTION () throw() { return __number(); } BOOST_STL_DECLARE_LIMITS_MEMBER(int, digits, 0); BOOST_STL_DECLARE_LIMITS_MEMBER(int, digits10, 0); BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_signed, false); BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_integer, false); BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_exact, false); BOOST_STL_DECLARE_LIMITS_MEMBER(int, radix, 0); static __number epsilon() throw() { return __number(); } static __number round_error() throw() { return __number(); } BOOST_STL_DECLARE_LIMITS_MEMBER(int, min_exponent, 0); BOOST_STL_DECLARE_LIMITS_MEMBER(int, min_exponent10, 0); BOOST_STL_DECLARE_LIMITS_MEMBER(int, max_exponent, 0); BOOST_STL_DECLARE_LIMITS_MEMBER(int, max_exponent10, 0); BOOST_STL_DECLARE_LIMITS_MEMBER(bool, has_infinity, false); BOOST_STL_DECLARE_LIMITS_MEMBER(bool, has_quiet_NaN, false); BOOST_STL_DECLARE_LIMITS_MEMBER(bool, has_signaling_NaN, false); BOOST_STL_DECLARE_LIMITS_MEMBER(float_denorm_style, has_denorm, denorm_absent); BOOST_STL_DECLARE_LIMITS_MEMBER(bool, has_denorm_loss, false); static __number infinity() throw() { return __number(); } static __number quiet_NaN() throw() { return __number(); } static __number signaling_NaN() throw() { return __number(); } static __number denorm_min() throw() { return __number(); } BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_iec559, false); BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_bounded, false); BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_modulo, false); BOOST_STL_DECLARE_LIMITS_MEMBER(bool, traps, false); BOOST_STL_DECLARE_LIMITS_MEMBER(bool, tinyness_before, false); BOOST_STL_DECLARE_LIMITS_MEMBER(float_round_style, round_style, round_toward_zero); }; // Base class for integers. template class _Integer_limits : public _Numeric_limits_base<_Int> { public: BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_specialized, true); static _Int min BOOST_PREVENT_MACRO_SUBSTITUTION () throw() { return __imin; } static _Int max BOOST_PREVENT_MACRO_SUBSTITUTION () throw() { return __imax; } BOOST_STL_DECLARE_LIMITS_MEMBER(int, digits, (__idigits < 0) ? (int)(sizeof(_Int) * CHAR_BIT) - (__imin == 0 ? 0 : 1) : __idigits); BOOST_STL_DECLARE_LIMITS_MEMBER(int, digits10, (digits * 301) / 1000); // log 2 = 0.301029995664... BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_signed, __imin != 0); BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_integer, true); BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_exact, true); BOOST_STL_DECLARE_LIMITS_MEMBER(int, radix, 2); BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_bounded, true); BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_modulo, true); }; #if defined(BOOST_BIG_ENDIAN) template struct float_helper{ static Number get_word() throw() { // sizeof(long double) == 16 const unsigned int _S_word[4] = { Word, 0, 0, 0 }; return *reinterpret_cast(&_S_word); } }; #else template struct float_helper{ static Number get_word() throw() { // sizeof(long double) == 12, but only 10 bytes significant const unsigned int _S_word[4] = { 0, 0, 0, Word }; return *reinterpret_cast( reinterpret_cast(&_S_word)+16- (sizeof(Number) == 12 ? 10 : sizeof(Number))); } }; #endif // Base class for floating-point numbers. template class _Floating_limits : public _Numeric_limits_base<__number> { public: BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_specialized, true); BOOST_STL_DECLARE_LIMITS_MEMBER(int, digits, __Digits); BOOST_STL_DECLARE_LIMITS_MEMBER(int, digits10, __Digits10); BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_signed, true); BOOST_STL_DECLARE_LIMITS_MEMBER(int, radix, 2); BOOST_STL_DECLARE_LIMITS_MEMBER(int, min_exponent, __MinExp); BOOST_STL_DECLARE_LIMITS_MEMBER(int, max_exponent, __MaxExp); BOOST_STL_DECLARE_LIMITS_MEMBER(int, min_exponent10, __MinExp10); BOOST_STL_DECLARE_LIMITS_MEMBER(int, max_exponent10, __MaxExp10); BOOST_STL_DECLARE_LIMITS_MEMBER(bool, has_infinity, true); BOOST_STL_DECLARE_LIMITS_MEMBER(bool, has_quiet_NaN, true); BOOST_STL_DECLARE_LIMITS_MEMBER(bool, has_signaling_NaN, true); BOOST_STL_DECLARE_LIMITS_MEMBER(float_denorm_style, has_denorm, denorm_indeterminate); BOOST_STL_DECLARE_LIMITS_MEMBER(bool, has_denorm_loss, false); static __number infinity() throw() { return float_helper<__number, __InfinityWord>::get_word(); } static __number quiet_NaN() throw() { return float_helper<__number,__QNaNWord>::get_word(); } static __number signaling_NaN() throw() { return float_helper<__number,__SNaNWord>::get_word(); } BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_iec559, __IsIEC559); BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_bounded, true); BOOST_STL_DECLARE_LIMITS_MEMBER(bool, traps, false /* was: true */ ); BOOST_STL_DECLARE_LIMITS_MEMBER(bool, tinyness_before, false); BOOST_STL_DECLARE_LIMITS_MEMBER(float_round_style, round_style, __RoundStyle); }; // Class numeric_limits // The unspecialized class. template class numeric_limits : public _Numeric_limits_base {}; // Specializations for all built-in integral types. template<> class numeric_limits : public _Integer_limits {}; template<> class numeric_limits : public _Integer_limits {}; template<> class numeric_limits : public _Integer_limits {}; template<> class numeric_limits : public _Integer_limits {}; #ifndef BOOST_NO_INTRINSIC_WCHAR_T template<> class numeric_limits #if !defined(WCHAR_MAX) || !defined(WCHAR_MIN) #if defined(_WIN32) || defined(__CYGWIN__) : public _Integer_limits #elif defined(__hppa) // wchar_t has "unsigned int" as the underlying type : public _Integer_limits #else // assume that wchar_t has "int" as the underlying type : public _Integer_limits #endif #else // we have WCHAR_MIN and WCHAR_MAX defined, so use it : public _Integer_limits #endif {}; #endif template<> class numeric_limits : public _Integer_limits {}; template<> class numeric_limits : public _Integer_limits {}; template<> class numeric_limits : public _Integer_limits {}; template<> class numeric_limits : public _Integer_limits {}; template<> class numeric_limits : public _Integer_limits {}; template<> class numeric_limits : public _Integer_limits {}; #ifdef __GNUC__ // Some compilers have long long, but don't define the // LONGLONG_MIN and LONGLONG_MAX macros in limits.h. This // assumes that long long is 64 bits. #if !defined(LONGLONG_MAX) && !defined(ULONGLONG_MAX) # define ULONGLONG_MAX 0xffffffffffffffffLLU # define LONGLONG_MAX 0x7fffffffffffffffLL #endif #if !defined(LONGLONG_MIN) # define LONGLONG_MIN (-LONGLONG_MAX - 1) #endif #if !defined(ULONGLONG_MIN) # define ULONGLONG_MIN 0 #endif #endif /* __GNUC__ */ // Specializations for all built-in floating-point type. template<> class numeric_limits : public _Floating_limits { public: static float min BOOST_PREVENT_MACRO_SUBSTITUTION () throw() { return FLT_MIN; } static float denorm_min() throw() { return FLT_MIN; } static float max BOOST_PREVENT_MACRO_SUBSTITUTION () throw() { return FLT_MAX; } static float epsilon() throw() { return FLT_EPSILON; } static float round_error() throw() { return 0.5f; } // Units: ulps. }; template<> class numeric_limits : public _Floating_limits { public: static double min BOOST_PREVENT_MACRO_SUBSTITUTION () throw() { return DBL_MIN; } static double denorm_min() throw() { return DBL_MIN; } static double max BOOST_PREVENT_MACRO_SUBSTITUTION () throw() { return DBL_MAX; } static double epsilon() throw() { return DBL_EPSILON; } static double round_error() throw() { return 0.5; } // Units: ulps. }; template<> class numeric_limits : public _Floating_limits { public: static long double min BOOST_PREVENT_MACRO_SUBSTITUTION () throw() { return LDBL_MIN; } static long double denorm_min() throw() { return LDBL_MIN; } static long double max BOOST_PREVENT_MACRO_SUBSTITUTION () throw() { return LDBL_MAX; } static long double epsilon() throw() { return LDBL_EPSILON; } static long double round_error() throw() { return 4; } // Units: ulps. }; } // namespace std #endif /* BOOST_SGI_CPP_LIMITS */ // Local Variables: // mode:C++ // End: wxformbuilder-3.1.59/src/boost/detail/sp_counted_base_cw_x86.hpp0000644000175000017500000000601411143440027025174 0ustar rrmulderrrmulder#ifndef BOOST_DETAIL_SP_COUNTED_BASE_CW_X86_HPP_INCLUDED #define BOOST_DETAIL_SP_COUNTED_BASE_CW_X86_HPP_INCLUDED // MS compatible compilers support #pragma once #if defined(_MSC_VER) && (_MSC_VER >= 1020) # pragma once #endif // // detail/sp_counted_base_cw_x86.hpp - CodeWarrion on 486+ // // Copyright (c) 2001, 2002, 2003 Peter Dimov and Multi Media Ltd. // Copyright 2004-2005 Peter Dimov // Copyright 2005 Rene Rivera // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // // Lock-free algorithm by Alexander Terekhov // // Thanks to Ben Hitchings for the #weak + (#shared != 0) // formulation // #include namespace boost { namespace detail { inline int atomic_exchange_and_add( int * pw, int dv ) { // int r = *pw; // *pw += dv; // return r; asm { mov esi, [pw] mov eax, dv lock xadd dword ptr [esi], eax } } inline void atomic_increment( int * pw ) { //atomic_exchange_and_add( pw, 1 ); asm { mov esi, [pw] lock inc dword ptr [esi] } } inline int atomic_conditional_increment( int * pw ) { // int rv = *pw; // if( rv != 0 ) ++*pw; // return rv; asm { mov esi, [pw] mov eax, dword ptr [esi] L0: test eax, eax je L1 mov ebx, eax inc ebx lock cmpxchg dword ptr [esi], ebx jne L0 L1: } } class sp_counted_base { private: sp_counted_base( sp_counted_base const & ); sp_counted_base & operator= ( sp_counted_base const & ); int use_count_; // #shared int weak_count_; // #weak + (#shared != 0) public: sp_counted_base(): use_count_( 1 ), weak_count_( 1 ) { } virtual ~sp_counted_base() // nothrow { } // dispose() is called when use_count_ drops to zero, to release // the resources managed by *this. virtual void dispose() = 0; // nothrow // destroy() is called when weak_count_ drops to zero. virtual void destroy() // nothrow { delete this; } virtual void * get_deleter( std::type_info const & ti ) = 0; void add_ref_copy() { atomic_increment( &use_count_ ); } bool add_ref_lock() // true on success { return atomic_conditional_increment( &use_count_ ) != 0; } void release() // nothrow { if( atomic_exchange_and_add( &use_count_, -1 ) == 1 ) { dispose(); weak_release(); } } void weak_add_ref() // nothrow { atomic_increment( &weak_count_ ); } void weak_release() // nothrow { if( atomic_exchange_and_add( &weak_count_, -1 ) == 1 ) { destroy(); } } long use_count() const // nothrow { return static_cast( use_count_ ); } }; } // namespace detail } // namespace boost #endif // #ifndef BOOST_DETAIL_SP_COUNTED_BASE_GCC_X86_HPP_INCLUDED wxformbuilder-3.1.59/src/boost/detail/ob_compressed_pair.hpp0000644000175000017500000004056711143440027024513 0ustar rrmulderrrmulder// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000. // Use, modification and distribution are subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt). // // See http://www.boost.org/libs/utility for most recent version including documentation. // see libs/utility/compressed_pair.hpp // /* Release notes: 20 Jan 2001: Fixed obvious bugs (David Abrahams) 07 Oct 2000: Added better single argument constructor support. 03 Oct 2000: Added VC6 support (JM). 23rd July 2000: Additional comments added. (JM) Jan 2000: Original version: this version crippled for use with crippled compilers - John Maddock Jan 2000. */ #ifndef BOOST_OB_COMPRESSED_PAIR_HPP #define BOOST_OB_COMPRESSED_PAIR_HPP #include #ifndef BOOST_OBJECT_TYPE_TRAITS_HPP #include #endif #ifndef BOOST_SAME_TRAITS_HPP #include #endif #ifndef BOOST_CALL_TRAITS_HPP #include #endif namespace boost { #ifdef BOOST_MSVC6_MEMBER_TEMPLATES // // use member templates to emulate // partial specialisation. Note that due to // problems with overload resolution with VC6 // each of the compressed_pair versions that follow // have one template single-argument constructor // in place of two specific constructors: // template class compressed_pair; namespace detail{ template struct best_conversion_traits { typedef char one; typedef char (&two)[2]; static A a; static one test(T1); static two test(T2); enum { value = sizeof(test(a)) }; }; template struct init_one; template <> struct init_one<1> { template static void init(const A& a, T1* p1, T2*) { *p1 = a; } }; template <> struct init_one<2> { template static void init(const A& a, T1*, T2* p2) { *p2 = a; } }; // T1 != T2, both non-empty template class compressed_pair_0 { private: T1 _first; T2 _second; public: typedef T1 first_type; typedef T2 second_type; typedef typename call_traits::param_type first_param_type; typedef typename call_traits::param_type second_param_type; typedef typename call_traits::reference first_reference; typedef typename call_traits::reference second_reference; typedef typename call_traits::const_reference first_const_reference; typedef typename call_traits::const_reference second_const_reference; compressed_pair_0() : _first(), _second() {} compressed_pair_0(first_param_type x, second_param_type y) : _first(x), _second(y) {} template explicit compressed_pair_0(const A& val) { init_one::value>::init(val, &_first, &_second); } compressed_pair_0(const ::boost::compressed_pair& x) : _first(x.first()), _second(x.second()) {} #if 0 compressed_pair_0& operator=(const compressed_pair_0& x) { cout << "assigning compressed pair 0" << endl; _first = x._first; _second = x._second; cout << "finished assigning compressed pair 0" << endl; return *this; } #endif first_reference first() { return _first; } first_const_reference first() const { return _first; } second_reference second() { return _second; } second_const_reference second() const { return _second; } void swap(compressed_pair_0& y) { using std::swap; swap(_first, y._first); swap(_second, y._second); } }; // T1 != T2, T2 empty template class compressed_pair_1 : T2 { private: T1 _first; public: typedef T1 first_type; typedef T2 second_type; typedef typename call_traits::param_type first_param_type; typedef typename call_traits::param_type second_param_type; typedef typename call_traits::reference first_reference; typedef typename call_traits::reference second_reference; typedef typename call_traits::const_reference first_const_reference; typedef typename call_traits::const_reference second_const_reference; compressed_pair_1() : T2(), _first() {} compressed_pair_1(first_param_type x, second_param_type y) : T2(y), _first(x) {} template explicit compressed_pair_1(const A& val) { init_one::value>::init(val, &_first, static_cast(this)); } compressed_pair_1(const ::boost::compressed_pair& x) : T2(x.second()), _first(x.first()) {} #if defined(BOOST_MSVC) && BOOST_MSVC <= 1300 // Total weirdness. If the assignment to _first is moved after // the call to the inherited operator=, then this breaks graph/test/graph.cpp // by way of iterator_adaptor. compressed_pair_1& operator=(const compressed_pair_1& x) { _first = x._first; T2::operator=(x); return *this; } #endif first_reference first() { return _first; } first_const_reference first() const { return _first; } second_reference second() { return *this; } second_const_reference second() const { return *this; } void swap(compressed_pair_1& y) { // no need to swap empty base class: using std::swap; swap(_first, y._first); } }; // T1 != T2, T1 empty template class compressed_pair_2 : T1 { private: T2 _second; public: typedef T1 first_type; typedef T2 second_type; typedef typename call_traits::param_type first_param_type; typedef typename call_traits::param_type second_param_type; typedef typename call_traits::reference first_reference; typedef typename call_traits::reference second_reference; typedef typename call_traits::const_reference first_const_reference; typedef typename call_traits::const_reference second_const_reference; compressed_pair_2() : T1(), _second() {} compressed_pair_2(first_param_type x, second_param_type y) : T1(x), _second(y) {} template explicit compressed_pair_2(const A& val) { init_one::value>::init(val, static_cast(this), &_second); } compressed_pair_2(const ::boost::compressed_pair& x) : T1(x.first()), _second(x.second()) {} #if 0 compressed_pair_2& operator=(const compressed_pair_2& x) { cout << "assigning compressed pair 2" << endl; T1::operator=(x); _second = x._second; cout << "finished assigning compressed pair 2" << endl; return *this; } #endif first_reference first() { return *this; } first_const_reference first() const { return *this; } second_reference second() { return _second; } second_const_reference second() const { return _second; } void swap(compressed_pair_2& y) { // no need to swap empty base class: using std::swap; swap(_second, y._second); } }; // T1 != T2, both empty template class compressed_pair_3 : T1, T2 { public: typedef T1 first_type; typedef T2 second_type; typedef typename call_traits::param_type first_param_type; typedef typename call_traits::param_type second_param_type; typedef typename call_traits::reference first_reference; typedef typename call_traits::reference second_reference; typedef typename call_traits::const_reference first_const_reference; typedef typename call_traits::const_reference second_const_reference; compressed_pair_3() : T1(), T2() {} compressed_pair_3(first_param_type x, second_param_type y) : T1(x), T2(y) {} template explicit compressed_pair_3(const A& val) { init_one::value>::init(val, static_cast(this), static_cast(this)); } compressed_pair_3(const ::boost::compressed_pair& x) : T1(x.first()), T2(x.second()) {} first_reference first() { return *this; } first_const_reference first() const { return *this; } second_reference second() { return *this; } second_const_reference second() const { return *this; } void swap(compressed_pair_3& y) { // no need to swap empty base classes: } }; // T1 == T2, and empty template class compressed_pair_4 : T1 { public: typedef T1 first_type; typedef T2 second_type; typedef typename call_traits::param_type first_param_type; typedef typename call_traits::param_type second_param_type; typedef typename call_traits::reference first_reference; typedef typename call_traits::reference second_reference; typedef typename call_traits::const_reference first_const_reference; typedef typename call_traits::const_reference second_const_reference; compressed_pair_4() : T1() {} compressed_pair_4(first_param_type x, second_param_type y) : T1(x), m_second(y) {} // only one single argument constructor since T1 == T2 explicit compressed_pair_4(first_param_type x) : T1(x), m_second(x) {} compressed_pair_4(const ::boost::compressed_pair& x) : T1(x.first()), m_second(x.second()) {} first_reference first() { return *this; } first_const_reference first() const { return *this; } second_reference second() { return m_second; } second_const_reference second() const { return m_second; } void swap(compressed_pair_4& y) { // no need to swap empty base classes: } private: T2 m_second; }; // T1 == T2, not empty template class compressed_pair_5 { private: T1 _first; T2 _second; public: typedef T1 first_type; typedef T2 second_type; typedef typename call_traits::param_type first_param_type; typedef typename call_traits::param_type second_param_type; typedef typename call_traits::reference first_reference; typedef typename call_traits::reference second_reference; typedef typename call_traits::const_reference first_const_reference; typedef typename call_traits::const_reference second_const_reference; compressed_pair_5() : _first(), _second() {} compressed_pair_5(first_param_type x, second_param_type y) : _first(x), _second(y) {} // only one single argument constructor since T1 == T2 explicit compressed_pair_5(first_param_type x) : _first(x), _second(x) {} compressed_pair_5(const ::boost::compressed_pair& c) : _first(c.first()), _second(c.second()) {} first_reference first() { return _first; } first_const_reference first() const { return _first; } second_reference second() { return _second; } second_const_reference second() const { return _second; } void swap(compressed_pair_5& y) { using std::swap; swap(_first, y._first); swap(_second, y._second); } }; template struct compressed_pair_chooser { template struct rebind { typedef compressed_pair_0 type; }; }; template <> struct compressed_pair_chooser { template struct rebind { typedef compressed_pair_1 type; }; }; template <> struct compressed_pair_chooser { template struct rebind { typedef compressed_pair_2 type; }; }; template <> struct compressed_pair_chooser { template struct rebind { typedef compressed_pair_3 type; }; }; template <> struct compressed_pair_chooser { template struct rebind { typedef compressed_pair_4 type; }; }; template <> struct compressed_pair_chooser { template struct rebind { typedef compressed_pair_5 type; }; }; template struct compressed_pair_traits { private: typedef compressed_pair_chooser::value, is_empty::value, is_same::value> chooser; typedef typename chooser::template rebind bound_type; public: typedef typename bound_type::type type; }; } // namespace detail template class compressed_pair : public detail::compressed_pair_traits::type { private: typedef typename detail::compressed_pair_traits::type base_type; public: typedef T1 first_type; typedef T2 second_type; typedef typename call_traits::param_type first_param_type; typedef typename call_traits::param_type second_param_type; typedef typename call_traits::reference first_reference; typedef typename call_traits::reference second_reference; typedef typename call_traits::const_reference first_const_reference; typedef typename call_traits::const_reference second_const_reference; compressed_pair() : base_type() {} compressed_pair(first_param_type x, second_param_type y) : base_type(x, y) {} template explicit compressed_pair(const A& x) : base_type(x){} first_reference first() { return base_type::first(); } first_const_reference first() const { return base_type::first(); } second_reference second() { return base_type::second(); } second_const_reference second() const { return base_type::second(); } }; template inline void swap(compressed_pair& x, compressed_pair& y) { x.swap(y); } #else // no partial specialisation, no member templates: template class compressed_pair { private: T1 _first; T2 _second; public: typedef T1 first_type; typedef T2 second_type; typedef typename call_traits::param_type first_param_type; typedef typename call_traits::param_type second_param_type; typedef typename call_traits::reference first_reference; typedef typename call_traits::reference second_reference; typedef typename call_traits::const_reference first_const_reference; typedef typename call_traits::const_reference second_const_reference; compressed_pair() : _first(), _second() {} compressed_pair(first_param_type x, second_param_type y) : _first(x), _second(y) {} explicit compressed_pair(first_param_type x) : _first(x), _second() {} // can't define this in case T1 == T2: // explicit compressed_pair(second_param_type y) : _first(), _second(y) {} first_reference first() { return _first; } first_const_reference first() const { return _first; } second_reference second() { return _second; } second_const_reference second() const { return _second; } void swap(compressed_pair& y) { using std::swap; swap(_first, y._first); swap(_second, y._second); } }; template inline void swap(compressed_pair& x, compressed_pair& y) { x.swap(y); } #endif } // boost #endif // BOOST_OB_COMPRESSED_PAIR_HPP wxformbuilder-3.1.59/src/boost/detail/named_template_params.hpp0000644000175000017500000001371211143440027025166 0ustar rrmulderrrmulder// (C) Copyright Jeremy Siek 2001. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // Revision History: // 04 Oct 2001 David Abrahams // Changed name of "bind" to "select" to avoid problems with MSVC. #ifndef BOOST_DETAIL_NAMED_TEMPLATE_PARAMS_HPP #define BOOST_DETAIL_NAMED_TEMPLATE_PARAMS_HPP #include #include // for is_reference #if defined(__BORLANDC__) #include #endif namespace boost { namespace detail { struct default_argument { }; struct dummy_default_gen { template struct select { typedef default_argument type; }; }; // This class template is a workaround for MSVC. template struct default_generator { typedef detail::dummy_default_gen type; }; template struct is_default { enum { value = false }; typedef type_traits::no_type type; }; template <> struct is_default { enum { value = true }; typedef type_traits::yes_type type; }; struct choose_default { template struct select { typedef typename default_generator::type Gen; typedef typename Gen::template select::type type; }; }; struct choose_arg { template struct select { typedef Arg type; }; }; #if defined(__BORLANDC__) template struct choose_arg_or_default { typedef choose_arg type; }; template <> struct choose_arg_or_default { typedef choose_default type; }; #else template struct choose_arg_or_default { typedef choose_arg type; }; template <> struct choose_arg_or_default { typedef choose_default type; }; #endif template class resolve_default { #if defined(__BORLANDC__) typedef typename choose_arg_or_default::type>::type Selector; #else // This usually works for Borland, but I'm seeing weird errors in // iterator_adaptor_test.cpp when using this method. enum { is_def = is_default::value }; typedef typename choose_arg_or_default::type Selector; #endif public: typedef typename Selector ::template select::type type; }; // To differentiate an unnamed parameter from a traits generator // we use is_convertible. struct named_template_param_base { }; template struct is_named_param_list { enum { value = is_convertible::value }; }; struct choose_named_params { template struct select { typedef Prev type; }; }; struct choose_default_arg { template struct select { typedef detail::default_argument type; }; }; template struct choose_default_dispatch_; template <> struct choose_default_dispatch_ { typedef choose_named_params type; }; template <> struct choose_default_dispatch_ { typedef choose_default_arg type; }; // The use of inheritance here is a Solaris Forte 6 workaround. template struct choose_default_dispatch : public choose_default_dispatch_ { }; template struct choose_default_argument { enum { is_named = is_named_param_list::value }; typedef typename choose_default_dispatch::type Selector; typedef typename Selector::template select::type type; }; // This macro assumes that there is a class named default_##TYPE // defined before the application of the macro. This class should // have a single member class template named "select" with two // template parameters: the type of the class being created (e.g., // the iterator_adaptor type when creating iterator adaptors) and // a traits class. The select class should have a single typedef // named "type" that produces the default for TYPE. See // boost/iterator_adaptors.hpp for an example usage. Also, // applications of this macro must be placed in namespace // boost::detail. #define BOOST_NAMED_TEMPLATE_PARAM(TYPE) \ struct get_##TYPE##_from_named { \ template \ struct select { \ typedef typename NamedParams::traits NamedTraits; \ typedef typename NamedTraits::TYPE TYPE; \ typedef typename resolve_default::type type; \ }; \ }; \ struct pass_thru_##TYPE { \ template struct select { \ typedef typename resolve_default::type type; \ };\ }; \ template \ struct get_##TYPE##_dispatch { }; \ template <> struct get_##TYPE##_dispatch<1> { \ typedef get_##TYPE##_from_named type; \ }; \ template <> struct get_##TYPE##_dispatch<0> { \ typedef pass_thru_##TYPE type; \ }; \ template \ class get_##TYPE { \ enum { is_named = is_named_param_list::value }; \ typedef typename get_##TYPE##_dispatch::type Selector; \ public: \ typedef typename Selector::template select::type type; \ }; \ template <> struct default_generator { \ typedef default_##TYPE type; \ } } // namespace detail } // namespace boost #endif // BOOST_DETAIL_NAMED_TEMPLATE_PARAMS_HPP wxformbuilder-3.1.59/src/boost/detail/binary_search.hpp0000644000175000017500000001432611143440027023457 0ustar rrmulderrrmulder// Copyright (c) 2000 David Abrahams. // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // Copyright (c) 1994 // Hewlett-Packard Company // // Permission to use, copy, modify, distribute and sell this software // and its documentation for any purpose is hereby granted without fee, // provided that the above copyright notice appear in all copies and // that both that copyright notice and this permission notice appear // in supporting documentation. Hewlett-Packard Company makes no // representations about the suitability of this software for any // purpose. It is provided "as is" without express or implied warranty. // // Copyright (c) 1996 // Silicon Graphics Computer Systems, Inc. // // Permission to use, copy, modify, distribute and sell this software // and its documentation for any purpose is hereby granted without fee, // provided that the above copyright notice appear in all copies and // that both that copyright notice and this permission notice appear // in supporting documentation. Silicon Graphics makes no // representations about the suitability of this software for any // purpose. It is provided "as is" without express or implied warranty. // #ifndef BINARY_SEARCH_DWA_122600_H_ # define BINARY_SEARCH_DWA_122600_H_ # include # include namespace boost { namespace detail { template ForwardIter lower_bound(ForwardIter first, ForwardIter last, const Tp& val) { typedef detail::iterator_traits traits; typename traits::difference_type len = boost::detail::distance(first, last); typename traits::difference_type half; ForwardIter middle; while (len > 0) { half = len >> 1; middle = first; std::advance(middle, half); if (*middle < val) { first = middle; ++first; len = len - half - 1; } else len = half; } return first; } template ForwardIter lower_bound(ForwardIter first, ForwardIter last, const Tp& val, Compare comp) { typedef detail::iterator_traits traits; typename traits::difference_type len = boost::detail::distance(first, last); typename traits::difference_type half; ForwardIter middle; while (len > 0) { half = len >> 1; middle = first; std::advance(middle, half); if (comp(*middle, val)) { first = middle; ++first; len = len - half - 1; } else len = half; } return first; } template ForwardIter upper_bound(ForwardIter first, ForwardIter last, const Tp& val) { typedef detail::iterator_traits traits; typename traits::difference_type len = boost::detail::distance(first, last); typename traits::difference_type half; ForwardIter middle; while (len > 0) { half = len >> 1; middle = first; std::advance(middle, half); if (val < *middle) len = half; else { first = middle; ++first; len = len - half - 1; } } return first; } template ForwardIter upper_bound(ForwardIter first, ForwardIter last, const Tp& val, Compare comp) { typedef detail::iterator_traits traits; typename traits::difference_type len = boost::detail::distance(first, last); typename traits::difference_type half; ForwardIter middle; while (len > 0) { half = len >> 1; middle = first; std::advance(middle, half); if (comp(val, *middle)) len = half; else { first = middle; ++first; len = len - half - 1; } } return first; } template std::pair equal_range(ForwardIter first, ForwardIter last, const Tp& val) { typedef detail::iterator_traits traits; typename traits::difference_type len = boost::detail::distance(first, last); typename traits::difference_type half; ForwardIter middle, left, right; while (len > 0) { half = len >> 1; middle = first; std::advance(middle, half); if (*middle < val) { first = middle; ++first; len = len - half - 1; } else if (val < *middle) len = half; else { left = boost::detail::lower_bound(first, middle, val); std::advance(first, len); right = boost::detail::upper_bound(++middle, first, val); return std::pair(left, right); } } return std::pair(first, first); } template std::pair equal_range(ForwardIter first, ForwardIter last, const Tp& val, Compare comp) { typedef detail::iterator_traits traits; typename traits::difference_type len = boost::detail::distance(first, last); typename traits::difference_type half; ForwardIter middle, left, right; while (len > 0) { half = len >> 1; middle = first; std::advance(middle, half); if (comp(*middle, val)) { first = middle; ++first; len = len - half - 1; } else if (comp(val, *middle)) len = half; else { left = boost::detail::lower_bound(first, middle, val, comp); std::advance(first, len); right = boost::detail::upper_bound(++middle, first, val, comp); return std::pair(left, right); } } return std::pair(first, first); } template bool binary_search(ForwardIter first, ForwardIter last, const Tp& val) { ForwardIter i = boost::detail::lower_bound(first, last, val); return i != last && !(val < *i); } template bool binary_search(ForwardIter first, ForwardIter last, const Tp& val, Compare comp) { ForwardIter i = boost::detail::lower_bound(first, last, val, comp); return i != last && !comp(val, *i); } }} // namespace boost::detail #endif // BINARY_SEARCH_DWA_122600_H_ wxformbuilder-3.1.59/src/boost/detail/atomic_count.hpp0000644000175000017500000000576511143440027023341 0ustar rrmulderrrmulder#ifndef BOOST_DETAIL_ATOMIC_COUNT_HPP_INCLUDED #define BOOST_DETAIL_ATOMIC_COUNT_HPP_INCLUDED // MS compatible compilers support #pragma once #if defined(_MSC_VER) && (_MSC_VER >= 1020) # pragma once #endif // // boost/detail/atomic_count.hpp - thread/SMP safe reference counter // // Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd. // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // typedef boost::detail::atomic_count; // // atomic_count a(n); // // (n is convertible to long) // // Effects: Constructs an atomic_count with an initial value of n // // a; // // Returns: (long) the current value of a // // ++a; // // Effects: Atomically increments the value of a // Returns: nothing // // --a; // // Effects: Atomically decrements the value of a // Returns: (long) zero if the new value of a is zero, // unspecified non-zero value otherwise (usually the new value) // // Important note: when --a returns zero, it must act as a // read memory barrier (RMB); i.e. the calling thread must // have a synchronized view of the memory // // On Intel IA-32 (x86) memory is always synchronized, so this // is not a problem. // // On many architectures the atomic instructions already act as // a memory barrier. // // This property is necessary for proper reference counting, since // a thread can update the contents of a shared object, then // release its reference, and another thread may immediately // release the last reference causing object destruction. // // The destructor needs to have a synchronized view of the // object to perform proper cleanup. // // Original example by Alexander Terekhov: // // Given: // // - a mutable shared object OBJ; // - two threads THREAD1 and THREAD2 each holding // a private smart_ptr object pointing to that OBJ. // // t1: THREAD1 updates OBJ (thread-safe via some synchronization) // and a few cycles later (after "unlock") destroys smart_ptr; // // t2: THREAD2 destroys smart_ptr WITHOUT doing any synchronization // with respect to shared mutable object OBJ; OBJ destructors // are called driven by smart_ptr interface... // #include #ifndef BOOST_HAS_THREADS namespace boost { namespace detail { typedef long atomic_count; } } #elif defined(BOOST_AC_USE_PTHREADS) # include #elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__) # include #elif defined(__GLIBCPP__) || defined(__GLIBCXX__) # include #elif defined(BOOST_HAS_PTHREADS) # define BOOST_AC_USE_PTHREADS # include #else // Use #define BOOST_DISABLE_THREADS to avoid the error #error Unrecognized threading platform #endif #endif // #ifndef BOOST_DETAIL_ATOMIC_COUNT_HPP_INCLUDED wxformbuilder-3.1.59/src/boost/detail/lwm_win32.hpp0000644000175000017500000000544011143440027022464 0ustar rrmulderrrmulder#ifndef BOOST_DETAIL_LWM_WIN32_HPP_INCLUDED #define BOOST_DETAIL_LWM_WIN32_HPP_INCLUDED // MS compatible compilers support #pragma once #if defined(_MSC_VER) && (_MSC_VER >= 1020) # pragma once #endif // // boost/detail/lwm_win32.hpp // // Copyright (c) 2002, 2003 Peter Dimov // // Permission to copy, use, modify, sell and distribute this software // is granted provided this copyright notice appears in all copies. // This software is provided "as is" without express or implied // warranty, and with no claim as to its suitability for any purpose. // #ifdef BOOST_USE_WINDOWS_H # include #endif #ifdef __BORLANDC__ # pragma warn -8027 // Functions containing while are not expanded inline #endif namespace boost { namespace detail { #ifndef BOOST_USE_WINDOWS_H #ifdef _WIN64 // Intel 6.0 on Win64 version, posted by Tim Fenders to [boost-users] extern "C" long_type __cdecl _InterlockedExchange(long volatile *, long); #pragma intrinsic(_InterlockedExchange) inline long InterlockedExchange(long volatile* lp, long l) { return _InterlockedExchange(lp, l); } #else // _WIN64 extern "C" __declspec(dllimport) long __stdcall InterlockedExchange(long volatile *, long); #endif // _WIN64 extern "C" __declspec(dllimport) void __stdcall Sleep(unsigned long); #endif // #ifndef BOOST_USE_WINDOWS_H class lightweight_mutex { private: long l_; lightweight_mutex(lightweight_mutex const &); lightweight_mutex & operator=(lightweight_mutex const &); public: lightweight_mutex(): l_(0) { } class scoped_lock; friend class scoped_lock; class scoped_lock { private: lightweight_mutex & m_; scoped_lock(scoped_lock const &); scoped_lock & operator=(scoped_lock const &); public: explicit scoped_lock(lightweight_mutex & m): m_(m) { while( InterlockedExchange(&m_.l_, 1) ) { // Note: changed to Sleep(1) from Sleep(0). // According to MSDN, Sleep(0) will never yield // to a lower-priority thread, whereas Sleep(1) // will. Performance seems not to be affected. Sleep(1); } } ~scoped_lock() { InterlockedExchange(&m_.l_, 0); // Note: adding a yield here will make // the spinlock more fair and will increase the overall // performance of some applications substantially in // high contention situations, but will penalize the // low contention / single thread case up to 5x } }; }; } // namespace detail } // namespace boost #ifdef __BORLANDC__ # pragma warn .8027 // Functions containing while are not expanded inline #endif #endif // #ifndef BOOST_DETAIL_LWM_WIN32_HPP_INCLUDED wxformbuilder-3.1.59/src/boost/detail/reference_content.hpp0000644000175000017500000000571611143440027024341 0ustar rrmulderrrmulder//----------------------------------------------------------------------------- // boost detail/reference_content.hpp header file // See http://www.boost.org for updates, documentation, and revision history. //----------------------------------------------------------------------------- // // Copyright (c) 2003 // Eric Friedman // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_DETAIL_REFERENCE_CONTENT_HPP #define BOOST_DETAIL_REFERENCE_CONTENT_HPP #include "boost/config.hpp" #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) # include "boost/mpl/bool.hpp" # include "boost/type_traits/has_nothrow_copy.hpp" #else # include "boost/mpl/if.hpp" # include "boost/type_traits/is_reference.hpp" #endif #include "boost/mpl/void.hpp" namespace boost { namespace detail { /////////////////////////////////////////////////////////////////////////////// // (detail) class template reference_content // // Non-Assignable wrapper for references. // template class reference_content { private: // representation RefT content_; public: // structors ~reference_content() { } reference_content(RefT r) : content_( r ) { } reference_content(const reference_content& operand) : content_( operand.content_ ) { } private: // non-Assignable reference_content& operator=(const reference_content&); public: // queries RefT get() const { return content_; } }; /////////////////////////////////////////////////////////////////////////////// // (detail) metafunction make_reference_content // // Wraps with reference_content if specified type is reference. // template struct make_reference_content; #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) template struct make_reference_content { typedef T type; }; template struct make_reference_content< T& > { typedef reference_content type; }; #else // defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) template struct make_reference_content : mpl::if_< is_reference , reference_content , T > { }; #endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION workaround template <> struct make_reference_content< mpl::void_ > { template struct apply : make_reference_content { }; typedef mpl::void_ type; }; } // namespace detail /////////////////////////////////////////////////////////////////////////////// // reference_content type traits specializations // #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) template struct has_nothrow_copy< ::boost::detail::reference_content< T& > > : mpl::true_ { }; #endif // !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) } // namespace boost #endif // BOOST_DETAIL_REFERENCE_CONTENT_HPP wxformbuilder-3.1.59/src/boost/detail/in_place_factory_suffix.hpp0000644000175000017500000000141711143440027025530 0ustar rrmulderrrmulder// Copyright (C) 2003, Fernando Luis Cacciola Carballal. // // Use, modification, and distribution is subject to the Boost Software // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // See http://www.boost.org/lib/optional for documentation. // // You are welcome to contact the author at: // fernando_cacciola@hotmail.com // #ifndef BOOST_UTILITY_INPLACE_FACTORY_SUFFIX_25AGO2003_HPP #define BOOST_UTILITY_INPLACE_FACTORY_SUFFIX_25AGO2003_HPP #undef BOOST_DEFINE_INPLACE_FACTORY_CLASS_MEMBER_INIT #undef BOOST_DEFINE_INPLACE_FACTORY_CLASS_MEMBER_DECL #undef BOOST_DEFINE_INPLACE_FACTORY_CLASS_MEMBER_ARG #undef BOOST_MAX_INPLACE_FACTORY_ARITY #undef BOOST_UTILITY_INPLACE_FACTORY_PREFIX_25AGO2003_HPP #endif wxformbuilder-3.1.59/src/boost/detail/sp_counted_impl.hpp0000644000175000017500000001000111143440027024014 0ustar rrmulderrrmulder#ifndef BOOST_DETAIL_SP_COUNTED_IMPL_HPP_INCLUDED #define BOOST_DETAIL_SP_COUNTED_IMPL_HPP_INCLUDED // MS compatible compilers support #pragma once #if defined(_MSC_VER) && (_MSC_VER >= 1020) # pragma once #endif // // detail/sp_counted_impl.hpp // // Copyright (c) 2001, 2002, 2003 Peter Dimov and Multi Media Ltd. // Copyright 2004-2005 Peter Dimov // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // #include #if defined(BOOST_SP_USE_STD_ALLOCATOR) && defined(BOOST_SP_USE_QUICK_ALLOCATOR) # error BOOST_SP_USE_STD_ALLOCATOR and BOOST_SP_USE_QUICK_ALLOCATOR are incompatible. #endif #include #include #if defined(BOOST_SP_USE_QUICK_ALLOCATOR) #include #endif #include // std::allocator #include // std::type_info in get_deleter #include // std::size_t namespace boost { #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) void sp_scalar_constructor_hook( void * px, std::size_t size, void * pn ); void sp_scalar_destructor_hook( void * px, std::size_t size, void * pn ); #endif namespace detail { template class sp_counted_impl_p: public sp_counted_base { private: X * px_; sp_counted_impl_p( sp_counted_impl_p const & ); sp_counted_impl_p & operator= ( sp_counted_impl_p const & ); typedef sp_counted_impl_p this_type; public: explicit sp_counted_impl_p( X * px ): px_( px ) { #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) boost::sp_scalar_constructor_hook( px, sizeof(X), this ); #endif } virtual void dispose() // nothrow { #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) boost::sp_scalar_destructor_hook( px_, sizeof(X), this ); #endif boost::checked_delete( px_ ); } virtual void * get_deleter( std::type_info const & ) { return 0; } #if defined(BOOST_SP_USE_STD_ALLOCATOR) void * operator new( std::size_t ) { return std::allocator().allocate( 1, static_cast(0) ); } void operator delete( void * p ) { std::allocator().deallocate( static_cast(p), 1 ); } #endif #if defined(BOOST_SP_USE_QUICK_ALLOCATOR) void * operator new( std::size_t ) { return quick_allocator::alloc(); } void operator delete( void * p ) { quick_allocator::dealloc( p ); } #endif }; // // Borland's Codeguard trips up over the -Vx- option here: // #ifdef __CODEGUARD__ # pragma option push -Vx- #endif template class sp_counted_impl_pd: public sp_counted_base { private: P ptr; // copy constructor must not throw D del; // copy constructor must not throw sp_counted_impl_pd( sp_counted_impl_pd const & ); sp_counted_impl_pd & operator= ( sp_counted_impl_pd const & ); typedef sp_counted_impl_pd this_type; public: // pre: d(p) must not throw sp_counted_impl_pd( P p, D d ): ptr(p), del(d) { } virtual void dispose() // nothrow { del( ptr ); } virtual void * get_deleter( std::type_info const & ti ) { return ti == typeid(D)? &del: 0; } #if defined(BOOST_SP_USE_STD_ALLOCATOR) void * operator new( std::size_t ) { return std::allocator().allocate( 1, static_cast(0) ); } void operator delete( void * p ) { std::allocator().deallocate( static_cast(p), 1 ); } #endif #if defined(BOOST_SP_USE_QUICK_ALLOCATOR) void * operator new( std::size_t ) { return quick_allocator::alloc(); } void operator delete( void * p ) { quick_allocator::dealloc( p ); } #endif }; #ifdef __CODEGUARD__ # pragma option pop #endif } // namespace detail } // namespace boost #endif // #ifndef BOOST_DETAIL_SP_COUNTED_IMPL_HPP_INCLUDED wxformbuilder-3.1.59/src/boost/detail/interlocked.hpp0000644000175000017500000000403011143440027023140 0ustar rrmulderrrmulder#ifndef BOOST_DETAIL_INTERLOCKED_HPP_INCLUDED #define BOOST_DETAIL_INTERLOCKED_HPP_INCLUDED // MS compatible compilers support #pragma once #if defined(_MSC_VER) && (_MSC_VER >= 1020) # pragma once #endif // // boost/detail/interlocked.hpp // // Copyright 2005 Peter Dimov // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // #include #if defined( BOOST_USE_WINDOWS_H ) # include # define BOOST_INTERLOCKED_INCREMENT InterlockedIncrement # define BOOST_INTERLOCKED_DECREMENT InterlockedDecrement # define BOOST_INTERLOCKED_COMPARE_EXCHANGE InterlockedCompareExchange #elif defined( BOOST_MSVC ) || defined( BOOST_INTEL_WIN ) extern "C" long __cdecl _InterlockedIncrement( long volatile * ); extern "C" long __cdecl _InterlockedDecrement( long volatile * ); extern "C" long __cdecl _InterlockedCompareExchange( long volatile *, long, long ); # pragma intrinsic( _InterlockedIncrement ) # pragma intrinsic( _InterlockedDecrement ) # pragma intrinsic( _InterlockedCompareExchange ) # define BOOST_INTERLOCKED_INCREMENT _InterlockedIncrement # define BOOST_INTERLOCKED_DECREMENT _InterlockedDecrement # define BOOST_INTERLOCKED_COMPARE_EXCHANGE _InterlockedCompareExchange #elif defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ ) namespace boost { namespace detail { extern "C" __declspec(dllimport) long __stdcall InterlockedIncrement( long volatile * ); extern "C" __declspec(dllimport) long __stdcall InterlockedDecrement( long volatile * ); extern "C" __declspec(dllimport) long __stdcall InterlockedCompareExchange( long volatile *, long, long ); } // namespace detail } // namespace boost # define BOOST_INTERLOCKED_INCREMENT InterlockedIncrement # define BOOST_INTERLOCKED_DECREMENT InterlockedDecrement # define BOOST_INTERLOCKED_COMPARE_EXCHANGE InterlockedCompareExchange #else # error "Interlocked intrinsics not available" #endif #endif // #ifndef BOOST_DETAIL_INTERLOCKED_HPP_INCLUDED wxformbuilder-3.1.59/src/boost/detail/select_type.hpp0000644000175000017500000000215211143440027023160 0ustar rrmulderrrmulder// (C) Copyright David Abrahams 2001. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // See http://www.boost.org for most recent version including documentation. // Revision History // 09 Feb 01 Applied John Maddock's Borland patch Moving // specialization to unspecialized template (David Abrahams) // 06 Feb 01 Created (David Abrahams) #ifndef SELECT_TYPE_DWA20010206_HPP # define SELECT_TYPE_DWA20010206_HPP namespace boost { namespace detail { // Template class if_true -- select among 2 types based on a bool constant expression // Usage: // typename if_true<(bool_const_expression)>::template then::type // HP aCC cannot deal with missing names for template value parameters template struct if_true { template struct then { typedef T type; }; }; template <> struct if_true { template struct then { typedef F type; }; }; }} #endif // SELECT_TYPE_DWA20010206_HPP wxformbuilder-3.1.59/src/boost/detail/call_traits.hpp0000644000175000017500000000742111143440027023145 0ustar rrmulderrrmulder// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000. // Use, modification and distribution are subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt). // // See http://www.boost.org/libs/utility for most recent version including documentation. // call_traits: defines typedefs for function usage // (see libs/utility/call_traits.htm) /* Release notes: 23rd July 2000: Fixed array specialization. (JM) Added Borland specific fixes for reference types (issue raised by Steve Cleary). */ #ifndef BOOST_DETAIL_CALL_TRAITS_HPP #define BOOST_DETAIL_CALL_TRAITS_HPP #ifndef BOOST_CONFIG_HPP #include #endif #include #include #include #include namespace boost{ namespace detail{ template struct ct_imp2 { typedef const T& param_type; }; template struct ct_imp2 { typedef const T param_type; }; template struct ct_imp { typedef const T& param_type; }; template struct ct_imp { typedef typename ct_imp2::param_type param_type; }; template struct ct_imp { typedef T const param_type; }; } template struct call_traits { public: typedef T value_type; typedef T& reference; typedef const T& const_reference; // // C++ Builder workaround: we should be able to define a compile time // constant and pass that as a single template parameter to ct_imp, // however compiler bugs prevent this - instead pass three bool's to // ct_imp and add an extra partial specialisation // of ct_imp to handle the logic. (JM) typedef typename detail::ct_imp< T, ::boost::is_pointer::value, ::boost::is_arithmetic::value >::param_type param_type; }; template struct call_traits { typedef T& value_type; typedef T& reference; typedef const T& const_reference; typedef T& param_type; // hh removed const }; #if BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT( 0x570 ) ) // these are illegal specialisations; cv-qualifies applied to // references have no effect according to [8.3.2p1], // C++ Builder requires them though as it treats cv-qualified // references as distinct types... template struct call_traits { typedef T& value_type; typedef T& reference; typedef const T& const_reference; typedef T& param_type; // hh removed const }; template struct call_traits { typedef T& value_type; typedef T& reference; typedef const T& const_reference; typedef T& param_type; // hh removed const }; template struct call_traits { typedef T& value_type; typedef T& reference; typedef const T& const_reference; typedef T& param_type; // hh removed const }; #endif #if !defined(BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS) template struct call_traits { private: typedef T array_type[N]; public: // degrades array to pointer: typedef const T* value_type; typedef array_type& reference; typedef const array_type& const_reference; typedef const T* const param_type; }; template struct call_traits { private: typedef const T array_type[N]; public: // degrades array to pointer: typedef const T* value_type; typedef array_type& reference; typedef const array_type& const_reference; typedef const T* const param_type; }; #endif } #endif // BOOST_DETAIL_CALL_TRAITS_HPP wxformbuilder-3.1.59/src/boost/detail/sp_counted_base_gcc_ppc.hpp0000644000175000017500000000650011143440027025454 0ustar rrmulderrrmulder#ifndef BOOST_DETAIL_SP_COUNTED_BASE_GCC_PPC_HPP_INCLUDED #define BOOST_DETAIL_SP_COUNTED_BASE_GCC_PPC_HPP_INCLUDED // MS compatible compilers support #pragma once #if defined(_MSC_VER) && (_MSC_VER >= 1020) # pragma once #endif // // detail/sp_counted_base_gcc_ppc.hpp - g++ on PowerPC // // Copyright (c) 2001, 2002, 2003 Peter Dimov and Multi Media Ltd. // Copyright 2004-2005 Peter Dimov // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // // Lock-free algorithm by Alexander Terekhov // // Thanks to Ben Hitchings for the #weak + (#shared != 0) // formulation // #include namespace boost { namespace detail { inline void atomic_increment( int * pw ) { // ++*pw; int tmp; __asm__ ( "0:\n\t" "lwarx %1, 0, %2\n\t" "addi %1, %1, 1\n\t" "stwcx. %1, 0, %2\n\t" "bne- 0b": "=m"( *pw ), "=&b"( tmp ): "r"( pw ): "cc" ); } inline int atomic_decrement( int * pw ) { // return --*pw; int rv; __asm__ __volatile__ ( "sync\n\t" "0:\n\t" "lwarx %1, 0, %2\n\t" "addi %1, %1, -1\n\t" "stwcx. %1, 0, %2\n\t" "bne- 0b\n\t" "isync": "=m"( *pw ), "=&b"( rv ): "r"( pw ): "memory", "cc" ); return rv; } inline int atomic_conditional_increment( int * pw ) { // if( *pw != 0 ) ++*pw; // return *pw; int rv; __asm__ ( "0:\n\t" "lwarx %1, 0, %2\n\t" "cmpwi %1, 0\n\t" "beq 1f\n\t" "addi %1, %1, 1\n\t" "1:\n\t" "stwcx. %1, 0, %2\n\t" "bne- 0b": "=m"( *pw ), "=&b"( rv ): "r"( pw ): "cc" ); return rv; } class sp_counted_base { private: sp_counted_base( sp_counted_base const & ); sp_counted_base & operator= ( sp_counted_base const & ); int use_count_; // #shared int weak_count_; // #weak + (#shared != 0) public: sp_counted_base(): use_count_( 1 ), weak_count_( 1 ) { } virtual ~sp_counted_base() // nothrow { } // dispose() is called when use_count_ drops to zero, to release // the resources managed by *this. virtual void dispose() = 0; // nothrow // destroy() is called when weak_count_ drops to zero. virtual void destroy() // nothrow { delete this; } virtual void * get_deleter( std::type_info const & ti ) = 0; void add_ref_copy() { atomic_increment( &use_count_ ); } bool add_ref_lock() // true on success { return atomic_conditional_increment( &use_count_ ) != 0; } void release() // nothrow { if( atomic_decrement( &use_count_ ) == 0 ) { dispose(); weak_release(); } } void weak_add_ref() // nothrow { atomic_increment( &weak_count_ ); } void weak_release() // nothrow { if( atomic_decrement( &weak_count_ ) == 0 ) { destroy(); } } long use_count() const // nothrow { return static_cast( use_count_ ); } }; } // namespace detail } // namespace boost #endif // #ifndef BOOST_DETAIL_SP_COUNTED_BASE_GCC_PPC_HPP_INCLUDED wxformbuilder-3.1.59/src/boost/detail/is_incrementable.hpp0000644000175000017500000000661711143440027024155 0ustar rrmulderrrmulder// Copyright David Abrahams 2004. Use, modification and distribution is // subject to the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef IS_INCREMENTABLE_DWA200415_HPP # define IS_INCREMENTABLE_DWA200415_HPP # include # include # include # include # include # include namespace boost { namespace detail { // is_incrementable metafunction // // Requires: Given x of type T&, if the expression ++x is well-formed // it must have complete type; otherwise, it must neither be ambiguous // nor violate access. // This namespace ensures that ADL doesn't mess things up. namespace is_incrementable_ { // a type returned from operator++ when no increment is found in the // type's own namespace struct tag {}; // any soaks up implicit conversions and makes the following // operator++ less-preferred than any other such operator that // might be found via ADL. struct any { template any(T const&); }; // This is a last-resort operator++ for when none other is found # if BOOST_WORKAROUND(__GNUC__, == 4) && __GNUC_MINOR__ == 0 && __GNUC_PATCHLEVEL__ == 2 } namespace is_incrementable_2 { is_incrementable_::tag operator++(is_incrementable_::any const&); is_incrementable_::tag operator++(is_incrementable_::any const&,int); } using namespace is_incrementable_2; namespace is_incrementable_ { # else tag operator++(any const&); tag operator++(any const&,int); # endif # if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3202)) \ || BOOST_WORKAROUND(BOOST_MSVC, <= 1300) # define BOOST_comma(a,b) (a) # else // In case an operator++ is found that returns void, we'll use ++x,0 tag operator,(tag,int); # define BOOST_comma(a,b) (a,b) # endif // two check overloads help us identify which operator++ was picked char (& check(tag) )[2]; template char check(T const&); template struct impl { static typename boost::remove_cv::type& x; BOOST_STATIC_CONSTANT( bool , value = sizeof(is_incrementable_::check(BOOST_comma(++x,0))) == 1 ); }; template struct postfix_impl { static typename boost::remove_cv::type& x; BOOST_STATIC_CONSTANT( bool , value = sizeof(is_incrementable_::check(BOOST_comma(x++,0))) == 1 ); }; } # undef BOOST_comma template struct is_incrementable BOOST_TT_AUX_BOOL_C_BASE(::boost::detail::is_incrementable_::impl::value) { BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(::boost::detail::is_incrementable_::impl::value) BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_incrementable,(T)) }; template struct is_postfix_incrementable BOOST_TT_AUX_BOOL_C_BASE(::boost::detail::is_incrementable_::impl::value) { BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(::boost::detail::is_incrementable_::postfix_impl::value) BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_postfix_incrementable,(T)) }; } // namespace detail BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(1, ::boost::detail::is_incrementable) BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(1, ::boost::detail::is_postfix_incrementable) } // namespace boost #endif // IS_INCREMENTABLE_DWA200415_HPP wxformbuilder-3.1.59/src/boost/detail/shared_array_nmt.hpp0000644000175000017500000000626111143440027024167 0ustar rrmulderrrmulder#ifndef BOOST_DETAIL_SHARED_ARRAY_NMT_HPP_INCLUDED #define BOOST_DETAIL_SHARED_ARRAY_NMT_HPP_INCLUDED // // detail/shared_array_nmt.hpp - shared_array.hpp without member templates // // (C) Copyright Greg Colvin and Beman Dawes 1998, 1999. // Copyright (c) 2001, 2002 Peter Dimov // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // See http://www.boost.org/libs/smart_ptr/shared_array.htm for documentation. // #include #include #include #include #include // for std::ptrdiff_t #include // for std::swap #include // for std::less #include // for std::bad_alloc namespace boost { template class shared_array { private: typedef detail::atomic_count count_type; public: typedef T element_type; explicit shared_array(T * p = 0): px(p) { #ifndef BOOST_NO_EXCEPTIONS try // prevent leak if new throws { pn = new count_type(1); } catch(...) { boost::checked_array_delete(p); throw; } #else pn = new count_type(1); if(pn == 0) { boost::checked_array_delete(p); boost::throw_exception(std::bad_alloc()); } #endif } ~shared_array() { if(--*pn == 0) { boost::checked_array_delete(px); delete pn; } } shared_array(shared_array const & r) : px(r.px) // never throws { pn = r.pn; ++*pn; } shared_array & operator=(shared_array const & r) { shared_array(r).swap(*this); return *this; } void reset(T * p = 0) { BOOST_ASSERT(p == 0 || p != px); shared_array(p).swap(*this); } T * get() const // never throws { return px; } T & operator[](std::ptrdiff_t i) const // never throws { BOOST_ASSERT(px != 0); BOOST_ASSERT(i >= 0); return px[i]; } long use_count() const // never throws { return *pn; } bool unique() const // never throws { return *pn == 1; } void swap(shared_array & other) // never throws { std::swap(px, other.px); std::swap(pn, other.pn); } private: T * px; // contained pointer count_type * pn; // ptr to reference counter }; // shared_array template inline bool operator==(shared_array const & a, shared_array const & b) { return a.get() == b.get(); } template inline bool operator!=(shared_array const & a, shared_array const & b) { return a.get() != b.get(); } template inline bool operator<(shared_array const & a, shared_array const & b) { return std::less()(a.get(), b.get()); } template void swap(shared_array & a, shared_array & b) { a.swap(b); } } // namespace boost #endif // #ifndef BOOST_DETAIL_SHARED_ARRAY_NMT_HPP_INCLUDED wxformbuilder-3.1.59/src/boost/detail/quick_allocator.hpp0000644000175000017500000001124111143440027024013 0ustar rrmulderrrmulder#ifndef BOOST_DETAIL_QUICK_ALLOCATOR_HPP_INCLUDED #define BOOST_DETAIL_QUICK_ALLOCATOR_HPP_INCLUDED // MS compatible compilers support #pragma once #if defined(_MSC_VER) && (_MSC_VER >= 1020) # pragma once #endif // // detail/quick_allocator.hpp // // Copyright (c) 2003 David Abrahams // Copyright (c) 2003 Peter Dimov // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // #include #include #include #include #include // ::operator new, ::operator delete #include // std::size_t namespace boost { namespace detail { template union freeblock { typedef typename boost::type_with_alignment::type aligner_type; aligner_type aligner; char bytes[size]; freeblock * next; }; template struct allocator_impl { typedef freeblock block; // It may seem odd to use such small pages. // // However, on a typical Windows implementation that uses // the OS allocator, "normal size" pages interact with the // "ordinary" operator new, slowing it down dramatically. // // 512 byte pages are handled by the small object allocator, // and don't interfere with ::new. // // The other alternative is to use much bigger pages (1M.) // // It is surprisingly easy to hit pathological behavior by // varying the page size. g++ 2.96 on Red Hat Linux 7.2, // for example, passionately dislikes 496. 512 seems OK. #if defined(BOOST_QA_PAGE_SIZE) enum { items_per_page = BOOST_QA_PAGE_SIZE / size }; #else enum { items_per_page = 512 / size }; // 1048560 / size #endif #ifdef BOOST_HAS_THREADS static lightweight_mutex mutex; #endif static block * free; static block * page; static unsigned last; static inline void * alloc() { #ifdef BOOST_HAS_THREADS lightweight_mutex::scoped_lock lock(mutex); #endif if(block * x = free) { free = x->next; return x; } else { if(last == items_per_page) { // "Listen to me carefully: there is no memory leak" // -- Scott Meyers, Eff C++ 2nd Ed Item 10 page = ::new block[items_per_page]; last = 0; } return &page[last++]; } } static inline void * alloc(std::size_t n) { if(n != size) // class-specific new called for a derived object { return ::operator new(n); } else { #ifdef BOOST_HAS_THREADS lightweight_mutex::scoped_lock lock(mutex); #endif if(block * x = free) { free = x->next; return x; } else { if(last == items_per_page) { page = ::new block[items_per_page]; last = 0; } return &page[last++]; } } } static inline void dealloc(void * pv) { if(pv != 0) // 18.4.1.1/13 { #ifdef BOOST_HAS_THREADS lightweight_mutex::scoped_lock lock(mutex); #endif block * pb = static_cast(pv); pb->next = free; free = pb; } } static inline void dealloc(void * pv, std::size_t n) { if(n != size) // class-specific delete called for a derived object { ::operator delete(pv); } else if(pv != 0) // 18.4.1.1/13 { #ifdef BOOST_HAS_THREADS lightweight_mutex::scoped_lock lock(mutex); #endif block * pb = static_cast(pv); pb->next = free; free = pb; } } }; #ifdef BOOST_HAS_THREADS template lightweight_mutex allocator_impl::mutex; #endif template freeblock * allocator_impl::free = 0; template freeblock * allocator_impl::page = 0; template unsigned allocator_impl::last = allocator_impl::items_per_page; template struct quick_allocator: public allocator_impl< sizeof(T), boost::alignment_of::value > { }; } // namespace detail } // namespace boost #endif // #ifndef BOOST_DETAIL_QUICK_ALLOCATOR_HPP_INCLUDED wxformbuilder-3.1.59/src/boost/detail/lightweight_mutex.hpp0000644000175000017500000000243411143440027024404 0ustar rrmulderrrmulder#ifndef BOOST_DETAIL_LIGHTWEIGHT_MUTEX_HPP_INCLUDED #define BOOST_DETAIL_LIGHTWEIGHT_MUTEX_HPP_INCLUDED // MS compatible compilers support #pragma once #if defined(_MSC_VER) && (_MSC_VER >= 1020) # pragma once #endif // // boost/detail/lightweight_mutex.hpp - lightweight mutex // // Copyright (c) 2002, 2003 Peter Dimov and Multi Media Ltd. // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // typedef boost::detail::lightweight_mutex; // // boost::detail::lightweight_mutex is a header-only implementation of // a subset of the Mutex concept requirements: // // http://www.boost.org/doc/html/threads/concepts.html#threads.concepts.Mutex // // It maps to a CRITICAL_SECTION on Windows or a pthread_mutex on POSIX. // #include #if !defined(BOOST_HAS_THREADS) # include #elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__) # include #elif defined(BOOST_HAS_PTHREADS) # include #else // Use #define BOOST_DISABLE_THREADS to avoid the error # error Unrecognized threading platform #endif #endif // #ifndef BOOST_DETAIL_LIGHTWEIGHT_MUTEX_HPP_INCLUDED wxformbuilder-3.1.59/src/boost/detail/in_place_factory_prefix.hpp0000644000175000017500000000247711143440027025530 0ustar rrmulderrrmulder// Copyright (C) 2003, Fernando Luis Cacciola Carballal. // // Use, modification, and distribution is subject to the Boost Software // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // See http://www.boost.org/lib/optional for documentation. // // You are welcome to contact the author at: // fernando_cacciola@hotmail.com // #ifndef BOOST_UTILITY_INPLACE_FACTORY_PREFIX_25AGO2003_HPP #define BOOST_UTILITY_INPLACE_FACTORY_PREFIX_25AGO2003_HPP #include #include #include #include #include #include #include #include #define BOOST_DEFINE_INPLACE_FACTORY_CLASS_MEMBER_INIT(z,n,_) BOOST_PP_CAT(m_a,n) BOOST_PP_LPAREN() BOOST_PP_CAT(a,n) BOOST_PP_RPAREN() #define BOOST_DEFINE_INPLACE_FACTORY_CLASS_MEMBER_DECL(z,n,_) BOOST_PP_CAT(A,n) const& BOOST_PP_CAT(m_a,n); #define BOOST_DEFINE_INPLACE_FACTORY_CLASS_MEMBER_ARG(z,n,_) BOOST_PP_CAT(m_a,n) #define BOOST_MAX_INPLACE_FACTORY_ARITY 10 #undef BOOST_UTILITY_INPLACE_FACTORY_SUFFIX_25AGO2003_HPP #endif wxformbuilder-3.1.59/src/boost/detail/lwm_win32_cs.hpp0000644000175000017500000000415011143440027023146 0ustar rrmulderrrmulder#ifndef BOOST_DETAIL_LWM_WIN32_CS_HPP_INCLUDED #define BOOST_DETAIL_LWM_WIN32_CS_HPP_INCLUDED // MS compatible compilers support #pragma once #if defined(_MSC_VER) && (_MSC_VER >= 1020) # pragma once #endif // // boost/detail/lwm_win32_cs.hpp // // Copyright (c) 2002, 2003 Peter Dimov // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // #ifdef BOOST_USE_WINDOWS_H # include #endif namespace boost { namespace detail { #ifndef BOOST_USE_WINDOWS_H struct CRITICAL_SECTION { struct critical_section_debug * DebugInfo; long LockCount; long RecursionCount; void * OwningThread; void * LockSemaphore; #if defined(_WIN64) unsigned __int64 SpinCount; #else unsigned long SpinCount; #endif }; extern "C" __declspec(dllimport) void __stdcall InitializeCriticalSection(CRITICAL_SECTION *); extern "C" __declspec(dllimport) void __stdcall EnterCriticalSection(CRITICAL_SECTION *); extern "C" __declspec(dllimport) void __stdcall LeaveCriticalSection(CRITICAL_SECTION *); extern "C" __declspec(dllimport) void __stdcall DeleteCriticalSection(CRITICAL_SECTION *); #endif // #ifndef BOOST_USE_WINDOWS_H class lightweight_mutex { private: CRITICAL_SECTION cs_; lightweight_mutex(lightweight_mutex const &); lightweight_mutex & operator=(lightweight_mutex const &); public: lightweight_mutex() { InitializeCriticalSection(&cs_); } ~lightweight_mutex() { DeleteCriticalSection(&cs_); } class scoped_lock; friend class scoped_lock; class scoped_lock { private: lightweight_mutex & m_; scoped_lock(scoped_lock const &); scoped_lock & operator=(scoped_lock const &); public: explicit scoped_lock(lightweight_mutex & m): m_(m) { EnterCriticalSection(&m_.cs_); } ~scoped_lock() { LeaveCriticalSection(&m_.cs_); } }; }; } // namespace detail } // namespace boost #endif // #ifndef BOOST_DETAIL_LWM_WIN32_CS_HPP_INCLUDED wxformbuilder-3.1.59/src/boost/detail/catch_exceptions.hpp0000644000175000017500000001321011143440027024160 0ustar rrmulderrrmulder// boost/catch_exceptions.hpp -----------------------------------------------// // Copyright Beman Dawes 1995-2001. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org/libs/test for documentation. // Revision History // 13 Jun 01 report_exception() made inline. (John Maddock, Jesse Jones) // 26 Feb 01 Numerous changes suggested during formal review. (Beman) // 25 Jan 01 catch_exceptions.hpp code factored out of cpp_main.cpp. // 22 Jan 01 Remove test_tools dependencies to reduce coupling. // 5 Nov 00 Initial boost version (Beman Dawes) #ifndef BOOST_CATCH_EXCEPTIONS_HPP #define BOOST_CATCH_EXCEPTIONS_HPP // header dependencies are deliberately restricted to the standard library // to reduce coupling to other boost libraries. #include // for string #include // for bad_alloc #include // for bad_cast, bad_typeid #include // for exception, bad_exception #include // for std exception hierarchy #include // for exit codes # if __GNUC__ != 2 || __GNUC_MINOR__ > 96 # include // for ostream # else # include // workaround GNU missing ostream header # endif # if defined(__BORLANDC__) && (__BORLANDC__ <= 0x0551) # define BOOST_BUILT_IN_EXCEPTIONS_MISSING_WHAT # endif #if defined(MPW_CPLUS) && (MPW_CPLUS <= 0x890) # define BOOST_BUILT_IN_EXCEPTIONS_MISSING_WHAT namespace std { class bad_typeid { }; } # endif namespace boost { namespace detail { // A separate reporting function was requested during formal review. inline void report_exception( std::ostream & os, const char * name, const char * info ) { os << "\n** uncaught exception: " << name << " " << info << std::endl; } } // catch_exceptions ------------------------------------------------------// template< class Generator > // Generator is function object returning int int catch_exceptions( Generator function_object, std::ostream & out, std::ostream & err ) { int result = 0; // quiet compiler warnings bool exception_thrown = true; // avoid setting result for each excptn type #ifndef BOOST_NO_EXCEPTIONS try { #endif result = function_object(); exception_thrown = false; #ifndef BOOST_NO_EXCEPTIONS } // As a result of hard experience with strangely interleaved output // under some compilers, there is a lot of use of endl in the code below // where a simple '\n' might appear to do. // The rules for catch & arguments are a bit different from function // arguments (ISO 15.3 paragraphs 18 & 19). Apparently const isn't // required, but it doesn't hurt and some programmers ask for it. catch ( const char * ex ) { detail::report_exception( out, "", ex ); } catch ( const std::string & ex ) { detail::report_exception( out, "", ex.c_str() ); } // std:: exceptions catch ( const std::bad_alloc & ex ) { detail::report_exception( out, "std::bad_alloc:", ex.what() ); } # ifndef BOOST_BUILT_IN_EXCEPTIONS_MISSING_WHAT catch ( const std::bad_cast & ex ) { detail::report_exception( out, "std::bad_cast:", ex.what() ); } catch ( const std::bad_typeid & ex ) { detail::report_exception( out, "std::bad_typeid:", ex.what() ); } # else catch ( const std::bad_cast & ) { detail::report_exception( out, "std::bad_cast", "" ); } catch ( const std::bad_typeid & ) { detail::report_exception( out, "std::bad_typeid", "" ); } # endif catch ( const std::bad_exception & ex ) { detail::report_exception( out, "std::bad_exception:", ex.what() ); } catch ( const std::domain_error & ex ) { detail::report_exception( out, "std::domain_error:", ex.what() ); } catch ( const std::invalid_argument & ex ) { detail::report_exception( out, "std::invalid_argument:", ex.what() ); } catch ( const std::length_error & ex ) { detail::report_exception( out, "std::length_error:", ex.what() ); } catch ( const std::out_of_range & ex ) { detail::report_exception( out, "std::out_of_range:", ex.what() ); } catch ( const std::range_error & ex ) { detail::report_exception( out, "std::range_error:", ex.what() ); } catch ( const std::overflow_error & ex ) { detail::report_exception( out, "std::overflow_error:", ex.what() ); } catch ( const std::underflow_error & ex ) { detail::report_exception( out, "std::underflow_error:", ex.what() ); } catch ( const std::logic_error & ex ) { detail::report_exception( out, "std::logic_error:", ex.what() ); } catch ( const std::runtime_error & ex ) { detail::report_exception( out, "std::runtime_error:", ex.what() ); } catch ( const std::exception & ex ) { detail::report_exception( out, "std::exception:", ex.what() ); } catch ( ... ) { detail::report_exception( out, "unknown exception", "" ); } #endif // BOOST_NO_EXCEPTIONS if ( exception_thrown ) result = boost::exit_exception_failure; if ( result != 0 && result != exit_success ) { out << std::endl << "**** returning with error code " << result << std::endl; err << "********** errors detected; see stdout for details ***********" << std::endl; } #if !defined(BOOST_NO_CPP_MAIN_SUCCESS_MESSAGE) else { out << std::flush << "no errors detected" << std::endl; } #endif return result; } // catch_exceptions } // boost #endif // BOOST_CATCH_EXCEPTIONS_HPP wxformbuilder-3.1.59/src/boost/detail/lwm_linux.hpp0000644000175000017500000000353211143440027022661 0ustar rrmulderrrmulder#ifndef BOOST_DETAIL_LWM_LINUX_HPP_INCLUDED #define BOOST_DETAIL_LWM_LINUX_HPP_INCLUDED // // boost/detail/lwm_linux.hpp // // Copyright (c) 2002 Peter Dimov and Multi Media Ltd. // // Permission to copy, use, modify, sell and distribute this software // is granted provided this copyright notice appears in all copies. // This software is provided "as is" without express or implied // warranty, and with no claim as to its suitability for any purpose. // // // This implementation uses . This is a kernel header; // using kernel headers in a user program may cause a number of problems, // and not all flavors of Linux provide the atomic instructions. // // This file is only provided because the performance of this implementation // is about 3.5 times higher than the pthreads version. Use at your own risk // (by defining BOOST_USE_ASM_ATOMIC_H.) // #include #include namespace boost { namespace detail { class lightweight_mutex { private: atomic_t a_; lightweight_mutex(lightweight_mutex const &); lightweight_mutex & operator=(lightweight_mutex const &); public: lightweight_mutex() { atomic_t a = ATOMIC_INIT(1); a_ = a; } class scoped_lock; friend class scoped_lock; class scoped_lock { private: lightweight_mutex & m_; scoped_lock(scoped_lock const &); scoped_lock & operator=(scoped_lock const &); public: explicit scoped_lock(lightweight_mutex & m): m_(m) { while( !atomic_dec_and_test(&m_.a_) ) { atomic_inc(&m_.a_); sched_yield(); } } ~scoped_lock() { atomic_inc(&m_.a_); } }; }; } // namespace detail } // namespace boost #endif // #ifndef BOOST_DETAIL_LWM_LINUX_HPP_INCLUDED wxformbuilder-3.1.59/src/boost/detail/lwm_nop.hpp0000644000175000017500000000124011143440027022310 0ustar rrmulderrrmulder#ifndef BOOST_DETAIL_LWM_NOP_HPP_INCLUDED #define BOOST_DETAIL_LWM_NOP_HPP_INCLUDED // MS compatible compilers support #pragma once #if defined(_MSC_VER) && (_MSC_VER >= 1020) # pragma once #endif // // boost/detail/lwm_nop.hpp // // Copyright (c) 2002 Peter Dimov and Multi Media Ltd. // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // namespace boost { namespace detail { class lightweight_mutex { public: typedef lightweight_mutex scoped_lock; }; } // namespace detail } // namespace boost #endif // #ifndef BOOST_DETAIL_LWM_NOP_HPP_INCLUDED wxformbuilder-3.1.59/src/boost/detail/shared_count.hpp0000644000175000017500000001531711143440027023325 0ustar rrmulderrrmulder#ifndef BOOST_DETAIL_SHARED_COUNT_HPP_INCLUDED #define BOOST_DETAIL_SHARED_COUNT_HPP_INCLUDED // MS compatible compilers support #pragma once #if defined(_MSC_VER) && (_MSC_VER >= 1020) # pragma once #endif // // detail/shared_count.hpp // // Copyright (c) 2001, 2002, 2003 Peter Dimov and Multi Media Ltd. // Copyright 2004-2005 Peter Dimov // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // #ifdef __BORLANDC__ # pragma warn -8027 // Functions containing try are not expanded inline #endif #include #include #include #include #include #include #include // std::auto_ptr, std::allocator #include // std::less #include // std::bad_alloc #include // std::type_info in get_deleter namespace boost { namespace detail { #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) int const shared_count_id = 0x2C35F101; int const weak_count_id = 0x298C38A4; #endif class weak_count; class shared_count { private: sp_counted_base * pi_; #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) int id_; #endif friend class weak_count; public: shared_count(): pi_(0) // nothrow #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) , id_(shared_count_id) #endif { } template explicit shared_count( Y * p ): pi_( 0 ) #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) , id_(shared_count_id) #endif { #ifndef BOOST_NO_EXCEPTIONS try { pi_ = new sp_counted_impl_p( p ); } catch(...) { boost::checked_delete( p ); throw; } #else pi_ = new sp_counted_impl_p( p ); if( pi_ == 0 ) { boost::checked_delete( p ); boost::throw_exception( std::bad_alloc() ); } #endif } template shared_count(P p, D d): pi_(0) #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) , id_(shared_count_id) #endif { #ifndef BOOST_NO_EXCEPTIONS try { pi_ = new sp_counted_impl_pd(p, d); } catch(...) { d(p); // delete p throw; } #else pi_ = new sp_counted_impl_pd(p, d); if(pi_ == 0) { d(p); // delete p boost::throw_exception(std::bad_alloc()); } #endif } #ifndef BOOST_NO_AUTO_PTR // auto_ptr is special cased to provide the strong guarantee template explicit shared_count( std::auto_ptr & r ): pi_( new sp_counted_impl_p( r.get() ) ) #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) , id_(shared_count_id) #endif { #ifdef BOOST_NO_EXCEPTIONS if( pi_ == 0 ) { boost::throw_exception(std::bad_alloc()); } #endif r.release(); } #endif ~shared_count() // nothrow { if( pi_ != 0 ) pi_->release(); #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) id_ = 0; #endif } shared_count(shared_count const & r): pi_(r.pi_) // nothrow #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) , id_(shared_count_id) #endif { if( pi_ != 0 ) pi_->add_ref_copy(); } explicit shared_count(weak_count const & r); // throws bad_weak_ptr when r.use_count() == 0 shared_count & operator= (shared_count const & r) // nothrow { sp_counted_base * tmp = r.pi_; if( tmp != pi_ ) { if( tmp != 0 ) tmp->add_ref_copy(); if( pi_ != 0 ) pi_->release(); pi_ = tmp; } return *this; } void swap(shared_count & r) // nothrow { sp_counted_base * tmp = r.pi_; r.pi_ = pi_; pi_ = tmp; } long use_count() const // nothrow { return pi_ != 0? pi_->use_count(): 0; } bool unique() const // nothrow { return use_count() == 1; } friend inline bool operator==(shared_count const & a, shared_count const & b) { return a.pi_ == b.pi_; } friend inline bool operator<(shared_count const & a, shared_count const & b) { return std::less()( a.pi_, b.pi_ ); } void * get_deleter(std::type_info const & ti) const { return pi_? pi_->get_deleter( ti ): 0; } }; class weak_count { private: sp_counted_base * pi_; #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) int id_; #endif friend class shared_count; public: weak_count(): pi_(0) // nothrow #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) , id_(weak_count_id) #endif { } weak_count(shared_count const & r): pi_(r.pi_) // nothrow #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) , id_(shared_count_id) #endif { if(pi_ != 0) pi_->weak_add_ref(); } weak_count(weak_count const & r): pi_(r.pi_) // nothrow #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) , id_(shared_count_id) #endif { if(pi_ != 0) pi_->weak_add_ref(); } ~weak_count() // nothrow { if(pi_ != 0) pi_->weak_release(); #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) id_ = 0; #endif } weak_count & operator= (shared_count const & r) // nothrow { sp_counted_base * tmp = r.pi_; if(tmp != 0) tmp->weak_add_ref(); if(pi_ != 0) pi_->weak_release(); pi_ = tmp; return *this; } weak_count & operator= (weak_count const & r) // nothrow { sp_counted_base * tmp = r.pi_; if(tmp != 0) tmp->weak_add_ref(); if(pi_ != 0) pi_->weak_release(); pi_ = tmp; return *this; } void swap(weak_count & r) // nothrow { sp_counted_base * tmp = r.pi_; r.pi_ = pi_; pi_ = tmp; } long use_count() const // nothrow { return pi_ != 0? pi_->use_count(): 0; } friend inline bool operator==(weak_count const & a, weak_count const & b) { return a.pi_ == b.pi_; } friend inline bool operator<(weak_count const & a, weak_count const & b) { return std::less()(a.pi_, b.pi_); } }; inline shared_count::shared_count( weak_count const & r ): pi_( r.pi_ ) #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) , id_(shared_count_id) #endif { if( pi_ == 0 || !pi_->add_ref_lock() ) { boost::throw_exception( boost::bad_weak_ptr() ); } } } // namespace detail } // namespace boost #ifdef __BORLANDC__ # pragma warn .8027 // Functions containing try are not expanded inline #endif #endif // #ifndef BOOST_DETAIL_SHARED_COUNT_HPP_INCLUDED wxformbuilder-3.1.59/src/boost/detail/allocator.hpp0000644000175000017500000001440311143440027022622 0ustar rrmulderrrmulder/* * * Copyright (c) 2001 * Dr John Maddock * * Use, modification and distribution are subject to the * Boost Software License, Version 1.0. (See accompanying file * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) * */ #ifndef BOOST_DETAIL_ALLOCATOR_HPP #define BOOST_DETAIL_ALLOCATOR_HPP #include #include #include #include #if defined(BOOST_NO_STDC_NAMESPACE) namespace std{ using ::ptrdiff_t; using ::size_t; } #endif // see if we have SGI alloc class: #if defined(BOOST_NO_STD_ALLOCATOR) && (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION) || defined(__GLIBCPP__) || defined(__STL_CONFIG_H)) # define BOOST_HAVE_SGI_ALLOCATOR # include # if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION) namespace boost{ namespace detail{ typedef std::__sgi_alloc alloc_type; }} # else namespace boost{ namespace detail{ typedef std::alloc alloc_type; }} # endif #endif namespace boost{ namespace detail{ template void allocator_construct(T* p, const T& t) { new (p) T(t); } template void allocator_destroy(T* p) { (void)p; // warning suppression p->~T(); } } } #if !defined(BOOST_NO_STD_ALLOCATOR) #include #define BOOST_DEFAULT_ALLOCATOR(T) std::allocator< T > namespace boost{ namespace detail{ template struct rebind_allocator { typedef typename A::template rebind binder; typedef typename binder::other type; }; } // namespace detail } // namespace boost #elif !defined(BOOST_NO_MEMBER_TEMPLATES) && !defined(__SUNPRO_CC) // no std::allocator, but the compiler supports the necessary syntax, // write our own allocator instead: #define BOOST_DEFAULT_ALLOCATOR(T) ::boost::detail::allocator< T > namespace boost{ namespace detail{ template class allocator { public: typedef T value_type; typedef value_type * pointer; typedef const T* const_pointer; typedef T& reference; typedef const T& const_reference; typedef std::size_t size_type; typedef std::ptrdiff_t difference_type; template struct rebind { typedef allocator other; }; allocator(){} template allocator(const allocator&){} allocator(const allocator&){} template allocator& operator=(const allocator&) { return *this; } ~allocator(){} pointer address(reference x) { return &x; } const_pointer address(const_reference x) const { return &x; } pointer allocate(size_type n, const void* = 0) { #ifdef BOOST_HAVE_SGI_ALLOCATOR return n != 0 ? reinterpret_cast(alloc_type::allocate(n * sizeof(value_type))) : 0; #else return n != 0 ? reinterpret_cast(::operator new(n * sizeof(value_type))) : 0; #endif } void deallocate(pointer p, size_type n) { #ifdef BOOST_HAVE_SGI_ALLOCATOR assert( (p == 0) == (n == 0) ); if (p != 0) alloc_type::deallocate((void*)p, n); #else assert( (p == 0) == (n == 0) ); if (p != 0) ::operator delete((void*)p); #endif } size_type max_size() const { return size_t(-1) / sizeof(value_type); } void construct(pointer p, const T& val) const { allocator_construct(p, val); } void destroy(pointer p) const { allocator_destroy(p); } }; template struct rebind_allocator { typedef typename A::template rebind binder; typedef typename binder::other type; }; } // namespace detail } // namespace boost #else // no std::allocator, use workaround version instead, // each allocator class must derive from a base class // that allocates blocks of bytes: #define BOOST_DEFAULT_ALLOCATOR(T) ::boost::detail::allocator_adapter namespace boost{ namespace detail{ class simple_alloc { public: typedef void value_type; typedef value_type * pointer; typedef const void* const_pointer; typedef std::size_t size_type; typedef std::ptrdiff_t difference_type; simple_alloc(){} simple_alloc(const simple_alloc&){} ~simple_alloc(){} pointer allocate(size_type n, const void* = 0) { #ifdef BOOST_HAVE_SGI_ALLOCATOR return n != 0 ? reinterpret_cast(alloc_type::allocate(n)) : 0; #else return n != 0 ? reinterpret_cast(::operator new(n)) : 0; #endif } void deallocate(pointer p, size_type n) { #ifdef BOOST_HAVE_SGI_ALLOCATOR assert( (p == 0) == (n == 0) ); if (p != 0) alloc_type::deallocate((void*)p, n); #else assert( (p == 0) == (n == 0) ); if (p != 0) ::operator delete((void*)p); #endif } }; template class allocator_adapter : public Base { public: typedef T value_type; typedef value_type * pointer; typedef const T* const_pointer; typedef T& reference; typedef const T& const_reference; typedef size_t size_type; typedef std::ptrdiff_t difference_type; typedef Base base_type; allocator_adapter(){} allocator_adapter(const base_type& x) : Base(x){} allocator_adapter& operator=(const base_type& x) { *(static_cast(this)) = x; return *this; } ~allocator_adapter(){} pointer address(reference x) { return &x; } const_pointer address(const_reference x) const { return &x; } pointer allocate(size_type n, const void* = 0) { return n != 0 ? reinterpret_cast(base_type::allocate(n * sizeof(value_type))) : 0; } void deallocate(pointer p, size_type n) { assert( (p == 0) == (n == 0) ); if (p != 0) static_cast(this)->deallocate((void*)p, n * sizeof(value_type)); } size_type max_size() const { return size_t(-1) / sizeof(value_type); } void construct(pointer p, const T& val) const { allocator_construct(p, val); } void destroy(pointer p) const { allocator_destroy(p); } }; template struct rebind_allocator { typedef allocator_adapter type; }; } // namespace detail } // namespace boost #endif #endif // include guard wxformbuilder-3.1.59/src/boost/detail/none_t.hpp0000644000175000017500000000117011143440027022121 0ustar rrmulderrrmulder// Copyright (C) 2003, Fernando Luis Cacciola Carballal. // // Use, modification, and distribution is subject to the Boost Software // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // See http://www.boost.org/lib/optional for documentation. // // You are welcome to contact the author at: // fernando_cacciola@hotmail.com // #ifndef BOOST_DETAIL_NONE_T_17SEP2003_HPP #define BOOST_DETAIL_NONE_T_17SEP2003_HPP namespace boost { namespace detail { struct none_helper{}; typedef int none_helper::*none_t ; } // namespace detail } // namespace boost #endif wxformbuilder-3.1.59/src/boost/detail/atomic_count_linux.hpp0000644000175000017500000000305011143440027024541 0ustar rrmulderrrmulder#ifndef BOOST_DETAIL_ATOMIC_COUNT_LINUX_HPP_INCLUDED #define BOOST_DETAIL_ATOMIC_COUNT_LINUX_HPP_INCLUDED // // boost/detail/atomic_count_linux.hpp // // Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd. // // Permission to copy, use, modify, sell and distribute this software // is granted provided this copyright notice appears in all copies. // This software is provided "as is" without express or implied // warranty, and with no claim as to its suitability for any purpose. // // // This implementation uses . This is a kernel header; // using kernel headers in a user program may cause a number of problems, // and not all flavors of Linux provide the atomic instructions. // // This file is only provided because the performance of this implementation // is significantly higher than the pthreads version. Use at your own risk // (by defining BOOST_USE_ASM_ATOMIC_H.) // #include namespace boost { namespace detail { class atomic_count { public: explicit atomic_count(long v) { atomic_t init = ATOMIC_INIT(v); value_ = init; } void operator++() { atomic_inc(&value_); } long operator--() { return !atomic_dec_and_test(&value_); } operator long() const { return atomic_read(&value_); } private: atomic_count(atomic_count const &); atomic_count & operator=(atomic_count const &); atomic_t value_; }; } // namespace detail } // namespace boost #endif // #ifndef BOOST_DETAIL_ATOMIC_COUNT_LINUX_HPP_INCLUDED wxformbuilder-3.1.59/src/boost/detail/compressed_pair.hpp0000644000175000017500000003747111143440027024033 0ustar rrmulderrrmulder// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000. // Use, modification and distribution are subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt). // // See http://www.boost.org/libs/utility for most recent version including documentation. // compressed_pair: pair that "compresses" empty members // (see libs/utility/compressed_pair.htm) // // JM changes 25 Jan 2004: // For the case where T1 == T2 and both are empty, then first() and second() // should return different objects. // JM changes 25 Jan 2000: // Removed default arguments from compressed_pair_switch to get // C++ Builder 4 to accept them // rewriten swap to get gcc and C++ builder to compile. // added partial specialisations for case T1 == T2 to avoid duplicate constructor defs. #ifndef BOOST_DETAIL_COMPRESSED_PAIR_HPP #define BOOST_DETAIL_COMPRESSED_PAIR_HPP #include #include #include #include #include namespace boost { template class compressed_pair; // compressed_pair namespace details { // JM altered 26 Jan 2000: template struct compressed_pair_switch; template struct compressed_pair_switch {static const int value = 0;}; template struct compressed_pair_switch {static const int value = 3;}; template struct compressed_pair_switch {static const int value = 1;}; template struct compressed_pair_switch {static const int value = 2;}; template struct compressed_pair_switch {static const int value = 4;}; template struct compressed_pair_switch {static const int value = 5;}; template class compressed_pair_imp; #ifdef __GNUC__ // workaround for GCC (JM): using std::swap; #endif // // can't call unqualified swap from within classname::swap // as Koenig lookup rules will find only the classname::swap // member function not the global declaration, so use cp_swap // as a forwarding function (JM): template inline void cp_swap(T& t1, T& t2) { #ifndef __GNUC__ using std::swap; #endif swap(t1, t2); } // 0 derive from neither template class compressed_pair_imp { public: typedef T1 first_type; typedef T2 second_type; typedef typename call_traits::param_type first_param_type; typedef typename call_traits::param_type second_param_type; typedef typename call_traits::reference first_reference; typedef typename call_traits::reference second_reference; typedef typename call_traits::const_reference first_const_reference; typedef typename call_traits::const_reference second_const_reference; compressed_pair_imp() {} compressed_pair_imp(first_param_type x, second_param_type y) : first_(x), second_(y) {} compressed_pair_imp(first_param_type x) : first_(x) {} compressed_pair_imp(second_param_type y) : second_(y) {} first_reference first() {return first_;} first_const_reference first() const {return first_;} second_reference second() {return second_;} second_const_reference second() const {return second_;} void swap(::boost::compressed_pair& y) { cp_swap(first_, y.first()); cp_swap(second_, y.second()); } private: first_type first_; second_type second_; }; // 1 derive from T1 template class compressed_pair_imp : private ::boost::remove_cv::type { public: typedef T1 first_type; typedef T2 second_type; typedef typename call_traits::param_type first_param_type; typedef typename call_traits::param_type second_param_type; typedef typename call_traits::reference first_reference; typedef typename call_traits::reference second_reference; typedef typename call_traits::const_reference first_const_reference; typedef typename call_traits::const_reference second_const_reference; compressed_pair_imp() {} compressed_pair_imp(first_param_type x, second_param_type y) : first_type(x), second_(y) {} compressed_pair_imp(first_param_type x) : first_type(x) {} compressed_pair_imp(second_param_type y) : second_(y) {} first_reference first() {return *this;} first_const_reference first() const {return *this;} second_reference second() {return second_;} second_const_reference second() const {return second_;} void swap(::boost::compressed_pair& y) { // no need to swap empty base class: cp_swap(second_, y.second()); } private: second_type second_; }; // 2 derive from T2 template class compressed_pair_imp : private ::boost::remove_cv::type { public: typedef T1 first_type; typedef T2 second_type; typedef typename call_traits::param_type first_param_type; typedef typename call_traits::param_type second_param_type; typedef typename call_traits::reference first_reference; typedef typename call_traits::reference second_reference; typedef typename call_traits::const_reference first_const_reference; typedef typename call_traits::const_reference second_const_reference; compressed_pair_imp() {} compressed_pair_imp(first_param_type x, second_param_type y) : second_type(y), first_(x) {} compressed_pair_imp(first_param_type x) : first_(x) {} compressed_pair_imp(second_param_type y) : second_type(y) {} first_reference first() {return first_;} first_const_reference first() const {return first_;} second_reference second() {return *this;} second_const_reference second() const {return *this;} void swap(::boost::compressed_pair& y) { // no need to swap empty base class: cp_swap(first_, y.first()); } private: first_type first_; }; // 3 derive from T1 and T2 template class compressed_pair_imp : private ::boost::remove_cv::type, private ::boost::remove_cv::type { public: typedef T1 first_type; typedef T2 second_type; typedef typename call_traits::param_type first_param_type; typedef typename call_traits::param_type second_param_type; typedef typename call_traits::reference first_reference; typedef typename call_traits::reference second_reference; typedef typename call_traits::const_reference first_const_reference; typedef typename call_traits::const_reference second_const_reference; compressed_pair_imp() {} compressed_pair_imp(first_param_type x, second_param_type y) : first_type(x), second_type(y) {} compressed_pair_imp(first_param_type x) : first_type(x) {} compressed_pair_imp(second_param_type y) : second_type(y) {} first_reference first() {return *this;} first_const_reference first() const {return *this;} second_reference second() {return *this;} second_const_reference second() const {return *this;} // // no need to swap empty bases: void swap(::boost::compressed_pair&) {} }; // JM // 4 T1 == T2, T1 and T2 both empty // Note does not actually store an instance of T2 at all - // but reuses T1 base class for both first() and second(). template class compressed_pair_imp : private ::boost::remove_cv::type { public: typedef T1 first_type; typedef T2 second_type; typedef typename call_traits::param_type first_param_type; typedef typename call_traits::param_type second_param_type; typedef typename call_traits::reference first_reference; typedef typename call_traits::reference second_reference; typedef typename call_traits::const_reference first_const_reference; typedef typename call_traits::const_reference second_const_reference; compressed_pair_imp() {} compressed_pair_imp(first_param_type x, second_param_type y) : first_type(x), m_second(y) {} compressed_pair_imp(first_param_type x) : first_type(x), m_second(x) {} first_reference first() {return *this;} first_const_reference first() const {return *this;} second_reference second() {return m_second;} second_const_reference second() const {return m_second;} void swap(::boost::compressed_pair&) {} private: T2 m_second; }; // 5 T1 == T2 and are not empty: //JM template class compressed_pair_imp { public: typedef T1 first_type; typedef T2 second_type; typedef typename call_traits::param_type first_param_type; typedef typename call_traits::param_type second_param_type; typedef typename call_traits::reference first_reference; typedef typename call_traits::reference second_reference; typedef typename call_traits::const_reference first_const_reference; typedef typename call_traits::const_reference second_const_reference; compressed_pair_imp() {} compressed_pair_imp(first_param_type x, second_param_type y) : first_(x), second_(y) {} compressed_pair_imp(first_param_type x) : first_(x), second_(x) {} first_reference first() {return first_;} first_const_reference first() const {return first_;} second_reference second() {return second_;} second_const_reference second() const {return second_;} void swap(::boost::compressed_pair& y) { cp_swap(first_, y.first()); cp_swap(second_, y.second()); } private: first_type first_; second_type second_; }; } // details template class compressed_pair : private ::boost::details::compressed_pair_imp::type, typename remove_cv::type>::value, ::boost::is_empty::value, ::boost::is_empty::value>::value> { private: typedef details::compressed_pair_imp::type, typename remove_cv::type>::value, ::boost::is_empty::value, ::boost::is_empty::value>::value> base; public: typedef T1 first_type; typedef T2 second_type; typedef typename call_traits::param_type first_param_type; typedef typename call_traits::param_type second_param_type; typedef typename call_traits::reference first_reference; typedef typename call_traits::reference second_reference; typedef typename call_traits::const_reference first_const_reference; typedef typename call_traits::const_reference second_const_reference; compressed_pair() : base() {} compressed_pair(first_param_type x, second_param_type y) : base(x, y) {} explicit compressed_pair(first_param_type x) : base(x) {} explicit compressed_pair(second_param_type y) : base(y) {} first_reference first() {return base::first();} first_const_reference first() const {return base::first();} second_reference second() {return base::second();} second_const_reference second() const {return base::second();} void swap(compressed_pair& y) { base::swap(y); } }; // JM // Partial specialisation for case where T1 == T2: // template class compressed_pair : private details::compressed_pair_imp::type, typename remove_cv::type>::value, ::boost::is_empty::value, ::boost::is_empty::value>::value> { private: typedef details::compressed_pair_imp::type, typename remove_cv::type>::value, ::boost::is_empty::value, ::boost::is_empty::value>::value> base; public: typedef T first_type; typedef T second_type; typedef typename call_traits::param_type first_param_type; typedef typename call_traits::param_type second_param_type; typedef typename call_traits::reference first_reference; typedef typename call_traits::reference second_reference; typedef typename call_traits::const_reference first_const_reference; typedef typename call_traits::const_reference second_const_reference; compressed_pair() : base() {} compressed_pair(first_param_type x, second_param_type y) : base(x, y) {} #if !(defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x530)) explicit #endif compressed_pair(first_param_type x) : base(x) {} first_reference first() {return base::first();} first_const_reference first() const {return base::first();} second_reference second() {return base::second();} second_const_reference second() const {return base::second();} void swap(::boost::compressed_pair& y) { base::swap(y); } }; template inline void swap(compressed_pair& x, compressed_pair& y) { x.swap(y); } } // boost #endif // BOOST_DETAIL_COMPRESSED_PAIR_HPP wxformbuilder-3.1.59/src/boost/detail/sp_counted_base_gcc_x86.hpp0000644000175000017500000000664311143440027025327 0ustar rrmulderrrmulder#ifndef BOOST_DETAIL_SP_COUNTED_BASE_GCC_X86_HPP_INCLUDED #define BOOST_DETAIL_SP_COUNTED_BASE_GCC_X86_HPP_INCLUDED // MS compatible compilers support #pragma once #if defined(_MSC_VER) && (_MSC_VER >= 1020) # pragma once #endif // // detail/sp_counted_base_gcc_x86.hpp - g++ on 486+ or AMD64 // // Copyright (c) 2001, 2002, 2003 Peter Dimov and Multi Media Ltd. // Copyright 2004-2005 Peter Dimov // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // // Lock-free algorithm by Alexander Terekhov // // Thanks to Ben Hitchings for the #weak + (#shared != 0) // formulation // #include namespace boost { namespace detail { inline int atomic_exchange_and_add( int * pw, int dv ) { // int r = *pw; // *pw += dv; // return r; int r; __asm__ __volatile__ ( "lock\n\t" "xadd %1, %0": "=m"( *pw ), "=r"( r ): // outputs (%0, %1) "m"( *pw ), "1"( dv ): // inputs (%2, %3 == %1) "memory", "cc" // clobbers ); return r; } inline void atomic_increment( int * pw ) { //atomic_exchange_and_add( pw, 1 ); __asm__ ( "lock\n\t" "incl %0": "=m"( *pw ): // output (%0) "m"( *pw ): // input (%1) "cc" // clobbers ); } inline int atomic_conditional_increment( int * pw ) { // int rv = *pw; // if( rv != 0 ) ++*pw; // return rv; int rv, tmp; __asm__ ( "movl %0, %%eax\n\t" "0:\n\t" "test %%eax, %%eax\n\t" "je 1f\n\t" "movl %%eax, %2\n\t" "incl %2\n\t" "lock\n\t" "cmpxchgl %2, %0\n\t" "jne 0b\n\t" "1:": "=m"( *pw ), "=&a"( rv ), "=&r"( tmp ): // outputs (%0, %1, %2) "m"( *pw ): // input (%3) "cc" // clobbers ); return rv; } class sp_counted_base { private: sp_counted_base( sp_counted_base const & ); sp_counted_base & operator= ( sp_counted_base const & ); int use_count_; // #shared int weak_count_; // #weak + (#shared != 0) public: sp_counted_base(): use_count_( 1 ), weak_count_( 1 ) { } virtual ~sp_counted_base() // nothrow { } // dispose() is called when use_count_ drops to zero, to release // the resources managed by *this. virtual void dispose() = 0; // nothrow // destroy() is called when weak_count_ drops to zero. virtual void destroy() // nothrow { delete this; } virtual void * get_deleter( std::type_info const & ti ) = 0; void add_ref_copy() { atomic_increment( &use_count_ ); } bool add_ref_lock() // true on success { return atomic_conditional_increment( &use_count_ ) != 0; } void release() // nothrow { if( atomic_exchange_and_add( &use_count_, -1 ) == 1 ) { dispose(); weak_release(); } } void weak_add_ref() // nothrow { atomic_increment( &weak_count_ ); } void weak_release() // nothrow { if( atomic_exchange_and_add( &weak_count_, -1 ) == 1 ) { destroy(); } } long use_count() const // nothrow { return static_cast( use_count_ ); } }; } // namespace detail } // namespace boost #endif // #ifndef BOOST_DETAIL_SP_COUNTED_BASE_GCC_X86_HPP_INCLUDED wxformbuilder-3.1.59/src/boost/detail/templated_streams.hpp0000644000175000017500000000430211143440027024354 0ustar rrmulderrrmulder//----------------------------------------------------------------------------- // boost detail/templated_streams.hpp header file // See http://www.boost.org for updates, documentation, and revision history. //----------------------------------------------------------------------------- // // Copyright (c) 2003 // Eric Friedman // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_DETAIL_TEMPLATED_STREAMS_HPP #define BOOST_DETAIL_TEMPLATED_STREAMS_HPP #include "boost/config.hpp" /////////////////////////////////////////////////////////////////////////////// // (detail) BOOST_TEMPLATED_STREAM_* macros // // Provides workaround platforms without stream class templates. // #if !defined(BOOST_NO_STD_LOCALE) #define BOOST_TEMPLATED_STREAM_TEMPLATE(E,T) \ template < typename E , typename T > #define BOOST_TEMPLATED_STREAM_TEMPLATE_ALLOC(E,T,A) \ template < typename E , typename T , typename A > #define BOOST_TEMPLATED_STREAM_ARGS(E,T) \ typename E , typename T #define BOOST_TEMPLATED_STREAM_ARGS_ALLOC(E,T,A) \ typename E , typename T , typename A #define BOOST_TEMPLATED_STREAM_COMMA , #define BOOST_TEMPLATED_STREAM_ELEM(E) E #define BOOST_TEMPLATED_STREAM_TRAITS(T) T #define BOOST_TEMPLATED_STREAM_ALLOC(A) A #define BOOST_TEMPLATED_STREAM(X,E,T) \ BOOST_JOIN(std::basic_,X)< E , T > #define BOOST_TEMPLATED_STREAM_WITH_ALLOC(X,E,T,A) \ BOOST_JOIN(std::basic_,X)< E , T , A > #else // defined(BOOST_NO_STD_LOCALE) #define BOOST_TEMPLATED_STREAM_TEMPLATE(E,T) /**/ #define BOOST_TEMPLATED_STREAM_TEMPLATE_ALLOC(E,T,A) /**/ #define BOOST_TEMPLATED_STREAM_ARGS(E,T) /**/ #define BOOST_TEMPLATED_STREAM_ARGS_ALLOC(E,T,A) /**/ #define BOOST_TEMPLATED_STREAM_COMMA /**/ #define BOOST_TEMPLATED_STREAM_ELEM(E) char #define BOOST_TEMPLATED_STREAM_TRAITS(T) std::char_traits #define BOOST_TEMPLATED_STREAM_ALLOC(A) std::allocator #define BOOST_TEMPLATED_STREAM(X,E,T) \ std::X #define BOOST_TEMPLATED_STREAM_WITH_ALLOC(X,E,T,A) \ std::X #endif // BOOST_NO_STD_LOCALE #endif // BOOST_DETAIL_TEMPLATED_STREAMS_HPP wxformbuilder-3.1.59/src/boost/detail/lightweight_test.hpp0000644000175000017500000000354011143440027024220 0ustar rrmulderrrmulder#ifndef BOOST_DETAIL_LIGHTWEIGHT_TEST_HPP_INCLUDED #define BOOST_DETAIL_LIGHTWEIGHT_TEST_HPP_INCLUDED // MS compatible compilers support #pragma once #if defined(_MSC_VER) && (_MSC_VER >= 1020) # pragma once #endif // // boost/detail/lightweight_test.hpp - lightweight test library // // Copyright (c) 2002 Peter Dimov and Multi Media Ltd. // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // BOOST_TEST(expression) // BOOST_ERROR(message) // // int boost::report_errors() // #include #include namespace boost { namespace detail { inline int & test_errors() { static int x = 0; return x; } inline void test_failed_impl(char const * expr, char const * file, int line, char const * function) { std::cerr << file << "(" << line << "): test '" << expr << "' failed in function '" << function << "'" << std::endl; ++test_errors(); } inline void error_impl(char const * msg, char const * file, int line, char const * function) { std::cerr << file << "(" << line << "): " << msg << " in function '" << function << "'" << std::endl; ++test_errors(); } } // namespace detail inline int report_errors() { int errors = detail::test_errors(); if(errors == 0) { std::cerr << "No errors detected." << std::endl; return 0; } else { std::cerr << errors << " error" << (errors == 1? "": "s") << " detected." << std::endl; return 1; } } } // namespace boost #define BOOST_TEST(expr) ((expr)? (void)0: ::boost::detail::test_failed_impl(#expr, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION)) #define BOOST_ERROR(msg) ::boost::detail::error_impl(msg, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION) #endif // #ifndef BOOST_DETAIL_LIGHTWEIGHT_TEST_HPP_INCLUDED wxformbuilder-3.1.59/src/boost/detail/atomic_count_pthreads.hpp0000644000175000017500000000332511143440027025221 0ustar rrmulderrrmulder#ifndef BOOST_DETAIL_ATOMIC_COUNT_PTHREADS_HPP_INCLUDED #define BOOST_DETAIL_ATOMIC_COUNT_PTHREADS_HPP_INCLUDED // // boost/detail/atomic_count_pthreads.hpp // // Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd. // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // #include // // The generic pthread_mutex-based implementation sometimes leads to // inefficiencies. Example: a class with two atomic_count members // can get away with a single mutex. // // Users can detect this situation by checking BOOST_AC_USE_PTHREADS. // namespace boost { namespace detail { class atomic_count { private: class scoped_lock { public: scoped_lock(pthread_mutex_t & m): m_(m) { pthread_mutex_lock(&m_); } ~scoped_lock() { pthread_mutex_unlock(&m_); } private: pthread_mutex_t & m_; }; public: explicit atomic_count(long v): value_(v) { pthread_mutex_init(&mutex_, 0); } ~atomic_count() { pthread_mutex_destroy(&mutex_); } void operator++() { scoped_lock lock(mutex_); ++value_; } long operator--() { scoped_lock lock(mutex_); return --value_; } operator long() const { scoped_lock lock(mutex_); return value_; } private: atomic_count(atomic_count const &); atomic_count & operator=(atomic_count const &); mutable pthread_mutex_t mutex_; long value_; }; } // namespace detail } // namespace boost #endif // #ifndef BOOST_DETAIL_ATOMIC_COUNT_PTHREADS_HPP_INCLUDED wxformbuilder-3.1.59/src/boost/detail/sp_counted_base_gcc_ia64.hpp0000644000175000017500000000674011143440027025443 0ustar rrmulderrrmulder#ifndef BOOST_DETAIL_SP_COUNTED_BASE_GCC_IA64_HPP_INCLUDED #define BOOST_DETAIL_SP_COUNTED_BASE_GCC_IA64_HPP_INCLUDED // // detail/sp_counted_base_gcc_ia64.hpp - g++ on IA64 // // Copyright (c) 2001, 2002, 2003 Peter Dimov and Multi Media Ltd. // Copyright 2004-2005 Peter Dimov // Copyright 2005 Ben Hutchings // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // // Lock-free algorithm by Alexander Terekhov // #include namespace boost { namespace detail { inline void atomic_increment( long * pw ) { // ++*pw; long tmp; // No barrier is required here but fetchadd always has an acquire or // release barrier associated with it. We choose release as it should be // cheaper. __asm__ ("fetchadd8.rel %0=[%2],1" : "=r"(tmp), "=m"(*pw) : "r"(pw)); } inline long atomic_decrement( long * pw ) { // return --*pw; long rv; __asm__ (" fetchadd8.rel %0=[%2],-1 ;; \n" " cmp.eq p7,p0=1,%0 ;; \n" "(p7) ld8.acq %0=[%2] " : "=&r"(rv), "=m"(*pw) : "r"(pw) : "p7"); return rv; } inline long atomic_conditional_increment( long * pw ) { // if( *pw != 0 ) ++*pw; // return *pw; long rv, tmp, tmp2; __asm__ ("0: ld8 %0=[%4] ;; \n" " cmp.eq p7,p0=0,%0 ;; \n" "(p7) br.cond.spnt 1f \n" " mov ar.ccv=%0 \n" " add %1=1,%0 ;; \n" " cmpxchg8.acq %2=[%4],%1,ar.ccv ;; \n" " cmp.ne p7,p0=%0,%2 ;; \n" "(p7) br.cond.spnt 0b \n" " mov %0=%1 ;; \n" "1:" : "=&r"(rv), "=&r"(tmp), "=&r"(tmp2), "=m"(*pw) : "r"(pw) : "ar.ccv", "p7"); return rv; } class sp_counted_base { private: sp_counted_base( sp_counted_base const & ); sp_counted_base & operator= ( sp_counted_base const & ); long use_count_; // #shared long weak_count_; // #weak + (#shared != 0) public: sp_counted_base(): use_count_( 1 ), weak_count_( 1 ) { } virtual ~sp_counted_base() // nothrow { } // dispose() is called when use_count_ drops to zero, to release // the resources managed by *this. virtual void dispose() = 0; // nothrow // destroy() is called when weak_count_ drops to zero. virtual void destroy() // nothrow { delete this; } virtual void * get_deleter( std::type_info const & ti ) = 0; void add_ref_copy() { atomic_increment( &use_count_ ); } bool add_ref_lock() // true on success { return atomic_conditional_increment( &use_count_ ) != 0; } void release() // nothrow { if( atomic_decrement( &use_count_ ) == 0 ) { dispose(); weak_release(); } } void weak_add_ref() // nothrow { atomic_increment( &weak_count_ ); } void weak_release() // nothrow { if( atomic_decrement( &weak_count_ ) == 0 ) { destroy(); } } long use_count() const // nothrow { return static_cast( use_count_ ); } }; } // namespace detail } // namespace boost #endif // #ifndef BOOST_DETAIL_SP_COUNTED_BASE_GCC_IA64_HPP_INCLUDED wxformbuilder-3.1.59/src/boost/detail/in_place_factory.hpp0000644000175000017500000000354011143440027024143 0ustar rrmulderrrmulder// Copyright (C) 2003, Fernando Luis Cacciola Carballal. // // Use, modification, and distribution is subject to the Boost Software // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // See http://www.boost.org/lib/optional for documentation. // // You are welcome to contact the author at: // fernando_cacciola@hotmail.com // #ifndef BOOST_UTILITY_INPLACE_FACTORY_25AGO2003_HPP #define BOOST_UTILITY_INPLACE_FACTORY_25AGO2003_HPP #include #include namespace boost { class InPlaceFactoryBase {} ; #define BOOST_DEFINE_INPLACE_FACTORY_CLASS(z,n,_) \ template< BOOST_PP_ENUM_PARAMS(BOOST_PP_INC(n),class A) > \ class BOOST_PP_CAT(InPlaceFactory, BOOST_PP_INC(n) ) : public InPlaceFactoryBase \ { \ public: \ \ BOOST_PP_CAT(InPlaceFactory, BOOST_PP_INC(n) ) ( BOOST_PP_ENUM_BINARY_PARAMS(BOOST_PP_INC(n),A,const& a) ) \ : \ BOOST_PP_ENUM( BOOST_PP_INC(n), BOOST_DEFINE_INPLACE_FACTORY_CLASS_MEMBER_INIT, _ ) \ {} \ \ template \ void apply ( void* address BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(T) ) const \ { \ new ( address ) T ( BOOST_PP_ENUM_PARAMS( BOOST_PP_INC(n), m_a ) ) ; \ } \ \ BOOST_PP_REPEAT( BOOST_PP_INC(n), BOOST_DEFINE_INPLACE_FACTORY_CLASS_MEMBER_DECL, _) \ } ; \ \ template< BOOST_PP_ENUM_PARAMS(BOOST_PP_INC(n),class A) > \ BOOST_PP_CAT(InPlaceFactory, BOOST_PP_INC(n) ) < BOOST_PP_ENUM_PARAMS( BOOST_PP_INC(n), A ) > \ in_place ( BOOST_PP_ENUM_BINARY_PARAMS(BOOST_PP_INC(n),A, const& a) ) \ { \ return BOOST_PP_CAT(InPlaceFactory, BOOST_PP_INC(n) ) < BOOST_PP_ENUM_PARAMS( BOOST_PP_INC(n), A ) > \ ( BOOST_PP_ENUM_PARAMS( BOOST_PP_INC(n), a ) ) ; \ } ; \ BOOST_PP_REPEAT( BOOST_MAX_INPLACE_FACTORY_ARITY, BOOST_DEFINE_INPLACE_FACTORY_CLASS, BOOST_PP_EMPTY() ) } // namespace boost #endif wxformbuilder-3.1.59/src/boost/detail/lwm_irix.hpp0000644000175000017500000000261111143440027022472 0ustar rrmulderrrmulder#ifndef BOOST_DETAIL_LWM_IRIX_HPP_INCLUDED #define BOOST_DETAIL_LWM_IRIX_HPP_INCLUDED // // boost/detail/lwm_irix.hpp // // Copyright (c) 2002 Peter Dimov and Multi Media Ltd. // Copyright (c) 2002 Dan Gohman // // Permission to copy, use, modify, sell and distribute this software // is granted provided this copyright notice appears in all copies. // This software is provided "as is" without express or implied // warranty, and with no claim as to its suitability for any purpose. // #include #include #include namespace boost { namespace detail { class lightweight_mutex { private: __uint32_t l_; lightweight_mutex(lightweight_mutex const &); lightweight_mutex & operator=(lightweight_mutex const &); public: lightweight_mutex(): l_(0) { } class scoped_lock; friend class scoped_lock; class scoped_lock { private: lightweight_mutex & m_; scoped_lock(scoped_lock const &); scoped_lock & operator=(scoped_lock const &); public: explicit scoped_lock(lightweight_mutex & m): m_(m) { while( test_and_set32(&m_.l_, 1) ) { sched_yield(); } } ~scoped_lock() { m_.l_ = 0; } }; }; } // namespace detail } // namespace boost #endif // #ifndef BOOST_DETAIL_LWM_IRIX_HPP_INCLUDED wxformbuilder-3.1.59/src/boost/detail/iterator.hpp0000644000175000017500000003673011143440027022502 0ustar rrmulderrrmulder// (C) Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // Boost versions of // // std::iterator_traits<>::iterator_category // std::iterator_traits<>::difference_type // std::distance() // // ...for all compilers and iterators // // Additionally, if X is a pointer // std::iterator_traits::pointer // Otherwise, if partial specialization is supported or X is not a pointer // std::iterator_traits::value_type // std::iterator_traits::pointer // std::iterator_traits::reference // // See http://www.boost.org for most recent version including documentation. // Revision History // 04 Mar 2001 - More attempted fixes for Intel C++ (David Abrahams) // 03 Mar 2001 - Put all implementation into namespace // boost::detail::iterator_traits_. Some progress made on fixes // for Intel compiler. (David Abrahams) // 02 Mar 2001 - Changed BOOST_MSVC to BOOST_MSVC_STD_ITERATOR in a few // places. (Jeremy Siek) // 19 Feb 2001 - Improved workarounds for stock MSVC6; use yes_type and // no_type from type_traits.hpp; stopped trying to remove_cv // before detecting is_pointer, in honor of the new type_traits // semantics. (David Abrahams) // 13 Feb 2001 - Make it work with nearly all standard-conforming iterators // under raw VC6. The one category remaining which will fail is // that of iterators derived from std::iterator but not // boost::iterator and which redefine difference_type. // 11 Feb 2001 - Clean away code which can never be used (David Abrahams) // 09 Feb 2001 - Always have a definition for each traits member, even if it // can't be properly deduced. These will be incomplete types in // some cases (undefined), but it helps suppress MSVC errors // elsewhere (David Abrahams) // 07 Feb 2001 - Support for more of the traits members where possible, making // this useful as a replacement for std::iterator_traits when // used as a default template parameter. // 06 Feb 2001 - Removed useless #includes of standard library headers // (David Abrahams) #ifndef ITERATOR_DWA122600_HPP_ # define ITERATOR_DWA122600_HPP_ # include # include // STLPort 4.0 and betas have a bug when debugging is enabled and there is no // partial specialization: instead of an iterator_category typedef, the standard // container iterators have _Iterator_category. // // Also, whether debugging is enabled or not, there is a broken specialization // of std::iterator which has no // typedefs but iterator_category. # if defined(__SGI_STL_PORT) # if (__SGI_STL_PORT <= 0x410) && !defined(__STL_CLASS_PARTIAL_SPECIALIZATION) && defined(__STL_DEBUG) # define BOOST_BAD_CONTAINER_ITERATOR_CATEGORY_TYPEDEF # endif # define BOOST_BAD_OUTPUT_ITERATOR_SPECIALIZATION # endif // STLPort <= 4.1b4 && no partial specialization # if !defined(BOOST_NO_STD_ITERATOR_TRAITS) \ && !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \ && !defined(BOOST_MSVC_STD_ITERATOR) namespace boost { namespace detail { // Define a new template so it can be specialized template struct iterator_traits : std::iterator_traits {}; using std::distance; }} // namespace boost::detail # else # if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \ && !defined(BOOST_MSVC_STD_ITERATOR) // This is the case where everything conforms except BOOST_NO_STD_ITERATOR_TRAITS namespace boost { namespace detail { // Rogue Wave Standard Library fools itself into thinking partial // specialization is missing on some platforms (e.g. Sun), so fails to // supply iterator_traits! template struct iterator_traits { typedef typename Iterator::value_type value_type; typedef typename Iterator::reference reference; typedef typename Iterator::pointer pointer; typedef typename Iterator::difference_type difference_type; typedef typename Iterator::iterator_category iterator_category; }; template struct iterator_traits { typedef T value_type; typedef T& reference; typedef T* pointer; typedef std::ptrdiff_t difference_type; typedef std::random_access_iterator_tag iterator_category; }; template struct iterator_traits { typedef T value_type; typedef T const& reference; typedef T const* pointer; typedef std::ptrdiff_t difference_type; typedef std::random_access_iterator_tag iterator_category; }; }} // namespace boost::detail # else # include # include # include # ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION # include # include # endif # ifdef BOOST_BAD_OUTPUT_ITERATOR_SPECIALIZATION # include # endif # include # include # include // should be the last #include # include "boost/type_traits/detail/bool_trait_def.hpp" namespace boost { namespace detail { BOOST_MPL_HAS_XXX_TRAIT_DEF(value_type) BOOST_MPL_HAS_XXX_TRAIT_DEF(reference) BOOST_MPL_HAS_XXX_TRAIT_DEF(pointer) BOOST_MPL_HAS_XXX_TRAIT_DEF(difference_type) BOOST_MPL_HAS_XXX_TRAIT_DEF(iterator_category) // is_mutable_iterator -- // // A metafunction returning true iff T is a mutable iterator type // with a nested value_type. Will only work portably with iterators // whose operator* returns a reference, but that seems to be OK for // the iterators supplied by Dinkumware. Some input iterators may // compile-time if they arrive here, and if the compiler is strict // about not taking the address of an rvalue. // This one detects ordinary mutable iterators - the result of // operator* is convertible to the value_type. template type_traits::yes_type is_mutable_iterator_helper(T const*, BOOST_DEDUCED_TYPENAME T::value_type*); // Since you can't take the address of an rvalue, the guts of // is_mutable_iterator_impl will fail if we use &*t directly. This // makes sure we can still work with non-lvalue iterators. template T* mutable_iterator_lvalue_helper(T& x); int mutable_iterator_lvalue_helper(...); // This one detects output iterators such as ostream_iterator which // return references to themselves. template type_traits::yes_type is_mutable_iterator_helper(T const*, T const*); type_traits::no_type is_mutable_iterator_helper(...); template struct is_mutable_iterator_impl { static T t; BOOST_STATIC_CONSTANT( bool, value = sizeof( detail::is_mutable_iterator_helper( (T*)0 , mutable_iterator_lvalue_helper(*t) // like &*t )) == sizeof(type_traits::yes_type) ); }; BOOST_TT_AUX_BOOL_TRAIT_DEF1( is_mutable_iterator,T,::boost::detail::is_mutable_iterator_impl::value) // is_full_iterator_traits -- // // A metafunction returning true iff T has all the requisite nested // types to satisfy the requirements for a fully-conforming // iterator_traits implementation. template struct is_full_iterator_traits_impl { enum { value = has_value_type::value & has_reference::value & has_pointer::value & has_difference_type::value & has_iterator_category::value }; }; BOOST_TT_AUX_BOOL_TRAIT_DEF1( is_full_iterator_traits,T,::boost::detail::is_full_iterator_traits_impl::value) # ifdef BOOST_BAD_CONTAINER_ITERATOR_CATEGORY_TYPEDEF BOOST_MPL_HAS_XXX_TRAIT_DEF(_Iterator_category) // is_stlport_40_debug_iterator -- // // A metafunction returning true iff T has all the requisite nested // types to satisfy the requirements of an STLPort 4.0 debug iterator // iterator_traits implementation. template struct is_stlport_40_debug_iterator_impl { enum { value = has_value_type::value & has_reference::value & has_pointer::value & has_difference_type::value & has__Iterator_category::value }; }; BOOST_TT_AUX_BOOL_TRAIT_DEF1( is_stlport_40_debug_iterator,T,::boost::detail::is_stlport_40_debug_iterator_impl::value) template struct stlport_40_debug_iterator_traits { typedef typename T::value_type value_type; typedef typename T::reference reference; typedef typename T::pointer pointer; typedef typename T::difference_type difference_type; typedef typename T::_Iterator_category iterator_category; }; # endif // BOOST_BAD_CONTAINER_ITERATOR_CATEGORY_TYPEDEF template struct pointer_iterator_traits; # ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION template struct pointer_iterator_traits { typedef typename remove_const::type value_type; typedef T* pointer; typedef T& reference; typedef std::random_access_iterator_tag iterator_category; typedef std::ptrdiff_t difference_type; }; # else // In case of no template partial specialization, and if T is a // pointer, iterator_traits::value_type can still be computed. For // some basic types, remove_pointer is manually defined in // type_traits/broken_compiler_spec.hpp. For others, do it yourself. template class please_invoke_BOOST_TT_BROKEN_COMPILER_SPEC_on_cv_unqualified_pointee; template struct pointer_value_type : mpl::if_< is_same::type> , please_invoke_BOOST_TT_BROKEN_COMPILER_SPEC_on_cv_unqualified_pointee

, typename remove_const< typename remove_pointer

::type >::type > { }; template struct pointer_reference : mpl::if_< is_same::type> , please_invoke_BOOST_TT_BROKEN_COMPILER_SPEC_on_cv_unqualified_pointee

, typename remove_pointer

::type& > { }; template struct pointer_iterator_traits { typedef T pointer; typedef std::random_access_iterator_tag iterator_category; typedef std::ptrdiff_t difference_type; typedef typename pointer_value_type::type value_type; typedef typename pointer_reference::type reference; }; # endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION // We'll sort iterator types into one of these classifications, from which we // can determine the difference_type, pointer, reference, and value_type template struct standard_iterator_traits { typedef typename Iterator::difference_type difference_type; typedef typename Iterator::value_type value_type; typedef typename Iterator::pointer pointer; typedef typename Iterator::reference reference; typedef typename Iterator::iterator_category iterator_category; }; template struct msvc_stdlib_mutable_traits : std::iterator_traits { typedef typename std::iterator_traits::distance_type difference_type; typedef typename std::iterator_traits::value_type* pointer; typedef typename std::iterator_traits::value_type& reference; }; template struct msvc_stdlib_const_traits : std::iterator_traits { typedef typename std::iterator_traits::distance_type difference_type; typedef const typename std::iterator_traits::value_type* pointer; typedef const typename std::iterator_traits::value_type& reference; }; # ifdef BOOST_BAD_OUTPUT_ITERATOR_SPECIALIZATION template struct is_bad_output_iterator : is_base_and_derived< std::iterator , Iterator> { }; struct bad_output_iterator_traits { typedef void value_type; typedef void difference_type; typedef std::output_iterator_tag iterator_category; typedef void pointer; typedef void reference; }; # endif // If we're looking at an MSVC6 (old Dinkumware) ``standard'' // iterator, this will generate an appropriate traits class. template struct msvc_stdlib_iterator_traits : mpl::if_< is_mutable_iterator , msvc_stdlib_mutable_traits , msvc_stdlib_const_traits >::type {}; template struct non_pointer_iterator_traits : mpl::if_< // if the iterator contains all the right nested types... is_full_iterator_traits // Use a standard iterator_traits implementation , standard_iterator_traits # ifdef BOOST_BAD_CONTAINER_ITERATOR_CATEGORY_TYPEDEF // Check for STLPort 4.0 broken _Iterator_category type , mpl::if_< is_stlport_40_debug_iterator , stlport_40_debug_iterator_traits # endif // Otherwise, assume it's a Dinkum iterator , msvc_stdlib_iterator_traits # ifdef BOOST_BAD_CONTAINER_ITERATOR_CATEGORY_TYPEDEF >::type # endif >::type { }; template struct iterator_traits_aux : mpl::if_< is_pointer , pointer_iterator_traits , non_pointer_iterator_traits >::type { }; template struct iterator_traits { // Explicit forwarding from base class needed to keep MSVC6 happy // under some circumstances. private: # ifdef BOOST_BAD_OUTPUT_ITERATOR_SPECIALIZATION typedef typename mpl::if_< is_bad_output_iterator , bad_output_iterator_traits , iterator_traits_aux >::type base; # else typedef iterator_traits_aux base; # endif public: typedef typename base::value_type value_type; typedef typename base::pointer pointer; typedef typename base::reference reference; typedef typename base::difference_type difference_type; typedef typename base::iterator_category iterator_category; }; // This specialization cuts off ETI (Early Template Instantiation) for MSVC. template <> struct iterator_traits { typedef int value_type; typedef int pointer; typedef int reference; typedef int difference_type; typedef int iterator_category; }; }} // namespace boost::detail # endif // workarounds namespace boost { namespace detail { namespace iterator_traits_ { template struct distance_select { static Difference execute(Iterator i1, const Iterator i2, ...) { Difference result = 0; while (i1 != i2) { ++i1; ++result; } return result; } static Difference execute(Iterator i1, const Iterator i2, std::random_access_iterator_tag*) { return i2 - i1; } }; } // namespace boost::detail::iterator_traits_ template inline typename iterator_traits::difference_type distance(Iterator first, Iterator last) { typedef typename iterator_traits::difference_type diff_t; typedef typename ::boost::detail::iterator_traits::iterator_category iterator_category; return iterator_traits_::distance_select::execute( first, last, (iterator_category*)0); } }} # endif # undef BOOST_BAD_CONTAINER_ITERATOR_CATEGORY_TYPEDEF # undef BOOST_BAD_OUTPUT_ITERATOR_SPECIALIZATION #endif // ITERATOR_DWA122600_HPP_ wxformbuilder-3.1.59/src/boost/detail/lwm_pthreads.hpp0000644000175000017500000000305411143440027023333 0ustar rrmulderrrmulder#ifndef BOOST_DETAIL_LWM_PTHREADS_HPP_INCLUDED #define BOOST_DETAIL_LWM_PTHREADS_HPP_INCLUDED // MS compatible compilers support #pragma once #if defined(_MSC_VER) && (_MSC_VER >= 1020) # pragma once #endif // // boost/detail/lwm_pthreads.hpp // // Copyright (c) 2002 Peter Dimov and Multi Media Ltd. // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // #include namespace boost { namespace detail { class lightweight_mutex { private: pthread_mutex_t m_; lightweight_mutex(lightweight_mutex const &); lightweight_mutex & operator=(lightweight_mutex const &); public: lightweight_mutex() { // HPUX 10.20 / DCE has a nonstandard pthread_mutex_init #if defined(__hpux) && defined(_DECTHREADS_) pthread_mutex_init(&m_, pthread_mutexattr_default); #else pthread_mutex_init(&m_, 0); #endif } ~lightweight_mutex() { pthread_mutex_destroy(&m_); } class scoped_lock; friend class scoped_lock; class scoped_lock { private: pthread_mutex_t & m_; scoped_lock(scoped_lock const &); scoped_lock & operator=(scoped_lock const &); public: scoped_lock(lightweight_mutex & m): m_(m.m_) { pthread_mutex_lock(&m_); } ~scoped_lock() { pthread_mutex_unlock(&m_); } }; }; } // namespace detail } // namespace boost #endif // #ifndef BOOST_DETAIL_LWM_PTHREADS_HPP_INCLUDED wxformbuilder-3.1.59/src/boost/detail/atomic_count_win32.hpp0000644000175000017500000000220711143440027024347 0ustar rrmulderrrmulder#ifndef BOOST_DETAIL_ATOMIC_COUNT_WIN32_HPP_INCLUDED #define BOOST_DETAIL_ATOMIC_COUNT_WIN32_HPP_INCLUDED // MS compatible compilers support #pragma once #if defined(_MSC_VER) && (_MSC_VER >= 1020) # pragma once #endif // // boost/detail/atomic_count_win32.hpp // // Copyright (c) 2001-2005 Peter Dimov // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // #include namespace boost { namespace detail { class atomic_count { public: explicit atomic_count( long v ): value_( v ) { } long operator++() { return BOOST_INTERLOCKED_INCREMENT( &value_ ); } long operator--() { return BOOST_INTERLOCKED_DECREMENT( &value_ ); } operator long() const { return static_cast( value_ ); } private: atomic_count( atomic_count const & ); atomic_count & operator=( atomic_count const & ); long value_; }; } // namespace detail } // namespace boost #endif // #ifndef BOOST_DETAIL_ATOMIC_COUNT_WIN32_HPP_INCLUDED wxformbuilder-3.1.59/src/boost/detail/none.hpp0000644000175000017500000000141711143440027021602 0ustar rrmulderrrmulder// Copyright (C) 2003, Fernando Luis Cacciola Carballal. // // Use, modification, and distribution is subject to the Boost Software // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // See http://www.boost.org/lib/optional for documentation. // // You are welcome to contact the author at: // fernando_cacciola@hotmail.com // #ifndef BOOST_UTILITY_NONE_17SEP2003_HPP #define BOOST_UTILITY_NONE_17SEP2003_HPP #include "boost/detail/none_t.hpp" // NOTE: Borland users have to include this header outside any precompiled headers // (bcc<=5.64 cannot include instance data in a precompiled header) namespace boost { namespace { detail::none_t const none = ((detail::none_t)0) ; } } // namespace boost #endif wxformbuilder-3.1.59/src/boost/detail/ob_call_traits.hpp0000644000175000017500000000740611143440027023630 0ustar rrmulderrrmulder// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000. // Use, modification and distribution are subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt). // // See http://www.boost.org/libs/utility for most recent version including documentation. // // Crippled version for crippled compilers: // see libs/utility/call_traits.htm // /* Release notes: 01st October 2000: Fixed call_traits on VC6, using "poor man's partial specialisation", using ideas taken from "Generative programming" by Krzysztof Czarnecki & Ulrich Eisenecker. */ #ifndef BOOST_OB_CALL_TRAITS_HPP #define BOOST_OB_CALL_TRAITS_HPP #ifndef BOOST_CONFIG_HPP #include #endif #ifndef BOOST_ARITHMETIC_TYPE_TRAITS_HPP #include #endif #ifndef BOOST_COMPOSITE_TYPE_TRAITS_HPP #include #endif namespace boost{ #ifdef BOOST_MSVC6_MEMBER_TEMPLATES // // use member templates to emulate // partial specialisation: // namespace detail{ template struct standard_call_traits { typedef T value_type; typedef T& reference; typedef const T& const_reference; typedef const T& param_type; }; template struct simple_call_traits { typedef T value_type; typedef T& reference; typedef const T& const_reference; typedef const T param_type; }; template struct reference_call_traits { typedef T value_type; typedef T reference; typedef T const_reference; typedef T param_type; }; template struct call_traits_chooser { template struct rebind { typedef standard_call_traits type; }; }; template <> struct call_traits_chooser { template struct rebind { typedef simple_call_traits type; }; }; template <> struct call_traits_chooser { template struct rebind { typedef reference_call_traits type; }; }; template struct call_traits_sizeof_chooser2 { template struct small_rebind { typedef simple_call_traits small_type; }; }; template<> struct call_traits_sizeof_chooser2 { template struct small_rebind { typedef standard_call_traits small_type; }; }; template <> struct call_traits_chooser { template struct rebind { enum { sizeof_choice = (sizeof(T) <= sizeof(void*)) }; typedef call_traits_sizeof_chooser2<(sizeof(T) <= sizeof(void*))> chooser; typedef typename chooser::template small_rebind bound_type; typedef typename bound_type::small_type type; }; }; } // namespace detail template struct call_traits { private: typedef detail::call_traits_chooser< ::boost::is_pointer::value, ::boost::is_arithmetic::value, ::boost::is_reference::value > chooser; typedef typename chooser::template rebind bound_type; typedef typename bound_type::type call_traits_type; public: typedef typename call_traits_type::value_type value_type; typedef typename call_traits_type::reference reference; typedef typename call_traits_type::const_reference const_reference; typedef typename call_traits_type::param_type param_type; }; #else // // sorry call_traits is completely non-functional // blame your broken compiler: // template struct call_traits { typedef T value_type; typedef T& reference; typedef const T& const_reference; typedef const T& param_type; }; #endif // member templates } #endif // BOOST_OB_CALL_TRAITS_HPP wxformbuilder-3.1.59/src/boost/config/auto_link.hpp0000644000175000017500000002346211143440027022637 0ustar rrmulderrrmulder// (C) Copyright John Maddock 2003. // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) /* * LOCATION: see http://www.boost.org for most recent version. * FILE auto_link.hpp * VERSION see * DESCRIPTION: Automatic library inclusion for Borland/Microsoft compilers. */ /************************************************************************* USAGE: ~~~~~~ Before including this header you must define one or more of define the following macros: BOOST_LIB_NAME: Required: A string containing the basename of the library, for example boost_regex. BOOST_LIB_TOOLSET: Optional: the base name of the toolset. BOOST_DYN_LINK: Optional: when set link to dll rather than static library. BOOST_LIB_DIAGNOSTIC: Optional: when set the header will print out the name of the library selected (useful for debugging). BOOST_AUTO_LINK_NOMANGLE: Specifies that we should link to BOOST_LIB_NAME.lib, rather than a mangled-name version. These macros will be undef'ed at the end of the header, further this header has no include guards - so be sure to include it only once from your library! Algorithm: ~~~~~~~~~~ Libraries for Borland and Microsoft compilers are automatically selected here, the name of the lib is selected according to the following formula: BOOST_LIB_PREFIX + BOOST_LIB_NAME + "_" + BOOST_LIB_TOOLSET + BOOST_LIB_THREAD_OPT + BOOST_LIB_RT_OPT "-" + BOOST_LIB_VERSION These are defined as: BOOST_LIB_PREFIX: "lib" for static libraries otherwise "". BOOST_LIB_NAME: The base name of the lib ( for example boost_regex). BOOST_LIB_TOOLSET: The compiler toolset name (vc6, vc7, bcb5 etc). BOOST_LIB_THREAD_OPT: "-mt" for multithread builds, otherwise nothing. BOOST_LIB_RT_OPT: A suffix that indicates the runtime library used, contains one or more of the following letters after a hiphen: s static runtime (dynamic if not present). d debug build (release if not present). g debug/diagnostic runtime (release if not present). p STLPort Build. BOOST_LIB_VERSION: The Boost version, in the form x_y, for Boost version x.y. ***************************************************************************/ #ifdef __cplusplus # ifndef BOOST_CONFIG_HPP # include # endif #elif defined(_MSC_VER) && !defined(__MWERKS__) && !defined(__EDG_VERSION__) // // C language compatability (no, honestly) // # define BOOST_MSVC _MSC_VER # define BOOST_STRINGIZE(X) BOOST_DO_STRINGIZE(X) # define BOOST_DO_STRINGIZE(X) #X #endif // // Only include what follows for known and supported compilers: // #if defined(BOOST_MSVC) \ || defined(__BORLANDC__) \ || (defined(__MWERKS__) && defined(_WIN32) && (__MWERKS__ >= 0x3000)) \ || (defined(__ICL) && defined(_MSC_EXTENSIONS) && (_MSC_VER >= 1200)) #ifndef BOOST_VERSION_HPP # include #endif #ifndef BOOST_LIB_NAME # error "Macro BOOST_LIB_NAME not set (internal error)" #endif // // error check: // #if defined(__MSVC_RUNTIME_CHECKS) && !defined(_DEBUG) # pragma message("Using the /RTC option without specifying a debug runtime will lead to linker errors") # pragma message("Hint: go to the code generation options and switch to one of the debugging runtimes") # error "Incompatible build options" #endif // // select toolset if not defined already: // #ifndef BOOST_LIB_TOOLSET #if defined(BOOST_MSVC) && (BOOST_MSVC == 1200) // vc6: # define BOOST_LIB_TOOLSET "vc6" #elif defined(BOOST_MSVC) && (BOOST_MSVC == 1300) // vc7: # define BOOST_LIB_TOOLSET "vc7" #elif defined(BOOST_MSVC) && (BOOST_MSVC == 1310) // vc71: # define BOOST_LIB_TOOLSET "vc71" #elif defined(BOOST_MSVC) && (BOOST_MSVC >= 1400) // vc80: # define BOOST_LIB_TOOLSET "vc80" #elif defined(__BORLANDC__) // CBuilder 6: # define BOOST_LIB_TOOLSET "bcb" #elif defined(__ICL) // Intel C++, no version number: # define BOOST_LIB_TOOLSET "iw" #elif defined(__MWERKS__) && (__MWERKS__ <= 0x31FF ) // Metrowerks CodeWarrior 8.x # define BOOST_LIB_TOOLSET "cw8" #elif defined(__MWERKS__) && (__MWERKS__ <= 0x32FF ) // Metrowerks CodeWarrior 9.x # define BOOST_LIB_TOOLSET "cw9" #endif #endif // BOOST_LIB_TOOLSET // // select thread opt: // #if defined(_MT) || defined(__MT__) # define BOOST_LIB_THREAD_OPT "-mt" #else # define BOOST_LIB_THREAD_OPT #endif #if defined(_MSC_VER) || defined(__MWERKS__) # ifdef _DLL # if (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)) && (defined(_STLP_OWN_IOSTREAMS) || defined(__STL_OWN_IOSTREAMS)) # if defined(_DEBUG) && (defined(__STL_DEBUG) || defined(_STLP_DEBUG)) # define BOOST_LIB_RT_OPT "-gdp" # elif defined(_DEBUG) # define BOOST_LIB_RT_OPT "-gdp" # pragma message("warning: STLPort debug versions are built with /D_STLP_DEBUG=1") # error "Build options aren't compatible with pre-built libraries" # else # define BOOST_LIB_RT_OPT "-p" # endif # elif defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION) # if defined(_DEBUG) && (defined(__STL_DEBUG) || defined(_STLP_DEBUG)) # define BOOST_LIB_RT_OPT "-gdpn" # elif defined(_DEBUG) # define BOOST_LIB_RT_OPT "-gdpn" # pragma message("warning: STLPort debug versions are built with /D_STLP_DEBUG=1") # error "Build options aren't compatible with pre-built libraries" # else # define BOOST_LIB_RT_OPT "-pn" # endif # else # if defined(_DEBUG) # define BOOST_LIB_RT_OPT "-gd" # else # define BOOST_LIB_RT_OPT # endif # endif # else # if (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)) && (defined(_STLP_OWN_IOSTREAMS) || defined(__STL_OWN_IOSTREAMS)) # if defined(_DEBUG) && (defined(__STL_DEBUG) || defined(_STLP_DEBUG)) # define BOOST_LIB_RT_OPT "-sgdp" # elif defined(_DEBUG) # define BOOST_LIB_RT_OPT "-sgdp" # pragma message("warning: STLPort debug versions are built with /D_STLP_DEBUG=1") # error "Build options aren't compatible with pre-built libraries" # else # define BOOST_LIB_RT_OPT "-sp" # endif # elif defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION) # if defined(_DEBUG) && (defined(__STL_DEBUG) || defined(_STLP_DEBUG)) # define BOOST_LIB_RT_OPT "-sgdpn" # elif defined(_DEBUG) # define BOOST_LIB_RT_OPT "-sgdpn" # pragma message("warning: STLPort debug versions are built with /D_STLP_DEBUG=1") # error "Build options aren't compatible with pre-built libraries" # else # define BOOST_LIB_RT_OPT "-spn" # endif # else # if defined(_DEBUG) # define BOOST_LIB_RT_OPT "-sgd" # else # define BOOST_LIB_RT_OPT "-s" # endif # endif # endif #elif defined(__BORLANDC__) // // figure out whether we want the debug builds or not: // #if __BORLANDC__ > 0x561 #pragma defineonoption BOOST_BORLAND_DEBUG -v #endif // // sanity check: // #if defined(__STL_DEBUG) || defined(_STLP_DEBUG) #error "Pre-built versions of the Boost libraries are not provided in STLPort-debug form" #endif # ifdef _RTLDLL # ifdef BOOST_BORLAND_DEBUG # define BOOST_LIB_RT_OPT "-d" # else # define BOOST_LIB_RT_OPT # endif # else # ifdef BOOST_BORLAND_DEBUG # define BOOST_LIB_RT_OPT "-sd" # else # define BOOST_LIB_RT_OPT "-s" # endif # endif #endif // // select linkage opt: // #if (defined(_DLL) || defined(_RTLDLL)) && defined(BOOST_DYN_LINK) # define BOOST_LIB_PREFIX #elif defined(BOOST_DYN_LINK) # error "Mixing a dll boost library with a static runtime is a really bad idea..." #else # define BOOST_LIB_PREFIX "lib" #endif // // now include the lib: // #if defined(BOOST_LIB_NAME) \ && defined(BOOST_LIB_PREFIX) \ && defined(BOOST_LIB_TOOLSET) \ && defined(BOOST_LIB_THREAD_OPT) \ && defined(BOOST_LIB_RT_OPT) \ && defined(BOOST_LIB_VERSION) #ifndef BOOST_AUTO_LINK_NOMANGLE # pragma comment(lib, BOOST_LIB_PREFIX BOOST_STRINGIZE(BOOST_LIB_NAME) "-" BOOST_LIB_TOOLSET BOOST_LIB_THREAD_OPT BOOST_LIB_RT_OPT "-" BOOST_LIB_VERSION ".lib") # ifdef BOOST_LIB_DIAGNOSTIC # pragma message ("Linking to lib file: " BOOST_LIB_PREFIX BOOST_STRINGIZE(BOOST_LIB_NAME) "-" BOOST_LIB_TOOLSET BOOST_LIB_THREAD_OPT BOOST_LIB_RT_OPT "-" BOOST_LIB_VERSION ".lib") # endif #else # pragma comment(lib, BOOST_STRINGIZE(BOOST_LIB_NAME) ".lib") # ifdef BOOST_LIB_DIAGNOSTIC # pragma message ("Linking to lib file: " BOOST_STRINGIZE(BOOST_LIB_NAME) ".lib") # endif #endif #else # error "some required macros where not defined (internal logic error)." #endif #endif // _MSC_VER || __BORLANDC__ // // finally undef any macros we may have set: // #ifdef BOOST_LIB_PREFIX # undef BOOST_LIB_PREFIX #endif #if defined(BOOST_LIB_NAME) # undef BOOST_LIB_NAME #endif // Don't undef this one: it can be set by the user and should be the // same for all libraries: //#if defined(BOOST_LIB_TOOLSET) //# undef BOOST_LIB_TOOLSET //#endif #if defined(BOOST_LIB_THREAD_OPT) # undef BOOST_LIB_THREAD_OPT #endif #if defined(BOOST_LIB_RT_OPT) # undef BOOST_LIB_RT_OPT #endif #if defined(BOOST_LIB_LINK_OPT) # undef BOOST_LIB_LINK_OPT #endif #if defined(BOOST_LIB_DEBUG_OPT) # undef BOOST_LIB_DEBUG_OPT #endif #if defined(BOOST_DYN_LINK) # undef BOOST_DYN_LINK #endif #if defined(BOOST_AUTO_LINK_NOMANGLE) # undef BOOST_AUTO_LINK_NOMANGLE #endif wxformbuilder-3.1.59/src/boost/config/select_compiler_config.hpp0000644000175000017500000000525211143440027025345 0ustar rrmulderrrmulder// Boost compiler configuration selection header file // (C) Copyright John Maddock 2001 - 2003. // (C) Copyright Martin Wille 2003. // (C) Copyright Guillaume Melquiond 2003. // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org for most recent version. // locate which compiler we are using and define // BOOST_COMPILER_CONFIG as needed: # if defined __COMO__ // Comeau C++ # define BOOST_COMPILER_CONFIG "boost/config/compiler/comeau.hpp" #elif defined __DMC__ // Digital Mars C++ # define BOOST_COMPILER_CONFIG "boost/config/compiler/digitalmars.hpp" #elif defined(__INTEL_COMPILER) || defined(__ICL) || defined(__ICC) || defined(__ECC) // Intel # define BOOST_COMPILER_CONFIG "boost/config/compiler/intel.hpp" # elif defined __GNUC__ // GNU C++: # define BOOST_COMPILER_CONFIG "boost/config/compiler/gcc.hpp" #elif defined __KCC // Kai C++ # define BOOST_COMPILER_CONFIG "boost/config/compiler/kai.hpp" #elif defined __sgi // SGI MIPSpro C++ # define BOOST_COMPILER_CONFIG "boost/config/compiler/sgi_mipspro.hpp" #elif defined __DECCXX // Compaq Tru64 Unix cxx # define BOOST_COMPILER_CONFIG "boost/config/compiler/compaq_cxx.hpp" #elif defined __ghs // Greenhills C++ # define BOOST_COMPILER_CONFIG "boost/config/compiler/greenhills.hpp" #elif defined __BORLANDC__ // Borland # define BOOST_COMPILER_CONFIG "boost/config/compiler/borland.hpp" #elif defined __MWERKS__ // Metrowerks CodeWarrior # define BOOST_COMPILER_CONFIG "boost/config/compiler/metrowerks.hpp" #elif defined __SUNPRO_CC // Sun Workshop Compiler C++ # define BOOST_COMPILER_CONFIG "boost/config/compiler/sunpro_cc.hpp" #elif defined __HP_aCC // HP aCC # define BOOST_COMPILER_CONFIG "boost/config/compiler/hp_acc.hpp" #elif defined(__MRC__) || defined(__SC__) // MPW MrCpp or SCpp # define BOOST_COMPILER_CONFIG "boost/config/compiler/mpw.hpp" #elif defined(__IBMCPP__) // IBM Visual Age # define BOOST_COMPILER_CONFIG "boost/config/compiler/vacpp.hpp" #elif defined _MSC_VER // Microsoft Visual C++ // // Must remain the last #elif since some other vendors (Metrowerks, for // example) also #define _MSC_VER # define BOOST_COMPILER_CONFIG "boost/config/compiler/visualc.hpp" #elif defined (BOOST_ASSERT_CONFIG) // this must come last - generate an error if we don't // recognise the compiler: # error "Unknown compiler - please configure (http://www.boost.org/libs/config/config.htm#configuring) and report the results to the main boost mailing list (http://www.boost.org/more/mailing_lists.htm#main)" #endif wxformbuilder-3.1.59/src/boost/config/select_stdlib_config.hpp0000644000175000017500000000452211143440027025013 0ustar rrmulderrrmulder// Boost compiler configuration selection header file // (C) Copyright John Maddock 2001 - 2003. // (C) Copyright Jens Maurer 2001 - 2002. // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org for most recent version. // locate which std lib we are using and define BOOST_STDLIB_CONFIG as needed: // we need to include a std lib header here in order to detect which // library is in use, use as it's about the smallest // of the std lib headers - do not rely on this header being included - // users can short-circuit this header if they know whose std lib // they are using. #include #if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION) // STLPort library; this _must_ come first, otherwise since // STLport typically sits on top of some other library, we // can end up detecting that first rather than STLport: # define BOOST_STDLIB_CONFIG "boost/config/stdlib/stlport.hpp" #elif defined(__LIBCOMO__) // Comeau STL: #define BOOST_STDLIB_CONFIG "boost/config/stdlib/libcomo.hpp" #elif defined(__STD_RWCOMPILER_H__) || defined(_RWSTD_VER) // Rogue Wave library: # define BOOST_STDLIB_CONFIG "boost/config/stdlib/roguewave.hpp" #elif defined(__GLIBCPP__) || defined(__GLIBCXX__) // GNU libstdc++ 3 # define BOOST_STDLIB_CONFIG "boost/config/stdlib/libstdcpp3.hpp" #elif defined(__STL_CONFIG_H) // generic SGI STL # define BOOST_STDLIB_CONFIG "boost/config/stdlib/sgi.hpp" #elif defined(__MSL_CPP__) // MSL standard lib: # define BOOST_STDLIB_CONFIG "boost/config/stdlib/msl.hpp" #elif defined(__IBMCPP__) // take the default VACPP std lib # define BOOST_STDLIB_CONFIG "boost/config/stdlib/vacpp.hpp" #elif defined(MSIPL_COMPILE_H) // Modena C++ standard library # define BOOST_STDLIB_CONFIG "boost/config/stdlib/modena.hpp" #elif (defined(_YVALS) && !defined(__IBMCPP__)) || defined(_CPPLIB_VER) // Dinkumware Library (this has to appear after any possible replacement libraries): # define BOOST_STDLIB_CONFIG "boost/config/stdlib/dinkumware.hpp" #elif defined (BOOST_ASSERT_CONFIG) // this must come last - generate an error if we don't // recognise the library: # error "Unknown standard library - please configure and report the results to boost.org" #endif wxformbuilder-3.1.59/src/boost/config/suffix.hpp0000644000175000017500000004234111143440027022153 0ustar rrmulderrrmulder// Boost config.hpp configuration header file ------------------------------// // (C) Copyright John Maddock 2001 - 2003. // (C) Copyright Darin Adler 2001. // (C) Copyright Peter Dimov 2001. // (C) Copyright Bill Kempf 2002. // (C) Copyright Jens Maurer 2002. // (C) Copyright David Abrahams 2002 - 2003. // (C) Copyright Gennaro Prota 2003. // (C) Copyright Eric Friedman 2003. // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org for most recent version. // Boost config.hpp policy and rationale documentation has been moved to // http://www.boost.org/libs/config // // This file is intended to be stable, and relatively unchanging. // It should contain boilerplate code only - no compiler specific // code unless it is unavoidable - no changes unless unavoidable. #ifndef BOOST_CONFIG_SUFFIX_HPP #define BOOST_CONFIG_SUFFIX_HPP // // look for long long by looking for the appropriate macros in . // Note that we use limits.h rather than climits for maximal portability, // remember that since these just declare a bunch of macros, there should be // no namespace issues from this. // #include # if !defined(BOOST_HAS_LONG_LONG) \ && !defined(BOOST_MSVC) && !defined(__BORLANDC__) \ && (defined(ULLONG_MAX) || defined(ULONG_LONG_MAX) || defined(ULONGLONG_MAX)) # define BOOST_HAS_LONG_LONG #endif // TODO: Remove the following lines after the 1.33 release because the presence // of an integral 64 bit type has nothing to do with support for long long. #if !defined(BOOST_HAS_LONG_LONG) && !defined(BOOST_NO_INTEGRAL_INT64_T) && !defined(__DECCXX_VER) # define BOOST_NO_INTEGRAL_INT64_T #endif // GCC 3.x will clean up all of those nasty macro definitions that // BOOST_NO_CTYPE_FUNCTIONS is intended to help work around, so undefine // it under GCC 3.x. #if defined(__GNUC__) && (__GNUC__ >= 3) && defined(BOOST_NO_CTYPE_FUNCTIONS) # undef BOOST_NO_CTYPE_FUNCTIONS #endif // // Assume any extensions are in namespace std:: unless stated otherwise: // # ifndef BOOST_STD_EXTENSION_NAMESPACE # define BOOST_STD_EXTENSION_NAMESPACE std # endif // // If cv-qualified specializations are not allowed, then neither are cv-void ones: // # if defined(BOOST_NO_CV_SPECIALIZATIONS) \ && !defined(BOOST_NO_CV_VOID_SPECIALIZATIONS) # define BOOST_NO_CV_VOID_SPECIALIZATIONS # endif // // If there is no numeric_limits template, then it can't have any compile time // constants either! // # if defined(BOOST_NO_LIMITS) \ && !defined(BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS) # define BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS # define BOOST_NO_MS_INT64_NUMERIC_LIMITS # define BOOST_NO_LONG_LONG_NUMERIC_LIMITS # endif // // if there is no long long then there is no specialisation // for numeric_limits either: // #if !defined(BOOST_HAS_LONG_LONG) && !defined(BOOST_NO_LONG_LONG_NUMERIC_LIMITS) # define BOOST_NO_LONG_LONG_NUMERIC_LIMITS #endif // // if there is no __int64 then there is no specialisation // for numeric_limits<__int64> either: // #if !defined(BOOST_HAS_MS_INT64) && !defined(BOOST_NO_MS_INT64_NUMERIC_LIMITS) # define BOOST_NO_MS_INT64_NUMERIC_LIMITS #endif // // if member templates are supported then so is the // VC6 subset of member templates: // # if !defined(BOOST_NO_MEMBER_TEMPLATES) \ && !defined(BOOST_MSVC6_MEMBER_TEMPLATES) # define BOOST_MSVC6_MEMBER_TEMPLATES # endif // // Without partial specialization, can't test for partial specialisation bugs: // # if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \ && !defined(BOOST_BCB_PARTIAL_SPECIALIZATION_BUG) # define BOOST_BCB_PARTIAL_SPECIALIZATION_BUG # endif // // Without partial specialization, we can't have array-type partial specialisations: // # if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \ && !defined(BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS) # define BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS # endif // // Without partial specialization, std::iterator_traits can't work: // # if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \ && !defined(BOOST_NO_STD_ITERATOR_TRAITS) # define BOOST_NO_STD_ITERATOR_TRAITS # endif // // Without member template support, we can't have template constructors // in the standard library either: // # if defined(BOOST_NO_MEMBER_TEMPLATES) \ && !defined(BOOST_MSVC6_MEMBER_TEMPLATES) \ && !defined(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS) # define BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS # endif // // Without member template support, we can't have a conforming // std::allocator template either: // # if defined(BOOST_NO_MEMBER_TEMPLATES) \ && !defined(BOOST_MSVC6_MEMBER_TEMPLATES) \ && !defined(BOOST_NO_STD_ALLOCATOR) # define BOOST_NO_STD_ALLOCATOR # endif // // without ADL support then using declarations will break ADL as well: // #if defined(BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP) && !defined(BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL) # define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL #endif // // If we have a standard allocator, then we have a partial one as well: // #if !defined(BOOST_NO_STD_ALLOCATOR) # define BOOST_HAS_PARTIAL_STD_ALLOCATOR #endif // // We can't have a working std::use_facet if there is no std::locale: // # if defined(BOOST_NO_STD_LOCALE) && !defined(BOOST_NO_STD_USE_FACET) # define BOOST_NO_STD_USE_FACET # endif // // We can't have a std::messages facet if there is no std::locale: // # if defined(BOOST_NO_STD_LOCALE) && !defined(BOOST_NO_STD_MESSAGES) # define BOOST_NO_STD_MESSAGES # endif // // We can't have a working std::wstreambuf if there is no std::locale: // # if defined(BOOST_NO_STD_LOCALE) && !defined(BOOST_NO_STD_WSTREAMBUF) # define BOOST_NO_STD_WSTREAMBUF # endif // // We can't have a if there is no : // # if defined(BOOST_NO_CWCHAR) && !defined(BOOST_NO_CWCTYPE) # define BOOST_NO_CWCTYPE # endif // // We can't have a swprintf if there is no : // # if defined(BOOST_NO_CWCHAR) && !defined(BOOST_NO_SWPRINTF) # define BOOST_NO_SWPRINTF # endif // // If Win32 support is turned off, then we must turn off // threading support also, unless there is some other // thread API enabled: // #if defined(BOOST_DISABLE_WIN32) && defined(_WIN32) \ && !defined(BOOST_DISABLE_THREADS) && !defined(BOOST_HAS_PTHREADS) # define BOOST_DISABLE_THREADS #endif // // Turn on threading support if the compiler thinks that it's in // multithreaded mode. We put this here because there are only a // limited number of macros that identify this (if there's any missing // from here then add to the appropriate compiler section): // #if (defined(__MT__) || defined(_MT) || defined(_REENTRANT) \ || defined(_PTHREADS)) && !defined(BOOST_HAS_THREADS) # define BOOST_HAS_THREADS #endif // // Turn threading support off if BOOST_DISABLE_THREADS is defined: // #if defined(BOOST_DISABLE_THREADS) && defined(BOOST_HAS_THREADS) # undef BOOST_HAS_THREADS #endif // // Turn threading support off if we don't recognise the threading API: // #if defined(BOOST_HAS_THREADS) && !defined(BOOST_HAS_PTHREADS)\ && !defined(BOOST_HAS_WINTHREADS) && !defined(BOOST_HAS_BETHREADS)\ && !defined(BOOST_HAS_MPTASKS) # undef BOOST_HAS_THREADS #endif // // Turn threading detail macros off if we don't (want to) use threading // #ifndef BOOST_HAS_THREADS # undef BOOST_HAS_PTHREADS # undef BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE # undef BOOST_HAS_WINTHREADS # undef BOOST_HAS_BETHREADS # undef BOOST_HAS_MPTASKS #endif // // If the compiler claims to be C99 conformant, then it had better // have a : // # if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901) # define BOOST_HAS_STDINT_H # endif // // Define BOOST_NO_SLIST and BOOST_NO_HASH if required. // Note that this is for backwards compatibility only. // # ifndef BOOST_HAS_SLIST # define BOOST_NO_SLIST # endif # ifndef BOOST_HAS_HASH # define BOOST_NO_HASH # endif // BOOST_HAS_ABI_HEADERS // This macro gets set if we have headers that fix the ABI, // and prevent ODR violations when linking to external libraries: #if defined(BOOST_ABI_PREFIX) && defined(BOOST_ABI_SUFFIX) && !defined(BOOST_HAS_ABI_HEADERS) # define BOOST_HAS_ABI_HEADERS #endif #if defined(BOOST_HAS_ABI_HEADERS) && defined(BOOST_DISABLE_ABI_HEADERS) # undef BOOST_HAS_ABI_HEADERS #endif // BOOST_NO_STDC_NAMESPACE workaround --------------------------------------// // Because std::size_t usage is so common, even in boost headers which do not // otherwise use the C library, the workaround is included here so // that ugly workaround code need not appear in many other boost headers. // NOTE WELL: This is a workaround for non-conforming compilers; // must still be #included in the usual places so that inclusion // works as expected with standard conforming compilers. The resulting // double inclusion of is harmless. # ifdef BOOST_NO_STDC_NAMESPACE # include namespace std { using ::ptrdiff_t; using ::size_t; } # endif // Workaround for the unfortunate min/max macros defined by some platform headers #define BOOST_PREVENT_MACRO_SUBSTITUTION #ifndef BOOST_USING_STD_MIN # define BOOST_USING_STD_MIN() using std::min #endif #ifndef BOOST_USING_STD_MAX # define BOOST_USING_STD_MAX() using std::max #endif // BOOST_NO_STD_MIN_MAX workaround -----------------------------------------// # ifdef BOOST_NO_STD_MIN_MAX namespace std { template inline const _Tp& min BOOST_PREVENT_MACRO_SUBSTITUTION (const _Tp& __a, const _Tp& __b) { return __b < __a ? __b : __a; } template inline const _Tp& max BOOST_PREVENT_MACRO_SUBSTITUTION (const _Tp& __a, const _Tp& __b) { return __a < __b ? __b : __a; } } # endif // BOOST_STATIC_CONSTANT workaround --------------------------------------- // // On compilers which don't allow in-class initialization of static integral // constant members, we must use enums as a workaround if we want the constants // to be available at compile-time. This macro gives us a convenient way to // declare such constants. # ifdef BOOST_NO_INCLASS_MEMBER_INITIALIZATION # define BOOST_STATIC_CONSTANT(type, assignment) enum { assignment } # else # define BOOST_STATIC_CONSTANT(type, assignment) static const type assignment # endif // BOOST_USE_FACET / HAS_FACET workaround ----------------------------------// // When the standard library does not have a conforming std::use_facet there // are various workarounds available, but they differ from library to library. // The same problem occurs with has_facet. // These macros provide a consistent way to access a locale's facets. // Usage: // replace // std::use_facet(loc); // with // BOOST_USE_FACET(Type, loc); // Note do not add a std:: prefix to the front of BOOST_USE_FACET! // Use for BOOST_HAS_FACET is analagous. #if defined(BOOST_NO_STD_USE_FACET) # ifdef BOOST_HAS_TWO_ARG_USE_FACET # define BOOST_USE_FACET(Type, loc) std::use_facet(loc, static_cast(0)) # define BOOST_HAS_FACET(Type, loc) std::has_facet(loc, static_cast(0)) # elif defined(BOOST_HAS_MACRO_USE_FACET) # define BOOST_USE_FACET(Type, loc) std::_USE(loc, Type) # define BOOST_HAS_FACET(Type, loc) std::_HAS(loc, Type) # elif defined(BOOST_HAS_STLP_USE_FACET) # define BOOST_USE_FACET(Type, loc) (*std::_Use_facet(loc)) # define BOOST_HAS_FACET(Type, loc) std::has_facet< Type >(loc) # endif #else # define BOOST_USE_FACET(Type, loc) std::use_facet< Type >(loc) # define BOOST_HAS_FACET(Type, loc) std::has_facet< Type >(loc) #endif // BOOST_NESTED_TEMPLATE workaround ------------------------------------------// // Member templates are supported by some compilers even though they can't use // the A::template member syntax, as a workaround replace: // // typedef typename A::template rebind binder; // // with: // // typedef typename A::BOOST_NESTED_TEMPLATE rebind binder; #ifndef BOOST_NO_MEMBER_TEMPLATE_KEYWORD # define BOOST_NESTED_TEMPLATE template #else # define BOOST_NESTED_TEMPLATE #endif // BOOST_UNREACHABLE_RETURN(x) workaround -------------------------------------// // Normally evaluates to nothing, unless BOOST_NO_UNREACHABLE_RETURN_DETECTION // is defined, in which case it evaluates to return x; Use when you have a return // statement that can never be reached. #ifdef BOOST_NO_UNREACHABLE_RETURN_DETECTION # define BOOST_UNREACHABLE_RETURN(x) return x; #else # define BOOST_UNREACHABLE_RETURN(x) #endif // BOOST_DEDUCED_TYPENAME workaround ------------------------------------------// // // Some compilers don't support the use of `typename' for dependent // types in deduced contexts, e.g. // // template void f(T, typename T::type); // ^^^^^^^^ // Replace these declarations with: // // template void f(T, BOOST_DEDUCED_TYPENAME T::type); #ifndef BOOST_NO_DEDUCED_TYPENAME # define BOOST_DEDUCED_TYPENAME typename #else # define BOOST_DEDUCED_TYPENAME #endif // long long workaround ------------------------------------------// // On gcc (and maybe other compilers?) long long is alway supported // but it's use may generate either warnings (with -ansi), or errors // (with -pedantic -ansi) unless it's use is prefixed by __extension__ // #if defined(BOOST_HAS_LONG_LONG) namespace boost{ # ifdef __GNUC__ __extension__ typedef long long long_long_type; __extension__ typedef unsigned long long ulong_long_type; # else typedef long long long_long_type; typedef unsigned long long ulong_long_type; # endif } #endif // BOOST_[APPEND_]EXPLICIT_TEMPLATE_[NON_]TYPE macros --------------------------// // // Some compilers have problems with function templates whose // template parameters don't appear in the function parameter // list (basically they just link one instantiation of the // template in the final executable). These macros provide a // uniform way to cope with the problem with no effects on the // calling syntax. // Example: // // #include // #include // #include // // template // void f() { std::cout << n << ' '; } // // template // void g() { std::cout << typeid(T).name() << ' '; } // // int main() { // f<1>(); // f<2>(); // // g(); // g(); // } // // With VC++ 6.0 the output is: // // 2 2 double double // // To fix it, write // // template // void f(BOOST_EXPLICIT_TEMPLATE_NON_TYPE(int, n)) { ... } // // template // void g(BOOST_EXPLICIT_TEMPLATE_TYPE(T)) { ... } // #if defined BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS # include "boost/type.hpp" # include "boost/non_type.hpp" # define BOOST_EXPLICIT_TEMPLATE_TYPE(t) boost::type* = 0 # define BOOST_EXPLICIT_TEMPLATE_TYPE_SPEC(t) boost::type* # define BOOST_EXPLICIT_TEMPLATE_NON_TYPE(t, v) boost::non_type* = 0 # define BOOST_EXPLICIT_TEMPLATE_NON_TYPE_SPEC(t, v) boost::non_type* # define BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(t) \ , BOOST_EXPLICIT_TEMPLATE_TYPE(t) # define BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(t) \ , BOOST_EXPLICIT_TEMPLATE_TYPE_SPEC(t) # define BOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE(t, v) \ , BOOST_EXPLICIT_TEMPLATE_NON_TYPE(t, v) # define BOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE_SPEC(t, v) \ , BOOST_EXPLICIT_TEMPLATE_NON_TYPE_SPEC(t, v) #else // no workaround needed: expand to nothing # define BOOST_EXPLICIT_TEMPLATE_TYPE(t) # define BOOST_EXPLICIT_TEMPLATE_TYPE_SPEC(t) # define BOOST_EXPLICIT_TEMPLATE_NON_TYPE(t, v) # define BOOST_EXPLICIT_TEMPLATE_NON_TYPE_SPEC(t, v) # define BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(t) # define BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(t) # define BOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE(t, v) # define BOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE_SPEC(t, v) #endif // defined BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS // ---------------------------------------------------------------------------// // // Helper macro BOOST_STRINGIZE: // Converts the parameter X to a string after macro replacement // on X has been performed. // #define BOOST_STRINGIZE(X) BOOST_DO_STRINGIZE(X) #define BOOST_DO_STRINGIZE(X) #X // // Helper macro BOOST_JOIN: // The following piece of macro magic joins the two // arguments together, even when one of the arguments is // itself a macro (see 16.3.1 in C++ standard). The key // is that macro expansion of macro arguments does not // occur in BOOST_DO_JOIN2 but does in BOOST_DO_JOIN. // #define BOOST_JOIN( X, Y ) BOOST_DO_JOIN( X, Y ) #define BOOST_DO_JOIN( X, Y ) BOOST_DO_JOIN2(X,Y) #define BOOST_DO_JOIN2( X, Y ) X##Y // // Set some default values for compiler/library/platform names. // These are for debugging config setup only: // # ifndef BOOST_COMPILER # define BOOST_COMPILER "Unknown ISO C++ Compiler" # endif # ifndef BOOST_STDLIB # define BOOST_STDLIB "Unknown ISO standard library" # endif # ifndef BOOST_PLATFORM # if defined(unix) || defined(__unix) || defined(_XOPEN_SOURCE) \ || defined(_POSIX_SOURCE) # define BOOST_PLATFORM "Generic Unix" # else # define BOOST_PLATFORM "Unknown" # endif # endif #endif wxformbuilder-3.1.59/src/boost/config/abi_suffix.hpp0000644000175000017500000000132111143440027022757 0ustar rrmulderrrmulder// abi_sufffix header -------------------------------------------------------// // Copyright John Maddock 2003 // Use, modification and distribution are subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt). // This header should be #included AFTER code that was preceded by a #include // . #ifndef BOOST_CONFIG_ABI_PREFIX_HPP # error Header boost/config/abi_prefix.hpp must only be used after boost/config/abi_prefix.hpp #else # undef BOOST_CONFIG_ABI_PREFIX_HPP #endif // the suffix header occurs after all of our code: #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif wxformbuilder-3.1.59/src/boost/config/posix_features.hpp0000644000175000017500000000667611143440027023722 0ustar rrmulderrrmulder// (C) Copyright John Maddock 2001 - 2003. // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org for most recent version. // All POSIX feature tests go in this file, // Note that we test _POSIX_C_SOURCE and _XOPEN_SOURCE as well // _POSIX_VERSION and _XOPEN_VERSION: on some systems POSIX API's // may be present but none-functional unless _POSIX_C_SOURCE and // _XOPEN_SOURCE have been defined to the right value (it's up // to the user to do this *before* including any header, although // in most cases the compiler will do this for you). # if defined(BOOST_HAS_UNISTD_H) # include // XOpen has , but is this the correct version check? # if defined(_XOPEN_VERSION) && (_XOPEN_VERSION >= 3) # define BOOST_HAS_NL_TYPES_H # endif // POSIX version 6 requires # if defined(_POSIX_VERSION) && (_POSIX_VERSION >= 200100) # define BOOST_HAS_STDINT_H # endif // POSIX version 2 requires # if defined(_POSIX_VERSION) && (_POSIX_VERSION >= 199009L) # define BOOST_HAS_DIRENT_H # endif // POSIX version 3 requires to have sigaction: # if defined(_POSIX_VERSION) && (_POSIX_VERSION >= 199506L) # define BOOST_HAS_SIGACTION # endif // POSIX defines _POSIX_THREADS > 0 for pthread support, // however some platforms define _POSIX_THREADS without // a value, hence the (_POSIX_THREADS+0 >= 0) check. // Strictly speaking this may catch platforms with a // non-functioning stub , but such occurrences should // occur very rarely if at all. # if defined(_POSIX_THREADS) && (_POSIX_THREADS+0 >= 0) && !defined(BOOST_HAS_WINTHREADS) && !defined(BOOST_HAS_MPTASKS) # define BOOST_HAS_PTHREADS # endif // BOOST_HAS_NANOSLEEP: // This is predicated on _POSIX_TIMERS or _XOPEN_REALTIME: # if (defined(_POSIX_TIMERS) && (_POSIX_TIMERS+0 >= 0)) \ || (defined(_XOPEN_REALTIME) && (_XOPEN_REALTIME+0 >= 0)) # define BOOST_HAS_NANOSLEEP # endif // BOOST_HAS_CLOCK_GETTIME: // This is predicated on _POSIX_TIMERS (also on _XOPEN_REALTIME // but at least one platform - linux - defines that flag without // defining clock_gettime): # if (defined(_POSIX_TIMERS) && (_POSIX_TIMERS+0 >= 0)) # define BOOST_HAS_CLOCK_GETTIME # endif // BOOST_HAS_SCHED_YIELD: // This is predicated on _POSIX_PRIORITY_SCHEDULING or // on _POSIX_THREAD_PRIORITY_SCHEDULING or on _XOPEN_REALTIME. # if defined(_POSIX_PRIORITY_SCHEDULING) && (_POSIX_PRIORITY_SCHEDULING+0 > 0)\ || (defined(_POSIX_THREAD_PRIORITY_SCHEDULING) && (_POSIX_THREAD_PRIORITY_SCHEDULING+0 > 0))\ || (defined(_XOPEN_REALTIME) && (_XOPEN_REALTIME+0 >= 0)) # define BOOST_HAS_SCHED_YIELD # endif // BOOST_HAS_GETTIMEOFDAY: // BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE: // These are predicated on _XOPEN_VERSION, and appears to be first released // in issue 4, version 2 (_XOPEN_VERSION > 500). # if defined(_XOPEN_VERSION) && (_XOPEN_VERSION+0 >= 500) # define BOOST_HAS_GETTIMEOFDAY # if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE+0 >= 500) # define BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE # endif # endif # endif wxformbuilder-3.1.59/src/boost/config/abi_prefix.hpp0000644000175000017500000000117511143440027022757 0ustar rrmulderrrmulder// abi_prefix header -------------------------------------------------------// // Copyright John Maddock 2003 // Use, modification and distribution are subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt). #ifndef BOOST_CONFIG_ABI_PREFIX_HPP # define BOOST_CONFIG_ABI_PREFIX_HPP #else # error double inclusion of header boost/config/abi_prefix.hpp is an error #endif #include // this must occur after all other includes and before any code appears: #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif wxformbuilder-3.1.59/src/boost/config/user.hpp0000644000175000017500000001204511143440027021623 0ustar rrmulderrrmulder// boost/config/user.hpp ---------------------------------------------------// // (C) Copyright John Maddock 2001. // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // Do not check in modified versions of this file, // This file may be customized by the end user, but not by boost. // // Use this file to define a site and compiler specific // configuration policy: // // define this to locate a compiler config file: // #define BOOST_COMPILER_CONFIG // define this to locate a stdlib config file: // #define BOOST_STDLIB_CONFIG // define this to locate a platform config file: // #define BOOST_PLATFORM_CONFIG // define this to disable compiler config, // use if your compiler config has nothing to set: // #define BOOST_NO_COMPILER_CONFIG // define this to disable stdlib config, // use if your stdlib config has nothing to set: // #define BOOST_NO_STDLIB_CONFIG // define this to disable platform config, // use if your platform config has nothing to set: // #define BOOST_NO_PLATFORM_CONFIG // define this to disable all config options, // excluding the user config. Use if your // setup is fully ISO compliant, and has no // useful extensions, or for autoconf generated // setups: // #define BOOST_NO_CONFIG // define this to make the config "optimistic" // about unknown compiler versions. Normally // unknown compiler versions are assumed to have // all the defects of the last known version, however // setting this flag, causes the config to assume // that unknown compiler versions are fully conformant // with the standard: // #define BOOST_STRICT_CONFIG // define this to cause the config to halt compilation // with an #error if it encounters anything unknown -- // either an unknown compiler version or an unknown // compiler/platform/library: // #define BOOST_ASSERT_CONFIG // define if you want to disable threading support, even // when available: // #define BOOST_DISABLE_THREADS // define when you want to disable Win32 specific features // even when available: // #define BOOST_DISABLE_WIN32 // BOOST_DISABLE_ABI_HEADERS: Stops boost headers from including any // prefix/suffix headers that normally control things like struct // packing and alignment. // #define BOOST_DISABLE_ABI_HEADERS // BOOST_ABI_PREFIX: A prefix header to include in place of whatever // boost.config would normally select, any replacement should set up // struct packing and alignment options as required. // #define BOOST_ABI_PREFIX my-header-name // BOOST_ABI_SUFFIX: A suffix header to include in place of whatever // boost.config would normally select, any replacement should undo // the effects of the prefix header. // #define BOOST_ABI_SUFFIX my-header-name // BOOST_ALL_DYN_LINK: Forces all libraries that have separate source, // to be linked as dll's rather than static libraries on Microsoft Windows // (this macro is used to turn on __declspec(dllimport) modifiers, so that // the compiler knows which symbols to look for in a dll rather than in a // static library). Note that there may be some libraries that can only // be statically linked (Boost.Test for example) and others which may only // be dynamically linked (Boost.Threads for example), in these cases this // macro has no effect. // #define BOOST_ALL_DYN_LINK // BOOST_WHATEVER_DYN_LINK: Forces library "whatever" to be linked as a dll // rather than a static library on Microsoft Windows: replace the WHATEVER // part of the macro name with the name of the library that you want to // dynamically link to, for example use BOOST_DATE_TIME_DYN_LINK or // BOOST_REGEX_DYN_LINK etc (this macro is used to turn on __declspec(dllimport) // modifiers, so that the compiler knows which symbols to look for in a dll // rather than in a static library). // Note that there may be some libraries that can only be statically linked // (Boost.Test for example) and others which may only be dynamically linked // (Boost.Threads for example), in these cases this macro is unsupported. // #define BOOST_WHATEVER_DYN_LINK // BOOST_ALL_NO_LIB: Tells the config system not to automatically select // which libraries to link against. // Normally if a compiler supports #pragma lib, then the correct library // build variant will be automatically selected and linked against, // simply by the act of including one of that library's headers. // This macro turns that feature off. // #define BOOST_ALL_NO_LIB // BOOST_WHATEVER_NO_LIB: Tells the config system not to automatically // select which library to link against for library "whatever", // replace WHATEVER in the macro name with the name of the library; // for example BOOST_DATE_TIME_NO_LIB or BOOST_REGEX_NO_LIB. // Normally if a compiler supports #pragma lib, then the correct library // build variant will be automatically selected and linked against, simply // by the act of including one of that library's headers. This macro turns // that feature off. // #define BOOST_WHATEVER_NO_LIB wxformbuilder-3.1.59/src/boost/config/select_platform_config.hpp0000644000175000017500000000475111143440027025362 0ustar rrmulderrrmulder// Boost compiler configuration selection header file // (C) Copyright John Maddock 2001 - 2002. // (C) Copyright Jens Maurer 2001. // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org for most recent version. // locate which platform we are on and define BOOST_PLATFORM_CONFIG as needed. // Note that we define the headers to include using "header_name" not // in order to prevent macro expansion within the header // name (for example "linux" is a macro on linux systems). #if defined(linux) || defined(__linux) || defined(__linux__) // linux: # define BOOST_PLATFORM_CONFIG "boost/config/platform/linux.hpp" #elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) // BSD: # define BOOST_PLATFORM_CONFIG "boost/config/platform/bsd.hpp" #elif defined(sun) || defined(__sun) // solaris: # define BOOST_PLATFORM_CONFIG "boost/config/platform/solaris.hpp" #elif defined(__sgi) // SGI Irix: # define BOOST_PLATFORM_CONFIG "boost/config/platform/irix.hpp" #elif defined(__hpux) // hp unix: # define BOOST_PLATFORM_CONFIG "boost/config/platform/hpux.hpp" #elif defined(__CYGWIN__) // cygwin is not win32: # define BOOST_PLATFORM_CONFIG "boost/config/platform/cygwin.hpp" #elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) // win32: # define BOOST_PLATFORM_CONFIG "boost/config/platform/win32.hpp" #elif defined(__BEOS__) // BeOS # define BOOST_PLATFORM_CONFIG "boost/config/platform/beos.hpp" #elif defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__) // MacOS # define BOOST_PLATFORM_CONFIG "boost/config/platform/macos.hpp" #elif defined(__IBMCPP__) || defined(_AIX) // IBM # define BOOST_PLATFORM_CONFIG "boost/config/platform/aix.hpp" #elif defined(__amigaos__) // AmigaOS # define BOOST_PLATFORM_CONFIG "boost/config/platform/amigaos.hpp" #else # if defined(unix) \ || defined(__unix) \ || defined(_XOPEN_SOURCE) \ || defined(_POSIX_SOURCE) // generic unix platform: # ifndef BOOST_HAS_UNISTD_H # define BOOST_HAS_UNISTD_H # endif # include # endif # if defined (BOOST_ASSERT_CONFIG) // this must come last - generate an error if we don't // recognise the platform: # error "Unknown platform - please configure and report the results to boost.org" # endif #endif wxformbuilder-3.1.59/src/boost/config/requires_threads.hpp0000644000175000017500000000666311143440027024227 0ustar rrmulderrrmulder// (C) Copyright John Maddock 2003. // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_CONFIG_REQUIRES_THREADS_HPP #define BOOST_CONFIG_REQUIRES_THREADS_HPP #ifndef BOOST_CONFIG_HPP # include #endif #if defined(BOOST_DISABLE_THREADS) // // special case to handle versions of gcc which don't currently support threads: // #if defined(__GNUC__) && ((__GNUC__ < 3) || (__GNUC_MINOR__ <= 3) || !defined(BOOST_STRICT_CONFIG)) // // this is checked up to gcc 3.3: // #if defined(__sgi) || defined(__hpux) # error "Multi-threaded programs are not supported by gcc on HPUX or Irix (last checked with gcc 3.3)" #endif #endif # error "Threading support unavaliable: it has been explicitly disabled with BOOST_DISABLE_THREADS" #elif !defined(BOOST_HAS_THREADS) # if defined __COMO__ // Comeau C++ # error "Compiler threading support is not turned on. Please set the correct command line options for threading: -D_MT (Windows) or -D_REENTRANT (Unix)" #elif defined(__INTEL_COMPILER) || defined(__ICL) || defined(__ICC) || defined(__ECC) // Intel #ifdef _WIN32 # error "Compiler threading support is not turned on. Please set the correct command line options for threading: either /MT /MTd /MD or /MDd" #else # error "Compiler threading support is not turned on. Please set the correct command line options for threading: -openmp" #endif # elif defined __GNUC__ // GNU C++: # error "Compiler threading support is not turned on. Please set the correct command line options for threading: -pthread (Linux), -pthreads (Solaris) or -mthreads (Mingw32)" #elif defined __sgi // SGI MIPSpro C++ # error "Compiler threading support is not turned on. Please set the correct command line options for threading: -D_SGI_MP_SOURCE" #elif defined __DECCXX // Compaq Tru64 Unix cxx # error "Compiler threading support is not turned on. Please set the correct command line options for threading: -pthread" #elif defined __BORLANDC__ // Borland # error "Compiler threading support is not turned on. Please set the correct command line options for threading: -tWM" #elif defined __MWERKS__ // Metrowerks CodeWarrior # error "Compiler threading support is not turned on. Please set the correct command line options for threading: either -runtime sm, -runtime smd, -runtime dm, or -runtime dmd" #elif defined __SUNPRO_CC // Sun Workshop Compiler C++ # error "Compiler threading support is not turned on. Please set the correct command line options for threading: -mt" #elif defined __HP_aCC // HP aCC # error "Compiler threading support is not turned on. Please set the correct command line options for threading: -mt" #elif defined(__IBMCPP__) // IBM Visual Age # error "Compiler threading support is not turned on. Please compile the code with the xlC_r compiler" #elif defined _MSC_VER // Microsoft Visual C++ // // Must remain the last #elif since some other vendors (Metrowerks, for // example) also #define _MSC_VER # error "Compiler threading support is not turned on. Please set the correct command line options for threading: either /MT /MTd /MD or /MDd" #else # error "Compiler threading support is not turned on. Please consult your compiler's documentation for the appropriate options to use" #endif // compilers #endif // BOOST_HAS_THREADS #endif // BOOST_CONFIG_REQUIRES_THREADS_HPP wxformbuilder-3.1.59/src/controls/build/premake.lua0000644000175000017500000000334111143440026022630 0ustar rrmulderrrmulder--***************************************************************************** --* Author: RJP Computing --* Date: 12/15/2006 --* Version: 1.00-beta --* Copyright (C) 2006 RJP Computing --* --* This program is free software; you can redistribute it and/or --* modify it under the terms of the GNU General Public License --* as published by the Free Software Foundation; either version 2 --* of the License, or (at your option) any later version. --* --* This program is distributed in the hope that it will be useful, --* but WITHOUT ANY WARRANTY; without even the implied warranty of --* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --* GNU General Public License for more details. --* --* You should have received a copy of the GNU General Public License --* along with this program; if not, write to the Free Software --* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --* --* NOTES: --* - use the '/' slash for all paths. --***************************************************************************** project.name = "wxFormBuilder 3rd-Party Controls" project.bindir = "../../../output" project.libdir = "../../../output" --dofile( "../../../premake/wrap_wxconfig.lua" ) -- Path to wx-config. --wxconfigPath = ".." .. wxCFG_PATH_SEP .. ".." .. wxCFG_PATH_SEP .. ".." .. wxCFG_PATH_SEP .. "premake" .. wxCFG_PATH_SEP -- Create a wxCfg object. --cfg = wxCfg:new() --cfg:Init( wxconfigPath ) --Test out functionality --print( "wxWidgets version = " .. cfg:GetWxVersion() ) --print( "wxWidgets Libs = " .. cfg:GetLibs() ) --print( "wxWidgets cflags = " .. cfg:GetCFlags() ) -- Add sdk projects here. dopackage( "propgrid" ) dopackage( "wxFlatNotebook" ) dopackage( "wxScintilla" ) wxformbuilder-3.1.59/output/resources/icons/left.xpm0000644000175000017500000000126711143440026023122 0ustar rrmulderrrmulder/* XPM */ static const unsigned char * left_xpm[] = { "22 22 4 1", " c None", "! c black", "# c #4C4465", "$ c #0066CC", " ", " ## $$ $$ $$ $$ $$ $$ ", " ## $$ $$ $$ $$ $$ $$ ", " ## ", " ## $$ ", " ## $$ ", " ## ", " ## $$ ", " ## $$ ", " ## ", " ## $$ ", " ## $$ ", " ## ", " ## $$ ", " ## $$ ", " ## ", " ## $$ ", " ## $$ ", " ## ", " ## $$ $$ $$ $$ $$ $$ ", " ## $$ $$ $$ $$ $$ $$ ", " "};wxformbuilder-3.1.59/output/resources/icons/designer.png0000644000175000017500000000072311143440026023744 0ustar rrmulderrrmulderPNG  IHDRagAMA7tEXtSoftwareAdobe ImageReadyqe<eIDATNam> IF4H:aa189HJ   uS( 2:}~!$@6W6/'ڀ%RedLdLRba{9i_,u;+Ḳ{9}LZw&cu43 UmLe0c|cTRl2/n|yJ4 hT%GJQ(EXz=..bLRR)s-1  ˳u$Qiے|͍ U4vJUB{o}2%" ɀ\[]]c4aTчvS(Ef"l[$!+qYXB:b&l  :LIENDB`wxformbuilder-3.1.59/output/resources/icons/prefs.xpm0000644000175000017500000000064011143440026023301 0ustar rrmulderrrmulder/* XPM */ static char * prefs_xpm[] = { "16 16 3 1", " c None", ". c #000000", "+ c #FFFFFF", " ", " ..... .. ", " .+.+++... ", " .....+.+.+++.. ", " .++.+.+.+.++.. ", " .+.+.+.+.+.... ", " .++.+++.+.. .. ", " .+++++++.+. ", " .+++++++++. ", " .+..+....+. ", " .+++++++++. ", " .+..+....+. ", " .+++++++++. ", " ........... ", " ", " "}; wxformbuilder-3.1.59/output/resources/icons/open.png0000644000175000017500000000213411143440026023103 0ustar rrmulderrrmulderPNG  IHDRĴl;sRGBgAMA a cHRMz&u0`:pQ<tIME /4|tEXtSoftwarePaint.NET v2.62kAIDATHK_LWƋbƘnYKe˲%Kc0Z ӑ2Zk l5!-+K4ZdPZhOК,ml)g眖f"4{޷O|-mL&C v2Rj XD ߞnlsvuV"@˝SqeeqY邤Bgg*!)dh,6sXjGȁ3vA3d6{L.[S5k" +bqef|& #(;Z_9}*ftbrr.5N oiB9=Y\4+1QIɡ5zfu5ϡr>O_KT,.-mJrF=F~BeJs[k!6s?;{p [oMCeL)0cLO znx`Ec(PIӘ5ZOt1T^73k*/6Bq /Ϡyri,Gc14fk}ItΠz*{?[4jLs{]g4]^u=yȡuEEE't>i. AThӹh_=GȜqJ/1c8پL~gm}%]!;!⓽{?P۶U'sˮ]DKx!dvƆ>[ۤ`37/4 EUIENDB`wxformbuilder-3.1.59/output/resources/icons/h.png0000644000175000017500000000113311143440026022367 0ustar rrmulderrrmulderPNG  IHDRagAMA7tEXtSoftwareAdobe ImageReadyqe<IDAT8ˍKKPǵ|R7B7nD0BR:  tDG) υ}hT&1ɤyg{n%H =w9pid41!ȋJUVk`$i(* y|ض 4*(L&#$ar= (X,\.7.,˂i\l6W ZRRj- /$8t]I(xb$5i1Ëxa+BW"m}m= s;&fs&L,$T 0x_Y /iZ+@ZE%̈́DF_yW*>S{'.,VH/H/L#7<1b0"ܜ;ӳcFk/ga5qǬ6" A'1^E;;IfxC\qп㮲3pnvKU9N4v,"Cӊc붂AܽerwVPՁA[6V{3.ytm}QP %̂wWwwW1qQ15M4hBh;Q Lg;wm4: h_A$ثE9IENDB`wxformbuilder-3.1.59/output/resources/icons/delete.png0000644000175000017500000000304411143440026023405 0ustar rrmulderrrmulderPNG  IHDRĴl;gAMA7tEXtSoftwareAdobe ImageReadyqe<IDATxb?-@z0eb '?Ʊh13 TaNvvvϞ;>wbr*)4ZRR0B@@XkOFF/\.珅/vssQoo.5)?d@]1TKIiQoA) ~\{8V#{9..B .||,L,, ?/T2 .)!`j`a XUߢ_H.`.²UVW$=AWA@LJ%,UȨ _FFϟ޼a`xؘC?LL@CMe/,#4#`2 ?y0qӧ?>/Ye YX DYX8}(!>TV##ƧO}c`~Ν W̙B6q㝻w7y5 {20,EGA6?9`.[ ?d8s矻gϦ311 @t(!A`r?TS\|+fǏ3ޞW/_2|9sŋn_t4Fff߿0fϿZq#ߧO ,zz 3pBԁ g2~X#̈l8#c00Y54E E$+ PeaQ6S@3_aa(vFvA``9?0bJP1C@DBVRr0% h]@ 88X,XbǓBocD2 в.7..>۷~ .;`i`7C(Y7**[|x@h(PWÖi`[-" @`Kkha` pef@Y@a (~]L!2kB]@`ŕVIHc INAA_?`3(X# d`en!a` 6Xpq H.f+n/&ݏ} N`ag@`_^Ǐ%VEElln4t>,k÷o.l~fzAg|GWu׎|=nS\h8|`}J$FE_(A ЃcM2q~yjal (:{6{{M_58voW/>2Q <[!T&/,]mMxJBRXΖIKLfzMáihR!)b tVz3 fN5m(0ύ%`q1 iWuhݲ#B'YYѩVT|{50kb,yMEH,o-?m 22V<~P}/\_[$rs==-XU MQ5xpSgPw-OzXڝhbqpv]onϽ>ǿMH!BHo;ĬuE_w?n" ؙٱ<#]{+>tJ_,t!OkK#R 2Պ @vMS8y>d-woO*#|.uw>&-ZK)jkPɦ J!'Q~71J_[Ot摆Y#T0>r . T*u5bYvjB5/>xnϷ|)W8?=Z\9¦RbI }r4Ұٜ19=S8YE(]M\.8ָkKGc?^!zK}q ,@r1;3+GŽKݗ?q(qeP7P@[Ͼ=35w=aENb]OX< < @`MPQ4giFϺ)ӁbN[4=]02LW\0<$FP{'c8I3Eu7Es'1MQWuc˦El $l[r!* "ػ]u* )0ī qaء)B߈R;iDln -a08}-@c9[ɦ)3T((Q4%-U<;•D0!\7@LFBĩR]xFt4@,;[BTqvâ~p-~P¯Wm?4u8̳|dr0pm O\d0?ċww~[eeT iF&pϗ)ub#2jH)zR4.P@EVW% axF-S@;qLjǤQg΃*- `^@EJu",Z1ipwB~ӱ!~-!A-c^g3D#cbt4f%!,-x`8 %`ob{m׳`\a@:`/V]kC,-p -!l\ltFRdÅ  0@Xb V,̖B I# = io߀;33 &폂z\)dLơK.Hea:d H,ȲA/ĖWeEAB7//3k3> )M Llg7+(û_B@V7~0K6EfvĕGeQf38 q ISa30PV@$GaӃRᗞ 2Gu@L!hCB$HxA~p WB31+n넚9``h0Dm9t~iB̶!lH߈,ǣ 168J24x&FHa*ehlQka6X2q\|vRY5jMrIm6[*lkԂ, c>&& `k0$z1o[<1# UFPa5&aH'6A) P }RjKY88\a0ҖcIzHmNZ$bK_ nd,x{ RNG4腤㤦Ozm3X}L[ d>k ,$F 3f,,Ӵ }FB"(q+\܀a9uV !u +-8 5CurY#y;M}h-e.觮&FԴf _,#!6\L W!Hka$aGGm~0w DcْRUDyavWqx,ƔTD O (PR9v턞S Pmŕ\_ᅾ ^,' oaY0 S-/yxXc2Zb菟 I 6$x[ORve2Xz N {y2GNx/?dIaUoin\nOa=͐ PMYҳ8#3Y,\`y^ C) ӹc mC ,柍eR; ĽZ`KWjm\g\0X.[vh甯ӸR!UQe~e`?dcX#]O>7L}0ГL㠉s) H @&RIJX`h S kI([I)-f0&H47NT{{C/~`3}2ctkv@o$s!!#f5<`hF6$ ʛ'5#!E\bGjǽ,?& HH(Fv.LCSY.Has6jX00ej%0\3?Ng8 | 3A0rqH/=5xVuw$\F0xz0?;K i8MkhJox `nR{Ae J&rcxad$?+]Iw JYadHFK9?~jh-9&I &a}zoa8ߞ:FWq^1AJ7˫rI>[ToŐ:\GYK(㠏/s[^$ I0zۼ0HρK"_N$(CCI_MtS ɢX,gy $Q&9߈*mYs4NfϮ]#rzٺ0}l*t9W~z+mgIJBw^5hsMRZUлGW*_ɲ"G?f3IsmKs yWf\Y{߳\~]@^{Rix&xnU%AD[?w*EXh]XqmM?Ϻb͏"/!TObE z];7:@"VD0[!0R@V8W?y K[>pI&u=^S~%D: )]ܔ@5t?Yl~~ c|J6h?8D1x U O92K^֧oKJcsl鎦DfytYTU 1p4zvlf/൧b壏ˏ`P^= zNѺ~fg+AkX޸8|w}4nNT}iCA4M T"> Ȓ%ް-Hǝ*h O#%dH~%ČX-$7 Dg-azJ{2*W;q(e3G>)/肥sh&\kx{OLZf 2)g87?x;v5sV%ѨdzȊW?lQywL2mZz9{3lcGB,/h [⦞=fWc?naڜ2,`oT#~0 j꽷?}zʢTՔsM+,5g:W|#d3-[]sVQ:N9_}G@{$(f(A4bhQ ^TL?_կ5 )W-]+O7u=R2S9Ǜ G1s^53fV0gQ--31IJ p>O@KǷhq?q~eW,i̔[y} 9)1V-ay5y'ـA֝ϵD"eeQQ2Rr}mw}؀n1gF).'+ >rM/ivmCj=o&bj|D9[{R5ފYE ֑MQVf~.@Э3x!{ 3*ęzz9 3 c-.%i;mY8Rɔǽ9ڷ=];Jqm8`cޟirQ0zA~@|+#%w!W,Nߣ|i7.l qɌ̜WH|3v1zڋ1r om=$GRlwtۢ3ՙ12jGuyM?d݃ ^_rP˗۶wvm PkWe8T> ?Gr޽\^]NQ3`] pA4fcTUa͟GP׾/w@h.|1@<$_6fE٦Ν®- =xB3 u(D I0G aj HlG"nP@{2e3gOh@F1yIV? f/ƇF:s?O8vdUx"_4Inpmw.}r.hX"'`݃ع%AFg~bh~4Gd4joݕ(_6;:O)k/1ZKboĞL)ҨzXA")c3s3+Y~r̈F6 >57\LQ]ws ѡgϫР W-$GMZU\g XilTZ #(H(Yn)_}Y_~FAt:̢Ct۝mؼ79\yTQBl3zt:mXbkzձ-i-VƏLx8}LЕ<?kkGx:zTZ_yơ. S0 K$d-Zѓ7LsΟB%3v+3^T|`-t20OCR10MXpW/`ժ,[6Ys4M|[ܨ۴s9ޕK[1T="`;fs$#- 64wH ޟ y^w +Q**8gs@؁FI滁n|dX~[-`J[쐻Gf-Hcs譡p0Q!F#ҾAUP II#G^,Uڧ;}Ym@o1z [ܼNIENDB`wxformbuilder-3.1.59/output/resources/icons/undo.png0000644000175000017500000000217311143440026023112 0ustar rrmulderrrmulderPNG  IHDRw=sRGBgAMA a cHRMz&u0`:pQ<tEXtSoftwarePaint.NET v2.62kAIDATHKT}Lq(*Vܼ%y6eXe&zŕl*J:2%꺟^"LU<~36~|~ ]HSȸM(KUt槶l'(&Y^hh ;[Fk{r*p>{oOA!~mo& KZ~6/+Td^C%a׾ЧkwcbKO$ }4>ʵ%:J 8(m:xquPGfS&R/pBNE>A}[Xf:{A"b#Ie-, E@#-(*Rag^!@DvWSzħu8%TBeFZz*,]VakZ#q =v#5h9L|nU}T:K<5:ph'#\nY`DeA)8voGtI!x bbbXXY/pwڵlj)"f% AhFm@lEl'~>{ 8q)( xo$X !Lu#˭`TKR4>aJ"].  RGG=EX-)]R]tTdhL^o<͙Zu ǣeۓ:NNJRQ^IENDB`wxformbuilder-3.1.59/output/resources/icons/right.xpm0000644000175000017500000000127011143440026023277 0ustar rrmulderrrmulder/* XPM */ static const unsigned char * right_xpm[] = { "22 22 4 1", " c None", "! c black", "# c #0066CC", "$ c #4C4465", " ", " ## ## ## ## ## ## $$ ", " ## ## ## ## ## ## $$ ", " $$ ", " ## $$ ", " ## $$ ", " $$ ", " ## $$ ", " ## $$ ", " $$ ", " ## $$ ", " ## $$ ", " $$ ", " ## $$ ", " ## $$ ", " $$ ", " ## $$ ", " ## $$ ", " $$ ", " ## ## ## ## ## ## $$ ", " ## ## ## ## ## ## $$ ", " "};wxformbuilder-3.1.59/output/resources/icons/logo.xpm0000644000175000017500000002432411143440026023127 0ustar rrmulderrrmulder/* XPM */ static char * logo_xpm[] = { "32 32 514 2", " c None", ". c #0B6DCF", "+ c #529DE2", "@ c #60A8E6", "# c #5EA6E5", "$ c #5BA5E5", "% c #59A3E4", "& c #56A2E3", "* c #53A0E2", "= c #519EE2", "- c #4E9CE1", "; c #4C9BE0", "> c #4596DE", ", c #1474D1", "' c #4091DD", ") c #BAE3FD", "! c #B7E1FB", "~ c #B2DEFA", "{ c #ADDBF9", "] c #A8D8F8", "^ c #A4D5F7", "/ c #A0D2F5", "( c #9BD0F4", "_ c #97CDF3", ": c #93CAF2", "< c #8EC8F0", "[ c #58A3E3", "} c #4B98DF", "| c #BEE4FC", "1 c #D5EDFC", "2 c #C0E3FA", "3 c #B1DCF9", "4 c #ADD9F7", "5 c #A9D7F6", "6 c #A5D4F5", "7 c #A1D2F4", "8 c #9ED0F3", "9 c #9ACDF2", "0 c #96CBF1", "a c #64AAE5", "b c #4D98DF", "c c #C4E5FB", "d c #E0F1FC", "e c #C5E5FA", "f c #B7DDF8", "g c #B3DBF7", "h c #B0D9F6", "i c #ACD7F5", "j c #A8D5F4", "k c #A5D3F3", "l c #A2D1F2", "m c #9ECFF1", "n c #69ADE5", "o c #4F99DF", "p c #C8E7FB", "q c #E2F2FC", "r c #CAE6FA", "s c #BDE0F8", "t c #BADEF7", "u c #B7DCF7", "v c #B4DAF6", "w c #B0D8F5", "x c #ADD6F3", "y c #ACD2E7", "z c #A9D0E5", "A c #74AEDA", "B c #4594DE", "C c #A6D7F8", "D c #CDE8FA", "E c #AAD7F6", "F c #A6D5F5", "G c #B9DDF7", "H c #BEE0F7", "I c #BCDEF6", "J c #BCD0C8", "K c #CDAC2A", "L c #D9B610", "M c #D9B510", "N c #D7B410", "O c #D7B20B", "P c #DAB309", "Q c #DAB209", "R c #DAB109", "S c #DAB009", "T c #DAB008", "U c #D2A304", "V c #3B8FDD", "W c #98D0F6", "X c #CAE6F9", "Y c #9DD0F4", "Z c #84C4F1", "` c #7FC1F0", " . c #A8D4F3", ".. c #C7B250", "+. c #F7EE23", "@. c #FFFB26", "#. c #FFF926", "$. c #FFF726", "%. c #FFF526", "&. c #FFF326", "*. c #FFF126", "=. c #FFEF26", "-. c #FFED26", ";. c #FFEB26", ">. c #FFE926", ",. c #F9DF23", "'. c #CF9E03", "). c #9C0403", "!. c #A20B07", "~. c #A20A06", "{. c #861A28", "]. c #398EDC", "^. c #94CDF4", "/. c #C8E5F9", "(. c #99CEF3", "_. c #79BEEE", ":. c #74BBED", "<. c #6FB8EA", "[. c #B8A63D", "}. c #FDF739", "|. c #FFFB5D", "1. c #FFF95D", "2. c #FFF63C", "3. c #FFF43C", "4. c #FFF33C", "5. c #FFF13C", "6. c #FFEF3C", "7. c #FFED3C", "8. c #FFEC3C", "9. c #FFEA3C", "0. c #FFE739", "a. c #D1A005", "b. c #9B0302", "c. c #DB573D", "d. c #FB8059", "e. c #FC7E56", "f. c #FC7B53", "g. c #FC7950", "h. c #FC764E", "i. c #D9725C", "j. c #378DDB", "k. c #8FCAF3", "l. c #C5E3F8", "m. c #94CCF2", "n. c #6FB8EB", "o. c #6AB4E9", "p. c #B6A63E", "q. c #FDF64E", "r. c #FFFBA0", "s. c #FFF983", "t. c #FFF654", "u. c #FFF452", "v. c #FFF352", "w. c #FFF152", "x. c #FFEF52", "y. c #FFEE52", "z. c #FFEC52", "A. c #FFEB52", "B. c #FFE84E", "C. c #D1A006", "D. c #A00A07", "E. c #F58260", "F. c #FF9673", "G. c #FF9878", "H. c #FF8A64", "I. c #FF8762", "J. c #FF855F", "K. c #DB7E6C", "L. c #358CDB", "M. c #89C7F2", "N. c #C2E2F7", "O. c #90C9F1", "P. c #6AB5EA", "Q. c #65B1E7", "R. c #B5A53F", "S. c #FDF663", "T. c #FFFBAE", "U. c #FFF893", "V. c #FFF569", "W. c #FFF468", "X. c #FFF368", "Y. c #FFF168", "Z. c #FFF068", "`. c #FFEF68", " + c #FFED68", ".+ c #FFEC68", "++ c #FFE963", "@+ c #D1A108", "#+ c #F68B6C", "$+ c #FFBFAA", "%+ c #FFB8A1", "&+ c #FF9574", "*+ c #FF9270", "=+ c #FF8F6D", "-+ c #DB8779", ";+ c #338ADA", ">+ c #A0D1F3", ",+ c #83C2EE", "'+ c #64B2E9", ")+ c #60AEE6", "!+ c #B4A43D", "~+ c #FDF22F", "{+ c #FFF882", "]+ c #FFF45B", "^+ c #FFF13D", "/+ c #FFF365", "(+ c #FFF37D", "_+ c #FFF27E", ":+ c #FFF17E", "<+ c #FFF07E", "[+ c #FFEF7E", "}+ c #FFED7D", "|+ c #FFE44A", "1+ c #D1A003", "2+ c #A10B08", "3+ c #F69478", "4+ c #FFC9B8", "5+ c #FFBFAB", "6+ c #FFA083", "7+ c #FF9D7F", "8+ c #FF9B7D", "9+ c #E39383", "0+ c #2A84D8", "a+ c #69B5EA", "b+ c #64B2E8", "c+ c #5FAEE7", "d+ c #5AABE4", "e+ c #B2A238", "f+ c #FCED00", "g+ c #FFF777", "h+ c #FFF249", "i+ c #FFEB02", "j+ c #FFE904", "k+ c #FFE921", "l+ c #FFED5A", "m+ c #FFF080", "n+ c #FFF08A", "o+ c #FFED77", "p+ c #FFE234", "q+ c #FFD902", "r+ c #D19F00", "s+ c #F79073", "t+ c #FFBDA8", "u+ c #FFB19A", "v+ c #FFA98F", "w+ c #FFA78D", "x+ c #FCA48C", "y+ c #537DB9", "z+ c #348CDB", "A+ c #3C92DD", "B+ c #3991DC", "C+ c #378FDC", "D+ c #348DDB", "E+ c #318CDA", "F+ c #2F8AD8", "G+ c #A89A35", "H+ c #FCEB00", "I+ c #FFF577", "J+ c #FFF049", "K+ c #FFE902", "L+ c #FFE700", "M+ c #FFE400", "N+ c #FFE200", "O+ c #FFE006", "P+ c #FFDE09", "Q+ c #FFDC04", "R+ c #FFD900", "S+ c #FFD600", "T+ c #A00704", "U+ c #F55F35", "V+ c #FFA58A", "W+ c #FF9575", "X+ c #FF6334", "Y+ c #FF7146", "Z+ c #FF9172", "`+ c #FFAF99", " @ c #F9AE9B", ".@ c #C59FA5", "+@ c #B597A4", "@@ c #B56869", "#@ c #B54F49", "$@ c #722843", "%@ c #BE9B12", "&@ c #FCE900", "*@ c #FFF477", "=@ c #FFEF49", "-@ c #FFE702", ";@ c #FFE000", ">@ c #FFDE00", ",@ c #FFDB00", "'@ c #FFD700", ")@ c #FFD400", "!@ c #F55B31", "~@ c #FFA387", "{@ c #FF9373", "]@ c #FF5E2F", "^@ c #FF5828", "/@ c #FF5525", "(@ c #FF5A2C", "_@ c #FF7048", ":@ c #FF724B", "<@ c #FF5628", "[@ c #FF4513", "}@ c #FF4210", "|@ c #A80902", "1@ c #D0A000", "2@ c #FCE700", "3@ c #FFF377", "4@ c #FFED49", "5@ c #FFE502", "6@ c #FFD200", "7@ c #D19E00", "8@ c #A00703", "9@ c #F5592D", "0@ c #FFA185", "a@ c #FF9170", "b@ c #FF5B2B", "c@ c #FF5221", "d@ c #FF4F1E", "e@ c #FF4C1B", "f@ c #FF4817", "g@ c #FF3E0C", "h@ c #A80901", "i@ c #FCE500", "j@ c #FFEF59", "k@ c #FFEB44", "l@ c #FFE201", "m@ c #FFCF00", "n@ c #A00603", "o@ c #F5562B", "p@ c #FFA084", "q@ c #FF8F6E", "r@ c #FF5728", "s@ c #FF3B09", "t@ c #A80801", "u@ c #D09F00", "v@ c #FBE200", "w@ c #FFE503", "x@ c #FFE307", "y@ c #FFD500", "z@ c #FFD000", "A@ c #FECD00", "B@ c #F55328", "C@ c #FF9677", "D@ c #FF8C6B", "E@ c #FF5424", "F@ c #FF3F0C", "G@ c #FF3806", "H@ c #A80800", "I@ c #CD9A00", "J@ c #E6BF00", "K@ c #F5D500", "L@ c #F6D300", "M@ c #F6D100", "N@ c #F6CF00", "O@ c #F6CE00", "P@ c #F6CC00", "Q@ c #F6CA00", "R@ c #F6C800", "S@ c #F6C600", "T@ c #F5C400", "U@ c #E8B500", "V@ c #F55024", "W@ c #FF5E30", "X@ c #FF6237", "Y@ c #FF4917", "Z@ c #FF3F0D", "`@ c #FF3502", " # c #A80700", ".# c #CC9900", "+# c #9B0201", "@# c #DA3717", "## c #FB4F20", "$# c #FC4C1D", "%# c #FC491A", "&# c #FC4617", "*# c #FC4313", "=# c #FC4010", "-# c #FC3D0C", ";# c #FC3909", "># c #FC3606", ",# c #FC3302", "'# c #E92800", ")# c #9F0300", "!# c #9C0301", "~# c #A20703", "{# c #A20702", "]# c #A20602", "^# c #A20601", "/# c #A20501", "(# c #A20500", "_# c #9E0200", ":# c #2C63B6", "<# c #619DD9", "[# c #649FDA", "}# c #67A1DB", "|# c #538ACD", "1# c #01359A", "2# c #487DC5", "3# c #73A8DE", "4# c #75A9DE", "5# c #70A3DA", "6# c #3C6EBC", "7# c #03379C", "8# c #02369B", "9# c #04389C", "0# c #003399", "a# c #3C75C1", "b# c #6AA7DF", "c# c #093D9F", "d# c #083C9E", "e# c #073A9D", "f# c #6499D6", "g# c #6196D4", "h# c #02359A", "i# c #487BC3", "j# c #A1D1F6", "k# c #1547A5", "l# c #3181CD", "m# c #1351AD", "n# c #2E75C4", "o# c #3279C6", "p# c #1B56AF", "q# c #4389D0", "r# c #01349A", "s# c #3978C4", "t# c #3A79C5", "u# c #4684CB", "v# c #3671BF", "w# c #68A5DE", "x# c #0A3EA0", "y# c #0C40A1", "z# c #5E93D2", "A# c #3D70BD", "B# c #78AADE", "C# c #2670C1", "D# c #2267BC", "E# c #03379B", "F# c #357FCB", "G# c #3F8AD1", "H# c #2E6FC0", "I# c #3172C1", "J# c #0C42A2", "K# c #599EDB", "L# c #4281C9", "M# c #589AD8", "N# c #05399D", "O# c #82C1EF", "P# c #659FDA", "Q# c #669FDA", "R# c #386EBC", "S# c #8FC5EF", "T# c #6598D5", "U# c #8DC0EB", "V# c #4C7EC5", "W# c #0A3D9F", "X# c #1555B0", "Y# c #317FCB", "Z# c #104BA8", "`# c #1F60B7", " $ c #2A6CBE", ".$ c #114BA8", "+$ c #4188CF", "@$ c #1953AE", "#$ c #2F6BBC", "$$ c #71B9EC", "%$ c #265FB4", "&$ c #65A2DC", "*$ c #013499", "=$ c #5D91D1", "-$ c #0C3FA0", ";$ c #90C0EC", ">$ c #4C7DC4", ",$ c #0840A1", "'$ c #3A8CD4", ")$ c #307AC7", "!$ c #0F49A7", "~$ c #1550AC", "{$ c #377FCA", "]$ c #4B96D8", "^$ c #0D43A3", "/$ c #579CDA", "($ c #3F7DC7", "_$ c #5DA0DC", ":$ c #083C9F", "<$ c #63A0DB", "[$ c #1043A2", "}$ c #92C2ED", "|$ c #5283C7", "1$ c #2D78C7", "2$ c #3887D0", "3$ c #04399D", "4$ c #4996D9", "5$ c #3478C5", "6$ c #3979C4", "7$ c #3573C1", "8$ c #3974C1", "9$ c #366EBD", "0$ c #5894D3", "a$ c #598ECF", "b$ c #84BAE8", "c$ c #6FA2DB", "d$ c #80B2E3", "e$ c #6698D4", "f$ c #1143A3", "g$ c #03389C", "h$ c #043A9D", "i$ c #063B9E", "j$ c #073C9E", "k$ c #05389C", "l$ c #083B9E", "m$ c #0C40A0", "n$ c #0D40A0", "o$ c #0B3E9F", " ", " ", " . + @ # $ % & * = - ; > , ", " ' ) ! ~ { ] ^ / ( _ : < [ ", " } | 1 2 3 4 5 6 7 8 9 0 a ", " b c d e f g h i j k l m n ", " o p q r s t u v w x y z A ", " B C D E F G H I J K L M N O P Q R R S T U ", " V W X Y Z ` < ...+.@.#.$.%.&.*.=.-.;.>.,.'. ", " ).!.!.!.!.~.{.].^./.(.` _.:.<.[.}.|.1.2.3.4.5.6.7.8.9.0.a. ", " b.c.d.e.f.g.h.i.j.k.l.m._.:.n.o.p.q.r.s.t.u.v.w.x.y.z.A.B.C. ", " D.E.F.G.H.I.J.K.L.M.N.O.:.n.P.Q.R.S.T.U.V.W.X.Y.Z.`. +.+++@+ ", " D.#+$+%+&+*+=+-+;+` >+,+n.P.'+)+!+~+{+]+^+/+(+_+:+<+[+}+|+1+ ", " 2+3+4+5+6+7+8+9+0+_.:.n.a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p+q+r+ ", " 2+s+t+u+6+v+w+x+y+z+A+B+C+D+E+F+G+H+I+J+K+L+M+N+O+P+Q+R+S+r+ ", " T+U+V+W+X+Y+Z+`+ @.@+@@@#@$@ %@&@*@=@-@M+N+;@>@,@R+'@)@r+ ", " T+!@~@{@]@^@/@(@_@:@<@[@}@|@ 1@2@3@4@5@N+;@>@,@R+'@)@6@7@ ", " 8@9@0@a@b@/@c@d@e@f@[@}@g@h@ 1@i@j@k@l@;@>@,@R+'@)@6@m@7@ ", " n@o@p@q@r@c@d@e@f@[@}@g@s@t@ u@v@w@x@;@>@,@R+'@y@6@z@A@7@ ", " n@B@C@D@E@d@e@f@[@}@F@s@G@H@ I@J@K@L@M@N@O@P@Q@R@S@T@U@I@ ", " n@V@W@X@d@e@Y@[@}@Z@s@G@`@ # .#.#.#.#.#.#.#.#.#.# ", " +#@###$#%#&#*#=#-#;#>#,#'#)# ", " !#~#~#{#]#]#^#^#/#(#(#_# ", " :#<#[#}#|#1#2#3#4#5#6# ", " 7# 8#8# 9#0#9# 9# a#b#c#d#e# f#g#h#i#j#k# ", " 7#l#m# n#o# p#q#r#s#t#h#u#v# a#w#x#y#e# f#z#e#A#B# ", " C#D#E#F#G#1#H#I# J#K#L#M#N# a#O#P#Q#R# f#S#T#U#V#W# ", " X#Y#Z#`# $.$+$@$ #$$$%$ a#&$*$ f#=$0#-$;$>$ ", " ,$'$)$!$~${$]$N# ^$/$($_$:$ a#<$ f#=$0#[$}$|$ ", " 1$2$3$8#4$5$ 6$7$1#u#8$ 9$0$ a$b$c$d$e$f$ ", " g$h$ i$9# j$ d# k$l$ l$m$n$o$ ", " "}; wxformbuilder-3.1.59/output/resources/icons/wxwin16x16.xpm0000644000175000017500000000550711143440026024053 0ustar rrmulderrrmulder/* XPM */ static const unsigned char * wxwin16x16_xpm[] = { "16 16 140 2", " c None", "! c black", "# c #3489D9", "$ c #65AAE7", "% c #60A7E5", "& c #5CA4E4", "' c #57A1E3", "( c #529FE2", ") c #4798DE", "* c #66A9E5", "+ c #C8E7FC", ", c #B4DDF9", "- c #AAD8F7", ". c #A3D3F5", "0 c #9CCFF3", "1 c #93C9F0", "2 c #1C7AD2", "3 c #6AABE6", "4 c #D7EDFB", "5 c #BEE1F8", "6 c #B6DCF7", "7 c #B0D9F5", "8 c #ABD2E9", "9 c #A5CCDF", ": c #377EB6", "; c #54A0E2", "< c #BBDFF8", "= c #96CDF3", "> c #A1D1F4", "? c #B9CFCA", "@ c #E6D01F", "A c #EED918", "B c #EED718", "C c #EED418", "D c #EED218", "E c #EED018", "F c #E0B80F", "G c #B5251A", "H c #CF452F", "I c #CE412B", "J c #CE3F29", "K c #5A92CE", "L c #B4DBF7", "M c #83C3F0", "N c #74BBED", "O c #8BAD9E", "P c #FBF44E", "Q c #FFF868", "R c #FFF445", "S c #FFF145", "T c #FFEE45", "U c #FFEB45", "V c #EDCC2A", "W c #D4563F", "X c #FFA385", "Y c #FF8B67", "Z c #FF8661", "[ c #5D96D1", "] c #A9D6F4", "^ c #79BDED", "_ c #6BB5EA", "` c #85A99C", "a c #FBF26B", "b c #FFF781", "c c #FFF46A", "d c #FFF26D", "e c #FFEF6D", "f c #FFED6D", "g c #EDCD3E", "h c #D55F4D", "i c #FFC6B4", "j c #FFA082", "k c #FF9B7D", "l c #5A92CD", "m c #73BAEC", "n c #68B4E9", "o c #5FAEE7", "p c #7DA39A", "q c #FBEC27", "r c #FFF143", "s c #FFEA10", "t c #FFEB44", "u c #FFEC68", "v c #FFE64B", "w c #EDC307", "x c #D4432B", "y c #FFA589", "z c #FF764D", "{ c #FF9273", "| c #D0A0A0", "} c #9587A2", "~ c #92596A", " ! c #3C4A8B", "!! c #708563", "#! c #FBE926", "$! c #FFEE43", "%! c #FFE500", "&! c #FFE100", "'! c #FFDC00", "(! c #FFD800", ")! c #EDC000", "*! c #D43A1E", "+! c #FF9E82", ",! c #FF5A2A", "-! c #FF5222", ".! c #FF4E1D", "0! c #FF4715", "1! c #FB3E0E", "2! c #9E0200", "3! c #CA9900", "4! c #FBE51B", "5! c #FFEA3C", "6! c #FFD400", "7! c #EDBD00", "8! c #D4371B", "9! c #FF987B", ":! c #FF5424", ";! c #FF4C1B", "! c #F0CF00", "?! c #FADA01", "@! c #FAD600", "A! c #FAD200", "B! c #FACE00", "C! c #FACB00", "D! c #E5B400", "E! c #D12F14", "F! c #FE592B", "G! c #FF4615", "H! c #FF3A08", "I! c #F63002", "J! c #9B0000", "K! c #AF1105", "L! c #AF0F05", "M! c #AF0F03", "N! c #AF0D01", "O! c #AF0B01", "P! c #A70600", "Q! c #90B5FF", " # $ % & ' ( ) ", " * + , - . 0 1 2 ", " 3 4 5 6 7 8 9 : ", " ; < = > ? @ A B C D E F ", "G H I J K L M N O P Q R S T U V ", "W X Y Z [ ] ^ _ ` a b c d e f g ", "h i j k l m n o p q r s t u v w ", "x y z { | } ~ !!!#!$!%!&!'!(!)!", "*!+!,!-!.!0!1!2!3!4!5!&!'!(!6!7!", "8!9!:!;!0!!?!@!A!B!C!D!", "E!F!;!G!lqn} A@wȝaۢ 4[IZ\n#`PP8oz7'(8S #=츹  D ٯ=i̳xqFF)+a ^f/uS%de_Ƚzd. ,lq)QD!KTع*:@M< c #4798DE", "? c #E7E7E7", "@ c #E9E9E9", "A c #66A9E5", "B c #C8E7FC", "C c #B4DDF9", "D c #AAD8F7", "E c #A3D3F5", "F c #9CCFF3", "G c #93C9F0", "H c #1C7AD2", "I c #C9CAC9", "J c #6AABE6", "K c #D7EDFB", "L c #BEE1F8", "M c #B6DCF7", "N c #B0D9F5", "O c #ABD2E9", "P c #A5CCDF", "Q c #377EB6", "R c #E8E8E8", "S c #EAEAEA", "T c #54A0E2", "U c #BBDFF8", "V c #96CDF3", "W c #A1D1F4", "X c #B9CFCA", "Y c #E6D01F", "Z c #EED918", "[ c #EED718", "] c #EED418", "^ c #EED218", "_ c #EED018", "` c #E0B80F", "a c #B5251A", "b c #CF452F", "c c #CE412B", "d c #CE3F29", "e c #5A92CE", "f c #B4DBF7", "g c #83C3F0", "h c #74BBED", "i c #8BAD9E", "j c #FBF44E", "k c #FFF868", "l c #FFF445", "m c #FFF145", "n c #FFEE45", "o c #FFEB45", "p c #EDCC2A", "q c #D4563F", "r c #FFA385", "s c #FF8B67", "t c #FF8661", "u c #5D96D1", "v c #A9D6F4", "w c #79BDED", "x c #6BB5EA", "y c #85A99C", "z c #FBF26B", "{ c #FFF781", "| c #FFF46A", "} c #FFF26D", "~ c #FFEF6D", " ! c #FFED6D", "!! c #EDCD3E", "#! c #EBEBEB", "$! c #D55F4D", "%! c #FFC6B4", "&! c #FFA082", "'! c #FF9B7D", "(! c #5A92CD", ")! c #73BAEC", "*! c #68B4E9", "+! c #5FAEE7", ",! c #7DA39A", "-! c #FBEC27", ".! c #FFF143", "0! c #FFEA10", "1! c #FFEB44", "2! c #FFEC68", "3! c #FFE64B", "4! c #EDC307", "5! c #D4432B", "6! c #FFA589", "7! c #FF764D", "8! c #FF9273", "9! c #D0A0A0", ":! c #9587A2", ";! c #92596A", "! c #FBE926", "?! c #FFEE43", "@! c #FFE500", "A! c #FFE100", "B! c #FFDC00", "C! c #FFD800", "D! c #EDC000", "E! c #CDCECC", "F! c #EFEFEF", "G! c #D43A1E", "H! c #FF9E82", "I! c #FF5A2A", "J! c #FF5222", "K! c #FF4E1D", "L! c #FF4715", "M! c #FB3E0E", "N! c #9E0200", "O! c #CA9900", "P! c #FBE51B", "Q! c #FFEA3C", "R! c #FFD400", "S! c #EDBD00", "T! c #D4371B", "U! c #FF987B", "V! c #FF5424", "W! c #FF4C1B", "X! c #FF400E", "Y! c #FB3808", "Z! c #FCFCFC", "[! c #F0CF00", "]! c #FADA01", "^! c #FAD600", "_! c #FAD200", "`! c #FACE00", "a! c #FACB00", "b! c #E5B400", "c! c #EDEDED", "d! c #D12F14", "e! c #FE592B", "f! c #FF4615", "g! c #FF3A08", "h! c #F63002", "i! c #9B0000", "j! c #868882", "k! c #AF1105", "l! c #AF0F05", "m! c #AF0F03", "n! c #AF0D01", "o! c #AF0B01", "p! c #A70600", "q! c #90B5FF", "! # # # # # # # # # # # # # # # # $ ", "# & & & & & & & & & & & & & & & & # ", "# & ' ' ' ' ' ' ' ' ' ' ' ' ' & & # ", "# & ( ) * + , - - ) ) ) ) ) ) ) & # ", "# & ' ' ' ' ' ' . ' ' ' 0 1 2 3 & # ", "# & * + - 4 5 ) ) ) ) 6 0 1 2 3 & # ", "# & ' ' ' ' ' ' 7 ' 8 9 : ; < = > # ", "# & , 4 5 ? ? @ @ ) A B C D E F G H ", "# & ' ' ' ' ' ' I ' J K L M N O P Q ", "# & 4 5 R @ S ) ) ) T U V W X Y Z [ ] ^ _ ` ", "# & 5 ? @ ? a b c d e f g h i j k l m n o p ", "# & ' ' ' ' q r s t u v w x y z { | } ~ !!!", "# & ? R S #!$!%!&!'!(!)!*!+!,!-!.!0!1!2!3!4!", "# & ? @ @ #!5!6!7!8!9!:!;!!?!@!A!B!C!D!", "# & ' ' E!F!G!H!I!J!K!L!M!N!O!P!Q!A!B!C!R!S!", "# & R @ #!& T!U!V!W!L!X!Y!N!Z![!]!^!_!`!a!b!", "# & R @ S c!d!e!W!f!X!g!h!i!3 Z!& # ", "j!# # # # # # k!l!m!n!o!p!# # # # j! ", " ", " % q! % q!% q!% q!% % q!% % q!", " % q!% q!% q! % q! % q! % q!% ", " % q!% q! % q!% q!% q! % % q!"};wxformbuilder-3.1.59/output/resources/icons/balign.png0000644000175000017500000000065611143440026023405 0ustar rrmulderrrmulderPNG  IHDRrP6 pHYs  gAMA|Q cHRMz%u0`:o_F$IDATxb?@11PU  b^/vsl@$G @$'neg">>#0/8  D> 5@1΂?@ ԛ(hP;L0͠/o  a~=G5FӀe@bؿ_"cן# bI6lg~JWq} YjkL DUoU]`fmIENDB`wxformbuilder-3.1.59/output/resources/icons/chalign.png0000644000175000017500000000067611143440026023560 0ustar rrmulderrrmulderPNG  IHDRrP6 pHYs  gAMA|Q cHRMz%u0`:o_F4IDATxb?>Vy,F vf)uX] @,5_``4Т n?'А@rp ܆9n}#~a;z  Fj3B1L&R\d>͋ h_  A b@Xl#`  4|ۥD@T5 j@Q0BV? MW1 Qhl_hlBχ_1  &Z7 (zt͈?IENDB`wxformbuilder-3.1.59/output/resources/icons/lalign.png0000644000175000017500000000070711143440026023414 0ustar rrmulderrrmulderPNG  IHDRrP6 pHYs  gAMA|Q cHRMz%u0`:o_F=IDATxb? 9wbd  .Y ivvRbx ߀?xgAzbo' d`hЄ34j"`g_Q oؿ_"cc0Y _0]#vװ X b@8 ɽXCL[ @xy[0EHB5WO`<`|T @L TDUU  @8ccUp4/$_za' -nIENDB`wxformbuilder-3.1.59/output/resources/icons/cvalign.png0000644000175000017500000000072111143440026023565 0ustar rrmulderrrmulderPNG  IHDRrP6 pHYs  gAMA|Q cHRMz%u0`:o_FGIDATxb?@11PU  b^O2f/vc96]n,E1>>?B XP5_ß@@K P4~j 4o~bOA/U})  }A3/avh*9Đ/@F#P暴`f;FvP7L` X6H.#DH (i`u_< @(.ۙF>_MbA~J@hb} FjDՌ@T5 j@Q0t3t\IENDB`wxformbuilder-3.1.59/output/resources/icons/talign.png0000644000175000017500000000067411143440026023427 0ustar rrmulderrrmulderPNG  IHDRrP6 pHYs  gAMA|Q cHRMz%u0`:o_F2IDATxb?@11PU  _4 2bf,EO({:V? QH~o@P?0Yp[aMWĞ ^b&fPka԰ cia bؿ_"c#a 94 ~Dw솁l- avb^- FFf6(\D@Dy2PS͇_y MWwO-RIENDB`wxformbuilder-3.1.59/output/resources/icons/bottom.xpm0000644000175000017500000000127111143440026023467 0ustar rrmulderrrmulder/* XPM */ static const unsigned char * bottom_xpm[] = { "22 22 4 1", " c None", "! c black", "# c #0066CC", "$ c #4C4465", " ", " ## ## ## ## ## ## ## ", " ## ## ## ## ## ## ## ", " ", " ## ## ", " ## ## ", " ", " ## ## ", " ## ## ", " ", " ## ## ", " ## ## ", " ", " ## ## ", " ## ## ", " ", " ## ## ", " ## ## ", " ", " $$$$$$$$$$$$$$$$$$$$ ", " $$$$$$$$$$$$$$$$$$$$ ", " "};wxformbuilder-3.1.59/output/resources/icons/top.xpm0000644000175000017500000000126611143440026022771 0ustar rrmulderrrmulder/* XPM */ static const unsigned char * top_xpm[] = { "22 22 4 1", " c None", "! c black", "# c #4C4465", "$ c #0066CC", " ", " #################### ", " #################### ", " ", " $$ $$ ", " $$ $$ ", " ", " $$ $$ ", " $$ $$ ", " ", " $$ $$ ", " $$ $$ ", " ", " $$ $$ ", " $$ $$ ", " ", " $$ $$ ", " $$ $$ ", " ", " $$ $$ $$ $$ $$ $$ $$ ", " $$ $$ $$ $$ $$ $$ $$ ", " "};wxformbuilder-3.1.59/output/resources/icons/paste.png0000644000175000017500000000140511143440026023256 0ustar rrmulderrrmulderPNG  IHDRĴl; pHYs  tIME 6?IDAT8˥MHTQsΔ48$B ( s&,rDZd&m"j6" ]( ҅BA f̘νsq<댃yr=Tx?g'''/' '~?,d 3THUJMT"68KG(s)[ۣ5ƒVW#S'74vŇzVglR+WsC[[{NCZtzL$`}CTuYE5=sȃgq8ujvN|`D ǟTRYںZgiD=(r/J`%]FR`]BrObJIp!P?T@IW"<XW*@wH))2kv-݊B@kkm8JeFbe7s #zT^4gEFaD1Mˊ|-p8]4 ֙x=lN;$-C- #Zu;++n{#*5n|-Yފ7$Fi<tOvKT@{B^DE@lɪnS`pj@*А@6̌`pJ^a9&PkIENDB`wxformbuilder-3.1.59/output/resources/icons/expand.png0000644000175000017500000000057411143440026023427 0ustar rrmulderrrmulderPNG  IHDRĴl;gAMA7tEXtSoftwarePaint.NET v3.08erIDATHKcd[?ӟ L20Bic #, XCic·\?o Dd, =ϰ;цՂ΀R{EjojZt`G6T f88LTfd9pA7d">b ?`qYqR0H3p#I2f0f\D[2j0<yMn 44+hVlҬYL)1[}2+4bŘIENDB`wxformbuilder-3.1.59/output/resources/icons/xrc.png0000644000175000017500000000113311143440026022734 0ustar rrmulderrrmulderPNG  IHDRagAMA7tEXtSoftwareAdobe ImageReadyqe<IDAT8ˍ=OP)C0[!k_@ @ &~@[%C *UAVJ;dB ,@l_رo}nqHP=<>.]D\cn?/ 8FNq$ɷAIP0Hɦi²,0iDQdAJ|mTU&2t]$ILPT@IMIP[5AJ(Je%6O(~0[dāa(*yUtOлM̾_ ^I P%4UUoVNcc_E{v_B|NuXתA"*kfB"_0-K?6љc.oal7.`Z:g|)bbܬ*āG å2Da.a2A$tCʘ?IENDB`wxformbuilder-3.1.59/output/resources/icons/c++.png0000644000175000017500000000153511143440026022516 0ustar rrmulderrrmulderPNG  IHDRagAMA7tEXtSoftwareAdobe ImageReadyqe<IDATMhmޜsoRH$(Cݼ(X`W/ Y:"=ĺZ %m[ɶ{~,Kp@X;-BZu,#*V-~,{ȶc_6Nj'MRֻ ?yb"˚={8 魄0T84ZT>OC` b,I6+ZR%QKl=E&9!$ᣗ wk3)!QIf~UvT{{wiɛ34 eYzO8 ]8nT}l6ahvvqEQcȺɮz* ($t,//P8p@V׿:sL;< qH{4M߿{GFFF߿˗sׇp{,fs*VKEͦa*}e`}}ܜiq$owgn64/A#TPn+++ܹ%.y~j| %׾€Gth4^V{?tfaͻ W {5\z5Eeӭ[YݼqF:ye;;jORVݳ_8y) Rn}IENDB`wxformbuilder-3.1.59/output/resources/icons/save.png0000644000175000017500000000142311143440026023100 0ustar rrmulderrrmulderPNG  IHDRĴl;sBIT|dtEXtSoftwarewww.inkscape.org<IDAT8kTWg F.,DRpcە躡֕.FPpQ RUJh7̦B @&{3V|k9xs_1p̮~%+.g@A 5~uסν[`3~cOn|ɩ|x [I9W(RK{i`w15kqqq4;>]Dži}0mHN2P%!;? jܽ8TɕT-nEJ S63WjN] efgg)˒((r4.#~5zsiR{*7)ՑB Cbf)qE+pM(˲`@#!bM1 WnM47ۦg$@&WcM(zز {1n/GOj !OBGHᣱA ^fdHD—y1齂Ù0OrwG.ID!;T0x-a#%%0` +䞒yd$YK {I*xm.IENDB`wxformbuilder-3.1.59/output/resources/icons/cpp.png0000644000175000017500000000115511143440026022726 0ustar rrmulderrrmulderPNG  IHDRagAMA7tEXtSoftwareAdobe ImageReadyqe<IDAT8ˍkQū]w%R.ZV (HWJەJQqFnHSBmPA7 EII$wdFځüown0vAq\ j6[V !$$ Zbٶ 4*Ȳ QcHt}a$uaY4MzH6 !C2s*2s fjq8]wX59q}=5QP  RqZ^}GV T*6(峋]z?.h}۩QVۀY7YCƓ ʴ3\7xMR x!copBpcrWIvpTJ3@ɼsX^sxC"K1ѫ+8s|)0S7q^˫6Yu6^;Xlv:lWW{sE[10+G{ fg]> @/A0Αh{=ҧIENDB`wxformbuilder-3.1.59/install/linux/data/wxformbuilder.10000644000175000017500000000225411143440026023443 0ustar rrmulderrrmulder.\" wxFormbuilder man page. .\" Contact rjmyst3@gmail.com to correct errors or omissions. .TH "WXFORMBUILDER" "1" "28 August 2007" "Ryan Mulder" "" .SH "NAME" wxformbuilder \- WYSIWYG GUI Designer and Code Generator for wxWidgets .SH "SYNOPSIS" .\" Syntax goes here. .B wxformbuilder [\-g][\-l ][\-h] .I [filename(s)...] .SH "DESCRIPTION" .B wxformbuilder is a GUI designer for programs which use wxWidgets. It is a very WYSIWYG designer, because it uses the actual controls to show the result, not some fake representation. Features include generation of C++ or XRC code, custom plugin support, and import of XRC code. .SH "OPTIONS" .TP 8 .B "\-h, \-\-help" Displays the list of accepted command\-line arguments. .TP 8 .B "\-g, \-\-generate" Generate code from the passed file. .TP 8 .B "\-l, \-\-language" Override the code_generation property from the passed file and generate the passed languages. Separate multiple languages with commas. .SH "EXAMPLES" Generate XRC code from myproject.fbp .nf wxformbuilder \-\-generate \-\-language XRC myproject.fbp .SH "AUTHORS" .nf Jose Antonio Hurtado Juan Antonio Ortega Ryan Mulder Ryan Pusztai .fi .SH "HISTORY" 2007 \- Initial version wxformbuilder-3.1.59/install/linux/debian/changelog0000644000175000017500000000204711143440026022653 0ustar rrmulderrrmulderwxformbuilder (3.1.59-0ubuntu1) jaunty; urgency=low * Sync to upstream 3.1.59. (LP: #326747) -- Ryan Mulder Sat, 07 Feb 2009 20:51:58 -0500 wxformbuilder (3.0.57-0ubuntu2) jaunty; urgency=low * FTBFS on 9.04 armel. (LP: #310286) -- Ryan Mulder Sun, 21 Dec 2008 14:00:00 -0400 wxformbuilder (3.0.57-0ubuntu1) hardy; urgency=low * Sync to upstream 3.0.57. Bug fixes only. (LP: #218001) -- Ryan Mulder Tue, 15 Apr 2008 20:06:25 -0400 wxformbuilder (3.0.56-0ubuntu1) hardy; urgency=low * Sync to upstream 3.0.56 (RC8). Bug fixes only. (LP: #203781) -- Ryan Mulder Wed, 18 Mar 2008 20:06:25 -0400 wxformbuilder (3.0.55-0ubuntu1) hardy; urgency=low * Fixed build on architectures other than i386 and amd64. (LP: #192818) -- Ryan Mulder Wed, 13 Feb 2008 20:06:25 -0400 wxformbuilder (3.0.54-0ubuntu1) hardy; urgency=low * Initial Release. (LP: #181412) -- Ryan Mulder Mon, 2 Apr 2007 20:06:25 -0400 wxformbuilder-3.1.59/install/linux/debian/control0000644000175000017500000000133611143440026022404 0ustar rrmulderrrmulderSource: wxformbuilder Section: contrib/devel Priority: optional XSBC-Original-Maintainer: Ryan Mulder Maintainer: Ubuntu MOTU Developers Build-Depends: debhelper (>= 5), libwxgtk2.8-dev (>= 2.8.4) Standards-Version: 3.7.3 Homepage: http://www.wxformbuilder.org Package: wxformbuilder Architecture: any Depends: ${shlibs:Depends} Description: WYSIWYG GUI Designer and Code Generator for wxWidgets wxFormBuilder is a GUI designer for programs which use wxWidgets. It is a very WYSIWYG designer, because it uses the actual controls to show the result, not some fake representation. . Features include generation of C++ or XRC code, custom plugin support, and import of XRC code. wxformbuilder-3.1.59/install/linux/debian/rules0000755000175000017500000000277311143440026022067 0ustar rrmulderrrmulder#!/usr/bin/make -f # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 get-orig-source: svn export https://wxformbuilder.svn.sourceforge.net/svnroot/wxformbuilder/3.x/trunk wxformbuilder cd $(CURDIR)/wxformbuilder && install/linux/create_src_tarball rm -rf $(CURDIR)/wxformbuilder configure: configure-stamp configure-stamp: dh_testdir touch configure-stamp build: build-stamp build-stamp: configure-stamp dh_testdir $(MAKE) CONFIG=Release touch $@ clean: dh_testdir dh_testroot rm -f build-stamp configure-stamp $(MAKE) CONFIG=Release clean dh_clean install: build dh_testdir dh_testroot dh_clean -k dh_installdirs $(CURDIR)/install/linux/wxfb_export.sh $(CURDIR)/debian/wxformbuilder/usr # Changelog installed separately rm -f $(CURDIR)/debian/wxformbuilder/usr/share/wxformbuilder/Changelog.txt # Another copy of the GPL is not necessary rm -f $(CURDIR)/debian/wxformbuilder/usr/share/wxformbuilder/license.txt binary-indep: build install binary-arch: build install dh_testdir dh_testroot dh_installchangelogs $(CURDIR)/output/Changelog.txt dh_installdocs $(CURDIR)/README.txt dh_install --sourcedir=$(CURDIR)/install/linux/data/gnome --autodest \* dh_installmenu dh_installmime dh_desktop dh_installman $(CURDIR)/install/linux/data/wxformbuilder.1 dh_link dh_strip dh_compress dh_fixperms dh_installdeb dh_shlibdeps dh_gencontrol dh_md5sums dh_builddeb binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install configure wxformbuilder-3.1.59/install/linux/debian/shlibs.local0000644000175000017500000000013711143440026023277 0ustar rrmulderrrmulderlibwx_gtk2u_flatnotebook 2.8_wxfb libwx_gtk2u_propgrid 2.8_wxfb libwx_gtk2u_scintilla 2.8_wxfb wxformbuilder-3.1.59/install/linux/debian/wxformbuilder.menu0000644000175000017500000000025611143440026024560 0ustar rrmulderrrmulder?package(wxformbuilder):needs="X11" section="Applications/Programming" title="wxFormBuilder" command="wxformbuilder" icon="/usr/share/wxformbuilder/resources/icons/logo.xpm" wxformbuilder-3.1.59/install/linux/debian/wxformbuilder.sharedmimeinfo0000644000175000017500000000074611143440026026612 0ustar rrmulderrrmulder wxFormBuilder Project wxformbuilder-3.1.59/install/linux/debian/copyright0000644000175000017500000002225611143440026022740 0ustar rrmulderrrmulderThis is wxformbuilder, maintained by Ryan Mulder on Mon, 2 Apr 2007 20:06:25 -0400. Authors: José Antonio Hurtado Juan Antonio Ortega Ryan Mulder Ryan Pusztai Copyright (C) 2005 José Antonio Hurtado The original source can always be found at: http://wxformbuilder.sourceforge.net License: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this package; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA On Debian systems, the complete text of the GNU General Public License can be found in `/usr/share/common-licenses/GPL-2'. ------------------------------------------------------------------------------- The source for a subset of boost is included as well and covered by the Boost Software License - Version 1.0 - August 17th, 2003 Permission is hereby granted, free of charge, to any person or organization obtaining a copy of the software and accompanying documentation covered by this license (the "Software") to use, reproduce, display, distribute, execute, and transmit the Software, and to prepare derivative works of the Software, and to permit third-parties to whom the Software is furnished to do so, all subject to the following: The copyright notices in the Software and this entire statement, including the above license grant, this restriction and the following disclaimer, must be included in all copies of the Software, in whole or in part, and all derivative works of the Software, unless such copies or derivative works are solely in the form of machine-executable object code generated by a source language processor. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ------------------------------------------------------------------------------- The source for the RSA Data Security, Inc. MD5 Message-Digest Algorithm is also included, and is covered by the license below: C++/object oriented translation and modification of MD5. Version: 1.00 (28 Aug 95) Version: 1.02 (22 Sep 97) Translation and modification (c) 1995 by Mordechai T. Abzug Thanks to Martin Cleaver for for making it happy on Windows NT and Solaris. This translation/ modification is provided "as is," without express or implied warranty of any kind. The translator/ modifier does not claim (1) that MD5 will do what you think it does; (2) that this translation/ modification is accurate; or (3) that this software is "merchantible." (Language for this disclaimer partially copied from the disclaimer below). Based on: MD5.H - header file for MD5C.C MD5C.C - RSA Data Security, Inc., MD5 message-digest algorithm MDDRIVER.C - test driver for MD2, MD4 and MD5 Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All rights reserved. License to copy and use this software is granted provided that it is identified as the "RSA Data Security, Inc. MD5 Message-Digest Algorithm" in all material mentioning or referencing this software or this function. License is also granted to make and use derivative works provided that such works are identified as "derived from the RSA Data Security, Inc. MD5 Message-Digest Algorithm" in all material mentioning or referencing the derived work. RSA Data Security, Inc. makes no representations concerning either the merchantability of this software or the suitability of this software for any particular purpose. It is provided "as is" without express or implied warranty of any kind. These notices must be retained in any copies of any part of this documentation and/or software. ---------------------------------------------------------------------- The sources for wxFlatNotebook, wxPropertyGrid, and wxScintilla are also included, and are all covered by the wxWindows License: wxWindows Library Licence, Version 3.1 ====================================== Copyright (C) 1998-2005 Julian Smart, Robert Roebling et al Everyone is permitted to copy and distribute verbatim copies of this licence document, but changing it is not allowed. WXWINDOWS LIBRARY LICENCE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public Licence as published by the Free Software Foundation; either version 2 of the Licence, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public Licence for more details. You should have received a copy of the GNU Library General Public Licence along with this software, usually in a file named COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. EXCEPTION NOTICE 1. As a special exception, the copyright holders of this library give permission for additional uses of the text contained in this release of the library as licenced under the wxWindows Library Licence, applying either version 3.1 of the Licence, or (at your option) any later version of the Licence as published by the copyright holders of version 3.1 of the Licence document. 2. The exception is that you may use, copy, link, modify and distribute under your own terms, binary object code versions of works based on the Library. 3. If you copy code from files distributed under the terms of the GNU General Public Licence or the GNU Library General Public Licence into a copy of this library, as this licence permits, the exception does not apply to the code that you add in this way. To avoid misleading anyone as to the status of such modified files, you must delete this exception notice from such code and/or adjust the licensing conditions notice accordingly. 4. If you write modifications of your own for this library, it is your choice whether to permit this exception to apply to your modifications. If you do not wish that, you must delete the exception notice from such code and/or adjust the licensing conditions notice accordingly. ---------------------------------------------------------------------- The source for Scintilla is included as well, and is covered by the License for Scintilla and SciTE Copyright 1998-2003 by Neil Hodgson All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. NEIL HODGSON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NEIL HODGSON BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ---------------------------------------------------------------------- The source for TinyXML and TinyXML++ are also included, and are covered by the following license: TinyXML++ Copyright (c) 2006 Ryan Pusztai, Ryan Mulder www.sourceforge.net/projects/tinyxml Original code (2.0 and earlier )copyright (c) 2000-2006 Lee Thomason (www.grinninglizard.com) This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. wxformbuilder-3.1.59/install/linux/debian/compat0000644000175000017500000000000211143440026022174 0ustar rrmulderrrmulder5 wxformbuilder-3.1.59/install/windows/support/wxFormBuilder.ico0000644000175000017500000005355611143440026025126 0ustar rrmulderrrmulder@@ (B6  ^B hS(@ ?40%0%1$-17%7%7%.: 2#0%0%1$0?8$0%0%1$< H7%0%0%4"71$0%0%7%<&< &:#5?4D32ʘ2ʙ2ə333(32ʘ2ʘ2ʘ2/ ?3g2Ș2ʘ2ʘ2ʙ38. 32ɘ2ʘ2ʙ2ə322ʘ2ʘ2ʙ3ƙ4?4"22ʘ2ʘ2ʘ2ʘ2ʘ2ʙ3ƙ231H?3 2E r)s+e"7412yC p-y4s082`2Q3Q{;x8I363r@ v9ʃFf-54~3ر[$͈MǀFH3x1>2ǀLђ]ђ^ғ_ғ`ҔaϏ]M^,> 33(72Ҽg"GI֐?G2p33]SYYK38 ?2B ԑLi̅C:35t8riW 323w=ŅxV 2z4?2緁՟՟Ǔ뾊Ҡܪԣ٠oQ23287́2ߞFݛEݛFZ30*5u0UTZm,3˗/84Laid)4Mktl26223w=ŅxV 2z4?2緁՟R GHO͌ZӢܬ|F2j2I֐;֐=\Ԏ>q*7ݙ3x:֑EЉ?d%ߢTҍE60:053պh+g`g,ؘVtҏO43gU3w=ŅxV 2z4?2緁՟~223g38ђaܬޯk93. ?3[ݚB~18l&Ј:<2ԥD R_!B ԐFܜPJ2y?3^:˄Cmlqݡ^M333w=ŅxV 2z4?2緁՟~22732rAק߰N30228u)ߝDi#3OܙFF 3e$ژJK6~9Ye&3?2Lepol03*3w=ŅxV 23@3@3@3@4:/4?2緁՟~33c3;3O4ʇV۫ܭh623 2d<ԋ7ޛCT2C ӌ=^3ˀ8Ј>>2k*[|884'.!4ܹf*jpq}?61>3w=Ņ}b+2222222n4?2緁՟麅:323`.ݭ㲂F2p* 3MߜBܘA<26v.̂7QؕGr-43QXڙOB 3h52Rߤ]kؘUgmf,2Λ1.3w=ŅƆ}ߨmnoqޥmS24?2緁՟ӝ踄ߪv{꾋֤‘ǁPA3. 6!2νi!ߜBӊ834D2Ķ`ݜJڗFߠNY31\<U\Q2: 3{9ԓNmьK<i.shD23 3w=ŅƆ~noprަnT24?2緁՟ҜݧsӖb٠mئL52/ 2B6υ3ߜBq'3̗0%2yF ۙHPܜK>3l4:3ҍF_t32͗3c7s5i_I3ڞ;ЍMuҏP? 3q33w=Ņ~j3? ? ? ? ? 63w4?2緁՟踃= :<G嶃ȗm;5ߘ223C ̀0ԋ7T23 5>55דC}52332OՒNۜVg+6ؚ282NחWݡae,42F3w=ŅxV 22K2K2K2K1C/4?2緁՟~23O193ƽq>ݬǗS!236A C 73x/ 2?D >238 4;EC 33:FE82e3(5ܢCG@ 434w=ŅxW 34'4'4'4'4'14?2緁՟~22G/+3½r?ݬ֦tC2231a1a1a2Z8 4,2_1a2_6*51\1a1a2k2i1a1a1a4I$1.2_1a1a1a453w=Ņ}j2;::::834M2緁՟黅? 26O涄ݬҢh733w=ŅƆvۡfۡgܢhܤjܤkȂK;2[2緁՟ћyۤpߪw꽋۩ݬ㰀B3l3ӹg/ݣfޥhޥiަkߧlߨnߩoqˆO;2[2ՙcz{}~~|ܦt~L= 2. """"""""""""""""""""3:A A A A ABBB= 53@2٠@ CCCCA< 53ј2/*q3282828282828282828288$?1$2728282827224'2/3, $$ $ # " ! !   6!O!P OMLKIHFEDBA? > < ;976431-= $S%V#T"R!QONLKIHGEDBA ? > <:97643't&U&W%V$T$T QONLKIHFECBA ? > ;:8764+ )====================<'  )W(Y,[Z~g8d"RONLKIHGEDBA ? > <:976-n` !*X*ZDoPv)X PONLKIHFEDBA ? = ;:87.m^"+Z,\jRx,Z"R QONLKJHGEDBA ? = <:9/'"-[-]mSz-\#S"R QONLKIHFEDB@ > = ;:0?#.\/_nU{/]%U#S"R QONLKIHGEDB@ > = ;1M#0^0`oV|0_&W%U#S"R QONLKIHGEDB@ > =3NU>$1_1apW}2`(X&V%U#S"R PONLKIHFEDB@ > 4NfV $3a3cqY3b)Z(X&V%U$T"R QONLKIHGEDA@ 5NV$%4b5drZ5c+[)Y(X&V%U#S!RP P+Y/\%SIHFECA 6NV$%6c7fs[7e-]+\)Z(X(X8dRw~Vz#RGED8NV$&7e8gt\8f.^-],]?jep5`GE:NV$*Al;iv]Y9A]s||||||||||||||zZ&5mqynjihfedbuzfwĂŅݺԧƋuromkhfdaMpqrqqqqqqqqqqqqqqqqqo5$4hkkt|ledca`^]\rzfyŅljըǍwtromkifdFhl|ihhhhhhhhhhhhhhhhhf2+aedba`^]\[YXV~U}pzf{Ljȋ֪ɏzwtrpmkhf?^as_^^^^^^^^^^^^^^^^^\- Pr_^][ZXWVT~S|R{PyNxnzf}ȊɎ׫ʑ|ywtromki9TXkUTTTTTTTTTTTTTTTTTR(U7SEiFjEhDgBfAd?d?c>a<`;_:_bqfɌː׭˓~|ywtromk2JMbKJJJJJJJJJJJJJJJJJH# ek5Ifˏ̒د͕~|ywtrom*??dyO??????????????????=1XruuuuuuuuuuuG,fƒ͔̑ڰ͗ă€~{ywtro%66:GE96666666666666666665efąΔϗڲΚņă€~|y|ʼn̘ű++++++++++++++++++++++++*efŇϖЙ۳ЛLjŅă€Ã֫͘޽ !!!!!!!!!!!!!!!!!!!!!!!! efnjјқܵѝɋɎ̕է޺߾ܽ  kefӦڭդ޹ת֨۴߾߽޻ݺܹ׹jefڵ޻޺ݹܸ۶۵ڴ׳ϴȵöõµkvA[NNNNNNNNNNNNL:!efٳ߻޹ݸܷܵڴڲٱد׮֬֫ԪԨӧҥ͝ۑ?ekefٱ߻ߺݸݶܵ۴ڲٰد׭֬ժթԧӦҥѣС˙ې>ekefٯ߸ݷݵ۳۲ٰٯ׭׬֩ըԦӥңѢРϞΝɔۏeeffffffffffffffffffffffgch  0pp?p00??( @ 83r3w1.. 3q3x2733w3w28U2f3x2d2d3x3J283w3x3x4o3<3co'͂5;4Nm+ԐF<2@ ҎJR3|y<{?4PۡdF3ިr|ߪw}ɅT? ?<֐<ш9P6ӎBוJ[02Af)ڛV`'iFϜ: X!K2ƐƀKBV#Ǘΐ]5H6Pш7Ji%D z4b#}82Q6ЌJoc)50X!Iŗ/ / 52ƐuA452}߫zݩx2_4Dm$q(8y0f%\JڙO;*> ڛWgt73OX!ÃEq9q9> 2Ɛٟls?͋Y縇_,13ӊ6[2jw0ޞLB ǚ6VOښ5w|=ЌKFgT/ X!ÄɄJw@w@? 2Ɛ֛hm9ܦtzH4z8˹c?Ɯ1Kd"23c`#K;n0F̘2AX!c*4X!H̘19197%2ƐuA4?U"֥Q0%4122#50. *0/23234132#415&Y!ÃEn7o9K3Ɛ؞io:ݧuϟHCs:sv?L2s>zFzGr?Lҙ45I  *5666673 661/3 L"QNLIFC@ =:74&'W4a9dPLIGDA >:71Y˙˞˞˞˞˞˞˞˞˞˞̄+Zk&UOLJGDA =:3] .]n)X"ROLIGD@ =6̡ 1`p,\%U"ROLIGD@ 9̧!^ 4cr/_(X%U"RO$SKGC ;̧Mt 7et3b+\=hk`M?̧MtW~[|Yx-w*q*j)eo o AMt}iLnjea\XSOMt?I/~ywuq>vz{pkfa\PMt 3jmsplign={̕ٲ}okfaPNx\mwwwwwwwmfija_\Yl=զݸÃtpkfQSnccccccccb?[RxPuMsJqHnElg;ąת޻ƈytokQB[OOOOOOOONSlj٭Ȍ~ytoR1Eg?;;;;;;;;:fʎ۱ˑăȎԨj&&&&&&&&&&&&fў޶ҟԦݸ߽ӽ. uf޺ݸ۵ڲհͰˮȩ; /''''''fߺ޸ܴڱخ֫ԨӥѢ͛| f f޶ܲگ׫ըӤѡϝ͚ɓ{f eݲ޳ۮ٪֦Ӣџϛ̗ʓƌyq fyݱܭ٩ץԡҝϘ̕ɐǍňnl cgqrrrrqqqqp o gd3"0G0@(  @K  u /+YLF@:0\<OOOOO(7{$TLG@8d@:*Z"RNG>dS<+CMvsjYJ%/E+A)?ΒZ۴ÃtNhEEEE*T߻͖ѡϹjٰܶҫ̥~7fݴتӣϜɓzى4e`\WRޘGmAH0wxformbuilder-3.1.59/src/boost/config/platform/beos.hpp0000644000175000017500000000112111143440027023412 0ustar rrmulderrrmulder// (C) Copyright John Maddock 2001. // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org for most recent version. // BeOS specific config options: #define BOOST_PLATFORM "BeOS" #define BOOST_NO_CWCHAR #define BOOST_NO_CWCTYPE #define BOOST_HAS_UNISTD_H #define BOOST_HAS_BETHREADS #ifndef BOOST_DISABLE_THREADS # define BOOST_HAS_THREADS #endif // boilerplate code: #include wxformbuilder-3.1.59/src/boost/config/platform/win32.hpp0000644000175000017500000000316311143440027023434 0ustar rrmulderrrmulder// (C) Copyright John Maddock 2001 - 2003. // (C) Copyright Bill Kempf 2001. // (C) Copyright Aleksey Gurtovoy 2003. // (C) Copyright Rene Rivera 2005. // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org for most recent version. // Win32 specific config options: #define BOOST_PLATFORM "Win32" // Get the information about the MinGW runtime, i.e. __MINGW32_*VERSION. #if defined(__MINGW32__) # include <_mingw.h> #endif #if defined(__GNUC__) && !defined(BOOST_NO_SWPRINTF) # define BOOST_NO_SWPRINTF #endif #if !defined(__GNUC__) && !defined(BOOST_HAS_DECLSPEC) # define BOOST_HAS_DECLSPEC #endif #if defined(__MINGW32__) && ((__MINGW32_MAJOR_VERSION > 2) || ((__MINGW32_MAJOR_VERSION == 2) && (__MINGW32_MINOR_VERSION >= 0))) # define BOOST_HAS_STDINT_H # define __STDC_LIMIT_MACROS # define BOOST_HAS_DIRENT_H # define BOOST_HAS_UNISTD_H #endif // // Win32 will normally be using native Win32 threads, // but there is a pthread library avaliable as an option, // we used to disable this when BOOST_DISABLE_WIN32 was // defined but no longer - this should allow some // files to be compiled in strict mode - while maintaining // a consistent setting of BOOST_HAS_THREADS across // all translation units (needed for shared_ptr etc). // #ifdef _WIN32_WCE # define BOOST_NO_ANSI_APIS #endif #ifndef BOOST_HAS_PTHREADS # define BOOST_HAS_WINTHREADS #endif #ifndef BOOST_DISABLE_WIN32 // WEK: Added #define BOOST_HAS_FTIME #define BOOST_WINDOWS 1 #endif wxformbuilder-3.1.59/src/boost/config/platform/solaris.hpp0000644000175000017500000000102211143440027024136 0ustar rrmulderrrmulder// (C) Copyright John Maddock 2001 - 2003. // (C) Copyright Jens Maurer 2003. // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org for most recent version. // sun specific config options: #define BOOST_PLATFORM "Sun Solaris" #define BOOST_HAS_GETTIMEOFDAY // boilerplate code: #define BOOST_HAS_UNISTD_H #include wxformbuilder-3.1.59/src/boost/config/platform/bsd.hpp0000644000175000017500000000356711143440027023252 0ustar rrmulderrrmulder// (C) Copyright John Maddock 2001 - 2003. // (C) Copyright Darin Adler 2001. // (C) Copyright Douglas Gregor 2002. // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org for most recent version. // generic BSD config options: #if !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__) && !defined(__DragonFly__) #error "This platform is not BSD" #endif #ifdef __FreeBSD__ #define BOOST_PLATFORM "FreeBSD " BOOST_STRINGIZE(__FreeBSD__) #elif defined(__NetBSD__) #define BOOST_PLATFORM "NetBSD " BOOST_STRINGIZE(__NetBSD__) #elif defined(__OpenBSD__) #define BOOST_PLATFORM "OpenBSD " BOOST_STRINGIZE(__OpenBSD__) #elif defined(__DragonFly__) #define BOOST_PLATFORM "DragonFly " BOOST_STRINGIZE(__DragonFly__) #endif // // is this the correct version check? // FreeBSD has but does not // advertise the fact in : // #if (defined(__FreeBSD__) && (__FreeBSD__ >= 3)) || defined(__DragonFly__) # define BOOST_HAS_NL_TYPES_H #endif // // FreeBSD 3.x has pthreads support, but defines _POSIX_THREADS in // and not in // #if defined(__FreeBSD__) && (__FreeBSD__ <= 3) # define BOOST_HAS_PTHREADS #endif // // No wide character support in the BSD header files: // #if !(defined(__FreeBSD__) && (__FreeBSD__ >= 5)) # define BOOST_NO_CWCHAR #endif // // The BSD has macros only, no functions: // #if !defined(__OpenBSD__) # define BOOST_NO_CTYPE_FUNCTIONS #endif // // thread API's not auto detected: // #define BOOST_HAS_SCHED_YIELD #define BOOST_HAS_NANOSLEEP #define BOOST_HAS_GETTIMEOFDAY #define BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE #define BOOST_HAS_SIGACTION // boilerplate code: #define BOOST_HAS_UNISTD_H #include wxformbuilder-3.1.59/src/boost/config/platform/linux.hpp0000644000175000017500000000465011143440027023633 0ustar rrmulderrrmulder// (C) Copyright John Maddock 2001 - 2003. // (C) Copyright Jens Maurer 2001 - 2003. // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org for most recent version. // linux specific config options: #define BOOST_PLATFORM "linux" // make sure we have __GLIBC_PREREQ if available at all #include // // added to glibc 2.1.1 // We can only test for 2.1 though: // #if defined(__GLIBC__) && ((__GLIBC__ > 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 1))) // defines int64_t unconditionally, but defines // int64_t only if __GNUC__. Thus, assume a fully usable // only when using GCC. # if defined __GNUC__ # define BOOST_HAS_STDINT_H # endif #endif #if defined(__LIBCOMO__) // // como on linux doesn't have std:: c functions: // NOTE: versions of libcomo prior to beta28 have octal version numbering, // e.g. version 25 is 21 (dec) // # if __LIBCOMO_VERSION__ <= 20 # define BOOST_NO_STDC_NAMESPACE # endif # if __LIBCOMO_VERSION__ <= 21 # define BOOST_NO_SWPRINTF # endif #endif // // If glibc is past version 2 then we definitely have // gettimeofday, earlier versions may or may not have it: // #if defined(__GLIBC__) && (__GLIBC__ >= 2) # define BOOST_HAS_GETTIMEOFDAY #endif #ifdef __USE_POSIX199309 # define BOOST_HAS_NANOSLEEP #endif #if defined(__GLIBC__) && defined(__GLIBC_PREREQ) // __GLIBC_PREREQ is available since 2.1.2 // swprintf is available since glibc 2.2.0 # if !__GLIBC_PREREQ(2,2) || (!defined(__USE_ISOC99) && !defined(__USE_UNIX98)) # define BOOST_NO_SWPRINTF # endif #else # define BOOST_NO_SWPRINTF #endif // boilerplate code: #define BOOST_HAS_UNISTD_H #include #ifndef __GNUC__ // // if the compiler is not gcc we still need to be able to parse // the GNU system headers, some of which (mainly ) // use GNU specific extensions: // # ifndef __extension__ # define __extension__ # endif # ifndef __const__ # define __const__ const # endif # ifndef __volatile__ # define __volatile__ volatile # endif # ifndef __signed__ # define __signed__ signed # endif # ifndef __typeof__ # define __typeof__ typeof # endif # ifndef __inline__ # define __inline__ inline # endif #endif wxformbuilder-3.1.59/src/boost/config/platform/amigaos.hpp0000644000175000017500000000067211143440027024114 0ustar rrmulderrrmulder// (C) Copyright John Maddock 2002. // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org for most recent version. #define BOOST_PLATFORM "AmigaOS" #define BOOST_DISABLE_THREADS #define BOOST_NO_CWCHAR #define BOOST_NO_STD_WSTRING #define BOOST_NO_INTRINSIC_WCHAR_T wxformbuilder-3.1.59/src/boost/config/platform/macos.hpp0000644000175000017500000000427511143440027023601 0ustar rrmulderrrmulder// (C) Copyright John Maddock 2001 - 2003. // (C) Copyright Darin Adler 2001 - 2002. // (C) Copyright Bill Kempf 2002. // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org for most recent version. // Mac OS specific config options: #define BOOST_PLATFORM "Mac OS" #if __MACH__ && !defined(_MSL_USING_MSL_C) // Using the Mac OS X system BSD-style C library. # ifndef BOOST_HAS_UNISTD_H # define BOOST_HAS_UNISTD_H # endif // // Begin by including our boilerplate code for POSIX // feature detection, this is safe even when using // the MSL as Metrowerks supply their own // to replace the platform-native BSD one. G++ users // should also always be able to do this on MaxOS X. // # include # ifndef BOOST_HAS_STDINT_H # define BOOST_HAS_STDINT_H # endif // // BSD runtime has pthreads, sigaction, sched_yield and gettimeofday, // of these only pthreads are advertised in , so set the // other options explicitly: // # define BOOST_HAS_SCHED_YIELD # define BOOST_HAS_GETTIMEOFDAY # define BOOST_HAS_SIGACTION # if (__GNUC__ < 3) && !defined( __APPLE_CC__) // GCC strange "ignore std" mode works better if you pretend everything // is in the std namespace, for the most part. # define BOOST_NO_STDC_NAMESPACE # endif #else // Using the MSL C library. // We will eventually support threads in non-Carbon builds, but we do // not support this yet. # if ( defined(TARGET_API_MAC_CARBON) && TARGET_API_MAC_CARBON ) || ( defined(TARGET_CARBON) && TARGET_CARBON ) # if !defined(BOOST_HAS_PTHREADS) # define BOOST_HAS_MPTASKS # elif ( __dest_os == __mac_os_x ) // We are doing a Carbon/Mach-O/MSL build which has pthreads, but only the // gettimeofday and no posix. # define BOOST_HAS_GETTIMEOFDAY # endif // The MP task implementation of Boost Threads aims to replace MP-unsafe // parts of the MSL, so we turn on threads unconditionally. # define BOOST_HAS_THREADS // The remote call manager depends on this. # define BOOST_BIND_ENABLE_PASCAL # endif #endif wxformbuilder-3.1.59/src/boost/config/platform/cygwin.hpp0000644000175000017500000000232211143440027023766 0ustar rrmulderrrmulder// (C) Copyright John Maddock 2001 - 2003. // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org for most recent version. // cygwin specific config options: #define BOOST_PLATFORM "Cygwin" #define BOOST_NO_CWCTYPE #define BOOST_NO_CWCHAR #define BOOST_NO_SWPRINTF #define BOOST_HAS_DIRENT_H // // Threading API: // See if we have POSIX threads, if we do use them, otherwise // revert to native Win threads. #define BOOST_HAS_UNISTD_H #include #if defined(_POSIX_THREADS) && (_POSIX_THREADS+0 >= 0) && !defined(BOOST_HAS_WINTHREADS) # define BOOST_HAS_PTHREADS # define BOOST_HAS_SCHED_YIELD # define BOOST_HAS_GETTIMEOFDAY # define BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE # define BOOST_HAS_SIGACTION #else # if !defined(BOOST_HAS_WINTHREADS) # define BOOST_HAS_WINTHREADS # endif # define BOOST_HAS_FTIME #endif // // find out if we have a stdint.h, there should be a better way to do this: // #include #ifdef _STDINT_H #define BOOST_HAS_STDINT_H #endif // boilerplate code: #include wxformbuilder-3.1.59/src/boost/config/platform/irix.hpp0000644000175000017500000000142511143440027023444 0ustar rrmulderrrmulder// (C) Copyright John Maddock 2001 - 2003. // (C) Copyright Jens Maurer 2003. // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org for most recent version. // SGI Irix specific config options: #define BOOST_PLATFORM "SGI Irix" #define BOOST_NO_SWPRINTF // // these are not auto detected by POSIX feature tests: // #define BOOST_HAS_GETTIMEOFDAY #define BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE #ifdef __GNUC__ // GNU C on IRIX does not support threads (checked up to gcc 3.3) # define BOOST_DISABLE_THREADS #endif // boilerplate code: #define BOOST_HAS_UNISTD_H #include wxformbuilder-3.1.59/src/boost/config/platform/hpux.hpp0000644000175000017500000000364211143440027023460 0ustar rrmulderrrmulder// (C) Copyright John Maddock 2001 - 2003. // (C) Copyright Jens Maurer 2001 - 2003. // (C) Copyright David Abrahams 2002. // (C) Copyright Toon Knapen 2003. // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org for most recent version. // hpux specific config options: #define BOOST_PLATFORM "HP-UX" // In principle, HP-UX has a nice under the name // However, it has the following problem: // Use of UINT32_C(0) results in "0u l" for the preprocessed source // (verifyable with gcc 2.95.3, assumed for HP aCC) // #define BOOST_HAS_STDINT_H #define BOOST_NO_SWPRINTF #define BOOST_NO_CWCTYPE #if defined(__GNUC__) # if (__GNUC__ < 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ < 3)) // GNU C on HP-UX does not support threads (checked up to gcc 3.3) # define BOOST_DISABLE_THREADS # elif !defined(BOOST_DISABLE_THREADS) // threads supported from gcc-3.3 onwards: # define BOOST_HAS_THREADS # define BOOST_HAS_PTHREADS # endif #endif // boilerplate code: #define BOOST_HAS_UNISTD_H #include // the following are always available: #ifndef BOOST_HAS_GETTIMEOFDAY # define BOOST_HAS_GETTIMEOFDAY #endif #ifndef BOOST_HAS_SCHED_YIELD # define BOOST_HAS_SCHED_YIELD #endif #ifndef BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE # define BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE #endif #ifndef BOOST_HAS_NL_TYPES_H # define BOOST_HAS_NL_TYPES_H #endif #ifndef BOOST_HAS_NANOSLEEP # define BOOST_HAS_NANOSLEEP #endif #ifndef BOOST_HAS_GETTIMEOFDAY # define BOOST_HAS_GETTIMEOFDAY #endif #ifndef BOOST_HAS_DIRENT_H # define BOOST_HAS_DIRENT_H #endif #ifndef BOOST_HAS_CLOCK_GETTIME # define BOOST_HAS_CLOCK_GETTIME #endif #ifndef BOOST_HAS_SIGACTION # define BOOST_HAS_SIGACTION #endif wxformbuilder-3.1.59/src/boost/config/platform/aix.hpp0000644000175000017500000000156111143440027023253 0ustar rrmulderrrmulder// (C) Copyright John Maddock 2001 - 2002. // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org for most recent version. // IBM/Aix specific config options: #define BOOST_PLATFORM "IBM Aix" #define BOOST_HAS_UNISTD_H #define BOOST_HAS_NL_TYPES_H #define BOOST_HAS_NANOSLEEP #define BOOST_HAS_CLOCK_GETTIME // This needs support in "boost/cstdint.hpp" exactly like FreeBSD. // This platform has header named which includes all // the things needed. #define BOOST_HAS_STDINT_H // Threading API's: #define BOOST_HAS_PTHREADS #define BOOST_HAS_PTHREAD_DELAY_NP #define BOOST_HAS_SCHED_YIELD //#define BOOST_HAS_PTHREAD_YIELD // boilerplate code: #include wxformbuilder-3.1.59/src/boost/config/abi/borland_suffix.hpp0000644000175000017500000000043011143440027024400 0ustar rrmulderrrmulder// (C) Copyright John Maddock 2003. // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) # pragma option pop #pragma nopushoptwarn wxformbuilder-3.1.59/src/boost/config/abi/borland_prefix.hpp0000644000175000017500000000174711143440027024405 0ustar rrmulderrrmulder// (C) Copyright John Maddock 2003. // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // for C++ Builder the following options effect the ABI: // // -b (on or off - effect emum sizes) // -Vx (on or off - empty members) // -Ve (on or off - empty base classes) // -aX (alignment - 5 options). // -pX (Calling convention - 4 options) // -VmX (member pointer size and layout - 5 options) // -VC (on or off, changes name mangling) // -Vl (on or off, changes struct layout). // In addition the following warnings are sufficiently annoying (and // unfixable) to have them turned off by default: // // 8027 - functions containing [for|while] loops are not expanded inline // 8026 - functions taking class by value arguments are not expanded inline #pragma nopushoptwarn # pragma option push -Vx -Ve -a8 -b -pc -Vmv -VC- -Vl- -w-8027 -w-8026 wxformbuilder-3.1.59/src/boost/config/abi/msvc_suffix.hpp0000644000175000017500000000037411143440027023736 0ustar rrmulderrrmulder// (C) Copyright John Maddock 2003. // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #pragma pack(pop) wxformbuilder-3.1.59/src/boost/config/abi/msvc_prefix.hpp0000644000175000017500000000037711143440027023732 0ustar rrmulderrrmulder// (C) Copyright John Maddock 2003. // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #pragma pack(push,8) wxformbuilder-3.1.59/src/boost/config/compiler/comeau.hpp0000644000175000017500000000304211143440027023725 0ustar rrmulderrrmulder// (C) Copyright John Maddock 2001. // (C) Copyright Douglas Gregor 2001. // (C) Copyright Peter Dimov 2001. // (C) Copyright Aleksey Gurtovoy 2003. // (C) Copyright Beman Dawes 2003. // (C) Copyright Jens Maurer 2003. // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org for most recent version. // Comeau C++ compiler setup: #include "boost/config/compiler/common_edg.hpp" #if (__COMO_VERSION__ <= 4245) # if defined(_MSC_VER) && _MSC_VER <= 1300 # if _MSC_VER > 100 // only set this in non-strict mode: # define BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP # endif # endif // Void returns don't work when emulating VC 6 (Peter Dimov) # if defined(_MSC_VER) && (_MSC_VER == 1200) # define BOOST_NO_VOID_RETURNS # endif #endif // version 4245 // // enable __int64 support in VC emulation mode // # if defined(_MSC_VER) && (_MSC_VER >= 1200) # define BOOST_HAS_MS_INT64 # endif #define BOOST_COMPILER "Comeau compiler version " BOOST_STRINGIZE(__COMO_VERSION__) // // versions check: // we don't know Comeau prior to version 4245: #if __COMO_VERSION__ < 4245 # error "Compiler not configured - please reconfigure" #endif // // last known and checked version is 4245: #if (__COMO_VERSION__ > 4245) # if defined(BOOST_ASSERT_CONFIG) # error "Unknown compiler version - please run the configure tests and report the results" # endif #endif wxformbuilder-3.1.59/src/boost/config/compiler/metrowerks.hpp0000644000175000017500000000571211143440027024664 0ustar rrmulderrrmulder// (C) Copyright John Maddock 2001. // (C) Copyright Darin Adler 2001. // (C) Copyright Peter Dimov 2001. // (C) Copyright David Abrahams 2001 - 2002. // (C) Copyright Beman Dawes 2001 - 2003. // (C) Copyright Stefan Slapeta 2004. // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org for most recent version. // Metrowerks C++ compiler setup: // locale support is disabled when linking with the dynamic runtime # ifdef _MSL_NO_LOCALE # define BOOST_NO_STD_LOCALE # endif # if __MWERKS__ <= 0x2301 // 5.3 # define BOOST_NO_FUNCTION_TEMPLATE_ORDERING # define BOOST_NO_POINTER_TO_MEMBER_CONST # define BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS # define BOOST_NO_MEMBER_TEMPLATE_KEYWORD # endif # if __MWERKS__ <= 0x2401 // 6.2 //# define BOOST_NO_FUNCTION_TEMPLATE_ORDERING # endif # if(__MWERKS__ <= 0x2407) // 7.x # define BOOST_NO_MEMBER_FUNCTION_SPECIALIZATIONS # define BOOST_NO_UNREACHABLE_RETURN_DETECTION # endif # if(__MWERKS__ <= 0x3003) // 8.x # define BOOST_NO_SFINAE # endif // the "|| !defined(BOOST_STRICT_CONFIG)" part should apply to the last // tested version *only*: # if(__MWERKS__ <= 0x3206) || !defined(BOOST_STRICT_CONFIG) // 9.5 # define BOOST_NO_MEMBER_TEMPLATE_FRIENDS # define BOOST_NO_IS_ABSTRACT # endif #if !__option(wchar_type) # define BOOST_NO_INTRINSIC_WCHAR_T #endif #if !__option(exceptions) # define BOOST_NO_EXCEPTIONS #endif #if (__INTEL__ && _WIN32) || (__POWERPC__ && macintosh) # if __MWERKS__ == 0x3000 # define BOOST_COMPILER_VERSION 8.0 # elif __MWERKS__ == 0x3001 # define BOOST_COMPILER_VERSION 8.1 # elif __MWERKS__ == 0x3002 # define BOOST_COMPILER_VERSION 8.2 # elif __MWERKS__ == 0x3003 # define BOOST_COMPILER_VERSION 8.3 # elif __MWERKS__ == 0x3200 # define BOOST_COMPILER_VERSION 9.0 # elif __MWERKS__ == 0x3201 # define BOOST_COMPILER_VERSION 9.1 # elif __MWERKS__ == 0x3202 # define BOOST_COMPILER_VERSION 9.2 # elif __MWERKS__ == 0x3204 # define BOOST_COMPILER_VERSION 9.3 # elif __MWERKS__ == 0x3205 # define BOOST_COMPILER_VERSION 9.4 # elif __MWERKS__ == 0x3206 # define BOOST_COMPILER_VERSION 9.5 # else # define BOOST_COMPILER_VERSION __MWERKS__ # endif #else # define BOOST_COMPILER_VERSION __MWERKS__ #endif #define BOOST_COMPILER "Metrowerks CodeWarrior C++ version " BOOST_STRINGIZE(BOOST_COMPILER_VERSION) // // versions check: // we don't support Metrowerks prior to version 5.3: #if __MWERKS__ < 0x2301 # error "Compiler not supported or configured - please reconfigure" #endif // // last known and checked version: #if (__MWERKS__ > 0x3205) # if defined(BOOST_ASSERT_CONFIG) # error "Unknown compiler version - please run the configure tests and report the results" # endif #endif wxformbuilder-3.1.59/src/boost/config/compiler/digitalmars.hpp0000644000175000017500000000266011143440027024761 0ustar rrmulderrrmulder// Copyright (C) Christof Meerwald 2003 // Copyright (C) Dan Watkins 2003 // // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // Digital Mars C++ compiler setup: #define BOOST_COMPILER __DMC_VERSION_STRING__ #define BOOST_HAS_LONG_LONG #define BOOST_HAS_PRAGMA_ONCE #if (__DMC__ <= 0x833) #define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL #define BOOST_NO_TEMPLATE_TEMPLATES #define BOOST_NEEDS_TOKEN_PASTING_OP_FOR_TOKENS_JUXTAPOSING #define BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS #define BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS #endif #if (__DMC__ <= 0x840) || !defined(BOOST_STRICT_CONFIG) #define BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS #define BOOST_NO_MEMBER_TEMPLATE_FRIENDS #define BOOST_NO_OPERATORS_IN_NAMESPACE #define BOOST_NO_UNREACHABLE_RETURN_DETECTION #define BOOST_NO_SFINAE #define BOOST_NO_USING_TEMPLATE #define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL #endif // // has macros: #if (__DMC__ >= 0x840) #define BOOST_HAS_DIRENT_H #define BOOST_HAS_STDINT_H #define BOOST_HAS_WINTHREADS #endif // check for exception handling support: #ifndef _CPPUNWIND # define BOOST_NO_EXCEPTIONS #endif #if (__DMC__ < 0x840) # if defined(BOOST_ASSERT_CONFIG) # error "Unknown compiler version - please run the configure tests and report the results" # endif #endif wxformbuilder-3.1.59/src/boost/config/compiler/gcc.hpp0000644000175000017500000000601211143440027023210 0ustar rrmulderrrmulder// (C) Copyright John Maddock 2001 - 2003. // (C) Copyright Darin Adler 2001 - 2002. // (C) Copyright Jens Maurer 2001 - 2002. // (C) Copyright Beman Dawes 2001 - 2003. // (C) Copyright Douglas Gregor 2002. // (C) Copyright David Abrahams 2002 - 2003. // (C) Copyright Synge Todo 2003. // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org for most recent version. // GNU C++ compiler setup: #if __GNUC__ < 3 # if __GNUC_MINOR__ == 91 // egcs 1.1 won't parse shared_ptr.hpp without this: # define BOOST_NO_AUTO_PTR # endif # if __GNUC_MINOR__ < 95 // // Prior to gcc 2.95 member templates only partly // work - define BOOST_MSVC6_MEMBER_TEMPLATES // instead since inline member templates mostly work. // # define BOOST_NO_MEMBER_TEMPLATES # if __GNUC_MINOR__ >= 9 # define BOOST_MSVC6_MEMBER_TEMPLATES # endif # endif # if __GNUC_MINOR__ < 96 # define BOOST_NO_SFINAE # endif # if __GNUC_MINOR__ <= 97 # define BOOST_NO_MEMBER_TEMPLATE_FRIENDS # define BOOST_NO_OPERATORS_IN_NAMESPACE # endif # define BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE # define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL # define BOOST_NO_IS_ABSTRACT #elif __GNUC__ == 3 // // gcc-3.x problems: // // Bug specific to gcc 3.1 and 3.2: // # if ((__GNUC_MINOR__ == 1) || (__GNUC_MINOR__ == 2)) # define BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS # endif # if __GNUC_MINOR__ < 4 # define BOOST_NO_IS_ABSTRACT # endif #endif #ifndef __EXCEPTIONS # define BOOST_NO_EXCEPTIONS #endif // // Threading support: Turn this on unconditionally here (except for // those platforms where we can know for sure). It will get turned off again // later if no threading API is detected. // #if !defined(__MINGW32__) && !defined(linux) && !defined(__linux) && !defined(__linux__) # define BOOST_HAS_THREADS #endif // // gcc has "long long" // #define BOOST_HAS_LONG_LONG // // gcc implements the named return value optimization since version 3.1 // #if __GNUC__ > 3 || ( __GNUC__ == 3 && __GNUC_MINOR__ >= 1 ) #define BOOST_HAS_NRVO #endif #define BOOST_COMPILER "GNU C++ version " __VERSION__ // // versions check: // we don't know gcc prior to version 2.90: #if (__GNUC__ == 2) && (__GNUC_MINOR__ < 90) # error "Compiler not configured - please reconfigure" #endif // // last known and checked version is 4.0 (Pre-release): #if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 0)) # if defined(BOOST_ASSERT_CONFIG) # error "Unknown compiler version - please run the configure tests and report the results" # else // we don't emit warnings here anymore since there are no defect macros defined for // gcc post 3.4, so any failures are gcc regressions... //# warning "Unknown compiler version - please run the configure tests and report the results" # endif #endif wxformbuilder-3.1.59/src/boost/config/compiler/vacpp.hpp0000644000175000017500000000336111143440027023571 0ustar rrmulderrrmulder// (C) Copyright John Maddock 2001 - 2003. // (C) Copyright Toon Knapen 2001 - 2003. // (C) Copyright Lie-Quan Lee 2001. // (C) Copyright Markus Schpflin 2002 - 2003. // (C) Copyright Beman Dawes 2002 - 2003. // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org for most recent version. // Visual Age (IBM) C++ compiler setup: #if __IBMCPP__ <= 501 # define BOOST_NO_MEMBER_TEMPLATE_FRIENDS # define BOOST_NO_MEMBER_FUNCTION_SPECIALIZATIONS #endif #if (__IBMCPP__ <= 502) // Actually the compiler supports inclass member initialization but it // requires a definition for the class member and it doesn't recognize // it as an integral constant expression when used as a template argument. # define BOOST_NO_INCLASS_MEMBER_INITIALIZATION # define BOOST_NO_INTEGRAL_INT64_T # define BOOST_NO_MEMBER_TEMPLATE_KEYWORD #endif #if (__IBMCPP__ <= 600) || !defined(BOOST_STRICT_CONFIG) # define BOOST_NO_POINTER_TO_MEMBER_TEMPLATE_PARAMETERS # define BOOST_MPL_CFG_ASSERT_USE_RELATION_NAMES 1 #endif // // On AIX thread support seems to be indicated by _THREAD_SAFE: // #ifdef _THREAD_SAFE # define BOOST_HAS_THREADS #endif #define BOOST_COMPILER "IBM Visual Age version " BOOST_STRINGIZE(__IBMCPP__) // // versions check: // we don't support Visual age prior to version 5: #if __IBMCPP__ < 500 #error "Compiler not supported or configured - please reconfigure" #endif // // last known and checked version is 600: #if (__IBMCPP__ > 600) # if defined(BOOST_ASSERT_CONFIG) # error "Unknown compiler version - please run the configure tests and report the results" # endif #endif wxformbuilder-3.1.59/src/boost/config/compiler/common_edg.hpp0000644000175000017500000000332211143440027024564 0ustar rrmulderrrmulder// (C) Copyright John Maddock 2001 - 2002. // (C) Copyright Jens Maurer 2001. // (C) Copyright David Abrahams 2002. // (C) Copyright Aleksey Gurtovoy 2002. // (C) Copyright Markus Schoepflin 2005. // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org for most recent version. // // Options common to all edg based compilers. // // This is included from within the individual compiler mini-configs. #ifndef __EDG_VERSION__ # error This file requires that __EDG_VERSION__ be defined. #endif #if (__EDG_VERSION__ <= 238) # define BOOST_NO_INTEGRAL_INT64_T # define BOOST_NO_SFINAE #endif #if (__EDG_VERSION__ <= 240) # define BOOST_NO_VOID_RETURNS #endif #if (__EDG_VERSION__ <= 241) && !defined(BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP) # define BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP #endif #if (__EDG_VERSION__ <= 244) && !defined(BOOST_NO_TEMPLATE_TEMPLATES) # define BOOST_NO_TEMPLATE_TEMPLATES #endif #if (__EDG_VERSION__ < 300) && !defined(BOOST_NO_IS_ABSTRACT) # define BOOST_NO_IS_ABSTRACT #endif #if (__EDG_VERSION__ <= 303) && !defined(BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL) # define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL #endif // See also kai.hpp which checks a Kai-specific symbol for EH # if !defined(__KCC) && !defined(__EXCEPTIONS) # define BOOST_NO_EXCEPTIONS # endif # if !defined(__NO_LONG_LONG) # define BOOST_HAS_LONG_LONG # endif #ifdef c_plusplus // EDG has "long long" in non-strict mode // However, some libraries have insufficient "long long" support // #define BOOST_HAS_LONG_LONG #endif wxformbuilder-3.1.59/src/boost/config/compiler/intel.hpp0000644000175000017500000001256411143440027023600 0ustar rrmulderrrmulder// (C) Copyright John Maddock 2001. // (C) Copyright Peter Dimov 2001. // (C) Copyright Jens Maurer 2001. // (C) Copyright David Abrahams 2002 - 2003. // (C) Copyright Aleksey Gurtovoy 2002 - 2003. // (C) Copyright Guillaume Melquiond 2002 - 2003. // (C) Copyright Beman Dawes 2003. // (C) Copyright Martin Wille 2003. // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org for most recent version. // Intel compiler setup: #include "boost/config/compiler/common_edg.hpp" #if defined(__INTEL_COMPILER) # define BOOST_INTEL_CXX_VERSION __INTEL_COMPILER #elif defined(__ICL) # define BOOST_INTEL_CXX_VERSION __ICL #elif defined(__ICC) # define BOOST_INTEL_CXX_VERSION __ICC #elif defined(__ECC) # define BOOST_INTEL_CXX_VERSION __ECC #endif #define BOOST_COMPILER "Intel C++ version " BOOST_STRINGIZE(BOOST_INTEL_CXX_VERSION) #define BOOST_INTEL BOOST_INTEL_CXX_VERSION #if defined(_WIN32) || defined(_WIN64) # define BOOST_INTEL_WIN BOOST_INTEL #else # define BOOST_INTEL_LINUX BOOST_INTEL #endif #if (BOOST_INTEL_CXX_VERSION <= 500) && defined(_MSC_VER) # define BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS # define BOOST_NO_TEMPLATE_TEMPLATES #endif #if (BOOST_INTEL_CXX_VERSION <= 600) # if defined(_MSC_VER) && (_MSC_VER <= 1300) // added check for <= VC 7 (Peter Dimov) // Boost libraries assume strong standard conformance unless otherwise // indicated by a config macro. As configured by Intel, the EDG front-end // requires certain compiler options be set to achieve that strong conformance. // Particularly /Qoption,c,--arg_dep_lookup (reported by Kirk Klobe & Thomas Witt) // and /Zc:wchar_t,forScope. See boost-root/tools/build/intel-win32-tools.jam for // details as they apply to particular versions of the compiler. When the // compiler does not predefine a macro indicating if an option has been set, // this config file simply assumes the option has been set. // Thus BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP will not be defined, even if // the compiler option is not enabled. # define BOOST_NO_SWPRINTF # endif // Void returns, 64 bit integrals don't work when emulating VC 6 (Peter Dimov) # if defined(_MSC_VER) && (_MSC_VER <= 1200) # define BOOST_NO_VOID_RETURNS # define BOOST_NO_INTEGRAL_INT64_T # endif #endif #if (BOOST_INTEL_CXX_VERSION <= 710) && defined(_WIN32) # define BOOST_NO_POINTER_TO_MEMBER_TEMPLATE_PARAMETERS #endif // See http://aspn.activestate.com/ASPN/Mail/Message/boost/1614864 #if BOOST_INTEL_CXX_VERSION < 600 # define BOOST_NO_INTRINSIC_WCHAR_T #else // We should test the macro _WCHAR_T_DEFINED to check if the compiler // supports wchar_t natively. *BUT* there is a problem here: the standard // headers define this macro if they typedef wchar_t. Anyway, we're lucky // because they define it without a value, while Intel C++ defines it // to 1. So we can check its value to see if the macro was defined natively // or not. // Under UNIX, the situation is exactly the same, but the macro _WCHAR_T // is used instead. # if ((_WCHAR_T_DEFINED + 0) == 0) && ((_WCHAR_T + 0) == 0) # define BOOST_NO_INTRINSIC_WCHAR_T # endif #endif #if defined(__GNUC__) && !defined(BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL) // // Figure out when Intel is emulating this gcc bug: // # if ((__GNUC__ == 3) && (__GNUC_MINOR__ <= 2)) || (BOOST_INTEL <= 900) # define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL # endif #endif // // Verify that we have actually got BOOST_NO_INTRINSIC_WCHAR_T // set correctly, if we don't do this now, we will get errors later // in type_traits code among other things, getting this correct // for the Intel compiler is actually remarkably fragile and tricky: // #if defined(BOOST_NO_INTRINSIC_WCHAR_T) #include template< typename T > struct assert_no_intrinsic_wchar_t; template<> struct assert_no_intrinsic_wchar_t { typedef void type; }; // if you see an error here then you need to unset BOOST_NO_INTRINSIC_WCHAR_T // where it is defined above: typedef assert_no_intrinsic_wchar_t::type assert_no_intrinsic_wchar_t_; #else template< typename T > struct assert_intrinsic_wchar_t; template<> struct assert_intrinsic_wchar_t {}; // if you see an error here then define BOOST_NO_INTRINSIC_WCHAR_T on the command line: template<> struct assert_intrinsic_wchar_t {}; #endif #if _MSC_VER+0 >= 1000 # if _MSC_VER >= 1200 # define BOOST_HAS_MS_INT64 # endif # define BOOST_NO_SWPRINTF #elif defined(_WIN32) # define BOOST_DISABLE_WIN32 #endif // I checked version 6.0 build 020312Z, it implements the NRVO. // Correct this as you find out which version of the compiler // implemented the NRVO first. (Daniel Frey) #if (BOOST_INTEL_CXX_VERSION >= 600) # define BOOST_HAS_NRVO #endif // // versions check: // we don't support Intel prior to version 5.0: #if BOOST_INTEL_CXX_VERSION < 500 # error "Compiler not supported or configured - please reconfigure" #endif // // last known and checked version: #if (BOOST_INTEL_CXX_VERSION > 900) # if defined(BOOST_ASSERT_CONFIG) # error "Unknown compiler version - please run the configure tests and report the results" # elif defined(_MSC_VER) # pragma message("Unknown compiler version - please run the configure tests and report the results") # endif #endif wxformbuilder-3.1.59/src/boost/config/compiler/sgi_mipspro.hpp0000644000175000017500000000124611143440027025013 0ustar rrmulderrrmulder// (C) Copyright John Maddock 2001 - 2002. // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org for most recent version. // SGI C++ compiler setup: #define BOOST_COMPILER "SGI Irix compiler version " BOOST_STRINGIZE(_COMPILER_VERSION) #include "boost/config/compiler/common_edg.hpp" // // Threading support: // Turn this on unconditionally here, it will get turned off again later // if no threading API is detected. // #define BOOST_HAS_THREADS // // version check: // probably nothing to do here? wxformbuilder-3.1.59/src/boost/config/compiler/borland.hpp0000644000175000017500000001175411143440027024106 0ustar rrmulderrrmulder// (C) Copyright John Maddock 2001 - 2003. // (C) Copyright David Abrahams 2002 - 2003. // (C) Copyright Aleksey Gurtovoy 2002. // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org for most recent version. // Borland C++ compiler setup: // Version 5.0 and below: # if __BORLANDC__ <= 0x0550 // Borland C++Builder 4 and 5: # define BOOST_NO_MEMBER_TEMPLATE_FRIENDS # if __BORLANDC__ == 0x0550 // Borland C++Builder 5, command-line compiler 5.5: # define BOOST_NO_OPERATORS_IN_NAMESPACE # endif # endif // Version 5.51 and below: #if (__BORLANDC__ <= 0x551) # define BOOST_NO_CV_SPECIALIZATIONS # define BOOST_NO_CV_VOID_SPECIALIZATIONS # define BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS # define BOOST_NO_DEDUCED_TYPENAME // workaround for missing WCHAR_MAX/WCHAR_MIN: #include #include #ifndef WCHAR_MAX # define WCHAR_MAX 0xffff #endif #ifndef WCHAR_MIN # define WCHAR_MIN 0 #endif #endif // Version 7.0 (Kylix) and below: #if (__BORLANDC__ <= 0x570) # define BOOST_NO_SFINAE # define BOOST_NO_INTEGRAL_INT64_T # define BOOST_NO_DEPENDENT_NESTED_DERIVATIONS # define BOOST_NO_PRIVATE_IN_AGGREGATE # define BOOST_NO_USING_TEMPLATE # define BOOST_BCB_PARTIAL_SPECIALIZATION_BUG # define BOOST_NO_TEMPLATE_TEMPLATES # define BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE # define BOOST_NO_MEMBER_TEMPLATE_FRIENDS // we shouldn't really need this - but too many things choke // without it, this needs more investigation: # define BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS # define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL # define BOOST_NO_IS_ABSTRACT # ifdef NDEBUG // fix broken so that Boost.test works: # include # undef strcmp # endif // // new bug in 5.61: #if (__BORLANDC__ >= 0x561) && (__BORLANDC__ <= 0x570) // this seems to be needed by the command line compiler, but not the IDE: # define BOOST_NO_MEMBER_FUNCTION_SPECIALIZATIONS #endif # ifdef _WIN32 # define BOOST_NO_SWPRINTF # elif defined(linux) || defined(__linux__) || defined(__linux) // we should really be able to do without this // but the wcs* functions aren't imported into std:: # define BOOST_NO_STDC_NAMESPACE // _CPPUNWIND doesn't get automatically set for some reason: # pragma defineonoption BOOST_CPPUNWIND -x # endif #endif // // Post 0x561 we have long long and stdint.h: #if __BORLANDC__ >= 0x561 # ifndef __NO_LONG_LONG # define BOOST_HAS_LONG_LONG # endif // On non-Win32 platforms let the platform config figure this out: # ifdef _WIN32 # define BOOST_HAS_STDINT_H # endif #endif // Borland C++Builder 6 defaults to using STLPort. If _USE_OLD_RW_STL is // defined, then we have 0x560 or greater with the Rogue Wave implementation // which presumably has the std::DBL_MAX bug. #if ((__BORLANDC__ >= 0x550) && (__BORLANDC__ < 0x560)) || defined(_USE_OLD_RW_STL) // is partly broken, some macros define symbols that are really in // namespace std, so you end up having to use illegal constructs like // std::DBL_MAX, as a fix we'll just include float.h and have done with: #include #endif // // __int64: // #if (__BORLANDC__ >= 0x530) && !defined(__STRICT_ANSI__) # define BOOST_HAS_MS_INT64 #endif // // check for exception handling support: // #if !defined(_CPPUNWIND) && !defined(BOOST_CPPUNWIND) && !defined(__EXCEPTIONS) # define BOOST_NO_EXCEPTIONS #endif // // all versions have a : // #ifndef __STRICT_ANSI__ # define BOOST_HAS_DIRENT_H #endif // // all versions support __declspec: // #ifndef __STRICT_ANSI__ # define BOOST_HAS_DECLSPEC #endif // // ABI fixing headers: // #if __BORLANDC__ < 0x600 // not implemented for version 6 compiler yet #ifndef BOOST_ABI_PREFIX # define BOOST_ABI_PREFIX "boost/config/abi/borland_prefix.hpp" #endif #ifndef BOOST_ABI_SUFFIX # define BOOST_ABI_SUFFIX "boost/config/abi/borland_suffix.hpp" #endif #endif // // Disable Win32 support in ANSI mode: // #if __BORLANDC__ < 0x600 # pragma defineonoption BOOST_DISABLE_WIN32 -A #elif defined(__STRICT_ANSI__) # define BOOST_DISABLE_WIN32 #endif // // MSVC compatibility mode does some nasty things: // #if defined(_MSC_VER) && (_MSC_VER <= 1200) # define BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP # define BOOST_NO_VOID_RETURNS #endif #define BOOST_COMPILER "Borland C++ version " BOOST_STRINGIZE(__BORLANDC__) // // versions check: // we don't support Borland prior to version 5.4: #if __BORLANDC__ < 0x540 # error "Compiler not supported or configured - please reconfigure" #endif // // last known and checked version is 1536 (Builder X preview): #if (__BORLANDC__ > 1536) # if defined(BOOST_ASSERT_CONFIG) # error "Unknown compiler version - please run the configure tests and report the results" # else # pragma message( "Unknown compiler version - please run the configure tests and report the results") # endif #endif wxformbuilder-3.1.59/src/boost/config/compiler/visualc.hpp0000644000175000017500000001231411143440027024124 0ustar rrmulderrrmulder// (C) Copyright John Maddock 2001 - 2003. // (C) Copyright Darin Adler 2001 - 2002. // (C) Copyright Peter Dimov 2001. // (C) Copyright Aleksey Gurtovoy 2002. // (C) Copyright David Abrahams 2002 - 2003. // (C) Copyright Beman Dawes 2002 - 2003. // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org for most recent version. // Microsoft Visual C++ compiler setup: #define BOOST_MSVC _MSC_VER // turn off the warnings before we #include anything #pragma warning( disable : 4503 ) // warning: decorated name length exceeded #if _MSC_VER < 1300 // 1200 == VC++ 6.0, 1200-1202 == eVC++4 # pragma warning( disable : 4786 ) // ident trunc to '255' chars in debug info # define BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS # define BOOST_NO_VOID_RETURNS # define BOOST_NO_EXCEPTION_STD_NAMESPACE // disable min/max macro defines on vc6: // #endif #if (_MSC_VER <= 1300) // 1300 == VC++ 7.0 # if !defined(_MSC_EXTENSIONS) && !defined(BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS) // VC7 bug with /Za # define BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS # endif # define BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS # define BOOST_NO_INCLASS_MEMBER_INITIALIZATION # define BOOST_NO_PRIVATE_IN_AGGREGATE # define BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP # define BOOST_NO_INTEGRAL_INT64_T # define BOOST_NO_DEDUCED_TYPENAME # define BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE // VC++ 6/7 has member templates but they have numerous problems including // cases of silent failure, so for safety we define: # define BOOST_NO_MEMBER_TEMPLATES // For VC++ experts wishing to attempt workarounds, we define: # define BOOST_MSVC6_MEMBER_TEMPLATES # define BOOST_NO_MEMBER_TEMPLATE_FRIENDS # define BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION # define BOOST_NO_CV_VOID_SPECIALIZATIONS # define BOOST_NO_FUNCTION_TEMPLATE_ORDERING # define BOOST_NO_USING_TEMPLATE # define BOOST_NO_SWPRINTF # define BOOST_NO_TEMPLATE_TEMPLATES # define BOOST_NO_SFINAE # define BOOST_NO_POINTER_TO_MEMBER_TEMPLATE_PARAMETERS # define BOOST_NO_IS_ABSTRACT // TODO: what version is meant here? Have there really been any fixes in cl 12.01 (as e.g. shipped with eVC4)? # if (_MSC_VER > 1200) # define BOOST_NO_MEMBER_FUNCTION_SPECIALIZATIONS # endif #endif #if _MSC_VER < 1310 // 1310 == VC++ 7.1 # define BOOST_NO_SWPRINTF #endif #if _MSC_VER <= 1400 // 1400 == VC++ 8.0 # define BOOST_NO_MEMBER_TEMPLATE_FRIENDS #endif #ifndef _NATIVE_WCHAR_T_DEFINED # define BOOST_NO_INTRINSIC_WCHAR_T #endif #ifdef _WIN32_WCE # define BOOST_NO_THREADEX # define BOOST_NO_GETSYSTEMTIMEASFILETIME #endif // // check for exception handling support: #ifndef _CPPUNWIND # define BOOST_NO_EXCEPTIONS #endif // // __int64 support: // #if (_MSC_VER >= 1200) # define BOOST_HAS_MS_INT64 #endif #if (_MSC_VER >= 1310) && defined(_MSC_EXTENSIONS) # define BOOST_HAS_LONG_LONG #endif // // disable Win32 API's if compiler extentions are // turned off: // #ifndef _MSC_EXTENSIONS # define BOOST_DISABLE_WIN32 #endif // // all versions support __declspec: // #define BOOST_HAS_DECLSPEC // // prefix and suffix headers: // #ifndef BOOST_ABI_PREFIX # define BOOST_ABI_PREFIX "boost/config/abi/msvc_prefix.hpp" #endif #ifndef BOOST_ABI_SUFFIX # define BOOST_ABI_SUFFIX "boost/config/abi/msvc_suffix.hpp" #endif // TODO: // these things are mostly bogus. 1200 means version 12.0 of the compiler. The // artificial versions assigned to them only refer to the versions of some IDE // these compilers have been shipped with, and even that is not all of it. Some // were shipped with freely downloadable SDKs, others as crosscompilers in eVC. // IOW, you can't use these 'versions' in any sensible way. Sorry. # if defined(UNDER_CE) # if _MSC_VER < 1200 // Note: these are so far off, they are not really supported # elif _MSC_VER < 1300 // eVC++ 4 comes with 1200-1202 # define BOOST_COMPILER_VERSION evc4.0 # error unknown CE compiler # else # error unknown CE compiler # endif # else # if _MSC_VER < 1200 // Note: these are so far off, they are not really supported # define BOOST_COMPILER_VERSION 5.0 # elif _MSC_VER < 1300 # define BOOST_COMPILER_VERSION 6.0 # elif _MSC_VER == 1300 # define BOOST_COMPILER_VERSION 7.0 # elif _MSC_VER == 1310 # define BOOST_COMPILER_VERSION 7.1 # elif _MSC_VER == 1400 # define BOOST_COMPILER_VERSION 8.0 # else # define BOOST_COMPILER_VERSION _MSC_VER # endif # endif #define BOOST_COMPILER "Microsoft Visual C++ version " BOOST_STRINGIZE(BOOST_COMPILER_VERSION) // // versions check: // we don't support Visual C++ prior to version 6: #if _MSC_VER < 1200 #error "Compiler not supported or configured - please reconfigure" #endif // // last known and checked version is 1400 (VC8): #if (_MSC_VER > 1400) # if defined(BOOST_ASSERT_CONFIG) # error "Unknown compiler version - please run the configure tests and report the results" # else # pragma message("Unknown compiler version - please run the configure tests and report the results") # endif #endif wxformbuilder-3.1.59/src/boost/config/compiler/sunpro_cc.hpp0000644000175000017500000000601611143440027024453 0ustar rrmulderrrmulder// (C) Copyright John Maddock 2001. // (C) Copyright Jens Maurer 2001 - 2003. // (C) Copyright Peter Dimov 2002. // (C) Copyright Aleksey Gurtovoy 2002 - 2003. // (C) Copyright David Abrahams 2002. // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org for most recent version. // Sun C++ compiler setup: # if __SUNPRO_CC <= 0x500 # define BOOST_NO_MEMBER_TEMPLATES # define BOOST_NO_FUNCTION_TEMPLATE_ORDERING # endif # if (__SUNPRO_CC <= 0x520) // // Sunpro 5.2 and earler: // // although sunpro 5.2 supports the syntax for // inline initialization it often gets the value // wrong, especially where the value is computed // from other constants (J Maddock 6th May 2001) # define BOOST_NO_INCLASS_MEMBER_INITIALIZATION // Although sunpro 5.2 supports the syntax for // partial specialization, it often seems to // bind to the wrong specialization. Better // to disable it until suppport becomes more stable // (J Maddock 6th May 2001). # define BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION # endif # if (__SUNPRO_CC <= 0x530) // Requesting debug info (-g) with Boost.Python results // in an internal compiler error for "static const" // initialized in-class. // >> Assertion: (../links/dbg_cstabs.cc, line 611) // while processing ../test.cpp at line 0. // (Jens Maurer according to Gottfried Ganauge 04 Mar 2002) # define BOOST_NO_INCLASS_MEMBER_INITIALIZATION // SunPro 5.3 has better support for partial specialization, // but breaks when compiling std::less > // (Jens Maurer 4 Nov 2001). // std::less specialization fixed as reported by George // Heintzelman; partial specialization re-enabled // (Peter Dimov 17 Jan 2002) //# define BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION // integral constant expressions with 64 bit numbers fail # define BOOST_NO_INTEGRAL_INT64_T # endif # if (__SUNPRO_CC < 0x570) # define BOOST_NO_TEMPLATE_TEMPLATES // see http://lists.boost.org/MailArchives/boost/msg47184.php // and http://lists.boost.org/MailArchives/boost/msg47220.php # define BOOST_NO_INCLASS_MEMBER_INITIALIZATION # define BOOST_NO_SFINAE # define BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS # define BOOST_NO_IS_ABSTRACT # endif #define BOOST_COMPILER "Sun compiler version " BOOST_STRINGIZE(__SUNPRO_CC) // // versions check: // we don't support sunpro prior to version 4: #if __SUNPRO_CC < 0x400 #error "Compiler not supported or configured - please reconfigure" #endif // // last known and checked version is 0x570: #if (__SUNPRO_CC > 0x570) # if defined(BOOST_ASSERT_CONFIG) # error "Unknown compiler version - please run the configure tests and report the results" # endif #endif wxformbuilder-3.1.59/src/boost/config/compiler/mpw.hpp0000644000175000017500000000311611143440027023261 0ustar rrmulderrrmulder// (C) Copyright John Maddock 2001 - 2002. // (C) Copyright Aleksey Gurtovoy 2002. // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org for most recent version. // MPW C++ compilers setup: # if defined(__SC__) # define BOOST_COMPILER "MPW SCpp version " BOOST_STRINGIZE(__SC__) # elif defined(__MRC__) # define BOOST_COMPILER "MPW MrCpp version " BOOST_STRINGIZE(__MRC__) # else # error "Using MPW compiler configuration by mistake. Please update." # endif // // MPW 8.90: // #if (MPW_CPLUS <= 0x890) || !defined(BOOST_STRICT_CONFIG) # define BOOST_NO_CV_SPECIALIZATIONS # define BOOST_NO_DEPENDENT_NESTED_DERIVATIONS # define BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS # define BOOST_NO_INCLASS_MEMBER_INITIALIZATION # define BOOST_NO_INTRINSIC_WCHAR_T # define BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION # define BOOST_NO_USING_TEMPLATE # define BOOST_NO_CWCHAR # define BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS # define BOOST_NO_STD_ALLOCATOR /* actually a bug with const reference overloading */ #endif // // versions check: // we don't support MPW prior to version 8.9: #if MPW_CPLUS < 0x890 # error "Compiler not supported or configured - please reconfigure" #endif // // last known and checked version is 0x890: #if (MPW_CPLUS > 0x890) # if defined(BOOST_ASSERT_CONFIG) # error "Unknown compiler version - please run the configure tests and report the results" # endif #endif wxformbuilder-3.1.59/src/boost/config/compiler/greenhills.hpp0000644000175000017500000000145711143440027024620 0ustar rrmulderrrmulder// (C) Copyright John Maddock 2001. // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org for most recent version. // Greenhills C++ compiler setup: #define BOOST_COMPILER "Greenhills C++ version " BOOST_STRINGIZE(__ghs) #include "boost/config/compiler/common_edg.hpp" // // versions check: // we don't support Greenhills prior to version 0: #if __ghs < 0 # error "Compiler not supported or configured - please reconfigure" #endif // // last known and checked version is 0: #if (__ghs > 0) # if defined(BOOST_ASSERT_CONFIG) # error "Unknown compiler version - please run the configure tests and report the results" # endif #endif wxformbuilder-3.1.59/src/boost/config/compiler/hp_acc.hpp0000644000175000017500000000410711143440027023674 0ustar rrmulderrrmulder// (C) Copyright John Maddock 2001 - 2003. // (C) Copyright Jens Maurer 2001 - 2003. // (C) Copyright Aleksey Gurtovoy 2002. // (C) Copyright David Abrahams 2002 - 2003. // (C) Copyright Toon Knapen 2003. // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org for most recent version. // HP aCC C++ compiler setup: #if (__HP_aCC <= 33100) # define BOOST_NO_INTEGRAL_INT64_T # define BOOST_NO_OPERATORS_IN_NAMESPACE # if !defined(_NAMESPACE_STD) # define BOOST_NO_STD_LOCALE # define BOOST_NO_STRINGSTREAM # endif #endif #if (__HP_aCC <= 33300) // member templates are sufficiently broken that we disable them for now # define BOOST_NO_MEMBER_TEMPLATES # define BOOST_NO_DEPENDENT_NESTED_DERIVATIONS # define BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE #endif #if (__HP_aCC <= 33900) || !defined(BOOST_STRICT_CONFIG) # define BOOST_NO_UNREACHABLE_RETURN_DETECTION # define BOOST_NO_TEMPLATE_TEMPLATES # define BOOST_NO_SWPRINTF # define BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS # define BOOST_NO_IS_ABSTRACT // std lib config should set this one already: //# define BOOST_NO_STD_ALLOCATOR #endif // optional features rather than defects: #if (__HP_aCC >= 33900) # define BOOST_HAS_LONG_LONG # define BOOST_HAS_PARTIAL_STD_ALLOCATOR #endif #if (__HP_aCC >= 50000 ) && (__HP_aCC <= 53800 ) || (__HP_aCC < 31300 ) # define BOOST_NO_MEMBER_TEMPLATE_KEYWORD #endif #define BOOST_NO_MEMBER_TEMPLATE_FRIENDS #define BOOST_COMPILER "HP aCC version " BOOST_STRINGIZE(__HP_aCC) // // versions check: // we don't support HP aCC prior to version 0: #if __HP_aCC < 33000 # error "Compiler not supported or configured - please reconfigure" #endif // // last known and checked version is 0: #if (__HP_aCC > 53800) # if defined(BOOST_ASSERT_CONFIG) # error "Unknown compiler version - please run the configure tests and report the results" # endif #endif wxformbuilder-3.1.59/src/boost/config/compiler/compaq_cxx.hpp0000644000175000017500000000077311143440027024626 0ustar rrmulderrrmulder// (C) Copyright John Maddock 2001 - 2003. // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org for most recent version. // Dec Alpha True64 C++ compiler setup: #define BOOST_COMPILER "Dec Alpha True64 " BOOST_STRINGIZE(__DECCXX_VER) #include "boost/config/compiler/common_edg.hpp" // // versions check: // Nothing to do here? wxformbuilder-3.1.59/src/boost/config/compiler/kai.hpp0000644000175000017500000000205011143440027023216 0ustar rrmulderrrmulder// (C) Copyright John Maddock 2001. // (C) Copyright David Abrahams 2002. // (C) Copyright Aleksey Gurtovoy 2002. // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org for most recent version. // Kai C++ compiler setup: #include "boost/config/compiler/common_edg.hpp" # if (__KCC_VERSION <= 4001) || !defined(BOOST_STRICT_CONFIG) // at least on Sun, the contents of is not in namespace std # define BOOST_NO_STDC_NAMESPACE # endif // see also common_edg.hpp which needs a special check for __KCC # if !defined(_EXCEPTIONS) # define BOOST_NO_EXCEPTIONS # endif #define BOOST_COMPILER "Kai C++ version " BOOST_STRINGIZE(__KCC_VERSION) // // last known and checked version is 4001: #if (__KCC_VERSION > 4001) # if defined(BOOST_ASSERT_CONFIG) # error "Unknown compiler version - please run the configure tests and report the results" # endif #endif wxformbuilder-3.1.59/src/boost/config/stdlib/modena.hpp0000644000175000017500000000123411143440027023367 0ustar rrmulderrrmulder// (C) Copyright Jens Maurer 2001. // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org for most recent version. // Modena C++ standard library (comes with KAI C++) #if !defined(MSIPL_COMPILE_H) # include # if !defined(__MSIPL_COMPILE_H) # error "This is not the Modena C++ library!" # endif #endif #ifndef MSIPL_NL_TYPES #define BOOST_NO_STD_MESSAGES #endif #ifndef MSIPL_WCHART #define BOOST_NO_STD_WSTRING #endif #define BOOST_STDLIB "Modena C++ standard library" wxformbuilder-3.1.59/src/boost/config/stdlib/stlport.hpp0000644000175000017500000001452711143440027023644 0ustar rrmulderrrmulder// (C) Copyright John Maddock 2001 - 2002. // (C) Copyright Darin Adler 2001. // (C) Copyright Jens Maurer 2001. // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org for most recent version. // STLPort standard library config: #if !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION) # include # if !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION) # error "This is not STLPort!" # endif #endif // // __STL_STATIC_CONST_INIT_BUG implies BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS // for versions prior to 4.1(beta) // #if (defined(__STL_STATIC_CONST_INIT_BUG) || defined(_STLP_STATIC_CONST_INIT_BUG)) && (__SGI_STL_PORT <= 0x400) # define BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS #endif // // If STLport thinks that there is no partial specialisation, then there is no // std::iterator traits: // #if !(defined(_STLP_CLASS_PARTIAL_SPECIALIZATION) || defined(__STL_CLASS_PARTIAL_SPECIALIZATION)) # define BOOST_NO_STD_ITERATOR_TRAITS #endif // // No new style iostreams on GCC without STLport's iostreams enabled: // #if (defined(__GNUC__) && (__GNUC__ < 3)) && !(defined(__SGI_STL_OWN_IOSTREAMS) || defined(_STLP_OWN_IOSTREAMS)) # define BOOST_NO_STRINGSTREAM #endif // // No new iostreams implies no std::locale, and no std::stringstream: // #if defined(__STL_NO_IOSTREAMS) || defined(__STL_NO_NEW_IOSTREAMS) || defined(_STLP_NO_IOSTREAMS) || defined(_STLP_NO_NEW_IOSTREAMS) # define BOOST_NO_STD_LOCALE # define BOOST_NO_STRINGSTREAM #endif // // If the streams are not native, and we have a "using ::x" compiler bug // then the io stream facets are not available in namespace std:: // #ifdef _STLPORT_VERSION # if !(_STLPORT_VERSION >= 0x500) && !defined(_STLP_OWN_IOSTREAMS) && defined(_STLP_USE_NAMESPACES) && defined(BOOST_NO_USING_TEMPLATE) && !defined(__BORLANDC__) # define BOOST_NO_STD_LOCALE # endif #else # if !defined(__SGI_STL_OWN_IOSTREAMS) && defined(__STL_USE_NAMESPACES) && defined(BOOST_NO_USING_TEMPLATE) && !defined(__BORLANDC__) # define BOOST_NO_STD_LOCALE # endif #endif // // Without member template support enabled, their are no template // iterate constructors, and no std::allocator: // #if !(defined(__STL_MEMBER_TEMPLATES) || defined(_STLP_MEMBER_TEMPLATES)) # define BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS # define BOOST_NO_STD_ALLOCATOR #endif // // however we always have at least a partial allocator: // #define BOOST_HAS_PARTIAL_STD_ALLOCATOR #if !defined(_STLP_MEMBER_TEMPLATE_CLASSES) || defined(_STLP_DONT_SUPPORT_REBIND_MEMBER_TEMPLATE) # define BOOST_NO_STD_ALLOCATOR #endif #if defined(_STLP_NO_MEMBER_TEMPLATE_KEYWORD) && defined(BOOST_MSVC) && (BOOST_MSVC <= 1300) # define BOOST_NO_STD_ALLOCATOR #endif // // If STLport thinks there is no wchar_t at all, then we have to disable // the support for the relevant specilazations of std:: templates. // #if !defined(_STLP_HAS_WCHAR_T) && !defined(_STLP_WCHAR_T_IS_USHORT) # ifndef BOOST_NO_STD_WSTRING # define BOOST_NO_STD_WSTRING # endif # ifndef BOOST_NO_STD_WSTREAMBUF # define BOOST_NO_STD_WSTREAMBUF # endif #endif // // We always have SGI style hash_set, hash_map, and slist: // #define BOOST_HAS_HASH #define BOOST_HAS_SLIST // // STLport does a good job of importing names into namespace std::, // but doesn't always get them all, define BOOST_NO_STDC_NAMESPACE, since our // workaround does not conflict with STLports: // // // Harold Howe says: // Borland switched to STLport in BCB6. Defining BOOST_NO_STDC_NAMESPACE with // BCB6 does cause problems. If we detect C++ Builder, then don't define // BOOST_NO_STDC_NAMESPACE // #if !defined(__BORLANDC__) && !defined(__DMC__) // // If STLport is using it's own namespace, and the real names are in // the global namespace, then we duplicate STLport's using declarations // (by defining BOOST_NO_STDC_NAMESPACE), we do this because STLport doesn't // necessarily import all the names we need into namespace std:: // # if (defined(__STL_IMPORT_VENDOR_CSTD) \ || defined(__STL_USE_OWN_NAMESPACE) \ || defined(_STLP_IMPORT_VENDOR_CSTD) \ || defined(_STLP_USE_OWN_NAMESPACE)) \ && (defined(__STL_VENDOR_GLOBAL_CSTD) || defined (_STLP_VENDOR_GLOBAL_CSTD)) # define BOOST_NO_STDC_NAMESPACE # define BOOST_NO_EXCEPTION_STD_NAMESPACE # endif #elif defined(__BORLANDC__) && __BORLANDC__ < 0x560 // STLport doesn't import std::abs correctly: #include namespace std { using ::abs; } // and strcmp/strcpy don't get imported either ('cos they are macros) #include #ifdef strcpy # undef strcpy #endif #ifdef strcmp # undef strcmp #endif #ifdef _STLP_VENDOR_CSTD namespace std{ using _STLP_VENDOR_CSTD::strcmp; using _STLP_VENDOR_CSTD::strcpy; } #endif #endif // // std::use_facet may be non-standard, uses a class instead: // #if defined(__STL_NO_EXPLICIT_FUNCTION_TMPL_ARGS) || defined(_STLP_NO_EXPLICIT_FUNCTION_TMPL_ARGS) # define BOOST_NO_STD_USE_FACET # define BOOST_HAS_STLP_USE_FACET #endif // // If STLport thinks there are no wide functions, etc. is not working; but // only if BOOST_NO_STDC_NAMESPACE is not defined (if it is then we do the import // into std:: ourselves). // #if defined(_STLP_NO_NATIVE_WIDE_FUNCTIONS) && !defined(BOOST_NO_STDC_NAMESPACE) # define BOOST_NO_CWCHAR # define BOOST_NO_CWCTYPE #endif // // If STLport for some reason was configured so that it thinks that wchar_t // is not an intrinsic type, then we have to disable the support for it as // well (we would be missing required specializations otherwise). // #if !defined( _STLP_HAS_WCHAR_T) || defined(_STLP_WCHAR_T_IS_USHORT) # undef BOOST_NO_INTRINSIC_WCHAR_T # define BOOST_NO_INTRINSIC_WCHAR_T #endif // // Borland ships a version of STLport with C++ Builder 6 that lacks // hashtables and the like: // #if defined(__BORLANDC__) && (__BORLANDC__ == 0x560) # undef BOOST_HAS_HASH #endif // // gcc-2.95.3/STLPort does not like the using declarations we use to get ADL with std::min/max // #if defined(__GNUC__) && (__GNUC__ < 3) # include // for std::min and std::max # define BOOST_USING_STD_MIN() ((void)0) # define BOOST_USING_STD_MAX() ((void)0) namespace boost { using std::min; using std::max; } #endif #define BOOST_STDLIB "STLPort standard library version " BOOST_STRINGIZE(__SGI_STL_PORT) wxformbuilder-3.1.59/src/boost/config/stdlib/vacpp.hpp0000644000175000017500000000074411143440027023242 0ustar rrmulderrrmulder// (C) Copyright John Maddock 2001 - 2002. // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org for most recent version. #if __IBMCPP__ <= 501 # define BOOST_NO_STD_ALLOCATOR #endif #define BOOST_HAS_MACRO_USE_FACET #define BOOST_NO_STD_MESSAGES #define BOOST_STDLIB "Visual Age default standard library" wxformbuilder-3.1.59/src/boost/config/stdlib/libstdcpp3.hpp0000644000175000017500000000431411143440027024175 0ustar rrmulderrrmulder// (C) Copyright John Maddock 2001. // (C) Copyright Jens Maurer 2001. // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org for most recent version. // config for libstdc++ v3 // not much to go in here: #ifdef __GLIBCXX__ #define BOOST_STDLIB "GNU libstdc++ version " BOOST_STRINGIZE(__GLIBCXX__) #else #define BOOST_STDLIB "GNU libstdc++ version " BOOST_STRINGIZE(__GLIBCPP__) #endif #if !defined(_GLIBCPP_USE_WCHAR_T) && !defined(_GLIBCXX_USE_WCHAR_T) # define BOOST_NO_CWCHAR # define BOOST_NO_CWCTYPE # define BOOST_NO_STD_WSTRING # define BOOST_NO_STD_WSTREAMBUF #endif #if defined(__osf__) && !defined(_REENTRANT) \ && ( defined(_GLIBCXX_HAVE_GTHR_DEFAULT) || defined(_GLIBCPP_HAVE_GTHR_DEFAULT) ) // GCC 3 on Tru64 forces the definition of _REENTRANT when any std lib header // file is included, therefore for consistency we define it here as well. # define _REENTRANT #endif #ifdef __GLIBCXX__ // gcc 3.4 and greater: # if defined(_GLIBCXX_HAVE_GTHR_DEFAULT) \ || defined(_GLIBCXX__PTHREADS) // // If the std lib has thread support turned on, then turn it on in Boost // as well. We do this because some gcc-3.4 std lib headers define _REENTANT // while others do not... // # define BOOST_HAS_THREADS # else # define BOOST_DISABLE_THREADS # endif #elif defined(__GLIBCPP__) \ && !defined(_GLIBCPP_HAVE_GTHR_DEFAULT) \ && !defined(_GLIBCPP__PTHREADS) // disable thread support if the std lib was built single threaded: # define BOOST_DISABLE_THREADS #endif #if (defined(linux) || defined(__linux) || defined(__linux__)) && defined(__arm__) && defined(_GLIBCPP_HAVE_GTHR_DEFAULT) // linux on arm apparently doesn't define _REENTRANT // so just turn on threading support whenever the std lib is thread safe: # define BOOST_HAS_THREADS #endif #if !defined(_GLIBCPP_USE_LONG_LONG) \ && !defined(_GLIBCXX_USE_LONG_LONG)\ && defined(BOOST_HAS_LONG_LONG) // May have been set by compiler/*.hpp, but "long long" without library // support is useless. # undef BOOST_HAS_LONG_LONG #endif wxformbuilder-3.1.59/src/boost/config/stdlib/sgi.hpp0000644000175000017500000000606611143440027022716 0ustar rrmulderrrmulder// (C) Copyright John Maddock 2001 - 2003. // (C) Copyright Darin Adler 2001. // (C) Copyright Jens Maurer 2001 - 2003. // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org for most recent version. // generic SGI STL: #if !defined(__STL_CONFIG_H) # include # if !defined(__STL_CONFIG_H) # error "This is not the SGI STL!" # endif #endif // // No std::iterator traits without partial specialisation: // #if !defined(__STL_CLASS_PARTIAL_SPECIALIZATION) # define BOOST_NO_STD_ITERATOR_TRAITS #endif // // No std::stringstream with gcc < 3 // #if defined(__GNUC__) && (__GNUC__ < 3) && \ ((__GNUC_MINOR__ < 95) || (__GNUC_MINOR__ == 96)) && \ !defined(__STL_USE_NEW_IOSTREAMS) || \ defined(__APPLE_CC__) // Note that we only set this for GNU C++ prior to 2.95 since the // latest patches for that release do contain a minimal // If you are running a 2.95 release prior to 2.95.3 then this will need // setting, but there is no way to detect that automatically (other // than by running the configure script). // Also, the unofficial GNU C++ 2.96 included in RedHat 7.1 doesn't // have . # define BOOST_NO_STRINGSTREAM #endif // // Assume no std::locale without own iostreams (this may be an // incorrect assumption in some cases): // #if !defined(__SGI_STL_OWN_IOSTREAMS) && !defined(__STL_USE_NEW_IOSTREAMS) # define BOOST_NO_STD_LOCALE #endif // // Original native SGI streams have non-standard std::messages facet: // #if defined(__sgi) && (_COMPILER_VERSION <= 650) && !defined(__SGI_STL_OWN_IOSTREAMS) # define BOOST_NO_STD_LOCALE #endif // // SGI's new iostreams have missing "const" in messages<>::open // #if defined(__sgi) && (_COMPILER_VERSION <= 740) && defined(__STL_USE_NEW_IOSTREAMS) # define BOOST_NO_STD_MESSAGES #endif // // No template iterator constructors, or std::allocator // without member templates: // #if !defined(__STL_MEMBER_TEMPLATES) # define BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS # define BOOST_NO_STD_ALLOCATOR #endif // // We always have SGI style hash_set, hash_map, and slist: // #define BOOST_HAS_HASH #define BOOST_HAS_SLIST // // If this is GNU libstdc++2, then no and no std::wstring: // #if (defined(__GNUC__) && (__GNUC__ < 3)) # include # if defined(__BASTRING__) # define BOOST_NO_LIMITS // Note: will provide compile-time constants # undef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS # define BOOST_NO_STD_WSTRING # endif #endif // // There is no standard iterator unless we have namespace support: // #if !defined(__STL_USE_NAMESPACES) # define BOOST_NO_STD_ITERATOR #endif // // Intrinsic type_traits support. // The SGI STL has it's own __type_traits class, which // has intrinsic compiler support with SGI's compilers. // Whatever map SGI style type traits to boost equivalents: // #define BOOST_HAS_SGI_TYPE_TRAITS #define BOOST_STDLIB "SGI standard library" wxformbuilder-3.1.59/src/boost/config/stdlib/libcomo.hpp0000644000175000017500000000236111143440027023552 0ustar rrmulderrrmulder// (C) Copyright John Maddock 2002 - 2003. // (C) Copyright Jens Maurer 2002 - 2003. // (C) Copyright Beman Dawes 2002 - 2003. // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org for most recent version. // Comeau STL: #if !defined(__LIBCOMO__) # include # if !defined(__LIBCOMO__) # error "This is not the Comeau STL!" # endif #endif // // std::streambuf is non-standard // NOTE: versions of libcomo prior to beta28 have octal version numbering, // e.g. version 25 is 21 (dec) #if __LIBCOMO_VERSION__ <= 22 # define BOOST_NO_STD_WSTREAMBUF #endif #if (__LIBCOMO_VERSION__ <= 31) && defined(_WIN32) #define BOOST_NO_SWPRINTF #endif #if __LIBCOMO_VERSION__ >= 31 # define BOOST_HAS_HASH # define BOOST_HAS_SLIST #endif // // Intrinsic type_traits support. // The SGI STL has it's own __type_traits class, which // has intrinsic compiler support with SGI's compilers. // Whatever map SGI style type traits to boost equivalents: // #define BOOST_HAS_SGI_TYPE_TRAITS #define BOOST_STDLIB "Comeau standard library " BOOST_STRINGIZE(__LIBCOMO_VERSION__) wxformbuilder-3.1.59/src/boost/config/stdlib/dinkumware.hpp0000644000175000017500000000700511143440027024274 0ustar rrmulderrrmulder// (C) Copyright John Maddock 2001 - 2003. // (C) Copyright Jens Maurer 2001. // (C) Copyright Peter Dimov 2001. // (C) Copyright David Abrahams 2002. // (C) Copyright Guillaume Melquiond 2003. // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org for most recent version. // Dinkumware standard library config: #if !defined(_YVALS) && !defined(_CPPLIB_VER) #include #if !defined(_YVALS) && !defined(_CPPLIB_VER) #error This is not the Dinkumware lib! #endif #endif #if defined(_CPPLIB_VER) && (_CPPLIB_VER >= 306) // full dinkumware 3.06 and above // fully conforming provided the compiler supports it: # if !(defined(_GLOBAL_USING) && (_GLOBAL_USING+0 > 0)) && !defined(__BORLANDC__) && !defined(_STD) && !(defined(__ICC) && (__ICC >= 700)) // can be defined in yvals.h # define BOOST_NO_STDC_NAMESPACE # endif # if !(defined(_HAS_MEMBER_TEMPLATES_REBIND) && (_HAS_MEMBER_TEMPLATES_REBIND+0 > 0)) && !(defined(_MSC_VER) && (_MSC_VER > 1300)) && defined(BOOST_MSVC) # define BOOST_NO_STD_ALLOCATOR # endif # define BOOST_HAS_PARTIAL_STD_ALLOCATOR # if defined(BOOST_MSVC) && (BOOST_MSVC < 1300) // if this lib version is set up for vc6 then there is no std::use_facet: # define BOOST_NO_STD_USE_FACET # define BOOST_HAS_TWO_ARG_USE_FACET // C lib functions aren't in namespace std either: # define BOOST_NO_STDC_NAMESPACE // and nor is # define BOOST_NO_EXCEPTION_STD_NAMESPACE # endif // There's no numeric_limits support unless _LONGLONG is defined: # if !defined(_LONGLONG) && (_CPPLIB_VER <= 310) # define BOOST_NO_MS_INT64_NUMERIC_LIMITS # endif // 3.06 appears to have (non-sgi versions of) & , // and no at all #else # define BOOST_MSVC_STD_ITERATOR 1 # define BOOST_NO_STD_ITERATOR # define BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS # define BOOST_NO_STD_ALLOCATOR # define BOOST_NO_STDC_NAMESPACE # define BOOST_NO_STD_USE_FACET # define BOOST_NO_STD_OUTPUT_ITERATOR_ASSIGN # define BOOST_HAS_MACRO_USE_FACET # ifndef _CPPLIB_VER // Updated Dinkum library defines this, and provides // its own min and max definitions. # define BOOST_NO_STD_MIN_MAX # define BOOST_NO_MS_INT64_NUMERIC_LIMITS # endif #endif // // std extension namespace is stdext for vc7.1 and later, // the same applies to other compilers that sit on top // of vc7.1 (Intel and Comeau): // #if defined(_MSC_VER) && (_MSC_VER >= 1310) && !defined(__BORLANDC__) # define BOOST_STD_EXTENSION_NAMESPACE stdext #endif #if (defined(_MSC_VER) && (_MSC_VER <= 1300) && !defined(__BORLANDC__)) || !defined(_CPPLIB_VER) || (_CPPLIB_VER < 306) // if we're using a dinkum lib that's // been configured for VC6/7 then there is // no iterator traits (true even for icl) # define BOOST_NO_STD_ITERATOR_TRAITS #endif #if defined(__ICL) && (__ICL < 800) && defined(_CPPLIB_VER) && (_CPPLIB_VER <= 310) // Intel C++ chokes over any non-trivial use of // this may be an overly restrictive define, but regex fails without it: # define BOOST_NO_STD_LOCALE #endif #ifdef _CPPLIB_VER # define BOOST_DINKUMWARE_STDLIB _CPPLIB_VER #else # define BOOST_DINKUMWARE_STDLIB 1 #endif #ifdef _CPPLIB_VER # define BOOST_STDLIB "Dinkumware standard library version " BOOST_STRINGIZE(_CPPLIB_VER) #else # define BOOST_STDLIB "Dinkumware standard library version 1.x" #endif wxformbuilder-3.1.59/src/boost/config/stdlib/roguewave.hpp0000644000175000017500000000737211143440027024141 0ustar rrmulderrrmulder// (C) Copyright John Maddock 2001 - 2003. // (C) Copyright Jens Maurer 2001. // (C) Copyright David Abrahams 2003. // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org for most recent version. // Rogue Wave std lib: #if !defined(__STD_RWCOMPILER_H__) && !defined(_RWSTD_VER) # include # if !defined(__STD_RWCOMPILER_H__) && !defined(_RWSTD_VER) # error This is not the Rogue Wave standard library # endif #endif // // figure out a consistent version number: // #ifndef _RWSTD_VER # define BOOST_RWSTD_VER 0x010000 #elif _RWSTD_VER < 0x010000 # define BOOST_RWSTD_VER (_RWSTD_VER << 8) #else # define BOOST_RWSTD_VER _RWSTD_VER #endif #ifndef _RWSTD_VER # define BOOST_STDLIB "Rogue Wave standard library version (Unknown version)" #else # define BOOST_STDLIB "Rogue Wave standard library version " BOOST_STRINGIZE(_RWSTD_VER) #endif // // Prior to version 2.2.0 the primary template for std::numeric_limits // does not have compile time constants, even though specializations of that // template do: // #if BOOST_RWSTD_VER < 0x020200 # define BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS #endif // Sun CC 5.5 patch 113817-07 adds long long specialization, but does not change the // library version number (http://sunsolve6.sun.com/search/document.do?assetkey=1-21-113817): #if BOOST_RWSTD_VER <= 0x020101 && (!defined(__SUNPRO_CC) || (__SUNPRO_CC < 0x550)) # define BOOST_NO_LONG_LONG_NUMERIC_LIMITS # endif // // Borland version of numeric_limits lacks __int64 specialisation: // #ifdef __BORLANDC__ # define BOOST_NO_MS_INT64_NUMERIC_LIMITS #endif // // No std::iterator if it can't figure out default template args: // #if defined(_RWSTD_NO_SIMPLE_DEFAULT_TEMPLATES) || defined(RWSTD_NO_SIMPLE_DEFAULT_TEMPLATES) || (BOOST_RWSTD_VER < 0x020000) # define BOOST_NO_STD_ITERATOR #endif // // No iterator traits without partial specialization: // #if defined(_RWSTD_NO_CLASS_PARTIAL_SPEC) || defined(RWSTD_NO_CLASS_PARTIAL_SPEC) # define BOOST_NO_STD_ITERATOR_TRAITS #endif // // Prior to version 2.0, std::auto_ptr was buggy, and there were no // new-style iostreams, and no conformant std::allocator: // #if (BOOST_RWSTD_VER < 0x020000) # define BOOST_NO_AUTO_PTR # define BOOST_NO_STRINGSTREAM # define BOOST_NO_STD_ALLOCATOR # define BOOST_NO_STD_LOCALE #endif // // No template iterator constructors without member template support: // #if defined(RWSTD_NO_MEMBER_TEMPLATES) || defined(_RWSTD_NO_MEMBER_TEMPLATES) # define BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS #endif // // RW defines _RWSTD_ALLOCATOR if the allocator is conformant and in use // (the or _HPACC_ part is a hack - the library seems to define _RWSTD_ALLOCATOR // on HP aCC systems even though the allocator is in fact broken): // #if !defined(_RWSTD_ALLOCATOR) || (defined(__HP_aCC) && __HP_aCC <= 33100) # define BOOST_NO_STD_ALLOCATOR #endif // // If we have a std::locale, we still may not have std::use_facet: // #if defined(_RWSTD_NO_TEMPLATE_ON_RETURN_TYPE) && !defined(BOOST_NO_STD_LOCALE) # define BOOST_NO_STD_USE_FACET # define BOOST_HAS_TWO_ARG_USE_FACET #endif // // There's no std::distance prior to version 2, or without // partial specialization support: // #if (BOOST_RWSTD_VER < 0x020000) || defined(_RWSTD_NO_CLASS_PARTIAL_SPEC) #define BOOST_NO_STD_DISTANCE #endif // // Some versions of the rogue wave library don't have assignable // OutputIterators: // #if BOOST_RWSTD_VER < 0x020100 # define BOOST_NO_STD_OUTPUT_ITERATOR_ASSIGN #endif // // Disable BOOST_HAS_LONG_LONG when the library has no support for it. // #if !defined(_RWSTD_LONG_LONG) && defined(BOOST_HAS_LONG_LONG) # undef BOOST_HAS_LONG_LONG #endif wxformbuilder-3.1.59/src/boost/config/stdlib/msl.hpp0000644000175000017500000000237011143440027022721 0ustar rrmulderrrmulder// (C) Copyright John Maddock 2001. // (C) Copyright Darin Adler 2001. // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org for most recent version. // Metrowerks standard library: #ifndef __MSL_CPP__ # include # ifndef __MSL_CPP__ # error This is not the MSL standard library! # endif #endif #if __MSL_CPP__ >= 0x6000 // Pro 6 # define BOOST_HAS_HASH # define BOOST_STD_EXTENSION_NAMESPACE Metrowerks #endif #define BOOST_HAS_SLIST #if __MSL_CPP__ < 0x6209 # define BOOST_NO_STD_MESSAGES #endif // check C lib version for #include #if defined(__MSL__) && (__MSL__ >= 0x5000) # define BOOST_HAS_STDINT_H # if !defined(__PALMOS_TRAPS__) # define BOOST_HAS_UNISTD_H # endif // boilerplate code: # include #endif #if defined(_MWMT) || _MSL_THREADSAFE # define BOOST_HAS_THREADS #endif #ifdef _MSL_NO_EXPLICIT_FUNC_TEMPLATE_ARG # define BOOST_NO_STD_USE_FACET # define BOOST_HAS_TWO_ARG_USE_FACET #endif #define BOOST_STDLIB "Metrowerks Standard Library version " BOOST_STRINGIZE(__MSL_CPP__) wxformbuilder-3.1.59/src/controls/src/propgrid/extras.cpp0000644000175000017500000000116211143440027024031 0ustar rrmulderrrmulder///////////////////////////////////////////////////////////////////////////// // Name: extras.cpp // Purpose: wxPropertyGrid Extras // Author: Jaakko Salli // Modified by: // Created: Mar-05-2006 // RCS-ID: $Id: // Copyright: (c) Jaakko Salli // Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// // // In wxPython version this file will have additional property and // editor control source code. // // For compilers that support precompilation, includes "wx/wx.h". #include "wx/wxprec.h" #ifdef __BORLANDC__ #pragma hdrstop #endif wxformbuilder-3.1.59/src/controls/src/propgrid/odcombo.cpp0000644000175000017500000031553611143440027024162 0ustar rrmulderrrmulder///////////////////////////////////////////////////////////////////////////// // Name: odcombo.cpp // Purpose: wxPGOwnerDrawnComboBox and related classes implementation // Author: Jaakko Salli // Modified by: // Created: Jan-25-2005 // RCS-ID: $Id: // Copyright: (c) 2005 Jaakko Salli // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// // ============================================================================ // declarations // ============================================================================ // ---------------------------------------------------------------------------- // headers // ---------------------------------------------------------------------------- #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "odcombo.h" #endif #include "wx/wxprec.h" #ifdef __BORLANDC__ #pragma hdrstop #endif #if wxUSE_COMBOBOX #ifndef WX_PRECOMP #include "wx/app.h" #include "wx/log.h" #include "wx/button.h" #include "wx/combobox.h" #include "wx/textctrl.h" #include "wx/dcclient.h" #include "wx/settings.h" #include "wx/dialog.h" #endif #include "wx/dcbuffer.h" #include "wx/tooltip.h" #include "wx/timer.h" #if defined(__WXMSW__) && !defined(__WXUNIVERSAL__) #include "wx/msw/uxtheme.h" #endif #include "wx/propgrid/odcombo.h" // // THESE GO TO BASE FILE // #define BMP_BUTTON_MARGIN 4 //#define DEFAULT_POPUP_HEIGHT -1 #define DEFAULT_POPUP_HEIGHT 300 #define DEFAULT_TEXT_INDENT 3 #if defined(__WXMSW__) #define ALLOW_FAKE_POPUP 0 // Use only on plats with problems with wxPopupWindow #define USE_TRANSIENT_POPUP 1 // Use wxPopupWindowTransient (preferred, if it works properly on platform) //#undef wxUSE_POPUPWIN //#define wxUSE_POPUPWIN 0 #elif defined(__WXGTK__) // Fake popup windows cause focus problems on GTK2 (but enable on GTK1.2, just in case) #if defined(__WXGTK20__) #define ALLOW_FAKE_POPUP 0 // Use only on plats with problems with wxPopupWindow #else #define ALLOW_FAKE_POPUP 1 // Use only on plats with problems with wxPopupWindow #endif #define USE_TRANSIENT_POPUP 1 // Use wxPopupWindowTransient (preferred, if it works properly on platform) #elif defined(__WXMAC__) #define ALLOW_FAKE_POPUP 1 // Use only on plats with problems with wxPopupWindow #define USE_TRANSIENT_POPUP 0 // Use wxPopupWindowTransient (preferred, if it works properly on platform) #else #define ALLOW_FAKE_POPUP 1 // Use only on plats with problems with wxPopupWindow #define USE_TRANSIENT_POPUP 0 // Use wxPopupWindowTransient (preferred, if it works properly on platform) #endif // Popupwin is really only supported on wxMSW (not WINCE) and wxGTK, regardless // what the wxUSE_POPUPWIN says. #if (!defined(__WXMSW__) && !defined(__WXGTK__)) || defined(__WXWINCE__) #undef wxUSE_POPUPWIN #define wxUSE_POPUPWIN 0 #endif #if wxUSE_POPUPWIN #include "wx/popupwin.h" #else #undef USE_TRANSIENT_POPUP #define USE_TRANSIENT_POPUP 0 #endif // For versions < 2.6.2, don't enable transient popup. There may be // problems I don't have time to test properly. #if !wxCHECK_VERSION(2, 6, 2) #undef USE_TRANSIENT_POPUP #define USE_TRANSIENT_POPUP 0 #endif #if USE_TRANSIENT_POPUP #undef ALLOW_FAKE_POPUP #define ALLOW_FAKE_POPUP 0 #define wxPGComboPopupWindowBase wxPopupTransientWindow #define INSTALL_TOPLEV_HANDLER 0 #elif wxUSE_POPUPWIN #define wxPGComboPopupWindowBase wxPopupWindow #define INSTALL_TOPLEV_HANDLER 1 #else #define wxPGComboPopupWindowBase wxDialog #if !ALLOW_FAKE_POPUP #define INSTALL_TOPLEV_HANDLER 0 // Doesn't need since can monitor active event #else #define INSTALL_TOPLEV_HANDLER 1 #endif #endif // // THESE GO TO GENERIC FILE // // Some adjustments to make the generic more bearable #if defined(__WXUNIVERSAL__) #define TEXTCTRLXADJUST 0 // position adjustment for wxTextCtrl, with zero indent #define TEXTCTRLYADJUST 0 #define TEXTXADJUST 0 // how much is read-only text's x adjusted #define DEFAULT_DROPBUTTON_WIDTH 19 #elif defined(__WXMSW__) #define TEXTCTRLXADJUST 2 // position adjustment for wxTextCtrl, with zero indent #define TEXTCTRLYADJUST 3 #define TEXTXADJUST 0 // how much is read-only text's x adjusted #define DEFAULT_DROPBUTTON_WIDTH 17 #elif defined(__WXGTK__) #define TEXTCTRLXADJUST -1 // position adjustment for wxTextCtrl, with zero indent #define TEXTCTRLYADJUST 0 #define TEXTXADJUST 1 // how much is read-only text's x adjusted #define DEFAULT_DROPBUTTON_WIDTH 23 #elif defined(__WXMAC__) #define TEXTCTRLXADJUST 0 // position adjustment for wxTextCtrl, with zero indent #define TEXTCTRLYADJUST 0 #define TEXTXADJUST 0 // how much is read-only text's x adjusted #define DEFAULT_DROPBUTTON_WIDTH 19 #else #define TEXTCTRLXADJUST 0 // position adjustment for wxTextCtrl, with zero indent #define TEXTCTRLYADJUST 0 #define TEXTXADJUST 0 // how much is read-only text's x adjusted #define DEFAULT_DROPBUTTON_WIDTH 19 #endif // constants // ---------------------------------------------------------------------------- // TO BASE // the margin between the text control and the combo button static const wxCoord g_comboMargin = 2; // ---------------------------------------------------------------------------- // wxPGComboFrameEventHandler takes care of hiding the popup when events happen // in its top level parent. // ---------------------------------------------------------------------------- #if INSTALL_TOPLEV_HANDLER // // This will no longer be necessary after wxTransientPopupWindow // works well on all platforms. // class wxPGComboFrameEventHandler : public wxEvtHandler { public: wxPGComboFrameEventHandler( wxPGComboControlBase* pCb ); ~wxPGComboFrameEventHandler(); void OnPopup(); void OnIdle( wxIdleEvent& event ); void OnMouseEvent( wxMouseEvent& event ); void OnActivate( wxActivateEvent& event ); void OnResize( wxSizeEvent& event ); void OnMove( wxMoveEvent& event ); void OnMenuEvent( wxMenuEvent& event ); void OnClose( wxCloseEvent& event ); protected: wxWindow* m_focusStart; wxPGComboControlBase* m_combo; private: DECLARE_EVENT_TABLE() }; BEGIN_EVENT_TABLE(wxPGComboFrameEventHandler, wxEvtHandler) EVT_IDLE(wxPGComboFrameEventHandler::OnIdle) EVT_LEFT_DOWN(wxPGComboFrameEventHandler::OnMouseEvent) EVT_RIGHT_DOWN(wxPGComboFrameEventHandler::OnMouseEvent) EVT_SIZE(wxPGComboFrameEventHandler::OnResize) EVT_MOVE(wxPGComboFrameEventHandler::OnMove) EVT_MENU_HIGHLIGHT(wxID_ANY,wxPGComboFrameEventHandler::OnMenuEvent) EVT_MENU_OPEN(wxPGComboFrameEventHandler::OnMenuEvent) EVT_ACTIVATE(wxPGComboFrameEventHandler::OnActivate) EVT_CLOSE(wxPGComboFrameEventHandler::OnClose) END_EVENT_TABLE() wxPGComboFrameEventHandler::wxPGComboFrameEventHandler( wxPGComboControlBase* combo ) : wxEvtHandler() { m_combo = combo; } wxPGComboFrameEventHandler::~wxPGComboFrameEventHandler() { } void wxPGComboFrameEventHandler::OnPopup() { m_focusStart = ::wxWindow::FindFocus(); } void wxPGComboFrameEventHandler::OnIdle( wxIdleEvent& event ) { wxWindow* winFocused = ::wxWindow::FindFocus(); wxWindow* popup = m_combo->GetPopupControl(); wxWindow* winpopup = m_combo->GetPopupWindow(); if ( winFocused != m_focusStart && winFocused != popup && winFocused->GetParent() != popup && winFocused != winpopup && winFocused->GetParent() != winpopup && winFocused != m_combo && winFocused != m_combo->GetButton() // GTK (atleast) requires this ) { m_combo->HidePopup(); } event.Skip(); } void wxPGComboFrameEventHandler::OnMenuEvent( wxMenuEvent& event ) { m_combo->HidePopup(); event.Skip(); } void wxPGComboFrameEventHandler::OnMouseEvent( wxMouseEvent& event ) { m_combo->HidePopup(); event.Skip(); } void wxPGComboFrameEventHandler::OnClose( wxCloseEvent& event ) { m_combo->HidePopup(); event.Skip(); } void wxPGComboFrameEventHandler::OnActivate( wxActivateEvent& event ) { m_combo->HidePopup(); event.Skip(); } void wxPGComboFrameEventHandler::OnResize( wxSizeEvent& event ) { m_combo->HidePopup(); event.Skip(); } void wxPGComboFrameEventHandler::OnMove( wxMoveEvent& event ) { m_combo->HidePopup(); event.Skip(); } #endif // INSTALL_TOPLEV_HANDLER // ---------------------------------------------------------------------------- // wxPGComboPopupWindow is wxPopupWindow customized for // wxComboControl. // ---------------------------------------------------------------------------- class wxPGComboPopupWindow : public wxPGComboPopupWindowBase { public: wxPGComboPopupWindow( wxPGComboControlBase *parent, int style = wxBORDER_NONE ); #if USE_TRANSIENT_POPUP virtual bool ProcessLeftDown(wxMouseEvent& event); #endif void OnKeyEvent(wxKeyEvent& event); void OnMouseEvent( wxMouseEvent& event ); #if !wxUSE_POPUPWIN void OnActivate( wxActivateEvent& event ); #endif protected: #if USE_TRANSIENT_POPUP virtual void OnDismiss(); #endif private: DECLARE_EVENT_TABLE() }; BEGIN_EVENT_TABLE(wxPGComboPopupWindow, wxPGComboPopupWindowBase) EVT_MOUSE_EVENTS(wxPGComboPopupWindow::OnMouseEvent) #if !wxUSE_POPUPWIN EVT_ACTIVATE(wxPGComboPopupWindow::OnActivate) #endif EVT_KEY_DOWN(wxPGComboPopupWindow::OnKeyEvent) EVT_KEY_UP(wxPGComboPopupWindow::OnKeyEvent) END_EVENT_TABLE() wxPGComboPopupWindow::wxPGComboPopupWindow( wxPGComboControlBase *parent, int style ) #if wxUSE_POPUPWIN : wxPGComboPopupWindowBase(parent,style) #else : wxPGComboPopupWindowBase(parent, wxID_ANY, wxEmptyString, wxPoint(-21,-21), wxSize(20,20), style) #endif { } void wxPGComboPopupWindow::OnKeyEvent( wxKeyEvent& event ) { // Relay keyboard event to the main child controls // (just skipping may just cause the popup to close) wxWindowList children = GetChildren(); wxWindowList::iterator node = children.begin(); wxWindow* child = (wxWindow*)*node; child->AddPendingEvent(event); } void wxPGComboPopupWindow::OnMouseEvent( wxMouseEvent& event ) { event.Skip(); } #if !wxUSE_POPUPWIN void wxPGComboPopupWindow::OnActivate( wxActivateEvent& event ) { if ( !event.GetActive() ) { // Tell combo control that we are dismissed. wxPGComboControl* combo = (wxPGComboControl*) GetParent(); wxASSERT( combo ); wxASSERT( combo->IsKindOf(CLASSINFO(wxPGComboControl)) ); combo->HidePopup(); event.Skip(); } } #endif #if USE_TRANSIENT_POPUP bool wxPGComboPopupWindow::ProcessLeftDown(wxMouseEvent& event ) { return wxPGComboPopupWindowBase::ProcessLeftDown(event); } #endif #if USE_TRANSIENT_POPUP // First thing that happens when a transient popup closes is that this method gets called. void wxPGComboPopupWindow::OnDismiss() { wxPGComboControlBase* combo = (wxPGComboControlBase*) GetParent(); wxASSERT ( combo->IsKindOf(CLASSINFO(wxPGComboControlBase)) ); combo->OnPopupDismiss(); } #endif // ---------------------------------------------------------------------------- // wxPGComboPopup methods // // ---------------------------------------------------------------------------- wxPGComboPopup::~wxPGComboPopup() { } void wxPGComboPopup::OnPopup() { } void wxPGComboPopup::OnDismiss() { } wxSize wxPGComboPopup::GetAdjustedSize( int minWidth, int prefHeight, int WXUNUSED(maxHeight) ) { return wxSize(minWidth,prefHeight); } void wxPGComboPopup::PaintComboControl( wxDC& dc, const wxRect& rect ) { if ( m_combo->GetWindowStyle() & wxCB_READONLY ) // ie. no textctrl { m_combo->DrawFocusBackground(dc,rect,0); dc.DrawText( GetStringValue(), rect.x + m_combo->GetTextIndent(), (rect.height-dc.GetCharHeight())/2 + m_combo->m_widthCustomBorder ); } } void wxPGComboPopup::OnComboKeyEvent( wxKeyEvent& event ) { event.Skip(); } void wxPGComboPopup::OnComboDoubleClick() { } void wxPGComboPopup::SetStringValue( const wxString& WXUNUSED(value) ) { } bool wxPGComboPopup::LazyCreate() { return false; } void wxPGComboPopup::Dismiss() { m_combo->HidePopup(); } // ---------------------------------------------------------------------------- // wxPGVListBoxComboPopup is a wxVListBox customized to act as a popup control // // ---------------------------------------------------------------------------- BEGIN_EVENT_TABLE(wxPGVListBoxComboPopup, wxVListBox) EVT_MOTION(wxPGVListBoxComboPopup::OnMouseMove) EVT_KEY_DOWN(wxPGVListBoxComboPopup::OnKey) EVT_LEFT_UP(wxPGVListBoxComboPopup::OnLeftClick) END_EVENT_TABLE() wxPGVListBoxComboPopup::wxPGVListBoxComboPopup(wxPGComboControl* combo) : wxVListBox(), wxPGComboPopup(combo) { //m_callback = callback; m_widestWidth = 0; m_avgCharWidth = 0; m_baseImageWidth = 0; m_itemHeight = 0; m_value = -1; m_itemHover = -1; m_clientDataItemsType = wxClientData_None; } bool wxPGVListBoxComboPopup::Create(wxWindow* parent) { if ( !wxVListBox::Create(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxBORDER_SIMPLE | wxLB_INT_HEIGHT | wxWANTS_CHARS) ) return false; m_font = m_combo->GetFont(); wxVListBox::SetItemCount(m_strings.GetCount()); // TODO: Move this to SetFont m_itemHeight = GetCharHeight() + 0; return true; } wxPGVListBoxComboPopup::~wxPGVListBoxComboPopup() { Clear(); } bool wxPGVListBoxComboPopup::LazyCreate() { // NB: There is a bug with wxVListBox that can be avoided by creating // it later (bug causes empty space to be shown if initial selection // is at the end of a list longer than the control can show at once). return true; } // paint the control itself void wxPGVListBoxComboPopup::PaintComboControl( wxDC& dc, const wxRect& rect ) { if ( !(m_combo->GetWindowStyle() & wxODCB_STD_CONTROL_PAINT) ) { m_combo->DrawFocusBackground(dc,rect,0); if ( m_combo->OnDrawListItem(dc,rect,m_value,wxPGCC_PAINTING_CONTROL) ) return; } wxPGComboPopup::PaintComboControl(dc,rect); } void wxPGVListBoxComboPopup::OnDrawItem( wxDC& dc, const wxRect& rect, size_t n) const { dc.SetFont(m_font); bool isHilited = wxVListBox::GetSelection() == (int) n; // Set correct text colour for selected items // (must always set the correct colour - atleast GTK may have lost it // in between calls). if ( isHilited ) dc.SetTextForeground( wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT) ); else dc.SetTextForeground( wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT) ); if ( !m_combo->OnDrawListItem(dc,rect,(int)n,0) ) dc.DrawText( GetString(n), rect.x + 2, rect.y ); } wxCoord wxPGVListBoxComboPopup::OnMeasureItem(size_t n) const { int itemHeight = m_combo->OnMeasureListItem(n); if ( itemHeight < 0 ) itemHeight = m_itemHeight; return itemHeight; } void wxPGVListBoxComboPopup::OnDrawBackground(wxDC& dc, const wxRect& rect, size_t n) const { // we need to render selected and current items differently if ( IsCurrent(n) ) { m_combo->DrawFocusBackground( dc, rect, wxCONTROL_ISSUBMENU|wxCONTROL_SELECTED ); } //else: do nothing for the normal items } void wxPGVListBoxComboPopup::DismissWithEvent() { int selection = wxVListBox::GetSelection(); Dismiss(); if ( selection != wxNOT_FOUND ) m_stringValue = m_strings[selection]; else m_stringValue = wxEmptyString; if ( m_stringValue != m_combo->GetValue() ) m_combo->SetValue(m_stringValue); m_value = selection; SendComboBoxEvent(selection); } void wxPGVListBoxComboPopup::SendComboBoxEvent( int selection ) { wxCommandEvent evt(wxEVT_COMMAND_COMBOBOX_SELECTED,m_combo->GetId()); evt.SetEventObject(m_combo); evt.SetInt(selection); // Set client data, if any if ( selection >= 0 && (int)m_clientDatas.GetCount() > selection ) { void* clientData = m_clientDatas[selection]; if ( m_clientDataItemsType == wxClientData_Object ) evt.SetClientObject((wxClientData*)clientData); else evt.SetClientData(clientData); } m_combo->GetEventHandler()->AddPendingEvent(evt); } // returns true if key was consumed bool wxPGVListBoxComboPopup::HandleKey( int keycode, bool saturate ) { int value = m_value; int itemCount = GetCount(); if ( keycode == WXK_DOWN || keycode == WXK_RIGHT ) { value++; } else if ( keycode == WXK_UP || keycode == WXK_LEFT ) { value--; } else if ( keycode == WXK_PAGEDOWN ) { value+=10; } else if ( keycode == WXK_PAGEUP ) { value-=10; } /* else if ( keycode == WXK_END ) { value = itemCount-1; } else if ( keycode == WXK_HOME ) { value = 0; } */ else return false; if ( saturate ) { if ( value >= itemCount ) value = itemCount - 1; else if ( value < 0 ) value = 0; } else { if ( value >= itemCount ) value -= itemCount; else if ( value < 0 ) value += itemCount; } if ( value == m_value ) // Even if value was same, don't skip the event // (good for consistency) return true; m_value = value; wxString valStr; if ( value >= 0 ) m_combo->SetValue(m_strings[value]); SendComboBoxEvent(m_value); return true; } void wxPGVListBoxComboPopup::OnComboDoubleClick() { // Cycle on dclick (disable saturation to allow true cycling). if ( !::wxGetKeyState(WXK_SHIFT) ) HandleKey(WXK_DOWN,false); else HandleKey(WXK_UP,false); } void wxPGVListBoxComboPopup::OnComboKeyEvent( wxKeyEvent& event ) { // Saturated key movement on if ( !HandleKey(event.GetKeyCode(),true) ) event.Skip(); } void wxPGVListBoxComboPopup::OnPopup() { // *must* set value after size is set (this is because of a vlbox bug) wxVListBox::SetSelection(m_value); } void wxPGVListBoxComboPopup::OnMouseMove(wxMouseEvent& event) { // Move selection to cursor if it is inside the popup int itemHere = GetItemAtPosition(event.GetPosition()); if ( itemHere >= 0 ) wxVListBox::SetSelection(itemHere); event.Skip(); } void wxPGVListBoxComboPopup::OnLeftClick(wxMouseEvent& WXUNUSED(event)) { DismissWithEvent(); } void wxPGVListBoxComboPopup::OnKey(wxKeyEvent& event) { // Select item if ENTER is pressed if ( event.GetKeyCode() == WXK_RETURN || event.GetKeyCode() == WXK_NUMPAD_ENTER ) { DismissWithEvent(); } // Hide popup if ESC is pressed else if ( event.GetKeyCode() == WXK_ESCAPE ) Dismiss(); else event.Skip(); } void wxPGVListBoxComboPopup::CheckWidth( int pos ) { wxCoord x = m_combo->OnMeasureListItemWidth(pos); if ( x < 0 ) { if ( !m_font.Ok() ) m_font = m_combo->GetFont(); wxCoord y; m_combo->GetTextExtent(m_strings[pos], &x, &y, 0, 0, &m_font); x += 4; } if ( m_widestWidth < x ) { m_widestWidth = x; } } void wxPGVListBoxComboPopup::Insert( const wxString& item, int pos ) { // Need to change selection? wxString strValue; if ( !(m_combo->GetWindowStyle() & wxCB_READONLY) && m_combo->GetValue() == item ) m_value = pos; else if ( m_value >= pos ) m_value++; m_strings.Insert(item,pos); if ( IsCreated() ) wxVListBox::SetItemCount( wxVListBox::GetItemCount()+1 ); // Calculate width CheckWidth(pos); } int wxPGVListBoxComboPopup::Append(const wxString& item) { int pos = (int)m_strings.GetCount(); if ( m_combo->GetWindowStyle() & wxCB_SORT ) { // Find position // TODO: Could be optimized with binary search wxArrayString strings = m_strings; unsigned int i; for ( i=0; i n ) return m_clientDatas[n]; return NULL; } void wxPGVListBoxComboPopup::Delete( wxODCIndex item ) { // Remove client data, if set if ( m_clientDatas.GetCount() ) { if ( m_clientDataItemsType == wxClientData_Object ) delete (wxClientData*) m_clientDatas[item]; m_clientDatas.RemoveAt(item); } m_strings.RemoveAt(item); int sel = GetSelection(); if ( IsCreated() ) wxVListBox::SetItemCount( wxVListBox::GetItemCount()-1 ); if ( (int)item < sel ) SetSelection(sel-1); else if ( (int)item == sel ) SetSelection(wxNOT_FOUND); } int wxPGVListBoxComboPopup::FindString(const wxString& s) const { return m_strings.Index(s); } wxODCCount wxPGVListBoxComboPopup::GetCount() const { return m_strings.GetCount(); } wxString wxPGVListBoxComboPopup::GetString( int item ) const { return m_strings[item]; } void wxPGVListBoxComboPopup::SetString( int item, const wxString& str ) { m_strings[item] = str; } wxString wxPGVListBoxComboPopup::GetStringValue() const { return m_stringValue; } void wxPGVListBoxComboPopup::SetSelection( int item ) { // This seems to be necessary (2.5.3 w/ MingW atleast) if ( item < -1 || item >= (int)m_strings.GetCount() ) item = -1; m_value = item; if ( item >= 0 ) m_stringValue = m_strings[item]; else m_stringValue = wxEmptyString; if ( IsCreated() ) wxVListBox::SetSelection(item); } int wxPGVListBoxComboPopup::GetSelection() const { return m_value; } void wxPGVListBoxComboPopup::SetStringValue( const wxString& value ) { int index = m_strings.Index(value); m_stringValue = value; if ( index >= 0 && index < (int)wxVListBox::GetItemCount() ) { wxVListBox::SetSelection(index); m_value = index; } } wxSize wxPGVListBoxComboPopup::GetAdjustedSize( int minWidth, int prefHeight, int maxHeight ) { int height = 250; if ( m_strings.GetCount() ) { if ( prefHeight > 0 ) height = prefHeight; if ( height > maxHeight ) height = maxHeight; int totalHeight = GetTotalHeight(); // + 3; if ( height >= totalHeight ) { height = totalHeight; } else { // Adjust height to a multiple of the height of the first item // NB: Calculations that take variable height into account // are unnecessary. int fih = GetLineHeight(0); int shown = height/fih; height = shown * fih; } } else height = 50; #if defined(__WXMAC__) // Set a minimum height since otherwise scrollbars won't draw properly height = wxMax(50, height); #endif // Take scrollbar into account in width calculations int widestWidth = m_widestWidth + wxSystemSettings::GetMetric(wxSYS_VSCROLL_X); return wxSize(minWidth > widestWidth ? minWidth : widestWidth, height+2); } void wxPGVListBoxComboPopup::Populate( int n, const wxString choices[] ) { int i; for ( i=0; iGetWindowStyle() & wxCB_SORT ) m_strings.Sort(); // Find initial selection wxString strValue = m_combo->GetValue(); if ( strValue.Length() ) m_value = m_strings.Index(strValue); } // ---------------------------------------------------------------------------- // input handling // ---------------------------------------------------------------------------- // // This is pushed to the event handler queue of either combo box // or its textctrl (latter if not readonly combo). // class wxPGComboBoxTextCtrlHandler : public wxEvtHandler { public: wxPGComboBoxTextCtrlHandler( wxPGComboControlBase* combo ) : wxEvtHandler() { m_combo = combo; } ~wxPGComboBoxTextCtrlHandler() { } void OnKey(wxKeyEvent& event); void OnFocus(wxFocusEvent& event); protected: wxPGComboControlBase* m_combo; private: DECLARE_EVENT_TABLE() }; BEGIN_EVENT_TABLE(wxPGComboBoxTextCtrlHandler, wxEvtHandler) EVT_KEY_DOWN(wxPGComboBoxTextCtrlHandler::OnKey) EVT_SET_FOCUS(wxPGComboBoxTextCtrlHandler::OnFocus) END_EVENT_TABLE() void wxPGComboBoxTextCtrlHandler::OnKey(wxKeyEvent& event) { // Let the wxComboCtrl event handler have a go first. wxPGComboControlBase* combo = m_combo; wxObject* prevObj = event.GetEventObject(); event.SetId(combo->GetId()); event.SetEventObject(combo); combo->GetEventHandler()->ProcessEvent(event); event.SetId(((wxWindow*)prevObj)->GetId()); event.SetEventObject(prevObj); } void wxPGComboBoxTextCtrlHandler::OnFocus(wxFocusEvent& event) { // FIXME: This code does run when control is clicked, // yet on Windows it doesn't select all the text. if ( !(m_combo->GetInternalFlags() & wxPGCC_NO_TEXT_AUTO_SELECT) ) { if ( m_combo->GetTextCtrl() ) m_combo->GetTextCtrl()->SelectAll(); else m_combo->SetSelection(-1,-1); } // Send focus indication to parent. // NB: This is needed for cases where the textctrl gets focus // instead of its parent. We'll check if the focus came from // in order to prevent a possible infinite recursion. if ( m_combo->ConsumingTextCtrlFocusEvent() ) { wxFocusEvent evt2(wxEVT_SET_FOCUS,m_combo->GetId()); evt2.SetEventObject(m_combo); m_combo->GetEventHandler()->ProcessEvent(evt2); } event.Skip(); } // // This is pushed to the event handler queue of the control in popup. // class wxPGComboPopupExtraEventHandler : public wxEvtHandler { public: wxPGComboPopupExtraEventHandler( wxPGComboControlBase* combo ) : wxEvtHandler() { m_combo = combo; m_beenInside = false; } ~wxPGComboPopupExtraEventHandler() { } void OnMouseEvent( wxMouseEvent& event ); // Called from wxPGComboControlBase::OnPopupDismiss void OnPopupDismiss() { m_beenInside = false; } protected: wxPGComboControlBase* m_combo; bool m_beenInside; private: DECLARE_EVENT_TABLE() }; BEGIN_EVENT_TABLE(wxPGComboPopupExtraEventHandler, wxEvtHandler) EVT_MOUSE_EVENTS(wxPGComboPopupExtraEventHandler::OnMouseEvent) END_EVENT_TABLE() void wxPGComboPopupExtraEventHandler::OnMouseEvent( wxMouseEvent& event ) { wxPoint pt = event.GetPosition(); wxSize sz = m_combo->GetPopupControl()->GetClientSize(); int evtType = event.GetEventType(); bool isInside = pt.x >= 0 && pt.y >= 0 && pt.x < sz.x && pt.y < sz.y; if ( evtType == wxEVT_MOTION || evtType == wxEVT_LEFT_DOWN || evtType == wxEVT_RIGHT_DOWN ) { // Block motion and click events outside the popup if ( !isInside ) { event.Skip(false); return; } } else if ( evtType == wxEVT_LEFT_UP ) { // Don't let left-down events in if outside if ( evtType == wxEVT_LEFT_DOWN ) { if ( !isInside ) return; } if ( !m_beenInside ) { if ( isInside ) { m_beenInside = true; } else { // // Some mouse events to popup that happen outside it, before cursor // has been inside the popu, need to be ignored by it but relayed to // the dropbutton. // wxWindow* btn = m_combo->GetButton(); if ( btn ) btn->GetEventHandler()->AddPendingEvent(event); else m_combo->GetEventHandler()->AddPendingEvent(event); return; } event.Skip(); } } event.Skip(); } // ---------------------------------------------------------------------------- // wxPGComboControlBase // ---------------------------------------------------------------------------- BEGIN_EVENT_TABLE(wxPGComboControlBase, wxControl) EVT_TEXT(wxID_ANY,wxPGComboControlBase::OnTextCtrlEvent) EVT_SIZE(wxPGComboControlBase::OnSizeEvent) EVT_KEY_DOWN(wxPGComboControlBase::OnKeyEvent) EVT_SET_FOCUS(wxPGComboControlBase::OnFocusEvent) EVT_KILL_FOCUS(wxPGComboControlBase::OnFocusEvent) //EVT_BUTTON(wxID_ANY,wxPGComboControlBase::OnButtonClickEvent) EVT_TEXT_ENTER(wxID_ANY,wxPGComboControlBase::OnTextCtrlEvent) EVT_SYS_COLOUR_CHANGED(wxPGComboControlBase::OnSysColourChanged) END_EVENT_TABLE() IMPLEMENT_ABSTRACT_CLASS(wxPGComboControlBase, wxControl) // Have global double buffer - should be enough for multiple combos static wxBitmap* gs_doubleBuffer = (wxBitmap*) NULL; void wxPGComboControlBase::Init() { m_winPopup = (wxWindow *)NULL; m_popup = (wxWindow *)NULL; m_isPopupShown = false; m_btn = (wxWindow*) NULL; m_text = (wxTextCtrl*) NULL; m_popupInterface = (wxPGComboPopup*) NULL; m_popupExtraHandler = (wxEvtHandler*) NULL; m_textEvtHandler = (wxEvtHandler*) NULL; #if INSTALL_TOPLEV_HANDLER m_toplevEvtHandler = (wxEvtHandler*) NULL; #endif m_heightPopup = -1; m_widthMinPopup = -1; m_widthCustomPaint = 0; m_widthCustomBorder = 0; m_btnState = 0; m_btnWidDefault = 0; m_blankButtonBg = false; m_btnWid = m_btnHei = 0; m_btnSide = wxRIGHT; m_btnSpacingX = 0; m_extLeft = 0; m_extRight = 0; m_absIndent = -1; m_iFlags = 0; m_fakePopupUsage = 0; m_skipTextCtrlFocusEvents = 0; m_timeCanAcceptClick = 0; } bool wxPGComboControlBase::Create(wxWindow *parent, wxWindowID id, const wxString& value, const wxPoint& pos, const wxSize& size, long style, const wxValidator& validator, const wxString& name) { if ( !wxControl::Create(parent, id, pos, size, style | wxWANTS_CHARS, validator, name) ) return false; m_valueString = value; // Get colours OnThemeChange(); m_absIndent = GetNativeTextIndent(); return true; } void wxPGComboControlBase::InstallInputHandlers() { if ( m_text ) { m_textEvtHandler = new wxPGComboBoxTextCtrlHandler(this); m_text->PushEventHandler(m_textEvtHandler); } } void wxPGComboControlBase::CreateTextCtrl( int extraStyle, const wxValidator& validator ) { if ( !(m_windowStyle & wxCB_READONLY) ) { m_text = new wxTextCtrl(this, 12345, m_valueString, wxDefaultPosition, wxDefaultSize, // wxTE_PROCESS_TAB is needed because on Windows, wxTAB_TRAVERSAL is // not used by the wxPropertyGrid and therefore the tab is // processed by looking at ancestors to see if they have // wxTAB_TRAVERSAL. The navigation event is then sent to // the wrong window. wxTE_PROCESS_TAB | wxTE_PROCESS_ENTER | //wxWANTS_CHARS | extraStyle, validator); #if defined(__WXMSW__) && !defined(__WXWINCE__) ::SendMessage(GetHwndOf(m_text), EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELONG(3, 3)); #endif // This is required for some platforms (GTK+ atleast) m_text->SetSizeHints(2,4); } } void wxPGComboControlBase::OnThemeChange() { SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW)); } bool wxPGComboControlBase::Destroy() { return wxControl::Destroy(); } wxPGComboControlBase::~wxPGComboControlBase() { if ( HasCapture() ) ReleaseMouse(); HidePopup(); delete gs_doubleBuffer; gs_doubleBuffer = (wxBitmap*) NULL; #if INSTALL_TOPLEV_HANDLER delete ((wxPGComboFrameEventHandler*)m_toplevEvtHandler); m_toplevEvtHandler = (wxEvtHandler*) NULL; #endif if ( m_popup ) m_popup->RemoveEventHandler(m_popupExtraHandler); delete m_popupExtraHandler; delete m_popupInterface; delete m_winPopup; if ( m_text ) m_text->RemoveEventHandler(m_textEvtHandler); delete m_textEvtHandler; } // ---------------------------------------------------------------------------- // geometry stuff // ---------------------------------------------------------------------------- // Recalculates button and textctrl areas void wxPGComboControlBase::CalculateAreas( int btnWidth ) { wxSize sz = GetClientSize(); int customBorder = m_widthCustomBorder; bool buttonOutside; int btnBorder; // border for button only if ( ( (m_iFlags & wxPGCC_BUTTON_OUTSIDE_BORDER) || m_blankButtonBg ) && m_btnSpacingX == 0 && m_btnWid == 0 && m_btnHei == 0 && (!m_bmpNormal.Ok() || m_blankButtonBg) ) { buttonOutside = true; m_iFlags |= wxPGCC_IFLAG_BUTTON_OUTSIDE; btnBorder = 0; } else { buttonOutside = false; m_iFlags &= ~(wxPGCC_IFLAG_BUTTON_OUTSIDE); btnBorder = customBorder; } // Defaul indentation if ( m_absIndent < 0 ) m_absIndent = GetNativeTextIndent(); int butWidth = btnWidth; if ( butWidth <= 0 ) butWidth = m_btnWidDefault; else m_btnWidDefault = butWidth; if ( butWidth <= 0 ) return; // Adjust button width if ( m_btnWid < 0 ) butWidth += m_btnWid; else if ( m_btnWid > 0 ) butWidth = m_btnWid; int butHeight = sz.y; butHeight -= btnBorder*2; // Adjust button height if ( m_btnHei < 0 ) butHeight += m_btnHei; else if ( m_btnHei > 0 ) butHeight = m_btnHei; // Use size of normal bitmap if... // It is larger // OR // button width is set to default and blank button bg is not drawn if ( m_bmpNormal.Ok() ) { int bmpReqWidth = m_bmpNormal.GetWidth(); int bmpReqHeight = m_bmpNormal.GetHeight(); // If drawing blank button background, we need to add some margin. if ( m_blankButtonBg ) { bmpReqWidth += BMP_BUTTON_MARGIN*2; bmpReqHeight += BMP_BUTTON_MARGIN*2; } if ( butWidth < bmpReqWidth || ( m_btnWid == 0 && !m_blankButtonBg ) ) butWidth = bmpReqWidth; if ( butHeight < bmpReqHeight || ( m_btnHei == 0 && !m_blankButtonBg ) ) butHeight = bmpReqHeight; // Need to fix height? if ( (sz.y-(customBorder*2)) < butHeight && btnWidth == 0 ) { int newY = butHeight+(customBorder*2); SetClientSize(-1,newY); sz.y = newY; } } int butAreaWid = butWidth + (m_btnSpacingX*2); m_btnSize.x = butWidth; m_btnSize.y = butHeight; m_btnArea.x = ( m_btnSide==wxRIGHT ? sz.x - butAreaWid - btnBorder : btnBorder ); m_btnArea.y = btnBorder; m_btnArea.width = butAreaWid; m_btnArea.height = sz.y - (btnBorder*2); if ( m_bmpNormal.Ok() || m_btnArea.width != butWidth || m_btnArea.height != butHeight ) m_iFlags |= wxPGCC_IFLAG_HAS_NONSTANDARD_BUTTON; else m_iFlags &= ~wxPGCC_IFLAG_HAS_NONSTANDARD_BUTTON; m_tcArea.x = ( m_btnSide==wxRIGHT ? 0 : butAreaWid ) + customBorder; m_tcArea.y = customBorder; m_tcArea.width = sz.x - butAreaWid - (customBorder*2); m_tcArea.height = sz.y - (customBorder*2); /* if ( m_text ) { ::wxMessageBox(wxString::Format(wxT("ButtonArea (%i,%i,%i,%i)\n"),m_btnArea.x,m_btnArea.y,m_btnArea.width,m_btnArea.height) + wxString::Format(wxT("TextCtrlArea (%i,%i,%i,%i)"),m_tcArea.x,m_tcArea.y,m_tcArea.width,m_tcArea.height)); } */ } void wxPGComboControlBase::PositionTextCtrl( int textCtrlXAdjust, int textCtrlYAdjust ) { if ( !m_text ) return; wxSize sz = GetClientSize(); int customBorder = m_widthCustomBorder; if ( (m_text->GetWindowStyleFlag() & wxBORDER_MASK) == wxNO_BORDER ) { // Centre textctrl int tcSizeY = m_text->GetBestSize().y; int diff = sz.y - tcSizeY; int y = textCtrlYAdjust + (diff/2); if ( y < customBorder ) y = customBorder; m_text->SetSize( m_tcArea.x + m_widthCustomPaint + m_absIndent + textCtrlXAdjust, y, m_tcArea.width - g_comboMargin - (textCtrlXAdjust + m_widthCustomPaint + m_absIndent), -1 ); // Make sure textctrl doesn't exceed the bottom custom border wxSize tsz = m_text->GetSize(); diff = (y + tsz.y) - (sz.y - customBorder); if ( diff >= 0 ) { tsz.y = tsz.y - diff - 1; m_text->SetSize(tsz); } } else { m_text->SetSize( m_tcArea.x, 0, sz.x - m_btnArea.x - m_widthCustomPaint - customBorder, sz.y ); } } wxSize wxPGComboControlBase::DoGetBestSize() const { wxSize sizeText(150,0); if ( m_text ) sizeText = m_text->GetBestSize(); // TODO: Better method to calculate close-to-native control height. int fhei; if ( m_font.Ok() ) fhei = (m_font.GetPointSize()*2) + 5; else if ( wxNORMAL_FONT->Ok() ) fhei = (wxNORMAL_FONT->GetPointSize()*2) + 5; else fhei = sizeText.y + 4; // Need to force height to accomodate bitmap? int btnSizeY = m_btnSize.y; if ( m_bmpNormal.Ok() && fhei < btnSizeY ) fhei = btnSizeY; // Control height doesn't depend on border /* // Add border int border = m_windowStyle & wxBORDER_MASK; if ( border == wxSIMPLE_BORDER ) fhei += 2; else if ( border == wxNO_BORDER ) fhei += (m_widthCustomBorder*2); else // Sunken etc. fhei += 4; */ // Final adjustments #ifdef __WXGTK__ fhei += 1; #endif wxSize ret(sizeText.x + g_comboMargin + DEFAULT_DROPBUTTON_WIDTH, fhei); CacheBestSize(ret); return ret; } void wxPGComboControlBase::DoMoveWindow(int x, int y, int width, int height) { // SetSize is called last in create, so it marks the end of creation m_iFlags |= wxPGCC_IFLAG_CREATED; wxControl::DoMoveWindow(x, y, width, height); } void wxPGComboControlBase::OnSizeEvent( wxSizeEvent& event ) { if ( !IsCreated() ) return; // defined by actual wxComboControls OnResize(); event.Skip(); } // ---------------------------------------------------------------------------- // standard operations // ---------------------------------------------------------------------------- bool wxPGComboControlBase::Enable(bool enable) { if ( !wxControl::Enable(enable) ) return false; if ( m_btn ) m_btn->Enable(enable); if ( m_text ) m_text->Enable(enable); return true; } bool wxPGComboControlBase::Show(bool show) { if ( !wxControl::Show(show) ) return false; if (m_btn) m_btn->Show(show); if (m_text) m_text->Show(show); return true; } bool wxPGComboControlBase::SetFont ( const wxFont& font ) { if ( !wxControl::SetFont(font) ) return false; if (m_text) m_text->SetFont(font); return true; } #if wxUSE_TOOLTIPS void wxPGComboControlBase::DoSetToolTip(wxToolTip *tooltip) { wxControl::DoSetToolTip(tooltip); // Set tool tip for button and text box if ( tooltip ) { const wxString &tip = tooltip->GetTip(); if ( m_text ) m_text->SetToolTip(tip); if ( m_btn ) m_btn->SetToolTip(tip); } else { if ( m_text ) m_text->SetToolTip( (wxToolTip*) NULL ); if ( m_btn ) m_btn->SetToolTip( (wxToolTip*) NULL ); } } #endif // wxUSE_TOOLTIPS // ---------------------------------------------------------------------------- // painting // ---------------------------------------------------------------------------- // draw focus background on area in a way typical on platform void wxPGComboControlBase::DrawFocusBackground( wxDC& dc, const wxRect& rect, int flags ) { wxSize sz = GetClientSize(); bool isEnabled; bool doDrawFocusRect; // also selected // For smaller size control (and for disabled background) use less spacing int focusSpacingX; int focusSpacingY; if ( !(flags & wxCONTROL_ISSUBMENU) ) { // Drawing control isEnabled = IsEnabled(); doDrawFocusRect = ShouldDrawFocus(); // Windows-style: for smaller size control (and for disabled background) use less spacing //focusSpacingX = isEnabled ? 2 : 1; focusSpacingX = 1; focusSpacingY = sz.y > (GetCharHeight()+500) && isEnabled ? 2 : 1; } else { // Drawing a list item isEnabled = true; // they are never disabled doDrawFocusRect = flags & wxCONTROL_SELECTED ? true : false; focusSpacingX = 0; focusSpacingY = 0; } // Set the background sub-rectangle for selection, disabled etc wxRect selRect(rect); selRect.y += focusSpacingY; selRect.height -= (focusSpacingY*2); int wcp = 0; if ( !(flags & wxCONTROL_ISSUBMENU) ) wcp += m_widthCustomPaint; selRect.x += wcp + focusSpacingX; selRect.width -= wcp + (focusSpacingX*2); wxColour bgCol; bool doDrawSelRect = true; if ( isEnabled ) { // If popup is hidden and this control is focused, // then draw the focus-indicator (selbgcolor background etc.). if ( doDrawFocusRect ) { dc.SetTextForeground( wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT) ); bgCol = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT); } else { dc.SetTextForeground( wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT) ); bgCol = GetBackgroundColour(); doDrawSelRect = false; } } else { dc.SetTextForeground( wxSystemSettings::GetColour(wxSYS_COLOUR_GRAYTEXT) ); bgCol = GetBackgroundColour(); } dc.SetBrush( bgCol ); if ( doDrawSelRect ) { dc.SetPen( bgCol ); dc.DrawRectangle( selRect ); } } void wxPGComboControlBase::DrawButton( wxDC& dc, const wxRect& rect, int flags ) { int drawState = m_btnState; if ( (m_iFlags & wxPGCC_BUTTON_STAYS_DOWN) && IsPopupShown() ) drawState |= wxCONTROL_PRESSED; wxRect drawRect(rect.x+m_btnSpacingX, rect.y+((rect.height-m_btnSize.y)/2), m_btnSize.x, m_btnSize.y); // Make sure area is not larger than the control if ( drawRect.y < rect.y ) drawRect.y = rect.y; if ( drawRect.height > rect.height ) drawRect.height = rect.height; bool enabled = IsEnabled(); if ( !enabled ) drawState |= wxCONTROL_DISABLED; if ( !m_bmpNormal.Ok() ) { if ( flags & Button_BitmapOnly ) return; // Need to clear button background even if m_btn is present if ( flags & Button_PaintBackground ) { wxColour bgCol; if ( m_iFlags & wxPGCC_IFLAG_BUTTON_OUTSIDE ) bgCol = GetParent()->GetBackgroundColour(); else bgCol = GetBackgroundColour(); dc.SetBrush(bgCol); dc.SetPen(bgCol); dc.DrawRectangle(rect); } // Draw standard button wxRendererNative::Get().DrawComboBoxDropButton(this, dc, drawRect, drawState); } else { // Draw bitmap wxBitmap* pBmp; if ( !enabled ) pBmp = &m_bmpDisabled; else if ( m_btnState & wxCONTROL_PRESSED ) pBmp = &m_bmpPressed; else if ( m_btnState & wxCONTROL_CURRENT ) pBmp = &m_bmpHover; else pBmp = &m_bmpNormal; #if wxCHECK_VERSION(2, 7, 0) if ( m_blankButtonBg ) { // If using blank button background, we need to clear its background // with button face colour instead of colour for rest of the control. if ( flags & Button_PaintBackground ) { wxColour bgCol = GetParent()->GetBackgroundColour(); //wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE); //wxColour bgCol = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW); dc.SetPen(bgCol); dc.SetBrush(bgCol); dc.DrawRectangle(rect); } if ( !(flags & Button_BitmapOnly) ) { wxRendererNative::Get().DrawPushButton(this, dc, drawRect, drawState); } } else #endif { // Need to clear button background even if m_btn is present // (assume non-button background was cleared just before this call so brushes are good) if ( flags & Button_PaintBackground ) dc.DrawRectangle(rect); } // Draw bitmap centered in drawRect dc.DrawBitmap(*pBmp, drawRect.x + (drawRect.width-pBmp->GetWidth())/2, drawRect.y + (drawRect.height-pBmp->GetHeight())/2, true); } } void wxPGComboControlBase::RecalcAndRefresh() { if ( IsCreated() ) { wxSizeEvent evt(GetSize(),GetId()); GetEventHandler()->ProcessEvent(evt); Refresh(); } } bool wxPGComboControlBase::OnDrawListItem( wxDC& WXUNUSED(dc), const wxRect& WXUNUSED(rect), int WXUNUSED(item), int WXUNUSED(flags) ) { return false; // signals caller to make default drawing } wxCoord wxPGComboControlBase::OnMeasureListItem( int WXUNUSED(item) ) { return -1; // signals caller to use default } wxCoord wxPGComboControlBase::OnMeasureListItemWidth( int WXUNUSED(item) ) { return -1; // signals caller to use default } // ---------------------------------------------------------------------------- // miscellaneous event handlers // ---------------------------------------------------------------------------- void wxPGComboControlBase::OnTextCtrlEvent(wxCommandEvent& event) { // Change event id and relay it forward event.SetId(GetId()); event.Skip(); } // call if cursor is on button area or mouse is captured for the button bool wxPGComboControlBase::HandleButtonMouseEvent( wxMouseEvent& event, int flags ) { int type = event.GetEventType(); if ( type == wxEVT_MOTION ) { if ( flags & wxPGCC_MF_ON_BUTTON ) { if ( !(m_btnState & wxCONTROL_CURRENT) ) { // Mouse hover begins m_btnState |= wxCONTROL_CURRENT; if ( HasCapture() ) // Retain pressed state. m_btnState |= wxCONTROL_PRESSED; Refresh(); } } else if ( (m_btnState & wxCONTROL_CURRENT) ) { // Mouse hover ends m_btnState &= ~(wxCONTROL_CURRENT|wxCONTROL_PRESSED); Refresh(); } } else if ( type == wxEVT_LEFT_DOWN ) { // Only accept event if it wasn't right after popup dismiss //if ( ::wxGetLocalTimeMillis() > m_timeCanClick ) { // Need to test this, because it might be outside. if ( flags & wxPGCC_MF_ON_BUTTON ) { m_btnState |= wxCONTROL_PRESSED; Refresh(); if ( !(m_iFlags & wxPGCC_POPUP_ON_MOUSE_UP) ) OnButtonClick(); else // If showing popup now, do not capture mouse or there will be interference CaptureMouse(); } } /*else { m_btnState = 0; }*/ } else if ( type == wxEVT_LEFT_UP ) { // Only accept event if mouse was left-press was previously accepted if ( HasCapture() ) ReleaseMouse(); if ( m_btnState & wxCONTROL_PRESSED ) { // If mouse was inside, fire the click event. if ( m_iFlags & wxPGCC_POPUP_ON_MOUSE_UP ) { if ( flags & wxPGCC_MF_ON_BUTTON ) OnButtonClick(); } m_btnState &= ~(wxCONTROL_PRESSED); Refresh(); } } else if ( type == wxEVT_LEAVE_WINDOW ) { if ( m_btnState & (wxCONTROL_CURRENT|wxCONTROL_PRESSED) ) { m_btnState &= ~(wxCONTROL_CURRENT); // Mouse hover ends if ( !m_isPopupShown ) { m_btnState &= ~(wxCONTROL_PRESSED); Refresh(); } } } else return false; return true; } // Conversion to double-clicks and some basic filtering // returns true if event was consumed or filtered bool wxPGComboControlBase::PreprocessMouseEvent( wxMouseEvent& event, int WXUNUSED(flags) ) { wxLongLong t = ::wxGetLocalTimeMillis(); int evtType = event.GetEventType(); if ( m_isPopupShown && ( evtType == wxEVT_LEFT_DOWN || evtType == wxEVT_RIGHT_DOWN ) ) { HidePopup(); return true; } // // Generate our own double-clicks // (to allow on-focus dc-event on double-clicks instead of triple-clicks) /*if ( (m_windowStyle & wxPGCC_DCLICK_CYCLES) && !m_isPopupShown && //!(handlerFlags & wxPGCC_MF_ON_BUTTON) ) !(flags & wxPGCC_MF_ON_BUTTON) ) { if ( evtType == wxEVT_LEFT_DOWN ) { // Set value to avoid up-events without corresponding downs m_downReceived = true; } else if ( evtType == wxEVT_LEFT_DCLICK ) { // We'll make our own double-clicks //evtType = 0; event.SetEventType(0); return true; } else if ( evtType == wxEVT_LEFT_UP ) { if ( m_downReceived || m_timeLastMouseUp == 1 ) { wxLongLong timeFromLastUp = (t-m_timeLastMouseUp); if ( timeFromLastUp < DOUBLE_CLICK_CONVERSION_TRESHOLD ) { //type = wxEVT_LEFT_DCLICK; event.SetEventType(wxEVT_LEFT_DCLICK); m_timeLastMouseUp = 1; } else { m_timeLastMouseUp = t; } //m_downReceived = false; } } }*/ // Filter out clicks on button immediately after popup dismiss (Windows like behaviour) if ( evtType == wxEVT_LEFT_DOWN && t < m_timeCanAcceptClick ) { event.SetEventType(0); return true; } return false; } void wxPGComboControlBase::HandleNormalMouseEvent( wxMouseEvent& event ) { int evtType = event.GetEventType(); if ( (evtType == wxEVT_LEFT_DOWN || evtType == wxEVT_LEFT_DCLICK) && (m_windowStyle & wxCB_READONLY) ) { if ( m_isPopupShown ) { #if !wxUSE_POPUPWIN // Normally do nothing - evt handler should close it for us #if ALLOW_FAKE_POPUP if ( m_fakePopupUsage == 2 ) HidePopup(); #endif #elif !USE_TRANSIENT_POPUP // Click here always hides the popup. HidePopup(); #endif } else { if ( !(m_windowStyle & wxPGCC_DCLICK_CYCLES) ) { // In read-only mode, clicking the text is the // same as clicking the button. OnButtonClick(); } else if ( /*evtType == wxEVT_LEFT_UP || */evtType == wxEVT_LEFT_DCLICK ) { //if ( m_popupInterface->CycleValue() ) // Refresh(); if ( m_popupInterface ) m_popupInterface->OnComboDoubleClick(); } } } else if ( m_isPopupShown ) { // relay (some) mouse events to the popup if ( evtType == wxEVT_MOUSEWHEEL ) m_popup->AddPendingEvent(event); } else if ( evtType ) event.Skip(); } void wxPGComboControlBase::OnKeyEvent( wxKeyEvent& event ) { int keycode = event.GetKeyCode(); if ( keycode == WXK_TAB && !IsPopupShown() ) { wxNavigationKeyEvent evt; evt.SetFlags(wxNavigationKeyEvent::FromTab| (!event.ShiftDown()?wxNavigationKeyEvent::IsForward: wxNavigationKeyEvent::IsBackward)); evt.SetEventObject(this); GetParent()->GetEventHandler()->AddPendingEvent(evt); return; } if ( IsPopupShown() ) { // pass it to the popped up control GetPopupControl()->AddPendingEvent(event); } else // no popup { int comboStyle = GetWindowStyle(); wxPGComboPopup* popupInterface = GetPopup(); if ( !popupInterface ) { event.Skip(); return; } if ( (comboStyle & wxCB_READONLY) || ( keycode != WXK_RIGHT && keycode != WXK_LEFT ) ) { // Alternate keys: UP and DOWN show the popup instead of cycling if ( (comboStyle & wxPGCC_ALT_KEYS) ) { if ( keycode == WXK_UP || keycode == WXK_DOWN ) { OnButtonClick(); return; } else event.Skip(); } else popupInterface->OnComboKeyEvent(event); } else event.Skip(); } } void wxPGComboControlBase::OnFocusEvent( wxFocusEvent& event ) { if ( event.GetEventType() == wxEVT_SET_FOCUS ) { if ( m_text && m_text != ::wxWindow::FindFocus() ) { m_skipTextCtrlFocusEvents++; m_text->SetFocus(); } } Refresh(); } void wxPGComboControlBase::OnSysColourChanged(wxSysColourChangedEvent& WXUNUSED(event)) { OnThemeChange(); // indentation may also have changed if ( !(m_iFlags & wxPGCC_IFLAG_INDENT_SET) ) m_absIndent = GetNativeTextIndent(); RecalcAndRefresh(); } // ---------------------------------------------------------------------------- // popup handling // ---------------------------------------------------------------------------- // Create popup window and the child control void wxPGComboControlBase::CreatePopup() { wxPGComboPopup* popupInterface = m_popupInterface; wxWindow* popup; if ( !m_winPopup ) m_winPopup = new wxPGComboPopupWindow( this, wxNO_BORDER ); popupInterface->Create(m_winPopup); m_popup = popup = popupInterface->GetControl(); m_popupExtraHandler = new wxPGComboPopupExtraEventHandler(this); popup->PushEventHandler( m_popupExtraHandler ); popupInterface->m_iFlags |= wxPGCP_IFLAG_CREATED; } void wxPGComboControlBase::SetPopup( wxPGComboPopup* iface ) { delete m_popupInterface; delete m_winPopup; m_popupInterface = iface; #if ALLOW_FAKE_POPUP m_fakePopupUsage = 0; #endif if ( !iface->LazyCreate() || m_winPopup ) { CreatePopup(); /* m_winPopup = new wxPGComboPopupWindow( this, wxNO_BORDER ); // Create popup right away iface->Create(m_winPopup); m_popup = iface->GetControl(); m_popupExtraHandler = new wxPGComboPopupExtraEventHandler(this); m_popup->PushEventHandler( m_popupExtraHandler ); // Add interface as event handler //m_popup->PushEventHandler( iface ); */ // FIXME: This bypasses wxGTK popupwindow bug // (i.e. window is not initially hidden when it should be) m_winPopup->Hide(); #if ALLOW_FAKE_POPUP m_fakePopupUsage = 1; #endif } else { m_popup = (wxWindow*) NULL; } // This must be after creation if ( m_valueString.length() ) iface->SetStringValue(m_valueString); } void wxPGComboControlBase::OnButtonClick() { // Derived classes can override this method for totally custom // popup action ShowPopup(); } void wxPGComboControlBase::ShowPopup() { wxCHECK_RET( m_popupInterface, wxT("no popup interface set for wxComboControl") ); wxCHECK_RET( !IsPopupShown(), wxT("popup window already shown") ); SetFocus(); // Space above and below int screenHeight; wxPoint scrPos; int spaceAbove; int spaceBelow; int maxHeightPopup; wxSize ctrlSz = GetSize(); #if ALLOW_FAKE_POPUP int existingHeight = 200; if ( m_popup ) existingHeight = m_popup->GetSize().y; int screenWidth; GetParent()->GetClientSize(&screenWidth,&screenHeight); screenWidth -= 2; scrPos = GetPosition(); spaceAbove = scrPos.y - 2; spaceBelow = screenHeight - spaceAbove - ctrlSz.y - 4; maxHeightPopup = spaceBelow; if ( spaceAbove > spaceBelow ) maxHeightPopup = spaceAbove; if ( maxHeightPopup >= existingHeight ) { if ( m_winPopup && m_fakePopupUsage!=2 ) { delete m_winPopup; m_winPopup = (wxWindow*) NULL; m_popup = (wxWindow*) NULL; } m_fakePopupUsage = 2; } else { if ( m_winPopup && m_fakePopupUsage!=1 ) { delete m_winPopup; m_winPopup = (wxWindow*) NULL; m_popup = (wxWindow*) NULL; } m_fakePopupUsage = 1; #else { #endif screenHeight = wxSystemSettings::GetMetric( wxSYS_SCREEN_Y ); scrPos = GetParent()->ClientToScreen(GetPosition()); spaceAbove = scrPos.y; spaceBelow = screenHeight - spaceAbove - ctrlSz.y; maxHeightPopup = spaceBelow; if ( spaceAbove > spaceBelow ) maxHeightPopup = spaceAbove; } // Width int widthPopup = ctrlSz.x + m_extLeft + m_extRight; if ( widthPopup < m_widthMinPopup ) widthPopup = m_widthMinPopup; wxWindow* winPopup = m_winPopup; wxWindow* popup; // Need to disable tab traversal of parent // // NB: This is to fix a bug in wxMSW. In theory it could also be fixed // by, for instance, adding check to window.cpp:wxWindowMSW::MSWProcessMessage // that if transient popup is open, then tab traversal is to be ignored. // However, I think this code would still be needed for cases where // transient popup doesn't work yet (wxWINCE?). wxWindow* parent = GetParent(); int parentFlags = parent->GetWindowStyle(); if ( parentFlags & wxTAB_TRAVERSAL ) { parent->SetWindowStyle( parentFlags & ~(wxTAB_TRAVERSAL) ); m_iFlags |= wxPGCC_IFLAG_PARENT_TAB_TRAVERSAL; } if ( !winPopup ) { #if ALLOW_FAKE_POPUP if ( m_fakePopupUsage == 2 ) { winPopup = new wxWindow(); #ifdef __WXMSW__ // Only wxMSW supports this winPopup->Hide(); #endif winPopup->Create( GetParent(), -1 ); m_winPopup = winPopup; } #endif CreatePopup(); winPopup = m_winPopup; popup = m_popup; } else { popup = m_popup; } wxASSERT( !m_popup || m_popup == popup ); // Consistency check. wxSize adjustedSize = m_popupInterface->GetAdjustedSize(widthPopup, m_heightPopup<=0?DEFAULT_POPUP_HEIGHT:m_heightPopup, maxHeightPopup); popup->SetSize(adjustedSize); popup->Move(0,0); m_popupInterface->OnPopup(); #if ALLOW_FAKE_POPUP // Make sure fake popup didn't get too big if ( m_fakePopupUsage == 2 && popup->GetSize().x > screenWidth ) { popup->SetSize(screenWidth-2,popup->GetSize().y); } #endif // // Reposition and resize popup window // wxSize szp = popup->GetSize(); int popupX; int popupY = scrPos.y + ctrlSz.y; // Anchor popup to the side the dropbutton is on if ( m_btnSide == wxRIGHT ) popupX = scrPos.x + ctrlSz.x + m_extRight- szp.x; else popupX = scrPos.x - m_extLeft; #if ALLOW_FAKE_POPUP if ( m_fakePopupUsage == 2 ) { if ( spaceBelow < szp.y ) { if ( spaceAbove > spaceBelow ) { if ( szp.y > spaceAbove ) { popup->SetSize(szp.x,spaceAbove); szp.y = spaceAbove; } popupY = scrPos.y - szp.y; } else { if ( szp.y > spaceBelow ) { popup->SetSize(szp.x,spaceBelow); szp.y = spaceBelow; } } } } else #endif if ( spaceBelow < szp.y ) { popupY = scrPos.y - szp.y; } // Move to position //wxLogDebug(wxT("popup scheduled position1: %i,%i"),ptp.x,ptp.y); //wxLogDebug(wxT("popup position1: %i,%i"),winPopup->GetPosition().x,winPopup->GetPosition().y); // Some platforms (GTK) may need these two to be separate winPopup->SetSize( szp.x, szp.y ); winPopup->Move( popupX, popupY ); //wxLogDebug(wxT("popup position2: %i,%i"),winPopup->GetPosition().x,winPopup->GetPosition().y); m_popup = popup; // Set string selection (must be this way instead of SetStringSelection) if ( m_text ) { if ( !(m_iFlags & wxPGCC_NO_TEXT_AUTO_SELECT) ) m_text->SelectAll(); m_popupInterface->SetStringValue( m_text->GetValue() ); } else { // This is neede since focus/selection indication may change when popup is shown // FIXME: But in that case, would m_isPopupShown need to go before this? Refresh(); } // This must be after SetStringValue m_isPopupShown = true; // Show it #if USE_TRANSIENT_POPUP ((wxPopupTransientWindow*)winPopup)->Popup(popup); #else winPopup->Show(); #endif #if INSTALL_TOPLEV_HANDLER // If our real popup is wxDialog, then only install handler // incase of fake popup. #if !wxUSE_POPUPWIN if ( m_fakePopupUsage != 2 ) { if ( m_toplevEvtHandler ) { delete m_toplevEvtHandler; m_toplevEvtHandler = (wxEvtHandler*) NULL; } } else #endif { // Put top level window event handler into place if ( !m_toplevEvtHandler ) m_toplevEvtHandler = new wxPGComboFrameEventHandler(this); wxWindow* toplev = ::wxGetTopLevelParent( this ); wxASSERT( toplev ); ((wxPGComboFrameEventHandler*)m_toplevEvtHandler)->OnPopup(); toplev->PushEventHandler( m_toplevEvtHandler ); } #endif } void wxPGComboControlBase::OnPopupDismiss() { // Just in case, avoid double dismiss if ( !m_isPopupShown ) return; // *Must* set this before focus etc. m_isPopupShown = false; // Inform popup control itself m_popupInterface->OnDismiss(); //((wxComboDropButton*)m_btn)->SetPopup( (wxWindow*) NULL ); if ( m_popupExtraHandler ) ((wxPGComboPopupExtraEventHandler*)m_popupExtraHandler)->OnPopupDismiss(); #if INSTALL_TOPLEV_HANDLER // Remove top level window event handler if ( m_toplevEvtHandler ) { wxWindow* toplev = ::wxGetTopLevelParent( this ); if ( toplev ) toplev->RemoveEventHandler( m_toplevEvtHandler ); } #endif #if !wxUSE_POPUPWIN if ( m_fakePopupUsage != 2 ) GetParent()->SetFocus(); #endif m_timeCanAcceptClick = ::wxGetLocalTimeMillis() + 150; // If cursor not on dropdown button, then clear its state // (technically not required by all ports, but do it for all just in case) if ( !m_btnArea.wxPGRectContains(ScreenToClient(::wxGetMousePosition())) ) m_btnState = 0; // Return parent's tab traversal flag. // See ShowPopup for notes. if ( m_iFlags & wxPGCC_IFLAG_PARENT_TAB_TRAVERSAL ) { wxWindow* parent = GetParent(); parent->SetWindowStyle( parent->GetWindowStyle() | wxTAB_TRAVERSAL ); m_iFlags &= ~(wxPGCC_IFLAG_PARENT_TAB_TRAVERSAL); } // refresh control (necessary even if m_text) Refresh(); } void wxPGComboControlBase::HidePopup() { // Should be able to call this without popup interface //wxCHECK_RET( m_popupInterface, _T("no popup interface") ); if ( !m_isPopupShown ) return; // transfer value and show it in textctrl, if any SetValue( m_popupInterface->GetStringValue() ); #if USE_TRANSIENT_POPUP ((wxPopupTransientWindow*)m_winPopup)->Dismiss(); #else m_winPopup->Hide(); #endif OnPopupDismiss(); } // ---------------------------------------------------------------------------- // customization methods // ---------------------------------------------------------------------------- void wxPGComboControlBase::SetButtonPosition( int width, int height, int side, int spacingX ) { m_btnWid = width; m_btnHei = height; m_btnSide = side; m_btnSpacingX = spacingX; RecalcAndRefresh(); } void wxPGComboControlBase::SetButtonBitmaps( const wxBitmap& bmpNormal, bool blankButtonBg, const wxBitmap& bmpPressed, const wxBitmap& bmpHover, const wxBitmap& bmpDisabled ) { m_bmpNormal = bmpNormal; m_blankButtonBg = blankButtonBg; if ( bmpPressed.Ok() ) m_bmpPressed = bmpPressed; else m_bmpPressed = bmpNormal; if ( bmpHover.Ok() ) m_bmpHover = bmpHover; else m_bmpHover = bmpNormal; if ( bmpDisabled.Ok() ) m_bmpDisabled = bmpDisabled; else m_bmpDisabled = bmpNormal; RecalcAndRefresh(); } void wxPGComboControlBase::SetCustomPaintWidth( int width ) { if ( m_text ) { // move textctrl accordingly wxRect r = m_text->GetRect(); int inc = width - m_widthCustomPaint; r.x += inc; r.width -= inc; m_text->SetSize( r ); } m_widthCustomPaint = width; RecalcAndRefresh(); } void wxPGComboControlBase::SetTextIndent( int indent ) { if ( indent < 0 ) { m_absIndent = GetNativeTextIndent(); m_iFlags &= ~(wxPGCC_IFLAG_INDENT_SET); } else { m_absIndent = indent; m_iFlags |= wxPGCC_IFLAG_INDENT_SET; } RecalcAndRefresh(); } wxCoord wxPGComboControlBase::GetNativeTextIndent() const { return DEFAULT_TEXT_INDENT; } // ---------------------------------------------------------------------------- // methods forwarded to wxTextCtrl // ---------------------------------------------------------------------------- wxString wxPGComboControlBase::GetValue() const { if ( m_text ) return m_text->GetValue(); return m_valueString; } void wxPGComboControlBase::SetValue(const wxString& value) { if ( m_text ) { m_text->SetValue(value); if ( !(m_iFlags & wxPGCC_NO_TEXT_AUTO_SELECT) ) m_text->SelectAll(); } // Since wxPGComboPopup may want to paint the combo as well, we need // to set the string value here (as well as sometimes in ShowPopup). if ( m_valueString != value && m_popupInterface ) { m_popupInterface->SetStringValue(value); } m_valueString = value; Refresh(); } void wxPGComboControlBase::Copy() { if ( m_text ) m_text->Copy(); } void wxPGComboControlBase::Cut() { if ( m_text ) m_text->Cut(); } void wxPGComboControlBase::Paste() { if ( m_text ) m_text->Paste(); } void wxPGComboControlBase::SetInsertionPoint(long pos) { if ( m_text ) m_text->SetInsertionPoint(pos); } void wxPGComboControlBase::SetInsertionPointEnd() { if ( m_text ) m_text->SetInsertionPointEnd(); } long wxPGComboControlBase::GetInsertionPoint() const { if ( m_text ) return m_text->GetInsertionPoint(); return 0; } long wxPGComboControlBase::GetLastPosition() const { if ( m_text ) return m_text->GetLastPosition(); return 0; } void wxPGComboControlBase::Replace(long from, long to, const wxString& value) { if ( m_text ) m_text->Replace(from, to, value); } void wxPGComboControlBase::Remove(long from, long to) { if ( m_text ) m_text->Remove(from, to); } void wxPGComboControlBase::SetSelection(long from, long to) { if ( m_text ) m_text->SetSelection(from, to); } void wxPGComboControlBase::Undo() { if ( m_text ) m_text->Undo(); } // ---------------------------------------------------------------------------- // wxPGGenericComboControl // ---------------------------------------------------------------------------- BEGIN_EVENT_TABLE(wxPGGenericComboControl, wxPGComboControlBase) //EVT_SIZE(wxPGGenericComboControl::OnSizeEvent) EVT_PAINT(wxPGGenericComboControl::OnPaintEvent) EVT_MOUSE_EVENTS(wxPGGenericComboControl::OnMouseEvent) END_EVENT_TABLE() IMPLEMENT_DYNAMIC_CLASS(wxPGGenericComboControl, wxPGComboControlBase) void wxPGGenericComboControl::Init() { } bool wxPGGenericComboControl::Create(wxWindow *parent, wxWindowID id, const wxString& value, const wxPoint& pos, const wxSize& size, long style, const wxValidator& validator, const wxString& name) { // Set border long border = style & wxBORDER_MASK; #if defined(__WXUNIVERSAL__) if ( !border ) border = wxBORDER_SIMPLE; #elif defined(__WXMSW__) if ( !border ) border = wxBORDER_SIMPLE; #else if ( !border ) { border = wxBORDER_NONE; m_widthCustomBorder = 1; } Customize( wxPGCC_BUTTON_OUTSIDE_BORDER | wxPGCC_NO_TEXT_AUTO_SELECT | wxPGCC_BUTTON_STAYS_DOWN ); #endif style = (style & ~(wxBORDER_MASK)) | border; // create main window if ( !wxPGComboControlBase::Create(parent, id, value, wxDefaultPosition, wxDefaultSize, style | wxFULL_REPAINT_ON_RESIZE, wxDefaultValidator, name) ) return false; // Create textctrl, if necessary CreateTextCtrl( wxBORDER_NONE, validator ); // Add keyboard input handlers for main control and textctrl InstallInputHandlers(); // Set background SetBackgroundStyle( wxBG_STYLE_CUSTOM ); // for double-buffering // SetSize should be called last SetSize(pos.x,pos.y,size.x,size.y); return true; } wxPGGenericComboControl::~wxPGGenericComboControl() { } void wxPGGenericComboControl::OnResize() { // Recalculates button and textctrl areas CalculateAreas(DEFAULT_DROPBUTTON_WIDTH); #if 0 // Move separate button control, if any, to correct position if ( m_btn ) { wxSize sz = GetClientSize(); m_btn->SetSize( m_btnArea.x + m_btnSpacingX, (sz.y-m_btnSize.y)/2, m_btnSize.x, m_btnSize.y ); } #endif // Move textctrl, if any, accordingly PositionTextCtrl( TEXTCTRLXADJUST, TEXTCTRLYADJUST ); } void wxPGGenericComboControl::OnPaintEvent( wxPaintEvent& WXUNUSED(event) ) { wxSize sz = GetClientSize(); #if !wxCHECK_VERSION(2, 7, 1) // If size is larger, recalculate double buffer bitmap if ( !gs_doubleBuffer || sz.x > gs_doubleBuffer->GetWidth() || sz.y > gs_doubleBuffer->GetHeight() ) { delete gs_doubleBuffer; gs_doubleBuffer = new wxBitmap(sz.x+25,sz.y); } wxBufferedPaintDC dc(this,*gs_doubleBuffer); #else wxAutoBufferedPaintDC dc(this); #endif const wxRect& rectb = m_btnArea; wxRect rect = m_tcArea; // artificial simple border if ( m_widthCustomBorder ) { int customBorder = m_widthCustomBorder; // Set border colour wxPen pen1( wxSystemSettings::GetColour(wxSYS_COLOUR_GRAYTEXT), customBorder, wxSOLID ); dc.SetPen( pen1 ); // area around both controls wxRect rect2(0,0,sz.x,sz.y); if ( m_iFlags & wxPGCC_IFLAG_BUTTON_OUTSIDE ) { rect2 = m_tcArea; if ( customBorder == 1 ) { rect2.Inflate(1); } else { #ifdef __WXGTK__ rect2.x -= 1; rect2.y -= 1; #else rect2.x -= customBorder; rect2.y -= customBorder; #endif rect2.width += 1 + customBorder; rect2.height += 1 + customBorder; } } dc.SetBrush( *wxTRANSPARENT_BRUSH ); dc.DrawRectangle(rect2); } wxColour winCol = GetBackgroundColour(); dc.SetBrush(winCol); dc.SetPen(winCol); //wxLogDebug(wxT("hei: %i tcy: %i tchei: %i"),GetClientSize().y,m_tcArea.y,m_tcArea.height); //wxLogDebug(wxT("btnx: %i tcx: %i tcwid: %i"),m_btnArea.x,m_tcArea.x,m_tcArea.width); // clear main background dc.DrawRectangle(rect); if ( !m_btn ) // Standard button rendering DrawButton(dc, rectb); // paint required portion on the control if ( !m_text || m_widthCustomPaint ) { wxASSERT( m_widthCustomPaint >= 0 ); // this is intentionally here to allow drawed rectangle's // right edge to be hidden if ( m_text ) rect.width = m_widthCustomPaint; dc.SetFont( GetFont() ); dc.SetClippingRegion(rect); m_popupInterface->PaintComboControl(dc, rect); } } void wxPGGenericComboControl::OnMouseEvent( wxMouseEvent& event ) { bool isOnButtonArea = m_btnArea.wxPGRectContains(event.m_x,event.m_y); int handlerFlags = isOnButtonArea ? wxPGCC_MF_ON_BUTTON : 0; // Preprocessing fabricates double-clicks and prevents // (it may also do other common things in future) if ( PreprocessMouseEvent(event,handlerFlags) ) return; #ifdef __WXMSW__ const bool ctrlIsButton = true; #else const bool ctrlIsButton = false; #endif if ( ctrlIsButton && (m_windowStyle & (wxPGCC_DCLICK_CYCLES|wxCB_READONLY)) == wxCB_READONLY ) { // if no textctrl and no special double-click, then the entire control acts // as a button handlerFlags |= wxPGCC_MF_ON_BUTTON; if ( HandleButtonMouseEvent(event,handlerFlags) ) return; } else { if ( isOnButtonArea || m_btnState & wxCONTROL_PRESSED ) { if ( HandleButtonMouseEvent(event,handlerFlags) ) return; } else if ( m_btnState ) { // otherwise need to clear the hover status m_btnState = 0; RefreshRect(m_btnArea); } } // // This will handle left_down and left_dclick events outside button in a Windows/GTK-like manner. // See header file for further information on this method. HandleNormalMouseEvent(event); } // ---------------------------------------------------------------------------- // wxComboControl // ---------------------------------------------------------------------------- #if defined(__WXMSW__) && !defined(__WXUNIVERSAL__) // Change to #if 1 to include tmschema.h for easier testing of theme // parameters. #if 0 #include #include #else //---------------------------------- #define EP_EDITTEXT 1 #define ETS_NORMAL 1 #define ETS_HOT 2 #define ETS_SELECTED 3 #define ETS_DISABLED 4 #define ETS_FOCUSED 5 #define ETS_READONLY 6 #define ETS_ASSIST 7 #define TMT_FILLCOLOR 3802 #define TMT_TEXTCOLOR 3803 #define TMT_BORDERCOLOR 3801 #define TMT_EDGEFILLCOLOR 3808 #define TMT_BGTYPE 4001 #define BT_IMAGEFILE 0 #define BT_BORDERFILL 1 #define CP_DROPDOWNBUTTON 1 #define CP_BACKGROUND 2 // This and above are Vista and later only #define CP_TRANSPARENTBACKGROUND 3 #define CP_BORDER 4 #define CP_READONLY 5 #define CP_DROPDOWNBUTTONRIGHT 6 #define CP_DROPDOWNBUTTONLEFT 7 #define CP_CUEBANNER 8 #define CBXS_NORMAL 1 #define CBXS_HOT 2 #define CBXS_PRESSED 3 #define CBXS_DISABLED 4 #define CBXSR_NORMAL 1 #define CBXSR_HOT 2 #define CBXSR_PRESSED 3 #define CBXSR_DISABLED 4 #define CBXSL_NORMAL 1 #define CBXSL_HOT 2 #define CBXSL_PRESSED 3 #define CBXSL_DISABLED 4 #define CBTBS_NORMAL 1 #define CBTBS_HOT 2 #define CBTBS_DISABLED 3 #define CBTBS_FOCUSED 4 #define CBB_NORMAL 1 #define CBB_HOT 2 #define CBB_FOCUSED 3 #define CBB_DISABLED 4 #define CBRO_NORMAL 1 #define CBRO_HOT 2 #define CBRO_PRESSED 3 #define CBRO_DISABLED 4 #define CBCB_NORMAL 1 #define CBCB_HOT 2 #define CBCB_PRESSED 3 #define CBCB_DISABLED 4 #endif #define NATIVE_TEXT_INDENT_XP 4 #define NATIVE_TEXT_INDENT_CLASSIC 2 #define TEXTCTRLXADJUST_XP 0 #define TEXTCTRLYADJUST_XP 4 #define TEXTCTRLXADJUST_CLASSIC 0 #define TEXTCTRLYADJUST_CLASSIC 4 BEGIN_EVENT_TABLE(wxPGComboControl, wxPGComboControlBase) EVT_PAINT(wxPGComboControl::OnPaintEvent) EVT_MOUSE_EVENTS(wxPGComboControl::OnMouseEvent) END_EVENT_TABLE() IMPLEMENT_DYNAMIC_CLASS(wxPGComboControl, wxPGComboControlBase) void wxPGComboControl::Init() { } bool wxPGComboControl::Create(wxWindow *parent, wxWindowID id, const wxString& value, const wxPoint& pos, const wxSize& size, long style, const wxValidator& validator, const wxString& name) { // Set border long border = style & wxBORDER_MASK; wxUxThemeEngine* theme = wxUxThemeEngine::GetIfActive(); if ( !border ) { // For XP, have 1-width custom border, for older version use sunken if ( theme ) { border = wxBORDER_NONE; m_widthCustomBorder = 1; } else border = wxBORDER_SUNKEN; style = (style & ~(wxBORDER_MASK)) | border; } //Customize( wxPGCC_BUTTON_OUTSIDE_BORDER ); // create main window if ( !wxPGComboControlBase::Create(parent, id, value, wxDefaultPosition, wxDefaultSize, style | wxFULL_REPAINT_ON_RESIZE, wxDefaultValidator, name) ) return false; if ( theme ) { #if wxCHECK_VERSION(2, 8, 0) const bool isVista = (::wxGetWinVersion() >= wxWinVersion_6); #else int Major = 0; int family = wxGetOsVersion(&Major, NULL); const bool isVista = ((family == wxWINDOWS_NT) && (Major >= 6)); #endif if ( isVista ) m_iFlags |= wxPGCC_BUTTON_STAYS_DOWN; } // Create textctrl, if necessary CreateTextCtrl( wxNO_BORDER, validator ); // Add keyboard input handlers for main control and textctrl InstallInputHandlers(); // Prepare background for double-buffering SetBackgroundStyle( wxBG_STYLE_CUSTOM ); // SetSize should be called last SetSize(pos.x,pos.y,size.x,size.y); return true; } wxPGComboControl::~wxPGComboControl() { } void wxPGComboControl::OnThemeChange() { wxUxThemeEngine* theme = wxUxThemeEngine::GetIfActive(); if ( theme ) { wxUxThemeHandle hTheme(this, L"COMBOBOX"); COLORREF col; theme->GetThemeColor(hTheme,EP_EDITTEXT,ETS_NORMAL,TMT_FILLCOLOR,&col); SetBackgroundColour(wxRGBToColour(col)); theme->GetThemeColor(hTheme,EP_EDITTEXT,ETS_NORMAL,TMT_TEXTCOLOR,&col); SetForegroundColour(wxRGBToColour(col)); } else { SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW)); SetForegroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT)); } } //void wxPGComboControl::OnSizeEvent( wxSizeEvent& event ) void wxPGComboControl::OnResize() { // // Recalculates button and textctrl areas int textCtrlXAdjust; int textCtrlYAdjust; if ( wxUxThemeEngine::GetIfActive() ) { textCtrlXAdjust = TEXTCTRLXADJUST_XP; textCtrlYAdjust = TEXTCTRLYADJUST_XP; } else { textCtrlXAdjust = TEXTCTRLXADJUST_CLASSIC; textCtrlYAdjust = TEXTCTRLYADJUST_CLASSIC; } // Technically Classic Windows style combo has more narrow button, // but the native renderer doesn't paint it well like that. int btnWidth = 17; CalculateAreas(btnWidth); // Position textctrl using standard routine PositionTextCtrl(textCtrlXAdjust,textCtrlYAdjust); } /* // Draws non-XP GUI dotted line around the focus area static void wxMSWDrawFocusRect( wxDC& dc, const wxRect& rect ) { #if !defined(__WXWINCE__) dc.SetLogicalFunction(wxINVERT); wxPen pen(*wxBLACK,1,wxDOT); pen.SetCap(wxCAP_BUTT); dc.SetPen(pen); dc.SetBrush(*wxTRANSPARENT_BRUSH); dc.DrawRectangle(rect); dc.SetLogicalFunction(wxCOPY); #else dc.SetLogicalFunction(wxINVERT); dc.SetPen(wxPen(*wxBLACK,1,wxDOT)); dc.SetBrush(*wxTRANSPARENT_BRUSH); dc.DrawRectangle(rect); dc.SetLogicalFunction(wxCOPY); #endif } */ /* // draw focus background on area in a way typical on platform void wxPGComboControl::DrawFocusBackground( wxDC& dc, const wxRect& rect, int flags ) { wxUxThemeEngine* theme = (wxUxThemeEngine*) NULL; wxUxThemeHandle hTheme(this, L"COMBOBOX"); //COLORREF cref; wxSize sz = GetClientSize(); bool isEnabled; bool isFocused; // also selected // For smaller size control (and for disabled background) use less spacing int focusSpacingX; int focusSpacingY; if ( !(flags & wxCONTROL_ISSUBMENU) ) { // Drawing control isEnabled = IsEnabled(); isFocused = ShouldDrawFocus(); // Windows-style: for smaller size control (and for disabled background) use less spacing if ( hTheme ) { // WinXP Theme focusSpacingX = isEnabled ? 2 : 1; focusSpacingY = sz.y > (GetCharHeight()+2) && isEnabled ? 2 : 1; } else { // Classic Theme if ( isEnabled ) { focusSpacingX = 1; focusSpacingY = 1; } else { focusSpacingX = 0; focusSpacingY = 0; } } } else { // Drawing a list item isEnabled = true; // they are never disabled isFocused = flags & wxCONTROL_SELECTED ? true : false; focusSpacingX = 0; focusSpacingY = 0; } // Set the background sub-rectangle for selection, disabled etc wxRect selRect(rect); selRect.y += focusSpacingY; selRect.height -= (focusSpacingY*2); int wcp = 0; if ( !(flags & wxCONTROL_ISSUBMENU) ) wcp += m_widthCustomPaint; selRect.x += wcp + focusSpacingX; selRect.width -= wcp + (focusSpacingX*2); if ( hTheme ) theme = wxUxThemeEngine::GetIfActive(); wxColour bgCol; bool drawDottedEdge = false; if ( isEnabled ) { // If popup is hidden and this control is focused, // then draw the focus-indicator (selbgcolor background etc.). if ( isFocused ) { #if 0 // TODO: Proper theme color getting (JMS: I don't know which parts/colors to use, // those below don't work) if ( hTheme ) { theme->GetThemeColor(hTheme,EP_EDITTEXT,ETS_SELECTED,TMT_TEXTCOLOR,&cref); dc.SetTextForeground( wxRGBToColour(cref) ); theme->GetThemeColor(hTheme,EP_EDITTEXT,ETS_SELECTED,TMT_FILLCOLOR,&cref); bgCol = wxRGBToColour(cref); } else #endif { dc.SetTextForeground( wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT) ); bgCol = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT); if ( m_windowStyle & wxCB_READONLY ) drawDottedEdge = true; } } else { bgCol = GetBackgroundColour(); } } else { dc.SetTextForeground( wxSystemSettings::GetColour(wxSYS_COLOUR_GRAYTEXT) ); bgCol = wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE); } dc.SetBrush(bgCol); dc.SetPen(bgCol); dc.DrawRectangle(selRect); //if ( drawDottedEdge ) // wxMSWDrawFocusRect(dc,selRect); } */ void wxPGComboControl::OnPaintEvent( wxPaintEvent& WXUNUSED(event) ) { // TODO: Convert drawing in this function to Windows API Code wxSize sz = GetClientSize(); #if !wxCHECK_VERSION(2, 7, 1) // If size is larger, recalculate double buffer bitmap if ( !gs_doubleBuffer || sz.x > gs_doubleBuffer->GetWidth() || sz.y > gs_doubleBuffer->GetHeight() ) { delete gs_doubleBuffer; gs_doubleBuffer = new wxBitmap(sz.x+25,sz.y); } wxBufferedPaintDC dc(this,*gs_doubleBuffer); #else wxAutoBufferedPaintDC dc(this); #endif const wxRect& rectButton = m_btnArea; wxRect rectTextField = m_tcArea; const bool isEnabled = IsEnabled(); wxColour bgCol = GetBackgroundColour(); HDC hDc = GetHdcOf(dc); HWND hWnd = GetHwndOf(this); wxUxThemeEngine* theme = NULL; wxUxThemeHandle hTheme(this, L"COMBOBOX"); if ( hTheme ) theme = wxUxThemeEngine::GetIfActive(); wxRect borderRect(0,0,sz.x,sz.y); if ( m_iFlags & wxPGCC_IFLAG_BUTTON_OUTSIDE ) { borderRect = m_tcArea; borderRect.Inflate(1); } int drawButFlags = 0; if ( hTheme ) { #if wxCHECK_VERSION(2, 8, 0) const bool useVistaComboBox = (::wxGetWinVersion() >= wxWinVersion_6); #else int Major = 0; int family = wxGetOsVersion(&Major, NULL); const bool useVistaComboBox = ((family == wxWINDOWS_NT) && (Major >= 6)); #endif RECT rFull; wxCopyRectToRECT(borderRect, rFull); RECT rButton; wxCopyRectToRECT(rectButton, rButton); RECT rBorder; wxCopyRectToRECT(borderRect, rBorder); bool isNonStdButton = (m_iFlags & wxPGCC_IFLAG_BUTTON_OUTSIDE) || (m_iFlags & wxPGCC_IFLAG_HAS_NONSTANDARD_BUTTON); // // Get some states for themed drawing int butState; if ( !isEnabled ) { butState = CBXS_DISABLED; } // Vista will display the drop-button as depressed always // when the popup window is visilbe else if ( (m_btnState & wxCONTROL_PRESSED) || (useVistaComboBox && IsPopupShown()) ) { butState = CBXS_PRESSED; } else if ( m_btnState & wxCONTROL_CURRENT ) { butState = CBXS_HOT; } else { butState = CBXS_NORMAL; } int comboBoxPart = 0; // For XP, use the 'default' part RECT* rUseForBg = &rBorder; bool drawFullButton = false; int bgState = butState; const bool isFocused = IsFocused(); if ( useVistaComboBox ) { // FIXME: Either SetBackgroundColour or GetBackgroundColour // doesn't work under Vista, so here's a temporary // workaround. bgCol = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW); // Draw the entire control as a single button? /* if ( !isNonStdButton ) { if ( HasFlag(wxCB_READONLY) ) drawFullButton = true; } */ if ( drawFullButton ) { comboBoxPart = CP_READONLY; rUseForBg = &rFull; // It should be safe enough to update this flag here. m_iFlags |= wxPGCC_FULL_BUTTON; } else { comboBoxPart = CP_BORDER; m_iFlags &= ~wxPGCC_FULL_BUTTON; if ( isFocused ) bgState = CBB_FOCUSED; else bgState = CBB_NORMAL; } } // // Draw parent's background, if necessary RECT* rUseForTb = NULL; if ( theme->IsThemeBackgroundPartiallyTransparent( hTheme, comboBoxPart, bgState ) ) rUseForTb = &rFull; else if ( m_iFlags & wxPGCC_IFLAG_BUTTON_OUTSIDE ) rUseForTb = &rButton; if ( rUseForTb ) theme->DrawThemeParentBackground( hWnd, hDc, rUseForTb ); // // Draw the control background (including the border) if ( m_widthCustomBorder > 0 ) { theme->DrawThemeBackground( hTheme, hDc, comboBoxPart, bgState, rUseForBg, NULL ); } else { // No border. We can't use theme, since it cannot be relied on // to deliver borderless drawing, even with DrawThemeBackgroundEx. dc.SetBrush(bgCol); dc.SetPen(bgCol); dc.DrawRectangle(borderRect); } // // Draw the drop-button if ( !isNonStdButton ) { drawButFlags = Button_BitmapOnly; int butPart = CP_DROPDOWNBUTTON; if ( useVistaComboBox && m_widthCustomBorder > 0 ) { if ( drawFullButton ) { // We need to alter the button style slightly before // drawing the actual button (but it was good above // when background etc was done). if ( butState == CBXS_HOT || butState == CBXS_PRESSED ) butState = CBXS_NORMAL; } if ( m_btnSide == wxRIGHT ) butPart = CP_DROPDOWNBUTTONRIGHT; else butPart = CP_DROPDOWNBUTTONLEFT; } theme->DrawThemeBackground( hTheme, hDc, butPart, butState, &rButton, NULL ); } else if ( useVistaComboBox && (m_iFlags & wxPGCC_IFLAG_BUTTON_OUTSIDE) ) { // We'll do this, because DrawThemeParentBackground // doesn't seem to be reliable on Vista. drawButFlags |= Button_PaintBackground; } } else { // Windows 2000 and earlier drawButFlags = Button_PaintBackground; dc.SetBrush(bgCol); dc.SetPen(bgCol); dc.DrawRectangle(borderRect); } // Button rendering (may only do the bitmap on button, depending on the flags) DrawButton( dc, rectButton, drawButFlags ); // Paint required portion of the custom image on the control if ( (!m_text || m_widthCustomPaint) ) { wxASSERT( m_widthCustomPaint >= 0 ); // this is intentionally here to allow drawed rectangle's // right edge to be hidden if ( m_text ) rectTextField.width = m_widthCustomPaint; dc.SetFont( GetFont() ); dc.SetClippingRegion(rectTextField); m_popupInterface->PaintComboControl(dc,rectTextField); } } void wxPGComboControl::OnMouseEvent( wxMouseEvent& event ) { bool isOnButtonArea = m_btnArea.wxPGRectContains(event.m_x,event.m_y); int handlerFlags = isOnButtonArea ? wxPGCC_MF_ON_BUTTON : 0; // Preprocessing fabricates double-clicks and prevents // (it may also do other common things in future) if ( PreprocessMouseEvent(event,isOnButtonArea) ) return; if ( (m_windowStyle & (wxPGCC_DCLICK_CYCLES|wxCB_READONLY)) == wxCB_READONLY ) { // if no textctrl and no special double-click, then the entire control acts // as a button handlerFlags |= wxPGCC_MF_ON_BUTTON; if ( HandleButtonMouseEvent(event,handlerFlags) ) return; } else { if ( isOnButtonArea || m_btnState & wxCONTROL_PRESSED ) { if ( HandleButtonMouseEvent(event,handlerFlags) ) return; } else if ( m_btnState ) { // otherwise need to clear the hover status m_btnState = 0; RefreshRect(m_btnArea); } } // // This will handle left_down and left_dclick events outside button in a Windows-like manner. // See header file for further information on this method. HandleNormalMouseEvent(event); } wxCoord wxPGComboControl::GetNativeTextIndent() const { if ( wxUxThemeEngine::GetIfActive() ) return NATIVE_TEXT_INDENT_XP; return NATIVE_TEXT_INDENT_CLASSIC; } #else IMPLEMENT_DYNAMIC_CLASS(wxPGComboControl, wxPGComboControlBase) #endif // #if defined(__WXMSW__) && !defined(__WXUNIVERSAL__) // ---------------------------------------------------------------------------- // wxPGOwnerDrawnComboBox // ---------------------------------------------------------------------------- IMPLEMENT_DYNAMIC_CLASS(wxPGOwnerDrawnComboBox, wxPGComboControl) BEGIN_EVENT_TABLE(wxPGOwnerDrawnComboBox, wxPGComboControl) END_EVENT_TABLE() void wxPGOwnerDrawnComboBox::Init() { } bool wxPGOwnerDrawnComboBox::Create(wxWindow *parent, wxWindowID id, const wxString& value, const wxPoint& pos, const wxSize& size, long style, const wxValidator& validator, const wxString& name) { return wxPGComboControl::Create(parent,id,value,pos,size,style,validator,name); } wxPGOwnerDrawnComboBox::wxPGOwnerDrawnComboBox(wxWindow *parent, wxWindowID id, const wxString& value, const wxPoint& pos, const wxSize& size, const wxArrayString& choices, long style, const wxValidator& validator, const wxString& name) : wxPGComboControl() { Init(); Create(parent,id,value,pos,size,choices,style, validator, name); } bool wxPGOwnerDrawnComboBox::Create(wxWindow *parent, wxWindowID id, const wxString& value, const wxPoint& pos, const wxSize& size, const wxArrayString& choices, long style, const wxValidator& validator, const wxString& name) { wxCArrayString chs(choices); return Create(parent, id, value, pos, size, chs.GetCount(), chs.GetStrings(), /*callback,*/ style, validator, name); } bool wxPGOwnerDrawnComboBox::Create(wxWindow *parent, wxWindowID id, const wxString& value, const wxPoint& pos, const wxSize& size, int n, const wxString choices[], long style, const wxValidator& validator, const wxString& name) { if ( !Create(parent, id, value, pos, size, style, validator, name) ) { return false; } wxPGVListBoxComboPopup* iface = new wxPGVListBoxComboPopup(this); SetPopup(iface); m_popupInterface = iface; // Add initial choices to the interface iface->Populate(n,choices); return true; } wxPGOwnerDrawnComboBox::~wxPGOwnerDrawnComboBox() { if ( m_popupInterface ) m_popupInterface->ClearClientDatas(); } // ---------------------------------------------------------------------------- // wxPGOwnerDrawnComboBox item manipulation methods // ---------------------------------------------------------------------------- void wxPGOwnerDrawnComboBox::Clear() { wxASSERT( m_popupInterface ); m_popupInterface->Clear(); GetTextCtrl()->SetValue(wxEmptyString); } void wxPGOwnerDrawnComboBox::Delete(wxODCIndex n) { wxCHECK_RET( (n >= 0) && (n < GetCount()), _T("invalid index in wxPGOwnerDrawnComboBox::Delete") ); if ( GetSelection() == (int) n ) SetValue(wxEmptyString); m_popupInterface->Delete(n); } wxODCCount wxPGOwnerDrawnComboBox::GetCount() const { wxASSERT( m_popupInterface ); return m_popupInterface->GetCount(); } wxString wxPGOwnerDrawnComboBox::GetString(wxODCIndex n) const { wxCHECK_MSG( (n >= 0) && (n < GetCount()), wxEmptyString, _T("invalid index in wxPGOwnerDrawnComboBox::GetString") ); return m_popupInterface->GetString(n); } void wxPGOwnerDrawnComboBox::SetString(wxODCIndex n, const wxString& s) { wxCHECK_RET( (n >= 0) && (n < GetCount()), _T("invalid index in wxPGOwnerDrawnComboBox::SetString") ); m_popupInterface->SetString(n,s); } int wxPGOwnerDrawnComboBox::FindString(const wxString& s) const { wxASSERT( m_popupInterface ); return m_popupInterface->FindString(s); } void wxPGOwnerDrawnComboBox::Select(int n) { wxCHECK_RET( (n >= -1) && (n < (int)GetCount()), _T("invalid index in wxPGOwnerDrawnComboBox::Select") ); wxASSERT( m_popupInterface ); m_popupInterface->SetSelection(n); wxString str; if ( n >= 0 ) str = m_popupInterface->GetString(n); // Refresh text portion in control if ( m_text ) m_text->SetValue( str ); else m_valueString = str; Refresh(); } int wxPGOwnerDrawnComboBox::GetSelection() const { wxASSERT( m_popupInterface ); return m_popupInterface->GetSelection(); } int wxPGOwnerDrawnComboBox::DoAppend(const wxString& item) { wxASSERT( m_popupInterface ); return m_popupInterface->Append(item); } int wxPGOwnerDrawnComboBox::DoInsert(const wxString& item, wxODCIndex pos) { wxCHECK_MSG(!(GetWindowStyle() & wxCB_SORT), -1, wxT("can't insert into sorted list")); wxCHECK_MSG((pos>=0) && (pos<=GetCount()), -1, wxT("invalid index")); m_popupInterface->Insert(item,pos); return pos; } #if wxCHECK_VERSION(2,9,0) int wxPGOwnerDrawnComboBox::DoInsertItems(const wxArrayStringsAdapter& items, unsigned int pos, void **clientData, wxClientDataType type) { unsigned int i; for ( i=0; iSetItemClientData(n,clientData, #if wxCHECK_VERSION(2,9,0) GetClientDataType() #else m_clientDataItemsType #endif ); } void* wxPGOwnerDrawnComboBox::DoGetItemClientData(wxODCIndex n) const { wxASSERT(m_popupInterface); return m_popupInterface->GetItemClientData(n); } void wxPGOwnerDrawnComboBox::DoSetItemClientObject(wxODCIndex n, wxClientData* clientData) { DoSetItemClientData(n, (void*) clientData); } wxClientData* wxPGOwnerDrawnComboBox::DoGetItemClientObject(wxODCIndex n) const { return (wxClientData*) DoGetItemClientData(n); } #endif // wxUSE_COMBOBOX wxformbuilder-3.1.59/src/controls/src/propgrid/advprops.cpp0000644000175000017500000015255611143440027024377 0ustar rrmulderrrmulder///////////////////////////////////////////////////////////////////////////// // Name: advprops.cpp // Purpose: wxPropertyGrid Advanced Properties (font, colour, etc.) // Author: Jaakko Salli // Modified by: // Created: Sep-25-2004 // RCS-ID: $Id: // Copyright: (c) Jaakko Salli // Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "advprops.h" #endif // For compilers that support precompilation, includes "wx/wx.h". #include "wx/wxprec.h" #ifdef __BORLANDC__ #pragma hdrstop #endif #ifndef WX_PRECOMP #include "wx/defs.h" #include "wx/object.h" #include "wx/hash.h" #include "wx/string.h" #include "wx/log.h" #include "wx/event.h" #include "wx/window.h" #include "wx/panel.h" #include "wx/dc.h" #include "wx/dcclient.h" #include "wx/button.h" #include "wx/pen.h" #include "wx/brush.h" #include "wx/cursor.h" #include "wx/dialog.h" #include "wx/settings.h" #include "wx/msgdlg.h" #include "wx/choice.h" #include "wx/stattext.h" #include "wx/textctrl.h" #include "wx/scrolwin.h" #include "wx/dirdlg.h" #include "wx/combobox.h" #include "wx/layout.h" #include "wx/sizer.h" #include "wx/textdlg.h" #include "wx/filedlg.h" #include "wx/intl.h" #endif #define __wxPG_SOURCE_FILE__ #include #if wxPG_INCLUDE_ADVPROPS #include #include #ifdef __WXMSW__ #include #endif // ----------------------------------------------------------------------- #if defined(__WXMSW__) #define wxPG_CAN_DRAW_CURSOR 1 #elif defined(__WXGTK__) #define wxPG_CAN_DRAW_CURSOR 0 #elif defined(__WXMAC__) #define wxPG_CAN_DRAW_CURSOR 0 #else #define wxPG_CAN_DRAW_CURSOR 0 #endif #if !defined(wxPG_ALLOW_WXADV) #undef wxUSE_DATEPICKCTRL #define wxUSE_DATEPICKCTRL 0 #endif // ----------------------------------------------------------------------- // Value type related // ----------------------------------------------------------------------- bool operator == (const wxFontPropertyValue& a, const wxFontPropertyValue& b) { return ( ( a.m_pointSize == b.m_pointSize ) && ( a.m_family == b.m_family ) && ( a.m_style == b.m_style ) && ( a.m_weight == b.m_weight ) && ( a.m_underlined == b.m_underlined ) && ( a.m_faceName == b.m_faceName ) ); } // Implement dynamic class for type value. IMPLEMENT_DYNAMIC_CLASS(wxFontPropertyValue,wxObject) WX_PG_IMPLEMENT_VALUE_TYPE_WXOBJ(wxFontPropertyValue,wxFontProperty,(const wxFontPropertyValue*)NULL) // Implement dynamic class for type value. IMPLEMENT_DYNAMIC_CLASS(wxColourPropertyValue,wxObject) bool operator == (const wxColourPropertyValue& a, const wxColourPropertyValue& b) { return ( ( a.m_colour == b.m_colour ) && (a.m_type == b.m_type) ); } WX_PG_IMPLEMENT_VALUE_TYPE_WXOBJ(wxColourPropertyValue,wxSystemColourProperty, (const wxColourPropertyValue*)NULL) WX_PG_IMPLEMENT_VALUE_TYPE_WXOBJ(wxColour,wxColourProperty, (const wxColour*)wxBLACK) bool operator == (const wxArrayInt& array1, const wxArrayInt& array2) { if ( array1.GetCount() != array2.GetCount() ) return false; size_t i; for ( i=0; i // NOTE: Regardless that this class inherits from a working editor, it has // all necessary methods to work independently. wxTextCtrl stuff is only // used for event handling here. class wxPGSpinCtrlEditor : public wxPGTextCtrlEditor { WX_PG_DECLARE_EDITOR_CLASS() public: virtual ~wxPGSpinCtrlEditor(); // See below for short explanations of what these are suppposed to do. wxPG_DECLARE_CREATECONTROLS virtual bool OnEvent( wxPropertyGrid* propgrid, wxPGProperty* property, wxWindow* wnd, wxEvent& event ) const; }; // This macro also defines global wxPGEditor_SpinCtrl for storing // the singleton class instance. WX_PG_IMPLEMENT_EDITOR_CLASS(SpinCtrl,wxPGSpinCtrlEditor,wxPGEditor) // Trivial destructor. wxPGSpinCtrlEditor::~wxPGSpinCtrlEditor() { } // Create controls and initialize event handling. #ifndef __WXPYTHON__ wxWindow* wxPGSpinCtrlEditor::CreateControls( wxPropertyGrid* propgrid, wxPGProperty* property, const wxPoint& pos, const wxSize& sz, wxWindow** pSecondary ) const #else wxPGWindowPair wxPGSpinCtrlEditor::CreateControls( wxPropertyGrid* propgrid, wxPGProperty* property, const wxPoint& pos, const wxSize& sz ) const #endif { const int margin = 1; wxSize butSz(18, sz.y); wxSize tcSz(sz.x - butSz.x - margin, sz.y); wxPoint butPos(pos.x + tcSz.x + margin, pos.y); wxSpinButton* wnd2 = new wxSpinButton(); #ifdef __WXMSW__ wnd2->Hide(); #endif wnd2->Create( propgrid, wxPG_SUBID2, butPos, butSz, wxSP_VERTICAL ); wnd2->SetRange( INT_MIN, INT_MAX ); //wnd2->SetRange( 5, 12 ); wnd2->SetValue( 0 ); propgrid->Connect( wxPG_SUBID2, wxEVT_SCROLL_LINEUP, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) &wxPropertyGrid::OnCustomEditorEvent, NULL, propgrid ); propgrid->Connect( wxPG_SUBID2, wxEVT_SCROLL_LINEDOWN, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) &wxPropertyGrid::OnCustomEditorEvent, NULL, propgrid ); // Let's add validator to make sure only numbers can be entered wxString temps; wxTextValidator validator(wxFILTER_NUMERIC, &temps); #ifndef __WXPYTHON__ wxTextCtrl* wnd1 = (wxTextCtrl*) wxPGTextCtrlEditor::CreateControls( propgrid, property, pos, tcSz, NULL ); wnd1->SetValidator(validator); *pSecondary = wnd2; return wnd1; #else wxTextCtrl* wnd1 = (wxTextCtrl*) wxPGTextCtrlEditor::CreateControls( propgrid, property, pos, tcSz ).m_primary; wnd1->SetValidator(validator); return wxPGWindowPair(wnd1, wnd2); #endif } // Control's events are redirected here bool wxPGSpinCtrlEditor::OnEvent( wxPropertyGrid* propgrid, wxPGProperty* property, wxWindow* wnd, wxEvent& event ) const { int evtType = event.GetEventType(); if ( evtType == wxEVT_SCROLL_LINEUP || evtType == wxEVT_SCROLL_LINEDOWN ) { wxString s; // Can't use wnd since it might be clipper window wxTextCtrl* tc = wxDynamicCast(propgrid->GetEditorControl(), wxTextCtrl); if ( tc ) s = tc->GetValue(); else s = property->GetValueAsString(wxPG_FULL_VALUE); wxSpinButton* spinButton = (wxSpinButton*) propgrid->GetEditorControlSecondary(); int spinMin = spinButton->GetMin(); int spinMax = spinButton->GetMax(); if ( property->GetValueType() == wxPG_VALUETYPE(double) ) { double v_d; // Try double if ( s.ToDouble(&v_d) ) { if ( evtType == wxEVT_SCROLL_LINEUP ) v_d += 1.0; else v_d -= 1.0; // Min/Max double dSpinMin = (double) spinMin; double dSpinMax = (double) spinMax; if ( v_d > dSpinMax ) v_d = dSpinMax; else if ( v_d < dSpinMin ) v_d = dSpinMin; wxPropertyGrid::DoubleToString(s, v_d, 6, true, NULL); } else { return false; } } else { long v_l; // Try long if ( s.ToLong(&v_l, 0) ) { if ( evtType == wxEVT_SCROLL_LINEUP ) v_l++; else v_l--; // Min/Max if ( v_l > spinMax ) v_l = spinMax; else if ( v_l < spinMin ) v_l = spinMin; s = wxString::Format(wxT("%i"),(int)v_l); } else { return false; } } if ( tc ) tc->SetValue(s); return true; } return wxPGTextCtrlEditor::OnEvent(propgrid,property,wnd,event); } #endif // wxUSE_SPINBTN // ----------------------------------------------------------------------- // wxDatePickerCtrl-based property editor // ----------------------------------------------------------------------- #if wxUSE_DATEPICKCTRL #include #include class wxPGDatePickerCtrlEditor : public wxPGEditor { WX_PG_DECLARE_EDITOR_CLASS() public: virtual ~wxPGDatePickerCtrlEditor(); wxPG_DECLARE_CREATECONTROLS virtual void UpdateControl( wxPGProperty* property, wxWindow* wnd ) const; virtual bool OnEvent( wxPropertyGrid* propgrid, wxPGProperty* property, wxWindow* wnd, wxEvent& event ) const; virtual bool CopyValueFromControl( wxPGProperty* property, wxWindow* wnd ) const; virtual void SetValueToUnspecified( wxWindow* wnd ) const; }; WX_PG_IMPLEMENT_EDITOR_CLASS(DatePickerCtrl,wxPGDatePickerCtrlEditor,wxPGEditor) wxPGDatePickerCtrlEditor::~wxPGDatePickerCtrlEditor() { } #ifndef __WXPYTHON__ wxWindow* wxPGDatePickerCtrlEditor::CreateControls( wxPropertyGrid* propgrid, wxPGProperty* property, const wxPoint& pos, const wxSize& sz, wxWindow** ) const #else wxPGWindowPair wxPGDatePickerCtrlEditor::CreateControls( wxPropertyGrid* propgrid, wxPGProperty* property, const wxPoint& pos, const wxSize& sz ) const #endif { wxCHECK_MSG( property->IsKindOf(WX_PG_CLASSINFO(wxDateProperty)), NULL, wxT("DatePickerCtrl editor can only be used with wxDateProperty or derivative.") ); wxDatePropertyClass* prop = (wxDatePropertyClass*) property; // Use two stage creation to allow cleaner display on wxMSW wxDatePickerCtrl* ctrl = new wxDatePickerCtrl(); #ifdef __WXMSW__ ctrl->Hide(); wxSize useSz = wxDefaultSize; useSz.x = sz.x; #else wxSize useSz = sz; #endif ctrl->Create(propgrid, wxPG_SUBID1, prop->GetDateValue(), pos, useSz, prop->GetDatePickerStyle() | wxNO_BORDER); // Connect all required events to grid's OnCustomEditorEvent // (all relevenat wxTextCtrl, wxComboBox and wxButton events are // already connected) propgrid->Connect( wxPG_SUBID1, wxEVT_DATE_CHANGED, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) &wxPropertyGrid::OnCustomEditorEvent ); #ifdef __WXMSW__ ctrl->Show(); #endif return ctrl; } // Copies value from property to control void wxPGDatePickerCtrlEditor::UpdateControl( wxPGProperty* property, wxWindow* wnd ) const { wxDatePickerCtrl* ctrl = (wxDatePickerCtrl*) wnd; wxASSERT( ctrl && ctrl->IsKindOf(CLASSINFO(wxDatePickerCtrl)) ); // We assume that property's data type is 'int' (or something similar), // thus allowing us to get raw, unchecked value via DoGetValue. ctrl->SetValue( *((const wxDateTime*)property->DoGetValue().GetVoidPtr()) ); } // Control's events are redirected here bool wxPGDatePickerCtrlEditor::OnEvent( wxPropertyGrid* WXUNUSED(propgrid), wxPGProperty* WXUNUSED(property), wxWindow* WXUNUSED(wnd), wxEvent& event ) const { if ( event.GetEventType() == wxEVT_DATE_CHANGED ) return true; return false; } bool wxPGDatePickerCtrlEditor::CopyValueFromControl( wxPGProperty* property, wxWindow* wnd ) const { wxDatePickerCtrl* ctrl = (wxDatePickerCtrl*) wnd; wxASSERT( ctrl && ctrl->IsKindOf(CLASSINFO(wxDatePickerCtrl)) ); wxDatePropertyClass* prop = (wxDatePropertyClass*) property; prop->SetDateValue( ctrl->GetValue() ); return true; } void wxPGDatePickerCtrlEditor::SetValueToUnspecified( wxWindow* WXUNUSED(wnd) ) const { // TODO? //wxDateProperty* prop = (wxDateProperty*) property; //ctrl->SetValue(?); } #endif // wxUSE_DATEPICKCTRL // ----------------------------------------------------------------------- // wxFontProperty // ----------------------------------------------------------------------- #include #include static const wxChar* gs_fp_es_family_labels[] = { wxT("Default"), wxT("Decorative"), wxT("Roman"), wxT("Script"), wxT("Swiss"), wxT("Modern"), wxT("Teletype"), (const wxChar*) NULL }; static long gs_fp_es_family_values[] = { wxFONTFAMILY_DEFAULT, wxFONTFAMILY_DECORATIVE, wxFONTFAMILY_ROMAN, wxFONTFAMILY_SCRIPT, wxFONTFAMILY_SWISS, wxFONTFAMILY_MODERN, wxFONTFAMILY_TELETYPE }; static const wxChar* gs_fp_es_style_labels[] = { wxT("Normal"), wxT("Slant"), wxT("Italic"), (const wxChar*) NULL }; static long gs_fp_es_style_values[] = { wxNORMAL, wxSLANT, wxITALIC }; static const wxChar* gs_fp_es_weight_labels[] = { wxT("Normal"), wxT("Light"), wxT("Bold"), (const wxChar*) NULL }; static long gs_fp_es_weight_values[] = { wxNORMAL, wxLIGHT, wxBOLD }; // Class body is in advprops.h WX_PG_IMPLEMENT_PROPERTY_CLASS(wxFontProperty,wxBaseParentProperty, wxFontPropertyValue,const wxFontPropertyValue&,TextCtrlAndButton) wxFontPropertyClass::wxFontPropertyClass( const wxString& label, const wxString& name, const wxFontPropertyValue& value ) : wxPGPropertyWithChildren(label,name) { wxPG_INIT_REQUIRED_TYPE(wxFontPropertyValue) DoSetValue( wxPGVariantCreator(value) ); // Initialize font family choices list if ( !wxPGGlobalVars->m_fontFamilyChoices ) { WX_PG_GLOBALS_LOCKER() wxFontEnumerator enumerator; enumerator.EnumerateFacenames(); #if wxMINOR_VERSION > 6 wxArrayString faceNames = enumerator.GetFacenames(); #else wxArrayString& faceNames = *enumerator.GetFacenames(); #endif // Allow empty string as a default facename faceNames.Add( wxEmptyString ); faceNames.Sort(); wxPGGlobalVars->m_fontFamilyChoices = new wxPGChoices(faceNames); } wxString emptyString(wxEmptyString); AddChild( wxIntProperty( _("Point Size"),emptyString,m_value_wxFont.GetPointSize() ) ); AddChild( wxEnumProperty(_("Family"), emptyString, gs_fp_es_family_labels,gs_fp_es_family_values, m_value_wxFont.GetFamily()) ); wxString faceName = m_value_wxFont.GetFaceName(); // If font was not in there, add it now if ( faceName.length() && wxPGGlobalVars->m_fontFamilyChoices->Index(faceName) == wxNOT_FOUND ) wxPGGlobalVars->m_fontFamilyChoices->AddAsSorted(faceName); wxPGProperty* p = wxEnumProperty(_("Face Name"),emptyString, *wxPGGlobalVars->m_fontFamilyChoices); p->SetValueFromString(faceName,wxPG_FULL_VALUE); AddChild( p ); AddChild( wxEnumProperty(_("Style"),emptyString, gs_fp_es_style_labels,gs_fp_es_style_values,m_value_wxFont.GetStyle()) ); AddChild( wxEnumProperty(_("Weight"),emptyString, gs_fp_es_weight_labels,gs_fp_es_weight_values,m_value_wxFont.GetWeight()) ); AddChild( wxBoolProperty(_("Underlined"),emptyString, m_value_wxFont.GetUnderlined()) ); } wxFontPropertyClass::~wxFontPropertyClass () { } void wxFontPropertyClass::DoSetValue( wxPGVariant value ) { const wxFontPropertyValue* font = wxPGVariantToWxObjectPtr(value,wxFontPropertyValue); m_value_wxFont = *font; RefreshChildren(); } wxPGVariant wxFontPropertyClass::DoGetValue() const { return wxPGVariantCreator(m_value_wxFont); } wxString wxFontPropertyClass::GetValueAsString( int argFlags ) const { return wxPGPropertyWithChildren::GetValueAsString(argFlags); } bool wxFontPropertyClass::OnEvent( wxPropertyGrid* propgrid, wxWindow* primary, wxEvent& event ) { if ( event.GetEventType() == wxEVT_COMMAND_BUTTON_CLICKED ) { // Update value from last minute changes PrepareValueForDialogEditing(propgrid); wxFontData data; data.SetInitialFont(m_value_wxFont.GetFont()); data.SetColour(*wxBLACK); wxFontDialog dlg(propgrid, data); if ( dlg.ShowModal() == wxID_OK ) { propgrid->EditorsValueWasModified(); wxFontData retData = dlg.GetFontData(); wxFont font = retData.GetChosenFont(); DoSetValue(wxPGVariantCreator(wxFontPropertyValue(font))); UpdateControl(primary); return true; } } return false; } void wxFontPropertyClass::RefreshChildren() { if ( !GetCount() ) return; Item(0)->DoSetValue( (long)m_value_wxFont.GetPointSize() ); Item(1)->DoSetValue( (long)m_value_wxFont.GetFamily() ); Item(2)->SetValueFromString( m_value_wxFont.GetFaceName(), wxPG_FULL_VALUE ); Item(3)->DoSetValue( (long)m_value_wxFont.GetStyle() ); Item(4)->DoSetValue( (long)m_value_wxFont.GetWeight() ); Item(5)->DoSetValue( m_value_wxFont.GetUnderlined() ? 1 : 0 ); } void wxFontPropertyClass::ChildChanged( wxPGProperty* p ) { wxASSERT( this == p->GetParent() ); int ind = p->GetIndexInParent(); if ( ind == 0 ) { m_value_wxFont.SetPointSize( wxPGVariantToLong(p->DoGetValue()) ); } else if ( ind == 1 ) { int fam = p->DoGetValue().GetLong(); if ( fam < wxDEFAULT || fam > wxTELETYPE ) fam = wxDEFAULT; m_value_wxFont.SetFamily( fam ); } else if ( ind == 2 ) { m_value_wxFont.SetFaceName( p->GetValueAsString(wxPG_FULL_VALUE) ); } else if ( ind == 3 ) { int st = wxPGVariantToLong(p->DoGetValue()); if ( st != wxFONTSTYLE_NORMAL && st != wxFONTSTYLE_SLANT && st != wxFONTSTYLE_ITALIC ) st = wxFONTWEIGHT_NORMAL; m_value_wxFont.SetStyle( st ); } else if ( ind == 4 ) { int wt = wxPGVariantToLong(p->DoGetValue()); if ( wt != wxFONTWEIGHT_NORMAL && wt != wxFONTWEIGHT_LIGHT && wt != wxFONTWEIGHT_BOLD ) wt = wxFONTWEIGHT_NORMAL; m_value_wxFont.SetWeight( wt ); } else if ( ind == 5 ) { m_value_wxFont.SetUnderlined( wxPGVariantToBool(p->DoGetValue())?true:false ); } } /* wxSize wxFontPropertyClass::GetImageSize() const { return wxSize(-1,-1); } void wxFontPropertyClass::OnCustomPaint(wxDC& dc, const wxRect& rect, wxPGPaintData& paintData) { wxString drawFace; if ( paintData.m_choiceItem >= 0 ) drawFace = wxPGGlobalVars->m_fontFamilyChoices->GetLabel(paintData.m_choiceItem); else drawFace = m_value_wxFont.GetFaceName(); if ( drawFace.length() ) { // Draw the background dc.SetBrush( wxColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE)) ); //dc.SetBrush( *wxWHITE_BRUSH ); //dc.SetPen( *wxMEDIUM_GREY_PEN ); dc.DrawRectangle( rect ); wxFont oldFont = dc.GetFont(); wxFont drawFont(oldFont.GetPointSize(), wxDEFAULT,wxNORMAL,wxBOLD,false,drawFace); dc.SetFont(drawFont); dc.SetTextForeground( wxSystemSettings::GetColour(wxSYS_COLOUR_BTNTEXT) ); dc.DrawText( wxT("Aa"), rect.x+2, rect.y+1 ); dc.SetFont(oldFont); } else { // No file - just draw a white box dc.SetBrush ( *wxWHITE_BRUSH ); dc.DrawRectangle ( rect ); } } */ // ----------------------------------------------------------------------- // wxSystemColourProperty // ----------------------------------------------------------------------- // wxEnumProperty based classes cannot use wxPG_PROP_CLASS_SPECIFIC_1 #define wxPG_PROP_HIDE_CUSTOM_COLOUR wxPG_PROP_CLASS_SPECIFIC_2 #include //#define wx_cp_es_syscolours_len 25 static const wxChar* gs_cp_es_syscolour_labels[] = { wxT("AppWorkspace"), wxT("ActiveBorder"), wxT("ActiveCaption"), wxT("ButtonFace"), wxT("ButtonHighlight"), wxT("ButtonShadow"), wxT("ButtonText"), wxT("CaptionText"), wxT("ControlDark"), wxT("ControlLight"), wxT("Desktop"), wxT("GrayText"), wxT("Highlight"), wxT("HighlightText"), wxT("InactiveBorder"), wxT("InactiveCaption"), wxT("InactiveCaptionText"), wxT("Menu"), wxT("Scrollbar"), wxT("Tooltip"), wxT("TooltipText"), wxT("Window"), wxT("WindowFrame"), wxT("WindowText"), wxT("Custom"), (const wxChar*) NULL }; static long gs_cp_es_syscolour_values[] = { wxSYS_COLOUR_APPWORKSPACE, wxSYS_COLOUR_ACTIVEBORDER, wxSYS_COLOUR_ACTIVECAPTION, wxSYS_COLOUR_BTNFACE, wxSYS_COLOUR_BTNHIGHLIGHT, wxSYS_COLOUR_BTNSHADOW, wxSYS_COLOUR_BTNTEXT , wxSYS_COLOUR_CAPTIONTEXT, wxSYS_COLOUR_3DDKSHADOW, wxSYS_COLOUR_3DLIGHT, wxSYS_COLOUR_BACKGROUND, wxSYS_COLOUR_GRAYTEXT, wxSYS_COLOUR_HIGHLIGHT, wxSYS_COLOUR_HIGHLIGHTTEXT, wxSYS_COLOUR_INACTIVEBORDER, wxSYS_COLOUR_INACTIVECAPTION, wxSYS_COLOUR_INACTIVECAPTIONTEXT, wxSYS_COLOUR_MENU, wxSYS_COLOUR_SCROLLBAR, wxSYS_COLOUR_INFOBK, wxSYS_COLOUR_INFOTEXT, wxSYS_COLOUR_WINDOW, wxSYS_COLOUR_WINDOWFRAME, wxSYS_COLOUR_WINDOWTEXT, wxPG_COLOUR_CUSTOM }; // Class body is in advprops.h WX_PG_IMPLEMENT_PROPERTY_CLASS(wxSystemColourProperty,wxEnumProperty, wxColourPropertyValue,const wxColourPropertyValue&,Choice) void wxSystemColourPropertyClass::Init( int type, const wxColour& colour ) { m_value.m_type = type; if ( colour.Ok() ) m_value.m_colour = colour; else m_value.m_colour = *wxWHITE; m_flags |= wxPG_PROP_STATIC_CHOICES; // Colour selection cannot be changed. } static wxPGChoices gs_wxSystemColourProperty_choicesCache; wxSystemColourPropertyClass::wxSystemColourPropertyClass( const wxString& label, const wxString& name, const wxColourPropertyValue& value ) : wxEnumPropertyClass( label, name, gs_cp_es_syscolour_labels, gs_cp_es_syscolour_values, &gs_wxSystemColourProperty_choicesCache ) { wxPG_INIT_REQUIRED_TYPE(wxColourPropertyValue) if ( &value ) Init(value.m_type,value.m_colour); else Init(0,*wxBLACK); DoSetValue( &m_value ); } wxSystemColourPropertyClass::wxSystemColourPropertyClass( const wxString& label, const wxString& name, const wxChar** labels, const long* values, wxPGChoices* choicesCache, const wxColourPropertyValue& value ) : wxEnumPropertyClass( label, name, labels, values, choicesCache ) { if ( &value ) Init(value.m_type,value.m_colour); else Init(wxPG_COLOUR_CUSTOM,*wxBLACK); } wxSystemColourPropertyClass::wxSystemColourPropertyClass( const wxString& label, const wxString& name, const wxChar** labels, const long* values, wxPGChoices* choicesCache, const wxColour& value ) : wxEnumPropertyClass( label, name, labels, values, choicesCache ) { Init(wxPG_COLOUR_CUSTOM,value); } wxSystemColourPropertyClass::~wxSystemColourPropertyClass() { } int wxSystemColourPropertyClass::ColToInd( const wxColour& colour ) { size_t i; size_t i_max = m_choices.GetCount() - 1; if ( !colour.Ok() ) return wxNOT_FOUND; long pixval = wxPG_COLOUR(colour.Red(),colour.Green(),colour.Blue()); const wxArrayInt& arrValues = m_choices.GetValues(); for ( i=0; i>8)&0xFF),((col>>16)&0xFF)); } void wxSystemColourPropertyClass::DoSetValue( wxPGVariant value ) { wxColourPropertyValue* pval = wxPGVariantToWxObjectPtr(value,wxColourPropertyValue); m_flags &= ~(wxPG_PROP_UNSPECIFIED); if ( pval != (wxColourPropertyValue*) NULL ) { if ( !pval->m_colour.Ok() ) { m_flags |= wxPG_PROP_UNSPECIFIED; m_index = wxNOT_FOUND; m_value.Init( wxPG_COLOUR_CUSTOM, *wxWHITE ); return; } else if ( pval != &m_value ) { m_value = *pval; } } else { m_value.Init( wxPG_COLOUR_CUSTOM, *wxWHITE ); } if ( m_value.m_type < wxPG_COLOUR_WEB_BASE ) { m_value.m_colour = GetColour( m_value.m_type ); wxEnumPropertyClass::DoSetValue( (long)m_value.m_type ); } else { m_index = m_choices.GetCount()-1; } } long wxSystemColourPropertyClass::GetColour( int index ) { wxColour colour = wxSystemSettings::GetColour ( (wxSystemColour)index ); return wxPG_COLOUR(colour.Red(),colour.Green(),colour.Blue()); } wxPGVariant wxSystemColourPropertyClass::DoGetValue() const { return wxPGVariantCreator(&m_value); } wxString wxSystemColourPropertyClass::GetValueAsString( int argFlags ) const { // Always show custom colour for non-choice editor // Assumes changed editor means its textctrl based... if ( m_value.m_type == wxPG_COLOUR_CUSTOM || (argFlags & wxPG_PROPERTY_SPECIFIC) ) { /*#ifdef __WXDEBUG__ // Sanity check if ( m_value.m_type != wxPG_COLOUR_CUSTOM && (GetEditorClass() == wxPG_EDITOR(Choice) || GetEditorClass() == wxPG_EDITOR(ChoiceAndButton)) ) { wxLogDebug(wxT("wxSystemColourPropertyClass: Assumed wrong editor type!!!")); } #endif*/ return wxString::Format(wxT("(%i,%i,%i)"), (int)m_value.m_colour.Red(), (int)m_value.m_colour.Green(), (int)m_value.m_colour.Blue()); } return m_choices.GetLabel(m_index); } wxSize wxSystemColourPropertyClass::GetImageSize() const { return wxSize(-1,-1); } bool wxSystemColourPropertyClass::QueryColourFromUser( wxPropertyGrid* propgrid, wxWindow* primary ) { bool res = false; m_value.m_type = wxPG_COLOUR_CUSTOM; wxColourData data; data.SetChooseFull(true); data.SetColour(m_value.m_colour); int i; for ( i = 0; i < 16; i++) { wxColour colour(i*16, i*16, i*16); data.SetCustomColour(i, colour); } wxColourDialog dialog(propgrid, &data); if ( dialog.ShowModal() == wxID_OK ) { wxColourData retData = dialog.GetColourData(); m_value.m_colour = retData.GetColour(); wxSystemColourPropertyClass::DoSetValue(&m_value); res = true; } // Update text in combo box (so it is "(R,G,B)" not "Custom"). if ( primary ) GetEditorClass()->SetControlStringValue(primary,GetValueAsString(0)); return res; } // Need to do some extra event handling. bool wxSystemColourPropertyClass::OnEvent( wxPropertyGrid* propgrid, wxWindow* primary, wxEvent& event ) { if ( event.GetEventType() == wxEVT_COMMAND_COMBOBOX_SELECTED ) { int index = m_index; // m_index has already been updated. int type = wxEnumPropertyClass::DoGetValue().GetLong(); const wxArrayInt& arrValues = m_choices.GetValues(); if ( ( arrValues.GetCount() && type == wxPG_COLOUR_CUSTOM ) || ( !arrValues.GetCount() && (index == (int)(m_choices.GetCount()-1) && !(m_flags & wxPG_PROP_HIDE_CUSTOM_COLOUR)) ) ) { QueryColourFromUser(propgrid,primary); return true; } else { m_value.m_type = type; m_value.m_colour = GetColour( type ); } } else if ( event.GetEventType() == wxEVT_COMMAND_BUTTON_CLICKED ) { // We need to handle button click in case editor has been // switched to one that has wxButton as well. return QueryColourFromUser(propgrid,primary); } return false; } void wxSystemColourPropertyClass::OnCustomPaint( wxDC& dc, const wxRect& rect, wxPGPaintData& paintdata ) { if ( paintdata.m_choiceItem >= 0 && ( paintdata.m_choiceItem < (int)(GetItemCount()-1) || (m_flags & wxPG_PROP_HIDE_CUSTOM_COLOUR)) ) { int colInd; const wxArrayInt& values = m_choices.GetValues(); if ( values.GetCount() ) colInd = values[paintdata.m_choiceItem]; else colInd = paintdata.m_choiceItem; dc.SetBrush ( wxColour ( GetColour ( colInd ) ) ); } else if ( !(m_flags & wxPG_PROP_UNSPECIFIED) ) dc.SetBrush ( m_value.m_colour ); else dc.SetBrush ( *wxWHITE ); dc.DrawRectangle ( rect ); } bool wxSystemColourPropertyClass::SetValueFromString( const wxString& text, int flags ) { wxColourPropertyValue val; if ( text[0] == wxT('(') ) { // Custom colour. val.m_type = wxPG_COLOUR_CUSTOM; int r, g, b; wxSscanf(text.c_str(),wxT("(%i,%i,%i)"),&r,&g,&b); val.m_colour.Set(r,g,b); wxSystemColourPropertyClass::DoSetValue( &val ); return true; } else { // Predefined colour. bool res = wxEnumPropertyClass::SetValueFromString(text,flags); if ( res ) { val.m_type = m_index; const wxArrayInt& values = GetValues(); if ( values.GetCount() ) val.m_type = values[m_index]; // Get proper colour for type. val.m_colour = wxColourFromPGLong(GetColour(val.m_type)); wxSystemColourPropertyClass::DoSetValue( &val ); return true; } } return false; } void wxSystemColourPropertyClass::SetAttribute( int id, wxVariant& value ) { if ( id == wxPG_COLOUR_ALLOW_CUSTOM ) { int ival = value.GetLong(); SetChoicesExclusive(); // Make sure we don't corrupt colour lists of other properties if ( ival && (m_flags & wxPG_PROP_HIDE_CUSTOM_COLOUR) ) { // Show custom choice m_choices.Add(wxT("Custom"),wxPG_COLOUR_CUSTOM); m_flags &= ~(wxPG_PROP_HIDE_CUSTOM_COLOUR); } else if ( !ival && !(m_flags & wxPG_PROP_HIDE_CUSTOM_COLOUR) ) { // Hide custom choice m_choices.RemoveAt(m_choices.GetCount()-1); m_flags |= wxPG_PROP_HIDE_CUSTOM_COLOUR; } } } // ----------------------------------------------------------------------- // wxColourProperty // ----------------------------------------------------------------------- static const wxChar* gs_cp_es_normcolour_labels[] = { wxT("Black"), wxT("Maroon"), wxT("Navy"), wxT("Purple"), wxT("Teal"), wxT("Gray"), wxT("Green"), wxT("Olive"), wxT("Brown"), wxT("Blue"), wxT("Fuchsia"), wxT("Red"), wxT("Orange"), wxT("Silver"), wxT("Lime"), wxT("Aqua"), wxT("Yellow"), wxT("White"), wxT("Custom"), (const wxChar*) NULL }; static unsigned long gs_cp_es_normcolour_colours[] = { wxPG_COLOUR(0,0,0), wxPG_COLOUR(128,0,0), wxPG_COLOUR(0,0,128), wxPG_COLOUR(128,0,128), wxPG_COLOUR(0,128,128), wxPG_COLOUR(128,128,128), wxPG_COLOUR(0,128,0), wxPG_COLOUR(128,128,0), wxPG_COLOUR(166,124,81), wxPG_COLOUR(0,0,255), wxPG_COLOUR(255,0,255), wxPG_COLOUR(255,0,0), wxPG_COLOUR(247,148,28), wxPG_COLOUR(192,192,192), wxPG_COLOUR(0,255,0), wxPG_COLOUR(0,255,255), wxPG_COLOUR(255,255,0), wxPG_COLOUR(255,255,255), wxPG_COLOUR(0,0,0) }; WX_PG_IMPLEMENT_CUSTOM_COLOUR_PROPERTY_USES_WXCOLOUR2(wxColourProperty, wxColourPropertyClass, gs_cp_es_normcolour_labels, (const long*)NULL, gs_cp_es_normcolour_colours, TextCtrlAndButton) // ----------------------------------------------------------------------- // wxCursorProperty // ----------------------------------------------------------------------- #define wxPG_CURSOR_IMAGE_WIDTH 32 //#define wx_cp_es_syscursors_len 28 static const wxChar* gs_cp_es_syscursors_labels[] = { wxT("Default"), wxT("Arrow"), wxT("Right Arrow"), wxT("Blank"), wxT("Bullseye"), wxT("Character"), wxT("Cross"), wxT("Hand"), wxT("I-Beam"), wxT("Left Button"), wxT("Magnifier"), wxT("Middle Button"), wxT("No Entry"), wxT("Paint Brush"), wxT("Pencil"), wxT("Point Left"), wxT("Point Right"), wxT("Question Arrow"), wxT("Right Button"), wxT("Sizing NE-SW"), wxT("Sizing N-S"), wxT("Sizing NW-SE"), wxT("Sizing W-E"), wxT("Sizing"), wxT("Spraycan"), wxT("Wait"), wxT("Watch"), wxT("Wait Arrow"), (const wxChar*) NULL }; static long gs_cp_es_syscursors_values[] = { wxCURSOR_NONE, wxCURSOR_ARROW, wxCURSOR_RIGHT_ARROW, wxCURSOR_BLANK, wxCURSOR_BULLSEYE, wxCURSOR_CHAR, wxCURSOR_CROSS, wxCURSOR_HAND, wxCURSOR_IBEAM, wxCURSOR_LEFT_BUTTON, wxCURSOR_MAGNIFIER, wxCURSOR_MIDDLE_BUTTON, wxCURSOR_NO_ENTRY, wxCURSOR_PAINT_BRUSH, wxCURSOR_PENCIL, wxCURSOR_POINT_LEFT, wxCURSOR_POINT_RIGHT, wxCURSOR_QUESTION_ARROW, wxCURSOR_RIGHT_BUTTON, wxCURSOR_SIZENESW, wxCURSOR_SIZENS, wxCURSOR_SIZENWSE, wxCURSOR_SIZEWE, wxCURSOR_SIZING, wxCURSOR_SPRAYCAN, wxCURSOR_WAIT, wxCURSOR_WATCH, wxCURSOR_ARROWWAIT }; WX_PG_IMPLEMENT_DERIVED_PROPERTY_CLASS(wxCursorProperty,wxEnumProperty,int) wxCursorPropertyClass::wxCursorPropertyClass( const wxString& label, const wxString& name, int value ) : wxEnumPropertyClass( label, name, gs_cp_es_syscursors_labels, gs_cp_es_syscursors_values, value ) { m_flags |= wxPG_PROP_STATIC_CHOICES; // Cursor selection cannot be changed. //wxEnumPropertyClass::DoSetValue ( (void*)&value, NULL ); } wxCursorPropertyClass::~wxCursorPropertyClass() { } wxSize wxCursorPropertyClass::GetImageSize() const { #if wxPG_CAN_DRAW_CURSOR return wxSize(wxPG_CURSOR_IMAGE_WIDTH,wxPG_CURSOR_IMAGE_WIDTH); #else return wxSize(0,0); #endif } #if wxPG_CAN_DRAW_CURSOR void wxCursorPropertyClass::OnCustomPaint( wxDC& dc, const wxRect& rect, wxPGPaintData& paintdata ) { // Background brush dc.SetBrush( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ) ); if ( paintdata.m_choiceItem >= 0 ) { dc.DrawRectangle( rect ); int cursorindex = gs_cp_es_syscursors_values[paintdata.m_choiceItem]; /* if ( cursorindex == wxPG_CURSOR_FROM_FILE ) { wxFAIL_MSG(wxT("not implemented")); } else if ( cursorindex == wxPG_CURSOR_FROM_RESOURCE ) { wxFAIL_MSG(wxT("not implemented")); } else */ { if ( cursorindex == wxCURSOR_NONE ) cursorindex = wxCURSOR_ARROW; wxCursor cursor( cursorindex ); #ifdef __WXMSW__ ::DrawIconEx( (HDC)dc.GetHDC(), rect.x, rect.y, (HICON)cursor.GetHandle(), 0, 0, 0, NULL, DI_COMPAT | DI_DEFAULTSIZE | DI_NORMAL ); #endif } } } #else void wxCursorPropertyClass::OnCustomPaint( wxDC&, const wxRect&, wxPGPaintData& ) { } #endif // ----------------------------------------------------------------------- // wxImageFileProperty // ----------------------------------------------------------------------- #if wxUSE_IMAGE const wxString& wxPGGetDefaultImageWildcard( int* allImageFilesIndex = 0 ) { WX_PG_GLOBALS_LOCKER() // Form the wildcard, if not done yet if ( !wxPGGlobalVars->m_pDefaultImageWildcard.length() ) { wxString str; wxString imageFiles( wxT("All image files|") ); // TODO: This section may require locking (using global). wxList& handlers = wxImage::GetHandlers(); wxList::iterator node; // Let's iterate over the image handler list. //for ( wxList::Node *node = handlers.GetFirst(); node; node = node->GetNext() ) for ( node = handlers.begin(); node != handlers.end(); node++ ) { wxImageHandler *handler = (wxImageHandler*)*node; wxString ext_lo = handler->GetExtension(); wxString ext_up = ext_lo.Upper(); imageFiles.append( wxT("*.") ); imageFiles.append( ext_lo ); imageFiles.append( wxT(";") ); str.append( ext_up ); str.append( wxT(" files (*.") ); str.append( ext_up ); str.append( wxT(")|*.") ); str.append( ext_lo ); str.append( wxT("|") ); } imageFiles[imageFiles.length() - 1] = wxT('|'); str.append( imageFiles ); str.append ( wxT("All files (*.*)|*.*") ); wxPGGlobalVars->m_pDefaultImageWildcard = str; wxPGGlobalVars->m_pDefaultImageFilterIndex = handlers.GetCount(); if ( allImageFilesIndex != 0 ) { *allImageFilesIndex = handlers.GetCount(); } } if ( allImageFilesIndex != 0 ) { *allImageFilesIndex = wxPGGlobalVars->m_pDefaultImageFilterIndex; } return wxPGGlobalVars->m_pDefaultImageWildcard; } WX_PG_IMPLEMENT_DERIVED_PROPERTY_CLASS(wxImageFileProperty, wxFileProperty, const wxString&) wxImageFilePropertyClass::wxImageFilePropertyClass( const wxString& label, const wxString& name, const wxString& value ) : wxFilePropertyClass(label,name,value) { m_wildcard = wxPGGetDefaultImageWildcard( &m_indFilter ); m_pImage = (wxImage*) NULL; m_pBitmap = (wxBitmap*) NULL; } wxImageFilePropertyClass::~wxImageFilePropertyClass() { if ( m_pBitmap ) delete m_pBitmap; if ( m_pImage ) delete m_pImage; } void wxImageFilePropertyClass::DoSetValue( wxPGVariant value ) { wxFilePropertyClass::DoSetValue(value); // Delete old image if ( m_pImage ) { delete m_pImage; m_pImage = NULL; } if ( m_pBitmap ) { delete m_pBitmap; m_pBitmap = NULL; } // Create the image thumbnail if ( m_filename.FileExists() ) { m_pImage = new wxImage ( m_filename.GetFullPath() ); } } wxSize wxImageFilePropertyClass::GetImageSize() const { return wxSize(-1,-1); } void wxImageFilePropertyClass::OnCustomPaint( wxDC& dc, const wxRect& rect, wxPGPaintData& ) { if ( m_pBitmap || (m_pImage && m_pImage->Ok() ) ) { // Draw the thumbnail // Create the bitmap here because required size is not known in DoSetValue(). if ( !m_pBitmap ) { m_pImage->Rescale( rect.width, rect.height ); m_pBitmap = new wxBitmap( *m_pImage ); delete m_pImage; m_pImage = NULL; } dc.DrawBitmap( *m_pBitmap, rect.x, rect.y, false ); } else { // No file - just draw a white box dc.SetBrush( *wxWHITE_BRUSH ); dc.DrawRectangle ( rect ); } } #endif // wxUSE_IMAGE // ----------------------------------------------------------------------- // wxMultiChoiceProperty // ----------------------------------------------------------------------- #if wxUSE_CHOICEDLG #include #ifndef __WXPYTHON__ wxPGProperty* wxPG_CONSTFUNC(wxMultiChoiceProperty)(const wxString& label, const wxString& name, const wxPGChoices& choices, const wxArrayInt& value) { return new wxPG_PROPCLASS(wxMultiChoiceProperty)(label,name,choices,value); } #endif wxPGProperty* wxPG_CONSTFUNC(wxMultiChoiceProperty)(const wxString& label, const wxString& name, const wxArrayString& strings, const wxArrayInt& value) { return new wxPG_PROPCLASS(wxMultiChoiceProperty)(label,name,strings,value); } WX_PG_IMPLEMENT_PROPERTY_CLASS(wxMultiChoiceProperty,wxBaseProperty, wxArrayInt,const wxArrayInt&,TextCtrlAndButton) wxMultiChoicePropertyClass::wxMultiChoicePropertyClass(const wxString& label, const wxString& name, const wxPGChoices& choices, const wxArrayInt& value) : wxPGProperty(label,name) { wxPG_INIT_REQUIRED_TYPE(wxArrayInt) m_choices.Assign(choices); SetValueI(value); } wxMultiChoicePropertyClass::wxMultiChoicePropertyClass(const wxString& label, const wxString& name, const wxArrayString& strings, const wxArrayInt& value) : wxPGProperty(label,name) { wxPG_INIT_REQUIRED_TYPE(wxArrayInt) m_choices.Set(strings); SetValueI(value); } wxMultiChoicePropertyClass::wxMultiChoicePropertyClass(const wxString& label, const wxString& name, const wxArrayInt& WXUNUSED(value)) : wxPGProperty(label,name) { } wxMultiChoicePropertyClass::~wxMultiChoicePropertyClass() { } void wxMultiChoicePropertyClass::SetValueI( const wxArrayInt& arr ) { if ( &arr ) { m_value_wxArrayInt = arr; GenerateValueAsString(); } else { m_display = wxEmptyString; } } void wxMultiChoicePropertyClass::DoSetValue( wxPGVariant value ) { #if !wxPG_PGVARIANT_IS_VARIANT wxArrayInt* pObj = (wxArrayInt*)wxPGVariantToVoidPtr(value); SetValueI(*pObj); #else wxArrayInt arr = wxPGVariantToArrayInt(value); SetValueI(arr); #endif } wxPGVariant wxMultiChoicePropertyClass::DoGetValue() const { return wxPGVariantCreator(m_value_wxArrayInt); } wxString wxMultiChoicePropertyClass::GetValueAsString( int ) const { return m_display; } void wxMultiChoicePropertyClass::GenerateValueAsString() { // Allow zero-length strings list if ( !m_choices.IsOk() || !m_choices.GetCount() ) { m_display = wxEmptyString; return; } wxString& tempStr = m_display; wxArrayInt indices = GetValueAsIndices(); unsigned int i; unsigned int itemCount = indices.GetCount(); tempStr.Empty(); if ( itemCount ) tempStr.append( wxT("\"") ); for ( i = 0; i < itemCount; i++ ) { int ind = indices.Item(i); wxCHECK_RET( ind >= 0 && ind < (int)m_choices.GetCount(), wxT("value out of range") ); tempStr.append( m_choices.GetLabel(ind) ); tempStr.append( wxT("\"") ); if ( i < (itemCount-1) ) tempStr.append ( wxT(" \"") ); } } wxArrayInt wxMultiChoicePropertyClass::GetValueAsIndices() const { const wxArrayInt& choiceValues = m_choices.GetValues(); if ( choiceValues.GetCount() ) { // Translate values to string indices. wxArrayInt selections; unsigned int i; for ( i=0; i= 0 ) selections.Add(sIndex); } return selections; } return m_value_wxArrayInt; } bool wxMultiChoicePropertyClass::OnEvent( wxPropertyGrid* propgrid, wxWindow* primary, wxEvent& event ) { if ( event.GetEventType() == wxEVT_COMMAND_BUTTON_CLICKED ) { // Update the value PrepareValueForDialogEditing(propgrid); // launch editor dialog wxMultiChoiceDialog dlg( propgrid, _("Make a selection:"), m_label, m_choices.GetCount(), &m_choices.GetLabels()[0], wxCHOICEDLG_STYLE ); dlg.Move( propgrid->GetGoodEditorDialogPosition(this,dlg.GetSize()) ); dlg.SetSelections(GetValueAsIndices()); if ( dlg.ShowModal() == wxID_OK ) { wxArrayInt arrInt = dlg.GetSelections(); const wxArrayInt& choiceValues = m_choices.GetValues(); if ( choiceValues.GetCount() ) { // Translate string indices to values. wxArrayInt values; unsigned int i; for ( i=0; im_itemCount = m_choices.GetCount(); choiceinfo->m_choices = &m_choices; } return -1; } bool wxMultiChoicePropertyClass::SetValueFromString( const wxString& text, int ) { m_value_wxArrayInt.Empty(); const wxArrayString& strings = m_choices.GetLabels(); const wxArrayInt& values = m_choices.GetValues(); WX_PG_TOKENIZER2_BEGIN(text,wxT('"')) int ind = strings.Index( token ); if ( ind != wxNOT_FOUND ) { if ( values.GetCount() ) ind = values.Item(ind); m_value_wxArrayInt.Add(ind); } WX_PG_TOKENIZER2_END() GenerateValueAsString(); return true; } #endif // wxUSE_CHOICEDLG // ----------------------------------------------------------------------- // wxDateProperty // ----------------------------------------------------------------------- #if wxUSE_DATETIME #if wxUSE_DATEPICKCTRL #define dtCtrl DatePickerCtrl #else #define dtCtrl TextCtrl #endif WX_PG_IMPLEMENT_PROPERTY_CLASS(wxDateProperty, wxBaseProperty, wxDateTime, const wxDateTime&, dtCtrl) wxString wxDatePropertyClass::ms_defaultDateFormat; wxDatePropertyClass::wxDatePropertyClass( const wxString& label, const wxString& name, const wxDateTime& value ) : wxPGProperty(label,name) { wxPGRegisterDefaultValueType(wxDateTime) #if wxUSE_DATEPICKCTRL wxPGRegisterEditorClass(DatePickerCtrl); m_dpStyle = wxDP_DEFAULT | wxDP_SHOWCENTURY; #else m_dpStyle = 0; #endif DoSetValue( value ); } wxDatePropertyClass::~wxDatePropertyClass() { } void wxDatePropertyClass::DoSetValue( wxPGVariant value ) { m_valueDateTime = wxPGVariantToDateTime(value); } wxPGVariant wxDatePropertyClass::DoGetValue() const { return wxPGVariantCreator(m_valueDateTime); } bool wxDatePropertyClass::SetValueFromString( const wxString& text, int WXUNUSED(argFlags) ) { const wxChar* c = m_valueDateTime.ParseFormat(text.c_str(),wxDefaultDateTimeFormat); return c ? true : false; } wxString wxDatePropertyClass::GetValueAsString( int argFlags ) const { const wxChar* format = (const wxChar*) NULL; if ( !m_valueDateTime.IsValid() ) return wxT("Invalid"); if ( !ms_defaultDateFormat.length() ) { #if wxUSE_DATEPICKCTRL bool showCentury = m_dpStyle & wxDP_SHOWCENTURY ? true : false; #else bool showCentury = true; #endif ms_defaultDateFormat = DetermineDefaultDateFormat( showCentury ); } if ( m_format.length() && !(argFlags & wxPG_FULL_VALUE) ) format = m_format.c_str(); // Determine default from locale // NB: This is really simple stuff, but can't figure anything // better without proper support in wxLocale if ( !format ) format = ms_defaultDateFormat.c_str(); return m_valueDateTime.Format(format); } wxString wxDatePropertyClass::DetermineDefaultDateFormat( bool showCentury ) { // This code is basicly copied from datectlg.cpp's SetFormat // wxString format; wxDateTime dt; dt.ParseFormat(wxT("2003-10-13"), wxT("%Y-%m-%d")); wxString str(dt.Format(wxT("%x"))); const wxChar *p = str.c_str(); while ( *p ) { int n=wxAtoi(p); if (n == dt.GetDay()) { format.Append(wxT("%d")); p += 2; } else if (n == (int)dt.GetMonth()+1) { format.Append(wxT("%m")); p += 2; } else if (n == dt.GetYear()) { format.Append(wxT("%Y")); p += 4; } else if (n == (dt.GetYear() % 100)) { if (showCentury) format.Append(wxT("%Y")); else format.Append(wxT("%y")); p += 2; } else format.Append(*p++); } return format; } void wxDatePropertyClass::SetAttribute( int id, wxVariant& value ) { if ( id == wxPG_DATE_FORMAT ) { m_format = value.GetString(); } else if ( id == wxPG_DATE_PICKER_STYLE ) { m_dpStyle = value.GetLong(); ms_defaultDateFormat.clear(); // This may need recalculation } } #endif // wxUSE_DATETIME // ----------------------------------------------------------------------- // wxPropertyContainerMethods // ----------------------------------------------------------------------- void wxPropertyContainerMethods::InitAllTypeHandlers() { wxPG_INIT_REQUIRED_TYPE(wxColour) wxPG_INIT_REQUIRED_TYPE(wxFontPropertyValue) wxPG_INIT_REQUIRED_TYPE(wxArrayInt) wxPG_INIT_REQUIRED_TYPE(wxColourPropertyValue) #if wxUSE_DATETIME wxPGRegisterDefaultValueType(wxDateTime) #endif } // ----------------------------------------------------------------------- void wxPropertyContainerMethods::RegisterAdditionalEditors() { #if wxUSE_SPINBTN wxPGRegisterEditorClass(SpinCtrl); #endif #if wxUSE_DATEPICKCTRL wxPGRegisterEditorClass(DatePickerCtrl); #endif } // ----------------------------------------------------------------------- void wxPropertyContainerMethods::RegisterAdvancedPropertyClasses() { wxPGRegisterPropertyClass(wxMultiChoiceProperty); wxPGRegisterPropertyClass(wxImageFileProperty); wxPGRegisterPropertyClass(wxColourProperty); wxPGRegisterPropertyClass(wxFontProperty); wxPGRegisterPropertyClass(wxSystemColourProperty); wxPGRegisterPropertyClass(wxCursorProperty); #if wxUSE_DATETIME wxPGRegisterPropertyClass(wxDateProperty); #endif } // ----------------------------------------------------------------------- #endif // wxPG_INCLUDE_ADVPROPS wxformbuilder-3.1.59/src/controls/src/propgrid/manager.cpp0000644000175000017500000014634111143440027024146 0ustar rrmulderrrmulder///////////////////////////////////////////////////////////////////////////// // Name: manager.cpp // Purpose: wxPropertyGridManager // Author: Jaakko Salli // Modified by: // Created: Jan-14-2005 // RCS-ID: $Id: // Copyright: (c) Jaakko Salli // Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "manager.h" #endif // For compilers that support precompilation, includes "wx/wx.h". #include "wx/wxprec.h" #ifdef __BORLANDC__ #pragma hdrstop #endif #ifndef WX_PRECOMP #include "wx/defs.h" #include "wx/object.h" #include "wx/hash.h" #include "wx/string.h" #include "wx/log.h" #include "wx/event.h" #include "wx/window.h" #include "wx/panel.h" #include "wx/dc.h" #include "wx/dcclient.h" #include "wx/button.h" #include "wx/pen.h" #include "wx/brush.h" #include "wx/cursor.h" #include "wx/dialog.h" #include "wx/settings.h" #include "wx/msgdlg.h" #include "wx/choice.h" #include "wx/stattext.h" #include "wx/textctrl.h" #include "wx/scrolwin.h" #include "wx/dirdlg.h" #include "wx/combobox.h" #include "wx/layout.h" #include "wx/sizer.h" #include "wx/textdlg.h" #include "wx/filedlg.h" #include "wx/statusbr.h" #include "wx/toolbar.h" #include "wx/intl.h" #endif // This define is necessary to prevent macro clearing #define __wxPG_SOURCE_FILE__ #include #include #define wxPG_MAN_ALTERNATE_BASE_ID 11249 // Needed for wxID_ANY madnesss // ----------------------------------------------------------------------- // For wxMSW cursor consistency, we must do mouse capturing even // when using custom controls #define BEGIN_MOUSE_CAPTURE \ if ( !(m_iFlags & wxPG_FL_MOUSE_CAPTURED) ) \ { \ CaptureMouse(); \ m_iFlags |= wxPG_FL_MOUSE_CAPTURED; \ } #define END_MOUSE_CAPTURE \ if ( m_iFlags & wxPG_FL_MOUSE_CAPTURED ) \ { \ ReleaseMouse(); \ m_iFlags &= ~(wxPG_FL_MOUSE_CAPTURED); \ } // ----------------------------------------------------------------------- // wxPropertyGridManager // ----------------------------------------------------------------------- const wxChar *wxPropertyGridManagerNameStr = wxT("wxPropertyGridManager"); // Categoric Mode Icon static const char* gs_xpm_catmode[] = { "16 16 5 1", ". c none", "B c black", "D c #868686", "L c #CACACA", "W c #FFFFFF", ".DDD............", ".DLD.BBBBBB.....", ".DDD............", ".....DDDDD.DDD..", "................", ".....DDDDD.DDD..", "................", ".....DDDDD.DDD..", "................", ".....DDDDD.DDD..", "................", ".DDD............", ".DLD.BBBBBB.....", ".DDD............", ".....DDDDD.DDD..", "................" }; // Alphabetic Mode Icon static const char* gs_xpm_noncatmode[] = { "16 16 5 1", ". c none", "B c black", "D c #868686", "L c #000080", "W c #FFFFFF", "..DBD...DDD.DDD.", ".DB.BD..........", ".BBBBB..DDD.DDD.", ".B...B..........", "...L....DDD.DDD.", "...L............", ".L.L.L..DDD.DDD.", "..LLL...........", "...L....DDD.DDD.", "................", ".BBBBB..DDD.DDD.", "....BD..........", "...BD...DDD.DDD.", "..BD............", ".BBBBB..DDD.DDD.", "................" }; // Default Page Icon. static const char* gs_xpm_defpage[] = { "16 16 5 1", ". c none", "B c black", "D c #868686", "L c #000080", "W c #FFFFFF", "................", "................", "..BBBBBBBBBBBB..", "..B..........B..", "..B.BB.LLLLL.B..", "..B..........B..", "..B.BB.LLLLL.B..", "..B..........B..", "..B.BB.LLLLL.B..", "..B..........B..", "..B.BB.LLLLL.B..", "..B..........B..", "..BBBBBBBBBBBB..", "................", "................", "................" }; /* // Categoric Mode Icon static const char* gs_xpm_catmode[] = { "12 12 5 1", ". c none", "B c black", "D c #868686", "L c #CACACA", "W c #FFFFFF", ".DDD............", ".DLD.BBBBBB.....", ".DDD............", ".....DDDDD.DDD..", "................", ".....DDDDD.DDD..", "................", ".....DDDDD.DDD..", "................", ".....DDDDD.DDD..", "................", ".DDD............" }; // Alphabetic Mode Icon static const char* gs_xpm_noncatmode[] = { "12 12 5 1", ". c none", "B c black", "D c #868686", "L c #000080", "W c #FFFFFF", "..DBD...DDD.DDD.", ".DB.BD..........", ".BBBBB..DDD.DDD.", ".B...B..........", "...L....DDD.DDD.", "...L............", ".L.L.L..DDD.DDD.", "..LLL...........", "...L....DDD.DDD.", "................", ".BBBBB..DDD.DDD.", "....BD.........." }; // Default Page Icon. static const char* gs_xpm_defpage[] = { "12 12 5 1", ". c none", "B c black", "D c #868686", "L c #000080", "W c #FFFFFF", "................", "................", "..BBBBBBBBBBBB..", "..B..........B..", "..B.BB.LLLLL.B..", "..B..........B..", "..B.BB.LLLLL.B..", "..B..........B..", "..B.BB.LLLLL.B..", "..B..........B..", "..B.BB.LLLLL.B..", "..B..........B.." };*/ // ----------------------------------------------------------------------- /** \class wxPropertyGridPageData \ingroup classes \brief Simple holder of propertygrid page information. */ /* class wxPropertyGridPageData { public: wxPropertyGridPageData() { } ~wxPropertyGridPageData() { } wxString m_label; wxPropertyGridState GetStatePtr(); int m_id; }; */ #define GetPageState(page) ((wxPropertyGridPage*)m_arrPages.Item(page))->GetStatePtr() // ----------------------------------------------------------------------- // wxPropertyGridPage // ----------------------------------------------------------------------- IMPLEMENT_CLASS(wxPropertyGridPage, wxEvtHandler) BEGIN_EVENT_TABLE(wxPropertyGridPage, wxEvtHandler) END_EVENT_TABLE() wxPropertyGridPage::wxPropertyGridPage() : wxEvtHandler(), wxPropertyContainerMethods(), wxPropertyGridState() { m_isDefault = false; m_pState = this; // wxPropertyContainerMethods to point to State } wxPropertyGridPage::~wxPropertyGridPage() { } void wxPropertyGridPage::RefreshProperty( wxPGProperty* p ) { m_manager->RefreshProperty(p); } /* bool wxPropertyGridPage::ProcessEvent( wxEvent& event ) { // By default, redirect unhandled events to the manager's parent if ( !wxEvtHandler::ProcessEvent(event) ) { if ( IsHandlingAllEvents() ) return false; m_manager->GetParent()->GetEventHandler()->AddPendingEvent(event); return true; } return true; }*/ wxPGId wxPropertyGridPage::Insert( wxPGId id, int index, wxPGProperty* property ) { return m_manager->Insert(id,index,property); } wxPGId wxPropertyGridPage::Insert( wxPGPropNameStr name, int index, wxPGProperty* property ) { return m_manager->Insert(name,index,property); } // ----------------------------------------------------------------------- // wxPropertyGridManager // ----------------------------------------------------------------------- // Final default splitter y is client height minus this. #define wxPGMAN_DEFAULT_NEGATIVE_SPLITTER_Y 100 // ----------------------------------------------------------------------- IMPLEMENT_CLASS(wxPropertyGridManager, wxPanel) #define ID_ADVTOOLBAR_OFFSET 1 #define ID_ADVHELPCAPTION_OFFSET 2 #define ID_ADVHELPCONTENT_OFFSET 3 #define ID_ADVBUTTON_OFFSET 4 #define ID_ADVTBITEMSBASE_OFFSET 5 // Must be last. // ----------------------------------------------------------------------- BEGIN_EVENT_TABLE(wxPropertyGridManager, wxPanel) EVT_MOTION(wxPropertyGridManager::OnMouseMove) EVT_SIZE(wxPropertyGridManager::OnResize) EVT_PAINT(wxPropertyGridManager::OnPaint) EVT_LEFT_DOWN(wxPropertyGridManager::OnMouseClick) EVT_LEFT_UP(wxPropertyGridManager::OnMouseUp) EVT_LEAVE_WINDOW(wxPropertyGridManager::OnMouseEntry) //EVT_ENTER_WINDOW(wxPropertyGridManager::OnMouseEntry) END_EVENT_TABLE() // ----------------------------------------------------------------------- wxPropertyGridManager::wxPropertyGridManager() : wxPanel() { Init1(); } // ----------------------------------------------------------------------- wxPropertyGridManager::wxPropertyGridManager( wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxChar* name ) : wxPanel() { Init1(); Create(parent,id,pos,size,style,name); } // ----------------------------------------------------------------------- bool wxPropertyGridManager::Create( wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxChar* name ) { bool res = wxPanel::Create( parent, id, pos, size, (style&0xFFFF0000)|wxWANTS_CHARS, name ); Init2(style); return res; } // ----------------------------------------------------------------------- // // Initialize values to defaults // void wxPropertyGridManager::Init1() { //m_pPropGrid = (wxPropertyGrid*) NULL; m_pPropGrid = CreatePropertyGrid(); #if wxUSE_TOOLBAR m_pToolbar = (wxToolBar*) NULL; #endif m_pTxtHelpCaption = (wxStaticText*) NULL; m_pTxtHelpContent = (wxStaticText*) NULL; m_pButCompactor = (wxButton*) NULL; m_targetState = (wxPropertyGridState*) NULL; m_emptyPage = (wxPropertyGridPage*) NULL; m_targetPage = 0; m_selPage = -1; m_width = m_height = 0; m_splitterHeight = 5; m_splitterY = -1; // -1 causes default to be set. m_nextDescBoxSize = -1; m_extraHeight = 0; m_dragStatus = 0; m_onSplitter = 0; m_iFlags = 0; } // ----------------------------------------------------------------------- // These flags are always used in wxPropertyGrid integrated in wxPropertyGridManager. #ifndef __WXMAC__ #define wxPG_MAN_PROPGRID_FORCED_FLAGS (wxSIMPLE_BORDER| \ wxNO_FULL_REPAINT_ON_RESIZE| \ wxCLIP_CHILDREN) #else // Looks better with no border on Mac #define wxPG_MAN_PROPGRID_FORCED_FLAGS (wxNO_BORDER| \ wxNO_FULL_REPAINT_ON_RESIZE| \ wxCLIP_CHILDREN) #endif // Which flags can be passed to underlying wxPropertyGrid. #define wxPG_MAN_PASS_FLAGS_MASK (0xFFF0|wxTAB_TRAVERSAL) // // Initialize after parent etc. set // void wxPropertyGridManager::Init2( int style ) { if ( m_iFlags & wxPG_FL_INITIALIZED ) return; m_windowStyle |= (style&0x0000FFFF); wxSize csz = GetClientSize(); m_cursorSizeNS = wxCursor(wxCURSOR_SIZENS); // Prepare the first page // NB: But just prepare - you still need to call Add/InsertPage // to actually add properties on it. wxPropertyGridPage* pd = new wxPropertyGridPage(); pd->m_isDefault = true; wxPropertyGridState* state = pd->GetStatePtr(); state->m_pPropGrid = m_pPropGrid; m_arrPages.Add( (void*)pd ); m_pPropGrid->m_pState = state; m_targetState = state; wxWindowID baseId = GetId(); wxWindowID useId = baseId; if ( baseId < 0 ) baseId = wxPG_MAN_ALTERNATE_BASE_ID; #ifdef __WXMAC__ // Smaller controls on Mac SetWindowVariant(wxWINDOW_VARIANT_SMALL); #endif // Create propertygrid. m_pPropGrid->Create(this,baseId,wxPoint(0,0),csz, (m_windowStyle&wxPG_MAN_PASS_FLAGS_MASK) |wxPG_MAN_PROPGRID_FORCED_FLAGS); m_pPropGrid->m_eventObject = this; m_pPropGrid->SetId(useId); m_pPropGrid->m_iFlags |= wxPG_FL_IN_MANAGER; m_pState = m_pPropGrid->m_pState; m_pPropGrid->SetExtraStyle(wxPG_EX_INIT_NOCAT); m_nextTbInd = baseId+ID_ADVTBITEMSBASE_OFFSET + 2; #ifndef __WXPYTHON__ // Connect to property grid onselect event. // NB: Even if wxID_ANY is used, this doesn't connect properly in wxPython // (see wxPropertyGridManager::ProcessEvent). Connect(m_pPropGrid->GetId()/*wxID_ANY*/, wxEVT_PG_SELECTED, wxPropertyGridEventHandler(wxPropertyGridManager::OnPropertyGridSelect) ); #endif // Connect to compactor button event. Connect(baseId+ID_ADVBUTTON_OFFSET, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(wxPropertyGridManager::OnCompactorClick) ); // Connect to toolbar button events. Connect(baseId+ID_ADVTBITEMSBASE_OFFSET,baseId+ID_ADVTBITEMSBASE_OFFSET+50, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(wxPropertyGridManager::OnToolbarClick) ); // Optional initial controls. m_width = -12345; m_iFlags |= wxPG_FL_INITIALIZED; } // ----------------------------------------------------------------------- wxPropertyGridManager::~wxPropertyGridManager() { END_MOUSE_CAPTURE m_pPropGrid->DoSelectProperty(NULL); m_pPropGrid->m_pState = NULL; size_t i; for ( i=0; iSetId(winid); } // ----------------------------------------------------------------------- wxSize wxPropertyGridManager::DoGetBestSize() const { /* //wxSize sz = m_pPropGrid->DoGetBestSize(); wxSize sz(60,m_pPropGrid->m_lineHeight); wxLogDebug(wxT("m_extraHeight: %i"),m_extraHeight); sz.y += m_extraHeight; wxLogDebug(wxT("sz.y: %i"),sz.y); //CacheBestSize(sz); return sz; */ return wxSize(60,150); } // ----------------------------------------------------------------------- bool wxPropertyGridManager::SetFont( const wxFont& font ) { bool res = wxWindow::SetFont(font); m_pPropGrid->SetFont(font); // TODO: Need to do caption recacalculations for other pages as well. return res; } // ----------------------------------------------------------------------- void wxPropertyGridManager::SetExtraStyle( long exStyle ) { wxWindow::SetExtraStyle( exStyle ); m_pPropGrid->SetExtraStyle( exStyle & 0xFFFFF000 ); #if wxUSE_TOOLBAR if ( (exStyle & wxPG_EX_NO_FLAT_TOOLBAR) && m_pToolbar ) RecreateControls(); #endif } // ----------------------------------------------------------------------- void wxPropertyGridManager::Freeze() { m_pPropGrid->Freeze(); wxWindow::Freeze(); } // ----------------------------------------------------------------------- void wxPropertyGridManager::Thaw() { wxWindow::Thaw(); m_pPropGrid->Thaw(); } // ----------------------------------------------------------------------- void wxPropertyGridManager::SetWindowStyleFlag( long style ) { wxWindow::SetWindowStyleFlag( style ); m_pPropGrid->SetWindowStyleFlag( (m_pPropGrid->GetWindowStyleFlag()&~(wxPG_MAN_PASS_FLAGS_MASK)) | (style&wxPG_MAN_PASS_FLAGS_MASK) ); } // ----------------------------------------------------------------------- // Actually shows given page. bool wxPropertyGridManager::DoSelectPage( int index ) { // -1 means no page was selected //wxASSERT( m_selPage >= 0 ); wxCHECK_MSG( index >= -1 && index < (int)GetPageCount(), false, wxT("invalid page index") ); if ( m_selPage == index ) return true; if ( m_pPropGrid->m_selected ) { if ( !m_pPropGrid->ClearSelection() ) return false; } wxPropertyGridPage* prevPage; if ( m_selPage >= 0 ) prevPage = GetPage(m_selPage); else prevPage = m_emptyPage; wxPropertyGridPage* nextPage; if ( index >= 0 ) { nextPage = (wxPropertyGridPage*)m_arrPages.Item(index); } else { if ( !m_emptyPage ) m_emptyPage = new wxPropertyGridPage(); nextPage = m_emptyPage; } m_iFlags |= wxPG_FL_DESC_REFRESH_REQUIRED; m_pPropGrid->SwitchState( nextPage->GetStatePtr() ); m_pState = m_pPropGrid->m_pState; m_selPage = index; #if wxUSE_TOOLBAR if ( m_pToolbar ) { if ( index >= 0 ) m_pToolbar->ToggleTool( nextPage->m_id, true ); else m_pToolbar->ToggleTool( prevPage->m_id, false ); } #endif return true; } // ----------------------------------------------------------------------- // Changes page *and* set the target page for insertion operations. void wxPropertyGridManager::SelectPage( int index ) { DoSelectPage(index); if ( index >= 0 ) SetTargetPage(index); } // ----------------------------------------------------------------------- int wxPropertyGridManager::GetPageByName( const wxChar* name ) const { wxASSERT( name ); size_t i; for ( i=0; im_label == name ) return i; } return wxNOT_FOUND; } // ----------------------------------------------------------------------- int wxPropertyGridManager::GetPageByState( wxPropertyGridState* pState ) const { wxASSERT( pState ); size_t i; for ( i=0; iGetStatePtr() ) return i; } return wxNOT_FOUND; } // ----------------------------------------------------------------------- const wxString& wxPropertyGridManager::GetPageName( int index ) const { wxASSERT( index >= 0 && index < (int)GetPageCount() ); return ((wxPropertyGridPage*)m_arrPages.Item(index))->m_label; } // ----------------------------------------------------------------------- // Sets page for append, insert, etc. operations. void wxPropertyGridManager::SetTargetPage( int index ) { wxASSERT( m_selPage >= 0 ); wxASSERT( index >= 0 ); wxASSERT( index < (int)GetPageCount() ); m_targetPage = index; m_targetState = ((wxPropertyGridPage*)m_arrPages.Item(index))->GetStatePtr(); } // ----------------------------------------------------------------------- void wxPropertyGridManager::ClearPage( int page ) { wxASSERT( page >= 0 ); wxASSERT( page < (int)GetPageCount() ); if ( page >= 0 && page < (int)GetPageCount() ) { wxPropertyGridState* state = GetPageState(page); if ( state == m_pPropGrid->GetState() ) m_pPropGrid->Clear(); else state->Clear(); } } // ----------------------------------------------------------------------- void wxPropertyGridManager::SetPropertyAttributeAll( int attrid, wxVariant value ) { size_t i; for ( i=0; iGetStatePtr()->m_properties),attrid,value,wxPG_RECURSE); } } // ----------------------------------------------------------------------- bool wxPropertyGridManager::Compact( bool compact ) { bool res = m_pPropGrid->Compact(compact); if ( res ) { if ( m_pButCompactor ) { if ( compact ) m_pButCompactor->SetLabel(wxT("Expand >>")); else m_pButCompactor->SetLabel(wxT("<< Compact")); } } return res; } // ----------------------------------------------------------------------- size_t wxPropertyGridManager::GetPageCount() const { if ( !(m_iFlags & wxPG_MAN_FL_PAGE_INSERTED) ) return 0; return m_arrPages.GetCount(); } // ----------------------------------------------------------------------- int wxPropertyGridManager::InsertPage( int index, const wxString& label, const wxBitmap& bmp, wxPropertyGridPage* pageObj ) { if ( index < 0 ) index = GetPageCount(); wxCHECK_MSG( (size_t)index == GetPageCount(), -1, wxT("wxPropertyGridManager currently only supports appending pages (due to wxToolBar limitation).")); bool needInit = true; bool isPageInserted = m_iFlags & wxPG_MAN_FL_PAGE_INSERTED ? true : false; wxASSERT( index == 0 || isPageInserted ); if ( !pageObj ) { // No custom page object was given, so we will either re-use the default base // page (if index==0), or create a new default page object. if ( !isPageInserted ) { pageObj = GetPage(0); // Of course, if the base page was custom, we need to delete and // re-create it. if ( !pageObj->m_isDefault ) { delete pageObj; pageObj = new wxPropertyGridPage(); m_arrPages[0] = pageObj; } needInit = false; } else { pageObj = new wxPropertyGridPage(); } pageObj->m_isDefault = true; } else { if ( !isPageInserted ) { // Initial page needs to be deleted and replaced delete GetPage(0); m_arrPages[0] = pageObj; m_pPropGrid->m_pState = pageObj->GetStatePtr(); } } wxPropertyGridState* state = pageObj->GetStatePtr(); pageObj->m_manager = this; if ( needInit ) { state->m_pPropGrid = m_pPropGrid; state->InitNonCatMode(); } pageObj->m_label = label; pageObj->m_id = m_nextTbInd; m_targetState = state; m_targetPage = index; if ( isPageInserted ) m_arrPages.Add( (void*)pageObj ); #if wxUSE_TOOLBAR if ( m_windowStyle & wxPG_TOOLBAR ) { if ( !m_pToolbar ) RecreateControls(); wxASSERT( m_pToolbar ); // Add separator before first page. if ( GetPageCount() < 2 && (GetExtraStyle()&wxPG_EX_MODE_BUTTONS) ) m_pToolbar->AddSeparator(); if ( &bmp != &wxNullBitmap ) m_pToolbar->AddTool(m_nextTbInd,label,bmp,label,wxITEM_RADIO); //m_pToolbar->InsertTool(index+3,m_nextTbInd,bmp); else m_pToolbar->AddTool(m_nextTbInd,label,wxBitmap( (const char**)gs_xpm_defpage ), label,wxITEM_RADIO); m_nextTbInd++; m_pToolbar->Realize(); } #else wxUnusedVar(bmp); #endif // If selected page was above the point of insertion, fix the current page index if ( isPageInserted ) { if ( m_selPage >= index ) { m_selPage += 1; } } else { // Set this value only when adding the first page m_selPage = 0; } pageObj->Init(); m_iFlags |= wxPG_MAN_FL_PAGE_INSERTED; return index; } // ----------------------------------------------------------------------- bool wxPropertyGridManager::IsAnyModified() const { size_t i; for ( i=0; iGetStatePtr()->m_anyModified ) return true; } return false; } // ----------------------------------------------------------------------- bool wxPropertyGridManager::IsPageModified( size_t index ) const { if ( ((wxPropertyGridPage*)m_arrPages.Item(index))->GetStatePtr()->m_anyModified ) return true; return false; } // ----------------------------------------------------------------------- wxPGId wxPropertyGridManager::GetPageRoot( int index ) const { wxASSERT( index >= 0 ); wxASSERT( index < (int)m_arrPages.GetCount() ); return ((wxPropertyGridPage*)m_arrPages.Item(index))->GetStatePtr()->m_properties; } // ----------------------------------------------------------------------- bool wxPropertyGridManager::RemovePage( int page ) { wxCHECK_MSG( (page >= 0) && (page < (int)GetPageCount()), false, wxT("invalid page index") ); wxPropertyGridPage* pd = (wxPropertyGridPage*)m_arrPages.Item(page); if ( m_arrPages.GetCount() == 1 ) { // Last page: do not remove page entry m_pPropGrid->Clear(); m_selPage = -1; m_iFlags &= ~wxPG_MAN_FL_PAGE_INSERTED; pd->m_label.clear(); } // Change selection if current is page else if ( page == m_selPage ) { if ( !m_pPropGrid->ClearSelection() ) return false; // Substitute page to select int substitute = page - 1; if ( substitute < 0 ) substitute = page + 1; SelectPage(substitute); } // Remove toolbar icon #if wxUSE_TOOLBAR if ( m_windowStyle & wxPG_TOOLBAR ) { wxASSERT( m_pToolbar ); int toolPos = GetExtraStyle() & wxPG_EX_MODE_BUTTONS ? 3 : 0; toolPos += page; m_pToolbar->DeleteToolByPos(toolPos); // Delete separator as well, for consistency if ( (GetExtraStyle() & wxPG_EX_MODE_BUTTONS) && GetPageCount() == 1 ) m_pToolbar->DeleteToolByPos(2); } #endif if ( m_arrPages.GetCount() > 1 ) { m_arrPages.RemoveAt(page); delete pd; } // Adjust indexes that were above removed if ( m_selPage > page ) m_selPage--; return true; } // ----------------------------------------------------------------------- bool wxPropertyGridManager::ProcessEvent( wxEvent& event ) { int evtType = event.GetEventType(); #ifdef __WXPYTHON__ // NB: For some reason, under wxPython, Connect in Init doesn't work properly, // so we'll need to call OnPropertyGridSelect manually. Multiple call's // don't really matter. if ( evtType == wxEVT_PG_SELECTED ) OnPropertyGridSelect((wxPropertyGridEvent&)event); #endif // Property grid events get special attention if ( evtType >= wxPG_BASE_EVT_TYPE && evtType < (wxPG_MAX_EVT_TYPE) && m_selPage >= 0 ) { wxPropertyGridPage* page = GetPage(m_selPage); wxPropertyGridEvent* pgEvent = wxDynamicCast(&event, wxPropertyGridEvent); // Add property grid events to appropriate custom pages // but stop propagating to parent if page says it is // handling everything. if ( pgEvent && !page->m_isDefault ) { if ( pgEvent->IsPending() ) page->AddPendingEvent(event); else page->ProcessEvent(event); if ( page->IsHandlingAllEvents() ) event.StopPropagation(); } } return wxPanel::ProcessEvent(event); } // ----------------------------------------------------------------------- void wxPropertyGridManager::RepaintSplitter( wxDC& dc, int new_splittery, int new_width, int new_height, bool desc_too ) { int use_hei = new_height; if ( m_pButCompactor ) use_hei = m_pButCompactor->GetPosition().y; // Draw background wxColour bgcol = GetBackgroundColour(); dc.SetBrush( bgcol ); dc.SetPen( bgcol ); int rect_hei = use_hei-new_splittery; if ( !desc_too ) rect_hei = m_splitterHeight; dc.DrawRectangle(0,new_splittery,new_width,rect_hei); dc.SetPen ( wxSystemSettings::GetColour ( wxSYS_COLOUR_3DDKSHADOW ) ); int splitter_bottom = new_splittery+m_splitterHeight - 1; int box_height = use_hei-splitter_bottom; if ( box_height > 1 ) dc.DrawRectangle(0,splitter_bottom,new_width,box_height); else dc.DrawLine(0,splitter_bottom,new_width,splitter_bottom); } // ----------------------------------------------------------------------- void wxPropertyGridManager::RefreshHelpBox( int new_splittery, int new_width, int new_height ) { //if ( new_splittery == m_splitterY && new_width == m_width ) // return; int use_hei = new_height; if ( m_pButCompactor ) use_hei = m_pButCompactor->GetPosition().y; use_hei--; //wxRendererNative::Get().DrawSplitterSash(this,dc, //wxSize(width,m_splitterHeight),new_splittery,wxHORIZONTAL); //wxRendererNative::Get().DrawSplitterBorder(this,dc, // wxRect(0,new_splittery,new_width,m_splitterHeight)); // Fix help control positions. int cap_hei = m_pPropGrid->m_fontHeight; int cap_y = new_splittery+m_splitterHeight+5; int cnt_y = cap_y+cap_hei+3; int sub_cap_hei = cap_y+cap_hei-use_hei; int cnt_hei = use_hei-cnt_y; if ( sub_cap_hei > 0 ) { cap_hei -= sub_cap_hei; cnt_hei = 0; } if ( cap_hei <= 2 ) { m_pTxtHelpCaption->Show( false ); m_pTxtHelpContent->Show( false ); } else { m_pTxtHelpCaption->SetSize(3,cap_y,new_width-6,cap_hei); m_pTxtHelpCaption->Show( true ); if ( cnt_hei <= 2 ) { m_pTxtHelpContent->Show( false ); } else { m_pTxtHelpContent->SetSize(3,cnt_y,new_width-6,cnt_hei); m_pTxtHelpContent->Show( true ); } } wxClientDC dc(this); RepaintSplitter( dc, new_splittery, new_width, new_height, true ); m_splitterY = new_splittery; m_iFlags &= ~(wxPG_FL_DESC_REFRESH_REQUIRED); } // ----------------------------------------------------------------------- void wxPropertyGridManager::RecalculatePositions( int width, int height ) { int propgridY = 0; int propgridBottomY = height; // Toolbar at the top. #if wxUSE_TOOLBAR if ( m_pToolbar ) { int tbHeight; #if ( wxMINOR_VERSION < 6 || (wxMINOR_VERSION == 6 && wxRELEASE_NUMBER < 2) ) tbHeight = -1; #else // In wxWidgets 2.6.2+, Toolbar default height may be broken #if defined(__WXMSW__) tbHeight = 24; #elif defined(__WXGTK__) tbHeight = -1; // 22; #elif defined(__WXMAC__) tbHeight = 22; #else tbHeight = 22; #endif #endif m_pToolbar->SetSize(0,0,width,tbHeight); propgridY = m_pToolbar->GetSize().y; } #endif // Button at the bottom. if ( m_pButCompactor ) { int but_hei = m_pButCompactor->GetSize().y; m_pButCompactor->SetSize(0,height-but_hei,width,but_hei); propgridBottomY -= but_hei; //button_top -= but_hei; } // Help box. if ( m_pTxtHelpCaption ) { int new_splittery = m_splitterY; // Move m_splitterY if ( ( m_splitterY >= 0 || m_nextDescBoxSize ) && m_height > 32 ) { if ( m_nextDescBoxSize >= 0 ) { new_splittery = m_height - m_nextDescBoxSize - m_splitterHeight; m_nextDescBoxSize = -1; } new_splittery += (height-m_height); } else { new_splittery = height - wxPGMAN_DEFAULT_NEGATIVE_SPLITTER_Y; if ( new_splittery < 32 ) new_splittery = 32; } // Check if beyond minimum. int nspy_min = propgridY + m_pPropGrid->m_lineHeight; if ( new_splittery < nspy_min ) new_splittery = nspy_min; propgridBottomY = new_splittery; RefreshHelpBox( new_splittery, width, height ); } if ( m_iFlags & wxPG_FL_INITIALIZED ) { int pgh = propgridBottomY - propgridY; m_pPropGrid->SetSize( 0, propgridY, width, pgh ); m_extraHeight = height - pgh; m_width = width; m_height = height; } } // ----------------------------------------------------------------------- void wxPropertyGridManager::SetDescBoxHeight( int ht, bool refresh ) { if ( m_windowStyle & wxPG_DESCRIPTION ) { m_nextDescBoxSize = ht; if ( refresh ) RecalculatePositions(m_width, m_height); } } // ----------------------------------------------------------------------- int wxPropertyGridManager::GetDescBoxHeight() const { return GetClientSize().y - m_splitterY; } // ----------------------------------------------------------------------- void wxPropertyGridManager::OnPaint( wxPaintEvent& WXUNUSED(event) ) { wxPaintDC dc(this); // Update everything inside the box wxRect r = GetUpdateRegion().GetBox(); // Repaint splitter? int r_bottom = r.y + r.height; int splitter_bottom = m_splitterY + m_splitterHeight; if ( r.y < splitter_bottom && r_bottom >= m_splitterY ) RepaintSplitter( dc, m_splitterY, m_width, m_height, false ); } // ----------------------------------------------------------------------- void wxPropertyGridManager::Refresh(bool eraseBackground, const wxRect* rect ) { m_pPropGrid->Refresh(eraseBackground); wxWindow::Refresh(eraseBackground,rect); } // ----------------------------------------------------------------------- void wxPropertyGridManager::RefreshProperty( wxPGProperty* p ) { wxPropertyGrid* grid = p->GetGrid(); if ( GetPage(m_selPage)->GetStatePtr() == p->GetParent()->GetParentState() ) grid->RefreshProperty(p); } // ----------------------------------------------------------------------- void wxPropertyGridManager::RecreateControls() { bool was_shown = IsShown(); if ( was_shown ) Show ( false ); wxWindowID baseId = m_pPropGrid->GetId(); if ( baseId < 0 ) baseId = wxPG_MAN_ALTERNATE_BASE_ID; #if wxUSE_TOOLBAR if ( m_windowStyle & wxPG_TOOLBAR ) { // Has toolbar. if ( !m_pToolbar ) { m_pToolbar = new wxToolBar(this,baseId+ID_ADVTOOLBAR_OFFSET, wxDefaultPosition,wxDefaultSize, ((GetExtraStyle()&wxPG_EX_NO_FLAT_TOOLBAR)?0:wxTB_FLAT) /*| wxTB_HORIZONTAL | wxNO_BORDER*/ ); #if defined(__WXMSW__) // Eliminate toolbar flicker on XP // NOTE: Not enabled since it corrupts drawing somewhat. /* #ifndef WS_EX_COMPOSITED #define WS_EX_COMPOSITED 0x02000000L #endif HWND hWnd = (HWND)m_pToolbar->GetHWND(); ::SetWindowLong( hWnd, GWL_EXSTYLE, ::GetWindowLong(hWnd, GWL_EXSTYLE) | WS_EX_COMPOSITED ); */ #endif m_pToolbar->SetCursor ( *wxSTANDARD_CURSOR ); if ( (GetExtraStyle()&wxPG_EX_MODE_BUTTONS) ) { wxString desc1(_("Categorized Mode")); wxString desc2(_("Alphabetic Mode")); m_pToolbar->AddTool(baseId+ID_ADVTBITEMSBASE_OFFSET+0, desc1,wxBitmap ( (const char**)gs_xpm_catmode ), desc1,wxITEM_RADIO); m_pToolbar->AddTool(baseId+ID_ADVTBITEMSBASE_OFFSET+1, desc2,wxBitmap ( (const char**)gs_xpm_noncatmode ), desc2,wxITEM_RADIO); m_pToolbar->Realize(); } } if ( (GetExtraStyle()&wxPG_EX_MODE_BUTTONS) ) { // Toggle correct mode button. // TODO: This doesn't work in wxMSW (when changing, // both items will get toggled). int toggle_but_on_ind = ID_ADVTBITEMSBASE_OFFSET+0; int toggle_but_off_ind = ID_ADVTBITEMSBASE_OFFSET+1; if ( m_pPropGrid->m_pState->IsInNonCatMode() ) { toggle_but_on_ind++; toggle_but_off_ind--; } m_pToolbar->ToggleTool(baseId+toggle_but_on_ind,true); m_pToolbar->ToggleTool(baseId+toggle_but_off_ind,false); } } else { // No toolbar. if ( m_pToolbar ) m_pToolbar->Destroy(); m_pToolbar = (wxToolBar*) NULL; } #endif if ( m_windowStyle & wxPG_COMPACTOR ) { // Has button. if ( !m_pButCompactor ) { m_pButCompactor = new wxButton (this,baseId+ID_ADVBUTTON_OFFSET, !(m_pPropGrid->m_iFlags & wxPG_FL_HIDE_STATE)?_("<< Compact"):_("Expand >>")); m_pButCompactor->SetCursor ( *wxSTANDARD_CURSOR ); } } else { // No button. if ( m_pButCompactor ) m_pButCompactor->Destroy(); m_pButCompactor = (wxButton*) NULL; } if ( m_windowStyle & wxPG_DESCRIPTION ) { // Has help box. m_pPropGrid->m_iFlags |= (wxPG_FL_NOSTATUSBARHELP); if ( !m_pTxtHelpCaption ) { m_pTxtHelpCaption = new wxStaticText (this,baseId+ID_ADVHELPCAPTION_OFFSET,wxT("")); m_pTxtHelpCaption->SetFont( m_pPropGrid->m_captionFont ); m_pTxtHelpCaption->SetCursor ( *wxSTANDARD_CURSOR ); } if ( !m_pTxtHelpContent ) { m_pTxtHelpContent = new wxStaticText (this,baseId+ID_ADVHELPCONTENT_OFFSET, wxT(""),wxDefaultPosition,wxDefaultSize,wxALIGN_LEFT|wxST_NO_AUTORESIZE); m_pTxtHelpContent->SetCursor ( *wxSTANDARD_CURSOR ); } } else { // No help box. m_pPropGrid->m_iFlags &= ~(wxPG_FL_NOSTATUSBARHELP); if ( m_pTxtHelpCaption ) m_pTxtHelpCaption->Destroy(); m_pTxtHelpCaption = (wxStaticText*) NULL; if ( m_pTxtHelpContent ) m_pTxtHelpContent->Destroy(); m_pTxtHelpContent = (wxStaticText*) NULL; } int width, height; GetClientSize(&width,&height); RecalculatePositions(width,height); if ( was_shown ) Show ( true ); } // ----------------------------------------------------------------------- wxPGId wxPropertyGridManager::DoGetPropertyByName( wxPGPropNameStr name ) const { //return GetPropertyByName2(name, (wxPropertyGridState**)NULL ); size_t i; for ( i=0; iGetStatePtr(); wxPGId id = pState->BaseGetPropertyByName(name); if ( wxPGIdIsOk(id) ) { //if ( ppState ) *ppState = pState; return id; } } return wxPGIdGen((wxPGProperty*)NULL); } // ----------------------------------------------------------------------- wxPGId wxPropertyGridManager::GetPropertyByLabel( const wxString& label, wxPropertyGridState** ppState ) const { size_t i; for ( i=0; iGetStatePtr(); wxPGId id = pState->GetPropertyByLabel(label); if ( wxPGIdIsOk(id) ) { if ( ppState ) *ppState = pState; return id; } } return wxPGIdGen((wxPGProperty*)NULL); } // ----------------------------------------------------------------------- bool wxPropertyGridManager::EnsureVisible( wxPGId id ) { wxPG_PROP_ID_CALL_PROLOG_RETVAL(false) wxPropertyGridState* parentState = p->GetParentState(); // Select correct page. if ( m_pPropGrid->m_pState != parentState ) DoSelectPage( GetPageByState(parentState) ); return m_pPropGrid->EnsureVisible(id); } // ----------------------------------------------------------------------- // TODO: Transfer name-argument methods to class as inlines. #define wxPG_IMPLEMENT_PGMAN_METHOD_WRET0(NAME,RETVAL) \ wxPG_IPAM_DECL RETVAL wxPropertyGridManager::NAME( wxPGId id ) \ { \ wxPGProperty* p = wxPGIdToPtr(id); \ wxASSERT_MSG(p,wxT("invalid property id")); \ if ( p ) \ { \ wxPropertyGridState* pState = p->GetParentState(); \ wxASSERT( pState != (wxPropertyGridState*) NULL ); \ if ( pState == m_pPropGrid->m_pState ) return m_pPropGrid->NAME(id); \ return pState->NAME(p); \ } \ return ((RETVAL)0); \ } \ wxPG_IPAM_DECL RETVAL wxPropertyGridManager::NAME( wxPGPropNameStr name ) \ { \ wxPGId id = GetPropertyByNameI(name); \ if ( !wxPGIdIsOk(id) ) return ((RETVAL)0); \ return NAME(id); \ } #define wxPG_IMPLEMENT_PGMAN_METHOD_WRET1(NAME,RETVAL,AT1) \ wxPG_IPAM_DECL RETVAL wxPropertyGridManager::NAME( wxPGId id, AT1 _av1_ ) \ { \ wxPGProperty* p = wxPGIdToPtr(id); \ wxASSERT_MSG(p,wxT("invalid property id")); \ if ( p ) \ { \ wxPropertyGridState* pState = p->GetParentState(); \ wxASSERT( pState != (wxPropertyGridState*) NULL ); \ if ( pState == m_pPropGrid->m_pState ) return m_pPropGrid->NAME(id,_av1_); \ return pState->NAME(p,_av1_); \ } \ return ((RETVAL)0); \ } \ wxPG_IPAM_DECL RETVAL wxPropertyGridManager::NAME( wxPGPropNameStr name, AT1 _av1_ ) \ { \ wxPGId id = GetPropertyByNameI(name); \ if ( !wxPGIdIsOk(id) ) return ((RETVAL)0); \ return NAME(id,_av1_); \ } #define wxPG_IMPLEMENT_PGMAN_METHOD_WRET2(NAME,RETVAL,AT1,AT2) \ wxPG_IPAM_DECL RETVAL wxPropertyGridManager::NAME( wxPGId id, AT1 _av1_, AT2 _av2_ ) \ { \ wxPGProperty* p = wxPGIdToPtr(id); \ wxASSERT_MSG(p,wxT("invalid property id")); \ if ( p ) \ { \ wxPropertyGridState* pState = p->GetParentState(); \ wxASSERT( pState != (wxPropertyGridState*) NULL ); \ if ( pState == m_pPropGrid->m_pState ) return m_pPropGrid->NAME(id,_av1_,_av2_); \ return pState->NAME(p,_av1_,_av2_); \ } \ return ((RETVAL)0); \ } \ wxPG_IPAM_DECL RETVAL wxPropertyGridManager::NAME( wxPGPropNameStr name, AT1 _av1_, AT2 _av2_ ) \ { \ wxPGId id = GetPropertyByNameI(name); \ if ( !wxPGIdIsOk(id) ) return ((RETVAL)0); \ return NAME(id,_av1_,_av2_); \ } #define wxPG_IMPLEMENT_PGMAN_METHOD_NORET0(NAME) \ wxPG_IPAM_DECL void wxPropertyGridManager::NAME( wxPGId id ) \ { \ wxPGProperty* p = wxPGIdToPtr(id); \ wxASSERT_MSG(p,wxT("invalid property id")); \ if ( p ) \ { \ wxPropertyGridState* pState = p->GetParentState(); \ wxASSERT( pState != (wxPropertyGridState*) NULL ); \ if ( pState == m_pPropGrid->m_pState ) m_pPropGrid->NAME(id); \ else pState->NAME(p); \ } \ } \ wxPG_IPAM_DECL void wxPropertyGridManager::NAME( wxPGPropNameStr name ) \ { \ wxPGId id = GetPropertyByNameI(name); \ if ( !wxPGIdIsOk(id) ) return; \ NAME(id); \ } #undef wxPG_IPAM_DECL #define wxPG_IPAM_DECL wxPG_IMPLEMENT_PGMAN_METHOD_WRET0(ClearPropertyValue,bool) wxPG_IMPLEMENT_PGMAN_METHOD_WRET0(Collapse,bool) wxPG_IMPLEMENT_PGMAN_METHOD_WRET1(EnableProperty,bool,bool) wxPG_IMPLEMENT_PGMAN_METHOD_WRET0(Expand,bool) wxPG_IMPLEMENT_PGMAN_METHOD_NORET1(LimitPropertyEditing,bool) wxPG_IMPLEMENT_PGMAN_METHOD_NORET1(SetPropertyLabel,const wxString&) wxPG_IMPLEMENT_PGMAN_METHOD_NORET1(SetPropertyValueLong,long) #ifndef __WXPYTHON__ wxPG_IMPLEMENT_PGMAN_METHOD_NORET1(SetPropertyValue,int) #endif wxPG_IMPLEMENT_PGMAN_METHOD_NORET1(SetPropertyValueDouble,double) wxPG_IMPLEMENT_PGMAN_METHOD_NORET1(SetPropertyValueBool,bool) wxPG_IMPLEMENT_PGMAN_METHOD_NORET1(SetPropertyValueString,const wxString&) wxPG_IMPLEMENT_PGMAN_METHOD_NORET1(SetPropertyValueWxObjectPtr,wxObject*) #ifndef __WXPYTHON__ wxPG_IMPLEMENT_PGMAN_METHOD_NORET1(SetPropertyValue,void*) wxPG_IMPLEMENT_PGMAN_METHOD_NORET1(SetPropertyValue,wxVariant&) wxPG_IMPLEMENT_PGMAN_METHOD_NORET1(SetPropertyValueArrstr2,const wxArrayString&) #else wxPG_IMPLEMENT_PGMAN_METHOD_NORET1_P1(SetPropertyValueArrstr2,const wxArrayString&) #endif #ifdef wxPG_COMPATIBILITY_1_0_0 wxPG_IMPLEMENT_PGMAN_METHOD_NORET0(SetPropertyValueUnspecified) #else wxPG_IMPLEMENT_PGMAN_METHOD_NORET0(SetPropertyUnspecified) #endif // ----------------------------------------------------------------------- void wxPropertyGridManager::ClearModifiedStatus( wxPGId id ) { wxPG_PROP_ID_CALL_PROLOG() wxPropertyGridState* pState = p->GetParentState(); wxASSERT ( pState != (wxPropertyGridState*) NULL ); pState->ClearModifiedStatus(p); } // ----------------------------------------------------------------------- size_t wxPropertyGridManager::GetChildrenCount( int page_index ) { return GetChildrenCount( wxPGIdGen(GetPage(page_index)->GetStatePtr()->m_properties) ); } // ----------------------------------------------------------------------- void wxPropertyGridManager::OnToolbarClick( wxCommandEvent &event ) { int id = event.GetId(); if ( id >= 0 ) { int baseId = m_pPropGrid->GetId(); if ( baseId < 0 ) baseId = wxPG_MAN_ALTERNATE_BASE_ID; if ( id == ( baseId + ID_ADVTBITEMSBASE_OFFSET + 0 ) ) { // Categorized mode. if ( m_pPropGrid->m_windowStyle & wxPG_HIDE_CATEGORIES ) m_pPropGrid->EnableCategories( true ); } else if ( id == ( baseId + ID_ADVTBITEMSBASE_OFFSET + 1 ) ) { // Alphabetic mode. if ( !(m_pPropGrid->m_windowStyle & wxPG_HIDE_CATEGORIES) ) m_pPropGrid->EnableCategories( false ); } else { // Page Switching. int index = -1; size_t i; wxPropertyGridPage* pdc; // Find page with given id. for ( i=0; im_id == id ) { index = i; break; } } wxASSERT( index >= 0 ); if ( DoSelectPage( index ) ) { // Event dispatching must be last. m_pPropGrid->SendEvent( wxEVT_PG_PAGE_CHANGED, (wxPGProperty*) NULL ); } else { // TODO: Depress the old button on toolbar. } } } } // ----------------------------------------------------------------------- void wxPropertyGridManager::SetDescription( const wxString& label, const wxString& content ) { if ( m_pTxtHelpCaption ) { wxSize osz1 = m_pTxtHelpCaption->GetSize(); wxSize osz2 = m_pTxtHelpContent->GetSize(); m_pTxtHelpCaption->SetLabel(label); m_pTxtHelpContent->SetLabel(content); m_pTxtHelpCaption->SetSize(-1,osz1.y); m_pTxtHelpContent->SetSize(-1,osz2.y); if ( (m_iFlags & wxPG_FL_DESC_REFRESH_REQUIRED) || (osz2.x<(m_width-10)) ) RefreshHelpBox( m_splitterY, m_width, m_height ); } } // ----------------------------------------------------------------------- void wxPropertyGridManager::SetDescribedProperty( wxPGProperty* p ) { if ( m_pTxtHelpCaption ) { if ( p ) { SetDescription( p->GetLabel(), p->GetHelpString() ); } else { m_pTxtHelpCaption->SetLabel(wxT("")); m_pTxtHelpContent->SetLabel(wxT("")); } } } // ----------------------------------------------------------------------- void wxPropertyGridManager::SetSplitterLeft( bool subProps, bool allPages ) { if ( !allPages ) { m_pPropGrid->SetSplitterLeft(subProps); } else { wxClientDC dc(this); dc.SetFont(m_pPropGrid->m_font); int highest = 0; unsigned int i; for ( i=0; iGetLeftSplitterPos(dc, GetPageState(i)->m_properties, subProps ); wxLogDebug(wxT("%i"),maxW); if ( maxW > highest ) highest = maxW; } if ( highest > 0 ) m_pPropGrid->SetSplitterPosition( highest ); m_pPropGrid->m_iFlags |= wxPG_FL_DONT_CENTER_SPLITTER; } } // ----------------------------------------------------------------------- void wxPropertyGridManager::OnPropertyGridSelect( wxPropertyGridEvent& event ) { // Check id. wxASSERT_MSG( GetId() == m_pPropGrid->GetId(), wxT("wxPropertyGridManager id must be set with wxPropertyGridManager::SetId (not wxWindow::SetId).") ); SetDescribedProperty(event.GetPropertyPtr()); event.Skip(); } // ----------------------------------------------------------------------- void wxPropertyGridManager::OnCompactorClick( wxCommandEvent& WXUNUSED(event) ) { if ( !(m_pPropGrid->m_iFlags & wxPG_FL_HIDE_STATE) ) { m_pPropGrid->Compact( true ); m_pButCompactor->SetLabel( _("Expand >>") ); } else { m_pPropGrid->Compact( false ); m_pButCompactor->SetLabel( _("<< Compact") ); } } // ----------------------------------------------------------------------- void wxPropertyGridManager::OnResize( wxSizeEvent& WXUNUSED(event) ) { int width, height; GetClientSize(&width,&height); if ( m_width == -12345 ) RecreateControls(); RecalculatePositions(width,height); } // ----------------------------------------------------------------------- void wxPropertyGridManager::OnMouseEntry( wxMouseEvent& WXUNUSED(event) ) { // Correct cursor. This is required atleast for wxGTK, for which // setting button's cursor to *wxSTANDARD_CURSOR does not work. SetCursor( wxNullCursor ); m_onSplitter = 0; } // ----------------------------------------------------------------------- void wxPropertyGridManager::OnMouseMove( wxMouseEvent &event ) { if ( !m_pTxtHelpCaption ) return; int y = event.m_y; if ( m_dragStatus > 0 ) { int sy = y - m_dragOffset; // Calculate drag limits int bottom_limit = m_height - m_splitterHeight + 1; if ( m_pButCompactor ) bottom_limit -= m_pButCompactor->GetSize().y; int top_limit = m_pPropGrid->m_lineHeight; #if wxUSE_TOOLBAR if ( m_pToolbar ) top_limit += m_pToolbar->GetSize().y; #endif if ( sy >= top_limit && sy < bottom_limit ) { int change = sy - m_splitterY; if ( change ) { m_splitterY = sy; m_pPropGrid->SetSize( m_width, m_splitterY - m_pPropGrid->GetPosition().y ); RefreshHelpBox( m_splitterY, m_width, m_height ); m_extraHeight -= change; InvalidateBestSize(); } } } else { if ( y >= m_splitterY && y < (m_splitterY+m_splitterHeight+2) ) { SetCursor ( m_cursorSizeNS ); m_onSplitter = 1; } else { if ( m_onSplitter ) { SetCursor ( wxNullCursor ); } m_onSplitter = 0; } } } // ----------------------------------------------------------------------- void wxPropertyGridManager::OnMouseClick( wxMouseEvent &event ) { int y = event.m_y; // Click on splitter. if ( y >= m_splitterY && y < (m_splitterY+m_splitterHeight+2) ) { if ( m_dragStatus == 0 ) { // // Begin draggin the splitter // BEGIN_MOUSE_CAPTURE m_dragStatus = 1; m_dragOffset = y - m_splitterY; } } } // ----------------------------------------------------------------------- void wxPropertyGridManager::OnMouseUp( wxMouseEvent &event ) { // No event type check - basicly calling this method should // just stop dragging. if ( m_dragStatus >= 1 ) { // // End Splitter Dragging // int y = event.m_y; // DO NOT ENABLE FOLLOWING LINE! // (it is only here as a reminder to not to do it) //m_splitterY = y; // This is necessary to return cursor END_MOUSE_CAPTURE // Set back the default cursor, if necessary if ( y < m_splitterY || y >= (m_splitterY+m_splitterHeight+2) ) { SetCursor ( wxNullCursor ); } m_dragStatus = 0; } } // ----------------------------------------------------------------------- wxformbuilder-3.1.59/src/controls/src/propgrid/propgrid.cpp0000644000175000017500000136035211143440027024363 0ustar rrmulderrrmulder///////////////////////////////////////////////////////////////////////////// // Name: propgrid.cpp // Purpose: wxPropertyGrid // Author: Jaakko Salli // Modified by: // Created: Sep-25-2004 // RCS-ID: $Id: // Copyright: (c) Jaakko Salli // Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "propgrid.h" #endif // For compilers that support precompilation, includes "wx/wx.h". #include "wx/wxprec.h" #ifdef __BORLANDC__ #pragma hdrstop #endif #ifndef WX_PRECOMP #include "wx/defs.h" #include "wx/object.h" #include "wx/hash.h" #include "wx/string.h" #include "wx/log.h" #include "wx/event.h" #include "wx/window.h" #include "wx/panel.h" #include "wx/dc.h" #include "wx/dcclient.h" #include "wx/dcmemory.h" #include "wx/button.h" #include "wx/pen.h" #include "wx/brush.h" #include "wx/cursor.h" #include "wx/dialog.h" #include "wx/settings.h" #include "wx/msgdlg.h" #include "wx/choice.h" #include "wx/stattext.h" #include "wx/scrolwin.h" #include "wx/dirdlg.h" #include "wx/combobox.h" #include "wx/layout.h" #include "wx/sizer.h" #include "wx/textdlg.h" #include "wx/filedlg.h" #include "wx/statusbr.h" #include "wx/intl.h" #include "wx/frame.h" #endif #include "wx/timer.h" #include "wx/dcbuffer.h" // This define is necessary to prevent macro clearing #define __wxPG_SOURCE_FILE__ #include #include #ifdef __WXPYTHON__ #include #include #endif #if wxPG_USE_RENDERER_NATIVE #include #endif #include #ifdef __WXMSW__ #include #endif // Two pics for the expand / collapse buttons. // Files are not supplied with this project (since it is // recommended to use either custom or native rendering). // If you want them, get wxTreeMultiCtrl by Jorgen Bodde, // and copy xpm files from archive to wxPropertyGrid src directory // (and also comment/undef wxPG_ICON_WIDTH in propGrid.h // and set wxPG_USE_RENDERER_NATIVE to 0). #ifndef wxPG_ICON_WIDTH #if defined(__WXMAC__) #include "mac_collapse.xpm" #include "mac_expand.xpm" #elif defined(__WXGTK__) #include "linux_collapse.xpm" #include "linux_expand.xpm" #else #include "default_collapse.xpm" #include "default_expand.xpm" #endif #endif //#define wxPG_TEXT_INDENT 4 // For the wxComboControl #define wxPG_ALLOW_CLIPPING 1 // If 1, GetUpdateRegion() in OnPaint event handler is not ignored #define wxPG_GUTTER_DIV 3 // gutter is max(iconwidth/gutter_div,gutter_min) #define wxPG_GUTTER_MIN 3 // gutter before and after image of [+] or [-] #define wxPG_YSPACING_MIN 1 #define wxPG_BUTTON_SIZEDEC 0 #define wxPG_DEFAULT_VSPACING 2 // This matches .NET propertygrid's value, // but causes normal combobox to spill out under MSW #define wxPG_OPTIMAL_WIDTH 200 // Arbitrary #define wxPG_CAPRECTXMARGIN 2 // space between caption and selection rectangle, #define wxPG_CAPRECTYMARGIN 1 // horizontally and vertically #define PWC_CHILD_SUMMARY_LIMIT 16 // Maximum number of children summarized in a parent property's // value field. #define PWC_CHILD_SUMMARY_CHAR_LIMIT 64 // Character limit of summary field when not editing #define wxPG_MIN_SCROLLBAR_WIDTH 10 // Smallest scrollbar width on any platform // Must be larger than largest control border // width * 2. #define wxPG_DEFAULT_CURSOR wxNullCursor #define RedrawAllVisible Refresh // // Here are some extra platform dependent defines. // #if defined(__WXMSW__) // tested #define wxPG_DEFAULT_SPLITTERX 110 // default splitter position #define wxPG_CREATE_CONTROLS_HIDDEN 0 // 1 to create controls out of sight, hide them, and then move them into correct position #define wxPG_NO_CHILD_EVT_MOTION 0 // 1 if splitter drag detect margin and control cannot overlap #define wxPG_CUSTOM_IMAGE_WIDTH 20 // for wxColourProperty etc. #define wxPG_ALLOW_EMPTY_TOOLTIPS 1 // If 1, then setting empty tooltip actually hides it #define wxPG_NAT_TEXTCTRL_BORDER_X 0 // Unremovable border of native textctrl. #define wxPG_NAT_TEXTCTRL_BORDER_Y 0 // Unremovable border of native textctrl. #define wxPG_NAT_BUTTON_BORDER_ANY 1 #define wxPG_NAT_BUTTON_BORDER_X 1 #define wxPG_NAT_BUTTON_BORDER_Y 1 #define wxPG_TEXTCTRLYADJUST (m_spacingy+0) #define wxPG_CHOICEXADJUST (-1) // Extra pixels next to wxChoice/ComboBox. #define wxPG_CHOICEYADJUST 0 // Extra pixels above wxChoice/ComboBox. #define wxPG_REFRESH_CONTROLS_AFTER_REPAINT 0 // If 1 then controls are refreshed after selected was drawn. #define wxPG_CHECKMARK_XADJ 1 #define wxPG_CHECKMARK_YADJ (-1) #define wxPG_CHECKMARK_WADJ 0 #define wxPG_CHECKMARK_HADJ 0 #define wxPG_CHECKMARK_DEFLATE 0 #elif defined(__WXGTK__) // tested #define wxPG_DEFAULT_SPLITTERX 110 #define wxPG_CREATE_CONTROLS_HIDDEN 0 // 1 to create controls out of sight, hide them, and then move them into correct position #define wxPG_NO_CHILD_EVT_MOTION 1 // 1 if splitter drag detect margin and control cannot overlap #define wxPG_CUSTOM_IMAGE_WIDTH 20 // for wxColourProperty etc. #define wxPG_ALLOW_EMPTY_TOOLTIPS 0 // If 1, then setting empty tooltip actually hides it #define wxPG_NAT_TEXTCTRL_BORDER_X 3 // Unremovable border of native textctrl. #define wxPG_NAT_TEXTCTRL_BORDER_Y 3 // Unremovable border of native textctrl. #define wxPG_NAT_BUTTON_BORDER_ANY 1 #define wxPG_NAT_BUTTON_BORDER_X 1 #define wxPG_NAT_BUTTON_BORDER_Y 1 #define wxPG_TEXTCTRLYADJUST 0 #define wxPG_CHOICEXADJUST 2 // Extra pixels next to wxChoice/ComboBox. #define wxPG_CHOICEYADJUST 0 #define wxPG_REFRESH_CONTROLS_AFTER_REPAINT 1 // If 1 then controls are refreshed after selected was drawn. #define wxPG_CHECKMARK_XADJ 0 #define wxPG_CHECKMARK_YADJ 0 #define wxPG_CHECKMARK_WADJ (-1) #define wxPG_CHECKMARK_HADJ (-1) #define wxPG_CHECKMARK_DEFLATE 3 #elif defined(__WXMAC__) // *not* tested #define wxPG_DEFAULT_SPLITTERX 110 #define wxPG_CREATE_CONTROLS_HIDDEN 0 // 1 to create controls out of sight, hide them, and then move them into correct position #define wxPG_NO_CHILD_EVT_MOTION 0 // 1 if splitter drag detect margin and control cannot overlap #define wxPG_CUSTOM_IMAGE_WIDTH 20 // for wxColourProperty etc. #define wxPG_ALLOW_EMPTY_TOOLTIPS 1 // If 1, then setting empty tooltip actually hides it #define wxPG_NAT_TEXTCTRL_BORDER_X 0 // Unremovable border of native textctrl. #define wxPG_NAT_TEXTCTRL_BORDER_Y 0 // Unremovable border of native textctrl. #define wxPG_NAT_BUTTON_BORDER_ANY 0 #define wxPG_NAT_BUTTON_BORDER_X 0 #define wxPG_NAT_BUTTON_BORDER_Y 0 #define wxPG_TEXTCTRLYADJUST 3 #define wxPG_CHOICEXADJUST 0 // Extra pixels next to wxChoice/ComboBox. #define wxPG_CHOICEYADJUST 0 #define wxPG_REFRESH_CONTROLS_AFTER_REPAINT 0 // If 1 then controls are refreshed after selected was drawn. #define wxPG_CHECKMARK_XADJ 0 #define wxPG_CHECKMARK_YADJ 0 #define wxPG_CHECKMARK_WADJ 0 #define wxPG_CHECKMARK_HADJ 0 #define wxPG_CHECKMARK_DEFLATE 0 #else // defaults #define wxPG_DEFAULT_SPLITTERX 110 #define wxPG_CREATE_CONTROLS_HIDDEN 0 // 1 to create controls out of sight, hide them, and then move them into correct position #define wxPG_NO_CHILD_EVT_MOTION 1 // 1 if splitter drag detect margin and control cannot overlap #define wxPG_CUSTOM_IMAGE_WIDTH 20 // for wxColourProperty etc. #define wxPG_ALLOW_EMPTY_TOOLTIPS 0 // If 1, then setting empty tooltip actually hides it #define wxPG_NAT_TEXTCTRL_BORDER_X 0 // Unremovable border of native textctrl. #define wxPG_NAT_TEXTCTRL_BORDER_Y 0 // Unremovable border of native textctrl. #define wxPG_NAT_BUTTON_BORDER_ANY 0 #define wxPG_NAT_BUTTON_BORDER_X 0 #define wxPG_NAT_BUTTON_BORDER_Y 0 #define wxPG_TEXTCTRLYADJUST 0 #define wxPG_CHOICEXADJUST 0 // Extra pixels next to wxChoice/ComboBox. #define wxPG_CHOICEYADJUST 0 #define wxPG_REFRESH_CONTROLS_AFTER_REPAINT 1 // If 1 then controls are refreshed after selected was drawn. #define wxPG_CHECKMARK_XADJ 0 #define wxPG_CHECKMARK_YADJ 0 #define wxPG_CHECKMARK_WADJ 0 #define wxPG_CHECKMARK_HADJ 0 #define wxPG_CHECKMARK_DEFLATE 0 #endif #if wxPG_NO_CHILD_EVT_MOTION #define wxPG_SPLITTERX_DETECTMARGIN1 3 // this much on left #define wxPG_SPLITTERX_DETECTMARGIN2 2 // this much on right #define wxPG_CONTROL_MARGIN 0 // space between splitter and control #else #define wxPG_SPLITTERX_DETECTMARGIN1 3 // this much on left #define wxPG_SPLITTERX_DETECTMARGIN2 2 // this much on right #define wxPG_CONTROL_MARGIN 0 // space between splitter and control #endif #define wxCC_CUSTOM_IMAGE_MARGIN1 4 // before image #define wxCC_CUSTOM_IMAGE_MARGIN2 5 // after image #if (!wxPG_NAT_TEXTCTRL_BORDER_X && !wxPG_NAT_TEXTCTRL_BORDER_Y) #define wxPG_ENABLE_CLIPPER_WINDOW 0 #else #define wxPG_ENABLE_CLIPPER_WINDOW 1 #endif //#define wxPG_NAT_CHOICE_BORDER_ANY 0 // for odcombo #undef wxPG_CHOICEXADJUST #define wxPG_CHOICEXADJUST 0 #undef wxPG_CHOICEYADJUST #define wxPG_CHOICEYADJUST 0 #define wxPG_DRAG_MARGIN 30 #define wxPG_CUSTOM_IMAGE_SPACINGY 1 // space between vertical sides of a custom image // Use this macro to generate standard custom image height from #define wxPG_STD_CUST_IMAGE_HEIGHT(LINEHEIGHT) (LINEHEIGHT-3) // How many pixels between textctrl and button #ifdef __WXMAC__ #define wxPG_TEXTCTRL_AND_BUTTON_SPACING 8 #else #define wxPG_TEXTCTRL_AND_BUTTON_SPACING 2 #endif #define wxPG_HIDER_BUTTON_HEIGHT 25 // m_expanded of wxPGPropertyWithChildren is set to this code if children should // not be deleted in destructor. #define wxPG_EXP_OF_COPYARRAY 127 #define wxPG_PIXELS_PER_UNIT m_lineHeight #ifdef wxPG_ICON_WIDTH #define m_iconHeight m_iconWidth #endif #define wxPG_TOOLTIP_DELAY 1000 // Colour for the empty but visible space below last property. #define wxPG_SLACK_BACKROUND m_colPropBack // Milliseconds to wait for two mouse-ups after focus inorder // to trigger a double-click. #define DOUBLE_CLICK_CONVERSION_TRESHOLD 500 // // Parenting types enum { PT_CUSTOMPROPERTY = -2, PT_FIXEDCHILDREN = -1, PT_NONE = 0, PT_CAPTION = 1, PT_ROOT = 2 }; // Helper to decide which way is better (ie. first macro clears // "unspecified" state of siblings of child properties as well, while the latter is // more precise). //#define CLEAR_PROPERTY_UNSPECIFIED_FLAG(p) wxPropertyGridState::ClearPropertyAndChildrenFlags(p,wxPG_PROP_UNSPECIFIED) #define CLEAR_PROPERTY_UNSPECIFIED_FLAG(p) p->ClearFlag(wxPG_PROP_UNSPECIFIED) #define __INTENSE_DEBUGGING__ 0 #define __PAINT_DEBUGGING__ 0 #define __MOUSE_DEBUGGING__ 0 // ----------------------------------------------------------------------- #if wxUSE_INTL void wxPropertyGrid::AutoGetTranslation ( bool enable ) { WX_PG_GLOBALS_LOCKER() wxPGGlobalVars->m_autoGetTranslation = enable; } #else void wxPropertyGrid::AutoGetTranslation ( bool ) { } #endif // ----------------------------------------------------------------------- // This was needed to make quicker progress towards wxPropertyGridState #define FROM_STATE(X) m_pState->X // ----------------------------------------------------------------------- #if !wxCHECK_VERSION(2, 7, 1) #if defined(__WXMSW__) #ifndef WS_EX_COMPOSITED #define WS_EX_COMPOSITED 0x02000000L #endif static bool wxPGIsWindowBuffered( const wxWindow* wnd ) { while ( wnd ) { if ( GetWindowLong((HWND)wnd->GetHWND(), GWL_EXSTYLE) & WS_EX_COMPOSITED ) return true; if ( wnd->IsTopLevel() ) break; wnd = wnd->GetParent(); } return false; } #elif defined(__WXGTK20__) #include static bool wxPGIsWindowBuffered( const wxWindow* wnd ) { return GTK_WIDGET_DOUBLE_BUFFERED(wnd->GetHandle()); } #elif defined(__WXMAC_OSX__) || defined(__WXCOCOA__) || defined(__WXDFB__) static bool wxPGIsWindowBuffered( const wxWindow* WXUNUSED(wnd) ) { return true; } #else static bool wxPGIsWindowBuffered( const wxWindow* WXUNUSED(wnd) ) { return false; } #endif #else static bool wxPGIsWindowBuffered( const wxWindow* wnd ) { return wnd->IsDoubleBuffered(); } #endif // ----------------------------------------------------------------------- // DeviceContext Init Macros. #define wxPG_CLIENT_DC_INIT() \ wxClientDC dc(this); \ PrepareDC(dc); #define wxPG_CLIENT_DC_INIT_R(RETVAL) \ wxClientDC dc(this); \ PrepareDC(dc); #define wxPG_PAINT_DC_INIT() \ wxPaintDC dc(this); \ PrepareDC(dc); // ----------------------------------------------------------------------- // For wxMSW cursor consistency, we must do mouse capturing even // when using custom controls. #define BEGIN_MOUSE_CAPTURE \ if ( !(m_iFlags & wxPG_FL_MOUSE_CAPTURED) ) \ { \ CaptureMouse(); \ m_iFlags |= wxPG_FL_MOUSE_CAPTURED; \ } #define END_MOUSE_CAPTURE \ if ( m_iFlags & wxPG_FL_MOUSE_CAPTURED ) \ { \ ReleaseMouse(); \ m_iFlags &= ~(wxPG_FL_MOUSE_CAPTURED); \ } // ----------------------------------------------------------------------- // NOTES // ----------------------------------------------------------------------- // // ----------------------------------------------------------------------- // TODO // ----------------------------------------------------------------------- // // // For Next Release: // * Fix NULL(?) focus after odcombo closed. // // ----------------------------------------------------------------------- const wxChar *wxPropertyGridNameStr = wxT("wxPropertyGrid"); const wxChar *wxPGTypeName_long = wxT("long"); const wxChar *wxPGTypeName_bool = wxT("bool"); const wxChar *wxPGTypeName_double = wxT("double"); const wxChar *wxPGTypeName_wxString = wxT("string"); const wxChar *wxPGTypeName_void = wxT("void*"); const wxChar *wxPGTypeName_wxArrayString = wxT("arrstring"); #ifdef __WXPYTHON__ const wxChar *wxPGTypeName_PyObject = wxT("PyObject"); #endif // ----------------------------------------------------------------------- static void wxPGDrawFocusRect( wxDC& dc, const wxRect& rect ) { #if defined(__WXMSW__) && !defined(__WXWINCE__) /* RECT mswRect; mswRect.left = rect.x; mswRect.top = rect.y; mswRect.right = rect.x + rect.width; mswRect.bottom = rect.y + rect.height; HDC hdc = (HDC) dc.GetHDC(); SetMapMode(hdc,MM_TEXT); // Just in case... DrawFocusRect(hdc,&mswRect); */ // FIXME: Use DrawFocusRect code above (currently it draws solid line // for caption focus but works ok for other stuff). // Also, it seems that this code may not work in future wx versions. dc.SetLogicalFunction(wxINVERT); wxPen pen(*wxBLACK,1,wxDOT); pen.SetCap(wxCAP_BUTT); dc.SetPen(pen); dc.SetBrush(*wxTRANSPARENT_BRUSH); dc.DrawRectangle(rect); dc.SetLogicalFunction(wxCOPY); #else dc.SetLogicalFunction(wxINVERT); dc.SetPen(wxPen(*wxBLACK,1,wxDOT)); dc.SetBrush(*wxTRANSPARENT_BRUSH); dc.DrawRectangle(rect); dc.SetLogicalFunction(wxCOPY); #endif } // ----------------------------------------------------------------------- // Choice related methods from various classes // ----------------------------------------------------------------------- void wxPropertyContainerMethods::AddPropertyChoice( wxPGId id, const wxString& label, int value ) { wxPG_PROP_ID_CALL_PROLOG() p->InsertChoice(label,-1,value); } void wxPropertyContainerMethods::InsertPropertyChoice( wxPGId id, const wxString& label, int index, int value ) { wxPG_PROP_ID_CALL_PROLOG() p->InsertChoice(label,index,value); } void wxPropertyContainerMethods::DeletePropertyChoice( wxPGId id, int index ) { wxPG_PROP_ID_CALL_PROLOG() p->DeleteChoice(index); } // ----------------------------------------------------------------------- // Statics in one class for easy destruction. // NB: We prefer to use wxModule, as it offers more consistent behaviour // across platforms. However, for those rare problem situations, we // also need to offer option to use simpler approach. // ----------------------------------------------------------------------- #ifndef wxPG_USE_WXMODULE #define wxPG_USE_WXMODULE 1 #endif #if wxPG_USE_WXMODULE #include class wxPGGlobalVarsClassManager : public wxModule { DECLARE_DYNAMIC_CLASS(wxPGGlobalVarsClassManager) public: wxPGGlobalVarsClassManager() {} virtual bool OnInit() { wxPGGlobalVars = new wxPGGlobalVarsClass(); return true; } virtual void OnExit() { delete wxPGGlobalVars; wxPGGlobalVars = NULL; } }; IMPLEMENT_DYNAMIC_CLASS(wxPGGlobalVarsClassManager, wxModule) #else // !wxPG_USE_WXMODULE class wxPGGlobalVarsClassManager { public: wxPGGlobalVarsClassManager() {} ~wxPGGlobalVarsClassManager() { delete wxPGGlobalVars; } }; static wxPGGlobalVarsClassManager gs_pgGlobalVarsClassManager; #endif wxPGGlobalVarsClass* wxPGGlobalVars = (wxPGGlobalVarsClass*) NULL; wxPGGlobalVarsClass::wxPGGlobalVarsClass() { m_boolChoices[0] = _("False"); m_boolChoices[1] = _("True"); m_boolChoices[2] = _("Unspecified"); m_numBoolChoices = 2; m_fontFamilyChoices = (wxPGChoices*) NULL; m_autoGetTranslation = false; m_offline = 0; } wxPGGlobalVarsClass::~wxPGGlobalVarsClass() { size_t i; // This will always have one ref delete m_fontFamilyChoices; #if wxUSE_VALIDATORS for ( i=0; isecond; wxASSERT( pcls ); delete pcls; } // Destroy editor class instances. // iterate over all the elements in the class for( vt_it = m_mapEditorClasses.begin(); vt_it != m_mapEditorClasses.end(); ++vt_it ) { delete ((wxPGEditor*)vt_it->second); } } // ----------------------------------------------------------------------- // wxPGProperty // ----------------------------------------------------------------------- wxPGPropertyClassInfo wxBasePropertyClassInfo = {wxT("wxBaseProperty"), (const wxPGPropertyClassInfo*) NULL, (wxPGPropertyConstructor) NULL}; void wxPGProperty::Init() { #ifdef __WXPYTHON__ m_scriptObject = NULL; #endif m_y = -3; m_arrIndex = 0xFFFF; m_parent = (wxPGPropertyWithChildren*) NULL; #if wxPG_USE_CLIENT_DATA m_clientData = NULL; #endif m_dataExt = (wxPGPropertyDataExt*) NULL; m_maxLen = 0; // infinite maximum length m_flags = 0; m_depth = 1; m_parentingType = 0; m_bgColIndex = 0; m_fgColIndex = 0; } void wxPGProperty::Init( const wxString& label, const wxString& name ) { m_label = label; #ifndef __WXPYTHON__ if ( &name != ((wxString*)NULL) ) #else if ( (&name != ((wxString*)NULL)) && name != wxT("_LABEL_AS_NAME") ) #endif DoSetName( name ); else DoSetName( label ); Init(); } wxPGProperty::wxPGProperty() #if wxPG_INCLUDE_WXOBJECT : wxObject() #endif { Init(); } wxPGProperty::wxPGProperty( const wxString& label, const wxString& name ) #if wxPG_INCLUDE_WXOBJECT : wxObject() #endif { Init( label, name ); } wxPGProperty::~wxPGProperty() { #ifdef __WXPYTHON__ #if wxPG_USE_CLIENT_DATA if ( m_clientData ) Py_DECREF( m_clientData ); #endif #endif delete m_dataExt; } bool wxPGProperty::IsSomeParent( wxPGProperty* candidate ) const { wxPGPropertyWithChildren* parent = m_parent; do { if ( parent == (wxPGPropertyWithChildren*)candidate ) return true; parent = parent->m_parent; } while ( parent ); return false; } wxPropertyGridState* wxPGProperty::GetParentState() const { wxASSERT( m_parent ); return m_parent->GetParentState(); } size_t wxPGProperty::GetChildCount() const { int cc = GetParentingType(); if ( cc == 0 ) return 0; return ((wxPGPropertyWithChildren*)this)->GetCount(); } void wxPGProperty::ShowError( const wxString& msg ) { if ( !msg.length() ) return; #if wxUSE_STATUSBAR if ( !wxPGGlobalVars->m_offline ) { wxPropertyGrid* pg = GetParentState()->m_pPropGrid; wxASSERT(pg); wxWindow* topWnd = ::wxGetTopLevelParent(pg); if ( topWnd ) { wxFrame* pFrame = wxDynamicCast(topWnd,wxFrame); if ( pFrame ) { wxStatusBar* pStatusBar = pFrame->GetStatusBar(); if ( pStatusBar ) { pStatusBar->SetStatusText(msg); return; } } } } #endif ::wxLogError(msg); } wxPropertyGrid* wxPGProperty::GetGrid() const { return GetParentState()->GetGrid(); } void wxPGProperty::UpdateControl( wxWindow* primary ) { if ( primary ) GetEditorClass()->UpdateControl(this,primary); } void wxPGProperty::DoSetValue( wxPGVariant ) { // Actually, this should never get called wxFAIL_MSG( wxT("must be overridden") ); } // wxPGRootPropertyClass, at least, should make use of this. wxPGVariant wxPGProperty::DoGetValue() const { return wxPGVariant((long)0); } wxString wxPGProperty::GetValueAsString( int ) const { wxFAIL_MSG( wxT("must be overridden") ); return m_name; } wxVariant wxPGProperty::GetValueAsVariant() const { // Return NULL variant for unspecified value //if ( HasFlag(wxPG_PROP_UNSPECIFIED) ) // return wxVariant(); wxPGVariant value = DoGetValue(); const wxPGValueType* typeClass = GetValueTypePtr(); wxASSERT_MSG( typeClass, wxT("Did you forgot to use wxPG_INIT_REQUIRED_TYPE(T) in constructor?") ); return typeClass->GenerateVariant(value,m_name); } bool wxPGProperty::SetValueFromString( const wxString&, int ) { wxFAIL_MSG( wxT("must be overridden") ); return false; } bool wxPGProperty::SetValueFromInt( long, int ) { wxFAIL_MSG ( wxT("must be overridden") ); return false; } wxSize wxPGProperty::GetImageSize() const { if ( m_dataExt && m_dataExt->m_valueBitmap ) return wxSize(m_dataExt->m_valueBitmap->GetWidth(),-1); return wxSize(0,0); } void wxPGProperty::OnCustomPaint( wxDC& dc, const wxRect& rect, wxPGPaintData& ) { wxCHECK_RET( m_dataExt, wxT("m_dataExt is mandatory") ); wxBitmap* bmp = m_dataExt->m_valueBitmap; wxCHECK_RET( bmp && bmp->Ok(), wxT("invalid bitmap") ); wxCHECK_RET( rect.x >= 0, wxT("unexpected measure call") ); dc.DrawBitmap(*bmp,rect.x,rect.y); } const wxPGEditor* wxPGProperty::DoGetEditorClass() const { return wxPG_EDITOR(TextCtrl); } #ifdef __WXPYTHON__ wxString wxPGProperty::GetEditor() const { return wxEmptyString; } #endif #ifdef __WXPYTHON__ wxString wxPGProperty::GetType() const { return wxString(); } const wxPGValueType* wxPGProperty::GetValueType() const { wxString s = GetType(); const wxPGValueType* p = wxPropertyContainerMethods::GetValueType(s); wxCHECK_MSG( p, wxPG_VALUETYPE(none), wxT("GetType must return string that identifies a valid type") ); return p; } #endif #if wxPG_VALUETYPE_IS_STRING const wxPGValueType* wxPGProperty::GetValueTypePtr() const { return wxPropertyContainerMethods::GetValueTypeByName(GetValueType()); } #endif // Default extra property event handling - that is, none at all. bool wxPGProperty::OnEvent( wxPropertyGrid*, wxWindow*, wxEvent& ) { return false; } void wxPGProperty::SetChoiceSelection( int newValue, const wxPGChoiceInfo& choiceInfo ) { // Changes value of a property with choices, but only // works if the value type is long or string. const wxPGValueType* vt = GetValueTypePtr(); wxCHECK_RET( choiceInfo.m_choices, wxT("invalid choiceinfo") ); if ( vt == wxPG_VALUETYPE_PTR(long) ) { DoSetValue( (long) newValue ); } else if ( vt == wxPG_VALUETYPE_PTR(wxString) ) { DoSetValue( choiceInfo.m_choices->GetLabel(newValue) ); } } int wxPGProperty::InsertChoice( const wxString& label, int index, int value ) { wxPropertyGrid* pg = GetGrid(); wxPGChoiceInfo ci; ci.m_choices = (wxPGChoices*) NULL; int sel = GetChoiceInfo(&ci); if ( ci.m_choices ) { int newSel = sel; if ( index < 0 ) index = ci.m_choices->GetCount(); if ( index <= sel ) newSel++; ci.m_choices->Insert(label, index, value); if ( sel != newSel ) SetChoiceSelection(newSel, ci); if ( this == wxPGIdToPtr(pg->GetSelection()) ) GetEditorClass()->InsertItem(pg->GetPrimaryEditor(),label,index); return index; } return -1; } void wxPGProperty::DeleteChoice( int index ) { wxPropertyGrid* pg = GetGrid(); wxPGChoiceInfo ci; ci.m_choices = (wxPGChoices*) NULL; int sel = GetChoiceInfo(&ci); if ( ci.m_choices ) { int newSel = sel; // Adjust current value if ( sel == index ) { SetFlag( wxPG_PROP_UNSPECIFIED ); newSel = 0; } else if ( index < sel ) { newSel--; } ci.m_choices->RemoveAt(index); if ( sel != newSel ) SetChoiceSelection(newSel, ci); if ( this == wxPGIdToPtr(pg->GetSelection()) ) GetEditorClass()->DeleteItem(pg->GetPrimaryEditor(), index); } } int wxPGProperty::GetChoiceInfo( wxPGChoiceInfo* ) { return 0; } void wxPGProperty::SetAttribute( int, wxVariant& ) { } #if wxUSE_VALIDATORS wxValidator* wxPGProperty::DoGetValidator() const { return (wxValidator*) NULL; } #endif bool wxPGProperty::SetChoices( wxPGChoices& choices ) { wxPGChoiceInfo ci; ci.m_choices = (wxPGChoices*) NULL; // Unref existing GetChoiceInfo(&ci); if ( ci.m_choices ) { ci.m_choices->Assign(choices); // This may be needed to trigger some initialization // (but don't do it if property is somewhat uninitialized) if ( m_parent ) DoSetValue(GetValueTypePtr()->GetDefaultValue()); return true; } return false; } const wxPGEditor* wxPGProperty::GetEditorClass() const { const wxPGEditor* editor; if ( !m_dataExt || !m_dataExt->m_customEditor ) { #ifdef __WXPYTHON__ wxString editorName = GetEditor(); if ( editorName.length() ) editor = wxPropertyContainerMethods::GetEditorByName(editorName); else #endif editor = DoGetEditorClass(); } else { editor = m_dataExt->m_customEditor; } return editor; } bool wxPGProperty::IsKindOf( wxPGPropertyClassInfo& info ) { const wxPGPropertyClassInfo* ownInfo = GetClassInfo(); do { if ( ownInfo == &info ) return true; ownInfo = ownInfo->m_baseInfo; } while ( ownInfo ); return false; } // Privatizes set of choices void wxPGProperty::SetChoicesExclusive() { wxPGChoiceInfo ci; ci.m_choices = (wxPGChoices*) NULL; GetChoiceInfo(&ci); if ( ci.m_choices ) ci.m_choices->SetExclusive(); } bool wxPGProperty::PrepareValueForDialogEditing( wxPropertyGrid* propGrid ) { wxWindow* primary = propGrid->GetEditorControl(); if ( primary && propGrid->IsEditorsValueModified() ) { GetEditorClass()->CopyValueFromControl( this, primary ); return true; } else if ( m_flags & wxPG_PROP_UNSPECIFIED ) { // Set default value in case it was unspecified DoSetValue(GetValueTypePtr()->GetDefaultValue()); } return false; } bool wxPGProperty::RecreateEditor() { wxPropertyGrid* pg = GetGrid(); wxASSERT(pg); wxPGProperty* selected = pg->GetSelection(); if ( this == selected ) { pg->DoSelectProperty(this, wxPG_SEL_FORCE); return true; } return false; } bool wxPGProperty::EnsureDataExt() { if ( !m_dataExt ) { m_dataExt = new wxPGPropertyDataExt(); return true; } return false; } void wxPGProperty::SetValueImage( wxBitmap& bmp ) { EnsureDataExt(); delete m_dataExt->m_valueBitmap; if ( &bmp && bmp.Ok() ) { // Resize the image wxSize maxSz = GetGrid()->GetImageSize(); wxSize imSz(bmp.GetWidth(),bmp.GetHeight()); if ( imSz.x != maxSz.x || imSz.y != maxSz.y ) { // Create a memory DC wxBitmap* bmpNew = new wxBitmap(maxSz.x,maxSz.y,bmp.GetDepth()); wxMemoryDC dc; dc.SelectObject(*bmpNew); // Scale // FIXME: This is ugly - use image or wait for scaling patch. double scaleX = (double)maxSz.x / (double)imSz.x; double scaleY = (double)maxSz.y / (double)imSz.y; dc.SetUserScale(scaleX,scaleY); dc.DrawBitmap( bmp, 0, 0 ); m_dataExt->m_valueBitmap = bmpNew; } else m_dataExt->m_valueBitmap = new wxBitmap(bmp); m_flags |= wxPG_PROP_CUSTOMIMAGE; } else { m_dataExt->m_valueBitmap = (wxBitmap*) NULL; m_flags &= ~(wxPG_PROP_CUSTOMIMAGE); } } wxPGProperty* wxPGProperty::GetMainParent() const { const wxPGProperty* curChild = this; const wxPGPropertyWithChildren* curParent = m_parent; while ( curParent->m_parentingType < 0 ) { curChild = curParent; curParent = curParent->m_parent; } return (wxPGProperty*) curChild; } const wxPGProperty* wxPGProperty::GetLastVisibleSubItem() const { // // Returns last visible sub-item, recursively. if ( GetParentingType() == PT_NONE ) return this; const wxPGPropertyWithChildren* pwc = (wxPGPropertyWithChildren*) this; unsigned int count = pwc->GetCount(); if ( !pwc->IsExpanded() || !count ) return this; return pwc->Last()->GetLastVisibleSubItem(); } bool wxPGProperty::UsesAutoUnspecified() const { if ( GetGrid()->GetExtraStyle() & wxPG_EX_AUTO_UNSPECIFIED_VALUES ) return true; return false; } // ----------------------------------------------------------------------- // wxPGPropertyWithChildren // ----------------------------------------------------------------------- wxPGPropertyClassInfo wxBaseParentPropertyClassInfo = {wxT("wxBaseParentProperty"), &wxBasePropertyClassInfo, (wxPGPropertyConstructor) NULL}; wxPGPropertyWithChildren::wxPGPropertyWithChildren() : wxPGProperty() { m_expanded = 1; m_y = -2; m_parentingType = -1; } wxPGPropertyWithChildren::wxPGPropertyWithChildren( const wxString &label, const wxString& name ) : wxPGProperty(label,name) { m_expanded = 1; m_y = -2; m_parentingType = -1; m_parentState = (wxPropertyGridState*) NULL; } wxPGPropertyWithChildren::~wxPGPropertyWithChildren() { Empty(); // this deletes items } // This is used by Insert etc. void wxPGPropertyWithChildren::AddChild2( wxPGProperty* prop, int index, bool correct_mode ) { if ( index < 0 || (size_t)index >= m_children.GetCount() ) { if ( correct_mode ) prop->m_arrIndex = m_children.GetCount(); m_children.Add( (void*)prop ); } else { m_children.Insert( (void*)prop, index ); if ( correct_mode ) FixIndexesOfChildren( index ); } prop->m_parent = this; } // This is used by properties that have fixed sub-properties void wxPGPropertyWithChildren::AddChild( wxPGProperty* prop ) { prop->m_arrIndex = m_children.GetCount(); m_children.Add( (void*)prop ); int custImgHeight = prop->GetImageSize().y; if ( custImgHeight < 0 /*|| custImgHeight > 1*/ ) prop->m_flags |= wxPG_PROP_CUSTOMIMAGE; prop->m_parent = this; prop->m_y = -1; // Collapsed } void wxPGPropertyWithChildren::FixIndexesOfChildren( size_t starthere ) { size_t i; for ( i=starthere;im_arrIndex = i; } // Returns (direct) child property with given name (or NULL if not found) wxPGProperty* wxPGPropertyWithChildren::GetPropertyByName( const wxString& name ) const { size_t i; for ( i=0; im_name == name ) return p; } // Does it have point, then? int pos = name.Find(wxT('.')); if ( pos <= 0 ) return (wxPGProperty*) NULL; wxPGPropertyWithChildren* pwc = (wxPGPropertyWithChildren*) GetPropertyByName(name.substr(0,pos)); if ( !pwc || !pwc->GetParentingType() ) return (wxPGProperty*) NULL; return pwc->GetPropertyByName(name.substr(pos+1,name.length()-pos-1)); } wxPGProperty* wxPGPropertyWithChildren::GetItemAtY( unsigned int y, unsigned int lh ) { // Linear search. unsigned int i = 0; unsigned int iMax = GetCount(); unsigned long py = 0xFFFFFFFF; wxPGProperty* p = (wxPGProperty*) NULL; while ( i < iMax ) { p = Item(i); if ( p->m_y >= 0 ) { py = (unsigned long)p->m_y; if ( (py+lh) > y ) break; } i++; } if ( py <= y && i < iMax ) { // perfectly this item wxASSERT_MSG( p, wxT("invalid property id") ); return p; } else { // If no visible children, we must retract our steps // (should not really happen, so right now we check that it // really doesn't). if ( py == 0xFFFFFFFF ) { wxLogDebug(wxT("wxPropertyGrid: \"%s\" (y=%i) did not have visible children (it should)."),m_label.c_str(),(int)m_y); return (wxPGProperty*) NULL; } // We are about to return a child of previous' visible item. #ifdef __WXDEBUG__ if ( i < 1 ) { wxLogDebug( wxT("WARNING: \"%s\"->GetItemAtY: (i <= 0)"), m_label.c_str() ); wxLogDebug( wxT(" \\--> y = %i, py = %i"), (int)y, (int)py ); if ( p ) wxLogDebug( wxT(" \\--> p = \"%s\""), p->GetLabel().c_str() ); else wxLogDebug( wxT(" \\--> p = None") ); return (wxPGProperty*) NULL; } #endif // Get previous *visible* parent. wxPGPropertyWithChildren* pwc; do { wxASSERT( i > 0 ); i--; pwc = (wxPGPropertyWithChildren*)Item(i); } while ( pwc->m_y < 0 ); if ( pwc->GetParentingType() != 0 ) { #ifdef __WXDEBUG__ if ( !pwc->m_expanded || pwc->m_y < 0 ) { wxLogDebug(wxT("WARNING: wxPGPropertyWithChildren::GetItemAtY: Item %s should have been visible and expanded."),pwc->m_label.c_str()); wxLogDebug(wxT(" (%s[%i]: %s)"),pwc->m_parent->m_label.c_str(),pwc->m_arrIndex,pwc->m_label.c_str()); //wxLogDebug(wxT(" py=%i"),(int)py); return (wxPGProperty*) NULL; } #endif return pwc->GetItemAtY(y,lh); } } return (wxPGProperty*) NULL; } void wxPGPropertyWithChildren::Empty() { size_t i; if ( m_expanded != wxPG_EXP_OF_COPYARRAY ) { for ( i=0; i 0, wxString(), wxT("If user property does not have any children, it must override GetValueAsString.") ); wxString text; int i; int iMax = m_children.GetCount(); if ( iMax > PWC_CHILD_SUMMARY_LIMIT && !(argFlags & wxPG_FULL_VALUE) ) iMax = PWC_CHILD_SUMMARY_LIMIT; int iMaxMinusOne = iMax-1; wxPGProperty* curChild = (wxPGProperty*) m_children.Item(0); for ( i = 0; i < iMax; i++ ) { wxString s; if ( !(curChild->m_flags & wxPG_PROP_UNSPECIFIED) ) s = curChild->GetValueAsString(argFlags); if ( curChild->GetParentingType() == 0 ) text += s; else text += wxT("[") + s + wxT("]"); if ( i < iMaxMinusOne ) { if ( text.length() > PWC_CHILD_SUMMARY_CHAR_LIMIT && !(argFlags & wxPG_EDITABLE_VALUE) && !(argFlags & wxPG_FULL_VALUE) ) break; curChild = (wxPGProperty*) m_children.Item(i+1); if ( curChild->GetParentingType() == 0 ) text += wxT("; "); else text += wxT(" "); } } if ( (unsigned int)i < m_children.GetCount() ) text += wxT("; ..."); return text; } // Convert semicolon delimited tokens into child values. bool wxPGPropertyWithChildren::SetValueFromString( const wxString& text, int argFlags ) { if ( !GetCount() ) return false; unsigned int curChild = 0; unsigned int iMax = m_children.GetCount(); if ( iMax > PWC_CHILD_SUMMARY_LIMIT && !(argFlags & wxPG_FULL_VALUE) ) iMax = PWC_CHILD_SUMMARY_LIMIT; bool changed = false; wxString token; size_t pos = 0; // Its best only to add non-empty group items bool addOnlyIfNotEmpty = false; const wxChar delimeter = wxT(';'); wxChar a; size_t lastPos = text.length(); size_t tokenStart = 0xFFFFFF; do { a = text[pos]; if ( tokenStart != 0xFFFFFF ) { // Token is running if ( a == delimeter || a == 0 ) { token = text.substr(tokenStart,pos-tokenStart); token.Trim(true); size_t len = token.length(); if ( !addOnlyIfNotEmpty || len > 0 ) { wxPGProperty* child = Item(curChild); if ( len > 0 ) { bool wasUnspecified = child->IsValueUnspecified(); if ( child->SetValueFromString( token, wxPG_REPORT_ERROR ) ) { // If modified, set mod flag and store value back to parent child->SetFlag( wxPG_PROP_MODIFIED ); // Clear unspecified flag only if SetValueFromString didn't // affect it. if ( child->IsValueUnspecified() && (wasUnspecified || !UsesAutoUnspecified()) ) child->ClearFlag( wxPG_PROP_UNSPECIFIED ); ChildChanged( child ); changed = true; } } else { child->SetFlag( wxPG_PROP_UNSPECIFIED ); changed = true; } curChild++; if ( curChild >= iMax ) break; } tokenStart = 0xFFFFFF; } } else { // Token is not running if ( a != wxT(' ') ) { addOnlyIfNotEmpty = false; // Is this a group of tokens? if ( a == wxT('[') ) { int depth = 1; pos++; size_t startPos = pos; // Group item - find end do { a = text[pos]; pos++; if ( a == wxT(']') ) depth--; else if ( a == wxT('[') ) depth++; } while ( depth > 0 && a ); token = text.substr(startPos,pos-startPos-1); if ( !token.length() ) break; wxPGProperty* child = Item(curChild); //wxLogDebug(wxT("child(1) %i: %s"),curChild,token.c_str()); if ( child->SetValueFromString( token, wxPG_REPORT_ERROR ) ) { // If modified, set mod flag and store value back to parent child->SetFlag( wxPG_PROP_MODIFIED ); ChildChanged( child ); changed = true; } curChild++; if ( curChild >= iMax ) break; addOnlyIfNotEmpty = true; tokenStart = 0xFFFFFF; } else { tokenStart = pos; if ( a == delimeter ) { pos--; } } } } pos++; } while ( pos <= lastPos ); // This ensures that the last item is set unspecified even // if the blank had no terminating delimiter. if ( curChild < iMax ) { wxPGProperty* child = Item(curChild); child->SetFlag( wxPG_PROP_UNSPECIFIED ); changed = true; } return changed; } void wxPGPropertyWithChildren::RefreshChildren () { } // ----------------------------------------------------------------------- // wxParentProperty // ----------------------------------------------------------------------- wxPGProperty* wxParentProperty( const wxString& label, const wxString& name ) { return new wxParentPropertyClass(label,name); } WX_PG_IMPLEMENT_PROPERTY_CLASS_PLAIN(wxParentProperty,none,TextCtrl) WX_PG_IMPLEMENT_CLASSINFO(wxParentProperty,wxBaseParentPropertyClass) wxParentPropertyClass::wxParentPropertyClass( const wxString& label, const wxString& name ) : wxPGPropertyWithChildren(label,name) { m_parentingType = PT_CUSTOMPROPERTY; } wxParentPropertyClass::~wxParentPropertyClass() { } void wxParentPropertyClass::DoSetValue( wxPGVariant value ) { const wxString& str = wxPGVariantToString(value); m_string = str; SetValueFromString(str,wxPG_REPORT_ERROR); } wxPGVariant wxParentPropertyClass::DoGetValue() const { return wxPGVariant(); } void wxParentPropertyClass::ChildChanged( wxPGProperty* WXUNUSED(p) ) { } wxString wxParentPropertyClass::GetValueAsString( int argFlags ) const { if ( !GetCount() ) return wxEmptyString; return wxPGPropertyWithChildren::GetValueAsString(argFlags); } // ----------------------------------------------------------------------- // wxPGRootPropertyClass // ----------------------------------------------------------------------- WX_PG_IMPLEMENT_PROPERTY_CLASS_PLAIN(wxPGRootProperty,none,TextCtrl) const wxPGPropertyClassInfo* wxPGRootPropertyClass::GetClassInfo() const { return (const wxPGPropertyClassInfo*) NULL; } wxPGRootPropertyClass::wxPGRootPropertyClass() : wxPGPropertyWithChildren() { m_parentingType = PT_ROOT; // this was PT_CAPTION in <= 1.1.6, but changed // so the depth calculations can become // more consistent. m_depth = 0; } wxPGRootPropertyClass::~wxPGRootPropertyClass() { } // ----------------------------------------------------------------------- // wxPropertyCategoryClass // ----------------------------------------------------------------------- wxPGProperty* wxPropertyCategory( const wxString& label, const wxString& name ) { return new wxPropertyCategoryClass(label,name); } WX_PG_IMPLEMENT_CLASSINFO(wxPropertyCategory,wxBaseParentPropertyClass) WX_PG_IMPLEMENT_PROPERTY_CLASS_PLAIN(wxPropertyCategory,none,TextCtrl) wxPropertyCategoryClass::wxPropertyCategoryClass() : wxPGPropertyWithChildren() { // don't set colour - prepareadditem method should do this m_parentingType = 1; m_capFgColIndex = 1; } wxPropertyCategoryClass::wxPropertyCategoryClass( const wxString &label, const wxString& name ) : wxPGPropertyWithChildren(label,name) { // don't set colour - prepareadditem method should do this m_parentingType = 1; m_capFgColIndex = 1; } wxPropertyCategoryClass::~wxPropertyCategoryClass() { } wxString wxPropertyCategoryClass::GetValueAsString( int ) const { return wxEmptyString; } void wxPropertyCategoryClass::CalculateTextExtent( wxWindow* wnd, wxFont& font ) { int x = 0, y = 0; wnd->GetTextExtent( m_label, &x, &y, 0, 0, &font ); m_textExtent = x; } // ----------------------------------------------------------------------- // wxPGEditor // ----------------------------------------------------------------------- wxPGEditor::~wxPGEditor() { } void wxPGEditor::DrawValue( wxDC& dc, wxPGProperty* property, const wxRect& rect ) const { if ( !(property->GetFlags() & wxPG_PROP_UNSPECIFIED) ) dc.DrawText( property->GetDisplayedString(), rect.x+wxPG_XBEFORETEXT, rect.y ); } void wxPGEditor::SetControlStringValue( wxWindow*, const wxString& ) const { } void wxPGEditor::SetControlIntValue( wxWindow*, int ) const { } int wxPGEditor::InsertItem( wxWindow*, const wxString&, int ) const { return -1; } void wxPGEditor::DeleteItem( wxWindow*, int ) const { return; } void wxPGEditor::OnFocus( wxPGProperty*, wxWindow* ) const { } bool wxPGEditor::CanContainCustomImage() const { return false; } // ----------------------------------------------------------------------- // wxPGClipperWindow // ----------------------------------------------------------------------- #if wxPG_ENABLE_CLIPPER_WINDOW // // Clipper window is used to "remove" borders from controls // which otherwise insist on having them despite of supplied // wxNO_BORDER window style. // class wxPGClipperWindow : public wxWindow { DECLARE_CLASS(wxPGClipperWindow) public: wxPGClipperWindow() : wxWindow() { wxPGClipperWindow::Init(); } wxPGClipperWindow(wxWindow* parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize) { Init(); Create(parent,id,pos,size); } void Create(wxWindow* parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize); virtual ~wxPGClipperWindow(); virtual bool ProcessEvent(wxEvent& event); inline wxWindow* GetControl() const { return m_ctrl; } // This is called before wxControl is constructed. void GetControlRect( int xadj, int yadj, wxPoint& pt, wxSize& sz ); // This is caleed after wxControl has been constructed. void SetControl( wxWindow* ctrl ); virtual void Refresh( bool eraseBackground = true, const wxRect *rect = (const wxRect *) NULL ); virtual void SetFocus(); virtual bool SetFont(const wxFont& font); inline int GetXClip() const { return m_xadj; } inline int GetYClip() const { return m_yadj; } protected: wxWindow* m_ctrl; int m_xadj; // Horizontal border clip. int m_yadj; // Vertical border clip. private: void Init () { m_ctrl = (wxWindow*) NULL; } }; IMPLEMENT_CLASS(wxPGClipperWindow,wxWindow) // This is called before wxControl is constructed. void wxPGClipperWindow::GetControlRect( int xadj, int yadj, wxPoint& pt, wxSize& sz ) { m_xadj = xadj; m_yadj = yadj; pt.x = -xadj; pt.y = -yadj; wxSize own_size = GetSize(); sz.x = own_size.x+(xadj*2); sz.y = own_size.y+(yadj*2); } // This is caleed after wxControl has been constructed. void wxPGClipperWindow::SetControl( wxWindow* ctrl ) { m_ctrl = ctrl; // GTK requires this. ctrl->SetSizeHints(3,3); // Correct size of this window to match the child. wxSize sz = GetSize(); wxSize chsz = ctrl->GetSize(); int hei_adj = chsz.y - (sz.y+(m_yadj*2)); if ( hei_adj ) SetSize(sz.x,chsz.y-(m_yadj*2)); } void wxPGClipperWindow::Refresh( bool eraseBackground, const wxRect *rect ) { wxWindow::Refresh(false,rect); if ( m_ctrl ) // FIXME: Rect to sub-ctrl refresh too m_ctrl->Refresh(eraseBackground); } // Pass focus to control void wxPGClipperWindow::SetFocus() { if ( m_ctrl ) m_ctrl->SetFocus(); else wxWindow::SetFocus(); } bool wxPGClipperWindow::SetFont(const wxFont& font) { bool res = wxWindow::SetFont(font); if ( m_ctrl ) return m_ctrl->SetFont(font); return res; } void wxPGClipperWindow::Create(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size ) { wxWindow::Create(parent,id,pos,size); } wxPGClipperWindow::~wxPGClipperWindow() { } bool wxPGClipperWindow::ProcessEvent(wxEvent& event) { if ( event.GetEventType() == wxEVT_SIZE ) { if ( m_ctrl ) { // Maintain correct size relationship. wxSize sz = GetSize(); m_ctrl->SetSize(sz.x+(m_xadj*2),sz.y+(m_yadj*2)); event.Skip(); return false; } } return wxWindow::ProcessEvent(event); } #endif // wxPG_ENABLE_CLIPPER_WINDOW /*wxWindow* wxPropertyGrid::GetActualEditorControl( wxWindow* ctrl ) { #if wxPG_ENABLE_CLIPPER_WINDOW // Pass real control instead of clipper window if ( ctrl->IsKindOf(CLASSINFO(wxPGClipperWindow)) ) { return ((wxPGClipperWindow*)ctrl)->GetControl(); } #else return ctrl; #endif }*/ // ----------------------------------------------------------------------- // wxPGTextCtrlEditor // ----------------------------------------------------------------------- // Clipper window support macro (depending on whether it is used // for this editor or not) #if wxPG_NAT_TEXTCTRL_BORDER_X || wxPG_NAT_TEXTCTRL_BORDER_Y #define wxPG_NAT_TEXTCTRL_BORDER_ANY 1 #define wxPGDeclareRealTextCtrl(WND) \ wxASSERT( WND ); \ wxTextCtrl* tc = (wxTextCtrl*)((wxPGClipperWindow*)WND)->GetControl() #else #define wxPG_NAT_TEXTCTRL_BORDER_ANY 0 #define wxPGDeclareRealTextCtrl(WND) \ wxASSERT( WND ); \ wxTextCtrl* tc = (wxTextCtrl*)WND #endif WX_PG_IMPLEMENT_EDITOR_CLASS(TextCtrl,wxPGTextCtrlEditor,wxPGEditor) #ifndef __WXPYTHON__ wxWindow* wxPGTextCtrlEditor::CreateControls( wxPropertyGrid* propGrid, wxPGProperty* property, const wxPoint& pos, const wxSize& sz, wxWindow** ) const #else wxPGWindowPair wxPGTextCtrlEditor::CreateControls( wxPropertyGrid* propGrid, wxPGProperty* property, const wxPoint& pos, const wxSize& sz ) const #endif { wxString text; // If has children and limited editing, then don't create. if ((property->GetFlags() & wxPG_PROP_NOEDITOR) && property->GetParentingType() < 0 && !property->IsKindOf(WX_PG_CLASSINFO(wxCustomProperty))) return (wxWindow*) NULL; if ( !(property->GetFlags() & wxPG_PROP_UNSPECIFIED) ) text = property->GetValueAsString(property->HasFlag(wxPG_PROP_READONLY)?0:wxPG_EDITABLE_VALUE); int flags = 0; if ( (property->GetFlags() & wxPG_PROP_PASSWORD) && property->IsKindOf(WX_PG_CLASSINFO(wxStringProperty)) ) flags |= wxTE_PASSWORD; wxWindow* wnd = propGrid->GenerateEditorTextCtrl(pos,sz,text,(wxWindow*)NULL,flags, property->GetMaxLength()); return wnd; } void wxPGTextCtrlEditor::DrawValue( wxDC& dc, wxPGProperty* property, const wxRect& rect ) const { if ( !(property->GetFlags() & wxPG_PROP_UNSPECIFIED) ) { wxString drawStr = property->GetDisplayedString(); // Code below should no longer be needed, as the obfuscation // is now done in GetValueAsString. /*if ( (property->GetFlags() & wxPG_PROP_PASSWORD) && property->IsKindOf(WX_PG_CLASSINFO(wxStringProperty)) ) { size_t a = drawStr.length(); drawStr.Empty(); drawStr.Append(wxT('*'),a); }*/ dc.DrawText( drawStr, rect.x+wxPG_XBEFORETEXT, rect.y ); } } void wxPGTextCtrlEditor::UpdateControl( wxPGProperty* property, wxWindow* ctrl ) const { wxPGDeclareRealTextCtrl(ctrl); tc->SetValue(property->GetDisplayedString()); } // Provided so that, for example, ComboBox editor can use the same code // (multiple inheritance would get way too messy). bool wxPGTextCtrlEditor::OnTextCtrlEvent( wxPropertyGrid* propGrid, wxPGProperty* property, wxWindow* ctrl, wxEvent& event ) { if ( !ctrl ) return false; if ( event.GetEventType() == wxEVT_COMMAND_TEXT_ENTER ) { if ( propGrid->IsEditorsValueModified() ) { return true; } } else if ( event.GetEventType() == wxEVT_COMMAND_TEXT_UPDATED ) { wxPGDeclareRealTextCtrl(ctrl); // If value is unspecified and character count is zero, // then do not set as modified. if ( !(property->GetFlags() & wxPG_PROP_UNSPECIFIED) || !tc || (tc->IsKindOf(CLASSINFO(wxTextCtrl)) && (tc->GetLastPosition() > 0)) ) { // We must check this since an 'empty' text event // may be triggered when creating the property. if ( !(propGrid->GetInternalFlags() & wxPG_FL_IN_SELECT_PROPERTY) ) { // // Pass this event outside wxPropertyGrid so that, // if necessary, program can tell when user is editing // a textctrl. // FIXME: Is it safe to change event id in the middle of event // processing (seems to work, but...)? event.Skip(); event.SetId(propGrid->GetId()); } propGrid->EditorsValueWasModified(); } } return false; } bool wxPGTextCtrlEditor::OnEvent( wxPropertyGrid* propGrid, wxPGProperty* property, wxWindow* ctrl, wxEvent& event ) const { return wxPGTextCtrlEditor::OnTextCtrlEvent(propGrid,property,ctrl,event); } bool wxPGTextCtrlEditor::CopyTextCtrlValueFromControl( wxPGProperty* property, wxWindow* ctrl ) { #if wxPG_ENABLE_CLIPPER_WINDOW // Pass real control instead of clipper window if ( ctrl->IsKindOf(CLASSINFO(wxPGClipperWindow)) ) { ctrl = ((wxPGClipperWindow*)ctrl)->GetControl(); } #endif wxTextCtrl* tc = (wxTextCtrl*)ctrl; bool res = property->SetValueFromString(tc->GetValue(),0); // Changing unspecified always causes event (returning // true here should be enough to trigger it). if ( !res && property->IsFlagSet(wxPG_PROP_UNSPECIFIED) ) res = true; return res; } bool wxPGTextCtrlEditor::CopyValueFromControl( wxPGProperty* property, wxWindow* ctrl ) const { return wxPGTextCtrlEditor::CopyTextCtrlValueFromControl(property,ctrl); } void wxPGTextCtrlEditor::SetValueToUnspecified( wxWindow* ctrl ) const { wxPGDeclareRealTextCtrl(ctrl); tc->Remove(0,tc->GetValue().length()); } void wxPGTextCtrlEditor::SetControlStringValue( wxWindow* ctrl, const wxString& txt ) const { wxPGDeclareRealTextCtrl(ctrl); tc->SetValue(txt); } void wxPGTextCtrlEditor::OnFocus( wxPGProperty*, wxWindow* wnd ) const { wxPGDeclareRealTextCtrl(wnd); tc->SetSelection(-1,-1); } wxPGTextCtrlEditor::~wxPGTextCtrlEditor() { } // ----------------------------------------------------------------------- // wxPGChoiceEditor // ----------------------------------------------------------------------- extern const wxChar* wxPG_ClassName_wxBoolProperty; // in props.cpp WX_PG_IMPLEMENT_EDITOR_CLASS(Choice,wxPGChoiceEditor,wxPGEditor) // This is a special enhanced double-click processor class. // In essence, it allows for double-clicks for which the // first click "created" the control. class wxPGDoubleClickProcessor : public wxEvtHandler { public: wxPGDoubleClickProcessor( wxPGOwnerDrawnComboBox* combo ) : wxEvtHandler() { m_timeLastMouseUp = 0; m_combo = combo; m_downReceived = false; } protected: void OnMouseEvent( wxMouseEvent& event ) { wxLongLong t = ::wxGetLocalTimeMillis(); int evtType = event.GetEventType(); if ( m_combo->HasFlag(wxPGCC_DCLICK_CYCLES) && !m_combo->IsPopupShown() ) { // Just check that it is in the text area wxPoint pt = event.GetPosition(); if ( m_combo->GetTextRect().wxPGRectContains(pt) ) { if ( evtType == wxEVT_LEFT_DOWN ) { // Set value to avoid up-events without corresponding downs m_downReceived = true; } else if ( evtType == wxEVT_LEFT_DCLICK ) { // We'll make our own double-clicks event.SetEventType(0); return; } else if ( evtType == wxEVT_LEFT_UP ) { if ( m_downReceived || m_timeLastMouseUp == 1 ) { wxLongLong timeFromLastUp = (t-m_timeLastMouseUp); if ( timeFromLastUp < DOUBLE_CLICK_CONVERSION_TRESHOLD ) { event.SetEventType(wxEVT_LEFT_DCLICK); m_timeLastMouseUp = 1; } else { m_timeLastMouseUp = t; } } } } } event.Skip(); } void OnSetFocus( wxFocusEvent& event ) { m_timeLastMouseUp = ::wxGetLocalTimeMillis(); event.Skip(); } private: wxLongLong m_timeLastMouseUp; wxPGOwnerDrawnComboBox* m_combo; bool m_downReceived; DECLARE_EVENT_TABLE() }; BEGIN_EVENT_TABLE(wxPGDoubleClickProcessor, wxEvtHandler) EVT_MOUSE_EVENTS(wxPGDoubleClickProcessor::OnMouseEvent) EVT_SET_FOCUS(wxPGDoubleClickProcessor::OnSetFocus) END_EVENT_TABLE() class wxPGComboBox : public wxPGOwnerDrawnComboBox { public: wxPGComboBox() : wxPGOwnerDrawnComboBox() { m_dclickProcessor = (wxPGDoubleClickProcessor*) NULL; } ~wxPGComboBox() { if ( m_dclickProcessor ) { RemoveEventHandler(m_dclickProcessor); delete m_dclickProcessor; } } bool Create(wxWindow *parent, wxWindowID id, const wxString& value = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, int n = 0, const wxString choices[] = (const wxString *) NULL, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxComboBoxNameStr) { if ( !wxPGOwnerDrawnComboBox::Create( parent, id, value, pos, size, n, choices, style, validator, name ) ) return false; m_dclickProcessor = new wxPGDoubleClickProcessor(this); PushEventHandler(m_dclickProcessor); return true; } virtual bool OnDrawListItem( wxDC& dc, const wxRect& rect, int item, int flags ) { wxPropertyGrid* pg = wxDynamicCast(GetParent(),wxPropertyGrid); wxASSERT(pg); pg->OnComboItemPaint((wxPGCustomComboControl*)this,item,dc,(wxRect&)rect,flags); return true; } virtual wxCoord OnMeasureListItem( int item ) { wxPropertyGrid* pg = wxDynamicCast(GetParent(),wxPropertyGrid); wxASSERT(pg); wxRect rect; rect.x = -1; rect.width = 0; pg->OnComboItemPaint((wxPGCustomComboControl*)this,item,*((wxDC*)NULL),rect,0); return rect.height; } virtual wxCoord OnMeasureListItemWidth( int item ) { wxPropertyGrid* pg = wxDynamicCast(GetParent(),wxPropertyGrid); wxASSERT(pg); wxRect rect; rect.x = -1; rect.width = -1; pg->OnComboItemPaint((wxPGCustomComboControl*)this,item,*((wxDC*)NULL),rect,0); return rect.width; } private: wxPGDoubleClickProcessor* m_dclickProcessor; }; void wxPropertyGrid::OnComboItemPaint( wxPGCustomComboControl* pCc, int item, wxDC& dc, wxRect& rect, int flags ) { wxPGOwnerDrawnComboBox* pCb = (wxPGOwnerDrawnComboBox*)pCc; // Sanity check wxASSERT( IsKindOf(CLASSINFO(wxPropertyGrid)) ); wxPGProperty* p = m_selected; // // Decide what custom image size to use wxSize cis = GetImageSize(p); if ( rect.x < 0 && !(m_iFlags & wxPG_FL_SELECTED_IS_PAINT_FLEXIBLE) ) { // Default measure behaviour (no flexible, custom paint image only) if ( rect.width < 0 ) { wxCoord x, y; GetTextExtent(pCb->GetString(item), &x, &y, 0, 0, &m_font); rect.width = cis.x + wxCC_CUSTOM_IMAGE_MARGIN1 + wxCC_CUSTOM_IMAGE_MARGIN2 + 9 + x; } rect.height = cis.y + 2; return; } wxPGPaintData paintdata; paintdata.m_parent = NULL; paintdata.m_choiceItem = item; // This is by the current (1.0.0b) spec - if painting control, item is -1 if ( (flags & wxPGCC_PAINTING_CONTROL) ) paintdata.m_choiceItem = -1; if ( &dc ) dc.SetBrush(*wxWHITE_BRUSH); if ( rect.x >= 0 ) { // // DrawItem call wxPoint pt(rect.x + wxPG_CONTROL_MARGIN - wxPG_CHOICEXADJUST - 1, rect.y + 1); if ( cis.x > 0 && ( !p->m_dataExt || !p->m_dataExt->m_valueBitmap || item == pCb->GetSelection() ) && ( item >= 0 || (flags & wxPGCC_PAINTING_CONTROL) ) ) { pt.x += wxCC_CUSTOM_IMAGE_MARGIN1; wxRect r(pt.x,pt.y,cis.x,cis.y); if ( flags & wxPGCC_PAINTING_CONTROL ) { //r.width = cis.x; r.height = wxPG_STD_CUST_IMAGE_HEIGHT(m_lineHeight); } if ( m_iFlags & wxPG_FL_SELECTED_IS_FULL_PAINT ) r.width = rect.width; paintdata.m_drawnWidth = r.width; dc.SetPen(m_colPropFore); if ( item >= 0 ) p->OnCustomPaint( dc, r, paintdata ); else dc.DrawRectangle( r ); if ( (m_iFlags & wxPG_FL_SELECTED_IS_FULL_PAINT) ) { if ( paintdata.m_drawnWidth > 0 ) return; // Revert pt.x pt.x -= (wxCC_CUSTOM_IMAGE_MARGIN1+1); } else pt.x += paintdata.m_drawnWidth + wxCC_CUSTOM_IMAGE_MARGIN2 - 1; } else // TODO: This aligns text so that it seems to be horizontally // on the same line as property values. Not really // sure if its needed, but seems to not cause any harm. pt.x -= 1; // // Draw text // pt.y += (rect.height-m_fontHeight)/2 - 1; wxString text; if ( !(flags & wxPGCC_PAINTING_CONTROL) ) { text = pCb->GetString(item); } else { if ( !p->IsValueUnspecified() ) text = p->GetValueAsString(0); } dc.DrawText( text, pt.x + wxPG_XBEFORETEXT, pt.y ); } else { // // MeasureItem call p->OnCustomPaint( dc, rect, paintdata ); rect.height = paintdata.m_drawnHeight + 2; rect.width = cis.x + wxCC_CUSTOM_IMAGE_MARGIN1 + wxCC_CUSTOM_IMAGE_MARGIN2 + 9; } } // CreateControls calls this with CB_READONLY in extraStyle wxWindow* wxPGChoiceEditor::CreateControlsBase( wxPropertyGrid* propGrid, wxPGProperty* property, const wxPoint& pos, const wxSize& sz, long extraStyle ) const { wxString defString; wxPGChoiceInfo choiceInfo; // Get choices. choiceInfo.m_arrWxString = (wxString*) NULL; choiceInfo.m_arrWxChars = (const wxChar**) NULL; choiceInfo.m_itemCount = 0; int index = property->GetChoiceInfo( &choiceInfo ); if ( property->GetFlags() & wxPG_PROP_UNSPECIFIED ) { index = -1; } else { defString = property->GetDisplayedString(); } // SLAlloc allows fast conversion using potentially pre-allocated wxStrings // (and appending is out of question due to performance problems on some platforms). // If itemcount is < 0, fill wxArrayString using GetEntry if ( choiceInfo.m_itemCount < 0 ) { wxBaseEnumPropertyClass* ep = (wxBaseEnumPropertyClass*) property; size_t i = 0; const wxString* entryLabel; int entryValue; wxArrayString& sl = propGrid->SLGet(); entryLabel = ep->GetEntry(i,&entryValue); while ( entryLabel ) { if ( sl.GetCount() > i ) sl[i] = *entryLabel; else sl.Add(*entryLabel); i++; entryLabel = ep->GetEntry(i,&entryValue); } choiceInfo.m_itemCount = ((int)i) - 1; } else if ( !choiceInfo.m_arrWxString ) { wxASSERT( choiceInfo.m_arrWxChars || !choiceInfo.m_itemCount ); propGrid->SLAlloc( choiceInfo.m_itemCount, choiceInfo.m_arrWxChars ); if ( choiceInfo.m_itemCount ) choiceInfo.m_arrWxString = &propGrid->SLGet().Item(0); } //wxPGOwnerDrawnComboBox* cb; wxPGComboBox* cb; wxPoint po(pos); wxSize si(sz); po.y += wxPG_CHOICEYADJUST; si.y -= (wxPG_CHOICEYADJUST*2); /*#if wxPG_NAT_CHOICE_BORDER_ANY po.x += (wxPG_CHOICEXADJUST+wxPG_NAT_CHOICE_BORDER_X); si.x -= (wxPG_CHOICEXADJUST+wxPG_NAT_CHOICE_BORDER_X); wxPGClipperWindow* wnd = new wxPGClipperWindow(propGrid,wxPG_SUBID1,po,si); wxWindow* ctrlParent = wnd; wnd->GetControlRect(wxPG_NAT_CHOICE_BORDER_X,wxPG_NAT_CHOICE_BORDER_Y,po,si); #else*/ po.x += wxPG_CHOICEXADJUST; si.x -= wxPG_CHOICEXADJUST; wxWindow* ctrlParent = propGrid; //#endif // NB: Using wxWidgets wxOwnerDrawnComboBox needs adding wxTE_PROCESS_ENTER // into the flags. int odcbFlags = extraStyle | wxNO_BORDER | wxPGCC_PROCESS_ENTER | wxPGCC_ALT_KEYS; if ( !(property->GetFlags() & wxPG_PROP_CUSTOMIMAGE) ) odcbFlags |= wxODCB_STD_CONTROL_PAINT; if ( (property->GetFlags() & wxPG_PROP_USE_DCC) && (property->GetClassName()==wxPG_ClassName_wxBoolProperty) ) odcbFlags |= wxPGCC_DCLICK_CYCLES; cb = new wxPGComboBox(); #ifdef __WXMSW__ cb->Hide(); #endif cb->Create(ctrlParent, wxPG_SUBID1, wxString(), po, si, choiceInfo.m_itemCount,choiceInfo.m_arrWxString, //(wxComboPaintCallback) &wxPropertyGrid::OnComboItemPaint, odcbFlags); int extRight = propGrid->GetClientSize().x - (po.x+si.x); cb->SetButtonPosition(si.y,0,wxRIGHT); cb->SetPopupExtents( 1, extRight ); cb->SetTextIndent(wxPG_XBEFORETEXT-2); if ( (property->GetFlags() & wxPG_PROP_CUSTOMIMAGE) && !(propGrid->GetInternalFlags() & wxPG_FL_SELECTED_IS_FULL_PAINT) ) { wxSize imageSize = propGrid->GetImageSize(property); cb->SetCustomPaintWidth( imageSize.x+6 ); } if ( index >= 0 && index < (int)cb->GetCount() ) { cb->SetSelection( index ); if ( defString.length() ) cb->SetValue( defString ); } else if ( !(extraStyle & wxCB_READONLY) && defString.length() ) cb->SetValue( defString ); else cb->SetSelection( -1 ); if ( property->HasFlag(wxPG_PROP_READONLY) ) cb->Disable(); #ifdef __WXMSW__ cb->Show(); #endif return (wxWindow*) cb; } void wxPGChoiceEditor::UpdateControl( wxPGProperty* property, wxWindow* ctrl ) const { wxASSERT( ctrl ); wxPGOwnerDrawnComboBox* cb = (wxPGOwnerDrawnComboBox*)ctrl; wxASSERT( cb->IsKindOf(CLASSINFO(wxPGOwnerDrawnComboBox))); int ind = property->GetChoiceInfo( (wxPGChoiceInfo*)NULL ); cb->SetSelection(ind); } #ifndef __WXPYTHON__ wxWindow* wxPGChoiceEditor::CreateControls( wxPropertyGrid* propGrid, wxPGProperty* property, const wxPoint& pos, const wxSize& sz, wxWindow** ) const #else wxPGWindowPair wxPGChoiceEditor::CreateControls( wxPropertyGrid* propGrid, wxPGProperty* property, const wxPoint& pos, const wxSize& sz ) const #endif { return CreateControlsBase(propGrid,property,pos,sz,wxCB_READONLY); } int wxPGChoiceEditor::InsertItem( wxWindow* ctrl, const wxString& label, int index ) const { wxASSERT( ctrl ); wxPGOwnerDrawnComboBox* cb = (wxPGOwnerDrawnComboBox*)ctrl; wxASSERT( cb->IsKindOf(CLASSINFO(wxPGOwnerDrawnComboBox))); if (index < 0) index = cb->GetCount(); return cb->Insert(label,index); } void wxPGChoiceEditor::DeleteItem( wxWindow* ctrl, int index ) const { wxASSERT( ctrl ); wxPGOwnerDrawnComboBox* cb = (wxPGOwnerDrawnComboBox*)ctrl; wxASSERT( cb->IsKindOf(CLASSINFO(wxPGOwnerDrawnComboBox))); cb->Delete(index); } bool wxPGChoiceEditor::OnEvent( wxPropertyGrid* WXUNUSED(propGrid), wxPGProperty* WXUNUSED(property), wxWindow* WXUNUSED(ctrl), wxEvent& event ) const { if ( event.GetEventType() == wxEVT_COMMAND_COMBOBOX_SELECTED ) { /*if ( CopyValueFromControl( property, ctrl ) ) { return true; } propGrid->EditorsValueWasNotModified(); //wxPropertyGridState::ClearPropertyAndChildrenFlags(property,wxPG_PROP_UNSPECIFIED); CLEAR_PROPERTY_UNSPECIFIED_FLAG(property);*/ return true; } return false; } bool wxPGChoiceEditor::CopyValueFromControl( wxPGProperty* property, wxWindow* ctrl ) const { wxPGOwnerDrawnComboBox* cb = (wxPGOwnerDrawnComboBox*)ctrl; int index = cb->GetSelection(); if ( index != property->GetChoiceInfo( (wxPGChoiceInfo*) NULL ) || // Changing unspecified always causes event (returning // true here should be enough to trigger it). property->IsFlagSet(wxPG_PROP_UNSPECIFIED) ) { property->SetValueFromInt(index,0); return true; } return false; } void wxPGChoiceEditor::SetControlStringValue( wxWindow* ctrl, const wxString& txt ) const { wxPGOwnerDrawnComboBox* cb = (wxPGOwnerDrawnComboBox*)ctrl; wxASSERT( cb ); cb->SetValue(txt); } void wxPGChoiceEditor::SetControlIntValue( wxWindow* ctrl, int value ) const { wxPGOwnerDrawnComboBox* cb = (wxPGOwnerDrawnComboBox*)ctrl; wxASSERT( cb ); cb->SetSelection(value); } void wxPGChoiceEditor::SetValueToUnspecified( wxWindow* ctrl ) const { wxPGOwnerDrawnComboBox* cb = (wxPGOwnerDrawnComboBox*)ctrl; cb->SetSelection(-1); } bool wxPGChoiceEditor::CanContainCustomImage() const { return true; } wxPGChoiceEditor::~wxPGChoiceEditor() { } // ----------------------------------------------------------------------- // wxPGComboBoxEditor // ----------------------------------------------------------------------- WX_PG_IMPLEMENT_EDITOR_CLASS(ComboBox,wxPGComboBoxEditor,wxPGChoiceEditor) void wxPGComboBoxEditor::UpdateControl( wxPGProperty* property, wxWindow* ctrl ) const { wxPGOwnerDrawnComboBox* cb = (wxPGOwnerDrawnComboBox*)ctrl; cb->SetValue(property->GetDisplayedString()); // TODO: If string matches any selection, then select that. } #ifndef __WXPYTHON__ wxWindow* wxPGComboBoxEditor::CreateControls( wxPropertyGrid* propGrid, wxPGProperty* property, const wxPoint& pos, const wxSize& sz, wxWindow** ) const #else wxPGWindowPair wxPGComboBoxEditor::CreateControls( wxPropertyGrid* propGrid, wxPGProperty* property, const wxPoint& pos, const wxSize& sz ) const #endif { return CreateControlsBase(propGrid,property,pos,sz,0); } bool wxPGComboBoxEditor::OnEvent( wxPropertyGrid* propGrid, wxPGProperty* property, wxWindow* ctrl, wxEvent& event ) const { wxPGOwnerDrawnComboBox* cb = (wxPGOwnerDrawnComboBox*) NULL; wxWindow* textCtrl = (wxWindow*) NULL; if ( ctrl ) { cb = (wxPGOwnerDrawnComboBox*)ctrl; textCtrl = cb->GetTextCtrl(); } if ( wxPGTextCtrlEditor::OnTextCtrlEvent(propGrid,property,textCtrl,event) ) return true; return wxPGChoiceEditor::OnEvent(propGrid,property,ctrl,event); } bool wxPGComboBoxEditor::CopyValueFromControl( wxPGProperty* property, wxWindow* ctrl ) const { wxPGOwnerDrawnComboBox* cb = (wxPGOwnerDrawnComboBox*)ctrl; bool res = property->SetValueFromString(cb->GetValue(),0); // Changing unspecified always causes event (returning // true here should be enough to trigger it). if ( !res && property->IsFlagSet(wxPG_PROP_UNSPECIFIED) ) res = true; return res; } void wxPGComboBoxEditor::OnFocus( wxPGProperty*, wxWindow* ctrl ) const { wxPGOwnerDrawnComboBox* cb = (wxPGOwnerDrawnComboBox*)ctrl; cb->GetTextCtrl()->SetSelection(-1,-1); } wxPGComboBoxEditor::~wxPGComboBoxEditor() { } // ----------------------------------------------------------------------- // wxPGChoiceAndButtonEditor // ----------------------------------------------------------------------- // This simpler implement_editor macro doesn't define class body. WX_PG_IMPLEMENT_EDITOR_CLASS(ChoiceAndButton,wxPGChoiceAndButtonEditor,wxPGChoiceEditor) #ifndef __WXPYTHON__ wxWindow* wxPGChoiceAndButtonEditor::CreateControls( wxPropertyGrid* propGrid, wxPGProperty* property, const wxPoint& pos, const wxSize& sz, wxWindow** psecondary ) const #else wxPGWindowPair wxPGChoiceAndButtonEditor::CreateControls( wxPropertyGrid* propGrid, wxPGProperty* property, const wxPoint& pos, const wxSize& sz ) const #endif { // Use one two units smaller to match size of the combo's dropbutton. // (normally a bigger button is used because it looks better) int bt_wid = sz.y; bt_wid -= 2; wxSize bt_sz(bt_wid,bt_wid); // Position of button. wxPoint bt_pos(pos.x+sz.x-bt_sz.x,pos.y); #ifdef __WXMAC__ bt_pos.y -= 1; #else bt_pos.y += 1; #endif wxWindow* bt = propGrid->GenerateEditorButton( bt_pos, bt_sz ); // Size of choice. wxSize ch_sz(sz.x-bt->GetSize().x,sz.y); #ifdef __WXMAC__ ch_sz.x -= wxPG_TEXTCTRL_AND_BUTTON_SPACING; #endif wxWindow* ch = wxPG_EDITOR(Choice)->CreateControls(propGrid,property, pos,ch_sz #ifndef __WXPYTHON__ , (wxWindow**)NULL); #else ).m_primary; #endif #ifdef __WXMSW__ bt->Show(); #endif #ifndef __WXPYTHON__ *psecondary = bt; return ch; #else return wxPGWindowPair(ch, bt); #endif } wxPGChoiceAndButtonEditor::~wxPGChoiceAndButtonEditor() { } // ----------------------------------------------------------------------- // wxPGTextCtrlAndButtonEditor // ----------------------------------------------------------------------- // This simpler implement_editor macro doesn't define class body. WX_PG_IMPLEMENT_EDITOR_CLASS(TextCtrlAndButton,wxPGTextCtrlAndButtonEditor,wxPGTextCtrlEditor) #ifndef __WXPYTHON__ wxWindow* wxPGTextCtrlAndButtonEditor::CreateControls( wxPropertyGrid* propGrid, wxPGProperty* property, const wxPoint& pos, const wxSize& sz, wxWindow** psecondary ) const { wxWindow* wnd = propGrid->GenerateEditorTextCtrlAndButton( pos, sz, psecondary, property->GetFlags() & wxPG_PROP_NOEDITOR, property); return wnd; } #else wxPGWindowPair wxPGTextCtrlAndButtonEditor::CreateControls( wxPropertyGrid* propGrid, wxPGProperty* property, const wxPoint& pos, const wxSize& sz ) const { wxWindow* wnd2; wxWindow* wnd = propGrid->GenerateEditorTextCtrlAndButton( pos, sz, &wnd2, property->GetFlags() & wxPG_PROP_NOEDITOR, property); return wxPGWindowPair(wnd, wnd2); } #endif wxPGTextCtrlAndButtonEditor::~wxPGTextCtrlAndButtonEditor() { } // ----------------------------------------------------------------------- // wxPGCheckBoxEditor // ----------------------------------------------------------------------- #if wxPG_INCLUDE_CHECKBOX WX_PG_IMPLEMENT_EDITOR_CLASS(CheckBox,wxPGCheckBoxEditor,wxPGEditor) // state argument: 0x01 = set if checked // 0x02 = set if rectangle should be bold static void DrawSimpleCheckBox( wxDC& dc, const wxRect& rect, int box_hei, int state, const wxColour& linecol ) { // Box rectangle. wxRect r(rect.x+wxPG_XBEFORETEXT,rect.y+((rect.height-box_hei)/2),box_hei,box_hei); // Draw check mark first because it is likely to overdraw the // surrounding rectangle. if ( state & 1 ) { wxRect r2(r.x+wxPG_CHECKMARK_XADJ, r.y+wxPG_CHECKMARK_YADJ, r.width+wxPG_CHECKMARK_WADJ, r.height+wxPG_CHECKMARK_HADJ); #if wxPG_CHECKMARK_DEFLATE r2.Deflate(wxPG_CHECKMARK_DEFLATE); #endif dc.DrawCheckMark(r2); // This would draw a simple cross check mark. // dc.DrawLine(r.x,r.y,r.x+r.width-1,r.y+r.height-1); // dc.DrawLine(r.x,r.y+r.height-1,r.x+r.width-1,r.y); } if ( !(state & 2) ) { // Pen for thin rectangle. dc.SetPen(linecol); } else { // Pen for bold rectangle. wxPen linepen(linecol,2,wxSOLID); linepen.SetJoin(wxJOIN_MITER); // This prevents round edges. dc.SetPen(linepen); r.x++; r.y++; r.width--; r.height--; } dc.SetBrush(*wxTRANSPARENT_BRUSH); dc.DrawRectangle(r); dc.SetPen(*wxTRANSPARENT_PEN); } // // Real simple custom-drawn checkbox-without-label class. // class wxSimpleCheckBox : public wxControl { public: void SetValue( int value ); wxSimpleCheckBox( wxWindow* parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize ) : wxControl(parent,id,pos,size,wxNO_BORDER|wxWANTS_CHARS) { // Due to SetOwnFont stuff necessary for GTK+ 1.2, we need to have this SetFont( parent->GetFont() ); m_state = 0; m_boxHeight = ((wxPropertyGrid*)parent)->GetFontHeight(); SetBackgroundStyle( wxBG_STYLE_COLOUR ); } virtual ~wxSimpleCheckBox(); virtual bool ProcessEvent(wxEvent& event); int m_state; int m_boxHeight; static wxBitmap* ms_doubleBuffer; }; wxSimpleCheckBox::~wxSimpleCheckBox() { delete ms_doubleBuffer; ms_doubleBuffer = NULL; } wxBitmap* wxSimpleCheckBox::ms_doubleBuffer = (wxBitmap*) NULL; // value = 2 means toggle (sorry, too lazy to do constants) void wxSimpleCheckBox::SetValue( int value ) { if ( value > 1 ) { m_state++; if ( m_state > 1 ) m_state = 0; } else { m_state = value; } Refresh(); wxCommandEvent evt(wxEVT_COMMAND_CHECKBOX_CLICKED,GetParent()->GetId()); ((wxPropertyGrid*)GetParent())->OnCustomEditorEvent(evt); } bool wxSimpleCheckBox::ProcessEvent(wxEvent& event) { wxPropertyGrid* propGrid = (wxPropertyGrid*) GetParent(); if ( event.GetEventType() == wxEVT_NAVIGATION_KEY ) { //wxLogDebug(wxT("wxEVT_NAVIGATION_KEY")); //SetFocusFromKbd(); //event.Skip(); //return wxControl::ProcessEvent(event); } else if ( ( (event.GetEventType() == wxEVT_LEFT_DOWN || event.GetEventType() == wxEVT_LEFT_DCLICK) && ((wxMouseEvent&)event).m_x > (wxPG_XBEFORETEXT-2) && ((wxMouseEvent&)event).m_x <= (wxPG_XBEFORETEXT-2+m_boxHeight) ) ) { SetValue(2); return true; } else if ( event.GetEventType() == wxEVT_PAINT ) { wxSize clientSize = GetClientSize(); wxPaintDC dc(this); /* // Buffered paint DC doesn't seem to do much good if ( !ms_doubleBuffer || clientSize.x > ms_doubleBuffer->GetWidth() || clientSize.y > ms_doubleBuffer->GetHeight() ) { delete ms_doubleBuffer; ms_doubleBuffer = new wxBitmap(clientSize.x+25,clientSize.y+25); } wxBufferedPaintDC dc(this,*ms_doubleBuffer); */ wxRect rect(0,0,clientSize.x,clientSize.y); rect.x -= 1; rect.width += 1; m_boxHeight = propGrid->GetFontHeight(); wxColour bgcol = GetBackgroundColour(); dc.SetBrush( bgcol ); dc.SetPen( bgcol ); dc.DrawRectangle( rect ); wxColour txcol = GetForegroundColour(); int state = m_state; if ( m_font.GetWeight() == wxBOLD ) state |= 2; DrawSimpleCheckBox(dc,rect,m_boxHeight,state,txcol); // If focused, indicate it somehow. /* if ( wxWindow::FindFocus() == this ) { rect.x += 1; rect.width -= 1; wxPGDrawFocusRect(dc,rect); } */ return true; } else if ( event.GetEventType() == wxEVT_SIZE || event.GetEventType() == wxEVT_SET_FOCUS || event.GetEventType() == wxEVT_KILL_FOCUS ) { Refresh(); } else if ( event.GetEventType() == wxEVT_KEY_DOWN ) { wxKeyEvent& keyEv = (wxKeyEvent&) event; if ( keyEv.GetKeyCode() == WXK_TAB ) { propGrid->SendNavigationKeyEvent( keyEv.ShiftDown()?0:1 ); return true; } else if ( keyEv.GetKeyCode() == WXK_SPACE ) { SetValue(2); return true; } } return wxControl::ProcessEvent(event); } #ifndef __WXPYTHON__ wxWindow* wxPGCheckBoxEditor::CreateControls( wxPropertyGrid* propGrid, wxPGProperty* property, const wxPoint& pos, const wxSize& size, wxWindow** ) const #else wxPGWindowPair wxPGCheckBoxEditor::CreateControls( wxPropertyGrid* propGrid, wxPGProperty* property, const wxPoint& pos, const wxSize& size ) const #endif { wxPoint pt = pos; pt.x -= wxPG_XBEFOREWIDGET; wxSize sz = size; sz.x += wxPG_XBEFOREWIDGET; wxSimpleCheckBox* cb = new wxSimpleCheckBox(propGrid,wxPG_SUBID1,pt,sz); cb->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW)); cb->Connect( wxPG_SUBID1, wxEVT_LEFT_DOWN, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) &wxPropertyGrid::OnCustomEditorEvent, NULL, propGrid ); cb->Connect( wxPG_SUBID1, wxEVT_LEFT_DCLICK, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) &wxPropertyGrid::OnCustomEditorEvent, NULL, propGrid ); if ( property->GetChoiceInfo((wxPGChoiceInfo*)NULL) && !(property->GetFlags() & wxPG_PROP_UNSPECIFIED) ) cb->m_state = 1; // If mouse cursor was on the item, toggle the value now. if ( propGrid->GetInternalFlags() & wxPG_FL_ACTIVATION_BY_CLICK ) { wxPoint pt = propGrid->ScreenToClient(::wxGetMousePosition()); if ( pt.x <= (cb->GetPosition().x+wxPG_XBEFORETEXT-2+cb->m_boxHeight) ) { cb->m_state++; if ( cb->m_state > 1 ) cb->m_state = 0; property->ClearFlag(wxPG_PROP_UNSPECIFIED); property->SetValueFromInt(cb->m_state,0); propGrid->PropertyWasModified(property); } } return cb; } void wxPGCheckBoxEditor::DrawValue( wxDC& dc, wxPGProperty* property, const wxRect& rect ) const { int state = 0; if ( !(property->GetFlags() & wxPG_PROP_UNSPECIFIED) ) { state = property->GetChoiceInfo((wxPGChoiceInfo*)NULL); if ( dc.GetFont().GetWeight() == wxBOLD ) state |= 2; } DrawSimpleCheckBox(dc,rect,dc.GetCharHeight(),state,dc.GetTextForeground()); } void wxPGCheckBoxEditor::UpdateControl( wxPGProperty* property, wxWindow* ctrl ) const { wxASSERT( ctrl ); ((wxSimpleCheckBox*)ctrl)->m_state = property->GetChoiceInfo((wxPGChoiceInfo*)NULL); ctrl->Refresh(); } bool wxPGCheckBoxEditor::OnEvent( wxPropertyGrid* WXUNUSED(propGrid), wxPGProperty* WXUNUSED(property), wxWindow* WXUNUSED(ctrl), wxEvent& event ) const { if ( event.GetEventType() == wxEVT_COMMAND_CHECKBOX_CLICKED ) { /*if ( CopyValueFromControl( property, ctrl ) ) return true; propGrid->EditorsValueWasNotModified(); CLEAR_PROPERTY_UNSPECIFIED_FLAG(property);*/ return true; } return false; } bool wxPGCheckBoxEditor::CopyValueFromControl( wxPGProperty* property, wxWindow* ctrl ) const { wxSimpleCheckBox* cb = (wxSimpleCheckBox*)ctrl; int index = cb->m_state; if ( index != property->GetChoiceInfo( (wxPGChoiceInfo*) NULL ) || // Changing unspecified always causes event (returning // true here should be enough to trigger it). property->IsFlagSet(wxPG_PROP_UNSPECIFIED) ) { property->SetValueFromInt(index,0); return true; } return false; } void wxPGCheckBoxEditor::SetControlIntValue( wxWindow* ctrl, int value ) const { if ( value != 0 ) value = 1; ((wxSimpleCheckBox*)ctrl)->m_state = value; ctrl->Refresh(); } void wxPGCheckBoxEditor::SetValueToUnspecified( wxWindow* ctrl ) const { ((wxSimpleCheckBox*)ctrl)->m_state = 0; ctrl->Refresh(); } wxPGCheckBoxEditor::~wxPGCheckBoxEditor() { } #endif // wxPG_INCLUDE_CHECKBOX // ----------------------------------------------------------------------- // wxPGBrush // ----------------------------------------------------------------------- // // This class is a wxBrush derivative used in the background colour // brush cache. It adds wxPG-type colour-in-long to the class. // JMS: Yes I know wxBrush doesn't actually hold the value (refcounted // object does), but this is simpler implementation and equally // effective. // class wxPGBrush : public wxBrush { public: wxPGBrush( const wxColour& colour ); wxPGBrush(); virtual ~wxPGBrush() { } void SetColour2( const wxColour& colour ); inline long GetColourAsLong() const { return m_colAsLong; } private: long m_colAsLong; }; void wxPGBrush::SetColour2( const wxColour& colour ) { wxBrush::SetColour(colour); m_colAsLong = wxPG_COLOUR(colour.Red(),colour.Green(),colour.Blue()); } wxPGBrush::wxPGBrush() : wxBrush() { m_colAsLong = 0; } wxPGBrush::wxPGBrush( const wxColour& colour ) : wxBrush(colour) { m_colAsLong = wxPG_COLOUR(colour.Red(),colour.Green(),colour.Blue()); } // ----------------------------------------------------------------------- // wxPGColour // ----------------------------------------------------------------------- // // Same as wxPGBrush, but for wxColour instead. // class wxPGColour : public wxColour { public: wxPGColour( const wxColour& colour ); wxPGColour(); virtual ~wxPGColour() { } void SetColour2( const wxColour& colour ); inline long GetColourAsLong() const { return m_colAsLong; } private: long m_colAsLong; }; void wxPGColour::SetColour2( const wxColour& colour ) { *this = colour; m_colAsLong = wxPG_COLOUR(colour.Red(),colour.Green(),colour.Blue()); } wxPGColour::wxPGColour() : wxColour() { m_colAsLong = 0; } wxPGColour::wxPGColour( const wxColour& colour ) : wxColour(colour) { m_colAsLong = wxPG_COLOUR(colour.Red(),colour.Green(),colour.Blue()); } // ----------------------------------------------------------------------- // wxPGTLWHandler // Intercepts Close-events sent to wxPropertyGrid's top-level parent, // and tries to commit property value. // ----------------------------------------------------------------------- class wxPGTLWHandler : public wxEvtHandler { public: wxPGTLWHandler( wxPropertyGrid* pg ) : wxEvtHandler() { m_pg = pg; } protected: void OnClose( wxCloseEvent& event ) { // ClearSelection forces value validation/commit. if ( event.CanVeto() && !m_pg->ClearSelection() ) { event.Veto(); return; } event.Skip(); } private: wxPropertyGrid* m_pg; DECLARE_EVENT_TABLE() }; BEGIN_EVENT_TABLE(wxPGTLWHandler, wxEvtHandler) EVT_CLOSE(wxPGTLWHandler::OnClose) END_EVENT_TABLE() // ----------------------------------------------------------------------- // wxPropertyGrid // ----------------------------------------------------------------------- IMPLEMENT_CLASS(wxPropertyGrid, wxScrolledWindow) BEGIN_EVENT_TABLE(wxPropertyGrid, wxScrolledWindow) EVT_MOTION(wxPropertyGrid::OnMouseMove) EVT_IDLE(wxPropertyGrid::OnIdle) EVT_LEFT_DOWN(wxPropertyGrid::OnMouseClick) EVT_LEFT_UP(wxPropertyGrid::OnMouseUp) EVT_RIGHT_UP(wxPropertyGrid::OnMouseRightClick) EVT_LEFT_DCLICK(wxPropertyGrid::OnMouseDoubleClick) EVT_PAINT(wxPropertyGrid::OnPaint) EVT_SIZE(wxPropertyGrid::OnResize) EVT_KEY_DOWN(wxPropertyGrid::OnKey) EVT_KEY_UP(wxPropertyGrid::OnKeyUp) EVT_CHAR(wxPropertyGrid::OnKey) EVT_ENTER_WINDOW(wxPropertyGrid::OnMouseEntry) EVT_LEAVE_WINDOW(wxPropertyGrid::OnMouseEntry) EVT_MOUSE_CAPTURE_CHANGED(wxPropertyGrid::OnCaptureChange) EVT_SCROLLWIN(wxPropertyGrid::OnScrollEvent) EVT_NAVIGATION_KEY(wxPropertyGrid::OnNavigationKey) EVT_TEXT(wxPG_SUBID1,wxPropertyGrid::OnCustomEditorEvent) EVT_COMBOBOX(wxPG_SUBID1,wxPropertyGrid::OnCustomEditorEvent) EVT_BUTTON(wxPG_SUBID2,wxPropertyGrid::OnCustomEditorEvent) EVT_CHILD_FOCUS(wxPropertyGrid::OnChildFocusEvent) EVT_SET_FOCUS(wxPropertyGrid::OnFocusEvent) EVT_KILL_FOCUS(wxPropertyGrid::OnFocusEvent) EVT_TEXT_ENTER(wxPG_SUBID1,wxPropertyGrid::OnCustomEditorEvent) EVT_SYS_COLOUR_CHANGED(wxPropertyGrid::OnSysColourChanged) END_EVENT_TABLE() // ----------------------------------------------------------------------- wxPropertyGrid::wxPropertyGrid() : wxScrolledWindow() { Init1(); } // ----------------------------------------------------------------------- wxPropertyGrid::wxPropertyGrid( wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxChar* name ) : wxScrolledWindow() { Init1(); Create(parent,id,pos,size,style,name); } // ----------------------------------------------------------------------- bool wxPropertyGrid::Create( wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxChar* name ) { if ( !(style&wxBORDER_MASK) ) style |= wxSIMPLE_BORDER; style |= wxVSCROLL; #ifdef __WXMSW__ // This prevents crash under Win2K, but still // enables keyboard navigation if ( style & wxTAB_TRAVERSAL ) { style &= ~(wxTAB_TRAVERSAL); style |= wxWANTS_CHARS; } #else if ( style & wxTAB_TRAVERSAL ) style |= wxWANTS_CHARS; #endif wxScrolledWindow::Create(parent,id,pos,size,style,name); Init2(); return true; } // ----------------------------------------------------------------------- static void wxPGRegisterStandardPropertyClasses(); // // Initialize values to defaults // void wxPropertyGrid::Init1() { WX_PG_GLOBALS_LOCKER() #if !wxPG_USE_WXMODULE if ( !wxPGGlobalVars ) wxPGGlobalVars = new wxPGGlobalVarsClass(); #endif // Register type classes, if necessary. if ( wxPGGlobalVars->m_dictValueType.empty() ) RegisterDefaultValues(); // Register editor classes, if necessary. if ( wxPGGlobalVars->m_mapEditorClasses.empty() ) RegisterDefaultEditors(); // Register property classes, if necessary if ( wxPGGlobalVars->m_dictPropertyClassInfo.empty() ) wxPGRegisterStandardPropertyClasses(); m_iFlags = 0; m_pState = (wxPropertyGridState*) NULL; m_wndPrimary = m_wndSecondary = (wxWindow*) NULL; m_selected = (wxPGProperty*) NULL; m_propHover = (wxPGProperty*) NULL; m_eventObject = this; m_curFocused = (wxWindow*) NULL; m_tlwHandler = NULL; m_processingEvent = 0; m_dragStatus = 0; m_mouseSide = 16; m_editorFocused = 0; m_coloursCustomized = 0; m_frozen = 0; #if wxPG_DOUBLE_BUFFER m_doubleBuffer = (wxBitmap*) NULL; #endif m_windowsToDelete = NULL; #ifndef wxPG_ICON_WIDTH m_expandbmp = NULL; m_collbmp = NULL; m_iconWidth = 11; m_iconHeight = 11; #else m_iconWidth = wxPG_ICON_WIDTH; #endif m_prevVY = -1; m_calcVisHeight = 0; m_gutterWidth = wxPG_GUTTER_MIN; m_subgroup_extramargin = 10; m_lineHeight = 0; m_width = m_height = m_fWidth = 0; m_bottomy = 0; m_splitterx = wxPG_DEFAULT_SPLITTERX; m_fSplitterX = (float) wxPG_DEFAULT_SPLITTERX; #if !wxPG_HEAVY_GFX m_splitterpen.SetColour( *wxBLACK ); m_splitterpen.SetWidth( 4 ); m_splitterprevdrawnx = -1; #endif SetButtonShortcut(0); m_keyComboConsumed = 0; m_ignoredEvents = 0; } // ----------------------------------------------------------------------- // // Initialize after parent etc. set // void wxPropertyGrid::Init2() { wxASSERT( !(m_iFlags & wxPG_FL_INITIALIZED ) ); #ifdef __WXMAC__ // Smaller controls on Mac SetWindowVariant(wxWINDOW_VARIANT_SMALL); #endif // Now create state, if one didn't exist already // (wxPropertyGridManager might have created it for us). if ( !m_pState ) { m_pState = CreateState(); m_pState->m_pPropGrid = this; m_iFlags |= wxPG_FL_CREATEDSTATE; } if ( !(m_windowStyle & wxPG_SPLITTER_AUTO_CENTER) ) m_iFlags |= wxPG_FL_DONT_CENTER_SPLITTER; if ( m_windowStyle & wxPG_HIDE_CATEGORIES ) { m_pState->InitNonCatMode(); FROM_STATE(m_properties) = FROM_STATE(m_abcArray); } GetClientSize(&m_width,&m_height); #if !wxPG_HEAVY_GFX m_splitterpen.SetColour( *wxBLACK ); m_splitterpen.SetWidth( 4 ); #endif #ifndef wxPG_ICON_WIDTH // create two bitmap nodes for drawing m_expandbmp = new wxBitmap(expand_xpm); m_collbmp = new wxBitmap(collapse_xpm); // calculate average font height for bitmap centering m_iconWidth = m_expandbmp->GetWidth(); m_iconHeight = m_expandbmp->GetHeight(); #endif m_curcursor = wxCURSOR_ARROW; m_cursorSizeWE = new wxCursor( wxCURSOR_SIZEWE ); // adjust bitmap icon y position so they are centered m_vspacing = wxPG_DEFAULT_VSPACING; if ( !m_font.Ok() ) { wxFont useFont = wxScrolledWindow::GetFont(); wxScrolledWindow::SetOwnFont( useFont ); } else // This should be otherwise called by SetOwnFont CalculateFontAndBitmapStuff( wxPG_DEFAULT_VSPACING ); // Add base brush item m_arrBgBrushes.Add((void*)new wxPGBrush()); // Add base colour items m_arrFgCols.Add((void*)new wxPGColour()); m_arrFgCols.Add((void*)new wxPGColour()); RegainColours(); // This helps with flicker SetBackgroundStyle( wxBG_STYLE_CUSTOM ); // Hook the TLW wxPGTLWHandler* handler = new wxPGTLWHandler(this); m_tlp = ::wxGetTopLevelParent(this); m_tlwHandler = handler; m_tlp->PushEventHandler(handler); // set virtual size to this window size wxSize wndsize = GetSize(); SetVirtualSize(wndsize.GetWidth(), wndsize.GetWidth()); m_timeCreated = ::wxGetLocalTimeMillis(); m_iFlags |= wxPG_FL_INITIALIZED; // Need to call OnResize handler or size given in constructor/Create // will never work. wxSizeEvent sizeEvent(wndsize,0); OnResize(sizeEvent); } // ----------------------------------------------------------------------- wxPropertyGrid::~wxPropertyGrid() { size_t i; DoSelectProperty(NULL); // This should do prevent things from going too badly wrong m_iFlags &= ~(wxPG_FL_INITIALIZED); END_MOUSE_CAPTURE wxPGTLWHandler* handler = (wxPGTLWHandler*) m_tlwHandler; m_tlp->RemoveEventHandler(handler); delete handler; #ifdef __WXDEBUG__ if ( IsEditorsValueModified() ) ::wxMessageBox(wxT("Most recent change in property editor was lost!!!\n\n(if you don't want this to happen, close your frames and dialogs using Close(false).)"), wxT("wxPropertyGrid Debug Warning") ); #endif #if wxPG_DOUBLE_BUFFER if ( m_doubleBuffer ) delete m_doubleBuffer; #endif delete m_windowsToDelete; m_selected = (wxPGProperty*) NULL; if ( m_iFlags & wxPG_FL_CREATEDSTATE ) delete m_pState; delete m_cursorSizeWE; #ifndef wxPG_ICON_WIDTH delete m_expandbmp; delete m_collbmp; #endif // Delete cached text colours. for ( i=0; iSetDelay ( wxPG_TOOLTIP_DELAY );*/ } else if ( (old_style & wxPG_TOOLTIPS) && !(style & wxPG_TOOLTIPS) ) { // // Tooltips disabled // wxScrolledWindow::SetToolTip ( (wxToolTip*) NULL ); } #endif } wxScrolledWindow::SetWindowStyleFlag ( style ); if ( m_iFlags & wxPG_FL_INITIALIZED ) { if ( (old_style & wxPG_HIDE_MARGIN) != (style & wxPG_HIDE_MARGIN) ) { CalculateFontAndBitmapStuff( m_vspacing ); RedrawAllVisible(); } } } // ----------------------------------------------------------------------- void wxPropertyGrid::Freeze() { m_frozen++; wxScrolledWindow::Freeze(); } // ----------------------------------------------------------------------- void wxPropertyGrid::Thaw() { m_frozen--; wxScrolledWindow::Thaw(); #if wxPG_REFRESH_CONTROLS_AFTER_REPAINT Refresh(); #endif // Force property re-selection if ( m_selected ) DoSelectProperty(m_selected, wxPG_SEL_FORCE); } // ----------------------------------------------------------------------- void wxPropertyGrid::SetExtraStyle( long exStyle ) { if ( exStyle & wxPG_EX_NATIVE_DOUBLE_BUFFERING ) { #if defined(__WXMSW__) /* // Don't use WS_EX_COMPOSITED just now. HWND hWnd; if ( m_iFlags & wxPG_FL_IN_MANAGER ) hWnd = (HWND)GetParent()->GetHWND(); else hWnd = (HWND)GetHWND(); ::SetWindowLong( hWnd, GWL_EXSTYLE, ::GetWindowLong(hWnd, GWL_EXSTYLE) | WS_EX_COMPOSITED ); */ //#elif defined(__WXGTK20__) #endif // Only apply wxPG_EX_NATIVE_DOUBLE_BUFFERING if the window // truly was double-buffered. if ( !wxPGIsWindowBuffered(this) ) { exStyle &= ~(wxPG_EX_NATIVE_DOUBLE_BUFFERING); } else { #if wxPG_DOUBLE_BUFFER delete m_doubleBuffer; m_doubleBuffer = NULL; #endif } } wxScrolledWindow::SetExtraStyle( exStyle ); if ( exStyle & wxPG_EX_INIT_NOCAT ) m_pState->InitNonCatMode (); if ( exStyle & wxPG_EX_HELP_AS_TOOLTIPS ) m_windowStyle |= wxPG_TOOLTIPS; if ( exStyle & wxPG_EX_AUTO_UNSPECIFIED_VALUES ) { wxPGGlobalVars->m_numBoolChoices = 3; } else { wxPGGlobalVars->m_numBoolChoices = 2; } } // ----------------------------------------------------------------------- // returns the best acceptable minimal size wxSize wxPropertyGrid::DoGetBestSize() const { int hei = 15; if ( m_lineHeight > hei ) hei = m_lineHeight; wxSize sz = wxSize( 60, hei+40 ); CacheBestSize(sz); return sz; } // ----------------------------------------------------------------------- // wxPropertyGrid Font and Colour Methods // ----------------------------------------------------------------------- void wxPropertyGrid::CalculateFontAndBitmapStuff( int vspacing ) { int x = 0, y = 0; m_captionFont = GetFont(); GetTextExtent(wxT("jG"), &x, &y, 0, 0, &m_captionFont); m_subgroup_extramargin = x + (x/2); m_fontHeight = y; #if wxPG_USE_RENDERER_NATIVE m_iconWidth = wxPG_ICON_WIDTH; #elif wxPG_ICON_WIDTH // scale icon m_iconWidth = (m_fontHeight * wxPG_ICON_WIDTH) / 13; if ( m_iconWidth < 5 ) m_iconWidth = 5; else if ( !(m_iconWidth & 0x01) ) m_iconWidth++; // must be odd #endif m_gutterWidth = m_iconWidth / wxPG_GUTTER_DIV; if ( m_gutterWidth < wxPG_GUTTER_MIN ) m_gutterWidth = wxPG_GUTTER_MIN; int vdiv = 6; if ( vspacing <= 1 ) vdiv = 12; else if ( vspacing >= 3 ) vdiv = 3; m_spacingy = m_fontHeight / vdiv; if ( m_spacingy < wxPG_YSPACING_MIN ) m_spacingy = wxPG_YSPACING_MIN; m_marginWidth = 0; if ( !(m_windowStyle & wxPG_HIDE_MARGIN) ) m_marginWidth = m_gutterWidth*2 + m_iconWidth; m_captionFont.SetWeight(wxBOLD); GetTextExtent(wxT("jG"), &x, &y, 0, 0, &m_captionFont); m_lineHeight = m_fontHeight+(2*m_spacingy)+1; // button spacing m_buttonSpacingY = (m_lineHeight - m_iconHeight) / 2; if ( m_buttonSpacingY < 0 ) m_buttonSpacingY = 0; InvalidateBestSize(); } // ----------------------------------------------------------------------- void wxPropertyGrid::OnSysColourChanged( wxSysColourChangedEvent &WXUNUSED(event) ) { RegainColours(); Refresh(); } // ----------------------------------------------------------------------- static wxColour wxPGAdjustColour(const wxColour& src, int ra, int ga = 1000, int ba = 1000, bool forceDifferent = false) { if ( ga >= 1000 ) ga = ra; if ( ba >= 1000 ) ba = ra; // Recursion guard (allow 2 max) static int isinside = 0; isinside++; wxCHECK_MSG( isinside < 3, *wxBLACK, wxT("wxPGAdjustColour should not be recursively called more than once") ); wxColour dst; int r = src.Red(); int g = src.Green(); int b = src.Blue(); int r2 = r + ra; if ( r2>255 ) r2 = 255; else if ( r2<0) r2 = 0; int g2 = g + ga; if ( g2>255 ) g2 = 255; else if ( g2<0) g2 = 0; int b2 = b + ba; if ( b2>255 ) b2 = 255; else if ( b2<0) b2 = 0; // Make sure they are somewhat different if ( forceDifferent && (abs((r+g+b)-(r2+g2+b2)) < abs(ra/2)) ) dst = wxPGAdjustColour(src,-(ra*2)); else dst = wxColour(r2,g2,b2); // Recursion guard (allow 2 max) isinside--; return dst; } static int wxPGGetColAvg( const wxColour& col ) { return (col.Red() + col.Green() + col.Blue()) / 3; } void wxPropertyGrid::RegainColours() { wxColour def_bgcol = wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ); if ( !(m_coloursCustomized & 0x0002) ) { wxColour col = wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ); // Make sure colour is dark enough #ifdef __WXGTK__ int colDec = wxPGGetColAvg(col) - 230; #else int colDec = wxPGGetColAvg(col) - 200; #endif if ( colDec > 0 ) m_colCapBack = wxPGAdjustColour(col,-colDec); else m_colCapBack = col; } if ( !(m_coloursCustomized & 0x0001) ) m_colMargin = m_colCapBack; if ( !(m_coloursCustomized & 0x0004) ) { #ifdef __WXGTK__ int colDec = -90; #else int colDec = -72; #endif wxColour capForeCol = wxPGAdjustColour(m_colCapBack,colDec,5000,5000,true); m_colCapFore = capForeCol; // Set the cached colour as well. ((wxPGColour*)m_arrFgCols.Item(1))->SetColour2(capForeCol); } if ( !(m_coloursCustomized & 0x0008) ) { wxColour bgCol = wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ); m_colPropBack = bgCol; // Set the cached brush as well. ((wxPGBrush*)m_arrBgBrushes.Item(0))->SetColour2(bgCol); } if ( !(m_coloursCustomized & 0x0010) ) { wxColour fgCol = wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOWTEXT ); m_colPropFore = fgCol; // Set the cached colour as well. ((wxPGColour*)m_arrFgCols.Item(0))->SetColour2(fgCol); } if ( !(m_coloursCustomized & 0x0020) ) m_colSelBack = wxSystemSettings::GetColour( wxSYS_COLOUR_HIGHLIGHT ); if ( !(m_coloursCustomized & 0x0040) ) m_colSelFore = wxSystemSettings::GetColour( wxSYS_COLOUR_HIGHLIGHTTEXT ); if ( !(m_coloursCustomized & 0x0080) ) m_colLine = m_colCapBack; if ( !(m_coloursCustomized & 0x0100) ) m_colDisPropFore = m_colCapFore; } // ----------------------------------------------------------------------- void wxPropertyGrid::ResetColours() { m_coloursCustomized = 0; RegainColours(); Refresh(); } // ----------------------------------------------------------------------- bool wxPropertyGrid::SetFont( const wxFont& font ) { #if __INTENSE_DEBUGGING__ wxLogDebug( wxT("wxPropertyGrid::SetFont") ); #endif // Must disable active editor. if ( m_selected ) { bool selRes = ClearSelection(); wxPG_CHECK_MSG_DBG( selRes, false, wxT("failed to deselect a property (editor probably had invalid value)") ); } // TODO: Following code is disabled with wxMac because // it is reported to fail. I (JMS) cannot debug it // personally right now. #if !defined(__WXMAC__) bool res = wxScrolledWindow::SetFont( font ); if ( res ) { CalculateFontAndBitmapStuff( m_vspacing ); if ( m_pState ) { // Recalculate caption text extents. // TODO: This should also be done to other pages of manager // (so add wxPropertyGridManager::SetFont), but since font // is usually set before categories are added, this is // quite low priority. size_t i; for ( i=0;iGetParentingType() > 0 ) ((wxPropertyCategoryClass*)p)->CalculateTextExtent(this,m_captionFont); } CalculateYs(NULL,-1); } Refresh(); } return res; #else // ** wxMAC Only ** // TODO: Remove after SetFont crash fixed. if ( m_iFlags & wxPG_FL_INITIALIZED ) { wxLogDebug(wxT("WARNING: propGrid.cpp: wxPropertyGrid::SetFont has been disabled on wxMac since there has been crash reported in it. If you are willing to debug the cause, replace line '#if !defined(__WXMAC__)' with line '#if 1' in wxPropertyGrid::SetFont.")); } return false; #endif } // ----------------------------------------------------------------------- void wxPropertyGrid::SetLineColour( const wxColour& col ) { m_colLine = col; m_coloursCustomized |= 0x80; Refresh(); } // ----------------------------------------------------------------------- void wxPropertyGrid::SetMarginColour( const wxColour& col ) { m_colMargin = col; m_coloursCustomized |= 0x01; Refresh(); } // ----------------------------------------------------------------------- void wxPropertyGrid::SetCellBackgroundColour( const wxColour& col ) { m_colPropBack = col; m_coloursCustomized |= 0x08; // Set the cached brush as well. ((wxPGBrush*)m_arrBgBrushes.Item(0))->SetColour2(col); Refresh(); } // ----------------------------------------------------------------------- void wxPropertyGrid::SetCellTextColour( const wxColour& col ) { m_colPropFore = col; m_coloursCustomized |= 0x10; // Set the cached colour as well. ((wxPGColour*)m_arrFgCols.Item(0))->SetColour2(col); Refresh(); } // ----------------------------------------------------------------------- void wxPropertyGrid::SetCellDisabledTextColour( const wxColour& col ) { m_colDisPropFore = col; m_coloursCustomized |= 0x100; Refresh(); } // ----------------------------------------------------------------------- void wxPropertyGrid::SetSelectionBackground( const wxColour& col ) { m_colSelBack = col; m_coloursCustomized |= 0x20; Refresh(); } // ----------------------------------------------------------------------- void wxPropertyGrid::SetSelectionForeground( const wxColour& col ) { m_colSelFore = col; m_coloursCustomized |= 0x40; Refresh(); } // ----------------------------------------------------------------------- void wxPropertyGrid::SetCaptionBackgroundColour( const wxColour& col ) { m_colCapBack = col; m_coloursCustomized |= 0x02; Refresh(); } // ----------------------------------------------------------------------- void wxPropertyGrid::SetCaptionForegroundColour( const wxColour& col ) { m_colCapFore = col; m_coloursCustomized |= 0x04; // Set the cached colour as well. ((wxPGColour*)m_arrFgCols.Item(1))->SetColour2(col); Refresh(); } // ----------------------------------------------------------------------- void wxPropertyGrid::SetBackgroundColourIndex( wxPGProperty* p, int index, int flags ) { unsigned char ind = index; if ( (p->m_bgColIndex == 0) || (flags & (wxPG_RECURSE_STARTS|wxPG_FORCE)) ) p->m_bgColIndex = ind; if ( p->GetParentingType() != 0 && (flags & wxPG_RECURSE) ) { wxPGPropertyWithChildren* pwc = (wxPGPropertyWithChildren*)p; unsigned int i; for ( i=0; iGetCount(); i++ ) SetBackgroundColourIndex(pwc->Item(i), index, flags & ~(wxPG_RECURSE_STARTS)); } } // ----------------------------------------------------------------------- void wxPropertyGrid::SetPropertyBackgroundColour( wxPGId id, const wxColour& colour ) { wxPG_PROP_ID_CALL_PROLOG() size_t i; int colInd = -1; long colAsLong = wxPG_COLOUR(colour.Red(),colour.Green(),colour.Blue()); // As it is most likely that the previous colour is used, start comparison // from the end. for ( i=(m_arrBgBrushes.GetCount()-1); i>0; i-- ) { if ( ((wxPGBrush*)m_arrBgBrushes.Item(i))->GetColourAsLong() == colAsLong ) { colInd = i; break; } } if ( colInd < 0 ) { colInd = m_arrBgBrushes.GetCount(); wxCHECK_RET( colInd < 256, wxT("wxPropertyGrid: Warning - Only 255 different property background colours allowed.") ); m_arrBgBrushes.Add( (void*)new wxPGBrush(colour) ); } // Set indexes SetBackgroundColourIndex(p, colInd, wxPG_RECURSE|wxPG_RECURSE_STARTS); // If this was on a visible grid, then draw it. DrawItemAndChildren(p); } // ----------------------------------------------------------------------- wxColour wxPropertyGrid::GetPropertyBackgroundColour( wxPGId id ) const { wxPG_PROP_ID_CALL_PROLOG_RETVAL(wxColour()) return ((wxPGBrush*)m_arrBgBrushes.Item(p->m_bgColIndex))->GetColour(); } // ----------------------------------------------------------------------- void wxPropertyGrid::SetTextColourIndex( wxPGProperty* p, int index, int flags ) { unsigned char ind = index; if ( (p->m_fgColIndex == 0) || (flags & (wxPG_RECURSE_STARTS|wxPG_FORCE)) ) p->m_fgColIndex = ind; if ( p->GetParentingType() != 0 && (flags & wxPG_RECURSE) ) { wxPGPropertyWithChildren* pwc = (wxPGPropertyWithChildren*)p; unsigned int i; for ( i=0; iGetCount(); i++ ) SetTextColourIndex( pwc->Item(i), index, flags&~(wxPG_RECURSE_STARTS) ); } } // ----------------------------------------------------------------------- int wxPropertyGrid::CacheColour( const wxColour& colour ) { unsigned int i; int colInd = -1; long colAsLong = wxPG_COLOUR(colour.Red(),colour.Green(),colour.Blue()); // As it is most likely that the previous colour is used, start comparison // from the end. for ( i=(m_arrFgCols.GetCount()-1); i>0; i-- ) { if ( ((wxPGColour*)m_arrFgCols.Item(i))->GetColourAsLong() == colAsLong ) { colInd = i; break; } } if ( colInd < 0 ) { colInd = m_arrFgCols.GetCount(); wxCHECK_MSG( colInd < 256, 0, wxT("wxPropertyGrid: Warning - Only 255 different property foreground colours allowed.") ); m_arrFgCols.Add( (void*)new wxPGColour(colour) ); } return colInd; } // ----------------------------------------------------------------------- void wxPropertyGrid::SetPropertyTextColour( wxPGId id, const wxColour& colour ) { wxPG_PROP_ID_CALL_PROLOG() // Set indexes SetTextColourIndex(p, CacheColour(colour), wxPG_RECURSE|wxPG_RECURSE_STARTS ); // If this was on a visible grid, then draw it. DrawItemAndChildren(p); } // ----------------------------------------------------------------------- void wxPropertyGrid::SetCaptionTextColour( wxPGId id, const wxColour& colour ) { wxPG_PROP_ID_CALL_PROLOG() wxCHECK_RET( p->GetParentingType() == PT_CAPTION, wxT("Only call SetCaptionTextColour for caption properties") ); // Set indexes wxPropertyCategoryClass* cat = (wxPropertyCategoryClass*) p; cat->SetTextColIndex(CacheColour(colour)); // If this was on a visible grid, then draw it. DrawItemAndChildren(p); } // ----------------------------------------------------------------------- wxColour wxPropertyGrid::GetPropertyTextColour( wxPGId id ) const { wxPG_PROP_ID_CALL_PROLOG_RETVAL(wxColour()) return wxColour(*((wxPGColour*)m_arrFgCols.Item(p->m_fgColIndex))); } // ----------------------------------------------------------------------- void wxPropertyGrid::SetPropertyColourToDefault( wxPGId id ) { wxPG_PROP_ID_CALL_PROLOG() SetBackgroundColourIndex( p, 0, wxPG_RECURSE|wxPG_FORCE ); SetTextColourIndex( p, 0, wxPG_RECURSE|wxPG_FORCE ); if ( p->GetParentingType() == PT_CAPTION ) { wxPropertyCategoryClass* cat = (wxPropertyCategoryClass*) p; cat->SetTextColIndex(1); } } // ----------------------------------------------------------------------- // wxPropertyGrid property adding and removal // ----------------------------------------------------------------------- wxPGId wxPropertyGrid::Append( wxPGProperty* property ) { return FROM_STATE(Append(property)); } // ----------------------------------------------------------------------- wxPGId wxPropertyGrid::_Insert( wxPGProperty* priorthis, wxPGProperty* property ) { wxASSERT( priorthis ); return FROM_STATE(DoInsert(priorthis->GetParent(), priorthis->GetArrIndex(), property)); } // ----------------------------------------------------------------------- void wxPropertyContainerMethods::Delete( wxPGId id ) { wxPG_PROP_ID_CALL_PROLOG() wxPropertyGridState* state = p->GetParentState(); wxPropertyGrid* grid = state->GetGrid(); if ( grid->GetState() == state ) { bool selRes = grid->DoSelectProperty(wxPGIdGen(NULL), wxPG_SEL_DELETING); wxPG_CHECK_RET_DBG( selRes, wxT("failed to deselect a property (editor probably had invalid value)") ); } state->DoDelete( p ); if ( grid->GetState() == state && !grid->IsFrozen() ) { // This should be enough to resolve even the worst // graphics glitch imaginable. grid->Update(); grid->Refresh(); } } // ----------------------------------------------------------------------- wxPGId wxPropertyContainerMethods::ReplaceProperty( wxPGId id, wxPGProperty* property ) { wxPG_PROP_ID_CALL_PROLOG_RETVAL(wxNullProperty) wxPGProperty* replaced = wxPGIdToPtr(id); wxCHECK_MSG( replaced && property, wxNullProperty, wxT("NULL property") ); wxCHECK_MSG( replaced->GetParentingType() == 0 || replaced->GetParentingType() == -1, wxNullProperty, wxT("cannot replace this type of property") ); wxCHECK_MSG( !m_pState->IsInNonCatMode(), wxNullProperty, wxT("cannot replace properties in alphabetic mode") ); // Get address to the slot wxPGPropertyWithChildren* parent = replaced->GetParent(); int ind = replaced->GetIndexInParent(); wxPropertyGridState* state = replaced->GetParentState(); Delete(replaced); // Must use generic Delete state->DoInsert(parent,ind,property); return wxPGIdGen(property); } // ----------------------------------------------------------------------- void wxPropertyGrid::PrepareAfterItemsAdded() { if ( !FROM_STATE(m_itemsAdded) ) return; #if __INTENSE_DEBUGGING__ wxLogDebug(wxT("PrepareAfterItemsAdded( in thread 0x%lX )"), (unsigned long)wxThread::GetCurrentId()); #endif FROM_STATE(m_itemsAdded) = 0; if ( m_windowStyle & wxPG_AUTO_SORT ) { Sort (); } else { if ( m_bottomy < 1 ) CalculateYs( NULL, -1 ); else { RecalculateVirtualSize(); // Update visibles array (maybe not necessary here, but just in case) CalculateVisibles ( -1, true ); } } } // ----------------------------------------------------------------------- // wxPropertyGrid property value setting and getting // ----------------------------------------------------------------------- void wxPGGetFailed( const wxPGProperty* p, const wxChar* typestr ) { wxPGTypeOperationFailed(p,typestr,wxT("Get")); } // ----------------------------------------------------------------------- void wxPGTypeOperationFailed( const wxPGProperty* p, const wxChar* typestr, const wxChar* op ) { wxASSERT( p != NULL ); wxLogError( _("Type operation \"%s\" failed: Property labeled \"%s\" is of type \"%s\", NOT \"%s\"."), op,p->GetLabel().c_str(),wxPG_TO_WXCHAR_PTR(p->GetValueTypePtr()->GetCustomTypeName()),typestr ); } // ----------------------------------------------------------------------- void wxPropertyGrid::SetPropertyValue( wxPGId id, const wxPGValueType* typeclass, const wxPGVariant& value ) { wxPG_PROP_ID_CALL_PROLOG() if ( p && m_pState->SetPropertyValue(p,typeclass,value) ) DrawItemAndValueRelated( p ); } // ----------------------------------------------------------------------- void wxPropertyGrid::SetPropertyValue( wxPGId id, const wxChar* typestring, const wxPGVariant& value ) { wxPG_PROP_ID_CALL_PROLOG() if ( p && m_pState->SetPropertyValue(p,typestring,value) ) DrawItemAndValueRelated( p ); } // ----------------------------------------------------------------------- void wxPropertyGrid::SetPropertyValueString( wxPGId id, const wxString& value ) { wxPG_PROP_ID_CALL_PROLOG() if ( m_pState->SetPropertyValueString(p,value) ) DrawItemAndValueRelated( p ); } // ----------------------------------------------------------------------- void wxPropertyGrid::SetPropertyValueWxObjectPtr( wxPGId id, wxObject* value ) { wxPG_PROP_ID_CALL_PROLOG() if ( m_pState->SetPropertyValueWxObjectPtr(p,value) ) DrawItemAndValueRelated( p ); } // ----------------------------------------------------------------------- #ifndef __WXPYTHON__ void wxPropertyGrid::SetPropertyValue( wxPGId id, wxVariant& value ) { wxPG_PROP_ID_CALL_PROLOG() if ( m_pState->SetPropertyValue(p,value) ) DrawItemAndValueRelated( p ); } #endif // ----------------------------------------------------------------------- bool wxPropertyGrid::ClearPropertyValue( wxPGId id ) { wxPG_PROP_ID_CALL_PROLOG_RETVAL(false) if ( m_pState->ClearPropertyValue(p) ) { DrawItemAndChildren( p ); return true; } return false; } // ----------------------------------------------------------------------- void wxPropertyGrid::SetPropertyUnspecified( wxPGId id ) { wxPG_PROP_ID_CALL_PROLOG() m_pState->SetPropertyUnspecified(p); DrawItemAndChildren(p); wxPGPropertyWithChildren* parent = p->GetParent(); while ( parent->GetParentingType() <= PT_FIXEDCHILDREN ) { DrawItem(parent); parent = parent->GetParent(); } } // ----------------------------------------------------------------------- // wxPropertyGrid miscellaneous GetPropertyXXX methods // ----------------------------------------------------------------------- wxPropertyCategoryClass* wxPropertyGrid::_GetPropertyCategory( wxPGProperty* p ) { wxPGProperty* parent = (wxPGPropertyWithChildren*)p; wxPGProperty* grandparent = (wxPGProperty*)parent->GetParent(); do { parent = grandparent; grandparent = (wxPGProperty*)parent->GetParent(); if ( parent->GetParentingType() >= PT_CAPTION && grandparent ) return (wxPropertyCategoryClass*)parent; } while ( grandparent ); return (wxPropertyCategoryClass*) NULL; } // ----------------------------------------------------------------------- // wxPropertyGrid property operations // ----------------------------------------------------------------------- bool wxPropertyGrid::EnableProperty( wxPGId id, bool enable ) { wxPG_PROP_ID_CALL_PROLOG_RETVAL(false) if ( enable ) { if ( !(p->m_flags & wxPG_PROP_DISABLED) ) return false; // If active, Set active Editor. if ( p == m_selected ) DoSelectProperty( p, wxPG_SEL_FORCE ); } else { if ( p->m_flags & wxPG_PROP_DISABLED ) return false; // If active, Disable as active Editor. if ( p == m_selected ) DoSelectProperty( p, wxPG_SEL_FORCE ); } m_pState->EnableProperty(p,enable); DrawItemAndChildren( p ); return true; } // ----------------------------------------------------------------------- void wxPropertyGrid::LimitPropertyEditing( wxPGId id, bool limit ) { wxPG_PROP_ID_CALL_PROLOG() m_pState->LimitPropertyEditing(p,limit); if ( p == m_selected ) DoSelectProperty( p, wxPG_SEL_FORCE ); } // ----------------------------------------------------------------------- void wxPropertyGrid::_SetPropertyLabel( wxPGProperty* p, const wxString& newproplabel ) { wxCHECK_RET( p, wxT("invalid property id") ); p->m_label = newproplabel; if ( m_windowStyle & wxPG_AUTO_SORT ) { Sort(p->GetParent()); Refresh(); } else DrawItem ( p ); } // ----------------------------------------------------------------------- void wxPropertyGrid::DoSetPropertyName( wxPGProperty* p, const wxString& newname ) { wxCHECK_RET( p, wxT("invalid property id") ); #if __INTENSE_DEBUGGING__ wxLogDebug( wxT("wxPropertyGrid::SetPropertyName( %s -> %s )"), p->GetName().c_str(), newname.c_str() ); #endif if ( p->GetName().Len() ) FROM_STATE(m_dictName).erase ( wxPGNameConv(p->GetName()) ); if ( newname.Len() ) FROM_STATE(m_dictName)[newname] = (void*) p; p->DoSetName(newname); } // ----------------------------------------------------------------------- bool wxPropertyGrid::EnsureVisible( wxPGId id ) { wxPG_PROP_ID_CALL_PROLOG_RETVAL(false) Update(); bool changed = false; // Is it inside collapsed section? if ( p->m_y < 0 ) { // expand parents wxPGProperty* parent = p->GetParent(); wxPGProperty* grandparent = parent->GetParent(); if ( grandparent && grandparent != FROM_STATE(m_properties) ) Expand ( grandparent ); Expand ( parent ); changed = true; } // Need to scroll? int vx, vy; GetViewStart(&vx,&vy); vy*=wxPG_PIXELS_PER_UNIT; if ( p->m_y < vy ) { Scroll (vx, p->m_y/wxPG_PIXELS_PER_UNIT ); m_iFlags |= wxPG_FL_SCROLLED; changed = true; } else if ( (p->m_y+m_lineHeight) > (vy+m_height) ) { Scroll (vx, (p->m_y-m_height+(m_lineHeight*2))/wxPG_PIXELS_PER_UNIT ); m_iFlags |= wxPG_FL_SCROLLED; changed = true; } if ( changed ) DrawItems ( p, p ); return changed; } // ----------------------------------------------------------------------- // wxPropertyGrid helper methods called by properties // ----------------------------------------------------------------------- // Fixes position of wxTextCtrl-like control (wxSpinCtrl usually // fits into that category as well). void wxPropertyGrid::FixPosForTextCtrl( wxWindow* ctrl ) { // Center the control vertically wxRect finalPos = ctrl->GetRect(); int y_adj = (m_lineHeight - finalPos.height)/2 + wxPG_TEXTCTRLYADJUST; // Prevent over-sized control int sz_dec = (y_adj + finalPos.height) - m_lineHeight; if ( sz_dec < 0 ) sz_dec = 0; finalPos.y += y_adj; finalPos.height -= (y_adj+sz_dec); // STUPID HACK: wxTextCtrl has different indentation with different // fonts, so this is to solve most common case (ie. using MS Shell Dlg 2 // or Tahoma - which are usually the same). /*#ifdef __WXMSW__ wxString faceName = m_font.GetFaceName(); int textCtrlXAdjust = wxPG_TEXTCTRLXADJUST; if ( (faceName == wxT("MS Shell Dlg 2") || faceName == wxT("Tahoma")) && m_font.GetWeight() != wxFONTWEIGHT_BOLD ) textCtrlXAdjust = 0; #else*/ const int textCtrlXAdjust = wxPG_TEXTCTRLXADJUST; //#endif finalPos.x += textCtrlXAdjust; finalPos.width -= textCtrlXAdjust; ctrl->SetSize(finalPos); } // ----------------------------------------------------------------------- // Control font changer helper. void wxPropertyGrid::SetCurControlBoldFont() { wxASSERT( m_wndPrimary ); m_wndPrimary->SetFont( m_captionFont ); } // ----------------------------------------------------------------------- wxWindow* wxPropertyGrid::GenerateEditorTextCtrl( const wxPoint& pos, const wxSize& sz, const wxString& value, wxWindow* secondary, int extraStyle, int maxLen ) { int tcFlags = wxTE_PROCESS_ENTER | extraStyle; if ( m_selected->HasFlag(wxPG_PROP_READONLY) ) tcFlags |= wxTE_READONLY; wxPoint p(pos.x,pos.y); wxSize s(sz.x,sz.y); // Need to reduce width of text control on Mac #if defined(__WXMAC__) s.x -= 8; #endif // Take button into acccount if ( secondary ) { s.x -= (secondary->GetSize().x + wxPG_TEXTCTRL_AND_BUTTON_SPACING); m_iFlags &= ~(wxPG_FL_PRIMARY_FILLS_ENTIRE); } // If the height is significantly higher, then use border, and fill the rect exactly. bool hasSpecialSize = false; if ( (sz.y - m_lineHeight) > 5 ) hasSpecialSize = true; #if wxPG_NAT_TEXTCTRL_BORDER_ANY // Create clipper window wxPGClipperWindow* wnd = new wxPGClipperWindow(); #if defined(__WXMSW__) wnd->Hide(); #endif wnd->Create(this,wxPG_SUBID1,p,s); // This generates rect of the control inside the clipper window if ( !hasSpecialSize ) wnd->GetControlRect(wxPG_NAT_TEXTCTRL_BORDER_X, wxPG_NAT_TEXTCTRL_BORDER_Y, p, s); else wnd->GetControlRect(0, 0, p, s); wxWindow* ctrlParent = wnd; #else wxWindow* ctrlParent = this; if ( !hasSpecialSize ) tcFlags |= wxNO_BORDER; #endif wxTextCtrl* tc = new wxTextCtrl(); #if defined(__WXMSW__) && !wxPG_NAT_TEXTCTRL_BORDER_ANY tc->Hide(); #endif tc->Create(ctrlParent,wxPG_SUBID1,value, p, s,tcFlags); #if wxPG_NAT_TEXTCTRL_BORDER_ANY wxWindow* ed = wnd; wnd->SetControl(tc); #else wxWindow* ed = tc; #endif // Center the control vertically if ( !hasSpecialSize ) FixPosForTextCtrl(ed); #ifdef __WXMSW__ ed->Show(); if ( secondary ) secondary->Show(); #endif // Set maximum length if ( maxLen > 0 ) tc->SetMaxLength( maxLen ); return (wxWindow*) ed; } // ----------------------------------------------------------------------- wxWindow* wxPropertyGrid::GenerateEditorButton( const wxPoint& pos, const wxSize& sz ) { #ifdef __WXMAC__ // Decorations are chunky on Mac, and we can't make the button square, so // do things a bit differently on this platform. wxPoint p(pos.x+sz.x, pos.y+wxPG_BUTTON_SIZEDEC-wxPG_NAT_BUTTON_BORDER_Y); wxSize s(25, -1); wxButton* but = new wxButton(); but->Create(this,wxPG_SUBID2,wxT("..."),p,s,wxWANTS_CHARS); // Now that we know the size, move to the correct position p.x = pos.x + sz.x - but->GetSize().x - 2; but->Move(p); #else wxSize s(sz.y-(wxPG_BUTTON_SIZEDEC*2)+(wxPG_NAT_BUTTON_BORDER_Y*2), sz.y-(wxPG_BUTTON_SIZEDEC*2)+(wxPG_NAT_BUTTON_BORDER_Y*2)); // Reduce button width to lineheight if ( s.x > m_lineHeight ) s.x = m_lineHeight; wxPoint p(pos.x+sz.x-s.x, pos.y+wxPG_BUTTON_SIZEDEC-wxPG_NAT_BUTTON_BORDER_Y); wxButton* but = new wxButton(); #ifdef __WXMSW__ but->Hide(); #endif but->Create(this,wxPG_SUBID2,wxT("..."),p,s,wxWANTS_CHARS); but->SetFont( m_captionFont ); #endif if ( m_selected->HasFlag(wxPG_PROP_READONLY) ) but->Disable(); return but; } // ----------------------------------------------------------------------- wxWindow* wxPropertyGrid::GenerateEditorTextCtrlAndButton( const wxPoint& pos, const wxSize& sz, wxWindow** psecondary, int limitedEditing, wxPGProperty* property ) { wxButton* but = (wxButton*)GenerateEditorButton(pos,sz); *psecondary = (wxWindow*)but; if ( limitedEditing ) { #ifdef __WXMSW__ // There is button Show in GenerateEditorTextCtrl as well but->Show(); #endif return (wxWindow*) NULL; } wxString text; if ( !(property->GetFlags() & wxPG_PROP_UNSPECIFIED) ) text = property->GetValueAsString(property->HasFlag(wxPG_PROP_READONLY)?0:wxPG_EDITABLE_VALUE); return GenerateEditorTextCtrl(pos,sz,text,but,property->m_maxLen); } // ----------------------------------------------------------------------- wxPoint wxPropertyGrid::GetGoodEditorDialogPosition( wxPGProperty* p, const wxSize& sz ) { #if wxPG_SMALL_SCREEN // On small-screen devices, always show dialogs with default position and size. return wxDefaultPosition; #else int x = m_splitterx; int y = p->m_y; wxCHECK_MSG( y >= 0, wxPoint(-1,-1), wxT("invalid y?") ); wxCHECK_MSG( y < (int)m_bottomy, wxPoint(-1,-1), wxT("invalid y?") ); ImprovedClientToScreen( &x, &y ); int sw = wxSystemSettings::GetMetric( ::wxSYS_SCREEN_X ); int sh = wxSystemSettings::GetMetric( ::wxSYS_SCREEN_Y ); int new_x; int new_y; if ( x > (sw/2) ) // left new_x = x + (m_width-m_splitterx) - sz.x; else // right new_x = x; if ( y > (sh/2) ) // above new_y = y - sz.y; else // below new_y = y + m_lineHeight; return wxPoint(new_x,new_y); #endif } // ----------------------------------------------------------------------- void wxPropertyGrid::SLAlloc( unsigned int itemcount, const wxChar** items ) { wxArrayString& sl = m_sl; unsigned int i; unsigned int sl_oldcount = sl.GetCount(); if ( sl_oldcount > itemcount ) sl_oldcount = itemcount; #if wxUSE_INTL if ( !wxPGGlobalVars->m_autoGetTranslation ) { #endif for ( i=0; i= wxT(' ') #if !wxUSE_UNICODE || a < 0 #endif ) { // This surely is not something that requires an escape sequence. dst_str << a; } else { // This might need... if ( a == wxT('\r') ) { // DOS style line end. // Already taken care below //dst_str = wxT("\\n"); //src++; } else if ( a == wxT('\n') ) // UNIX style line end. dst_str << wxT("\\n"); else if ( a == wxT('\t') ) // Tab. dst_str << wxT('\t'); else { //wxLogDebug(wxT("WARNING: Could not create escape sequence for character #%i"),(int)a); dst_str << a; } } prev_a = a; } return dst_str; } // ----------------------------------------------------------------------- // Item iteration macros // ----------------------------------------------------------------------- #define II_INVALID_I 0x00FFFFFF #define ITEM_ITERATION_VARIABLES \ wxPGPropertyWithChildren* parent; \ unsigned int i; \ unsigned int iMax; #define ITEM_ITERATION_DCAE_VARIABLES \ wxPGPropertyWithChildren* parent; \ unsigned int i; \ unsigned int iMax; #define ITEM_ITERATION_INIT_FROM_THE_TOP \ parent = FROM_STATE(m_properties); \ i = 0; #define ITEM_ITERATION_INIT(startparent,startindex) \ parent = startparent; \ i = (unsigned int)startindex; \ if ( parent == (wxPGPropertyWithChildren*) NULL ) \ { \ parent = FROM_STATE(m_properties); \ i = 0; \ } #define ITEM_ITERATION_LOOP_BEGIN \ unsigned char parent_expanded; \ do \ { \ parent_expanded = (unsigned char)parent->m_expanded; \ if ( parent->m_parent && !parent->m_parent->m_expanded ) \ parent_expanded = 0; \ iMax = parent->GetCount(); \ while ( i < iMax ) \ { \ wxPGProperty* p = parent->Item(i); \ int parenting = p->GetParentingType(); #define ITEM_ITERATION_LOOP_END \ if ( parenting ) \ { \ i = 0; \ parent = (wxPGPropertyWithChildren*)p; \ if ( parent_expanded ) \ parent_expanded = (unsigned char)parent->m_expanded; \ else \ parent_expanded = 0; \ iMax = parent->GetCount(); \ } \ else \ i++; \ } \ i = parent->m_arrIndex + 1; \ parent = parent->m_parent; \ } \ while ( parent != NULL ); // DCAE = Don't care about parent_expanded (this is the least space hungry method). #define ITEM_ITERATION_DCAE_LOOP_BEGIN \ do \ { \ iMax = parent->GetCount(); \ while ( i < iMax ) \ { \ wxPGProperty* p = parent->Item(i); \ int parenting = p->GetParentingType(); #define ITEM_ITERATION_DCAE_LOOP_END \ if ( parenting ) \ { \ i = 0; \ parent = (wxPGPropertyWithChildren*)p; \ iMax = parent->GetCount(); \ } \ else \ i++; \ } \ i = parent->m_arrIndex + 1; \ parent = parent->m_parent; \ } \ while ( parent != NULL ); // DCAE_ISP = Don't care about parent_expanded, Ignore sub-properties. // Note that this treats fixed sub-properties same as sub-properties // of wxParentProperty. Mode conversion requires this behaviour. #define ITEM_ITERATION_DCAE_ISP_LOOP_BEGIN \ do \ { \ iMax = parent->GetCount(); \ while ( i < iMax ) \ { \ wxPGProperty* p = parent->Item(i); \ int parenting = p->GetParentingType(); #define ITEM_ITERATION_DCAE_ISP_LOOP_END \ if ( parenting > 0 ) \ { \ i = 0; \ parent = (wxPGPropertyWithChildren*)p; \ iMax = parent->GetCount(); \ } \ else \ i++; \ } \ i = parent->m_arrIndex + 1; \ parent = parent->m_parent; \ } \ while ( parent != (wxPGPropertyWithChildren*) NULL ); // VO = Visible only (including those outside the scrolled section). #define ITEM_ITERATION_VO_LOOP_BEGIN \ if ( (parent == FROM_STATE(m_properties) || parent->m_y >= 0) && parent->m_expanded ) \ { \ do \ { \ iMax = parent->GetCount(); \ while ( i < iMax ) \ { \ wxPGProperty* p = parent->Item(i); \ if ( p->m_y >= 0 ) \ { \ int parenting = p->GetParentingType(); #define ITEM_ITERATION_VO_LOOP_END \ if ( parenting && ((wxPGPropertyWithChildren*)p)->m_expanded ) \ { \ parent = (wxPGPropertyWithChildren*)p; \ i = 0; \ break; \ } \ } \ i++; \ } \ if ( i >= iMax ) \ { \ i = parent->m_arrIndex + 1; \ parent = parent->m_parent; \ } \ } \ while ( parent != (wxPGPropertyWithChildren*) NULL ); \ } // ----------------------------------------------------------------------- // wxPropertyGrid visibility related methods // ----------------------------------------------------------------------- void wxPropertyGrid::CalculateYs( wxPGPropertyWithChildren* startparent, int startindex ) { // Selection must be temporarily cleared during y-recalc wxPGProperty* prevSelected = m_selected; if ( prevSelected ) { bool selRes = ClearSelection(); wxPG_CHECK_RET_DBG( selRes, wxT("failed to deselect a property (editor probably had invalid value)") ); } ITEM_ITERATION_VARIABLES #if __INTENSE_DEBUGGING__ wxLogDebug(wxT("CalculateYs(startsfrom: %s[%i] ) "), startparent?startparent->m_label.c_str():wxT("NULL"), startindex); #endif ITEM_ITERATION_INIT(startparent,startindex) wxASSERT( !m_frozen ); int cury = 0; int lh = m_lineHeight; if ( startparent != NULL ) cury = parent->Item(i)->m_y; wxASSERT_MSG( cury >= 0, wxT("CalculateYs first item was not visible!!!") ); long hide_state = m_iFlags & wxPG_FL_HIDE_STATE; bool inside_hidden_part = false; //parent_expanded = (unsigned char)parent->m_expanded; wxPGPropertyWithChildren* nearest_expanded = (wxPGPropertyWithChildren*) NULL; // Find first visible and expanded parent. while ( !parent->IsExpanded() || ( (parent->m_flags & wxPG_PROP_HIDEABLE) && hide_state ) ) { parent = parent->GetParent(); i = 0; } wxASSERT( parent ); //parent = nearest_expanded; do { iMax = parent->GetCount(); if ( !inside_hidden_part ) { while ( i < iMax ) { wxPGProperty* p = parent->Item(i); int parenting = p->GetParentingType(); if ( !(p->m_flags & wxPG_PROP_HIDEABLE) || (!hide_state) ) { // item is visible (all parents are expanded, non-hideable or not in hide state) p->m_y = (int)cury; cury += lh; } else { p->m_y = -1; } if ( parenting ) { wxPGPropertyWithChildren* p2 = (wxPGPropertyWithChildren*)p; if ( !p2->m_expanded || ( (p2->m_flags & wxPG_PROP_HIDEABLE) && hide_state ) ) { inside_hidden_part = true; nearest_expanded = parent; } parent = p2; i = 0; break; } i++; } } else { while ( i < iMax ) { wxPGProperty* p = parent->Item(i); int parenting = p->GetParentingType(); p->m_y = -1; if ( parenting ) { parent = (wxPGPropertyWithChildren*)p; i = 0; break; } i++; } } if ( i >= iMax ) { i = parent->m_arrIndex + 1; parent = parent->m_parent; if ( inside_hidden_part && parent == nearest_expanded ) { inside_hidden_part = false; } } } while ( parent != (wxPGPropertyWithChildren*) NULL ); m_bottomy = cury; #if __INTENSE_DEBUGGING__ wxLogDebug(wxT(" \\-> m_bottomy = %i"),(int)m_bottomy); #endif // Forces a new DoGetBestSize() call. wxScrolledWindow::InvalidateBestSize(); // Visibles need to be recalculated *always* after y recalculation // (but make sure it stays here, above RecalculateVirtualSize). CalculateVisibles( -1, true ); RecalculateVirtualSize(); // Reselect if ( prevSelected ) DoSelectProperty( prevSelected, wxPG_SEL_NONVISIBLE ); } // ----------------------------------------------------------------------- // Call when scroll position changes. Do not pre-fill m_prevVY. void wxPropertyGrid::CalculateVisibles( int vy, bool full_recalc ) { if ( vy < 0 ) { int vx; GetViewStart(&vx,&vy); vy *= wxPG_PIXELS_PER_UNIT; if ( full_recalc ) m_prevVY = -1; } // Control not yet properly built. if ( vy >= (int)m_bottomy ) return; if ( m_height < 0 ) return; // Hide popup // FIXME: Delete after transient popup support fully added if ( m_wndPrimary && m_wndPrimary->IsKindOf(CLASSINFO(wxPGOwnerDrawnComboBox)) ) ((wxPGOwnerDrawnComboBox*)m_wndPrimary)->HidePopup(); int vy2 = vy + m_height; if ( vy2 > (int)m_bottomy ) vy2 = m_bottomy; unsigned int arr_index = 0; unsigned int vis_height = vy2-vy; unsigned int new_item_count = vis_height/m_lineHeight; if ( vis_height % m_lineHeight ) new_item_count++; wxPGArrayProperty& arr = m_arrVisible; arr.SetCount ( new_item_count ); #if __INTENSE_DEBUGGING__ wxLogDebug( wxT("wxPropertyGrid::CalculateVisibles ( vy=%i, vy2=%i, m_height=%i, newitemcount=%i, lineheight=%i )"), (int)vy, (int)vy2, (int)m_height, (int)new_item_count, (int)m_lineHeight ); #endif //wxASSERT( vy != m_prevVY ); wxASSERT( vy >= 0 ); if ( !new_item_count ) { arr.Empty(); return; } ITEM_ITERATION_VARIABLES wxPGProperty* base = NULL; // Will simpler operation be enough? if ( m_prevVY >= 0 ) { if ( m_calcVisHeight == m_height ) { if ( m_iFlags & wxPG_FL_SCROLLED ) { int diff = vy - m_prevVY; if ( diff == m_lineHeight ) { // Scrolled one down base = DoGetItemAtY_Full( vy2 - 1 ); wxASSERT( base ); arr_index = new_item_count - 1; for ( i=0; iarr_index; i-- ) arr.Item(i) = arr.Item(i-1); arr.Item(arr_index) = base; base = (wxPGProperty*) NULL; } else base = DoGetItemAtY_Full( vy ); } else base = DoGetItemAtY_Full( vy ); } else if ( m_prevVY == vy && !(m_iFlags & wxPG_FL_SCROLLED) ) { if ( m_height > m_calcVisHeight ) { // Increased height - add missing items arr_index = (m_calcVisHeight-1)/m_lineHeight; if ( arr_index >= new_item_count ) { // Now, were probably below last item here //if ( (vy+m_calcVisHeight) >= (int)m_bottomy ) base = NULL; /*else arr_index = arr.GetCount()-1;*/ } else { base = (wxPGProperty*) arr.Item( arr_index ); } } else { // Decreased height - do nothing //base = NULL; } } else base = DoGetItemAtY_Full( vy ); } else { base = DoGetItemAtY_Full( vy ); } if ( base ) { ITEM_ITERATION_INIT(base->m_parent,base->m_arrIndex) #if __INTENSE_DEBUGGING__ wxLogDebug( wxT(" Starting at index %i"), (int)arr_index ); #endif ITEM_ITERATION_VO_LOOP_BEGIN //wxASSERT( p->m_y >= 0 ); // update visibility limit reached? if ( p->m_y >= vy2 ) { parent = NULL; break; } #ifdef __WXDEBUG__ if ( arr_index >= arr.GetCount() ) { wxLogDebug(wxT(" wxPropertyGrid::CalculateVisibles Loop overflow (index=%i,vy+vis_height=%i,p->m_y=%i)"), (int)arr_index,(int)(vy+vis_height),(int)p->m_y); } #endif arr.Item(arr_index) = (void*)p; arr_index++; ITEM_ITERATION_VO_LOOP_END } // Adjust controls /*if ( m_selected ) { int adjust = prevVY - vy; if ( adjust ) { wxPoint cp(0,adjust); if ( m_wndPrimary ) m_wndPrimary->Move ( m_wndPrimary->GetPosition() + cp ); if ( m_wndSecondary ) m_wndSecondary->Move ( m_wndSecondary->GetPosition() + cp ); } }*/ m_iFlags &= ~(wxPG_FL_SCROLLED); m_prevVY = vy; m_calcVisHeight = m_height; } // ----------------------------------------------------------------------- // This version uses the visible item cache. wxPGProperty* wxPropertyGrid::DoGetItemAtY( int y ) { //wxASSERT( m_prevVY >= 0 ); // Outside(check 1)? if ( y >= (int)m_bottomy || y < 0 ) { /* #if __PAINT_DEBUGGING__ wxLogDebug(wxT("WARNING: DoGetItemAtY(a): y = %i"),y); #endif */ return (wxPGProperty*) NULL; } int vx, vy; GetViewStart(&vx,&vy); vy*=wxPG_PIXELS_PER_UNIT; // Need to recalculate visibility cache // Note: need to check for y < m_prevVY is a hack. if ( m_prevVY != vy ||y < m_prevVY ) //m_iFlags & wxPG_FL_SCROLLED || CalculateVisibles( vy, true ); // Outside(check 2)? if ( y >= (vy+m_height) ) { /* #if __PAINT_DEBUGGING__ wxLogDebug(wxT("WARNING: DoGetItemAtY(b): y = %i"),y); #endif */ return (wxPGProperty*) NULL; } unsigned int index = (unsigned int)((y - vy) / m_lineHeight); // Consistency checks if ( !m_arrVisible.GetCount() ) return (wxPGProperty*) NULL; if ( index >= m_arrVisible.GetCount() ) { #ifdef __WXDEBUG__ wxLogDebug(wxT(" index = %i"),(int)index); wxLogDebug(wxT(" (height/lineheight+1) = %i"),(int)((m_height/m_lineHeight)+1)); wxLogDebug(wxT(" m_arrVisible.GetCount() = %i"),(int)m_arrVisible.GetCount()); // This was wxCHECK_MSG, but I don't want it to show, since it can happen from // time to time, and I probably won't fix in the current version of wxPropertyGrid. wxLogDebug( wxT("Not enough entries in m_arrVisible (y was < m_bottomy).") ); #endif return (wxPGProperty*) NULL; } if ( index >= m_arrVisible.GetCount() ) { index = m_arrVisible.GetCount()-1; } return (wxPGProperty*)m_arrVisible.Item(index); } // ----------------------------------------------------------------------- // wxPropertyGrid graphics related methods // ----------------------------------------------------------------------- void wxPropertyGrid::OnPaint( wxPaintEvent& WXUNUSED(event) ) { wxPG_PAINT_DC_INIT() // Don't paint after destruction has begun if ( !(m_iFlags & wxPG_FL_INITIALIZED) ) return; #if __PAINT_DEBUGGING__ wxLogDebug( wxT("wxPropertyGrid::OnPaint()") ); #endif // Find out where the window is scrolled to int vx,vy; // Top left corner of client GetViewStart(&vx,&vy); vy *= wxPG_PIXELS_PER_UNIT; // Update everything inside the box wxRect r = GetUpdateRegion().GetBox(); r.y += vy; // Repaint this rectangle //if ( r.height > 0 ) DrawItems ( dc, r.y, r.y + r.height, #if wxPG_ALLOW_CLIPPING NULL //&r #else NULL #endif ); // We assume that the size set when grid is shown // is what is desired. m_iFlags |= wxPG_FL_GOOD_SIZE_SET; } // ----------------------------------------------------------------------- // // This is the one called by OnPaint event handler and others. // topy and bottomy are already unscrolled // Clears any area in coordinates that doesn't have items. // void wxPropertyGrid::DrawItems( wxDC& dc, unsigned int topy, unsigned int bottomy, const wxRect* clipRect ) { if ( m_frozen || m_height < 1 || bottomy < topy || !m_pState ) return; #if __PAINT_DEBUGGING__ wxLogDebug(wxT("wxPropertyGrid::DrawItems ( %i -> %i, clipRect = 0x%X )"),topy,bottomy, (unsigned int)clipRect); #endif // items added check if ( FROM_STATE(m_itemsAdded) ) PrepareAfterItemsAdded(); unsigned int vx, vy; // Top left corner of client GetViewStart((int*)&vx,(int*)&vy); vy *= wxPG_PIXELS_PER_UNIT; unsigned int client_bottom = (unsigned int)m_height + vy; // Clip topy and bottomy if ( bottomy > client_bottom ) bottomy = client_bottom; if ( topy < vy ) topy = vy; #if __PAINT_DEBUGGING__ wxLogDebug(wxT(" \\--> ( final area %i -> %i )"),topy,bottomy); #endif // // Determine first and last item to draw // (don't draw if already over the top) // if ( topy < client_bottom && topy < m_bottomy && FROM_STATE(m_properties)->GetCount() > 0 ) { wxPGProperty* firstItem = DoGetItemAtY(topy); if ( firstItem == (wxPGProperty*) NULL ) { #ifdef __WXDEBUG__ wxString msg; msg.Printf(wxT("WARNING: wxPropertyGrid::DrawItems(): firstItem == NULL!")); wxMessageBox(msg); wxLogDebug(msg); wxLogDebug(wxT(" More info: y: %i -> %i visible_window: %i -> %i"), (int)topy,(int)bottomy,(int)vy,(int)client_bottom); // This is here for debugging purposes. DoGetItemAtY(topy); #endif return; } wxPGProperty* lastItem = (wxPGProperty*) NULL; // lastItem may be NULL on call to DoDrawItems // in this case lastItem will truly become the last item if ( bottomy > topy && bottomy < m_bottomy ) { lastItem = DoGetItemAtY(bottomy-1); #if __PAINT_DEBUGGING__ wxLogDebug( wxT(" \\--> WARNING: lastItem acquisition failed (should not)!")); #endif } DoDrawItems( dc, firstItem, lastItem, clipRect ); } // Clear area beyond m_bottomy? if ( bottomy > m_bottomy ) { wxColour& bgc = wxPG_SLACK_BACKROUND; //wxColour& bgc = wxColour(255,0,255); dc.SetPen ( wxPen(bgc) ); dc.SetBrush ( wxBrush(bgc) ); unsigned int clear_top = m_bottomy; if ( topy > clear_top ) clear_top = topy; dc.DrawRectangle ( 0, clear_top, m_width, m_height-(clear_top-vy) ); } } // ----------------------------------------------------------------------- #define DECLARE_ITEM_ITERATION_UVC_VARIABLES \ unsigned int ind; \ wxPGProperty* p; // UVC = Use Visibility Cache // VISTART = index to first item from visibility cache to use. // BOTTOMY = Logical y coordinate of last item to draw. #define ITEM_ITERATION_UVC_LOOP_BEGIN(VISTART,BOTTOMY) \ ind = VISTART; \ do \ { \ p = (wxPGProperty*)m_arrVisible.Item(ind); \ ind++; \ int parenting = p->GetParentingType(); #define ITEM_ITERATION_UVC_LOOP_END(BOTTOMY) \ } while ( p->m_y < BOTTOMY ); \ void wxPropertyGrid::DoDrawItems( wxDC& dcMain, const wxPGProperty* firstItem, const wxPGProperty* lastItem, const wxRect* clipRect ) { if ( m_frozen || m_height < 1 ) return; //wxCHECK_RET( !FROM_STATE(m_itemsAdded), wxT("m_itemsAdded must be zero at this point") ); // items added check if ( FROM_STATE(m_itemsAdded) ) PrepareAfterItemsAdded(); wxCHECK_RET( firstItem != NULL, wxT("invalid first item") ); wxASSERT( FROM_STATE(m_properties->GetCount()) ); // Make sure visibility cache is up-to-date int vy; int vx; GetViewStart(&vx,&vy); vy*=wxPG_PIXELS_PER_UNIT; if ( vy != m_prevVY ) CalculateVisibles(vy,true); if ( vy != m_prevVY ) return; // Determine last item, if not given (but requires clipRect). if ( lastItem == NULL ) { if ( clipRect != NULL ) { unsigned int bottomy = clipRect->y + clipRect->height; if ( bottomy <= (unsigned int)firstItem->m_y ) lastItem = firstItem; } if ( lastItem == NULL ) { lastItem = DoGetItemAtY(vy+m_height-1); if ( lastItem == NULL ) lastItem = GetLastItem(true); } } DoDrawItems2(dcMain, firstItem, lastItem, clipRect); } // // Uses three pass approach, so it is optimized for drawing // multiple items at once. // // IMPORTANT NOTES: // - Clipping rectangle must be of physical coordinates. // // void wxPropertyGrid::DoDrawItems2( wxDC& dcMain, const wxPGProperty* firstItem, const wxPGProperty* lastItem, const wxRect* clipRect ) const { int lh = m_lineHeight; int vy; int vx; GetViewStart(&vx,&vy); vy*=wxPG_PIXELS_PER_UNIT; int firstItemTopY = firstItem->m_y; int lastItemBottomY = lastItem->m_y+lh-1; int yRelMod = 0; // Entire range outside scrolled, visible area? if ( firstItemTopY >= (vy+m_height) || lastItemBottomY <= vy ) return; wxCHECK_RET( firstItemTopY < lastItemBottomY, wxT("invalid y values") ); wxDC* dcPtr; #if wxPG_DOUBLE_BUFFER wxMemoryDC* bufferDC = NULL; const wxRect* blitClipRect = NULL; int renderHeight = lastItem->m_y - firstItemTopY + m_lineHeight; if ( !(GetExtraStyle() & wxPG_EX_NATIVE_DOUBLE_BUFFERING) ) { if ( !m_doubleBuffer ) return; // Must fit to double-buffer #ifdef __WXDEBUG__ if ( (lastItemBottomY - firstItemTopY) > m_doubleBuffer->GetHeight() ) { wxString msg; msg.Printf( wxT("wxPropertyGrid: DOUBLE-BUFFER TOO SMALL ( drawn %i vs db height %i vs client_height %i)!"), (int)(lastItemBottomY - firstItemTopY), (int)(m_doubleBuffer->GetHeight()), (int)m_height ); wxLogError(msg); wxLogDebug(msg); } #endif bufferDC = new wxMemoryDC(); bufferDC->SelectObject( *m_doubleBuffer ); dcPtr = bufferDC; blitClipRect = clipRect; //if ( m_iFlags & wxPG_FL_CHANGED || // !(m_iFlags & wxPG_FL_HANDLING_PAINT_EVENT) ) //{ } else #endif { dcPtr = &dcMain; } wxDC& dc = *dcPtr; #if __PAINT_DEBUGGING__ wxLogDebug(wxT(" -> DoDrawItems ( \"%s\" -> \"%s\", height=%i (ch=%i), clipRect = 0x%lX )"), firstItem->GetLabel().c_str(), lastItem->GetLabel().c_str(), (int)(lastItemBottomY - firstItemTopY), (int)m_height, (unsigned long)clipRect ); #endif wxPGPaintData paintdata; wxRect r; DECLARE_ITEM_ITERATION_UVC_VARIABLES // Get first and last indexes to visibility cache unsigned int viStart = (firstItemTopY - vy) / lh; int vi_end_y = lastItem->m_y; if ( viStart >= m_arrVisible.GetCount() ) { wxLogDebug(wxT("WARNING: viStart >= m_arrVisible.GetCount() ( %i >= %i )"), (int)viStart, (int)m_arrVisible.GetCount() ); return; } #ifdef __WXDEBUG__ unsigned int viEnd = (lastItem->m_y - vy) / lh; if ( viEnd >= m_arrVisible.GetCount() ) { wxLogDebug(wxT("WARNING: viEnd >= m_arrVisible.GetCount() ( %i >= %i )"), (int)viEnd, (int)m_arrVisible.GetCount() ); return; } #endif int x = m_marginWidth; int y; long window_style = m_windowStyle; int extraStyle = GetExtraStyle(); // // With wxPG_DOUBLE_BUFFER, do double buffering // - buffer's y = 0, so align cliprect and coordinates to that // #if wxPG_DOUBLE_BUFFER if ( bufferDC ) { wxRect cr2; //yRelMod = firstItemTopY; yRelMod = vy; // // clipRect conversion if ( clipRect ) { cr2 = *clipRect; cr2.y -= yRelMod; clipRect = &cr2; } //int renderHeight = lastItem->m_y - firstItemTopY + m_lineHeight; //lastItemBottomY -= firstItemTopY; //firstItemTopY = 0; firstItemTopY -= vy; lastItemBottomY -= vy; } #endif const wxFont& normalfont = m_font; bool reallyFocused = (m_iFlags & wxPG_FL_FOCUSED) ? true : false; bool isEnabled = IsEnabled(); // // Prepare some pens and brushes that are often changed to. // wxBrush marginBrush(m_colMargin); wxPen marginPen(m_colMargin); wxBrush capbgbrush(m_colCapBack,wxSOLID); wxPen linepen(m_colLine,1,wxSOLID); // pen that has same colour as text wxPen outlinepen(m_colPropFore,1,wxSOLID); if ( clipRect ) dc.SetClippingRegion( *clipRect ); // // Clear margin with background colour // dc.SetBrush( marginBrush ); if ( !(window_style & wxPG_HIDE_MARGIN) ) { dc.SetPen( *wxTRANSPARENT_PEN ); dc.DrawRectangle(-1,firstItemTopY-1,m_marginWidth+2,lastItemBottomY-firstItemTopY+3); } /* // This colorizer helps to debug painting. bool small_draw = false; if ( renderHeight < (m_height-(lh*3)) ) { if ( firstItem == lastItem ) { bgbrush = wxBrush(wxColour(255,128,128)); linepen = wxPen(wxColour(128,0,255)); //boxbrush = wxBrush(wxColour(192,192,192)); } else { bgbrush = wxBrush(wxColour(128,255,128)); linepen = wxPen(wxColour(0,0,255)); //boxbrush = wxBrush(wxColour(230,230,230)); } small_draw = true; } */ //dc.SetPen ( *wxTRANSPARENT_PEN ); //dc.SetFont(normalfont); wxPGProperty* selected = m_selected; /*#if wxPG_REFRESH_CONTROLS_AFTER_REPAINT bool selected_painted = false; #endif*/ // NOTE: Clipping and pen/brush switching are main reasons for multi-pass approach. // // zero'th pass: Wireframes. // (this could be embedded in another loop) dc.SetBrush( marginBrush ); unsigned long cur_first_ind = viStart; unsigned long next_cur_first_ind = 0xFFFFFFFF; wxPGPropertyWithChildren* cur_category = (wxPGPropertyWithChildren*) NULL; int vcache_last_item_y = vy + m_height; if ( vcache_last_item_y > (int)m_bottomy ) vcache_last_item_y = m_bottomy; vcache_last_item_y -= lh; ITEM_ITERATION_UVC_LOOP_BEGIN(viStart,vi_end_y) wxPGPropertyWithChildren* parent = p->GetParent(); // Should not happen (but this is better than a crash)... wxCHECK_RET( parent, wxT("NULL parent") ); // Does this wireframe end? // Conditions: // A) This is last item within its parent, and parent is category. // B) Next is category. // C) This is collapsed category. // D) This is the last item drawn. if ( p->m_y >= vi_end_y ) { // This is the last item. //wxLogDebug(wxT("--> last item")); next_cur_first_ind = ind; } else if ( p->m_arrIndex >= (parent->GetCount()-1) && parent->GetParentingType() >= PT_CAPTION && ( parenting <= 0 /*|| ((wxPGPropertyWithChildren*)p)->GetCount() < 1*/ ) ) { // This is last item within its parent, and parent is category, but this isn't // an non-empty category. //wxLogDebug(wxT("--> category ends")); cur_category = (wxPropertyCategoryClass*)parent; next_cur_first_ind = ind; } else if ( ((wxPGProperty*)m_arrVisible.Item(ind))->GetParentingType() >= PT_CAPTION ) { // Next item is a category. //wxLogDebug(wxT("--> next item is category")); next_cur_first_ind = ind; } else if ( parenting > 0 && (!((wxPGPropertyWithChildren*)p)->IsExpanded() || !((wxPGPropertyWithChildren*)p)->GetCount()) ) { // This is collapsed category. //wxLogDebug(wxT("--> collapsed category")); cur_category = (wxPropertyCategoryClass*)p; next_cur_first_ind = ind; } // When new category begins or old ends, draw wireframe for items in-between if ( next_cur_first_ind < 0xFFFFFF ) { wxPGProperty* cur_first = (wxPGProperty*)m_arrVisible.Item(cur_first_ind); wxPGPropertyWithChildren* cur_last_item = (wxPGPropertyWithChildren*)p; if ( !cur_category ) { if ( cur_first->GetParentingType() >= PT_CAPTION ) { cur_category = (wxPropertyCategoryClass*)cur_first; } else if ( !(m_windowStyle & wxPG_HIDE_CATEGORIES) ) { cur_category = _GetPropertyCategory(cur_first); /*if ( !cur_category ) cur_category = (wxPropertyCategoryClass*)FROM_STATE(m_properties);*/ } } int draw_top = cur_first->m_y - yRelMod; int draw_bottom = cur_last_item->m_y + lh - yRelMod; int frame_top = draw_top; int frame_bottom = draw_bottom; int margin_top = draw_top; int margin_bottom = draw_bottom; int ly = frame_top + lh - 1; if ( cur_first->GetParentingType() >= PT_CAPTION ) { wxPropertyCategoryClass* pc = ((wxPropertyCategoryClass*)cur_first); frame_top += lh; if ( !pc->IsExpanded() ) { // Category collapsed. frame_top = frame_bottom + 1; } } int grey_x = x; if ( cur_category /*!(window_style & wxPG_HIDE_CATEGORIES)*/ ) grey_x += ((unsigned int)((cur_category->GetDepth()-1)*m_subgroup_extramargin)); //wxLogDebug( wxT("wireframe: %s -> %s (grey_x:%i)"), cur_first->GetLabel().c_str(), // cur_last_item->GetLabel().c_str(),((int)grey_x-x)); dc.SetPen( *wxTRANSPARENT_PEN ); // Clear extra margin area. dc.DrawRectangle( x-1, margin_top, grey_x - x + 1, margin_bottom-margin_top ); dc.SetPen( linepen ); if ( frame_bottom > frame_top ) { //if ( cat_top < firstItemTopY ) // cat_top = firstItemTopY; // Margin Edge dc.DrawLine ( grey_x, frame_top, grey_x, frame_bottom ); // Splitter dc.DrawLine ( m_splitterx, frame_top, m_splitterx, frame_bottom ); // Horizontal Lines while ( ly < (frame_bottom-1) ) { dc.DrawLine ( grey_x, ly, m_width, ly ); ly += lh; } } int use_depth = grey_x; // Default is to simply tidy up this wireframe. // Properly draw top line of next wireframe, if adjacent. // Get next item. wxPGProperty* next_item; //if ( ind < m_arrVisible.GetCount() ) if ( cur_last_item->m_y < vcache_last_item_y ) { next_item = (wxPGProperty*)m_arrVisible.Item(ind); } else { // Was not in visibility cache, so use clumsier method. next_item = GetNeighbourItem(cur_last_item,true,1); if (!next_item) next_item = cur_last_item; // This will serve our purpose. } //wxLogDebug(wxT("next_item: %s"),next_item->GetLabel().c_str()); // Just take the depth and is-it-category out of it. int next_parenting = next_item->GetParentingType(); int last_parenting = cur_last_item->GetParentingType(); // A) If both are categories, draw line with background colour. // B) If only next is category, use its category's depth. // C) If only last is category, use grey_x as depth. // D) If neither is a category, use smaller. if ( next_parenting > 0 ) { // Next is category. if ( last_parenting > 0 ) { // Last is a category too - draw complete line with background colour. dc.SetPen ( marginPen ); use_depth = x; } } else { // Next is not a category. wxPropertyCategoryClass* next_cat = _GetPropertyCategory(next_item); int depth_next = x; if ( next_cat && /*cur_category*/ !(window_style & wxPG_HIDE_CATEGORIES) ) { //wxLogDebug(wxT("next_item_cat: %s"),next_cat->GetLabel().c_str()); depth_next += ((unsigned int)((next_cat->GetDepth()-1)*m_subgroup_extramargin)); } if ( last_parenting <= 0 ) { // Last is not a category - use lesser depth if ( depth_next < grey_x ) use_depth = depth_next; //wxLogDebug(wxT("- neither is category")); } else { // Last is a category use_depth = depth_next; //wxLogDebug(wxT("last only is category")); } } //wxLogDebug(wxT("last_line_use_depth: %i"),(int)use_depth); dc.DrawLine( use_depth, ly, m_width, ly ); cur_first_ind = next_cur_first_ind; next_cur_first_ind = 0xFFFFFFFF; //cur_first = (wxPGPropertyWithChildren*)p; cur_category = (wxPGPropertyWithChildren*) NULL; } //cur_last_item = p; ITEM_ITERATION_UVC_LOOP_END(vi_end_y) // // First pass: Category background and text, Images, Label+value background. // //wxLogDebug(wxT(" \\--> first pass...")); y = firstItemTopY; dc.SetFont( m_captionFont ); dc.SetPen( *wxTRANSPARENT_PEN ); ITEM_ITERATION_UVC_LOOP_BEGIN(viStart,vi_end_y) y += m_spacingy; int text_x = x + ((unsigned int)((p->GetDepth()-1)*m_subgroup_extramargin)); if ( parenting > 0 ) { dc.SetBrush( capbgbrush ); // Category label background colour. // Category - draw background, text and possibly selection rectangle. wxPropertyCategoryClass* pc = (wxPropertyCategoryClass*)p; // Note how next separator line is overdrawn if next item is category . int useLh = lh; if ( ind < (m_arrVisible.GetCount()) && ( ((wxPGProperty*)m_arrVisible[ind])->GetParentingType() <= 0 ) ) useLh -= 1; if ( isEnabled && p->IsEnabled() ) dc.SetTextForeground( *(wxPGColour*)m_arrFgCols[pc->GetTextColIndex()] ); else dc.SetTextForeground( m_colDisPropFore ); dc.DrawRectangle( text_x, y-m_spacingy, m_width-text_x, useLh ); dc.DrawText( pc->GetLabel(), text_x+wxPG_XBEFORETEXT, y ); // active caption gets nice dotted rectangle if ( p == selected ) { wxRect focusRect(text_x+wxPG_XBEFORETEXT-wxPG_CAPRECTXMARGIN, y-wxPG_CAPRECTYMARGIN, pc->GetTextExtent()+(wxPG_CAPRECTXMARGIN*2), m_fontHeight+(wxPG_CAPRECTYMARGIN*2)); wxPGDrawFocusRect(dc,focusRect); dc.SetPen( *wxTRANSPARENT_PEN ); } } else { // Basic background colour. dc.SetBrush( *(wxPGBrush*)m_arrBgBrushes[p->m_bgColIndex] ); //wxLogDebug(wxT("%s: %i"),p->m_label.c_str(),(int)p->m_depthBgCol); int greyDepth = 0; if ( !(window_style & wxPG_HIDE_CATEGORIES) ) greyDepth = (((int)p->m_depthBgCol)-1) * m_subgroup_extramargin; // In two parts to retain splitter if ( p == m_selected ) { // Selected get different label background. if ( reallyFocused ) dc.SetBrush( m_colSelBack ); else dc.SetBrush( m_colLine ); dc.DrawRectangle( x+greyDepth+1, y-m_spacingy, m_splitterx-greyDepth-x-1, lh-1 ); } else { dc.DrawRectangle( x+greyDepth+1, y-m_spacingy, m_splitterx-greyDepth-x-1, lh-1 ); } dc.DrawRectangle( m_splitterx+1, y-m_spacingy, m_width-m_splitterx, lh-1 ); } y += m_fontHeight+m_spacingy+1; ITEM_ITERATION_UVC_LOOP_END(vi_end_y) dc.SetFont( normalfont ); // // Second pass: Expander Buttons, Labels. // // Second pass happens entirely on the left side, so sometimes // we can just skip it. if ( clipRect == NULL || clipRect->x < m_splitterx ) { //wxLogDebug(wxT(" \\--> second pass...")); y = firstItemTopY; r = wxRect(0,y,m_splitterx,lastItemBottomY); dc.SetClippingRegion ( r ); dc.SetFont(normalfont); ITEM_ITERATION_UVC_LOOP_BEGIN(viStart,vi_end_y) if ( isEnabled && (p->IsEnabled() || !(extraStyle & wxPG_EX_GREY_LABEL_WHEN_DISABLED)) ) dc.SetTextForeground( *(wxPGColour*)m_arrFgCols[p->m_fgColIndex] ); else dc.SetTextForeground( m_colDisPropFore ); // // Expand/collapse button image. if ( parenting != 0 && !(window_style & wxPG_HIDE_MARGIN) && ((wxPGPropertyWithChildren*)p)->GetChildCount() ) { wxPGPropertyWithChildren* pwc = (wxPGPropertyWithChildren*)p; int depth = p->m_depth - 1; #ifdef wxPG_ICON_WIDTH int imageX = m_gutterWidth + ( depth * m_subgroup_extramargin ); #endif y += m_buttonSpacingY; #if (wxPG_USE_RENDERER_NATIVE) // Prepare rectangle to be used r.x = imageX; r.y = y; r.width = m_iconWidth; r.height = m_iconHeight; #elif wxPG_ICON_WIDTH // Drawing expand/collapse button manually dc.SetPen(m_colPropFore); if ( parenting > 0 ) { dc.SetBrush(*wxTRANSPARENT_BRUSH); } else { dc.SetBrush(m_colPropBack); } dc.DrawRectangle( imageX, y, m_iconWidth, m_iconWidth ); int _y = y+(m_iconWidth/2); dc.DrawLine(imageX+2,_y,imageX+m_iconWidth-2,_y); #else wxBitmap* bmp; #endif if ( pwc->m_expanded ) { // wxRenderer functions are non-mutating in nature, so it // should be safe to cast "const wxPropertyGrid*" to "wxWindow*". // Hopefully this does not cause problems. #if (wxPG_USE_RENDERER_NATIVE) wxRendererNative::Get().DrawTreeItemButton( (wxWindow*)this, dc, r, wxCONTROL_EXPANDED ); #elif wxPG_ICON_WIDTH // #else bmp = m_collbmp; #endif } else { #if (wxPG_USE_RENDERER_NATIVE) wxRendererNative::Get().DrawTreeItemButton( (wxWindow*)this, dc, r, 0 ); #elif wxPG_ICON_WIDTH int _x = imageX+(m_iconWidth/2); dc.DrawLine(_x,y+2,_x,y+m_iconWidth-2); #else bmp = m_expandbmp; #endif } #if (wxPG_USE_RENDERER_NATIVE) // #elif wxPG_ICON_WIDTH // #else dc.DrawBitmap( *bmp, m_gutterWidth, y, true ); #endif y -= m_buttonSpacingY; } y += m_spacingy; if ( parenting <= 0 ) { // Non-categories. int text_x = x; // Use basic depth if in non-categoric mode and parent is base array. if ( !(window_style & wxPG_HIDE_CATEGORIES) || p->GetParent() != FROM_STATE(m_properties) ) { text_x += ((unsigned int)((p->m_depth-1)*m_subgroup_extramargin)); } /* else { wxLogDebug( wxT("%s"), p->GetLabel().c_str() ); text_x = x; } */ if ( p != selected ) { dc.DrawText( p->m_label, text_x+wxPG_XBEFORETEXT, y ); } else { // Selected gets different colour. if ( reallyFocused ) dc.SetTextForeground( m_colSelFore ); dc.DrawText( p->m_label, text_x+wxPG_XBEFORETEXT, y ); } } else { /*// switch background colour bgbrush.SetColour ( ((wxPropertyCategoryClass*)p)->m_colCellBg ); dc.SetBrush ( bgbrush );*/ } y += m_fontHeight+m_spacingy+1; ITEM_ITERATION_UVC_LOOP_END(vi_end_y) } // // Third pass: Values // dc.DestroyClippingRegion(); if ( clipRect ) { // third pass happens entirely on the right side, so sometimes // we can just skip it if ( (clipRect->x + clipRect->width) < m_splitterx ) x = -1; dc.SetClippingRegion ( *clipRect ); } // This used with value drawer method. wxRect valueRect(0,0, m_width-(m_splitterx+wxPG_CONTROL_MARGIN), m_fontHeight); wxSize imageSize; if ( x != -1 ) { r.x = m_splitterx+1+wxPG_CONTROL_MARGIN; r.width = m_width-m_splitterx-wxPG_CONTROL_MARGIN; //r.x = m_splitterx+wxPG_DIST_SPLITTER_TO_IMAGE; //r.width = m_width-m_splitterx-wxPG_DIST_SPLITTER_TO_IMAGE-1; r.height = lh-1; /*#if wxCC_CORRECT_CONTROL_POSITION const int vy2 = vy; #endif*/ //wxLogDebug(wxT(" \\--> third pass...")); // Altough this line may seem unnecessary, it isn't dc.SetFont(normalfont); dc.SetPen( *wxTRANSPARENT_PEN ); // Prepare paintdata. paintdata.m_parent = this; paintdata.m_choiceItem = -1; // Not drawing list item at this time. y = firstItemTopY; ITEM_ITERATION_UVC_LOOP_BEGIN(viStart,vi_end_y) if ( parenting <= 0 ) { r.y = y; y += m_spacingy; // background dc.SetBrush( *(wxPGBrush*)m_arrBgBrushes[p->m_bgColIndex] ); if ( isEnabled && p->IsEnabled() ) dc.SetTextForeground( *(wxPGColour*)m_arrFgCols[p->m_fgColIndex] ); else dc.SetTextForeground( m_colDisPropFore ); // draw value string only if editor widget not open // (exception: no primary editor widget or it is hidden) if ( p != selected || !m_wndPrimary // "if not primary shown" is required because // primary is not usually shown during splitter // movement. || m_dragStatus > 0 ) { valueRect.x = m_splitterx+wxPG_CONTROL_MARGIN; valueRect.y = y; // Draw background if ( p != selected ) { dc.DrawRectangle( r ); } else { if ( m_wndPrimary ) dc.SetBrush( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); else dc.SetBrush( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); dc.DrawRectangle( r ); } // Set bold font? if ( p->m_flags & wxPG_PROP_MODIFIED && (window_style & wxPG_BOLD_MODIFIED) ) dc.SetFont( m_captionFont ); const wxPGEditor* editor = p->GetEditorClass(); bool fullPaint = false; if ( p->m_flags & wxPG_PROP_CUSTOMIMAGE ) { imageSize = p->GetImageSize(); wxRect imageRect(r.x + wxPG_CONTROL_MARGIN + wxCC_CUSTOM_IMAGE_MARGIN1, r.y+wxPG_CUSTOM_IMAGE_SPACINGY, wxPG_CUSTOM_IMAGE_WIDTH, r.height-(wxPG_CUSTOM_IMAGE_SPACINGY*2)); if ( imageSize.x == wxPG_FULL_CUSTOM_PAINT_WIDTH ) { fullPaint = true; imageRect.width = m_width - imageRect.x; } dc.SetPen( outlinepen ); paintdata.m_drawnWidth = imageRect.width; if ( !(p->m_flags & wxPG_PROP_UNSPECIFIED) ) { p->OnCustomPaint( dc, imageRect, paintdata ); } else { dc.SetBrush(*wxWHITE_BRUSH); dc.DrawRectangle(imageRect); } dc.SetPen( *wxTRANSPARENT_PEN ); } else paintdata.m_drawnWidth = 0; if ( paintdata.m_drawnWidth > 0 ) valueRect.x += paintdata.m_drawnWidth + wxCC_CUSTOM_IMAGE_MARGIN1 + wxCC_CUSTOM_IMAGE_MARGIN2; else fullPaint = false; if ( !fullPaint ) editor->DrawValue(dc,p,valueRect); // Return original font? if ( p->m_flags & wxPG_PROP_MODIFIED && (window_style & wxPG_BOLD_MODIFIED) ) dc.SetFont(normalfont); } else { if ( !(m_iFlags & wxPG_FL_PRIMARY_FILLS_ENTIRE) || m_iFlags & wxPG_FL_CUR_USES_CUSTOM_IMAGE ) { //wxLogDebug(wxT("Primary doesn't fill entire")); dc.SetBrush( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); dc.DrawRectangle( r ); } if ( m_iFlags & wxPG_FL_CUR_USES_CUSTOM_IMAGE ) { wxRect imagerect(r.x + wxPG_CONTROL_MARGIN + wxCC_CUSTOM_IMAGE_MARGIN1, r.y+wxPG_CUSTOM_IMAGE_SPACINGY,wxPG_CUSTOM_IMAGE_WIDTH, r.height-(wxPG_CUSTOM_IMAGE_SPACINGY*2)); dc.SetPen ( outlinepen ); if ( !(p->m_flags & wxPG_PROP_UNSPECIFIED) ) { p->OnCustomPaint( dc, imagerect, paintdata ); } else { dc.SetBrush(*wxWHITE_BRUSH); dc.DrawRectangle(imagerect); } } dc.SetPen( *wxTRANSPARENT_PEN ); } y += m_fontHeight+m_spacingy + 1; } else { // caption item y += lh; } //if ( y > lastItemBottomY ) { parent = NULL; break; } ITEM_ITERATION_UVC_LOOP_END(vi_end_y) } dc.DestroyClippingRegion(); // Is this really necessary? #if wxPG_DOUBLE_BUFFER //} //else wxLogDebug(wxT("Used Cache")); if ( bufferDC ) { if ( blitClipRect ) dcMain.SetClippingRegion( *blitClipRect ); //wxLogDebug(wxT(" \\--> (0,%i)"),(int)final_y); dcMain.Blit ( 0, firstItem->m_y, m_width, renderHeight, &dc, 0, firstItem->m_y-vy, wxCOPY ); //dcMain.Blit ( 0, 0, m_width, m_height, // &dc, 0, 0, wxCOPY ); dcMain.DestroyClippingRegion(); // Is this really necessary? delete bufferDC; } #endif #if __PAINT_DEBUGGING__ wxLogDebug(wxT(" \\--> ends...")); #endif } // ----------------------------------------------------------------------- wxRect wxPropertyGrid::GetPropertyRect( const wxPGProperty* p1, const wxPGProperty* p2 ) const { wxRect r; if ( m_width < 10 || m_height < 10 || !FROM_STATE(m_properties)->GetCount() || p1 == (wxPGProperty*) NULL ) return wxRect(0,0,0,0); int vx,vy; GetViewStart(&vx,&vy); vy*=wxPG_PIXELS_PER_UNIT; // // Return rect which encloses the given property range int visTop = p1->m_y; int visBottom = m_bottomy; if ( p2 ) visBottom = p2->m_y + m_lineHeight; // If seleced property is inside the range, we'll extend the range to include // control's size. wxPGProperty* selected = m_selected; if ( selected && selected->m_y >= visTop && selected->m_y < visBottom ) { wxWindow* editor = GetEditorControl(); if ( editor ) { int visBottom2 = selected->m_y + editor->GetSize().y; if ( visBottom2 > visBottom ) visBottom = visBottom2; } } return wxRect(0,visTop-vy,m_width,visBottom-visTop); } // ----------------------------------------------------------------------- void wxPropertyGrid::DrawItems( const wxPGProperty* p1, const wxPGProperty* p2 ) { if ( m_frozen ) return; if ( FROM_STATE(m_itemsAdded) ) PrepareAfterItemsAdded(); wxRect r = GetPropertyRect(p1, p2); if ( r.width > 0 ) RefreshRect(r); } // ----------------------------------------------------------------------- // In addition to calling DoDrawItems directly, this is the // only alternative for using wxClientDC - others just call // RefreshRect. void wxPropertyGrid::DrawItem( wxDC& dc, wxPGProperty* p ) { wxCHECK_RET( p, wxT("invalid property id") ); // do not draw a single item if multiple pending if ( FROM_STATE(m_itemsAdded) ) return; if ( p->m_y < 0 ) return; #if __PAINT_DEBUGGING__ wxLogDebug(wxT("wxPropertyGrid::DrawItem( %s )"), p->GetLabel().c_str() ); #endif DoDrawItems( dc, p, p, NULL ); } // ----------------------------------------------------------------------- void wxPropertyGrid::RefreshProperty( wxPGProperty* p ) { if ( p == m_selected ) DoSelectProperty(p, wxPG_SEL_FORCE); DrawItemAndChildren(p); } // ----------------------------------------------------------------------- void wxPropertyGrid::DrawItemAndValueRelated( wxPGProperty* p ) { if ( m_frozen ) return; // Draw item, children, and parent too, if it is not category wxPGProperty* parent = p->GetParent(); while ( parent && parent->GetParentingType() < PT_NONE ) { DrawItem(parent); parent = parent->GetParent(); } DrawItemAndChildren(p); } void wxPropertyGrid::DrawItemAndChildren( wxPGProperty* p ) { wxCHECK_RET( p, wxT("invalid property id") ); // Do not draw if in non-visible page if ( p->GetParentState() != m_pState ) return; // do not draw a single item if multiple pending if ( FROM_STATE(m_itemsAdded) || p->m_y < 0 || m_frozen ) return; #if __PAINT_DEBUGGING__ wxLogDebug(wxT("wxPropertyGrid::DrawItemAndChildren( %s )"), p->GetLabel().c_str() ); #endif // Update child control. if ( m_selected && m_selected->GetParent() == p ) m_selected->UpdateControl(m_wndPrimary); const wxPGProperty* lastDrawn = p->GetLastVisibleSubItem(); DrawItems(p, lastDrawn); } // ----------------------------------------------------------------------- void wxPropertyGrid::Refresh( bool WXUNUSED(eraseBackground), const wxRect *rect ) { // Refresh implies forced redraw //m_iFlags |= wxPG_FL_CHANGED; wxWindow::Refresh(false,rect); #if wxPG_REFRESH_CONTROLS_AFTER_REPAINT // I think this really helps only GTK+1.2 if ( m_wndPrimary ) m_wndPrimary->Refresh(); if ( m_wndSecondary ) m_wndSecondary->Refresh(); #endif } // ----------------------------------------------------------------------- /* void wxPropertyGrid::RedrawAllVisible () { // TODO: Is this safe? //Update(); if ( m_frozen || !IsShown() ) return; wxPG_CLIENT_DC_INIT() #if __PAINT_DEBUGGING__ wxLogDebug( wxT("wxPropertyGrid::RedrawAllVisible()") ); #endif int vx,vy; // Top left corner of client GetViewStart(&vx,&vy); vy *= wxPG_PIXELS_PER_UNIT; int y1 = vy; int y2 = y1 + m_height; // Repaint this rectangle DrawItems ( dc, y1, y2, (wxRect*) NULL ); } */ // ----------------------------------------------------------------------- #if wxPG_HEAVY_GFX void wxPropertyGrid::DrawSplitterDragColumn( wxDC&, int ) { } #else void wxPropertyGrid::DrawSplitterDragColumn( wxDC& dc, int x ) { int vx, vy; GetViewStart(&vx,&vy); vy *= wxPG_PIXELS_PER_UNIT; dc.SetLogicalFunction(wxINVERT); dc.DestroyClippingRegion(); dc.SetPen( m_splitterpen ); dc.DrawLine(x,vy,x,vy+m_height); } #endif // ----------------------------------------------------------------------- // wxPropertyGrid global operations // ----------------------------------------------------------------------- void wxPropertyGrid::Clear() { if ( m_selected ) { bool selRes = DoSelectProperty(wxPGIdGen(NULL), wxPG_SEL_DELETING); // This must be before state clear wxPG_CHECK_RET_DBG( selRes, wxT("failed to deselect a property (editor probably had invalid value)") ); } FROM_STATE(Clear()); m_propHover = NULL; m_bottomy = 0; m_prevVY = 0; m_arrVisible.Empty(); RecalculateVirtualSize(); // Need to clear some area at the end if ( !m_frozen ) RefreshRect(wxRect(0, 0, m_width, m_height)); } // ----------------------------------------------------------------------- bool wxPropertyGrid::EnableCategories( bool enable ) { if ( !ClearSelection() ) return false; if ( enable ) { // // Enable categories // m_windowStyle &= ~(wxPG_HIDE_CATEGORIES); } else { // // Disable categories // m_windowStyle |= wxPG_HIDE_CATEGORIES; } if ( !m_pState->EnableCategories(enable) ) return false; if ( !m_frozen ) { if ( m_windowStyle & wxPG_AUTO_SORT ) { FROM_STATE(m_itemsAdded) = 1; // force PrepareAfterItemsAdded(); } else { CalculateYs(NULL,-1); //CalculateVisibles( -1 ); } } else FROM_STATE(m_itemsAdded) = 1; Refresh(); return true; } // ----------------------------------------------------------------------- void wxPropertyGrid::SwitchState( wxPropertyGridState* pNewState ) { wxASSERT( pNewState ); wxPGProperty* oldSelection = m_selected; // Deselect if ( m_selected ) { bool selRes = ClearSelection(); wxPG_CHECK_RET_DBG( selRes, wxT("failed to deselect a property (editor probably had invalid value)") ); } m_pState->m_selected = oldSelection; bool orig_mode = m_pState->IsInNonCatMode(); bool new_state_mode = pNewState->IsInNonCatMode(); m_pState = pNewState; m_bottomy = 0; // This is necessary or y's won't get updated. m_propHover = (wxPGProperty*) NULL; // If necessary, convert state to correct mode. if ( orig_mode != new_state_mode ) { // This should refresh as well. EnableCategories ( orig_mode?false:true ); } else if ( !m_frozen ) { // Refresh, if not frozen. if ( FROM_STATE(m_itemsAdded) ) PrepareAfterItemsAdded(); else CalculateYs(NULL,-1); // Reselect if ( FROM_STATE(m_selected) ) DoSelectProperty( FROM_STATE(m_selected) ); //RedrawAllVisible(); Refresh(); } else m_pState->m_itemsAdded = 1; } // ----------------------------------------------------------------------- void wxPropertyGrid::Sort( wxPGId id ) { wxPG_PROP_ID_CALL_PROLOG() m_pState->Sort( p ); // Because order changed, Y's need to be changed as well if ( p->GetParentState() == m_pState ) CalculateYs ( p->m_parent, p->m_arrIndex ); } // ----------------------------------------------------------------------- void wxPropertyGrid::Sort() { bool selRes = ClearSelection(); // This must be before state clear wxPG_CHECK_RET_DBG( selRes, wxT("failed to deselect a property (editor probably had invalid value)") ); m_pState->Sort(); CalculateYs( NULL, -1 ); } // ----------------------------------------------------------------------- // Call to SetSplitterPosition will always disable splitter auto-centering // if parent window is shown. void wxPropertyGrid::DoSetSplitterPosition( int newxpos, bool refresh ) { if ( ( newxpos < wxPG_DRAG_MARGIN ) ) return; // ( m_width > wxPG_DRAG_MARGIN && newxpos > (m_width-wxPG_DRAG_MARGIN) ) #if __INTENSE_DEBUGGING__ wxLogDebug( wxT("wxPropertyGrid::DoSetSplitterPosition ( %i )"), newxpos ); #endif #if wxPG_HEAVY_GFX m_splitterx = newxpos; m_fSplitterX = (float) newxpos; if ( refresh ) { if ( m_selected ) CorrectEditorWidgetSizeX( m_splitterx, m_width ); Refresh(); //RedrawAllVisible(); // no flicker } #else if ( !m_dragStatus ) { // Only do this if this was not a call from HandleMouseUp m_startingSplitterX = m_splitterx; m_splitterx = newxpos; m_fSplitterX = (float) newxpos; } // Clear old if ( m_splitterprevdrawnx != -1 ) { wxPG_CLIENT_DC_INIT() DrawSplitterDragColumn( dc, m_splitterprevdrawnx ); m_splitterprevdrawnx = -1; } // Redraw only if drag really moved if ( m_splitterx != m_startingSplitterX && refresh ) { if ( m_selected) CorrectEditorWidgetSizeX( m_splitterx, m_width ); Update(); // This fixes a graphics-mess in wxMSW Refresh(); //RedrawAllVisible(); // no flicker } #endif // Don't allow initial splitter auto-positioning after this. m_iFlags |= wxPG_FL_SPLITTER_PRE_SET; } // ----------------------------------------------------------------------- void wxPropertyGrid::CenterSplitter( bool enable_auto_centering ) { SetSplitterPosition ( m_width/2, true ); if ( enable_auto_centering && ( m_windowStyle & wxPG_SPLITTER_AUTO_CENTER ) ) m_iFlags &= ~(wxPG_FL_DONT_CENTER_SPLITTER); } // ----------------------------------------------------------------------- // Moves splitter so that all labels are visible, but just. void wxPropertyGrid::SetSplitterLeft( bool subProps ) { wxClientDC dc(this); dc.SetFont(m_font); int maxW = m_pState->GetLeftSplitterPos(dc, m_pState->m_properties, subProps ); if ( maxW > 0 ) SetSplitterPosition( maxW ); m_iFlags |= wxPG_FL_DONT_CENTER_SPLITTER; } // ----------------------------------------------------------------------- // wxPropertyGrid item iteration (GetNextProperty etc.) methods // ----------------------------------------------------------------------- // Returns nearest paint visible property (such that will be painted unless // window is scrolled or resized). If given property is paint visible, then // it itself will be returned wxPGProperty* wxPropertyGrid::GetNearestPaintVisible( wxPGProperty* p ) { int vx,vy1;// Top left corner of client GetViewStart(&vx,&vy1); vy1 *= wxPG_PIXELS_PER_UNIT; int vy2 = vy1 + m_height; if ( (p->m_y + m_lineHeight) < vy1 ) { // Too high return DoGetItemAtY( vy1 ); } else if ( p->m_y > vy2 ) { // Too low return DoGetItemAtY( vy2 ); } // Itself paint visible return p; } // ----------------------------------------------------------------------- wxPGProperty* wxPropertyGrid::GetNeighbourItem( wxPGProperty* item, bool need_visible, int dir ) const { wxPGPropertyWithChildren* parent = item->m_parent; unsigned int indinparent = item->GetIndexInParent(); if ( dir > 0 ) { if ( item->GetChildCount() == 0 || (!((wxPGPropertyWithChildren*)item)->m_expanded && need_visible) ) { // current item did not have any expanded children if ( indinparent < (parent->GetCount()-1) ) { // take next in parent's array item = parent->Item(indinparent+1); } else { // no more in parent's array; move up until found; wxPGPropertyWithChildren* p2 = parent; parent = parent->m_parent; item = (wxPGProperty*) NULL; while ( parent ) { if ( p2->m_arrIndex < (parent->GetCount()-1) ) { item = parent->Item(p2->m_arrIndex+1); break; } p2 = parent; parent = parent->m_parent; } } } else { // take first of current item's children wxPGPropertyWithChildren* p2 = (wxPGPropertyWithChildren*)item; item = p2->Item(0); //indinparent = 0; } } else { // items in array left? if ( indinparent > 0 ) { // take prev in parent's array item = parent->Item(indinparent-1); wxPGPropertyWithChildren* pwc = (wxPGPropertyWithChildren*)item; // Recurse to it's last child while ( item->GetParentingType() != 0 && pwc->GetCount() && ( pwc->m_expanded || !need_visible ) ) { item = pwc->Last(); pwc = (wxPGPropertyWithChildren*)item; } } else { // If we were at first, go to parent item = parent; } } if ( item == FROM_STATE(m_properties) ) return (wxPGProperty*) NULL; // If item was hidden and need_visible, get next. if ( (m_iFlags & wxPG_FL_HIDE_STATE) && need_visible && item ) { if ( item->m_flags & wxPG_PROP_HIDEABLE ) { // Speed-up: If parent is hidden as well, then skip to last child or to itself if ( parent->m_flags & wxPG_PROP_HIDEABLE ) { item = parent; // if dir up if ( dir > 0 ) item = parent->Last(); // if dir down } return GetNeighbourItem ( item, need_visible, dir ); } } return item; } // ----------------------------------------------------------------------- // This is used in DoDrawItems. wxPGProperty* wxPropertyGrid::GetLastItem ( bool need_visible, bool allowSubprops ) { if ( FROM_STATE(m_properties)->GetCount() < 1 ) return (wxPGProperty*) NULL; wxPGProperty* p = FROM_STATE(m_properties)->Last(); int parenting = p->GetParentingType(); while ( parenting != 0 && ( allowSubprops || parenting >= PT_CAPTION ) ) { wxPGPropertyWithChildren* pwc = (wxPGPropertyWithChildren*)p; parenting = 0; if ( pwc->GetCount() ) { if ( (!need_visible || pwc->m_expanded) ) { p = pwc->Last(); parenting = p->GetParentingType(); } else parenting = 0; } } // If item was hidden and need_visible, get previous. if ( (m_iFlags & wxPG_FL_HIDE_STATE) && need_visible && p && ( p->m_flags & wxPG_PROP_HIDEABLE ) ) return GetNeighbourItem( p, need_visible, -1 ); return p; } // ----------------------------------------------------------------------- void wxPropertyGrid::SetButtonShortcut( int keycode, bool ctrlDown, bool altDown ) { if ( keycode ) { m_pushButKeyCode = keycode; m_pushButKeyCodeNeedsCtrl = ctrlDown ? 1 : 0; m_pushButKeyCodeNeedsAlt = altDown ? 1 : 0; } else { m_pushButKeyCode = WXK_DOWN; m_pushButKeyCodeNeedsCtrl = 0; m_pushButKeyCodeNeedsAlt = 1; } } // ----------------------------------------------------------------------- // Methods related to change in value, value modification and sending events // ----------------------------------------------------------------------- // commits any changes in editor of selected property // return true if validation did not fail // flags are same as with DoSelectProperty bool wxPropertyGrid::CommitChangesFromEditor( wxUint32 flags ) { if ( m_wndPrimary && IsEditorsValueModified() && (m_iFlags & wxPG_FL_INITIALIZED) ) { wxCHECK_MSG( m_selected, false, wxT("no selection") ); bool wasUnspecified = m_selected->IsValueUnspecified(); // JACS - necessary to avoid new focus being found spuriously within OnIdle // due to another window getting focus wxWindow* oldFocus = m_curFocused; if ( !(flags & (wxPG_SEL_NOVALIDATE|wxPG_SEL_FORCE)) && !DoEditorValidate() ) { if (oldFocus) { oldFocus->SetFocus(); m_curFocused = oldFocus; } return false; } // Save value (only if truly modified). if ( !m_selected->GetEditorClass()->CopyValueFromControl( m_selected, m_wndPrimary ) ) EditorsValueWasNotModified(); if ( m_selected->IsValueUnspecified() && !wasUnspecified && UsesAutoUnspecified() ) flags |= wxPG_SEL_SETUNSPEC; DoPropertyChanged( m_selected, flags ); return true; } return true; } // ----------------------------------------------------------------------- // flags are same as with DoSelectProperty void wxPropertyGrid::DoPropertyChanged( wxPGProperty* p, unsigned int selFlags ) { if ( m_processingEvent ) return; #if __INTENSE_DEBUGGING__ wxLogDebug(wxT("wxPropertyGrid::DoPropertyChanged( %s )"),p->GetLabel().c_str()); #endif m_pState->m_anyModified = 1; m_processingEvent = 1; // No longer unspecified (but not if the value was set to unspecified by // user modification) if ( !(selFlags & wxPG_SEL_SETUNSPEC) ) CLEAR_PROPERTY_UNSPECIFIED_FLAG(p); if ( m_iFlags & wxPG_FL_VALUE_MODIFIED ) { m_iFlags &= ~(wxPG_FL_VALUE_MODIFIED); // Set as Modified (not if dragging just began) if ( !(p->m_flags & wxPG_PROP_MODIFIED) ) { p->m_flags |= wxPG_PROP_MODIFIED; if ( p == m_selected && (m_windowStyle & wxPG_BOLD_MODIFIED) ) { if ( m_wndPrimary ) SetCurControlBoldFont(); } } wxPGProperty* curChild = p; wxPGPropertyWithChildren* curParent = p->m_parent; // Also update parent(s), if any // (but not if its wxCustomProperty) while ( curParent && curParent->GetParentingType() < 0 /*&& wxStrcmp(curParent->GetClassName(),wxT("wxCustomProperty")) != 0*/ ) { // Set as Modified if ( !(curParent->m_flags & wxPG_PROP_MODIFIED) ) { curParent->m_flags |= wxPG_PROP_MODIFIED; if ( curParent == m_selected && (m_windowStyle & wxPG_BOLD_MODIFIED) ) { if ( m_wndPrimary ) SetCurControlBoldFont(); } } curParent->ChildChanged( curChild ); DrawItem( curParent ); curChild = curParent; curParent = curParent->GetParent(); } // Draw the actual property if ( ( p != m_selected ) || !m_wndPrimary || ( p->GetParentingType() < 0 ) || ( p->m_flags & wxPG_PROP_CUSTOMIMAGE ) ) { DrawItemAndChildren( p ); } if ( curChild != p && !(selFlags & wxPG_SEL_SETUNSPEC) ) //m_pState->ClearPropertyAndChildrenFlags(curChild,wxPG_PROP_UNSPECIFIED); CLEAR_PROPERTY_UNSPECIFIED_FLAG(curChild); wxPGProperty* changedProperty; // Call wx event handler for property (or its topmost parent, but only // when dealing with legitemate sub-properties - see above). if ( curChild->GetParentingType() != PT_CUSTOMPROPERTY ) changedProperty = curChild; else changedProperty = p; // Maybe need to update control #if wxPG_REFRESH_CONTROLS_AFTER_REPAINT if ( m_wndPrimary ) m_wndPrimary->Refresh(); if ( m_wndSecondary ) m_wndSecondary->Refresh(); #endif SendEvent( wxEVT_PG_CHANGED, changedProperty, selFlags ); } m_processingEvent = 0; } // ----------------------------------------------------------------------- // Runs wxValidator for the selected property bool wxPropertyGrid::DoEditorValidate() { #if wxUSE_VALIDATORS if ( m_iFlags & wxPG_FL_VALIDATION_FAILED ) { return false; } wxWindow* wnd = GetEditorControl(); wxValidator* validator = m_selected->GetValidator(); if ( validator && wnd ) { // Use TextCtrl of ODComboBox instead if ( wnd->IsKindOf(CLASSINFO(wxPGOwnerDrawnComboBox)) ) { wnd = ((wxPGOwnerDrawnComboBox*)wnd)->GetTextCtrl(); if ( !wnd ) return true; } validator->SetWindow(wnd); // Instead setting the flag after the failure, we set // it before checking and then clear afterwards if things // went fine. This trick is necessary since focus events // may be triggered while in Validate. m_iFlags |= wxPG_FL_VALIDATION_FAILED; if ( !validator->Validate(this) ) { // If you dpm't want to display message multiple times per change, // comment the following line. m_iFlags &= ~(wxPG_FL_VALIDATION_FAILED); return false; } m_iFlags &= ~(wxPG_FL_VALIDATION_FAILED); } #endif return true; } // ----------------------------------------------------------------------- #if wxUSE_VALIDATORS bool wxPGInDialogValidator::DoValidate( wxPropertyGrid* propGrid, wxValidator* validator, const wxString& value ) { if ( !validator ) return true; wxTextCtrl* tc = m_textCtrl; if ( !tc ) { { tc = new wxTextCtrl( propGrid, wxPG_SUBID_TEMP1, wxEmptyString, wxPoint(30000,30000)); tc->Hide(); } m_textCtrl = tc; } //wxString oldValue = tc->GetValue(); tc->SetValue(value); validator->SetWindow(tc); bool res = validator->Validate(propGrid); //tc->SetValue(oldValue); return res; } #else bool wxPGInDialogValidator::DoValidate( wxPropertyGrid* WXUNUSED(propGrid), wxValidator* WXUNUSED(validator), const wxString& WXUNUSED(value) ) { return true; } #endif // ----------------------------------------------------------------------- // NB: It may really not be wxCommandEvent - must check if necessary // (usually not). void wxPropertyGrid::OnCustomEditorEvent( wxCommandEvent &event ) { wxPGProperty* selected = m_selected; // // Somehow, event is handled after property has been deselected. // Possibly, but very rare. if ( !selected ) return; bool wasUnspecified = selected->IsValueUnspecified(); bool usesAutoUnspecified = UsesAutoUnspecified(); wxWindow* wnd = m_wndPrimary; bool res1, res2; m_iFlags &= ~(wxPG_FL_VALIDATION_FAILED); // First call editor class' event handler. const wxPGEditor* editor = selected->GetEditorClass(); res1 = editor->OnEvent( this, selected, wnd, event ); if ( res1 ) { // If changes, validate them if ( DoEditorValidate() ) { if ( editor->CopyValueFromControl( selected, wnd ) ) { } else { // False alarm res1 = false; EditorsValueWasNotModified(); // However, even moot editing will clear the unspecified status if ( wasUnspecified || !usesAutoUnspecified ) CLEAR_PROPERTY_UNSPECIFIED_FLAG(selected); } } else { res1 = false; EditorsValueWasNotModified(); if ( wasUnspecified || !usesAutoUnspecified ) CLEAR_PROPERTY_UNSPECIFIED_FLAG(selected); return; } } // Then the property's custom handler (must be always called). res2 = selected->OnEvent( this, wnd, event ); if ( res1 || res2 ) { // Setting this is not required if res was true, so we do it now. m_iFlags |= wxPG_FL_VALUE_MODIFIED; int selFlags = ( !wasUnspecified && selected->IsValueUnspecified() && usesAutoUnspecified ) ? wxPG_SEL_SETUNSPEC : 0; DoPropertyChanged(selected, selFlags); } else // Let unhandled button click events go to the parent if ( event.GetEventType() == wxEVT_COMMAND_BUTTON_CLICKED ) { wxCommandEvent evt(wxEVT_COMMAND_BUTTON_CLICKED,GetId()); GetEventHandler()->AddPendingEvent(evt); } } // ----------------------------------------------------------------------- // When a property's value was modified internally (using SetValueFromString // or SetValueFromInt, for example), then this should be called afterwards. // NB: Avoid using this method, if possible. void wxPropertyGrid::PropertyWasModified( wxPGProperty* p, int selFlags ) { wxCHECK_RET( p, wxT("invalid property id") ); EditorsValueWasModified(); DoPropertyChanged(p, selFlags); } // ----------------------------------------------------------------------- // wxPropertyGrid editor control helper methods // ----------------------------------------------------------------------- wxWindow* wxPropertyGrid::GetEditorControl() const { wxWindow* ctrl = m_wndPrimary; if ( !ctrl ) return ctrl; // If it's clipper window, return its child instead #if wxPG_ENABLE_CLIPPER_WINDOW if ( ctrl->IsKindOf(CLASSINFO(wxPGClipperWindow)) ) { return ((wxPGClipperWindow*)ctrl)->GetControl(); } #endif return ctrl; } // ----------------------------------------------------------------------- // inline because it is used exactly once in the code inline wxRect wxPropertyGrid::GetEditorWidgetRect( wxPGProperty* p ) { //wxASSERT( p->m_y >= 0 ); // item is not visible int itemy = p->m_y; int vx,vy;// Top left corner of client GetViewStart(&vx,&vy); vy *= wxPG_PIXELS_PER_UNIT; int cust_img_space = 0; //m_iFlags &= ~(wxPG_FL_CUR_USES_CUSTOM_IMAGE); // TODO: If custom image detection changes from current, change this. if ( m_iFlags & wxPG_FL_CUR_USES_CUSTOM_IMAGE /*p->m_flags & wxPG_PROP_CUSTOMIMAGE*/ ) { //m_iFlags |= wxPG_FL_CUR_USES_CUSTOM_IMAGE; int imwid = p->GetImageSize().x; if ( imwid < 1 ) imwid = wxPG_CUSTOM_IMAGE_WIDTH; cust_img_space = imwid + wxCC_CUSTOM_IMAGE_MARGIN1 + wxCC_CUSTOM_IMAGE_MARGIN2; } return wxRect ( m_splitterx+cust_img_space+wxPG_XBEFOREWIDGET+wxPG_CONTROL_MARGIN+1, itemy-vy, m_width-m_splitterx-wxPG_XBEFOREWIDGET-wxPG_CONTROL_MARGIN-cust_img_space-1, m_lineHeight-1 ); } // ----------------------------------------------------------------------- // return size of custom paint image wxSize wxPropertyGrid::GetImageSize( wxPGId id ) const { if ( wxPGIdIsOk(id) ) { wxSize cis = wxPGIdToPtr(id)->GetImageSize(); if ( cis.x < 0 ) { if ( cis.x <= -1 ) cis.x = wxPG_CUSTOM_IMAGE_WIDTH; } if ( cis.y <= 0 ) { if ( cis.y >= -1 ) cis.y = wxPG_STD_CUST_IMAGE_HEIGHT(m_lineHeight); else cis.y = -cis.y; } return cis; } // If called with NULL property, then return default image // size for properties that use image. return wxSize(wxPG_CUSTOM_IMAGE_WIDTH,wxPG_STD_CUST_IMAGE_HEIGHT(m_lineHeight)); } // ----------------------------------------------------------------------- void wxPropertyGrid::CorrectEditorWidgetSizeX( int newSplitterx, int newWidth ) { wxASSERT( m_selected ); int secWid = 0; if ( m_wndSecondary ) { // if width change occurred, move secondary wnd by that amount wxRect r = m_wndSecondary->GetRect(); secWid = r.width; r.x = newWidth - secWid; //r.y += yAdj; m_wndSecondary->SetSize ( r ); // if primary is textctrl, then we have to add some extra space #ifdef __WXMAC__ if ( m_wndPrimary ) #else if ( m_wndPrimary && m_wndPrimary->IsKindOf(CLASSINFO(wxTextCtrl)) ) #endif secWid += wxPG_TEXTCTRL_AND_BUTTON_SPACING; } if ( m_wndPrimary ) { wxRect r = m_wndPrimary->GetRect(); r.x = newSplitterx+m_ctrlXAdjust; //r.y += yAdj; r.width = newWidth - r.x - secWid; m_wndPrimary->SetSize(r); } /* int sec_wid = 0; int vx, vy; GetViewStart(&vx,&vy); vy*=wxPG_PIXELS_PER_UNIT; int propY = m_selected->m_y - vy; if ( m_wndSecondary ) { // if width change occurred, move secondary wnd by that amount wxRect r = m_wndSecondary->GetRect(); int adjust = r.y % wxPG_PIXELS_PER_UNIT; if ( adjust > (wxPG_PIXELS_PER_UNIT/2) ) adjust = adjust - wxPG_PIXELS_PER_UNIT; int y = propY + adjust; sec_wid = r.width; m_wndSecondary->Move ( new_width-r.width,y ); // if primary is textctrl, then we have to add some extra space if ( m_wndPrimary && m_wndPrimary->IsKindOf(CLASSINFO(wxTextCtrl)) ) sec_wid += wxPG_TEXTCTRL_AND_BUTTON_SPACING; } if ( m_wndPrimary ) { wxRect r = m_wndPrimary->GetRect(); int adjust = r.y % wxPG_PIXELS_PER_UNIT; if ( adjust > (wxPG_PIXELS_PER_UNIT/2) ) adjust = adjust - wxPG_PIXELS_PER_UNIT; wxLogDebug(wxT("adjust: %i"),adjust); int y = propY + adjust; m_wndPrimary->SetSize( new_splitterx+m_ctrlXAdjust, y, new_width-(new_splitterx+m_ctrlXAdjust)-sec_wid, r.height ); } */ if ( m_wndSecondary ) m_wndSecondary->Refresh(); } // ----------------------------------------------------------------------- /*void wxPropertyGrid::CorrectEditorWidgetSizeY( int cy ) { if ( m_selected ) { wxPoint cp(0,cy); if ( m_wndPrimary ) m_wndPrimary->Move ( m_wndPrimary->GetPosition() + cp ); if ( m_wndSecondary ) m_wndSecondary->Move ( m_wndSecondary->GetPosition() + cp ); } }*/ // ----------------------------------------------------------------------- // takes scrolling into account void wxPropertyGrid::ImprovedClientToScreen( int* px, int* py ) { int vx, vy; GetViewStart(&vx,&vy); vy*=wxPG_PIXELS_PER_UNIT; vx*=wxPG_PIXELS_PER_UNIT; *px -= vx; *py -= vy; ClientToScreen ( px, py ); } // ----------------------------------------------------------------------- // custom set cursor void wxPropertyGrid::CustomSetCursor( int type, bool override ) { if ( type == m_curcursor && !override ) return; wxCursor* cursor = &wxPG_DEFAULT_CURSOR; if ( type == wxCURSOR_SIZEWE ) cursor = m_cursorSizeWE; SetCursor ( *cursor ); //if ( m_wndPrimary ) m_wndPrimary->SetCursor(wxNullCursor); m_curcursor = type; } // ----------------------------------------------------------------------- // wxPropertyGrid property selection // ----------------------------------------------------------------------- #define CONNECT_CHILD(EVT,FUNCTYPE,FUNC) \ wnd->Connect(id, EVT, \ (wxObjectEventFunction) (wxEventFunction) \ FUNCTYPE (&wxPropertyGrid::FUNC), \ NULL, this ); /* class MyEvtHandler : public wxEvtHandler { public: virtual bool ProcessEvent( wxEvent& event ) { if ( event.GetEventType() == wxEVT_NAVIGATION_KEY ) wxLogDebug(wxT("wxEVT_NAVIGATION_KEY(id=%i)"),event.GetId()); else if ( event.GetEventType() == wxEVT_KEY_DOWN ) wxLogDebug(wxT("wxEVT_KEY_DOWN")); event.Skip(); return wxEvtHandler::ProcessEvent(event); } }; */ // Setups event handling for child control void wxPropertyGrid::SetupEventHandling( wxWindow* argWnd, int id ) { wxWindow* wnd = argWnd; #if wxPG_ENABLE_CLIPPER_WINDOW // Pass real control instead of clipper window if ( wnd->IsKindOf(CLASSINFO(wxPGClipperWindow)) ) { wnd = ((wxPGClipperWindow*)argWnd)->GetControl(); } #endif if ( argWnd == m_wndPrimary ) { CONNECT_CHILD(wxEVT_MOTION,(wxMouseEventFunction),OnMouseMoveChild) CONNECT_CHILD(wxEVT_LEFT_UP,(wxMouseEventFunction),OnMouseUpChild) CONNECT_CHILD(wxEVT_LEFT_DOWN,(wxMouseEventFunction),OnMouseClickChild) //CONNECT_CHILD(wxEVT_LEFT_DCLICK,(wxMouseEventFunction),OnMouseClickChild) CONNECT_CHILD(wxEVT_RIGHT_UP,(wxMouseEventFunction),OnMouseRightClickChild) CONNECT_CHILD(wxEVT_ENTER_WINDOW,(wxMouseEventFunction),OnMouseEntry) CONNECT_CHILD(wxEVT_LEAVE_WINDOW,(wxMouseEventFunction),OnMouseEntry) } else { CONNECT_CHILD(wxEVT_NAVIGATION_KEY,(wxNavigationKeyEventFunction),OnNavigationKey) } CONNECT_CHILD(wxEVT_KEY_DOWN,(wxCharEventFunction),OnChildKeyDown) CONNECT_CHILD(wxEVT_KEY_UP,(wxCharEventFunction),OnChildKeyUp) CONNECT_CHILD(wxEVT_KILL_FOCUS,(wxFocusEventFunction),OnFocusEvent) } void wxPropertyGrid::FreeEditors() { // Do not free editors immediately if processing events if ( !m_windowsToDelete ) m_windowsToDelete = new wxArrayPtrVoid; if ( m_wndSecondary ) { m_windowsToDelete->push_back(m_wndSecondary); m_wndSecondary->Hide(); m_wndSecondary = (wxWindow*) NULL; } if ( m_wndPrimary ) { m_windowsToDelete->push_back(m_wndPrimary); m_wndPrimary->Hide(); m_wndPrimary = (wxWindow*) NULL; } } // Call with NULL to de-select property bool wxPropertyGrid::DoSelectProperty( wxPGProperty* p, unsigned int flags ) { #if __INTENSE_DEBUGGING__ if (p) wxLogDebug(wxT("SelectProperty( %s (%s[%i]) )"),p->m_label.c_str(), p->m_parent->m_label.c_str(),p->GetIndexInParent()); else wxLogDebug(wxT("SelectProperty( NULL, -1 )")); #endif // // Delete windows pending for deletion if ( m_windowsToDelete && !m_processingEvent && m_windowsToDelete->size() ) { unsigned int i; for ( i=0; isize(); i++ ) delete ((wxWindow*)((*m_windowsToDelete)[i])); m_windowsToDelete->clear(); } wxPGProperty* prev = m_selected; // // If we are frozen, then just set the values. if ( m_frozen ) { m_iFlags &= ~(wxPG_FL_ABNORMAL_EDITOR); m_editorFocused = 0; m_selected = p; FROM_STATE(m_selected) = p; // If frozen, always free controls. But don't worry, as Thaw will // recall SelectProperty to recreate them. FreeEditors(); // Prevent any further selection measures in this call p = (wxPGProperty*) NULL; } else { // Is it the same? if ( m_selected == p && !(flags & wxPG_SEL_FORCE) ) { // Only set focus if not deselecting if ( p ) { if ( flags & wxPG_SEL_FOCUS ) { if ( m_wndPrimary ) { m_wndPrimary->SetFocus(); m_editorFocused = 1; } } else { wxScrolledWindow::SetFocus(); m_editorFocused = 0; } } return true; } wxClientDC dc(this); PrepareDC(dc); // Don't put this earlier, due to return statements m_iFlags |= wxPG_FL_IN_SELECT_PROPERTY; // // First, deactivate previous if ( m_selected ) { #if __INTENSE_DEBUGGING__ wxLogDebug(wxT(" (closing previous (%s))"), m_selected->m_label.c_str() ); #endif // Must double-check if this is an selected in case of forceswitch if ( p != prev ) { if ( !CommitChangesFromEditor(flags) ) { // Validation has failed, so we can't exit the previous editor //::wxMessageBox(_("Please correct the value or press ESC to cancel the edit."), // _("Invalid Value"),wxOK|wxICON_ERROR); return false; } } FreeEditors(); m_iFlags &= ~(wxPG_FL_SELECTED_IS_PAINT_FLEXIBLE|wxPG_FL_SELECTED_IS_FULL_PAINT); m_selected = (wxPGProperty*) NULL; FROM_STATE(m_selected) = (wxPGProperty*) NULL; // Make sure the previous selection is refreshed // JACS: must use paint handler whenever possible Refresh(false); /*if ( m_iFlags & wxPG_FL_ABNORMAL_EDITOR ) Refresh(false); else if ( prev->m_y < (int)m_bottomy ) DoDrawItems( dc, prev, prev, NULL ); */ m_iFlags &= ~(wxPG_FL_VALUE_MODIFIED|wxPG_FL_ABNORMAL_EDITOR); } // // Then, activate the one given. if ( p ) { m_editorFocused = 0; m_selected = p; FROM_STATE(m_selected) = p; m_iFlags |= wxPG_FL_PRIMARY_FILLS_ENTIRE; if ( p != prev ) m_iFlags &= ~(wxPG_FL_VALIDATION_FAILED); //m_wndPrimary = (wxWindow*) NULL; wxASSERT( m_wndPrimary == (wxWindow*) NULL ); // Do we need OnMeasureCalls? wxSize imsz = p->GetImageSize(); if ( imsz.y < -1 ) m_iFlags |= wxPG_FL_SELECTED_IS_PAINT_FLEXIBLE; // Is the entire cell/row custom painted? if ( imsz.x == wxPG_FULL_CUSTOM_PAINT_WIDTH ) m_iFlags |= wxPG_FL_SELECTED_IS_FULL_PAINT; // // Only create editor for non-disabled non-caption if ( p->GetParentingType() <= 0 && !(p->m_flags & wxPG_PROP_DISABLED) ) { // do this for non-caption items // Do we need to paint the custom image, if any? m_iFlags &= ~(wxPG_FL_CUR_USES_CUSTOM_IMAGE); if ( (p->m_flags & wxPG_PROP_CUSTOMIMAGE) && !p->GetEditorClass()->CanContainCustomImage() ) m_iFlags |= wxPG_FL_CUR_USES_CUSTOM_IMAGE; wxRect grect = GetEditorWidgetRect(p); wxPoint good_pos = grect.GetPosition(); #if wxPG_CREATE_CONTROLS_HIDDEN int coord_adjust = m_height - good_pos.y; good_pos.y += coord_adjust; #endif const wxPGEditor* editor = p->GetEditorClass(); wxCHECK_MSG(editor, false, wxT("NULL editor class not allowed")); #ifndef __WXPYTHON__ m_wndPrimary = editor->CreateControls(this, p, good_pos, grect.GetSize(), &m_wndSecondary); #else wxPGWindowPair wndPair = editor->CreateControls(this, p, good_pos, grect.GetSize()); m_wndPrimary = wndPair.m_primary; m_wndSecondary = wndPair.m_secondary; #endif // NOTE: It is allowed for m_wndPrimary to be NULL - in this case // value is drawn as normal, and m_wndSecondary is assumed // to be a right-aligned button that triggers a separate editor // window. if ( m_wndPrimary ) { //wxLogDebug(wxT("%s Editor created for %s"),editor->GetName(),p->GetName().c_str()); // Set validator, if any /*#if wxUSE_VALIDATORS if ( validator ) m_wndPrimary->SetValidator(*validator); #endif*/ if ( m_wndPrimary->GetSize().y > (m_lineHeight+6) ) m_iFlags |= wxPG_FL_ABNORMAL_EDITOR; // If it has modified status, use bold font // (must be done before capturing m_ctrlXAdjust) if ( (p->m_flags & wxPG_PROP_MODIFIED) && (m_windowStyle & wxPG_BOLD_MODIFIED) ) SetCurControlBoldFont(); // // Fix TextCtrl indentation #if defined(__WXMSW__) && !defined(__WXWINCE__) wxTextCtrl* tc = wxDynamicCast(m_wndPrimary, wxTextCtrl); if ( tc ) ::SendMessage(GetHwndOf(tc), EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELONG(0, 0)); #endif // Store x relative to splitter (we'll need it). m_ctrlXAdjust = m_wndPrimary->GetPosition().x - m_splitterx; // Check if background clear is not necessary wxPoint pos = m_wndPrimary->GetPosition(); if ( pos.x > (m_splitterx+1) || pos.y > p->m_y ) { m_iFlags &= ~(wxPG_FL_PRIMARY_FILLS_ENTIRE); } m_wndPrimary->SetSizeHints(3,3); #if wxPG_CREATE_CONTROLS_HIDDEN m_wndPrimary->Show(false); m_wndPrimary->Freeze(); good_pos = m_wndPrimary->GetPosition(); good_pos.y -= coord_adjust; m_wndPrimary->Move( good_pos ); #endif SetupEventHandling(m_wndPrimary, wxPG_SUBID1); // Focus and select all (wxTextCtrl, wxComboBox etc) if ( flags & wxPG_SEL_FOCUS ) { wxWindow* ctrl = m_wndPrimary; ctrl->SetFocus(); #if wxPG_NAT_TEXTCTRL_BORDER_ANY // Take into account textctrl in clipper window if ( ctrl->IsKindOf(CLASSINFO(wxPGClipperWindow)) ) ctrl = ((wxPGClipperWindow*)ctrl)->GetControl(); #endif p->GetEditorClass()->OnFocus(p,m_wndPrimary); } } if ( m_wndSecondary ) { m_wndSecondary->SetSizeHints(3,3); #if wxPG_CREATE_CONTROLS_HIDDEN wxRect sec_rect = m_wndSecondary->GetRect(); sec_rect.y -= coord_adjust; // Fine tuning required to fix "oversized" // button disappearance bug. if ( sec_rect.y < 0 ) { sec_rect.height += sec_rect.y; sec_rect.y = 0; } m_wndSecondary->SetSize( sec_rect ); #endif m_wndSecondary->Show(); SetupEventHandling(m_wndSecondary,wxPG_SUBID2); // If no primary editor, focus to button to allow // it to interprete ENTER etc. // NOTE: Due to problems focusing away from it, this // has been disabled. /* if ( (flags & wxPG_SEL_FOCUS) && !m_wndPrimary ) m_wndSecondary->SetFocus(); */ } if ( flags & wxPG_SEL_FOCUS ) m_editorFocused = 1; } else { // wxGTK atleast seems to need this (wxMSW not) SetFocus(); } m_iFlags &= ~(wxPG_FL_VALUE_MODIFIED); //Update(); // If it's inside collapsed section, expand parent, scroll, etc. // Also, if it was partially visible, scroll it into view. int vx, vy; GetViewStart(&vx,&vy); vy*=wxPG_PIXELS_PER_UNIT; int vy2 = vy + m_height; if ( (p->m_y < vy || (p->m_y <= vy2 && (p->m_y+m_lineHeight) > vy2)) && !(flags & wxPG_SEL_NONVISIBLE) ) EnsureVisible( wxPGIdGen(p) ); if ( m_wndPrimary ) { // Clear its background // (why can't this be optimized by some other drawing?) if ( !(m_iFlags & wxPG_FL_PRIMARY_FILLS_ENTIRE) ) { dc.SetPen(*wxTRANSPARENT_PEN); dc.SetBrush( wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW) ); dc.DrawRectangle(m_splitterx+1,p->m_y, m_width-m_splitterx,m_lineHeight-1); } #if wxPG_CREATE_CONTROLS_HIDDEN m_wndPrimary->Thaw(); #endif m_wndPrimary->Show(true); } DoDrawItems( dc, p, p, (const wxRect*) NULL ); } } #if wxUSE_STATUSBAR // // Show help text in status bar. // (if found and grid not embedded in manager with help box and // style wxPG_EX_HELP_AS_TOOLTIPS is not used). // if ( !(GetExtraStyle() & wxPG_EX_HELP_AS_TOOLTIPS) ) { wxStatusBar* statusbar = (wxStatusBar*) NULL; if ( !(m_iFlags & wxPG_FL_NOSTATUSBARHELP) ) { wxFrame* frame = wxDynamicCast(::wxGetTopLevelParent(this),wxFrame); if ( frame ) statusbar = frame->GetStatusBar(); } if ( statusbar ) { const wxString* pHelpString = (const wxString*) NULL; if ( p && p->m_dataExt ) { pHelpString = &p->m_dataExt->m_helpString; if ( pHelpString->length() ) { // Set help box text. statusbar->SetStatusText( *pHelpString ); m_iFlags |= wxPG_FL_STRING_IN_STATUSBAR; } } if ( (!pHelpString || !pHelpString->length()) && (m_iFlags & wxPG_FL_STRING_IN_STATUSBAR) ) { // Clear help box - but only if it was written // by us at previous time. statusbar->SetStatusText( m_emptyString ); m_iFlags &= ~(wxPG_FL_STRING_IN_STATUSBAR); } } } #endif m_iFlags &= ~(wxPG_FL_IN_SELECT_PROPERTY); // call wx event handler (here so that it also occurs on deselection) SendEvent( wxEVT_PG_SELECTED, m_selected, flags ); return true; } // ----------------------------------------------------------------------- // This method is not inline because it called dozens of times // (i.e. two-arg function calls create smaller code size). bool wxPropertyGrid::ClearSelection() { return DoSelectProperty((wxPGProperty*)NULL); } // ----------------------------------------------------------------------- // wxPropertyGrid expand/collapse state and priority (compact mode) related // ----------------------------------------------------------------------- bool wxPropertyGrid::_Collapse( wxPGProperty* p, bool sendEvents ) { wxCHECK_MSG( p, false, wxT("invalid property id") ); wxPGPropertyWithChildren* pwc = (wxPGPropertyWithChildren*)p; if ( pwc->GetParentingType() == 0 ) return false; if ( !pwc->m_expanded ) return false; // If active editor was inside collapsed section, then disable it if ( m_selected && m_selected->IsSomeParent (p) ) { if ( !ClearSelection() ) return false; } // Store dont-center-splitter flag 'cause we need to temporarily set it wxUint32 old_flag = m_iFlags & wxPG_FL_DONT_CENTER_SPLITTER; m_iFlags |= wxPG_FL_DONT_CENTER_SPLITTER; // m_expanded must be set just before call to CalculateYs pwc->m_expanded = 0; // Redraw etc. only if collapsed was visible. if (pwc->m_y >= 0 && !m_frozen && ( pwc->GetParentingType() != 1 || !(m_windowStyle & wxPG_HIDE_CATEGORIES) ) ) { /*int y_adjust = 0; if ( m_selected && m_selected->m_y > pwc->m_y ) { wxPGProperty* next_vis = GetNeighbourItem(pwc,true,1); wxASSERT( next_vis ); y_adjust = next_vis->m_y - pwc->m_y - m_lineHeight; }*/ CalculateYs( pwc->m_parent, pwc->m_arrIndex ); // Fix control position. /*if ( y_adjust ) CorrectEditorWidgetSizeY ( -y_adjust );*/ // When item is collapsed so that scrollbar would move, // graphics mess is about (unless we redraw everything). Refresh(); } // Clear dont-center-splitter flag if it wasn't set m_iFlags = m_iFlags & ~(wxPG_FL_DONT_CENTER_SPLITTER) | old_flag; if ( sendEvents ) SendEvent( wxEVT_PG_ITEM_COLLAPSED, p ); return true; } // ----------------------------------------------------------------------- bool wxPropertyGrid::_Expand( wxPGProperty* p, bool sendEvents ) { wxCHECK_MSG( p, false, wxT("invalid property id") ); wxPGPropertyWithChildren* pwc = (wxPGPropertyWithChildren*)p; if ( pwc->GetParentingType() == 0 ) return false; if ( pwc->m_expanded ) return false; // Store dont-center-splitter flag 'cause we need to temporarily set it wxUint32 old_flag = m_iFlags & wxPG_FL_DONT_CENTER_SPLITTER; m_iFlags |= wxPG_FL_DONT_CENTER_SPLITTER; // m_expanded must be set just before call to CalculateYs pwc->m_expanded = 1; // Redraw etc. only if expanded was visible. if ( pwc->m_y >= 0 && !m_frozen && ( pwc->GetParentingType() != 1 || !(m_windowStyle & wxPG_HIDE_CATEGORIES) ) ) { CalculateYs( pwc->m_parent, pwc->m_arrIndex ); /*int y_adjust = pwc->GetCount()*m_lineHeight; // Fix widget position as well if ( m_selected && m_selected->m_y > pwc->m_y ) CorrectEditorWidgetSizeY ( y_adjust );*/ // Redraw #if wxPG_REFRESH_CONTROLS_AFTER_REPAINT Refresh(); #else //wxPG_CLIENT_DC_INIT_R(true) //DrawItems( dc, pwc->m_y, m_bottomy ); DrawItems(pwc,(wxPGProperty*) NULL); #endif } // Clear dont-center-splitter flag if it wasn't set m_iFlags = m_iFlags & ~(wxPG_FL_DONT_CENTER_SPLITTER) | old_flag; if ( sendEvents ) SendEvent( wxEVT_PG_ITEM_EXPANDED, p ); return true; } // ----------------------------------------------------------------------- bool wxPropertyGrid::Compact( bool compact ) { #if __INTENSE_DEBUGGING__ wxLogDebug( wxT("wxPropertyGrid::Compact()") ); #endif if ( compact ) { if ( !(m_iFlags & wxPG_FL_HIDE_STATE) ) { // Deselect selected if it was hideable if ( m_selected && ( m_selected->m_flags & wxPG_PROP_HIDEABLE ) ) { if ( !ClearSelection() ) return false; } m_iFlags |= wxPG_FL_HIDE_STATE; if ( !m_frozen ) { CalculateYs( NULL, -1 ); RedrawAllVisible(); } } } else { if ( m_iFlags & wxPG_FL_HIDE_STATE ) { m_iFlags &= ~(wxPG_FL_HIDE_STATE); if ( !m_frozen ) { CalculateYs( NULL, -1 ); RedrawAllVisible(); } } } return true; } // ----------------------------------------------------------------------- // Used by HideProperty as well bool wxPropertyGrid::SetPropertyPriority( wxPGProperty* p, int priority ) { /* // Old code (Commented Aug-09-2007) if ( m_frozen ) return m_pState->SetPropertyPriority(p,priority); if ( (m_iFlags & wxPG_FL_HIDE_STATE) && m_selected && ( m_selected == p || m_selected->IsSomeParent(p) ) ) { if ( !ClearSelection() ) return false; } m_pState->SetPropertyPriority(p,priority); if ( m_iFlags & wxPG_FL_HIDE_STATE ) { CalculateYs(NULL,-1); RedrawAllVisible(); } return true; */ // Stefan Battmer: // Changed in a way that this update is only forced when the // properties new priority actually differs from the current // priority to improve update speed if ( p ) { int oldPriority = ( p->IsFlagSet(wxPG_PROP_HIDEABLE) ) ? wxPG_LOW : wxPG_HIGH; if( oldPriority != priority ) { if ( m_frozen ) return m_pState->SetPropertyPriority(p,priority); if ( (m_iFlags & wxPG_FL_HIDE_STATE) && m_selected && ( m_selected == p || m_selected->IsSomeParent(p) ) ) { if ( !ClearSelection() ) return false; } m_pState->SetPropertyPriority(p,priority); if ( m_iFlags & wxPG_FL_HIDE_STATE ) { CalculateYs(NULL,-1); RedrawAllVisible(); } return true; } } return false; } // ----------------------------------------------------------------------- // wxPropertyGrid size related methods // ----------------------------------------------------------------------- // This is called by CalculateYs (so those calling it won't need to call this) void wxPropertyGrid::RecalculateVirtualSize() { int x = m_width; int y = m_bottomy; //SetClientSize(x,y); // Now adjust virtual size. SetVirtualSize(x, y); PGAdjustScrollbars(y); // // FIXME: Is this really needed? I mean, can't OnResize handle this? int width, height; GetClientSize(&width,&height); if ( m_selected && width != m_width ) { CorrectEditorWidgetSizeX( m_splitterx, width ); } m_width = width; m_height = height; } // ----------------------------------------------------------------------- void wxPropertyGrid::PGAdjustScrollbars( int y ) { // Adjust scrollbars. y += wxPG_PIXELS_PER_UNIT+2; // One more scrollbar unit + 2 pixels. int y_amount = y/wxPG_PIXELS_PER_UNIT; int y_pos = GetScrollPos( wxVERTICAL ); SetScrollbars( 0, wxPG_PIXELS_PER_UNIT, 0, y_amount, 0, y_pos, true ); } // ----------------------------------------------------------------------- /* bool wxPropertyGrid::DetectScrollbar() { // Call at every time scrollbar may have appeared/disappeared // Returns true if scrollbar was toggled bool toggled = false; // Use functions instead of m_width for total independence wxCoord width = GetSize().x; wxCoord cwidth = GetClientSize().x; if ( abs(width-cwidth) >= wxPG_MIN_SCROLLBAR_WIDTH ) { // There is a scrollbar. if ( !(m_iFlags & wxPG_FL_SCROLLBAR_DETECTED) ) { //wxLogDebug(wxT("Scrollbar Appeared")); toggled = true; m_iFlags |= wxPG_FL_SCROLLBAR_DETECTED; } } else if ( m_iFlags & wxPG_FL_SCROLLBAR_DETECTED ) { //wxLogDebug(wxT("Scrollbar Disappeared")); toggled = true; m_iFlags &= ~(wxPG_FL_SCROLLBAR_DETECTED); } return toggled; } */ void wxPropertyGrid::OnResize( wxSizeEvent& event ) { if ( !(m_iFlags & wxPG_FL_INITIALIZED) ) return; if ( FROM_STATE(m_itemsAdded) && !m_frozen ) PrepareAfterItemsAdded(); int width, height; GetClientSize(&width,&height); #if __INTENSE_DEBUGGING__ wxLogDebug(wxT("wxPropertyGrid::OnResize ( %i, %i )"),width,height); #endif //int old_width = m_width; //int old_height = m_height; int old_fwidth = m_fWidth; // non-client width int old_splitterx = m_splitterx; int fwidth = event.GetSize().x; m_fWidth = fwidth; m_width = width; m_height = height; int widthDiff = fwidth - old_fwidth; #if wxPG_DOUBLE_BUFFER if ( !(GetExtraStyle() & wxPG_EX_NATIVE_DOUBLE_BUFFERING) ) { int dblh = (m_lineHeight*2); if ( !m_doubleBuffer ) { // Create double buffer bitmap to draw on, if none int w = (width>250)?width:250; int h = height + dblh; h = (h>400)?h:400; m_doubleBuffer = new wxBitmap ( w, h ); } else { int w = m_doubleBuffer->GetWidth(); int h = m_doubleBuffer->GetHeight(); // Double buffer must be large enough if ( w < width || h < (height+dblh) ) { if ( w < width ) w = width; if ( h < (height+dblh) ) h = height + dblh; delete m_doubleBuffer; m_doubleBuffer = new wxBitmap ( w, h ); } } } // Consider full update on every resize //m_iFlags |= wxPG_FL_CHANGED; #endif // // Center splitter when... // * always when propGrid not shown yet or its full size is not realized yet // and then only if splitter's position was not pre-set // * auto-centering is enabled and scrollbar was not toggled // // Need to center splitter? //if ( width!=old_width ) { bool needSplitterCheck = true; //if ( !sb_vis_toggled ) { if ( m_windowStyle & wxPG_SPLITTER_AUTO_CENTER ) { float centerX = float(width) * 0.5; float splitterX = m_fSplitterX + (float(widthDiff) * 0.5); float deviation = fabs(centerX - splitterX); //wxLogDebug(wxT("deviation: %.1f"),deviation); // If deviated too far from the center, reset it if ( deviation > 30.0 ) splitterX = centerX; DoSetSplitterPosition( (int)splitterX, false ); m_fSplitterX = splitterX; // needed to retain accuracy needSplitterCheck = false; } else if ( !(m_iFlags & wxPG_FL_SPLITTER_PRE_SET) ) { long timeSinceCreation = (::wxGetLocalTimeMillis() - m_timeCreated).ToLong(); if ( m_pState->m_properties->GetCount() || timeSinceCreation > 750 ) { SetSplitterLeft( false ); needSplitterCheck = false; } else { DoSetSplitterPosition( width / 2, false ); m_iFlags &= ~(wxPG_FL_SPLITTER_PRE_SET); needSplitterCheck = false; } } } if ( needSplitterCheck && (m_splitterx + wxPG_DRAG_MARGIN) > width ) { long timeSinceCreation = (::wxGetLocalTimeMillis() - m_timeCreated).ToLong(); if ( timeSinceCreation >= 750 ) { DoSetSplitterPosition( width - wxPG_DRAG_MARGIN - 1, false ); } } } // Need to correct widget position? if ( m_selected /*&& (width != old_width || sb_vis_toggled)*/ ) { // Take splitter position change into account CorrectEditorWidgetSizeX( m_splitterx, width ); } if ( !m_frozen ) { // Need to recalculate visibles array? //if ( height != old_height ) if ( height > m_calcVisHeight ) CalculateVisibles( -1, false ); /*if ( sb_vis_toggled ) { Refresh(); } else*/ if ( m_splitterx != old_splitterx ) { Refresh(); /*if ( abs(height-old_height) < 100 ) { Update(); // Necessary, atleast on wxMSW RedrawAllVisible(); } else { Refresh(); }*/ } } // Without this, virtual size (atleast under wxGTK) will be skewed RecalculateVirtualSize(); } // ----------------------------------------------------------------------- // wxPropertyGrid mouse event handling // ----------------------------------------------------------------------- // selFlags uses same values DoSelectProperty's flags void wxPropertyGrid::SendEvent( int eventType, wxPGProperty* p, unsigned int selFlags ) { // Send property grid event of specific type and with specific property wxPropertyGridEvent evt( eventType, GetId() ); evt.SetPropertyGrid(this); evt.SetEventObject(m_eventObject); evt.SetProperty(p); wxEvtHandler* evtHandler = GetEventHandler(); // Always need to process event immediately if the property in question is // about to be deleted. if ( (selFlags & wxPG_SEL_DELETING) || (GetExtraStyle() & wxPG_EX_PROCESS_EVENTS_IMMEDIATELY) ) { evtHandler->ProcessEvent(evt); } else { evt.SetPending(true); evtHandler->AddPendingEvent(evt); } } // ----------------------------------------------------------------------- // Return false if should be skipped bool wxPropertyGrid::HandleMouseClick( int x, unsigned int y, wxMouseEvent &event ) { bool res = true; #if __MOUSE_DEBUGGING__ wxLogDebug( wxT(" \\--> HandleMouseClick") ); #endif // Need to set focus? if ( !(m_iFlags & wxPG_FL_FOCUSED) ) { SetFocus(); } if ( y < m_bottomy ) { wxPGProperty* p = DoGetItemAtY(y); if ( p ) { int parenting = p->GetParentingType(); int depth = (int)p->GetDepth() - 1; int marginEnds = m_marginWidth + ( depth * m_subgroup_extramargin ); if ( x >= marginEnds ) { // Outside margin. if ( parenting > 0 ) { // This is category. wxPropertyCategoryClass* pwc = (wxPropertyCategoryClass*)p; int text_x = m_marginWidth + ((unsigned int)((pwc->m_depth-1)*m_subgroup_extramargin)); // Expand, collapse, activate etc. if click on text or left of splitter. if ( x >= text_x && ( x < (text_x+pwc->GetTextExtent()+(wxPG_CAPRECTXMARGIN*2)) || x < m_splitterx ) ) { if ( !DoSelectProperty( p ) ) return res; // On double-click, expand/collapse. if ( event.ButtonDClick() && !(m_windowStyle & wxPG_HIDE_MARGIN) ) { if ( pwc->m_expanded ) _Collapse ( p, true ); else _Expand ( p, true ); } } } else if ( x > (m_splitterx + wxPG_SPLITTERX_DETECTMARGIN2) || x < (m_splitterx - wxPG_SPLITTERX_DETECTMARGIN1) ) { // Click on value. unsigned int selFlag = 0; if ( x > m_splitterx ) { m_iFlags |= wxPG_FL_ACTIVATION_BY_CLICK; selFlag = wxPG_SEL_FOCUS; } if ( !DoSelectProperty( p, selFlag ) ) return res; m_iFlags &= ~(wxPG_FL_ACTIVATION_BY_CLICK); if ( p->GetParentingType() < 0 ) // On double-click, expand/collapse. if ( event.ButtonDClick() && !(m_windowStyle & wxPG_HIDE_MARGIN) ) { wxPGPropertyWithChildren* pwc = (wxPGPropertyWithChildren*)p; if ( pwc->m_expanded ) _Collapse ( p, true ); else _Expand ( p, true ); } res = false; } else { // click on splitter if ( !(m_windowStyle & wxPG_STATIC_SPLITTER) ) { if ( event.GetEventType() == wxEVT_LEFT_DCLICK ) { // Double-clicking the splitter causes auto-centering CenterSplitter( true ); // TODO: Would this be more natural? // .NET grid doesn't do it but maybe we should. //CustomSetCursor ( wxCURSOR_ARROW ); } else if ( m_dragStatus == 0 ) { // // Begin draggin the splitter // #if __MOUSE_DEBUGGING__ wxLogDebug( wxT(" dragging begins at splitter + %i"), (int)(x - m_splitterx) ); #endif if ( m_wndPrimary ) { // Changes must be committed here or the // value won't be drawn correctly if ( !CommitChangesFromEditor() ) return res; m_wndPrimary->Show ( false ); } BEGIN_MOUSE_CAPTURE m_dragStatus = 1; m_dragOffset = x - m_splitterx; wxPG_CLIENT_DC_INIT() #if wxPG_REFRESH_CONTROLS_AFTER_REPAINT // Fixes button disappearance bug if ( m_wndSecondary ) m_wndSecondary->Show ( false ); #endif m_startingSplitterX = m_splitterx; #if wxPG_HEAVY_GFX #else Update(); // clear graphics mess DrawSplitterDragColumn( dc, m_splitterx ); m_splitterprevdrawnx = m_splitterx; #endif } } } } else { // Click on margin. if ( parenting != 0 ) { int nx = x + m_marginWidth - marginEnds; // Normalize x. if ( (nx >= m_gutterWidth && nx < (m_gutterWidth+m_iconWidth)) ) { int y2 = y - p->m_y; if ( (y2 >= m_buttonSpacingY && y2 < (m_buttonSpacingY+m_iconHeight)) ) { // On click on expander button, expand/collapse if ( ((wxPGPropertyWithChildren*)p)->m_expanded ) _Collapse ( p, true ); else _Expand ( p, true ); } } } } } } return res; } // ----------------------------------------------------------------------- bool wxPropertyGrid::HandleMouseRightClick( int WXUNUSED(x), unsigned int y, wxMouseEvent& WXUNUSED(event) ) { if ( y < m_bottomy ) { // Select property here as well wxPGProperty* p = m_propHover; if ( p != m_selected ) DoSelectProperty( p ); // Send right click event. SendEvent( wxEVT_PG_RIGHT_CLICK, p ); return true; } return false; } // ----------------------------------------------------------------------- bool wxPropertyGrid::HandleMouseDoubleClick( int WXUNUSED(x), unsigned int y, wxMouseEvent& WXUNUSED(event) ) { if ( y < m_bottomy ) { // Select property here as well wxPGProperty* p = m_propHover; if ( p != m_selected ) DoSelectProperty( p ); // Send double-click event. SendEvent( wxEVT_PG_DOUBLE_CLICK, m_propHover ); return true; } return false; } // ----------------------------------------------------------------------- /* // Splits text into lines so that each will have width less than arg maxWidth. // * Returns string with line breaks inserted into appropriate positions. // * Keeps words together. // * Useful in conjunction with wxWindow::SetToolTip and wxDC::DrawLabel. static wxString SplitTextByPixelWidth(wxDC& dc, const wxString& text, int lineWidth) { if ( !text.length() ) return text; wxString resultLine; wxArrayInt extents; unsigned int index = 0; unsigned int maxIndex = text.length() - 1; unsigned int prevSplitIndex = 0; unsigned int prevCanSplitIndex = 0; int lineCheckWidth = lineWidth; wxChar prevA = wxT('\0'); dc.GetPartialTextExtents(text,extents); wxASSERT( text.length() == extents.GetCount() ); while ( index <= maxIndex ) { const wxChar A = text[index]; if ( !wxIsalnum(prevA) ) { // Can split here prevCanSplitIndex = index; } else { // Can't split here } if ( ( (extents[index] >= lineCheckWidth || A == wxT('\n')) && index > prevCanSplitIndex ) || index == maxIndex ) { // Need to split now unsigned int useSplit = prevCanSplitIndex; if ( useSplit <= prevSplitIndex || index >= maxIndex ) useSplit = index; resultLine << text.Mid(prevSplitIndex,useSplit-prevSplitIndex); if ( index >= maxIndex ) break; else if ( A != wxT('\n') ) { resultLine.Append(_T("\n")); //resultLine.Append(text.Mid(useSplit,text.length()-useSplit)); //break; } prevSplitIndex = useSplit; lineCheckWidth = extents[useSplit] + lineWidth; //widSum = 0; index = useSplit; prevA = wxT('\0'); } else { index++; prevA = A; } } return resultLine; } */ // ----------------------------------------------------------------------- #if wxPG_SUPPORT_TOOLTIPS void wxPropertyGrid::SetToolTip( const wxString& tipString ) { if ( tipString.length() ) { //wxClientDC dc(this); //wxString finalString = SplitTextByPixelWidth(dc,tipString,350); //wxScrolledWindow::SetToolTip(finalString); wxScrolledWindow::SetToolTip(tipString); } else { #if wxPG_ALLOW_EMPTY_TOOLTIPS wxScrolledWindow::SetToolTip( m_emptyString ); #else wxScrolledWindow::SetToolTip( NULL ); #endif } } #endif // #if wxPG_SUPPORT_TOOLTIPS // ----------------------------------------------------------------------- // Return false if should be skipped bool wxPropertyGrid::HandleMouseMove( int x, unsigned int y, wxMouseEvent &event ) { // Safety check (needed because mouse capturing may // otherwise freeze the control) if ( m_dragStatus > 0 && !event.Dragging() ) { //wxLogDebug(wxT("MOUSE CAPTURE SAFETY RELEASE TRIGGERED")); HandleMouseUp(x,y,event); } if ( m_dragStatus > 0 ) { if ( x > (m_marginWidth + wxPG_DRAG_MARGIN) && x < (m_width - wxPG_DRAG_MARGIN) ) { #if wxPG_HEAVY_GFX int new_splitterx = x - m_dragOffset; // Splitter redraw required? if ( new_splitterx != m_splitterx ) { if ( m_selected ) CorrectEditorWidgetSizeX( new_splitterx, m_width ); // Move everything m_splitterx = new_splitterx; m_fSplitterX = (float) new_splitterx; Update(); RedrawAllVisible(); } #else if ( x != m_splitterx ) { wxPG_CLIENT_DC_INIT_R(false) if ( m_splitterprevdrawnx != -1 ) DrawSplitterDragColumn( dc, m_splitterprevdrawnx ); m_splitterx = x; m_fSplitterX = (float) x; DrawSplitterDragColumn( dc, x ); m_splitterprevdrawnx = x; } #endif m_dragStatus = 2; } return false; } else { int ih = m_lineHeight; int sy = y; #if wxPG_SUPPORT_TOOLTIPS wxPGProperty* prevHover = m_propHover; unsigned char prevSide = m_mouseSide; #endif // On which item it hovers if ( ( !m_propHover && y < m_bottomy) || ( m_propHover && ( sy < m_propHover->m_y || sy >= (m_propHover->m_y+ih) ) ) ) { // Mouse moves on another property m_propHover = DoGetItemAtY(y); // Send hover event SendEvent( wxEVT_PG_HIGHLIGHTED, m_propHover ); } #if wxPG_SUPPORT_TOOLTIPS // Store which side we are on m_mouseSide = 0; if ( x >= m_splitterx ) m_mouseSide = 2; else if ( x >= m_marginWidth ) m_mouseSide = 1; // // If tooltips are enabled, show label or value as a tip // in case it doesn't otherwise show in full length. // if ( m_windowStyle & wxPG_TOOLTIPS ) { wxToolTip* tooltip = GetToolTip(); if ( m_propHover != prevHover || prevSide != m_mouseSide ) { if ( m_propHover && m_propHover->GetParentingType() <= 0 ) { if ( GetExtraStyle() & wxPG_EX_HELP_AS_TOOLTIPS ) { // Show help string as a tooltip wxString tipString = m_propHover->GetHelpString(); SetToolTip(tipString); } else { // Show cropped value string as a tooltip wxString tipString; int space = 0; if ( m_mouseSide == 1 ) { tipString = m_propHover->m_label; space = m_splitterx-m_marginWidth-3; } else if ( m_mouseSide == 2 ) { tipString = m_propHover->GetDisplayedString(); space = m_width - m_splitterx; if ( m_propHover->m_flags & wxPG_PROP_CUSTOMIMAGE ) space -= wxPG_CUSTOM_IMAGE_WIDTH + wxCC_CUSTOM_IMAGE_MARGIN1 + wxCC_CUSTOM_IMAGE_MARGIN2; } if ( space ) { int tw, th; GetTextExtent( tipString, &tw, &th, 0, 0, &m_font ); if ( tw > space ) { SetToolTip( tipString ); } } else { if ( tooltip ) { #if wxPG_ALLOW_EMPTY_TOOLTIPS wxScrolledWindow::SetToolTip( m_emptyString ); #else wxScrolledWindow::SetToolTip( NULL ); #endif } } } } else { if ( tooltip ) { #if wxPG_ALLOW_EMPTY_TOOLTIPS wxScrolledWindow::SetToolTip( m_emptyString ); #else wxScrolledWindow::SetToolTip( NULL ); #endif } } } } #endif if ( x > (m_splitterx + wxPG_SPLITTERX_DETECTMARGIN2) || x < (m_splitterx - wxPG_SPLITTERX_DETECTMARGIN1) || y >= m_bottomy || (m_windowStyle & wxPG_STATIC_SPLITTER) ) { // hovering on something else if ( m_curcursor != wxCURSOR_ARROW ) CustomSetCursor( wxCURSOR_ARROW ); } else { // Do not allow splitter cursor on caption items. // (also not if we were dragging and its started // outside the splitter region) if ( m_propHover && m_propHover->GetParentingType() <= 0 && !event.Dragging() ) { // hovering on splitter // NB: Condition disabled since MouseLeave event (from the editor control) cannot be // reliably detected. //if ( m_curcursor != wxCURSOR_SIZEWE ) CustomSetCursor( wxCURSOR_SIZEWE, true ); return false; } else { // hovering on something else if ( m_curcursor != wxCURSOR_ARROW ) CustomSetCursor( wxCURSOR_ARROW ); } } } return true; } // ----------------------------------------------------------------------- // Also handles Leaving event bool wxPropertyGrid::HandleMouseUp( int x, unsigned int y, wxMouseEvent &WXUNUSED(event) ) { bool res = false; #if __MOUSE_DEBUGGING__ wxLogDebug( wxT(" \\--> HandleMouseUp") ); #endif // No event type check - basicly calling this method should // just stop dragging. //if( event.LeftUp() || event.Leaving() ) //{ // Left up after dragged? if ( m_dragStatus >= 1 ) { // // End Splitter Dragging // #if __MOUSE_DEBUGGING__ wxLogDebug( wxT(" dragging ends") ); #endif // DO NOT ENABLE FOLLOWING LINE! // (it is only here as a reminder to not to do it) //m_splitterx = x; #if wxPG_HEAVY_GFX //Refresh(); #else DoSetSplitterPosition( -1 ); // -1 tells not to make change // Hack to clear-up editor graphics mess (on wxMSW, atleast) if ( m_selected ) DrawItem ( m_selected ); #endif // Disable splitter auto-centering m_iFlags |= wxPG_FL_DONT_CENTER_SPLITTER; // This is necessary to return cursor END_MOUSE_CAPTURE // Set back the default cursor, if necessary if ( x > (m_splitterx + wxPG_SPLITTERX_DETECTMARGIN2) || x < (m_splitterx - wxPG_SPLITTERX_DETECTMARGIN1) || y >= m_bottomy ) { CustomSetCursor( wxCURSOR_ARROW ); } m_dragStatus = 0; #if wxPG_HEAVY_GFX // Control background needs to be cleared if ( !(m_iFlags & wxPG_FL_PRIMARY_FILLS_ENTIRE) && m_selected ) DrawItem ( m_selected ); #endif if ( m_wndPrimary ) { m_wndPrimary->Show ( true ); } #if wxPG_REFRESH_CONTROLS_AFTER_REPAINT // Fixes button disappearance bug if ( m_wndSecondary ) m_wndSecondary->Show ( true ); #endif // This clears the focus. m_editorFocused = 0; } //} return res; } // ----------------------------------------------------------------------- bool wxPropertyGrid::OnMouseCommon( wxMouseEvent& event, int* px, int* py ) { int ux, uy; CalcUnscrolledPosition( event.m_x, event.m_y, &ux, &uy ); // Hide popup on clicks // FIXME: Not necessary after transient window implemented if ( event.GetEventType() != wxEVT_MOTION ) if ( m_wndPrimary && m_wndPrimary->IsKindOf(CLASSINFO(wxPGOwnerDrawnComboBox)) ) { ((wxPGOwnerDrawnComboBox*)m_wndPrimary)->HidePopup(); } //if (printmsg) wxLogDebug( wxT("On") wxT(#func) wxT("( %i, %i )"),(int)ux,(int)uy ); wxRect r; wxWindow* wnd = m_wndPrimary; if ( wnd ) r = wnd->GetRect(); if ( wnd == (wxWindow*) NULL || m_dragStatus || ( ux <= (m_splitterx + wxPG_SPLITTERX_DETECTMARGIN2) || event.m_y < r.y || event.m_y >= (r.y+r.height) ) ) { *px = ux; *py = uy; return true; } else { if ( m_curcursor != wxCURSOR_ARROW ) CustomSetCursor ( wxCURSOR_ARROW ); } return false; } // ----------------------------------------------------------------------- void wxPropertyGrid::OnMouseClick( wxMouseEvent &event ) { int x, y; if ( OnMouseCommon( event, &x, &y ) ) { HandleMouseClick(x,y,event); } event.Skip(); } // ----------------------------------------------------------------------- void wxPropertyGrid::OnMouseRightClick( wxMouseEvent &event ) { int x, y; CalcUnscrolledPosition( event.m_x, event.m_y, &x, &y ); HandleMouseRightClick(x,y,event); event.Skip(); } // ----------------------------------------------------------------------- void wxPropertyGrid::OnMouseDoubleClick( wxMouseEvent &event ) { // Always run standard mouse-down handler as well OnMouseClick(event); int x, y; CalcUnscrolledPosition( event.m_x, event.m_y, &x, &y ); HandleMouseDoubleClick(x,y,event); event.Skip(); } // ----------------------------------------------------------------------- void wxPropertyGrid::OnMouseMove( wxMouseEvent &event ) { int x, y; if ( OnMouseCommon ( event, &x, &y ) ) { HandleMouseMove(x,y,event); } event.Skip(); } // ----------------------------------------------------------------------- void wxPropertyGrid::OnMouseUp( wxMouseEvent &event ) { int x, y; if ( OnMouseCommon ( event, &x, &y ) ) { HandleMouseUp(x,y,event); } event.Skip(); } // ----------------------------------------------------------------------- void wxPropertyGrid::OnMouseEntry( wxMouseEvent &event ) { // This may get called from child control as well, so event's // mouse position cannot be relied on. //int x = event.m_x; //int y = event.m_y; if ( event.Entering() ) { if ( !(m_iFlags & wxPG_FL_MOUSE_INSIDE) ) { #if __MOUSE_DEBUGGING__ wxLogDebug(wxT("Mouse Enters Window")); #endif //SetCursor ( *wxSTANDARD_CURSOR ); // TODO: Fix this (detect parent and only do // cursor trick if it is a manager). wxASSERT( GetParent() ); GetParent()->SetCursor(wxNullCursor); m_iFlags |= wxPG_FL_MOUSE_INSIDE; //if ( m_wndPrimary ) m_wndPrimary->Show ( true ); } else GetParent()->SetCursor(wxNullCursor); } else if ( event.Leaving() ) { // Without this, wxSpinCtrl editor will sometimes have wrong cursor SetCursor( wxNullCursor ); // Get real cursor position wxPoint pt = ScreenToClient(::wxGetMousePosition()); if ( ( pt.x <= 0 || pt.y <= 0 || pt.x >= m_width || pt.y >= m_height ) ) { //if ( CommitChangesFromEditor() ) { if ( (m_iFlags & wxPG_FL_MOUSE_INSIDE) ) { #if __MOUSE_DEBUGGING__ wxLogDebug(wxT("Mouse Leaves Window")); #endif m_iFlags &= ~(wxPG_FL_MOUSE_INSIDE); //if ( m_wndPrimary ) m_wndPrimary->Show ( false ); } if ( m_dragStatus ) wxPropertyGrid::HandleMouseUp ( -1, 10000, event ); } } else { /*#if wxPG_NO_CHILD_EVT_MOTION // cursor must be reset because EVT_MOTION handler is not there to do it if ( m_curcursor != wxCURSOR_ARROW ) CustomSetCursor ( wxCURSOR_ARROW ); #endif*/ } } event.Skip(); } // ----------------------------------------------------------------------- // if (printmsg) wxLogDebug( wxT("On") wxT(#func) wxT("Child ( %i, %i )"),(int)event.m_x,(int)event.m_y ); // Common code used by various OnMouseXXXChild methods. bool wxPropertyGrid::OnMouseChildCommon( wxMouseEvent &event, int* px, int *py ) { wxWindow* topCtrlWnd = (wxWindow*)event.GetEventObject(); wxASSERT( topCtrlWnd ); int x, y; event.GetPosition(&x,&y); #if wxPG_ENABLE_CLIPPER_WINDOW // Take clipper window into account if (topCtrlWnd->GetPosition().x < 1 && !topCtrlWnd->IsKindOf(CLASSINFO(wxPGClipperWindow))) { topCtrlWnd = topCtrlWnd->GetParent(); wxASSERT( topCtrlWnd->IsKindOf(CLASSINFO(wxPGClipperWindow)) ); x -= ((wxPGClipperWindow*)topCtrlWnd)->GetXClip(); y -= ((wxPGClipperWindow*)topCtrlWnd)->GetYClip(); } #endif wxRect r = topCtrlWnd->GetRect(); if ( !m_dragStatus && x > (m_splitterx-r.x+wxPG_SPLITTERX_DETECTMARGIN2) && y >= 0 && y < r.height \ ) { if ( m_curcursor != wxCURSOR_ARROW ) CustomSetCursor ( wxCURSOR_ARROW ); event.Skip(); } else { CalcUnscrolledPosition( event.m_x + r.x, event.m_y + r.y, \ px, py ); return true; } return false; } /*void wxPropertyGrid::OnMouseEntryChild ( wxMouseEvent &event ) { wxLogDebug(wxT("Entering/Leaving Child...")); event.Skip(); }*/ void wxPropertyGrid::OnMouseClickChild( wxMouseEvent &event ) { int x,y; if ( OnMouseChildCommon(event,&x,&y) ) { bool res = HandleMouseClick(x,y,event); if ( !res ) event.Skip(); /*if ( event.GetEventType() == wxEVT_LEFT_DCLICK ) { HandleMouseDoubleClick( x, y, event ); event.Skip(); }*/ } } void wxPropertyGrid::OnMouseRightClickChild( wxMouseEvent &event ) { int x,y; wxASSERT( m_wndPrimary ); // These coords may not be exact (about +-2), // but that should not matter (right click is about item, not position). wxPoint pt = m_wndPrimary->GetPosition(); CalcUnscrolledPosition( event.m_x + pt.x, event.m_y + pt.y, &x, &y ); wxASSERT( m_selected ); m_propHover = m_selected; bool res = HandleMouseRightClick(x,y,event); if ( !res ) event.Skip(); } void wxPropertyGrid::OnMouseMoveChild( wxMouseEvent &event ) { int x,y; if ( OnMouseChildCommon(event,&x,&y) ) { bool res = HandleMouseMove(x,y,event); if ( !res ) event.Skip(); } } void wxPropertyGrid::OnMouseUpChild( wxMouseEvent &event ) { int x,y; if ( OnMouseChildCommon(event,&x,&y) ) { bool res = HandleMouseUp(x,y,event); if ( !res ) event.Skip(); } } // ----------------------------------------------------------------------- // wxPropertyGrid keyboard event handling // ----------------------------------------------------------------------- void wxPropertyGrid::SendNavigationKeyEvent( int dir ) { wxNavigationKeyEvent evt; evt.SetFlags(wxNavigationKeyEvent::FromTab| (dir?wxNavigationKeyEvent::IsForward: wxNavigationKeyEvent::IsBackward)); evt.SetEventObject(this); GetEventHandler()->AddPendingEvent(evt); } void wxPropertyGrid::HandleKeyEvent(wxKeyEvent &event) { // // Handles key event when editor control is not focused. // #if __INTENSE_DEBUGGING__ wxLogDebug( wxT("wxPropertyGrid::HandleKeyEvent(%i)"),(int)event.GetKeyCode() ); #endif wxASSERT( !m_frozen ); if ( m_frozen ) return; // Travelsal between items, collapsing/expanding, etc. int keycode = event.GetKeyCode(); if ( keycode == WXK_TAB ) { SendNavigationKeyEvent( event.ShiftDown()?0:1 ); return; } // Ignore Alt and Control when they are down alone if ( keycode == WXK_ALT || keycode == WXK_CONTROL ) { event.Skip(); return; } if ( m_selected ) { // Show dialog? if ( ButtonTriggerKeyTest(event) ) return; wxPGProperty* p = m_selected; int selectDir = -2; if ( p->GetParentingType() != 0 && !(p->m_flags & wxPG_PROP_DISABLED) ) { //wxPGPropertyWithChildren* pwc = (wxPGPropertyWithChildren*)p; if ( keycode == WXK_LEFT ) { if ( (m_windowStyle & wxPG_HIDE_MARGIN) || Collapse ( p ) ) keycode = 0; } else if ( keycode == WXK_RIGHT ) { if ( (m_windowStyle & wxPG_HIDE_MARGIN) || Expand ( p ) ) keycode = 0; } } if ( keycode ) { if ( keycode == WXK_UP || keycode == WXK_LEFT ) { selectDir = 0; } else if ( keycode == WXK_DOWN || keycode == WXK_RIGHT ) { selectDir = 1; } else { event.Skip(); } } if ( selectDir >= -1 ) { p = GetNeighbourItem( p, true, selectDir ); if ( p ) DoSelectProperty(p); } } else { // If nothing was selected, select the first item now // (or navigate out of tab). if ( keycode != WXK_ESCAPE ) { wxPGProperty* p = GetFirst(); if ( p ) DoSelectProperty(p); } } } // ----------------------------------------------------------------------- // Potentially handles a keyboard event for editor controls. // Returns false if event should *not* be skipped (on true it can // be optionally skipped). // Basicly, false means that SelectProperty was called (or was about // to be called, if canDestroy was false). bool wxPropertyGrid::HandleChildKey( wxKeyEvent& event, bool canDestroy ) { int keycode = event.GetKeyCode(); bool res = true; #if __INTENSE_DEBUGGING__ wxLogDebug( wxT("wxPropertyGrid::HandleChildKey(%i)"),(int)event.GetKeyCode() ); #endif // Unfocus? if ( keycode == WXK_ESCAPE ) { // Esc cancels any changes EditorsValueWasNotModified(); wxPGProperty* p = m_selected; res = false; if ( canDestroy ) { DoSelectProperty( (wxPGProperty*)NULL, wxPG_SEL_NOVALIDATE ); DoSelectProperty( p ); } } return res; } // ----------------------------------------------------------------------- void wxPropertyGrid::OnKey( wxKeyEvent &event ) { // // Events to editor controls should get relayed here. // wxWindow* focused = wxWindow::FindFocus(); //wxLogDebug(wxT("OnKey")); if ( m_wndPrimary && (focused==m_wndPrimary || m_editorFocused #if wxPG_ENABLE_CLIPPER_WINDOW || ((m_wndPrimary->IsKindOf(CLASSINFO(wxPGClipperWindow))) && ((wxPGClipperWindow*)m_wndPrimary)->GetControl() == focused) #endif ) ) { // Child key must be processed here, since it can // destroy the control which is referred by its own // event handling. HandleChildKey( event, true ); } else HandleKeyEvent( event ); } // ----------------------------------------------------------------------- void wxPropertyGrid::OnKeyUp(wxKeyEvent &event) { m_keyComboConsumed = 0; event.Skip(); } // ----------------------------------------------------------------------- void wxPropertyGrid::OnNavigationKey( wxNavigationKeyEvent& event ) { // Ignore events that occur very close to focus set if ( m_iFlags & wxPG_FL_IGNORE_NEXT_NAVKEY ) { m_iFlags &= ~(wxPG_FL_IGNORE_NEXT_NAVKEY); event.Skip(); return; } wxPGProperty* next = (wxPGProperty*) NULL; int dir = event.GetDirection()?1:0; if ( m_selected ) { if ( dir == 1 && (m_wndPrimary || m_wndSecondary) ) { wxWindow* focused = wxWindow::FindFocus(); wxWindow* wndToCheck = GetEditorControl(); // ODComboBox focus goes to its text ctrl, so we need to use it instead if ( wndToCheck && wndToCheck->IsKindOf(CLASSINFO(wxPGOwnerDrawnComboBox)) ) { wxTextCtrl* comboTextCtrl = ((wxPGOwnerDrawnComboBox*)wndToCheck)->GetTextCtrl(); if ( comboTextCtrl ) wndToCheck = comboTextCtrl; } /* // Because of problems navigating from wxButton, do not go to it. if ( !wndToCheck ) { // No primary, use secondary wndToCheck = m_wndSecondary; } // If it has editor button, focus to it after the primary editor. // NB: Doesn't work since wxButton on wxMSW doesn't seem to propagate // key events (yes, I'm using wxWANTS_CHARS with it, and yes I // have somewhat debugged in window.cpp itself). else if ( focused == wndToCheck && m_wndSecondary && !(GetExtraStyle() & wxPG_EX_NO_TAB_TO_BUTTON) ) { wndToCheck = m_wndSecondary; wxLogDebug(wxT("Exp1")); } */ if ( focused != wndToCheck && wndToCheck ) { wndToCheck->SetFocus(); // Select all text in wxTextCtrl etc. if ( m_wndPrimary && wndToCheck == m_wndPrimary ) m_selected->GetEditorClass()->OnFocus(m_selected,wndToCheck); m_editorFocused = 1; next = m_selected; } } if ( !next ) { next = GetNeighbourItem(m_selected,true,dir); if ( next ) { // This allows preventing NavigateOut to occur DoSelectProperty( next, wxPG_SEL_FOCUS ); } } } if ( !next ) event.Skip(); } // ----------------------------------------------------------------------- bool wxPropertyGrid::ButtonTriggerKeyTest( wxKeyEvent &event ) { int keycode = event.GetKeyCode(); // Does the keycode trigger button? if ( keycode == m_pushButKeyCode && m_wndSecondary && (!m_pushButKeyCodeNeedsAlt || event.AltDown()) && (!m_pushButKeyCodeNeedsCtrl || event.ControlDown()) ) { m_keyComboConsumed = 1; wxCommandEvent evt(wxEVT_COMMAND_BUTTON_CLICKED,m_wndSecondary->GetId()); GetEventHandler()->AddPendingEvent(evt); return true; } return false; } // ----------------------------------------------------------------------- void wxPropertyGrid::OnChildKeyDown( wxKeyEvent &event ) { int keycode = event.GetKeyCode(); // Ignore Alt and Control when they are down alone if ( keycode == WXK_ALT || keycode == WXK_CONTROL ) { event.Skip(); return; } if ( ButtonTriggerKeyTest(event) ) return; // Since event handling may destroy the control which // triggered this event, we need to send it separately // to the wxPropertyGrid itself. Also, to allow pushed // event handler to grab ENTER, ESC and such, this // has been changed to add all keys as events. if ( HandleChildKey(event,false) == true ) event.Skip(); GetEventHandler()->AddPendingEvent(event); } void wxPropertyGrid::OnChildKeyUp( wxKeyEvent &event ) { m_keyComboConsumed = 0; GetEventHandler()->AddPendingEvent(event); event.Skip(); } // ----------------------------------------------------------------------- // wxPropertyGrid miscellaneous event handling // ----------------------------------------------------------------------- void wxPropertyGrid::OnIdle( wxIdleEvent& WXUNUSED(event) ) { // // Check if the focus is in this control or one of its children wxWindow* newFocused = wxWindow::FindFocus(); if ( newFocused != m_curFocused ) HandleFocusChange( newFocused ); } // Called by focus event handlers. newFocused is the window that becomes focused. void wxPropertyGrid::HandleFocusChange( wxWindow* newFocused ) { unsigned int oldFlags = m_iFlags; //wxLogDebug(wxT("HandleFocusChange: %s"),newFocused?newFocused->GetClassInfo()->GetClassName():wxT("NULL")); m_iFlags &= ~(wxPG_FL_FOCUSED); wxWindow* parent = newFocused; // This must be one of nextFocus' parents. while ( parent ) { // Use m_eventObject, which is either wxPropertyGrid or // wxPropertyGridManager, as appropriate. if ( parent == m_eventObject ) { m_iFlags |= wxPG_FL_FOCUSED; break; } parent = parent->GetParent(); } m_curFocused = newFocused; if ( (m_iFlags & wxPG_FL_FOCUSED) != (oldFlags & wxPG_FL_FOCUSED) ) { // On each focus kill, mark the next nav key event // to be ignored (can't do on set focus since the // event would occur before it). if ( !(m_iFlags & wxPG_FL_FOCUSED) ) { m_iFlags |= wxPG_FL_IGNORE_NEXT_NAVKEY; // Need to store changed value CommitChangesFromEditor(); } else { /* // // Preliminary code for tab-order respecting // tab-traversal (but should be moved to // OnNav handler) // wxWindow* prevFocus = event.GetWindow(); wxWindow* useThis = this; if ( m_iFlags & wxPG_FL_IN_MANAGER ) useThis = GetParent(); if ( prevFocus && prevFocus->GetParent() == useThis->GetParent() ) { wxList& children = useThis->GetParent()->GetChildren(); wxNode* node = children.Find(prevFocus); if ( node->GetNext() && useThis == node->GetNext()->GetData() ) DoSelectProperty(GetFirst()); else if ( node->GetPrevious () && useThis == node->GetPrevious()->GetData() ) DoSelectProperty(GetLastProperty()); } */ m_iFlags &= ~(wxPG_FL_IGNORE_NEXT_NAVKEY); } // Redraw selected if ( m_selected && (m_iFlags & wxPG_FL_INITIALIZED) ) DrawItem( m_selected ); } } void wxPropertyGrid::OnFocusEvent( wxFocusEvent& event ) { #if 1 if ( event.GetEventType() == wxEVT_SET_FOCUS ) HandleFocusChange((wxWindow*)event.GetEventObject()); // Line changed to "else" when applying patch #1675902 //else if ( event.GetWindow() ) else HandleFocusChange(event.GetWindow()); event.Skip(); #else unsigned int oldFlags = m_iFlags; // // Determine the current focus state if ( event.GetEventType() == wxEVT_SET_FOCUS || event.GetEventType() == wxEVT_CHILD_FOCUS ) { m_iFlags |= wxPG_FL_FOCUSED; } else { wxWindow* nextFocus = event.GetWindow(); m_iFlags &= ~(wxPG_FL_FOCUSED); wxWindow* parent = nextFocus; //wxLogDebug(wxT("KillFocus: %s"),parent->GetClassInfo()->GetClassName()); // This must be one of nextFocus' parents. while ( parent ) { if ( parent == this ) { m_iFlags |= wxPG_FL_FOCUSED; break; } parent = parent->GetParent(); } } if ( (m_iFlags & wxPG_FL_FOCUSED) != (oldFlags & wxPG_FL_FOCUSED) ) { // On each focus kill, mark the next nav key event // to be ignored (can't do on set focus since the // event would occur before it). if ( !(m_iFlags & wxPG_FL_FOCUSED) ) { m_iFlags |= wxPG_FL_IGNORE_NEXT_NAVKEY; // Need to store changed value CommitChangesFromEditor(); } else { /* // // Preliminary code for tab-order respecting // tab-traversal (but should be moved to // OnNav handler) // wxWindow* prevFocus = event.GetWindow(); wxWindow* useThis = this; if ( m_iFlags & wxPG_FL_IN_MANAGER ) useThis = GetParent(); if ( prevFocus && prevFocus->GetParent() == useThis->GetParent() ) { wxList& children = useThis->GetParent()->GetChildren(); wxNode* node = children.Find(prevFocus); if ( node->GetNext() && useThis == node->GetNext()->GetData() ) DoSelectProperty(GetFirst()); else if ( node->GetPrevious () && useThis == node->GetPrevious()->GetData() ) DoSelectProperty(GetLastProperty()); } */ m_iFlags &= ~(wxPG_FL_IGNORE_NEXT_NAVKEY); } // Redraw selected if ( m_selected && (m_iFlags & wxPG_FL_INITIALIZED) ) DrawItem( m_selected ); } event.Skip(); #endif } void wxPropertyGrid::OnChildFocusEvent( wxChildFocusEvent& event ) { HandleFocusChange((wxWindow*)event.GetEventObject()); event.Skip(); } // ----------------------------------------------------------------------- void wxPropertyGrid::OnScrollEvent( wxScrollWinEvent &event ) { m_iFlags |= wxPG_FL_SCROLLED; event.Skip(); } // ----------------------------------------------------------------------- void wxPropertyGrid::OnCaptureChange( wxMouseCaptureChangedEvent& WXUNUSED(event) ) { if ( m_iFlags & wxPG_FL_MOUSE_CAPTURED ) { #if __MOUSE_DEBUGGING__ wxLogDebug( wxT("wxPropertyGrid: mouse capture lost") ); #endif m_iFlags &= ~(wxPG_FL_MOUSE_CAPTURED); } } // ----------------------------------------------------------------------- // Property text-based storage // ----------------------------------------------------------------------- #define wxPG_PROPERTY_FLAGS_COUNT 8 // property-flag-to-text array static const wxChar* gs_property_flag_to_string[wxPG_PROPERTY_FLAGS_COUNT] = { wxT("Modified"), wxT("Disabled"), wxT("LowPriority"), (const wxChar*) NULL, // wxPG_PROP_CUSTOMIMAGE is auto-generated flag wxT("LimitedEditing"), wxT("Unspecified"), (const wxChar*) NULL, // Special flags cannot be stored as-is (const wxChar*) NULL // }; wxString wxPGProperty::GetAttributes( unsigned int flagmask ) { wxASSERT(this); wxString s; unsigned int i; unsigned int flags = ((unsigned int)m_flags) & flagmask & ~(wxPG_PROP_CUSTOMIMAGE | wxPG_PROP_CLASS_SPECIFIC_1 | wxPG_PROP_CLASS_SPECIFIC_2); if ( !flags ) return wxEmptyString; for ( i=0; iGetParentingType() != 1 ) { const wxChar* src = p->GetClassName(); wxString s; if ( src[0] == wxT('w') && src[1] == wxT('x') ) s = &src[2]; else s = src; wxASSERT( (((int)s.length())-8) > 0 ); s.Truncate(s.length()-8); //s.LowerCase(); return s; } return wxT("Category"); } wxPGId wxPropertyContainerMethods::GetPropertyByNameA( wxPGPropNameStr name ) const { wxPGId id = GetPropertyByName(name); wxASSERT_MSG(wxPGIdIsOk(id),wxString::Format(wxT("no property with name '%s'"),name.c_str())); return id; } // ---------------------------------------------------------------------------- // VariantDatas // ---------------------------------------------------------------------------- #if wxPG_PGVARIANT_IS_VARIANT IMPLEMENT_DYNAMIC_CLASS(wxPGVariantDataPoint, wxVariantData) IMPLEMENT_DYNAMIC_CLASS(wxPGVariantDataSize, wxVariantData) IMPLEMENT_DYNAMIC_CLASS(wxPGVariantDataArrayInt, wxVariantData) IMPLEMENT_DYNAMIC_CLASS(wxPGVariantDataLongLong, wxVariantData) IMPLEMENT_DYNAMIC_CLASS(wxPGVariantDataULongLong, wxVariantData) #ifdef __WXPYTHON__ IMPLEMENT_DYNAMIC_CLASS(wxPGVariantDataPyObject, wxVariantData) #endif #endif // ----------------------------------------------------------------------- // Value type related methods (should all be pretty much static). wxPGValueType::~wxPGValueType() { } wxPG_CONST_WXCHAR_PTR wxPGValueType::GetCustomTypeName() const { return GetTypeName(); } // Implement default types. WX_PG_IMPLEMENT_VALUE_TYPE(wxString,wxStringProperty,wxPGTypeName_wxString,GetString,wxEmptyString) WX_PG_IMPLEMENT_VALUE_TYPE(long,wxIntProperty,wxPGTypeName_long,GetLong,(long)0) WX_PG_IMPLEMENT_VALUE_TYPE(double,wxFloatProperty,wxPGTypeName_double,GetDouble,0.0) WX_PG_IMPLEMENT_VALUE_TYPE(wxArrayString,wxArrayStringProperty,wxPGTypeName_wxArrayString,GetArrayString,wxArrayString()) // Bool is a special case... thanks to the C++'s bool vs int vs long inconsistency issues. const wxPGValueType *wxPGValueType_bool = (wxPGValueType *) NULL; class wxPGValueTypeboolClass : public wxPGValueType { public: virtual wxPG_CONST_WXCHAR_PTR GetTypeName() const { return wxPGTypeName_long; } virtual wxPG_CONST_WXCHAR_PTR GetCustomTypeName() const { return wxPGTypeName_bool; } virtual wxPGVariant GetDefaultValue() const { return wxPGVariant((long)0); } virtual wxVariant GenerateVariant( wxPGVariant value, const wxString& name ) const { return wxVariant ( value.GetBool(), name ); } virtual wxPGProperty* GenerateProperty( const wxString& label, const wxString& name ) const { return wxPG_NEWPROPERTY(Bool,label,name,false); } virtual void SetValueFromVariant( wxPGProperty* property, wxVariant& value ) const { #if defined(__WXDEBUG__) || defined(__WXPYTHON__) wxCHECK_RET( wxStrcmp(wxPGTypeName_bool,value.GetType().c_str()) == 0, wxT("SetValueFromVariant: wxVariant type mismatch.") ); #endif property->DoSetValue(value.GetBool()?(long)1:(long)0); } }; // Implement nonetype. const wxPGValueType *wxPGValueType_none = (wxPGValueType*) NULL; class wxPGValueTypenoneClass : public wxPGValueType { public: virtual wxPG_CONST_WXCHAR_PTR GetTypeName() const { return wxT("null"); } virtual wxPGVariant GetDefaultValue() const { return wxPGVariant((long)0); } virtual wxVariant GenerateVariant( wxPGVariant, const wxString& name ) const { return wxVariant( (long)0, name ); } virtual wxPGProperty* GenerateProperty( const wxString&, const wxString& ) const { return (wxPGProperty*) NULL; } virtual void SetValueFromVariant( wxPGProperty*, wxVariant& ) const { } }; // Implement void* type. const wxPGValueType *wxPGValueType_void = (wxPGValueType*) NULL; class wxPGValueTypevoidClass : public wxPGValueType { public: virtual wxPG_CONST_WXCHAR_PTR GetTypeName() const { return wxPGTypeName_void; } virtual wxPGVariant GetDefaultValue() const { return wxPGVariant((void*)NULL); } virtual wxVariant GenerateVariant( wxPGVariant value, const wxString& name ) const { return wxVariant( wxPGVariantToVoidPtr(value), name ); } virtual wxPGProperty* GenerateProperty( const wxString&, const wxString& ) const { return (wxPGProperty*) NULL; } virtual void SetValueFromVariant( wxPGProperty* property, wxVariant& value ) const { #if defined(__WXDEBUG__) || defined(__WXPYTHON__) wxCHECK_RET( wxStrcmp(GetTypeName(),value.GetType().c_str()) == 0, wxT("SetValueFromVariant: wxVariant type mismatch.") ); #endif property->DoSetValue(value.GetVoidPtr()); } }; #ifdef __WXPYTHON__ // Implement PyObject* type. const wxPGValueType *wxPGValueType_PyObject = (wxPGValueType*) NULL; class wxPGValueTypePyObjectClass : public wxPGValueType { public: virtual wxPG_CONST_WXCHAR_PTR GetTypeName() const { return wxT("PyObject"); } virtual wxPGVariant GetDefaultValue() const { return wxVariant( new wxPGVariantDataPyObject(Py_None) ); } virtual wxVariant GenerateVariant( wxPGVariant value, const wxString& name ) const { value.SetName( name ); return value; // Can be done since under wxPython, wxPGVariant is wxVariant } virtual wxPGProperty* GenerateProperty( const wxString&, const wxString& ) const { return (wxPGProperty*) NULL; } virtual void SetValueFromVariant( wxPGProperty* property, wxVariant& value ) const { #if defined(__WXDEBUG__) || defined(__WXPYTHON__) wxCHECK_RET( wxStrcmp(GetTypeName(),value.GetType().c_str()) == 0, wxT("SetValueFromVariant: wxVariant type mismatch.") ); #endif property->DoSetValue(value); } }; #endif // __WXPYTHON__ // Registers all default value types void wxPropertyGrid::RegisterDefaultValues() { wxPGRegisterDefaultValueType( none ); wxPGRegisterDefaultValueType( wxString ); wxPGRegisterDefaultValueType( long ); wxPGRegisterDefaultValueType( bool ); wxPGRegisterDefaultValueType( double ); wxPGRegisterDefaultValueType( void ); wxPGRegisterDefaultValueType( wxArrayString ); #ifdef __WXPYTHON__ wxPGRegisterDefaultValueType( PyObject ); #endif } // noDefCheck = true prevents infinite recursion. wxPGValueType* wxPropertyGrid::RegisterValueType( wxPGValueType* valueclass, bool noDefCheck, const wxString& className ) { wxASSERT( valueclass ); WX_PG_GLOBALS_LOCKER() if ( !noDefCheck && wxPGGlobalVars->m_dictValueType.empty() ) RegisterDefaultValues(); wxString temp_str; wxPG_CONST_WXCHAR_PTR name_ = valueclass->GetType(); const wxChar* name = wxPG_TO_WXCHAR_PTR(name_); wxPGValueType* p_at_slot = (wxPGValueType*) wxPGGlobalVars->m_dictValueType[name]; if ( !p_at_slot ) { wxPGGlobalVars->m_dictValueType[name] = (void*) valueclass; #if wxPG_VALUETYPE_IS_STRING wxPGGlobalVars->m_dictValueTypeByClass[className] = (void*) valueclass; #else wxUnusedVar(className); #endif return valueclass; } // Delete given object instance, but only if it wasn't the same as in the hashmap. if ( p_at_slot != valueclass ) { delete valueclass; } return p_at_slot; } /* * wxPGVariantDataWxObj */ //IMPLEMENT_DYNAMIC_CLASS(wxPGVariantDataWxObj, wxVariantData) wxPGVariantDataWxObj::wxPGVariantDataWxObj() : wxVariantData() { } wxPGVariantDataWxObj::~wxPGVariantDataWxObj() { } #if wxUSE_STD_IOSTREAM bool wxPGVariantDataWxObj::Write(wxSTD ostream&) const { // Not implemented return true; } #endif bool wxPGVariantDataWxObj::Write(wxString&) const { // Not implemented return true; } #if wxUSE_STD_IOSTREAM bool wxPGVariantDataWxObj::Read(wxSTD istream& WXUNUSED(str)) { // Not implemented return false; } #endif bool wxPGVariantDataWxObj::Read(wxString& WXUNUSED(str)) { // Not implemented return false; } // ----------------------------------------------------------------------- // Editor class specific. // noDefCheck = true prevents infinite recursion. wxPGEditor* wxPropertyGrid::RegisterEditorClass( wxPGEditor* editorclass, const wxString& name, bool noDefCheck ) { wxASSERT( editorclass ); WX_PG_GLOBALS_LOCKER() if ( !noDefCheck && wxPGGlobalVars->m_mapEditorClasses.empty() ) RegisterDefaultEditors(); wxPGGlobalVars->m_mapEditorClasses[name] = (void*)editorclass; return editorclass; } // Registers all default editor classes void wxPropertyGrid::RegisterDefaultEditors() { wxPGRegisterDefaultEditorClass( TextCtrl ); wxPGRegisterDefaultEditorClass( Choice ); wxPGRegisterDefaultEditorClass( ComboBox ); wxPGRegisterDefaultEditorClass( TextCtrlAndButton ); #if wxPG_INCLUDE_CHECKBOX wxPGRegisterDefaultEditorClass( CheckBox ); #endif wxPGRegisterDefaultEditorClass( ChoiceAndButton ); // Register SpinCtrl etc. editors before use RegisterAdditionalEditors(); } wxPGEditor* wxPropertyContainerMethods::GetEditorByName( const wxString& editor_name ) { wxPGEditor* editor = (wxPGEditor*) wxPGGlobalVars->m_mapEditorClasses[editor_name]; wxASSERT_MSG( editor, wxT("unregistered editor name") ); return editor; } // ----------------------------------------------------------------------- // wxPGStringTokenizer // Needed to handle C-style string lists (e.g. "str1" "str2") // ----------------------------------------------------------------------- wxPGStringTokenizer::wxPGStringTokenizer( const wxString& str, wxChar delimeter ) : m_str(&str), m_curPos(str.begin()), m_delimeter(delimeter) { } wxPGStringTokenizer::~wxPGStringTokenizer() { } bool wxPGStringTokenizer::HasMoreTokens() { const wxString& str = *m_str; //wxASSERT_MSG( m_curPos != str.end(), wxT("Do not call wxPGStringTokenizer methods after HasMoreTokens has returned false.")); wxString::const_iterator i = m_curPos; wxUniChar delim = m_delimeter; wxUniChar a; wxUniChar prev_a = wxT('\0'); bool inToken = false; while ( i != str.end() ) { a = wxPGGetIterChar(str, i); if ( !inToken ) { if ( a == delim ) { inToken = true; m_readyToken.clear(); } } else { if ( prev_a != wxT('\\') ) { if ( a != delim ) { if ( a != wxT('\\') ) m_readyToken << a; } else { //wxLogDebug(m_readyToken); i++; m_curPos = i; return true; } prev_a = a; } else { m_readyToken << a; prev_a = wxT('\0'); } } i++; } m_curPos = str.end(); if ( inToken ) return true; return false; /* const wxChar* ptr = m_curPos; const wxChar* ptr_end = &m_str->c_str()[m_str->length()]; size_t store_index = 0xFFFFFFFF; #if !wxUSE_STL wxChar* store_ptr_base = (wxChar*) NULL; #endif wxChar delim = m_delimeter; wxChar a = *ptr; wxChar prev_a = 0; while ( a ) { if ( store_index == 0xFFFFFFFF ) { if ( a == delim ) { size_t req_len = ptr_end-ptr+1; #if wxUSE_STL if ( m_readyToken.length() < req_len ) m_readyToken.resize( req_len, wxT(' ') ); #else store_ptr_base = m_readyToken.GetWriteBuf( req_len ); #endif store_index = 0; prev_a = 0; } } else { if ( prev_a != wxT('\\') ) { if ( a != delim ) { if ( a != wxT('\\') ) { #if wxUSE_STL m_readyToken[store_index] = a; #else store_ptr_base[store_index] = a; #endif store_index++; } } else { #if wxUSE_STL m_readyToken[store_index] = 0; m_readyToken.resize(store_index,wxT(' ')); #else store_ptr_base[store_index] = 0; m_readyToken.UngetWriteBuf( store_index ); #endif m_curPos = ptr+1; return true; } prev_a = a; } else { #if wxUSE_STL m_readyToken[store_index] = a; #else store_ptr_base[store_index] = a; #endif store_index++; prev_a = 0; } } ptr++; a = *ptr; } #if !wxUSE_STL if ( store_index != 0xFFFFFFFF ) m_readyToken.UngetWriteBuf( store_index ); #endif m_curPos = (const wxChar*) NULL; return false; */ } wxString wxPGStringTokenizer::GetNextToken() { //wxASSERT_MSG( m_curPos != m_str->end(), wxT("Do not call wxPGStringTokenizer methods after HasMoreTokens has returned false.")); return m_readyToken; } // ----------------------------------------------------------------------- // wxPGChoicesData // ----------------------------------------------------------------------- wxPGChoicesData::wxPGChoicesData() { m_refCount = 1; } wxPGChoicesData::~wxPGChoicesData() { } // ----------------------------------------------------------------------- // wxPGChoices // ----------------------------------------------------------------------- void wxPGChoices::Add( const wxChar* label, int value ) { EnsureData(); if ( value != wxPG_INVALID_VALUE && m_data->m_arrLabels.GetCount() == m_data->m_arrValues.GetCount() ) m_data->m_arrValues.Add( value ); else if ( m_data->m_arrValues.GetCount() > 0 ) m_data->m_arrValues.Add( 0 ); m_data->m_arrLabels.Add ( label ); } // ----------------------------------------------------------------------- #if wxCHECK_VERSION(2,9,0) void wxPGChoices::Insert( const wxString& label, int index, int value ) #else void wxPGChoices::Insert( const wxChar* label, int index, int value ) #endif { EnsureData(); if ( value != wxPG_INVALID_VALUE && m_data->m_arrLabels.GetCount() == m_data->m_arrValues.GetCount() ) m_data->m_arrValues.Insert( value, index ); else if ( m_data->m_arrValues.GetCount() > 0 ) m_data->m_arrValues.Insert( 0, index ); m_data->m_arrLabels.Insert( label, index ); } // ----------------------------------------------------------------------- void wxPGChoices::AddAsSorted( const wxString& label, int value ) { //wxASSERT_MSG( IsOk(), // wxT("do not add items to invalid wxPGChoices") ); EnsureData(); size_t index = 0; wxArrayString& labels = m_data->m_arrLabels; wxArrayInt& values = m_data->m_arrValues; while ( index < labels.GetCount() ) { int cmpRes = labels[index].Cmp(label); if ( cmpRes > 0 ) break; index++; } if ( value != wxPG_INVALID_VALUE && labels.GetCount() == values.GetCount() ) values.Insert ( value, index ); labels.Insert ( label, index ); } // ----------------------------------------------------------------------- void wxPGChoices::Add( const wxChar** labels, const long* values ) { //wxASSERT_MSG( IsOk(), // wxT("do not add items to invalid wxPGChoices") ); EnsureData(); unsigned int itemcount = 0; const wxChar** p = &labels[0]; while ( *p ) { p++; itemcount++; } wxArrayString& i_labels = m_data->m_arrLabels; wxArrayInt& i_values = m_data->m_arrValues; unsigned int i; for ( i = 0; i < itemcount; i++ ) { i_labels.Add ( labels[i] ); } if ( values ) { for ( i = 0; i < itemcount; i++ ) { i_values.Add ( values[i] ); } } } // ----------------------------------------------------------------------- void wxPGChoices::Add( const wxArrayString& arr, const long* values ) { //wxASSERT_MSG( IsOk(), // wxT("do not add items to invalid wxPGChoices") ); EnsureData(); wxArrayString& labels = m_data->m_arrLabels; wxArrayInt& i_values = m_data->m_arrValues; unsigned int i; unsigned int itemcount = arr.GetCount(); for ( i = 0; i < itemcount; i++ ) { labels.Add ( arr[i] ); } if ( values ) { for ( i = 0; i < itemcount; i++ ) i_values.Add ( values[i] ); } } // ----------------------------------------------------------------------- void wxPGChoices::Add( const wxArrayString& arr, const wxArrayInt& arrint ) { //wxASSERT_MSG( IsOk(), // wxT("do not add items to invalid wxPGChoices") ); EnsureData(); wxArrayString& labels = m_data->m_arrLabels; wxArrayInt& values = m_data->m_arrValues; unsigned int i; unsigned int itemcount = arr.GetCount(); for ( i = 0; i < itemcount; i++ ) { labels.Add ( arr[i] ); } if ( &arrint && arrint.GetCount() ) for ( i = 0; i < itemcount; i++ ) { values.Add ( arrint[i] ); } } // ----------------------------------------------------------------------- void wxPGChoices::AssignData( wxPGChoicesData* data ) { Free(); if ( data != wxPGChoicesEmptyData ) { m_data = data; data->m_refCount++; } } // ----------------------------------------------------------------------- void wxPGChoices::Init() { m_data = wxPGChoicesEmptyData; } // ----------------------------------------------------------------------- void wxPGChoices::Free() { if ( m_data != wxPGChoicesEmptyData ) { m_data->m_refCount--; if ( m_data->m_refCount < 1 ) delete m_data; m_data = wxPGChoicesEmptyData; } } // ----------------------------------------------------------------------- // wxPropertyGridEvent // ----------------------------------------------------------------------- IMPLEMENT_DYNAMIC_CLASS(wxPropertyGridEvent, wxCommandEvent) DEFINE_EVENT_TYPE( wxEVT_PG_SELECTED ) DEFINE_EVENT_TYPE( wxEVT_PG_CHANGED ) DEFINE_EVENT_TYPE( wxEVT_PG_HIGHLIGHTED ) DEFINE_EVENT_TYPE( wxEVT_PG_RIGHT_CLICK ) DEFINE_EVENT_TYPE( wxEVT_PG_PAGE_CHANGED ) DEFINE_EVENT_TYPE( wxEVT_PG_ITEM_EXPANDED ) DEFINE_EVENT_TYPE( wxEVT_PG_ITEM_COLLAPSED ) DEFINE_EVENT_TYPE( wxEVT_PG_DOUBLE_CLICK ) wxPropertyGridEvent::wxPropertyGridEvent(wxEventType commandType, int id) : wxCommandEvent(commandType,id) { m_property = NULL; m_pending = false; } // ----------------------------------------------------------------------- wxPropertyGridEvent::wxPropertyGridEvent(const wxPropertyGridEvent& event) : wxCommandEvent(event) { m_eventType = event.GetEventType(); m_eventObject = event.m_eventObject; m_pg = event.m_pg; m_property = event.m_property; m_pending = false; } // ----------------------------------------------------------------------- wxPropertyGridEvent::~wxPropertyGridEvent() { } // ----------------------------------------------------------------------- wxEvent* wxPropertyGridEvent::Clone() const { return new wxPropertyGridEvent( *this ); } // ----------------------------------------------------------------------- // wxPropertyContainerMethods // - common methods for wxPropertyGrid and wxPropertyGridManager - // ----------------------------------------------------------------------- void wxPropertyContainerMethods::DoSetPropertyAttribute( wxPGId id, int attrid, wxVariant& value, long argFlags ) { wxPG_PROP_ID_CALL_PROLOG() p->SetAttribute(attrid,value); if ( ( argFlags & wxPG_RECURSE ) && p->GetParentingType() != 0 ) { wxPGPropertyWithChildren* pwc = (wxPGPropertyWithChildren*)p; size_t i; for ( i = 0; i < pwc->GetCount(); i++ ) DoSetPropertyAttribute(pwc->Item(i),attrid,value,argFlags); } } // ----------------------------------------------------------------------- void wxPropertyGrid::SetPropertyAttributeAll( int attrid, wxVariant value ) { DoSetPropertyAttribute(GetRoot(),attrid,value,wxPG_RECURSE); } // ----------------------------------------------------------------------- void wxPropertyContainerMethods::SetBoolChoices( const wxChar* true_choice, const wxChar* false_choice ) { WX_PG_GLOBALS_LOCKER() wxPGGlobalVars->m_boolChoices[0] = false_choice; wxPGGlobalVars->m_boolChoices[1] = true_choice; } // ----------------------------------------------------------------------- wxPGChoices gs_emptyChoices; wxPGChoices& wxPropertyContainerMethods::GetPropertyChoices( wxPGId id ) { wxPG_PROP_ID_CALL_PROLOG_RETVAL(gs_emptyChoices) wxPGChoiceInfo ci; ci.m_choices = (wxPGChoices*) NULL; p->GetChoiceInfo(&ci); if ( !ci.m_choices ) return gs_emptyChoices; return *ci.m_choices; } // ----------------------------------------------------------------------- wxPGChoices& wxPropertyContainerMethods::GetPropertyChoices( wxPGPropNameStr name ) { wxPG_PROP_NAME_CALL_PROLOG_RETVAL(gs_emptyChoices) return GetPropertyChoices(wxPGIdGen(p)); } // ----------------------------------------------------------------------- wxPGId wxPropertyContainerMethods::DoGetPropertyByName( wxPGPropNameStr name ) const { return m_pState->BaseGetPropertyByName(name); } // ----------------------------------------------------------------------- wxPGId wxPropertyContainerMethods::GetPropertyByName( wxPGPropNameStr name, wxPGPropNameStr subname ) const { wxPGId id = DoGetPropertyByName(name); wxPGPropertyWithChildren* pwc = (wxPGPropertyWithChildren*) wxPGIdToPtr(id); if ( !pwc || !pwc->GetParentingType() ) return wxNullProperty; return wxPGIdGen(pwc->GetPropertyByName(subname)); } // ----------------------------------------------------------------------- // Since GetPropertyByName is used *a lot*, this makes sense // since non-virtual method can be called with less code. wxPGId wxPropertyContainerMethods::GetPropertyByName( wxPGPropNameStr name ) const { wxPGId id = DoGetPropertyByName(name); if ( wxPGIdIsOk(id) ) return id; // Check if its "Property.SubProperty" format int pos = name.Find(wxT('.')); if ( pos <= 0 ) return id; return GetPropertyByName(name.substr(0,pos), name.substr(pos+1,name.length()-pos-1)); } // ----------------------------------------------------------------------- bool wxPropertyContainerMethods::HideProperty( wxPGId id, bool hide ) { // Hiding properties requires that we are always in the compact mode m_pState->GetGrid()->Compact(true); return SetPropertyPriority(id,hide?wxPG_LOW:wxPG_HIGH); } // ----------------------------------------------------------------------- // Used by HideProperty as well bool wxPropertyContainerMethods::SetPropertyPriority( wxPGId id, int priority ) { wxPG_PROP_ID_CALL_PROLOG_RETVAL(false) wxPropertyGrid* pg = m_pState->GetGrid(); if ( pg == p->GetGrid() ) return pg->SetPropertyPriority(p,priority); else m_pState->SetPropertyPriority(p,priority); return true; } // ----------------------------------------------------------------------- bool wxPropertyContainerMethods::SetPropertyMaxLength( wxPGId id, int maxLen ) { wxPG_PROP_ID_CALL_PROLOG_RETVAL(false) wxPropertyGrid* pg = m_pState->GetGrid(); p->m_maxLen = (short) maxLen; // Adjust control if selected currently if ( pg == p->GetGrid() && p == m_pState->GetSelection() ) { wxWindow* wnd = pg->GetEditorControl(); wxTextCtrl* tc = wxDynamicCast(wnd,wxTextCtrl); if ( tc ) tc->SetMaxLength( maxLen ); else // Not a text ctrl return false; } return true; } // ----------------------------------------------------------------------- // GetPropertyValueAsXXX methods #define IMPLEMENT_GET_VALUE(T,TRET,BIGNAME,DEFRETVAL) \ TRET wxPropertyContainerMethods::GetPropertyValueAs##BIGNAME( wxPGId id ) wxPG_GETVALUE_CONST \ { \ wxPG_PROP_ID_CALL_PROLOG_RETVAL(DEFRETVAL) \ if ( p->GetValueTypePtr()->GetTypeName() != wxPGTypeName_##T ) \ { \ wxPGGetFailed(p,wxPGTypeName_##T); \ return (TRET)DEFRETVAL; \ } \ return (TRET)wxPGVariantTo##BIGNAME(p->DoGetValue()); \ } // String is different than others. wxString wxPropertyContainerMethods::GetPropertyValueAsString( wxPGId id ) wxPG_GETVALUE_CONST { wxPG_PROP_ID_CALL_PROLOG_RETVAL(wxEmptyString) return p->GetValueAsString(wxPG_FULL_VALUE); } IMPLEMENT_GET_VALUE(long,long,Long,0) IMPLEMENT_GET_VALUE(long,bool,Bool,false) IMPLEMENT_GET_VALUE(double,double,Double,0.0) IMPLEMENT_GET_VALUE(void,void*,VoidPtr,NULL) #ifdef __WXPYTHON__ IMPLEMENT_GET_VALUE(PyObject,PyObject*,PyObject,Py_None) #endif #if !wxPG_PGVARIANT_IS_VARIANT IMPLEMENT_GET_VALUE(wxArrayString,const wxArrayString&,ArrayString,*((wxArrayString*)NULL)) #endif // wxObject is different than others. const wxObject* wxPropertyContainerMethods::GetPropertyValueAsWxObjectPtr( wxPGId id ) wxPG_GETVALUE_CONST { wxPG_PROP_ID_CALL_PROLOG_RETVAL((const wxObject*)NULL) wxPG_CONST_WXCHAR_PTR typestr = p->GetValueTypePtr()->GetTypeName(); if ( typestr[0] != wxT('w') || typestr[1] != wxT('x') ) { wxPGGetFailed(p,wxT("wxObject")); return (const wxObject*) NULL; } return (const wxObject*)wxPGVariantGetWxObjectPtr(p->DoGetValue()); } // ----------------------------------------------------------------------- bool wxPropertyContainerMethods::IsPropertyExpanded( wxPGId id ) { wxPG_PROP_ID_CALL_PROLOG_RETVAL(false) wxPGPropertyWithChildren* pwc = (wxPGPropertyWithChildren*)p; if ( pwc->GetParentingType() == 0 ) return false; return pwc->IsExpanded(); } // ----------------------------------------------------------------------- // returns value type class for type name wxPGValueType* wxPropertyContainerMethods::GetValueType(const wxString &type) { wxPGHashMapS2P::iterator it; it = wxPGGlobalVars->m_dictValueType.find(type); if ( it != wxPGGlobalVars->m_dictValueType.end() ) return (wxPGValueType*) it->second; return (wxPGValueType*) NULL; } // ----------------------------------------------------------------------- #if wxPG_VALUETYPE_IS_STRING wxPGValueType* wxPropertyContainerMethods::GetValueTypeByName(const wxString &className) { wxPGHashMapS2P::iterator it; it = wxPGGlobalVars->m_dictValueTypeByClass.find(className); if ( it != wxPGGlobalVars->m_dictValueTypeByClass.end() ) return (wxPGValueType*) it->second; return (wxPGValueType*) NULL; } #endif // ----------------------------------------------------------------------- wxPGProperty* wxPropertyContainerMethods::CreatePropertyByType(const wxString &valuetype, const wxString &label, const wxString &name) { wxPGHashMapS2P::iterator it; it = wxPGGlobalVars->m_dictValueType.find(valuetype); if ( it != wxPGGlobalVars->m_dictValueType.end() ) { wxPGValueType* vt = (wxPGValueType*) it->second; wxPGProperty* p = vt->GenerateProperty(label,name); #ifdef __WXDEBUG__ if ( !p ) { wxLogDebug(wxT("WARNING: CreatePropertyByValueType generated NULL property for ValueType \"%s\""),valuetype.c_str()); return (wxPGProperty*) NULL; } #endif return p; } wxLogDebug(wxT("WARNING: No value type registered with name \"%s\""),valuetype.c_str()); return (wxPGProperty*) NULL; } // ----------------------------------------------------------------------- wxPGProperty* wxPropertyContainerMethods::CreatePropertyByClass(const wxString &classname, const wxString &label, const wxString &name) { wxPGHashMapS2P* cis = (wxPGHashMapS2P*) &wxPGGlobalVars->m_dictPropertyClassInfo; const wxString* pClassname = &classname; wxString s; // Translate to long name, if necessary if ( (pClassname->GetChar(0) != wxT('w') || pClassname->GetChar(1) != wxT('x')) && pClassname->Find(wxT("Property")) < 0 ) { if ( classname != wxT("Category") ) s.Printf(wxT("wx%sProperty"),pClassname->c_str()); else s = wxT("wxPropertyCategory"); pClassname = &s; } wxPGHashMapS2P::iterator it; it = cis->find(*pClassname); if ( it != cis->end() ) { wxPGPropertyClassInfo* pci = (wxPGPropertyClassInfo*) it->second; wxPGProperty* p = pci->m_constructor(label,name); return p; } wxLogError(wxT("No such property class: %s"),pClassname->c_str()); return (wxPGProperty*) NULL; } // ----------------------------------------------------------------------- // lazy way to prevent RegisterPropertyClass infinite recursion static int gs_registering_standard_props = 0; bool wxPropertyContainerMethods::RegisterPropertyClass( const wxChar* name, wxPGPropertyClassInfo* classinfo ) { WX_PG_GLOBALS_LOCKER() // Standard classes must be registered first! if ( !gs_registering_standard_props && wxPGGlobalVars->m_dictPropertyClassInfo.empty() ) wxPGRegisterStandardPropertyClasses(); wxPGHashMapS2P::iterator it; it = wxPGGlobalVars->m_dictPropertyClassInfo.find(name); // only register if not registered already if ( it == wxPGGlobalVars->m_dictPropertyClassInfo.end() ) { wxPGGlobalVars->m_dictPropertyClassInfo[name] = classinfo; return true; } wxLogDebug(wxT("WARNING: Property class named \"%s\" was already registered."),name); return false; } // ----------------------------------------------------------------------- static void wxPGRegisterStandardPropertyClasses() { if ( gs_registering_standard_props ) return; gs_registering_standard_props = 1; // no need to reset this wxPGRegisterPropertyClass(wxStringProperty); wxPGRegisterPropertyClass(wxIntProperty); wxPGRegisterPropertyClass(wxUIntProperty); wxPGRegisterPropertyClass(wxFloatProperty); wxPGRegisterPropertyClass(wxBoolProperty); wxPGRegisterPropertyClass(wxEnumProperty); wxPGRegisterPropertyClass(wxFlagsProperty); wxPGRegisterPropertyClass(wxLongStringProperty); wxPGRegisterPropertyClass(wxPropertyCategory); wxPGRegisterPropertyClass(wxParentProperty); wxPGRegisterPropertyClass(wxCustomProperty); // TODO: Are these really "standard" ? wxPGRegisterPropertyClass(wxArrayStringProperty); wxPGRegisterPropertyClass(wxFileProperty); wxPGRegisterPropertyClass(wxDirProperty); #ifdef __WXPYTHON__ wxPropertyContainerMethods::RegisterAdvancedPropertyClasses(); #endif } // ----------------------------------------------------------------------- // wxPropertyGridState // ----------------------------------------------------------------------- // reset helper macro #undef FROM_STATE #define FROM_STATE(A) A // ----------------------------------------------------------------------- // wxPropertyGridState item iteration methods // ----------------------------------------------------------------------- // Skips categories and sub-properties (unless in wxCustomProperty/wxParentProperty). wxPGId wxPropertyGridState::GetFirstProperty() const { if ( !m_properties->GetCount() ) return wxPGIdGen((wxPGProperty*)NULL); wxPGProperty* p = m_properties->Item(0); int parenting = p->GetParentingType(); if ( parenting > 0 ) return GetNextProperty ( wxPGIdGen(p) ); return wxPGIdGen(p); } // ----------------------------------------------------------------------- // Skips categories and sub-properties (unless in wxParentProperty). wxPGId wxPropertyGridState::GetNextProperty( wxPGId id ) const { wxPG_PROP_ID_CALL_PROLOG_RETVAL(wxNullProperty) wxPGPropertyWithChildren* pwc = (wxPGPropertyWithChildren*)p; // Go with first child? int parenting = pwc->GetParentingType(); if ( parenting == 0 || parenting == -1 || !pwc->GetCount() ) { // No... wxPGPropertyWithChildren* parent = pwc->m_parent; // As long as last item, go up and get parent' sibling while ( pwc->m_arrIndex >= (parent->GetCount()-1) ) { pwc = parent; if ( pwc == m_properties ) return wxPGIdGen((wxPGProperty*)NULL); parent = parent->m_parent; } pwc = (wxPGPropertyWithChildren*)parent->Item(pwc->m_arrIndex+1); // Go with the next sibling of parent's parent? } else { // Yes... pwc = (wxPGPropertyWithChildren*)pwc->Item(0); } // If it's category or parentproperty, then go recursive parenting = pwc->GetParentingType(); if ( parenting > PT_NONE ) return GetNextProperty( wxPGIdGen(pwc) ); return wxPGIdGen(pwc); } // ----------------------------------------------------------------------- wxPGId wxPropertyGridState::GetNextSibling( wxPGId id ) { wxPG_PROP_ID_CALL_PROLOG_RETVAL(wxNullProperty) wxPGPropertyWithChildren* parent = p->m_parent; size_t next_ind = p->m_arrIndex + 1; if ( next_ind >= parent->GetCount() ) return wxPGIdGen((wxPGProperty*)NULL); return wxPGIdGen(parent->Item(next_ind)); } // ----------------------------------------------------------------------- wxPGId wxPropertyGridState::GetPrevSibling( wxPGId id ) { wxPG_PROP_ID_CALL_PROLOG_RETVAL(wxNullProperty) size_t ind = p->m_arrIndex; if ( ind < 1 ) return wxPGIdGen((wxPGProperty*)NULL); return wxPGIdGen(p->m_parent->Item(ind-1)); } // ----------------------------------------------------------------------- // Skips categories and sub-properties (unless in wxParentProperty). wxPGId wxPropertyGridState::GetPrevProperty( wxPGId id ) const { wxPG_PROP_ID_CALL_PROLOG_RETVAL(wxNullProperty) wxPGPropertyWithChildren* p2 = (wxPGPropertyWithChildren*) p; wxPGPropertyWithChildren* parent = p2->m_parent; // Is there a previous sibling? if ( p2->m_arrIndex > 0 ) { // There is! p2 = (wxPGPropertyWithChildren*)parent->Item ( p2->m_arrIndex-1 ); int parenting = p2->GetParentingType(); // Do we return it's last child? while ( (parenting > 0 || parenting == PT_CUSTOMPROPERTY) && p2->GetCount() ) { p2 = (wxPGPropertyWithChildren*)p2->Last(); parenting = p2->GetParentingType(); } } else if ( parent != m_properties ) // Return parent if it isnt' the root p2 = parent; else return wxPGIdGen((wxPGProperty*)NULL); // Skip category and parentproperty. int parenting = p2->GetParentingType(); if ( parenting > PT_NONE ) return GetPrevProperty ( wxPGIdGen(p2) ); return wxPGIdGen(p2); } // ----------------------------------------------------------------------- wxPGId wxPropertyGridState::GetFirstCategory() const { //if ( IsInNonCatMode() ) // return wxPGIdGen((wxPGProperty*)NULL); wxPGProperty* found = (wxPGProperty*)NULL; size_t i; for ( i=0; iGetParentingType() > 0 ) { found = p; break; } } return wxPGIdGen(found); } // ----------------------------------------------------------------------- wxPGId wxPropertyGridState::GetNextCategory( wxPGId id ) const { wxPG_PROP_ID_CALL_PROLOG_RETVAL(wxNullProperty) wxPGPropertyWithChildren* current = (wxPGPropertyWithChildren*)p; wxCHECK_MSG( !IsInNonCatMode() || current->GetParentingType() == 1, wxPGIdGen((wxPGProperty*)NULL), wxT("GetNextCategory should not be called with non-category argument in non-categoric mode.") ); wxPGPropertyWithChildren* parent = current->m_parent; wxPGProperty* found = (wxPGProperty*) NULL; size_t i; // Find sub-category, if any. if ( current->GetParentingType() > 0 ) { // Find first sub-category in current's array. for ( i = 0; iGetCount(); i++ ) { wxPGProperty* p = current->Item(i); if ( p->GetParentingType() > 0 ) { found = p; break; } } if ( found ) return wxPGIdGen(found); } // Find next category in parent's array. // (and go up in hierarchy until one found or // top is reached). do { for ( i = current->m_arrIndex+1; iGetCount(); i++ ) { wxPGProperty* p = parent->Item(i); if ( p->GetParentingType() > 0 ) { found = p; break; } } current = parent; parent = parent->m_parent; } while ( !found && parent ); return wxPGIdGen(found); } // ----------------------------------------------------------------------- // wxPropertyGridState GetPropertyXXX methods // ----------------------------------------------------------------------- wxPGId wxPropertyGridState::GetPropertyByLabel( const wxString& label, wxPGPropertyWithChildren* parent ) const { size_t i; if ( !parent ) parent = (wxPGPropertyWithChildren*) &m_regularArray; for ( i=0; iGetCount(); i++ ) { wxPGProperty* p = parent->Item(i); if ( p->m_label == label ) return wxPGIdGen(p); // Check children recursively. if ( p->GetParentingType() != 0 ) { p = wxPGIdToPtr(GetPropertyByLabel(label,(wxPGPropertyWithChildren*)p)); if ( p ) return wxPGIdGen(p); } } return wxPGIdGen((wxPGProperty*) NULL); } // ----------------------------------------------------------------------- wxPGId wxPropertyGridState::BaseGetPropertyByName( wxPGPropNameStr name ) const { wxPGHashMapS2P::const_iterator it; it = m_dictName.find(name); if ( it != m_dictName.end() ) return wxPGIdGen( (wxPGProperty*) it->second ); return wxPGIdGen( (wxPGProperty*) NULL ); } // ----------------------------------------------------------------------- // wxPropertyGridState global operations // ----------------------------------------------------------------------- bool wxPropertyGridState::EnableCategories( bool enable ) { ITEM_ITERATION_VARIABLES if ( enable ) { // // Enable categories // if ( !IsInNonCatMode() ) return false; m_properties = &m_regularArray; // fix parents, indexes, and depths ITEM_ITERATION_INIT_FROM_THE_TOP ITEM_ITERATION_LOOP_BEGIN p->m_arrIndex = i; p->m_parent = parent; // If parent was category, and this is not, // then the depth stays the same. if ( parent->GetParentingType() == 1 && p->GetParentingType() <= 0 ) p->m_depth = parent->m_depth; else p->m_depth = parent->m_depth + 1; ITEM_ITERATION_LOOP_END } else { // // Disable categories // if ( IsInNonCatMode() ) return false; // Create array, if necessary. if ( !m_abcArray ) InitNonCatMode(); m_properties = m_abcArray; // fix parents, indexes, and depths ITEM_ITERATION_INIT_FROM_THE_TOP //ITEM_ITERATION_DCAE_ISP_LOOP_BEGIN ITEM_ITERATION_DCAE_LOOP_BEGIN p->m_arrIndex = i; p->m_parent = parent; p->m_depth = parent->m_depth + 1; //ITEM_ITERATION_DCAE_ISP_LOOP_END ITEM_ITERATION_DCAE_LOOP_END } return true; } // ----------------------------------------------------------------------- static int wxPG_SortFunc(void **p1, void **p2) { wxPGProperty *pp1 = *((wxPGProperty**)p1); wxPGProperty *pp2 = *((wxPGProperty**)p2); return pp1->GetLabel().compare( pp2->GetLabel() ); } void wxPropertyGridState::Sort( wxPGProperty* p ) { if ( !p ) p = (wxPGProperty*)m_properties; wxCHECK_RET( p->GetParentingType() != 0, wxT("cannot sort non-parenting property") ); wxPGPropertyWithChildren* pwc = (wxPGPropertyWithChildren*)p; // Can only sort items with children if ( pwc->m_children.GetCount() < 1 ) return; pwc->m_children.Sort( wxPG_SortFunc ); // Fix indexes pwc->FixIndexesOfChildren(); } // ----------------------------------------------------------------------- void wxPropertyGridState::Sort() { Sort( m_properties ); // Sort categories as well if ( !IsInNonCatMode() ) { size_t i; for ( i=0;iGetCount();i++) { wxPGProperty* p = m_properties->Item(i); if ( p->GetParentingType() > 0 ) Sort ( p ); } } } // ----------------------------------------------------------------------- bool wxPropertyGridState::ExpandAll( unsigned char doExpand ) { ITEM_ITERATION_DCAE_VARIABLES bool isGrid = m_pPropGrid->GetState() == this; if ( isGrid && m_selected && m_selected->GetParent() != m_properties ) { if ( !m_pPropGrid->ClearSelection() ) return false; } if ( !doExpand ) { if ( isGrid ) { if ( !m_pPropGrid->ClearSelection() ) return false; } else m_selected = (wxPGProperty*) NULL; } ITEM_ITERATION_INIT_FROM_THE_TOP ITEM_ITERATION_DCAE_LOOP_BEGIN if ( parenting != 0 ) ((wxPGPropertyWithChildren*)p)->m_expanded = doExpand; ITEM_ITERATION_DCAE_LOOP_END if ( m_pPropGrid->GetState() == this ) { m_pPropGrid->CalculateYs((wxPGPropertyWithChildren*)NULL,-1); m_pPropGrid->RedrawAllVisible(); } return true; } // ----------------------------------------------------------------------- // Used by SetSplitterLeft int wxPropertyGridState::GetLeftSplitterPos(wxClientDC& dc, wxPGPropertyWithChildren* pwc, bool subProps) { wxPropertyGrid* pg = m_pPropGrid; size_t i; int maxW = 0; int w, h; for ( i=0; iGetCount(); i++ ) { wxPGProperty* p = pwc->Item(i); if ( p->GetParentingType() <= 0 ) { dc.GetTextExtent( p->GetLabel(), &w, &h ); w += pg->m_marginWidth + ( ((int)p->m_depth-1) * pg->m_subgroup_extramargin ) + (wxPG_XBEFORETEXT*2); if ( w > maxW ) maxW = w; } if ( p->GetParentingType() && ( subProps || p->GetParentingType() > 0 ) ) { w = GetLeftSplitterPos( dc, (wxPGPropertyWithChildren*) p, subProps ); if ( w > maxW ) maxW = w; } } return maxW; } // ----------------------------------------------------------------------- // wxPropertyGridState property value setting and getting // ----------------------------------------------------------------------- void wxPropertyGridState::SetPropVal( wxPGProperty* p, const wxPGVariant& value ) { p->DoSetValue(value); if ( m_selected==p && this==m_pPropGrid->GetState() ) p->UpdateControl(m_pPropGrid->m_wndPrimary); } // ----------------------------------------------------------------------- bool wxPropertyGridState::ClearPropertyValue( wxPGProperty* p ) { if ( p ) { const wxPGValueType* valueclass = p->GetValueTypePtr(); if ( valueclass != wxPG_VALUETYPE_PTR(none) ) { // wnd_primary has to be given so the editor control can be updated as well. SetPropVal(p,valueclass->GetDefaultValue()); return true; } } return false; } // ----------------------------------------------------------------------- bool wxPropertyGridState::SetPropertyValue( wxPGProperty* p, const wxPGValueType* typeclass, const wxPGVariant& value ) { if ( p ) { if ( p->GetValueTypePtr()->GetTypeName() == typeclass->GetTypeName() ) { CLEAR_PROPERTY_UNSPECIFIED_FLAG(p); SetPropVal(p,value); return true; } wxPGTypeOperationFailed ( p, typeclass->GetTypeName(), wxT("Set") ); } return false; } // ----------------------------------------------------------------------- bool wxPropertyGridState::SetPropertyValue( wxPGProperty* p, const wxChar* typestring, const wxPGVariant& value ) { if ( p ) { if ( wxStrcmp(p->GetValueTypePtr()->GetCustomTypeName(),typestring) == 0 ) { // wnd_primary has to be given so the control can be updated as well. SetPropVal(p,value); return true; } wxPGTypeOperationFailed ( p, typestring, wxT("Set") ); } return false; } // ----------------------------------------------------------------------- bool wxPropertyGridState::SetPropertyValueString( wxPGProperty* p, const wxString& value ) { if ( p ) { int flags = wxPG_REPORT_ERROR|wxPG_FULL_VALUE; CLEAR_PROPERTY_UNSPECIFIED_FLAG(p); if ( p->GetMaxLength() <= 0 ) p->SetValueFromString( value, flags ); else p->SetValueFromString( value.Mid(0,p->GetMaxLength()), flags ); if ( m_selected==p && this==m_pPropGrid->GetState() ) p->UpdateControl(m_pPropGrid->m_wndPrimary); return true; } return false; } // ----------------------------------------------------------------------- bool wxPropertyGridState::SetPropertyValue( wxPGProperty* p, wxVariant& value ) { if ( p ) { CLEAR_PROPERTY_UNSPECIFIED_FLAG(p); p->GetValueTypePtr()->SetValueFromVariant(p,value); if ( m_selected==p && this==m_pPropGrid->GetState() ) p->UpdateControl(m_pPropGrid->m_wndPrimary); return true; } return false; } // ----------------------------------------------------------------------- bool wxPropertyGridState::SetPropertyValueWxObjectPtr( wxPGProperty* p, wxObject* value ) { if ( p ) { if ( wxStrcmp( p->GetValueTypePtr()->GetTypeName(), value->GetClassInfo()->GetClassName() ) == 0 ) { CLEAR_PROPERTY_UNSPECIFIED_FLAG(p); // wnd_primary has to be given so the control can be updated as well. SetPropVal(p,wxPGVariantFromWxObject(value)); return true; } wxPGTypeOperationFailed ( p, wxT("wxObject"), wxT("Set") ); } return false; } // ----------------------------------------------------------------------- void wxPropertyGridState::SetPropertyUnspecified( wxPGProperty* p ) { wxCHECK_RET( p, wxT("invalid property id") ); if ( !(p->m_flags & wxPG_PROP_UNSPECIFIED) ) { // Flag should be set first - editor class methods may need it p->m_flags |= wxPG_PROP_UNSPECIFIED; wxASSERT( m_pPropGrid ); if ( m_pPropGrid->GetState() == this ) { if ( m_pPropGrid->m_selected == p && m_pPropGrid->m_wndPrimary ) { p->GetEditorClass()->SetValueToUnspecified(m_pPropGrid->m_wndPrimary); } } if ( p->GetParentingType() != 0 ) { wxPGPropertyWithChildren* pwc = (wxPGPropertyWithChildren*)p; size_t i; for ( i = 0; i < pwc->GetCount(); i++ ) SetPropertyUnspecified( pwc->Item(i) ); } } } // ----------------------------------------------------------------------- // wxPropertyGridState property operations // ----------------------------------------------------------------------- void wxPropertyGridState::LimitPropertyEditing( wxPGProperty* p, bool limit ) { if ( p ) { if ( limit ) p->m_flags |= wxPG_PROP_NOEDITOR; else p->m_flags &= ~(wxPG_PROP_NOEDITOR); } } // ----------------------------------------------------------------------- void wxPropertyGridState::ClearModifiedStatus( wxPGProperty* p ) { wxPGPropertyWithChildren* pwc = (wxPGPropertyWithChildren*)p; if ( p->m_flags & wxPG_PROP_MODIFIED ) { p->m_flags &= ~(wxPG_PROP_MODIFIED); if ( m_pPropGrid->GetState() == this ) { // Clear active editor bold if ( p == m_selected && m_pPropGrid->m_wndPrimary ) m_pPropGrid->m_wndPrimary->SetFont( m_pPropGrid->GetFont() ); m_pPropGrid->DrawItem( p ); } } if ( pwc->GetParentingType() != 0 ) { size_t i; for ( i = 0; i < pwc->GetCount(); i++ ) ClearModifiedStatus( pwc->Item(i) ); } } // ----------------------------------------------------------------------- bool wxPropertyGridState::Collapse( wxPGProperty* p ) { wxCHECK_MSG( p, false, wxT("invalid property id") ); wxPGPropertyWithChildren* pwc = (wxPGPropertyWithChildren*)p; if ( pwc->GetParentingType() == 0 ) return false; if ( !pwc->m_expanded ) return false; // m_expanded must be set just before call to CalculateYs pwc->m_expanded = 0; return true; } // ----------------------------------------------------------------------- bool wxPropertyGridState::Expand( wxPGProperty* p ) { wxCHECK_MSG( p, false, wxT("invalid property id") ); wxPGPropertyWithChildren* pwc = (wxPGPropertyWithChildren*)p; if ( pwc->GetParentingType() == 0 ) return false; if ( pwc->m_expanded ) return false; // m_expanded must be set just before call to CalculateYs pwc->m_expanded = 1; return true; } // ----------------------------------------------------------------------- bool wxPropertyGridState::DoSelectProperty( wxPGProperty* p, unsigned int flags ) { if ( this == m_pPropGrid->GetState() ) return m_pPropGrid->DoSelectProperty( p, flags ); m_selected = p; return true; } // ----------------------------------------------------------------------- void wxPropertyGridState::SetPropertyLabel( wxPGProperty* p, const wxString& newlabel ) { wxCHECK_RET(p, wxT("invalid property id")); p->SetLabel(newlabel); if ( m_pPropGrid->GetWindowStyleFlag() & wxPG_AUTO_SORT ) Sort(p->GetParent()); } // ----------------------------------------------------------------------- bool wxPropertyGridState::SetPropertyPriority( wxPGProperty* p, int priority ) { int parenting = p->GetParentingType(); if ( priority == wxPG_HIGH ) p->ClearFlag( wxPG_PROP_HIDEABLE ); else p->SetFlag( wxPG_PROP_HIDEABLE ); if ( parenting != 0 ) { wxPGPropertyWithChildren* pwc = (wxPGPropertyWithChildren*)p; size_t i; for ( i = 0; i < pwc->GetCount(); i++ ) SetPropertyPriority(pwc->Item(i),priority); } return true; } // ----------------------------------------------------------------------- void wxPropertyGridState::SetPropertyAndChildrenFlags( wxPGProperty* p, long flags ) { p->m_flags |= flags; if ( p->GetParentingType() != 0 ) { wxPGPropertyWithChildren* pwc = (wxPGPropertyWithChildren*)p; size_t i; for ( i = 0; i < pwc->GetCount(); i++ ) ClearPropertyAndChildrenFlags ( pwc->Item(i), flags ); } } // ----------------------------------------------------------------------- void wxPropertyGridState::ClearPropertyAndChildrenFlags( wxPGProperty* p, long flags ) { p->m_flags &= ~(flags); if ( p->GetParentingType() != 0 ) { wxPGPropertyWithChildren* pwc = (wxPGPropertyWithChildren*)p; size_t i; for ( i = 0; i < pwc->GetCount(); i++ ) ClearPropertyAndChildrenFlags ( pwc->Item(i), flags ); } } // ----------------------------------------------------------------------- bool wxPropertyGridState::EnableProperty( wxPGProperty* p, bool enable ) { if ( p ) { if ( enable ) { if ( !(p->m_flags & wxPG_PROP_DISABLED) ) return false; // Enabling p->m_flags &= ~(wxPG_PROP_DISABLED); } else { if ( p->m_flags & wxPG_PROP_DISABLED ) return false; // Disabling p->m_flags |= wxPG_PROP_DISABLED; } if ( p->GetParentingType() == 0 ) return true; // Apply same to sub-properties as well wxPGPropertyWithChildren* pwc = (wxPGPropertyWithChildren*)p; size_t i; for ( i = 0; i < pwc->GetCount(); i++ ) EnableProperty ( pwc->Item(i), enable ); return true; } return false; } // ----------------------------------------------------------------------- // wxPropertyGridState wxVariant related routines // ----------------------------------------------------------------------- // Returns list of wxVariant objects (non-categories and non-sub-properties only). // Never includes sub-properties (unless they are parented by wxParentProperty). wxVariant wxPropertyGridState::GetPropertyValues( const wxString& listname, wxPGId baseparent, long flags ) const { ITEM_ITERATION_DCAE_VARIABLES wxPGPropertyWithChildren* pwc = (wxPGPropertyWithChildren*)wxPGIdToPtr(baseparent); // Root is the default base-parent. if ( !pwc ) pwc = m_properties; wxVariantList temp_list; wxVariant v( temp_list, listname ); if ( flags & wxPG_KEEP_STRUCTURE ) { wxASSERT( (pwc->GetParentingType() < -1) || (pwc->GetParentingType() > 0) ); size_t i; for ( i=0; iGetCount(); i++ ) { wxPGProperty* p = pwc->Item(i); int parenting = p->GetParentingType(); if ( parenting == 0 || parenting == -1 ) { v.Append( p->GetValueAsVariant() ); } else { v.Append( GetPropertyValues(p->m_name,wxPGIdGen(p),wxPG_KEEP_STRUCTURE) ); } } } else { ITEM_ITERATION_INIT((wxPGPropertyWithChildren*)wxPGIdToPtr(baseparent),0) ITEM_ITERATION_DCAE_ISP_LOOP_BEGIN // Use a trick to ignore wxParentProperty itself, but not its sub-properties. if ( parenting == PT_CUSTOMPROPERTY ) { parenting = PT_CAPTION; } else if ( parenting <= 0 ) { v.Append ( p->GetValueAsVariant() ); } ITEM_ITERATION_DCAE_ISP_LOOP_END } return v; } // ----------------------------------------------------------------------- void wxPropertyGridState::SetPropertyValues( const wxVariantList& list, wxPGId default_category ) { unsigned char origFrozen = 1; if ( m_pPropGrid->GetState() == this ) { origFrozen = m_pPropGrid->m_frozen; if ( !origFrozen ) m_pPropGrid->Freeze(); } wxPropertyCategoryClass* use_category = (wxPropertyCategoryClass*)wxPGIdToPtr(default_category); if ( !use_category ) use_category = (wxPropertyCategoryClass*)m_properties; // Let's iterate over the list of variants. wxVariantList::const_iterator node; //for ( wxVariantList::Node *node = list.GetFirst(); node; node = node->GetNext() ) for ( node = list.begin(); node != list.end(); node++ ) { wxVariant *current = (wxVariant*)*node; // Make sure it is wxVariant. wxASSERT( current ); wxASSERT( wxStrcmp(current->GetClassInfo()->GetClassName(),wxT("wxVariant")) == 0 ); if ( current->GetName().length() > 0 ) { wxPGId foundProp = BaseGetPropertyByName(current->GetName()); if ( wxPGIdIsOk(foundProp) ) { wxPGProperty* p = wxPGIdToPtr(foundProp); const wxPGValueType* vtype = p->GetValueTypePtr(); // If it was a list, we still have to go through it. if ( current->GetType() == wxT("list") ) { SetPropertyValues( current->GetList(), wxPGIdGen( p->GetParentingType()>0?p:((wxPGProperty*)NULL) ) ); } else { #ifdef __WXDEBUG__ if ( current->GetType() != vtype->GetTypeName() && current->GetType() != vtype->GetCustomTypeName() ) { wxLogDebug(wxT("wxPropertyGridState::SetPropertyValues Warning: Setting value of property \"%s\" from variant"), p->m_name.c_str()); wxLogDebug(wxT(" but variant's type name (%s) doesn't match either base type name (%s) nor custom type name (%s)."), #ifndef __WXPYTHON__ current->GetType().c_str(),vtype->GetTypeName(),vtype->GetCustomTypeName()); #else current->GetType().c_str(),vtype->GetTypeName().c_str(),vtype->GetCustomTypeName().c_str()); #endif } #endif vtype->SetValueFromVariant(p,*current); } } else { // Is it list? if ( current->GetType() != wxT("list") ) { // Not. AppendIn(use_category,current->GetName(),wxPG_LABEL,(wxVariant&)*current); } else { // Yes, it is; create a sub category and append contents there. wxPGId newCat = DoInsert(use_category,-1,new wxPropertyCategoryClass(current->GetName(),wxPG_LABEL)); SetPropertyValues( current->GetList(), newCat ); } } } } if ( !origFrozen ) { m_pPropGrid->Thaw(); if ( this == m_pPropGrid->GetState() ) { m_selected->UpdateControl(m_pPropGrid->m_wndPrimary); } } } // ----------------------------------------------------------------------- // wxPropertyGridState property adding and removal // ----------------------------------------------------------------------- // Call for after sub-properties added with AddChild void wxPGPropertyWithChildren::PrepareSubProperties() { // TODO: When in 1.0.5, move extra stuff from AddChild to here. wxPropertyGridState* state = GetParentState(); wxASSERT(state); if ( !GetCount() ) return; wxByte depth = m_depth + 1; wxByte depthBgCol = m_depthBgCol; wxByte inheritFlags = m_flags & wxPG_INHERITED_PROPFLAGS; wxByte bgColIndex = m_bgColIndex; wxByte fgColIndex = m_fgColIndex; // // Set some values to the children // size_t i = 0; wxPGPropertyWithChildren* nparent = this; while ( i < nparent->GetCount() ) { wxPGProperty* np = nparent->Item(i); np->m_flags |= inheritFlags; // Hideable also if parent. np->m_depth = depth; np->m_depthBgCol = depthBgCol; np->m_bgColIndex = bgColIndex; np->m_fgColIndex = fgColIndex; // Also handle children of children if ( np->GetParentingType() != 0 && ((wxPGPropertyWithChildren*)np)->GetCount() > 0 ) { nparent = (wxPGPropertyWithChildren*) np; i = 0; // Init nparent->m_expanded = 0; nparent->m_parentState = state; depth++; } else { // Next sibling i++; } // After reaching last sibling, go back to processing // siblings of the parent while ( i >= nparent->GetCount() ) { // Exit the loop when top parent hit if ( nparent == this ) break; depth--; i = nparent->GetArrIndex() + 1; nparent = nparent->GetParent(); } } } // ----------------------------------------------------------------------- // Call after fixed sub-properties added/removed after creation. // if oldSelInd >= 0 and < new max items, then selection is // moved to it. Note: oldSelInd -2 indicates that this property // should be selected. void wxPGPropertyWithChildren::SubPropsChanged( int oldSelInd ) { wxPropertyGridState* state = GetParentState(); wxPropertyGrid* grid = state->GetGrid(); PrepareSubProperties(); wxPGProperty* sel = (wxPGProperty*) NULL; if ( oldSelInd >= (int)m_children.GetCount() ) oldSelInd = (int)m_children.GetCount() - 1; if ( oldSelInd >= 0 ) sel = (wxPGProperty*) m_children[oldSelInd]; else if ( oldSelInd == -2 ) sel = this; if ( sel ) state->DoSelectProperty(sel); if ( state == grid->GetState() ) { if ( m_expanded ) grid->CalculateYs( GetParent(), m_arrIndex ); grid->Refresh(); } } // ----------------------------------------------------------------------- int wxPropertyGridState::PrepareToAddItem( wxPGProperty* property, wxPGPropertyWithChildren* scheduledParent ) { wxPropertyGrid* propGrid = m_pPropGrid; wxASSERT( propGrid ); int parenting = property->GetParentingType(); // This will allow better behaviour. if ( scheduledParent == m_properties ) scheduledParent = (wxPGPropertyWithChildren*) NULL; if ( parenting > 0 ) { /* if ( scheduledParent ) wxLogDebug(wxT("scheduledParent= %s, %i"), scheduledParent->GetName().c_str(), (int)scheduledParent->GetParentingType()); */ // Parent of a category must be either root or another category // (otherwise Bad Things might happen). wxASSERT_MSG( scheduledParent == (wxPGPropertyWithChildren*) NULL || scheduledParent == m_properties || scheduledParent->GetParentingType() > 0, wxT("Parent of a category must be either root or another category.")); /* wxASSERT_MSG( m_properties == &m_regularArray, wxT("Do not add categories in non-categoric mode!")); */ // If we already have category with same name, delete given property // and use it instead as most recent caption item. wxPGId found_id = BaseGetPropertyByName( property->GetName() ); if ( wxPGIdIsOk(found_id) ) { wxPropertyCategoryClass* pwc = (wxPropertyCategoryClass*)wxPGIdToPtr(found_id); if ( pwc->GetParentingType() > 0 ) // Must be a category. { delete property; m_currentCategory = pwc; return 2; // Tells the caller what we did. } } } #ifdef __WXDEBUG__ // Warn for identical names in debug mode. if ( property->GetName().length() && wxPGIdIsOk(BaseGetPropertyByName(property->GetName())) && (!scheduledParent || scheduledParent->GetParentingType() >= 1) ) wxLogError(wxT("wxPropertyGrid: Warning - item with name \"%s\" already exists."), property->GetName().c_str()); #endif // Make sure nothing is selected. if ( propGrid && propGrid->m_selected ) { bool selRes = propGrid->ClearSelection(); wxPG_CHECK_MSG_DBG( selRes, -1, wxT("failed to deselect a property (editor probably had invalid value)") ); } property->m_y = -1; if ( scheduledParent ) { // Use parent's colours. property->m_bgColIndex = scheduledParent->m_bgColIndex; property->m_fgColIndex = scheduledParent->m_fgColIndex; } // If in hideable adding mode, or if assigned parent is hideable, then // make this one hideable. if ( ( scheduledParent && (scheduledParent->m_flags & wxPG_PROP_HIDEABLE) ) || ( propGrid && (propGrid->m_iFlags & wxPG_FL_ADDING_HIDEABLES) ) ) property->SetFlag ( wxPG_PROP_HIDEABLE ); // Set custom image flag. int custImgHeight = property->GetImageSize().y; if ( custImgHeight < 0 /*|| custImgHeight > 1*/ ) { property->m_flags |= wxPG_PROP_CUSTOMIMAGE; } if ( propGrid->GetWindowStyleFlag() & wxPG_LIMITED_EDITING ) property->m_flags |= wxPG_PROP_NOEDITOR; if ( parenting < 1 ) { // This is not a category. wxASSERT_MSG( property->GetEditorClass(), wxT("Editor class not initialized!") ); // Depth. // unsigned char depth = 1; if ( scheduledParent ) { depth = scheduledParent->m_depth; if ( scheduledParent->GetParentingType() != PT_CAPTION ) depth++; } property->m_depth = depth; unsigned char greyDepth = depth; if ( scheduledParent ) { wxPropertyCategoryClass* pc; if ( scheduledParent->GetParentingType() >= PT_CAPTION ) pc = (wxPropertyCategoryClass*)scheduledParent; else // This conditional compile is necessary to // bypass some compiler bug. pc = wxPropertyGrid::_GetPropertyCategory(scheduledParent); if ( pc ) greyDepth = pc->GetDepth(); else greyDepth = scheduledParent->m_depthBgCol; } property->m_depthBgCol = greyDepth; // Add children to propertywithchildren. if ( parenting < PT_NONE ) { wxPGPropertyWithChildren* pwc = (wxPGPropertyWithChildren*)property; pwc->m_parentState = this; pwc->m_expanded = 0; // Properties with children are not expanded by default. if ( propGrid && propGrid->GetWindowStyleFlag() & wxPG_HIDE_MARGIN ) pwc->m_expanded = 1; // ...unless it cannot not be expanded. if ( pwc->GetCount() ) { pwc->PrepareSubProperties(); } // // If children were added prior to append, then this is considered // a "fixed" parent (otherwise the PT_CUSTOMPROPERTY is set, see below, // to mark it as customizable). /*if ( pwc->GetCount() ) { pwc->PrepareSubProperties(); } else { pwc->m_parentingType = PT_CUSTOMPROPERTY; }*/ } } else { // This is a category. // depth unsigned char depth = 1; if ( scheduledParent ) { depth = scheduledParent->m_depth + 1; } property->m_depth = depth; property->m_depthBgCol = depth; m_currentCategory = (wxPropertyCategoryClass*)property; wxPropertyCategoryClass* pc = (wxPropertyCategoryClass*)property; pc->m_parentState = this; // Calculate text extent for caption item. pc->CalculateTextExtent(propGrid,propGrid->GetCaptionFont()); } return parenting; } // ----------------------------------------------------------------------- void wxPropertyContainerMethods::BeginAddChildren( wxPGId id ) { wxPGPropertyWithChildren* pwc = (wxPGPropertyWithChildren*) wxPGIdToPtr(id); wxCHECK_RET( pwc, wxT("NULL property") ); wxCHECK_RET( pwc->GetParentingType() == PT_FIXEDCHILDREN, wxT("only call on properties with fixed children") ); pwc->m_parentingType = PT_CUSTOMPROPERTY; } // ----------------------------------------------------------------------- void wxPropertyContainerMethods::EndAddChildren( wxPGId id ) { wxPGPropertyWithChildren* pwc = (wxPGPropertyWithChildren*) wxPGIdToPtr(id); wxCHECK_RET( pwc, wxT("NULL property") ); wxCHECK_RET( pwc->GetParentingType() == PT_CUSTOMPROPERTY, wxT("only call on properties for which BeginAddChildren was called prior") ); pwc->m_parentingType = PT_FIXEDCHILDREN; } // ----------------------------------------------------------------------- wxPGId wxPropertyGridState::Append( wxPGProperty* property ) { wxPropertyCategoryClass* cur_cat = m_currentCategory; if ( property->GetParentingType() > 0 ) cur_cat = (wxPropertyCategoryClass*) NULL; return DoInsert( cur_cat, -1, property ); } // ----------------------------------------------------------------------- wxPGId wxPropertyGridState::DoInsert( wxPGPropertyWithChildren* parent, int index, wxPGProperty* property ) { if ( !parent ) parent = m_properties; wxPropertyGrid* propGrid = m_pPropGrid; wxCHECK_MSG( parent->GetParentingType() != PT_NONE, wxNullProperty, wxT("this parent cannot accomodate children") ); wxCHECK_MSG( parent->GetParentingType() != PT_FIXEDCHILDREN, wxNullProperty, wxT("when adding properties to fixed parents, use BeginAddChildren and EndAddChildren.") ); int parenting = PrepareToAddItem( property, (wxPropertyCategoryClass*)parent ); // This type of invalid parenting value indicates we should exit now, returning // id of most recent category. if ( parenting > PT_CAPTION ) return wxPGIdGen(m_currentCategory); // Note that item must be added into current mode later. // If parent is wxParentProperty, just stick it in... // If parent is root (m_properties), then... // In categoric mode: Add as last item in m_abcArray (if not category). // Add to given index in m_regularArray. // In non-cat mode: Add as last item in m_regularArray. // Add to given index in m_abcArray. // If parent is category, then... // 1) Add to given category in given index. // 2) Add as last item in m_abcArray. int parents_parenting = parent->GetParentingType(); if ( parents_parenting < 0 ) { // Parent is wxParentingProperty: Just stick it in... parent->AddChild2( property, index ); } else { // Parent is Category or Root. if ( m_properties == &m_regularArray ) { // Categorized mode // Only add non-categories to m_abcArray. if ( m_abcArray && parenting <= 0 ) m_abcArray->AddChild2( property, -1, false ); // Add to current mode. parent->AddChild2( property, index ); } else { // Non-categorized mode. if ( parent != m_properties ) // Parent is category. parent->AddChild2( property, index, false ); else // Parent is root. m_regularArray.AddChild2( property, -1, false ); // Add to current mode (no categories). if ( parenting <= 0 ) m_abcArray->AddChild2( property, index ); } } // category stuff if ( parenting > PT_NONE ) { // This is a category caption item. // Last caption is not the bottom one (this info required by append) m_lastCaptionBottomnest = 0; } // Only add name to hashmap if parent is root or category if ( parent->GetParentingType() >= PT_CAPTION && property->m_name.length() ) m_dictName[property->m_name] = (void*) property; m_itemsAdded = 1; if ( propGrid ) propGrid->m_bottomy = 0; // this signals y recalculation return wxPGIdGen(property); } // ----------------------------------------------------------------------- wxPGId wxPropertyGridState::AppendIn( wxPGPropertyWithChildren* pwc, const wxString& label, const wxString& propname, wxVariant& value ) { wxPGProperty* p = wxPropertyContainerMethods:: CreatePropertyByType(value.GetType(),label,propname); if ( p ) { p->GetValueTypePtr()->SetValueFromVariant(p,value); return DoInsert(pwc,-1,p); } return wxPGIdGen((wxPGProperty*)NULL); } // ----------------------------------------------------------------------- void wxPropertyGridState::DoDelete( wxPGProperty* item ) { wxCHECK_RET( item != &m_regularArray && item != m_abcArray, wxT("wxPropertyGrid: Do not attempt to remove the root item.") ); size_t i; int parenting = item->GetParentingType(); unsigned int indinparent = item->GetIndexInParent(); wxPGPropertyWithChildren* pwc = (wxPGPropertyWithChildren*)item; wxCHECK_RET( item->GetParent()->GetParentingType() != -1, wxT("wxPropertyGrid: Do not attempt to remove sub-properties.") ); if ( parenting > 0 ) { // deleting a category // erase category entries from the hash table for ( i=0; iGetCount(); i++ ) { wxPGProperty* sp = pwc->Item( i ); if ( sp->GetName().Len() ) m_dictName.erase( wxPGNameConv(sp->GetName()) ); } if ( pwc == m_currentCategory ) m_currentCategory = (wxPropertyCategoryClass*) NULL; if ( m_abcArray ) { // Remove children from non-categorized array. for ( i=0; iGetCount(); i++ ) { wxPGProperty * p = pwc->Item( i ); wxASSERT( p != NULL ); if ( p->GetParentingType() <= PT_NONE ) m_abcArray->m_children.Remove( (void*)p ); } if ( IsInNonCatMode() ) m_abcArray->FixIndexesOfChildren(); } } if ( !IsInNonCatMode() ) { // categorized mode - non-categorized array // Remove from non-cat array, but only if parent is in it if ( parenting <= 0 && item->GetParent()->GetParentingType() == PT_CAPTION ) { if ( m_abcArray ) { m_abcArray->m_children.Remove( item ); } } // categorized mode - categorized array item->m_parent->m_children.RemoveAt(indinparent); item->m_parent->FixIndexesOfChildren(/*indinparent*/); } else { // non-categorized mode - categorized array // We need to find location of item. wxPGPropertyWithChildren* cat_parent = &m_regularArray; int cat_index = m_regularArray.GetCount(); size_t i; for ( i = 0; i < m_regularArray.GetCount(); i++ ) { wxPGProperty* p = m_regularArray.Item(i); if ( p == item ) { cat_index = i; break; } if ( p->GetParentingType() > 0 ) { int subind = ((wxPGPropertyWithChildren*)p)->Index(item); if ( subind != wxNOT_FOUND ) { cat_parent = ((wxPGPropertyWithChildren*)p); cat_index = subind; break; } } } cat_parent->m_children.RemoveAt(cat_index); // non-categorized mode - non-categorized array if ( parenting <= 0 ) { wxASSERT( item->m_parent == m_abcArray ); item->m_parent->m_children.RemoveAt(indinparent); item->m_parent->FixIndexesOfChildren(indinparent); } } if ( item->GetName().Len() ) m_dictName.erase( wxPGNameConv(item->GetName()) ); #ifdef __WXPYTHON__ // For some reason, Py_DECREF always crashes, even though we make // matching Py_INCREF call in propgrid_cbacks.cpp. Maybe refcount is decremented // somewhere automatically? Unlikely though... //if ( item->m_scriptObject ) // Py_DECREF( item->m_scriptObject ); #endif // We can actually delete it now delete item; m_itemsAdded = 1; // Not a logical assignment (but required nonetheless). if ( this == m_pPropGrid->GetState() ) { //m_pPropGrid->m_clearThisMany = 1; m_pPropGrid->m_bottomy = 0; // this signals y recalculation } } // ----------------------------------------------------------------------- // wxPropertyGridState init etc. // ----------------------------------------------------------------------- void wxPropertyGridState::InitNonCatMode() { ITEM_ITERATION_DCAE_VARIABLES if ( !m_abcArray ) { m_abcArray = new wxPGRootPropertyClass(); m_abcArray->SetParentState(this); m_abcArray->m_expanded = wxPG_EXP_OF_COPYARRAY; } // Must be called when FROM_STATE(m_properties) still points to regularArray. wxPGPropertyWithChildren* oldProperties = m_properties; // Must use temp value in FROM_STATE(m_properties) for item iteration loop // to run as expected. m_properties = &m_regularArray; // Copy items. ITEM_ITERATION_INIT_FROM_THE_TOP ITEM_ITERATION_DCAE_ISP_LOOP_BEGIN if ( parenting < 1 && ( parent == m_properties || parent->GetParentingType() > 0 ) ) { m_abcArray->AddChild2 ( p ); p->m_parent = &FROM_STATE(m_regularArray); } //else wxLogDebug("OUT: %s",p->m_label.c_str()); ITEM_ITERATION_DCAE_ISP_LOOP_END m_properties = oldProperties; } // ----------------------------------------------------------------------- void wxPropertyGridState::Clear() { m_regularArray.Empty(); if ( m_abcArray ) m_abcArray->Empty(); m_dictName.clear(); m_currentCategory = (wxPropertyCategoryClass*) NULL; m_lastCaptionBottomnest = 1; m_itemsAdded = 0; m_selected = (wxPGProperty*) NULL; } // ----------------------------------------------------------------------- wxPropertyGridState::wxPropertyGridState() { m_pPropGrid = (wxPropertyGrid*) NULL; m_regularArray.SetParentState(this); m_properties = &m_regularArray; m_abcArray = (wxPGRootPropertyClass*) NULL; m_currentCategory = (wxPropertyCategoryClass*) NULL; m_selected = (wxPGProperty*) NULL; m_lastCaptionBottomnest = 1; m_itemsAdded = 0; m_anyModified = 0; } // ----------------------------------------------------------------------- wxPropertyGridState::~wxPropertyGridState() { delete m_abcArray; } // ----------------------------------------------------------------------- // wxPropertyGridPopulator // ----------------------------------------------------------------------- void wxPropertyGridPopulator::Init( wxPropertyGrid* pg, wxPGId popRoot ) { WX_PG_GLOBALS_LOCKER() m_propGrid = pg; m_popRoot = popRoot; wxPGGlobalVars->m_offline++; } // ----------------------------------------------------------------------- wxPropertyGridPopulator::~wxPropertyGridPopulator() { // // Free unused sets of choices wxPGHashMapP2P::iterator it; for( it = m_dictIdChoices.begin(); it != m_dictIdChoices.end(); ++it ) { wxPGChoicesData* data = (wxPGChoicesData*) it->second; data->m_refCount--; if ( data->m_refCount < 1 ) delete data; } wxPGGlobalVars->m_offline--; } // ----------------------------------------------------------------------- bool wxPropertyGridPopulator::HasChoices( wxPGChoicesId id ) const { wxPGHashMapP2P::const_iterator it = m_dictIdChoices.find(id); return ( it != m_dictIdChoices.end() ); } // ----------------------------------------------------------------------- bool wxPropertyGridPopulator::BeginChildren() { if ( wxPGIdIsOk(m_lastProperty) && wxPGIdToPtr(m_lastProperty)->CanHaveExtraChildren() ) { wxLogDebug(wxT("New Parent: %s"),wxPGIdToPtr(m_lastProperty)->GetLabel().c_str()); m_curParent = m_lastProperty; return true; } return false; } // ----------------------------------------------------------------------- void wxPropertyGridPopulator::AddChoices(wxPGChoicesId choicesId, const wxArrayString& choiceLabels, const wxArrayInt& choiceValues) { #ifdef __WXDEBUG__ // Make sure the id is not used yet wxPGHashMapP2P::iterator it = m_dictIdChoices.find(choicesId); wxCHECK_RET( it == m_dictIdChoices.end(), wxT("added set of choices to same id twice (use HasChoices if necessary)") ); #endif wxCHECK_RET( choicesId != (wxPGChoicesId)0, wxT("choicesId must not be 0/NULL")); wxPGChoices chs(choiceLabels,choiceValues); wxPGChoicesData* data = chs.ExtractData(); m_dictIdChoices[choicesId] = (void*) data; // Artifically reduce refcount to 0 (since nothing uses it yet) //data->m_refCount = 0; } // ----------------------------------------------------------------------- wxPGId wxPropertyGridPopulator::DoAppend(wxPGProperty* p, const wxString& value, const wxString& attributes, wxPGChoicesId choicesId, const wxArrayString& choiceLabels, const wxArrayInt& choiceValues) { wxASSERT( m_propGrid ); // Make sure m_curParent is ok if ( !wxPGIdIsOk(m_curParent) ) { if ( !wxPGIdIsOk(m_popRoot) ) m_popRoot = m_propGrid->GetRoot(); m_curParent = m_popRoot; } if ( p ) { // Set choices if ( choicesId ) { wxPGHashMapP2P::iterator it = m_dictIdChoices.find(choicesId); wxPGChoices chs; if ( it != m_dictIdChoices.end() ) { // Already found wxPGChoicesData* foundData = (wxPGChoicesData*) it->second; chs.AssignData(foundData); } else { chs.Set(choiceLabels,choiceValues); m_dictIdChoices[choicesId] = (void*) chs.GetData(); } p->SetChoices(chs); } // Value setter must be before append if ( value.length() ) { p->SetValueFromString(value,wxPG_FULL_VALUE); } // Set attributes if ( attributes.length() ) wxPropertyGrid::SetPropertyAttributes(p,attributes); // Append to grid m_propGrid->AppendIn(m_curParent,p); m_lastProperty = p; } return wxPGIdGen(p); } // ----------------------------------------------------------------------- wxPGId wxPropertyGridPopulator::AppendByClass(const wxString& classname, const wxString& label, const wxString& name, const wxString& value, const wxString& attributes, wxPGChoicesId choicesId, const wxArrayString& choiceLabels, const wxArrayInt& choiceValues) { wxPGProperty* p = m_propGrid->CreatePropertyByClass(classname,label,name); return DoAppend(p,value,attributes,choicesId,choiceLabels,choiceValues); } // ----------------------------------------------------------------------- wxPGId wxPropertyGridPopulator::AppendByType(const wxString& valuetype, const wxString& label, const wxString& name, const wxString& value, const wxString& attributes, wxPGChoicesId choicesId, const wxArrayString& choiceLabels, const wxArrayInt& choiceValues) { wxPGProperty* p = m_propGrid->CreatePropertyByType(valuetype,label,name); return DoAppend(p,value,attributes,choicesId,choiceLabels,choiceValues); } // ----------------------------------------------------------------------- wxformbuilder-3.1.59/src/controls/src/propgrid/props.cpp0000644000175000017500000022024011143440027023666 0ustar rrmulderrrmulder///////////////////////////////////////////////////////////////////////////// // Name: props.cpp // Purpose: Basic Property Classes // Author: Jaakko Salli // Modified by: // Created: May-14-2004 // RCS-ID: $Id: // Copyright: (c) Jaakko Salli // Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// // For compilers that support precompilation, includes "wx/wx.h". #include "wx/wxprec.h" #ifdef __BORLANDC__ #pragma hdrstop #endif #ifndef WX_PRECOMP #include "wx/defs.h" #include "wx/object.h" #include "wx/hash.h" #include "wx/string.h" #include "wx/log.h" #include "wx/event.h" #include "wx/window.h" #include "wx/panel.h" #include "wx/dc.h" #include "wx/dcclient.h" #include "wx/dcmemory.h" #include "wx/button.h" #include "wx/pen.h" #include "wx/brush.h" #include "wx/cursor.h" #include "wx/dialog.h" #include "wx/settings.h" #include "wx/msgdlg.h" #include "wx/choice.h" #include "wx/stattext.h" #include "wx/scrolwin.h" #include "wx/dirdlg.h" #include "wx/combobox.h" #include "wx/layout.h" #include "wx/sizer.h" #include "wx/textdlg.h" #include "wx/filedlg.h" #include "wx/statusbr.h" #include "wx/intl.h" #include "wx/frame.h" #endif #include #include #include #define wxPG_CUSTOM_IMAGE_WIDTH 20 // for wxColourProperty etc. // ----------------------------------------------------------------------- // wxStringProperty // ----------------------------------------------------------------------- WX_PG_IMPLEMENT_PROPERTY_CLASS(wxStringProperty,wxBaseProperty, wxString,const wxString&,TextCtrl) wxStringPropertyClass::wxStringPropertyClass( const wxString& label, const wxString& name, const wxString& value ) : wxPGProperty(label,name) { DoSetValue(value); } wxStringPropertyClass::~wxStringPropertyClass() { } void wxStringPropertyClass::DoSetValue( wxPGVariant value ) { m_value = wxPGVariantToString(value); } wxPGVariant wxStringPropertyClass::DoGetValue() const { return wxPGVariant(m_value); } wxString wxStringPropertyClass::GetValueAsString( int argFlags ) const { // If string is password and value is for visual purposes, // then return asterisks instead the actual string. if ( (m_flags & wxPG_PROP_PASSWORD) && !(argFlags & wxPG_FULL_VALUE) ) return wxString(wxChar('*'), m_value.Length()); return m_value; } bool wxStringPropertyClass::SetValueFromString( const wxString& text, int ) { if ( m_value != text ) return StdValidationProcedure(text); return false; } void wxStringPropertyClass::SetAttribute( int id, wxVariant& value ) { if ( id == wxPG_STRING_PASSWORD ) { m_flags &= ~(wxPG_PROP_PASSWORD); if ( value.GetLong() ) m_flags |= wxPG_PROP_PASSWORD; RecreateEditor(); } } // ----------------------------------------------------------------------- // wxIntProperty // ----------------------------------------------------------------------- wxPG_BEGIN_PROPERTY_CLASS_BODY(wxIntProperty,wxPGProperty,long,long) WX_PG_DECLARE_BASIC_TYPE_METHODS() virtual bool SetValueFromInt( long value, int flags ); #if wxUSE_VALIDATORS static wxValidator* GetClassValidator(); virtual wxValidator* DoGetValidator() const; #endif wxPG_END_PROPERTY_CLASS_BODY() WX_PG_IMPLEMENT_PROPERTY_CLASS(wxIntProperty,wxBaseProperty, long,long,TextCtrl) wxIntPropertyClass::wxIntPropertyClass( const wxString& label, const wxString& name, long value ) : wxPGProperty(label,name) { DoSetValue(value); } wxIntPropertyClass::~wxIntPropertyClass() { } void wxIntPropertyClass::DoSetValue( wxPGVariant value ) { m_value = wxPGVariantToLong(value); } wxPGVariant wxIntPropertyClass::DoGetValue() const { return wxPGVariant(m_value); } wxString wxIntPropertyClass::GetValueAsString( int ) const { return wxString::Format(wxT("%li"),m_value); } bool wxIntPropertyClass::SetValueFromString( const wxString& text, int argFlags ) { wxString s; long value; if ( text.length() == 0 ) { SetValueToUnspecified(); return true; } // We know it is a number, but let's still check // the return value. if ( text.IsNumber() && text.ToLong( &value, 0 ) ) { if ( m_value != value ) { return StdValidationProcedure(value); } } else if ( argFlags & wxPG_REPORT_ERROR ) { s.Printf( wxT("! %s: \"%s\" is not a number."), m_label.c_str(), text.c_str() ); ShowError(s); } return false; } bool wxIntPropertyClass::SetValueFromInt( long value, int WXUNUSED(flags) ) { if ( m_value != value ) { m_value = value; return true; } return false; } #if wxUSE_VALIDATORS wxValidator* wxIntPropertyClass::GetClassValidator() { WX_PG_DOGETVALIDATOR_ENTRY() // Atleast wxPython 2.6.2.1 required that the string argument is given static wxString v; wxTextValidator* validator = new wxTextValidator(wxFILTER_NUMERIC,&v); WX_PG_DOGETVALIDATOR_EXIT(validator) } wxValidator* wxIntPropertyClass::DoGetValidator() const { return GetClassValidator(); } #endif // ----------------------------------------------------------------------- // wxUIntProperty // ----------------------------------------------------------------------- #define wxPG_UINT_TEMPLATE_MAX 8 static const wxChar* gs_uintTemplates[wxPG_UINT_TEMPLATE_MAX] = { wxT("%x"),wxT("0x%x"),wxT("$%x"), wxT("%X"),wxT("0x%X"),wxT("$%X"), wxT("%u"),wxT("%o") }; wxPG_BEGIN_PROPERTY_CLASS_BODY(wxUIntProperty,wxBasePropertyClass,long,unsigned long) WX_PG_DECLARE_BASIC_TYPE_METHODS() WX_PG_DECLARE_ATTRIBUTE_METHODS() virtual bool SetValueFromInt ( long value, int flags ); protected: wxByte m_base; wxByte m_realBase; // translated to 8,16,etc. wxByte m_prefix; wxPG_END_PROPERTY_CLASS_BODY() WX_PG_IMPLEMENT_PROPERTY_CLASS(wxUIntProperty,wxBaseProperty, long,unsigned long,TextCtrl) wxUIntPropertyClass::wxUIntPropertyClass( const wxString& label, const wxString& name, unsigned long value ) : wxBasePropertyClass(label,name) { m_base = 6; // This is magic number for dec base (must be same as in setattribute) m_realBase = 10; m_prefix = wxPG_PREFIX_NONE; DoSetValue((long)value); } wxUIntPropertyClass::~wxUIntPropertyClass() { } void wxUIntPropertyClass::DoSetValue( wxPGVariant value ) { m_value = wxPGVariantToLong(value); } wxPGVariant wxUIntPropertyClass::DoGetValue() const { return wxPGVariant(m_value); } wxString wxUIntPropertyClass::GetValueAsString( int ) const { //return wxString::Format(wxPGGlobalVars->m_uintTemplate.c_str(),m_value); size_t index = m_base + m_prefix; if ( index >= wxPG_UINT_TEMPLATE_MAX ) index = wxPG_BASE_DEC; return wxString::Format(gs_uintTemplates[index],m_value); } bool wxUIntPropertyClass::SetValueFromString( const wxString& text, int WXUNUSED(argFlags) ) { //wxString s; long unsigned value = 0; if ( text.length() == 0 ) { SetValueToUnspecified(); return true; } size_t start = 0; if ( text.length() > 0 && !wxIsalnum(text[0]) ) start++; wxString s = text.substr(start, text.length() - start); bool res = s.ToULong(&value, (unsigned int)m_realBase); //wxChar *end; //value = wxStrtoul(text.c_str() + ((size_t)start), &end, (unsigned int)m_realBase); if ( res && m_value != (long)value ) { return StdValidationProcedure((long)value); } /*} else if ( argFlags & wxPG_REPORT_ERROR ) { s.Printf ( wxT("! %s: \"%s\" is not a number."), m_label.c_str(), text.c_str() ); ShowError(s); }*/ return false; } bool wxUIntPropertyClass::SetValueFromInt( long value, int WXUNUSED(flags) ) { if ( m_value != value ) { m_value = value; return true; } return false; } void wxUIntPropertyClass::SetAttribute( int id, wxVariant& value ) { if ( id == wxPG_UINT_BASE ) { int val = value.GetLong(); m_realBase = (wxByte) val; if ( m_realBase > 16 ) m_realBase = 16; // // Translate logical base to a template array index m_base = 7; // oct if ( val == wxPG_BASE_HEX ) m_base = 3; else if ( val == wxPG_BASE_DEC ) m_base = 6; else if ( val == wxPG_BASE_HEXL ) m_base = 0; } else if ( id == wxPG_UINT_PREFIX ) m_prefix = (wxByte) value.GetLong(); } // ----------------------------------------------------------------------- // wxFloatProperty // ----------------------------------------------------------------------- wxPG_BEGIN_PROPERTY_CLASS_BODY(wxFloatProperty,wxPGProperty,double,double) WX_PG_DECLARE_BASIC_TYPE_METHODS() WX_PG_DECLARE_ATTRIBUTE_METHODS() protected: int m_precision; #if wxUSE_VALIDATORS //static wxValidator* GetClassValidator (); virtual wxValidator* DoGetValidator () const; #endif wxPG_END_PROPERTY_CLASS_BODY() WX_PG_IMPLEMENT_PROPERTY_CLASS(wxFloatProperty,wxBaseProperty, double,double,TextCtrl) wxFloatPropertyClass::wxFloatPropertyClass( const wxString& label, const wxString& name, double value ) : wxPGProperty(label,name) { m_precision = -1; DoSetValue(value); } wxFloatPropertyClass::~wxFloatPropertyClass() { } void wxFloatPropertyClass::DoSetValue( wxPGVariant value ) { m_value = wxPGVariantToDouble(value); } wxPGVariant wxFloatPropertyClass::DoGetValue() const { return wxPGVariant(m_value); } // This helper method provides standard way for floating point-using // properties to convert values to string. void wxPropertyGrid::DoubleToString(wxString& target, double value, int precision, bool removeZeroes, wxString* precTemplate) { if ( precision >= 0 ) { wxString text1; if (!precTemplate) precTemplate = &text1; if ( !precTemplate->length() ) { *precTemplate = wxT("%."); *precTemplate << wxString::Format( wxT("%i"), precision ); *precTemplate << wxT('f'); } target.Printf( precTemplate->c_str(), value ); } else { target.Printf( wxT("%f"), value ); } if ( removeZeroes && precision != 0 && target.length() ) { // Remove excess zeroes (do not remove this code just yet, // since sprintf can't do the same consistently across platforms). wxString::const_iterator i = target.end() - 1; size_t new_len = target.length() - 1; for ( ; i != target.begin(); i-- ) { if ( wxPGGetIterChar(target, i) != wxT('0') ) break; new_len--; } wxChar cur_char = wxPGGetIterChar(target, i); if ( cur_char != wxT('.') && cur_char != wxT(',') ) new_len++; if ( new_len != target.length() ) target.resize(new_len); /* unsigned int cur_pos = target.length() - 1; wxChar a; a = target.GetChar( cur_pos ); while ( a == wxT('0') && cur_pos > 0 ) { cur_pos--; a = target.GetChar( cur_pos ); } wxChar cur_char = target.GetChar( cur_pos ); if ( cur_char != wxT('.') && cur_char != wxT(',') ) cur_pos += 1; if ( cur_pos < target.length() ) target.Truncate( cur_pos ); */ } } wxString wxFloatPropertyClass::GetValueAsString( int argFlags ) const { wxString text; wxPropertyGrid::DoubleToString(text,m_value, m_precision, !(argFlags & wxPG_FULL_VALUE), (wxString*) NULL); return text; } bool wxFloatPropertyClass::SetValueFromString( const wxString& text, int argFlags ) { wxString s; double value; if ( text.length() == 0 ) { SetValueToUnspecified(); return true; } bool res = text.ToDouble(&value); if ( res ) { if ( m_value != value ) { m_value = value; return true; } } else if ( argFlags & wxPG_REPORT_ERROR ) { ShowError(wxString::Format( _("\"%s\" is not a floating-point number"), text.c_str() )); } return false; } void wxFloatPropertyClass::SetAttribute( int id, wxVariant& value ) { if ( id == wxPG_FLOAT_PRECISION ) { m_precision = value.GetLong(); } } #if wxUSE_VALIDATORS wxValidator* wxFloatPropertyClass::DoGetValidator() const { return wxIntPropertyClass::GetClassValidator(); } #endif // ----------------------------------------------------------------------- // wxBoolProperty // ----------------------------------------------------------------------- wxPG_BEGIN_PROPERTY_CLASS_BODY2(wxBoolPropertyClass,wxPGProperty,bool,long,bool,class) WX_PG_DECLARE_BASIC_TYPE_METHODS() WX_PG_DECLARE_CHOICE_METHODS() WX_PG_DECLARE_ATTRIBUTE_METHODS() wxPG_END_PROPERTY_CLASS_BODY() // We cannot use standard WX_PG_IMPLEMENT_PROPERTY_CLASS macro, since // there is a custom GetEditorClass. WX_PG_IMPLEMENT_CONSTFUNC(wxBoolProperty,bool) WX_PG_IMPLEMENT_CLASSINFO(wxBoolProperty,wxBasePropertyClass) wxPG_GETCLASSNAME_IMPLEMENTATION(wxBoolProperty) wxPG_VALUETYPE_MSGVAL wxBoolPropertyClass::GetValueType() const { return wxPG_VALUETYPE(bool); } const wxChar* wxPG_ClassName_wxBoolProperty = wxBoolProperty_ClassName; const wxPGEditor* wxBoolPropertyClass::DoGetEditorClass() const { // Select correct editor control. #if wxPG_INCLUDE_CHECKBOX if ( !(m_flags & wxPG_PROP_USE_CHECKBOX) ) return wxPG_EDITOR(Choice); return wxPG_EDITOR(CheckBox); #else return wxPG_EDITOR(Choice); #endif } wxBoolPropertyClass::wxBoolPropertyClass( const wxString& label, const wxString& name, bool value ) : wxPGProperty(label,name) { int useVal; if ( value ) useVal = 1; else useVal = 0; DoSetValue((long)useVal); m_flags |= wxPG_PROP_USE_DCC; } wxBoolPropertyClass::~wxBoolPropertyClass() { } void wxBoolPropertyClass::DoSetValue( wxPGVariant value ) { long v = wxPGVariantToLong(value); if ( v == 2 ) SetValueToUnspecified(); else if ( v != 0 ) m_value = 1; else m_value = 0; } wxPGVariant wxBoolPropertyClass::DoGetValue() const { return wxPGVariant(m_value); } wxString wxBoolPropertyClass::GetValueAsString( int argFlags ) const { if ( !(argFlags & wxPG_FULL_VALUE) ) { return wxPGGlobalVars->m_boolChoices[m_value]; } wxString text; if (m_value) text = wxT("true"); else text = wxT("false"); return text; } int wxBoolPropertyClass::GetChoiceInfo( wxPGChoiceInfo* choiceinfo ) { if ( choiceinfo ) { // 3 choice mode (ie. true, false, unspecified) does not work well (yet). //choiceinfo->m_itemCount = wxPGGlobalVars->m_numBoolChoices; choiceinfo->m_itemCount = 2; choiceinfo->m_arrWxString = wxPGGlobalVars->m_boolChoices; } return m_value; } bool wxBoolPropertyClass::SetValueFromString( const wxString& text, int /*argFlags*/ ) { int value = 0; if ( text.CmpNoCase(wxPGGlobalVars->m_boolChoices[1]) == 0 || text.CmpNoCase(wxT("true")) == 0 ) value = 1; if ( text.length() == 0 ) { SetValueToUnspecified(); return true; } if ( (m_value && !value) || (!m_value && value) ) { DoSetValue( (long) value ); return true; } /* else if ( argFlags & wxPG_REPORT_ERROR ) { wxLogError ( wxT("Property %s: \"%s\" is not a boolean value (True and False are valid)."), m_label.c_str(), text.c_str() ); } */ return false; } bool wxBoolPropertyClass::SetValueFromInt( long value, int ) { if ( value != 0 ) value = 1; if ( (m_value && !value) || (!m_value && value) ) { // (wxPG_BOOLPROP_VAL_INTERNAL_LONG) m_value = value; return true; } return false; } void wxBoolPropertyClass::SetAttribute( int id, wxVariant& value ) { int ival = value.GetLong(); #if wxPG_INCLUDE_CHECKBOX if ( id == wxPG_BOOL_USE_CHECKBOX ) { if ( ival ) m_flags |= wxPG_PROP_USE_CHECKBOX; else m_flags &= ~(wxPG_PROP_USE_CHECKBOX); } //else #endif if ( id == wxPG_BOOL_USE_DOUBLE_CLICK_CYCLING ) { if ( ival ) m_flags |= wxPG_PROP_USE_DCC; else m_flags &= ~(wxPG_PROP_USE_DCC); } } // ----------------------------------------------------------------------- // wxBaseEnumPropertyClass // ----------------------------------------------------------------------- // Class body is in propdev.h. wxBaseEnumPropertyClass::wxBaseEnumPropertyClass( const wxString& label, const wxString& name ) : wxPGProperty(label,name) { } /** If has values array, then returns number at index with value - otherwise just returns the value. */ int wxBaseEnumPropertyClass::GetIndexForValue( int value ) const { return value; } void wxBaseEnumPropertyClass::DoSetValue( wxPGVariant value ) { int intval = (int) value.GetLong(); m_index = GetIndexForValue(intval); } wxPGVariant wxBaseEnumPropertyClass::DoGetValue() const { if ( m_index < 0 ) return wxPGVariant((long)-1); int val; GetEntry(m_index,&val); return wxPGVariantCreator(val); } wxString wxBaseEnumPropertyClass::GetValueAsString( int ) const { if ( m_index >= 0 ) { int unused_val; const wxString* pstr = GetEntry( m_index, &unused_val ); if ( pstr ) return *pstr; } return wxEmptyString; } bool wxBaseEnumPropertyClass::SetValueFromString ( const wxString& text, int WXUNUSED(argFlags) ) { size_t i = 0; const wxString* entry_label; int entry_value; int use_index = -1; long use_value = 0; entry_label = GetEntry(i,&entry_value); while ( entry_label ) { if ( text.CmpNoCase(*entry_label) == 0 ) { use_index = (int)i; use_value = (long)entry_value; break; } i++; entry_label = GetEntry(i,&entry_value); } if ( m_index != use_index ) { if ( use_index != -1 ) // FIXME: Why can't this be virtual call? wxBaseEnumPropertyClass::DoSetValue ( use_value ); else m_index = -1; return true; } /*} else if ( argFlags & wxPG_REPORT_ERROR ) { wxString s; s.Printf ( wxT("\"%s\" was not among valid choices."), text.c_str() ); ShowError(s); }*/ return false; } bool wxBaseEnumPropertyClass::SetValueFromInt ( long value, int argFlags ) { if ( argFlags & wxPG_FULL_VALUE ) { DoSetValue(value); return true; } else { if ( m_index != value ) { m_index = value; return true; } } return false; } // ----------------------------------------------------------------------- // wxEnumProperty // ----------------------------------------------------------------------- // Class body is in propdev.h. wxPGProperty* wxEnumProperty( const wxString& label, const wxString& name, const wxChar** labels, const long* values, int value ) { return new wxEnumPropertyClass (label,name,labels,values,value); } wxPGProperty* wxEnumProperty( const wxString& label, const wxString& name, const wxArrayString& labels, const wxArrayInt& values, int value ) { return new wxEnumPropertyClass(label,name,labels,values,value); } wxPGProperty* wxEnumProperty( const wxString& label, const wxString& name, const wxArrayString& labels, int value ) { return new wxEnumPropertyClass (label,name,labels,*((const wxArrayInt*)NULL),value); } wxPGProperty* wxEnumProperty( const wxString& label, const wxString& name, wxPGChoices& choices, int value ) { return new wxEnumPropertyClass (label,name,choices,value); } WX_PG_IMPLEMENT_CLASSINFO(wxEnumProperty,wxBasePropertyClass) WX_PG_IMPLEMENT_PROPERTY_CLASS_PLAIN(wxEnumProperty,long,Choice) wxEnumPropertyClass::wxEnumPropertyClass ( const wxString& label, const wxString& name, const wxChar** labels, const long* values, int value ) : wxBaseEnumPropertyClass(label,name) { m_index = 0; if ( labels ) { m_choices.Add(labels,values); if ( GetItemCount() ) wxEnumPropertyClass::DoSetValue( (long)value ); } } wxEnumPropertyClass::wxEnumPropertyClass ( const wxString& label, const wxString& name, const wxChar** labels, const long* values, wxPGChoices* choicesCache, int value ) : wxBaseEnumPropertyClass(label,name) { m_index = 0; wxASSERT( choicesCache ); if ( choicesCache->IsOk() ) { m_choices.Assign( *choicesCache ); } else if ( labels ) { m_choices.Add(labels,values); if ( GetItemCount() ) wxEnumPropertyClass::DoSetValue( (long)value ); } } wxEnumPropertyClass::wxEnumPropertyClass ( const wxString& label, const wxString& name, const wxArrayString& labels, const wxArrayInt& values, int value ) : wxBaseEnumPropertyClass(label,name) { m_index = 0; if ( &labels ) { wxPGChoices choices(labels,values); m_choices = choices.ExtractData(); if ( GetItemCount() ) wxEnumPropertyClass::DoSetValue( (long)value ); } } wxEnumPropertyClass::wxEnumPropertyClass ( const wxString& label, const wxString& name, wxPGChoices& choices, int value ) : wxBaseEnumPropertyClass(label,name) { m_choices.Assign( choices ); if ( GetItemCount() ) wxEnumPropertyClass::DoSetValue( (long)value ); } int wxEnumPropertyClass::GetIndexForValue( int value ) const { if ( !m_choices.IsOk() ) return -1; const wxArrayInt& arrValues = m_choices.GetValues(); if ( arrValues.GetCount() ) { int intval = arrValues.Index(value); // TODO: Use real default instead of 0. if ( intval < 0 ) intval = 0; return intval; } return value; } wxEnumPropertyClass::~wxEnumPropertyClass () { } const wxString* wxEnumPropertyClass::GetEntry( size_t index, int* pvalue ) const { if ( m_choices.IsOk() && index < m_choices.GetCount() ) { const wxArrayInt& arrValues = m_choices.GetValues(); int value = (int)index; if ( arrValues.GetCount() ) value = arrValues[index]; *pvalue = value; return &m_choices.GetLabel(index); } return (const wxString*) NULL; } int wxEnumPropertyClass::GetChoiceInfo( wxPGChoiceInfo* choiceinfo ) { if ( choiceinfo ) { if ( !(m_flags & wxPG_PROP_STATIC_CHOICES) ) choiceinfo->m_choices = &m_choices; if ( !m_choices.IsOk() ) return -1; choiceinfo->m_itemCount = m_choices.GetCount(); if ( m_choices.GetCount() ) choiceinfo->m_arrWxString = (wxString*)&m_choices.GetLabel(0); } if ( !m_choices.IsOk() ) return -1; return m_index; } // ----------------------------------------------------------------------- // wxEditEnumProperty // ----------------------------------------------------------------------- class wxEditEnumPropertyClass : public wxEnumPropertyClass { WX_PG_DECLARE_PROPERTY_CLASS() public: wxEditEnumPropertyClass( const wxString& label, const wxString& name, const wxChar** labels, const long* values, const wxString& value ); wxEditEnumPropertyClass( const wxString& label, const wxString& name, const wxArrayString& labels, const wxArrayInt& values, const wxString& value ); wxEditEnumPropertyClass( const wxString& label, const wxString& name, wxPGChoices& choices, const wxString& value ); // Special constructor for caching choices (used by derived class) wxEditEnumPropertyClass( const wxString& label, const wxString& name, const wxChar** labels, const long* values, wxPGChoices* choicesCache, const wxString& value ); WX_PG_DECLARE_BASIC_TYPE_METHODS() int GetChoiceInfo( wxPGChoiceInfo* choiceinfo ); virtual ~wxEditEnumPropertyClass (); protected: wxString m_value_wxString; }; wxPGProperty* wxEditEnumProperty( const wxString& label, const wxString& name, const wxChar** labels, const long* values, const wxString& value ) { return new wxEditEnumPropertyClass(label,name,labels,values,value); } wxPGProperty* wxEditEnumProperty( const wxString& label, const wxString& name, const wxArrayString& labels, const wxArrayInt& values, const wxString& value ) { return new wxEditEnumPropertyClass(label,name,labels,values,value); } wxPGProperty* wxEditEnumProperty( const wxString& label, const wxString& name, const wxArrayString& labels, const wxString& value ) { return new wxEditEnumPropertyClass(label,name,labels,*((const wxArrayInt*)NULL),value); } wxPGProperty* wxEditEnumProperty( const wxString& label, const wxString& name, wxPGChoices& choices, const wxString& value ) { return new wxEditEnumPropertyClass(label,name,choices,value); } WX_PG_IMPLEMENT_CLASSINFO(wxEditEnumProperty,wxBasePropertyClass) WX_PG_IMPLEMENT_PROPERTY_CLASS_PLAIN(wxEditEnumProperty,wxString,ComboBox) wxEditEnumPropertyClass::wxEditEnumPropertyClass( const wxString& label, const wxString& name, const wxChar** labels, const long* values, const wxString& value ) : wxEnumPropertyClass(label,name,labels,values,0) { wxEditEnumPropertyClass::DoSetValue( value ); } wxEditEnumPropertyClass::wxEditEnumPropertyClass( const wxString& label, const wxString& name, const wxChar** labels, const long* values, wxPGChoices* choicesCache, const wxString& value ) : wxEnumPropertyClass(label,name,labels,values,choicesCache,0) { wxEditEnumPropertyClass::DoSetValue( value ); } wxEditEnumPropertyClass::wxEditEnumPropertyClass( const wxString& label, const wxString& name, const wxArrayString& labels, const wxArrayInt& values, const wxString& value ) : wxEnumPropertyClass(label,name,labels,values,0) { wxEditEnumPropertyClass::DoSetValue( value ); } wxEditEnumPropertyClass::wxEditEnumPropertyClass( const wxString& label, const wxString& name, wxPGChoices& choices, const wxString& value ) : wxEnumPropertyClass(label,name,choices,0) { wxEditEnumPropertyClass::DoSetValue( value ); } wxEditEnumPropertyClass::~wxEditEnumPropertyClass() { } void wxEditEnumPropertyClass::DoSetValue( wxPGVariant value ) { m_value_wxString = wxPGVariantToString(value); } wxPGVariant wxEditEnumPropertyClass::DoGetValue() const { return wxPGVariant(m_value_wxString); } wxString wxEditEnumPropertyClass::GetValueAsString( int ) const { return m_value_wxString; } bool wxEditEnumPropertyClass::SetValueFromString( const wxString& text, int ) { if ( m_value_wxString != text ) return StdValidationProcedure(text); return false; } int wxEditEnumPropertyClass::GetChoiceInfo( wxPGChoiceInfo* choiceinfo ) { wxEnumPropertyClass::GetChoiceInfo(choiceinfo); // However, select index using the current value wxPGChoices& choices = m_choices; const wxString& value = m_value_wxString; int index = -1; unsigned int k; for ( k=0; kGetParentState(); parent = parent->GetParent(); } wxASSERT( state ); if ( state ) { wxPGProperty* selected = state->GetSelection(); if ( selected ) { if ( selected->GetParent() == this ) oldSel = selected->GetArrIndex(); else if ( selected == this ) oldSel = -2; } } state->ClearSelection(); } // Delete old children for ( i=0; im_autoGetTranslation ) { bool_prop = wxBoolProperty( ::wxGetTranslation ( GetLabel(i) ), wxEmptyString, child_val ); } else #endif { bool_prop = wxBoolProperty( GetLabel(i), wxEmptyString, child_val ); } AddChild(bool_prop); } m_oldChoicesData = m_choices.GetDataPtr(); } if ( prevChildCount ) SubPropsChanged(oldSel); } wxFlagsPropertyClass::wxFlagsPropertyClass ( const wxString& label, const wxString& name, const wxChar** labels, const long* values, long value ) : wxPGPropertyWithChildren(label,name) { m_value = 0; m_oldChoicesData = (wxPGChoicesData*) NULL; if ( labels ) { m_choices.Set(labels,values); wxASSERT ( GetItemCount() ); DoSetValue( value ); } } wxFlagsPropertyClass::wxFlagsPropertyClass ( const wxString& label, const wxString& name, const wxArrayString& labels, const wxArrayInt& values, int value ) : wxPGPropertyWithChildren(label,name) { m_value = 0; m_oldChoicesData = (wxPGChoicesData*) NULL; if ( &labels ) { m_choices.Set(labels,values); wxASSERT( GetItemCount() ); DoSetValue( (long)value ); } } wxFlagsPropertyClass::wxFlagsPropertyClass ( const wxString& label, const wxString& name, wxPGChoices& choices, long value ) : wxPGPropertyWithChildren(label,name) { m_oldChoicesData = (wxPGChoicesData*) NULL; m_choices.Assign(choices); wxASSERT ( GetItemCount() ); DoSetValue( value ); } wxFlagsPropertyClass::~wxFlagsPropertyClass () { //wxPGUnRefChoices(m_choices); } void wxFlagsPropertyClass::DoSetValue ( wxPGVariant value ) { if ( !m_choices.IsOk() || !GetItemCount() ) { m_value = 0; return; } long val = value.GetLong(); long full_flags = 0; // normalize the value (i.e. remove extra flags) unsigned int i; const wxArrayInt& values = GetValues(); if ( values.GetCount() ) { for ( i = 0; i < GetItemCount(); i++ ) full_flags |= values[i]; } else { for ( i = 0; i < GetItemCount(); i++ ) full_flags |= (1< 1 ) text.Truncate ( text.Len() - 2 ); return text; } // Translate string into flag tokens bool wxFlagsPropertyClass::SetValueFromString ( const wxString& text, int ) { if ( !m_choices.IsOk() || !GetItemCount() ) return false; long new_flags = 0; // semicolons are no longer valid delimeters WX_PG_TOKENIZER1_BEGIN(text,wxT(',')) if ( token.length() ) { // Determine which one it is long bit = IdToBit( token ); if ( bit != -1 ) { // Changed? new_flags |= bit; } else { // Unknown identifier wxString s; s.Printf ( wxT("! %s: Unknown flag identifier \"%s\""), m_label.c_str(), token.c_str() ); ShowError(s); } } WX_PG_TOKENIZER1_END() if ( new_flags != m_value ) { // Set child modified states unsigned int i; const wxArrayInt& values = GetValues(); if ( values.GetCount() ) for ( i = 0; i < GetItemCount(); i++ ) { long flag = values[i]; if ( (new_flags & flag) != (m_value & flag) ) ((wxPGProperty*)m_children.Item( i ))->SetFlag ( wxPG_PROP_MODIFIED ); } else for ( i = 0; i < GetItemCount(); i++ ) { long flag = (1<SetFlag ( wxPG_PROP_MODIFIED ); } DoSetValue ( new_flags ); return TRUE; } return FALSE; } // Converts string id to a relevant bit. long wxFlagsPropertyClass::IdToBit ( const wxString& id ) const { unsigned int i; const wxArrayInt& values = GetValues(); for ( i = 0; i < GetItemCount(); i++ ) { #if wxCHECK_VERSION(2,9,0) const wxString ptr = GetLabel(i); #else const wxChar* ptr = GetLabel(i); #endif if ( id == ptr ) { //*pindex = i; if ( values.GetCount() ) return values[i]; return (1<DoSetValue ( ((long)((flags & values[i])?TRUE:FALSE)) ); else for ( i = 0; i < GetItemCount(); i++ ) Item(i)->DoSetValue ( ((long)((flags & (1<GetParent() ); const wxArrayInt& values = GetValues(); long val = p->DoGetValue().GetLong(); // bypass type checking unsigned int iip = p->GetIndexInParent(); unsigned long vi = (1<m_choices = &m_choices; return -1; } // ----------------------------------------------------------------------- // wxDirProperty // ----------------------------------------------------------------------- class wxDirPropertyClass : public wxLongStringPropertyClass { WX_PG_DECLARE_DERIVED_PROPERTY_CLASS() public: wxDirPropertyClass( const wxString& name, const wxString& label, const wxString& value ); virtual ~wxDirPropertyClass(); WX_PG_DECLARE_ATTRIBUTE_METHODS() WX_PG_DECLARE_VALIDATOR_METHODS() virtual bool OnButtonClick ( wxPropertyGrid* propGrid, wxString& value ); protected: wxString m_dlgMessage; }; WX_PG_IMPLEMENT_DERIVED_PROPERTY_CLASS(wxDirProperty,wxLongStringProperty,const wxString&) wxDirPropertyClass::wxDirPropertyClass( const wxString& name, const wxString& label, const wxString& value ) : wxLongStringPropertyClass(name,label,value) { m_flags |= wxPG_NO_ESCAPE; } wxDirPropertyClass::~wxDirPropertyClass() { } #if wxUSE_VALIDATORS wxValidator* wxDirPropertyClass::DoGetValidator() const { return wxFilePropertyClass::GetClassValidator(); } #endif bool wxDirPropertyClass::OnButtonClick( wxPropertyGrid* propGrid, wxString& value ) { wxSize dlg_sz(300,400); wxDirDialog dlg( propGrid, m_dlgMessage.length() ? m_dlgMessage : wxString(_("Choose a directory:")), value, 0, #if !wxPG_SMALL_SCREEN propGrid->GetGoodEditorDialogPosition(this,dlg_sz), dlg_sz ); #else wxDefaultPosition, wxDefaultSize ); #endif if ( dlg.ShowModal() == wxID_OK ) { value = dlg.GetPath(); return true; } return false; } void wxDirPropertyClass::SetAttribute( int id, wxVariant& value ) { if ( id == wxPG_DIR_DIALOG_MESSAGE ) { m_dlgMessage = value.GetString(); } } // ----------------------------------------------------------------------- // wxFileProperty // ----------------------------------------------------------------------- // Class body is in propdev.h. WX_PG_IMPLEMENT_PROPERTY_CLASS(wxFileProperty,wxBaseProperty, wxString,const wxString&,TextCtrlAndButton) wxFilePropertyClass::wxFilePropertyClass( const wxString& label, const wxString& name, const wxString& value ) : wxPGProperty(label,name) { m_wildcard = _("All files (*.*)|*.*"); m_flags |= wxPG_PROP_SHOW_FULL_FILENAME; m_indFilter = -1; DoSetValue(value); } wxFilePropertyClass::~wxFilePropertyClass() {} #if wxUSE_VALIDATORS wxValidator* wxFilePropertyClass::GetClassValidator() { WX_PG_DOGETVALIDATOR_ENTRY() // Atleast wxPython 2.6.2.1 required that the string argument is given static wxString v; wxTextValidator* validator = new wxTextValidator(wxFILTER_EXCLUDE_CHAR_LIST,&v); wxArrayString exChars; exChars.Add(wxT("?")); exChars.Add(wxT("*")); exChars.Add(wxT("|")); exChars.Add(wxT("<")); exChars.Add(wxT(">")); exChars.Add(wxT("\"")); validator->SetExcludes(exChars); WX_PG_DOGETVALIDATOR_EXIT(validator) } wxValidator* wxFilePropertyClass::DoGetValidator() const { return GetClassValidator(); } #endif void wxFilePropertyClass::DoSetValue( wxPGVariant value ) { const wxString& str = wxPGVariantToString(value); m_fnstr = str; m_filename = str; if ( !m_filename.HasName() ) { m_fnstr = wxEmptyString; m_filename.Clear(); } // Find index for extension. if ( m_indFilter < 0 && m_fnstr.length() ) { wxString ext = m_filename.GetExt(); int curind = 0; size_t pos = 0; size_t len = m_wildcard.length(); pos = m_wildcard.find(wxT("|"), pos); while ( pos != wxString::npos && pos < (len-3) ) { size_t ext_begin = pos + 3; pos = m_wildcard.find(wxT("|"), ext_begin); if ( pos == wxString::npos ) pos = len; wxString found_ext = m_wildcard.substr(ext_begin, pos-ext_begin); if ( found_ext.length() > 0 ) { if ( found_ext[0] == wxT('*') ) { m_indFilter = curind; break; } if ( ext.CmpNoCase(found_ext) == 0 ) { m_indFilter = curind; break; } } if ( pos != len ) pos = m_wildcard.find(wxT("|"), pos+1); curind++; } /* wxChar a = wxT(' '); const wxChar* p = m_wildcard.c_str(); wxString ext = m_filename.GetExt(); int curind = 0; do { while ( a && a != wxT('|') ) { a = *p; p++; } if ( !a ) break; a = *p; p++; if ( !a ) break; a = *p; p++; const wxChar* ext_begin = p; if ( *ext_begin == wxT('*') ) { m_indFilter = curind; break; } while ( a && a != '|' ) { a = *p; p++; } a = wxT(' '); int count = p-ext_begin-1; if ( count > 0 ) { wxASSERT( count < 32 ); wxString found_ext = m_wildcard.Mid(ext_begin-m_wildcard.c_str(),count); if ( ext.CmpNoCase(found_ext) == 0 ) { m_indFilter = curind; break; } } curind++; } while ( a ); */ } } wxPGVariant wxFilePropertyClass::DoGetValue() const { return wxPGVariant(m_fnstr); } wxString wxFilePropertyClass::GetValueAsString( int argFlags ) const { if ( argFlags & wxPG_FULL_VALUE ) { return m_filename.GetFullPath(); } else if ( m_flags & wxPG_PROP_SHOW_FULL_FILENAME ) { if ( m_basePath.Length() ) { wxFileName fn2(m_filename); fn2.MakeRelativeTo(m_basePath); return fn2.GetFullPath(); } return m_filename.GetFullPath(); } return m_filename.GetFullName(); } bool wxFilePropertyClass::OnEvent( wxPropertyGrid* propGrid, wxWindow* primary, wxEvent& event ) { if ( event.GetEventType() == wxEVT_COMMAND_BUTTON_CLICKED ) { // If text in control is changed, then update it to value. PrepareValueForDialogEditing(propGrid); wxString path; path = m_filename.GetPath(); wxFileDialog dlg( propGrid, m_dlgTitle.length() ? m_dlgTitle : wxString(_("Choose a file")), !m_initialPath.empty() ? m_initialPath : m_filename.GetPath(), wxEmptyString, m_wildcard, wxFD_FILE_MUST_EXIST | wxFD_PREVIEW, wxDefaultPosition ); if ( m_indFilter >= 0 ) dlg.SetFilterIndex( m_indFilter ); if ( dlg.ShowModal() == wxID_OK ) { m_indFilter = dlg.GetFilterIndex(); wxString path = dlg.GetPath(); SetValueFromString( path, wxPG_FULL_VALUE ); if ( primary ) GetEditorClass()->SetControlStringValue( primary, GetValueAsString(0) ); return true; } } return false; } bool wxFilePropertyClass::SetValueFromString( const wxString& text, int argFlags ) { if ( (m_flags & wxPG_PROP_SHOW_FULL_FILENAME) || (argFlags & wxPG_FULL_VALUE) ) { if ( m_filename != text ) { return StdValidationProcedure( text ); } } else { if ( m_filename.GetFullName() != text ) { wxFileName fn = m_filename; fn.SetFullName(text); wxString val = fn.GetFullPath(); return StdValidationProcedure( val ); } } return false; } void wxFilePropertyClass::SetAttribute( int id, wxVariant& value ) { if ( id == wxPG_FILE_SHOW_FULL_PATH ) { if ( value.GetLong() ) m_flags |= wxPG_PROP_SHOW_FULL_FILENAME; else m_flags &= ~(wxPG_PROP_SHOW_FULL_FILENAME); } else if ( id == wxPG_FILE_WILDCARD ) { m_wildcard = value.GetString(); } else if ( id == wxPG_FILE_SHOW_RELATIVE_PATH ) { m_basePath = value.GetString(); } else if ( id == wxPG_FILE_INITIAL_PATH ) { m_initialPath = value.GetString(); } else if ( id == wxPG_FILE_DIALOG_TITLE ) { m_dlgTitle = value.GetString(); } else if ( id == wxPG_FILE_FILTER_INDEX ) { m_indFilter = value.GetInteger(); } } // ----------------------------------------------------------------------- // wxLongStringProperty // ----------------------------------------------------------------------- // Class body is in propdev.h. WX_PG_IMPLEMENT_PROPERTY_CLASS(wxLongStringProperty,wxBaseProperty, wxString,const wxString&,TextCtrlAndButton) wxLongStringPropertyClass::wxLongStringPropertyClass( const wxString& label, const wxString& name, const wxString& value ) : wxBasePropertyClass(label,name) { DoSetValue(value); } wxLongStringPropertyClass::~wxLongStringPropertyClass() {} void wxLongStringPropertyClass::DoSetValue( wxPGVariant value ) { m_value = wxPGVariantToString(value); } wxPGVariant wxLongStringPropertyClass::DoGetValue() const { return wxPGVariant(m_value); } wxString wxLongStringPropertyClass::GetValueAsString( int ) const { return m_value; } bool wxLongStringPropertyClass::OnEvent( wxPropertyGrid* propGrid, wxWindow* primary, wxEvent& event ) { if ( event.GetEventType() == wxEVT_COMMAND_BUTTON_CLICKED ) { // Update the value PrepareValueForDialogEditing(propGrid); wxString val1 = GetValueAsString(0); wxString val_orig = val1; wxString value; if ( !(m_flags & wxPG_PROP_NO_ESCAPE) ) wxPropertyGrid::ExpandEscapeSequences(value,val1); else value = wxString(val1); // Run editor dialog. if ( OnButtonClick(propGrid,value) ) { if ( !(m_flags & wxPG_PROP_NO_ESCAPE) ) wxPropertyGrid::CreateEscapeSequences(val1,value); else val1 = value; if ( val1 != val_orig ) { SetValueFromString ( val1, 0 ); UpdateControl ( primary ); return true; } } } return false; } bool wxLongStringPropertyClass::OnButtonClick( wxPropertyGrid* propGrid, wxString& value ) { // launch editor dialog wxDialog* dlg = new wxDialog(propGrid,-1,m_label,wxDefaultPosition,wxDefaultSize, wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxCLIP_CHILDREN); dlg->SetFont(propGrid->GetFont()); // To allow entering chars of the same set as the propGrid // Multi-line text editor dialog. #if !wxPG_SMALL_SCREEN const int spacing = 8; #else const int spacing = 4; #endif wxBoxSizer* topsizer = new wxBoxSizer( wxVERTICAL ); wxBoxSizer* rowsizer = new wxBoxSizer( wxHORIZONTAL ); wxTextCtrl* ed = new wxTextCtrl(dlg,11,value, wxDefaultPosition,wxDefaultSize,wxTE_MULTILINE); rowsizer->Add( ed, 1, wxEXPAND|wxALL, spacing ); topsizer->Add( rowsizer, 1, wxEXPAND, 0 ); rowsizer = new wxBoxSizer( wxHORIZONTAL ); const int but_sz_flags = wxALIGN_RIGHT|wxALIGN_CENTRE_VERTICAL|wxBOTTOM|wxLEFT|wxRIGHT; rowsizer->Add( new wxButton(dlg,wxID_OK,_("Ok")), 0, but_sz_flags, spacing ); rowsizer->Add( new wxButton(dlg,wxID_CANCEL,_("Cancel")), 0, but_sz_flags, spacing ); topsizer->Add( rowsizer, 0, wxALIGN_RIGHT|wxALIGN_CENTRE_VERTICAL, 0 ); dlg->SetSizer( topsizer ); topsizer->SetSizeHints( dlg ); #if !wxPG_SMALL_SCREEN dlg->SetSize(400,300); dlg->Move( propGrid->GetGoodEditorDialogPosition(this,dlg->GetSize()) ); #endif int res = dlg->ShowModal(); if ( res == wxID_OK ) { value = ed->GetValue(); dlg->Destroy(); return true; } dlg->Destroy(); return false; } bool wxLongStringPropertyClass::SetValueFromString( const wxString& text, int ) { if ( m_value != text ) { DoSetValue ( text ); return true; } return false; } // ----------------------------------------------------------------------- // wxArrayEditorDialog // ----------------------------------------------------------------------- BEGIN_EVENT_TABLE(wxArrayEditorDialog, wxDialog) EVT_IDLE(wxArrayEditorDialog::OnIdle) EVT_LISTBOX(24, wxArrayEditorDialog::OnListBoxClick) EVT_TEXT_ENTER(21, wxArrayEditorDialog::OnAddClick) EVT_BUTTON(22, wxArrayEditorDialog::OnAddClick) EVT_BUTTON(23, wxArrayEditorDialog::OnDeleteClick) EVT_BUTTON(25, wxArrayEditorDialog::OnUpClick) EVT_BUTTON(26, wxArrayEditorDialog::OnDownClick) EVT_BUTTON(27, wxArrayEditorDialog::OnUpdateClick) //EVT_BUTTON(28, wxArrayEditorDialog::OnCustomEditClick) END_EVENT_TABLE() IMPLEMENT_ABSTRACT_CLASS(wxArrayEditorDialog, wxDialog) #include // ----------------------------------------------------------------------- void wxArrayEditorDialog::OnIdle(wxIdleEvent& event) { // // Do control focus detection here. // wxWindow* focused = FindFocus(); // This strange focus thing is a workaround for wxGTK wxListBox focus // reporting bug. if ( m_curFocus == 0 && focused != m_edValue && focused != m_butAdd && focused != m_butUpdate && m_lbStrings->GetSelection() >= 0 ) { //wxLogDebug(wxT("Focused: %s"),focused?focused->GetClassInfo()->GetClassName():wxT("NULL")); // ListBox was just focused. m_butAdd->Enable(false); m_butUpdate->Enable(false); m_butRemove->Enable(true); m_butUp->Enable(true); m_butDown->Enable(true); m_curFocus = 1; } else if ( (m_curFocus == 1 && focused == m_edValue) /*|| m_curFocus == 2*/ ) { //wxLogDebug(wxT("Focused: %s"),focused?focused->GetClassInfo()->GetClassName():wxT("NULL")); // TextCtrl was just focused. m_butAdd->Enable(true); bool upd_enable = false; if ( m_lbStrings->GetCount() && m_lbStrings->GetSelection() >= 0 ) upd_enable = true; m_butUpdate->Enable(upd_enable); m_butRemove->Enable(false); m_butUp->Enable(false); m_butDown->Enable(false); m_curFocus = 0; } event.Skip(); } // ----------------------------------------------------------------------- wxArrayEditorDialog::wxArrayEditorDialog() : wxDialog() { Init(); } // ----------------------------------------------------------------------- void wxArrayEditorDialog::Init() { m_custBtText = (const wxChar*) NULL; //m_pCallingClass = (wxArrayStringPropertyClass*) NULL; } // ----------------------------------------------------------------------- wxArrayEditorDialog::wxArrayEditorDialog( wxWindow *parent, const wxString& message, const wxString& caption, long style, const wxPoint& pos, const wxSize& sz ) : wxDialog() { Init(); Create(parent,message,caption,style,pos,sz); } // ----------------------------------------------------------------------- bool wxArrayEditorDialog::Create( wxWindow *parent, const wxString& message, const wxString& caption, long style, const wxPoint& pos, const wxSize& sz ) { #ifdef __WXMAC__ bool res = wxDialog::Create(parent,1,caption,pos,sz,wxCAPTION | wxFRAME_TOOL_WINDOW); #else bool res = wxDialog::Create(parent,1,caption,pos,sz,style); #endif SetFont(parent->GetFont()); // To allow entering chars of the same set as the propGrid #if !wxPG_SMALL_SCREEN const int spacing = 4; #else const int spacing = 3; #endif m_modified = false; m_curFocus = 1; const int but_sz_flags = wxALIGN_RIGHT|wxALIGN_CENTRE_VERTICAL|wxALL; //wxBOTTOM|wxLEFT|wxRIGHT; wxBoxSizer* topsizer = new wxBoxSizer( wxVERTICAL ); // Message if ( message.length() ) topsizer->Add( new wxStaticText(this,-1,message), 0, wxALIGN_LEFT|wxALIGN_CENTRE_VERTICAL|wxALL, spacing ); // String editor wxBoxSizer* rowsizer = new wxBoxSizer( wxHORIZONTAL ); m_edValue = new wxTextCtrl(this,21,wxEmptyString, wxDefaultPosition,wxDefaultSize,wxTE_PROCESS_ENTER); wxValidator* validator = GetTextCtrlValidator(); if ( validator ) { m_edValue->SetValidator( *validator ); delete validator; } rowsizer->Add( m_edValue, 1, wxALIGN_LEFT|wxALIGN_CENTRE_VERTICAL|wxALL, spacing ); // Add button m_butAdd = new wxButton(this,22,_("Add")); rowsizer->Add( m_butAdd, 0, wxALIGN_LEFT|wxALIGN_CENTRE_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, spacing ); topsizer->Add( rowsizer, 0, wxEXPAND, spacing ); // Separator line topsizer->Add( new wxStaticLine(this,-1), 0, wxEXPAND|wxBOTTOM|wxLEFT|wxRIGHT, spacing ); rowsizer = new wxBoxSizer( wxHORIZONTAL ); // list box m_lbStrings = new wxListBox(this, 24, wxDefaultPosition, wxDefaultSize); unsigned int i; for ( i=0; iAppend( ArrayGet(i) ); rowsizer->Add( m_lbStrings, 1, wxEXPAND|wxRIGHT, spacing ); // Manipulator buttons wxBoxSizer* colsizer = new wxBoxSizer( wxVERTICAL ); m_butCustom = (wxButton*) NULL; if ( m_custBtText ) { m_butCustom = new wxButton(this,28,::wxGetTranslation(m_custBtText)); colsizer->Add( m_butCustom, 0, wxALIGN_CENTER|wxTOP/*wxALIGN_LEFT|wxALIGN_CENTRE_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT*/, spacing ); } m_butUpdate = new wxButton(this,27,_("Update")); colsizer->Add( m_butUpdate, 0, wxALIGN_CENTER|wxTOP, spacing ); m_butRemove = new wxButton(this,23,_("Remove")); colsizer->Add( m_butRemove, 0, wxALIGN_CENTER|wxTOP, spacing ); m_butUp = new wxButton(this,25,_("Up")); colsizer->Add( m_butUp, 0, wxALIGN_CENTER|wxTOP, spacing ); m_butDown = new wxButton(this,26,_("Down")); colsizer->Add( m_butDown, 0, wxALIGN_CENTER|wxTOP, spacing ); rowsizer->Add( colsizer, 0, 0, spacing ); topsizer->Add( rowsizer, 1, wxLEFT|wxRIGHT|wxEXPAND, spacing ); // Separator line topsizer->Add( new wxStaticLine(this,-1), 0, wxEXPAND|wxTOP|wxLEFT|wxRIGHT, spacing ); // buttons rowsizer = new wxBoxSizer( wxHORIZONTAL ); /* const int but_sz_flags = wxALIGN_RIGHT|wxALIGN_CENTRE_VERTICAL|wxBOTTOM|wxLEFT|wxRIGHT; */ rowsizer->Add( new wxButton(this,wxID_OK,_("Ok")), 0, but_sz_flags, spacing ); rowsizer->Add( new wxButton(this,wxID_CANCEL,_("Cancel")), 0, but_sz_flags, spacing ); topsizer->Add( rowsizer, 0, wxALIGN_RIGHT|wxALIGN_CENTRE_VERTICAL, 0 ); m_edValue->SetFocus(); SetSizer( topsizer ); topsizer->SetSizeHints( this ); #if !wxPG_SMALL_SCREEN if ( sz.x == wxDefaultSize.x && sz.y == wxDefaultSize.y ) SetSize( wxSize(275,360) ); else SetSize(sz); #endif return res; } // ----------------------------------------------------------------------- void wxArrayEditorDialog::OnAddClick(wxCommandEvent& ) { wxString text = m_edValue->GetValue(); if ( text.length() ) { if ( ArrayInsert( text, -1 ) ) { m_lbStrings->Append( text ); m_modified = true; m_edValue->Clear(); } } } // ----------------------------------------------------------------------- void wxArrayEditorDialog::OnDeleteClick(wxCommandEvent& ) { int index = m_lbStrings->GetSelection(); if ( index >= 0 ) { ArrayRemoveAt( index ); m_lbStrings->Delete ( index ); m_modified = true; } } // ----------------------------------------------------------------------- void wxArrayEditorDialog::OnUpClick(wxCommandEvent& ) { int index = m_lbStrings->GetSelection(); if ( index > 0 ) { ArraySwap(index-1,index); /*wxString old_str = m_array[index-1]; wxString new_str = m_array[index]; m_array[index-1] = new_str; m_array[index] = old_str;*/ m_lbStrings->SetString ( index-1, ArrayGet(index-1) ); m_lbStrings->SetString ( index, ArrayGet(index) ); m_lbStrings->SetSelection ( index-1 ); m_modified = true; } } // ----------------------------------------------------------------------- void wxArrayEditorDialog::OnDownClick(wxCommandEvent& ) { int index = m_lbStrings->GetSelection(); int lastStringIndex = ((int) m_lbStrings->GetCount()) - 1; if ( index >= 0 && index < lastStringIndex ) { ArraySwap(index,index+1); /*wxString old_str = m_array[index+1]; wxString new_str = m_array[index]; m_array[index+1] = new_str; m_array[index] = old_str;*/ m_lbStrings->SetString ( index+1, ArrayGet(index+1) ); m_lbStrings->SetString ( index, ArrayGet(index) ); m_lbStrings->SetSelection ( index+1 ); m_modified = true; } } // ----------------------------------------------------------------------- void wxArrayEditorDialog::OnUpdateClick(wxCommandEvent& ) { int index = m_lbStrings->GetSelection(); if ( index >= 0 ) { wxString str = m_edValue->GetValue(); if ( ArraySet(index,str) ) { m_lbStrings->SetString ( index, str ); //m_array[index] = str; m_modified = true; } } } // ----------------------------------------------------------------------- /*void wxArrayEditorDialog::OnCustomEditClick(wxCommandEvent& ) { wxASSERT ( m_pCallingClass ); wxString str = m_edValue->GetValue(); if ( m_pCallingClass->OnCustomStringEdit(m_parent,str) ) { //m_edValue->SetValue ( str ); if ( ArrayInsert(-1,str) ) { m_lbStrings->Append ( str ); m_modified = true; } } }*/ // ----------------------------------------------------------------------- void wxArrayEditorDialog::OnListBoxClick(wxCommandEvent& ) { int index = m_lbStrings->GetSelection(); if ( index >= 0 ) { m_edValue->SetValue( m_lbStrings->GetString(index) ); } } // ----------------------------------------------------------------------- // wxArrayStringEditorDialog // ----------------------------------------------------------------------- class wxArrayStringEditorDialog : public wxArrayEditorDialog { public: wxArrayStringEditorDialog(); void Init(); virtual void SetDialogValue( const wxVariant& value ) { m_array = value.GetArrayString(); } virtual wxVariant GetDialogValue() const { return m_array; } inline void SetCustomButton( const wxChar* custBtText, wxArrayStringPropertyClass* pcc ) { m_custBtText = custBtText; m_pCallingClass = pcc; } void OnCustomEditClick(wxCommandEvent& event); protected: wxArrayString m_array; wxArrayStringPropertyClass* m_pCallingClass; virtual wxString ArrayGet( size_t index ); virtual size_t ArrayGetCount(); virtual bool ArrayInsert( const wxString& str, int index ); virtual bool ArraySet( size_t index, const wxString& str ); virtual void ArrayRemoveAt( int index ); virtual void ArraySwap( size_t first, size_t second ); private: DECLARE_DYNAMIC_CLASS_NO_COPY(wxArrayStringEditorDialog) DECLARE_EVENT_TABLE() }; BEGIN_EVENT_TABLE(wxArrayStringEditorDialog, wxArrayEditorDialog) EVT_BUTTON(28, wxArrayStringEditorDialog::OnCustomEditClick) END_EVENT_TABLE() IMPLEMENT_DYNAMIC_CLASS(wxArrayStringEditorDialog, wxArrayEditorDialog) // ----------------------------------------------------------------------- wxString wxArrayStringEditorDialog::ArrayGet( size_t index ) { return m_array[index]; } size_t wxArrayStringEditorDialog::ArrayGetCount() { return m_array.GetCount(); } bool wxArrayStringEditorDialog::ArrayInsert( const wxString& str, int index ) { if (index<0) m_array.Add(str); else m_array.Insert(str,index); return true; } bool wxArrayStringEditorDialog::ArraySet( size_t index, const wxString& str ) { m_array[index] = str; return true; } void wxArrayStringEditorDialog::ArrayRemoveAt( int index ) { m_array.RemoveAt(index); } void wxArrayStringEditorDialog::ArraySwap( size_t first, size_t second ) { wxString old_str = m_array[first]; wxString new_str = m_array[second]; m_array[first] = new_str; m_array[second] = old_str; } wxArrayStringEditorDialog::wxArrayStringEditorDialog() : wxArrayEditorDialog() { Init(); } void wxArrayStringEditorDialog::Init() { m_pCallingClass = (wxArrayStringPropertyClass*) NULL; } void wxArrayStringEditorDialog::OnCustomEditClick(wxCommandEvent& ) { wxASSERT( m_pCallingClass ); wxString str = m_edValue->GetValue(); if ( m_pCallingClass->OnCustomStringEdit(m_parent,str) ) { //m_edValue->SetValue ( str ); m_lbStrings->Append ( str ); m_array.Add ( str ); m_modified = true; } } // ----------------------------------------------------------------------- // wxArrayStringProperty // ----------------------------------------------------------------------- // Class body is in propdev.h WX_PG_IMPLEMENT_PROPERTY_CLASS(wxArrayStringProperty, // Property name wxBaseProperty, // Property we inherit from wxArrayString, // Value type name const wxArrayString&, // Value type, as given in constructor TextCtrlAndButton) // Initial editor wxArrayStringPropertyClass::wxArrayStringPropertyClass( const wxString& label, const wxString& name, const wxArrayString& array ) : wxPGProperty(label,name) { DoSetValue( array ); } wxArrayStringPropertyClass::~wxArrayStringPropertyClass() { } void wxArrayStringPropertyClass::DoSetValue( wxPGVariant value ) { m_value = wxPGVariantToArrayString(value); GenerateValueAsString(); } wxPGVariant wxArrayStringPropertyClass::DoGetValue() const { return wxPGVariantCreator(m_value); } wxString wxArrayStringPropertyClass::GetValueAsString( int WXUNUSED(argFlags) ) const { return m_display; } // Converts wxArrayString to a string separated by delimeters and spaces. // preDelim is useful for "str1" "str2" style. Set flags to 1 to do slash // conversion. void wxPropertyGrid::ArrayStringToString( wxString& dst, const wxArrayString& src, wxChar preDelim, wxChar postDelim, int flags ) { wxString pdr; unsigned int i; unsigned int itemCount = src.GetCount(); wxChar preas[2]; dst.Empty(); if ( !preDelim ) preas[0] = 0; else if ( (flags & 1) ) { preas[0] = preDelim; preas[1] = 0; pdr = wxT("\\"); pdr += preDelim; } if ( itemCount ) dst.append( preas ); wxASSERT( postDelim ); for ( i = 0; i < itemCount; i++ ) { wxString str( src.Item(i) ); // Do some character conversion. // Convertes \ to \\ and to \ // Useful when preDelim and postDelim are "\"". if ( flags & 1 ) { str.Replace( wxT("\\"), wxT("\\\\"), true ); if ( pdr.length() ) str.Replace( preas, pdr, true ); } dst.append ( str ); if ( i < (itemCount-1) ) { dst.append( wxString(postDelim) ); dst.append( wxT(" ") ); dst.append( wxString(preas) ); } else if ( preDelim ) dst.append( wxString(postDelim) ); } } #define ARRSTRPROP_ARRAY_TO_STRING(STRING,ARRAY) \ wxPropertyGrid::ArrayStringToString(STRING,ARRAY,wxT('"'),wxT('"'),1); void wxArrayStringPropertyClass::GenerateValueAsString() { ARRSTRPROP_ARRAY_TO_STRING(m_display, m_value) } // Default implementation doesn't do anything. bool wxArrayStringPropertyClass::OnCustomStringEdit( wxWindow*, wxString& ) { return false; } wxArrayEditorDialog* wxArrayStringPropertyClass::CreateEditorDialog() { return new wxArrayStringEditorDialog(); } bool wxArrayStringPropertyClass::OnButtonClick( wxPropertyGrid* propGrid, wxWindow* primaryCtrl, const wxChar* cbt ) { // Update the value PrepareValueForDialogEditing(propGrid); if ( !propGrid->EditorValidate() ) return false; // Create editor dialog. wxArrayEditorDialog* dlg = CreateEditorDialog(); wxValidator* validator = GetValidator(); wxPGInDialogValidator dialogValidator; wxArrayStringEditorDialog* strEdDlg = wxDynamicCast(dlg, wxArrayStringEditorDialog); if ( strEdDlg ) strEdDlg->SetCustomButton(cbt, this); dlg->SetDialogValue( wxVariant(m_value) ); dlg->Create(propGrid, wxEmptyString, m_label); #if !wxPG_SMALL_SCREEN dlg->Move( propGrid->GetGoodEditorDialogPosition(this,dlg->GetSize()) ); #endif bool retVal; for (;;) { retVal = false; int res = dlg->ShowModal(); if ( res == wxID_OK && dlg->IsModified() ) { wxVariant value = dlg->GetDialogValue(); if ( !value.IsNull() ) { wxArrayString actualValue = value.GetArrayString(); wxString tempStr; ARRSTRPROP_ARRAY_TO_STRING(tempStr, actualValue) if ( dialogValidator.DoValidate( propGrid, validator, tempStr ) ) { DoSetValue( actualValue ); UpdateControl( primaryCtrl ); retVal = true; break; } } else break; } else break; } delete dlg; return retVal; } bool wxArrayStringPropertyClass::OnEvent( wxPropertyGrid* propGrid, wxWindow* primary, wxEvent& event ) { if ( event.GetEventType() == wxEVT_COMMAND_BUTTON_CLICKED ) return OnButtonClick(propGrid,primary,(const wxChar*) NULL); return false; } bool wxArrayStringPropertyClass::SetValueFromString( const wxString& text, int ) { m_value.Empty(); WX_PG_TOKENIZER2_BEGIN(text,wxT('"')) // Need to replace backslashes with empty characters // (opposite what is done in GenerateValueString). //token.Replace ( wxT("\\"), wxT(""), true ); m_value.Add ( token ); WX_PG_TOKENIZER2_END() GenerateValueAsString(); return true; } // ----------------------------------------------------------------------- // wxCustomProperty // ----------------------------------------------------------------------- wxPGProperty* wxCustomProperty( const wxString& label, const wxString& name ) { return new wxCustomPropertyClass (label,name); } WX_PG_IMPLEMENT_CLASSINFO(wxCustomProperty,wxBaseParentPropertyClass) wxPG_GETCLASSNAME_IMPLEMENTATION(wxCustomProperty) wxPG_VALUETYPE_MSGVAL wxCustomPropertyClass::GetValueType() const { return wxPG_VALUETYPE(wxString); } const wxPGEditor* wxCustomPropertyClass::DoGetEditorClass() const { return wxPG_EDITOR(TextCtrl); } wxCustomPropertyClass::wxCustomPropertyClass(const wxString& label, const wxString& name) : wxPGPropertyWithChildren(label,name) { m_parentingType = -2; #ifdef wxPG_COMPATIBILITY_1_0_0 m_callback = (wxPropertyGridCallback) NULL; #endif //m_choices = &wxPGGlobalVars->m_emptyChoicesData; m_paintCallback = (wxPGPaintCallback) NULL; } wxCustomPropertyClass::~wxCustomPropertyClass() { //wxPGUnRefChoices(m_choices); } void wxCustomPropertyClass::DoSetValue ( wxPGVariant value ) { m_value = value.GetString(); } wxPGVariant wxCustomPropertyClass::DoGetValue () const { return m_value; } bool wxCustomPropertyClass::SetValueFromString ( const wxString& text, int /*flags*/ ) { if ( text != m_value ) { m_value = text; return true; } return false; } wxString wxCustomPropertyClass::GetValueAsString ( int /*argFlags*/ ) const { return m_value; } // Need to do some extra event handling. #ifdef wxPG_COMPATIBILITY_1_0_0 bool wxCustomPropertyClass::OnEvent ( wxPropertyGrid* propGrid, wxWindow* primary, wxEvent& event ) { if ( event.GetEventType() == wxEVT_COMMAND_BUTTON_CLICKED ) { if ( m_callback ) return m_callback(propGrid,this,primary,0); } return false; } #endif wxSize wxCustomPropertyClass::GetImageSize() const { if ( m_paintCallback ) return wxSize(-wxPG_CUSTOM_IMAGE_WIDTH,-wxPG_CUSTOM_IMAGE_WIDTH); return wxPGPropertyWithChildren::GetImageSize(); } void wxCustomPropertyClass::OnCustomPaint( wxDC& dc, const wxRect& rect, wxPGPaintData& paintData ) { if ( m_paintCallback ) m_paintCallback(this,dc,rect,paintData); else wxPGPropertyWithChildren::OnCustomPaint(dc,rect,paintData); } bool wxCustomPropertyClass::SetValueFromInt ( long value, int ) { size_t index = value; const wxArrayInt& values = m_choices.GetValues(); if ( values.GetCount() ) index = values.Index(value); const wxString& sAtIndex = m_choices.GetLabel(index); if ( sAtIndex != m_value ) { m_value = sAtIndex; return true; } return false; } int wxCustomPropertyClass::GetChoiceInfo( wxPGChoiceInfo* choiceinfo ) { if ( choiceinfo ) { choiceinfo->m_choices = &m_choices; if ( !m_choices.IsOk() ) return -1; choiceinfo->m_itemCount = m_choices.GetCount(); if ( m_choices.GetCount() ) choiceinfo->m_arrWxString = (wxString*)&m_choices.GetLabel(0); } if ( !m_choices.IsOk() ) return -1; return m_choices.GetLabels().Index(m_value); } void wxCustomPropertyClass::SetAttribute ( int id, wxVariant& value ) { #ifdef wxPG_COMPATIBILITY_1_0_0 wxPropertyGrid* grid = GetGrid(); if ( id == wxPG_CUSTOM_EDITOR ) { if ( grid ) grid->SetPropertyEditor( wxPGIdGen(this), (wxPGEditor*) value.GetVoidPtr() ); else SetEditor( (wxPGEditor*) value.GetVoidPtr() ); } else if ( id == wxPG_CUSTOM_IMAGE ) { wxBitmap* bmp = (wxBitmap*) value.GetWxObjectPtr(); if ( grid ) grid->SetPropertyImage(wxPGIdGen(this),*bmp); else SetValueImage(*bmp); } else if ( id == wxPG_CUSTOM_CALLBACK ) { m_callback = (wxPropertyGridCallback) value.GetVoidPtr(); } else #endif if ( id == wxPG_CUSTOM_PAINT_CALLBACK ) { void* voidValue = value.GetVoidPtr(); m_paintCallback = (wxPGPaintCallback) voidValue; if ( voidValue ) m_flags |= wxPG_PROP_CUSTOMIMAGE; else if ( !GetValueImage() ) m_flags &= ~(wxPG_PROP_CUSTOMIMAGE); } else if ( id == wxPG_CUSTOM_PRIVATE_CHILDREN ) { if ( value.GetLong() ) m_parentingType = -1; else m_parentingType = -2; } } // ----------------------------------------------------------------------- wxformbuilder-3.1.59/src/controls/src/wxFlatNotebook/popup_dlg.cpp0000644000175000017500000001512111143440027025634 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // Name: popup_dlg.cpp // Purpose: Impl of the navigation dialog used by wxFlatNotebook // Author: Eran Ifrah // Created: 30/12/2005 // Modified: 01/01/2006 // Copyright: Eran Ifrah (c) // Licence: wxWindows license /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include //#include #include wxBitmap wxTabNavigatorWindow::m_bmp; wxTabNavigatorWindow::wxTabNavigatorWindow(wxWindow* parent) : m_listBox(NULL) , m_selectedItem(-1) , m_panel(NULL) { Create(parent); GetSizer()->Fit(this); GetSizer()->SetSizeHints(this); GetSizer()->Layout(); Centre(); } wxTabNavigatorWindow::wxTabNavigatorWindow() : wxDialog() , m_listBox(NULL) , m_selectedItem(-1) , m_panel(NULL) { } wxTabNavigatorWindow::~wxTabNavigatorWindow() { } void wxTabNavigatorWindow::Create(wxWindow* parent) { long style = 0; if( !wxDialog::Create(parent, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, style) ) return; wxBoxSizer *sz = new wxBoxSizer( wxVERTICAL ); SetSizer( sz ); long flags = wxLB_SINGLE | wxNO_BORDER ; m_listBox = new wxListBox(this, wxID_ANY, wxDefaultPosition, wxSize(200, 150), 0, NULL, flags); static int panelHeight = 0; if( panelHeight == 0 ) { wxMemoryDC mem_dc; // bitmap must be set before it can be used for anything wxBitmap bmp(10, 10); mem_dc.SelectObject(bmp); wxFont font(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT)); font.SetWeight( wxBOLD ); mem_dc.SetFont(font); int w; mem_dc.GetTextExtent(wxT("Tp"), &w, &panelHeight); panelHeight += 4; // Place a spacer of 2 pixels // Out signpost bitmap is 24 pixels if( panelHeight < 24 ) panelHeight = 24; } m_panel = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxSize(200, panelHeight)); sz->Add( m_panel ); sz->Add( m_listBox, 1, wxEXPAND ); SetSizer( sz ); // Connect events to the list box m_listBox->Connect(wxID_ANY, wxEVT_KEY_UP, wxKeyEventHandler(wxTabNavigatorWindow::OnKeyUp), NULL, this); //Connect(wxEVT_CHAR_HOOK, wxCharEventHandler(wxTabNavigatorWindow::OnKeyUp), NULL, this); m_listBox->Connect(wxID_ANY, wxEVT_NAVIGATION_KEY, wxNavigationKeyEventHandler(wxTabNavigatorWindow::OnNavigationKey), NULL, this); m_listBox->Connect(wxID_ANY, wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, wxCommandEventHandler(wxTabNavigatorWindow::OnItemSelected), NULL, this); // Connect paint event to the panel m_panel->Connect(wxID_ANY, wxEVT_PAINT, wxPaintEventHandler(wxTabNavigatorWindow::OnPanelPaint), NULL, this); m_panel->Connect(wxID_ANY, wxEVT_ERASE_BACKGROUND, wxEraseEventHandler(wxTabNavigatorWindow::OnPanelEraseBg), NULL, this); SetBackgroundColour( wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE) ); m_listBox->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE)); PopulateListControl( static_cast( parent ) ); // Create the bitmap, only once if( !m_bmp.Ok() ) { wxImage img(signpost_xpm); img.SetAlpha(signpost_alpha, true); m_bmp = wxBitmap(img); } m_listBox->SetFocus(); } void wxTabNavigatorWindow::OnKeyUp(wxKeyEvent &event) { if(event.GetKeyCode() == WXK_CONTROL) { CloseDialog(); } } void wxTabNavigatorWindow::OnNavigationKey(wxNavigationKeyEvent &event) { long selected = m_listBox->GetSelection(); wxFlatNotebook* bk = static_cast(GetParent()); /// Bug Fix (History) ---- Ti-R ---- // long maxItems = bk->GetPageCount(); long maxItems = bk->GetBrowseHistory().GetCount(); long itemToSelect; if( event.GetDirection() ) { // Select next page if (selected == maxItems - 1) itemToSelect = 0; else itemToSelect = selected + 1; } else { // Previous page if( selected == 0 ) itemToSelect = maxItems - 1; else itemToSelect = selected - 1; } m_listBox->SetSelection( itemToSelect ); } void wxTabNavigatorWindow::PopulateListControl(wxFlatNotebook *book) { int selection = book->GetSelection(); //int count = book->GetPageCount(); std::map temp; m_listBox->Append( book->GetPageText(static_cast(selection)) ); m_indexMap[0] = selection; temp[selection] = true; const wxArrayInt &arr = book->GetBrowseHistory(); for(size_t i=0; iAppend( book->GetPageText(static_cast(arr.Item(i))) ); m_indexMap[(int)m_listBox->GetCount()-1] = arr.Item(i); temp[arr.Item(i)] = true; } } // Select the next entry after the current selection m_listBox->SetSelection( 0 ); wxNavigationKeyEvent dummy; dummy.SetDirection(true); OnNavigationKey(dummy); } void wxTabNavigatorWindow::OnItemSelected(wxCommandEvent & event ) { wxUnusedVar( event ); CloseDialog(); } void wxTabNavigatorWindow::CloseDialog() { wxFlatNotebook* bk = static_cast(GetParent()); m_selectedItem = m_listBox->GetSelection(); std::map::iterator iter = m_indexMap.find(m_selectedItem); bk->SetSelection( iter->second ); EndModal( wxID_OK ); } void wxTabNavigatorWindow::OnPanelPaint(wxPaintEvent &event) { wxUnusedVar(event); wxPaintDC dc(m_panel); wxRect rect = m_panel->GetClientRect(); static bool first = true; static wxBitmap bmp( rect.width, rect.height ); if( first ) { first = false; wxMemoryDC mem_dc; mem_dc.SelectObject( bmp ); wxColour endColour( wxSystemSettings::GetColour(wxSYS_COLOUR_BTNSHADOW) ); wxColour startColour( wxFNBRenderer::LightColour(endColour, 50) ); wxFNBRenderer::PaintStraightGradientBox(mem_dc, rect, startColour, endColour); // Draw the caption title and place the bitmap wxPoint bmpPt; wxPoint txtPt; // get the bitmap optimal position, and draw it bmpPt.y = (rect.height - m_bmp.GetHeight()) / 2; bmpPt.x = 3; mem_dc.DrawBitmap( m_bmp, bmpPt, true ); // get the text position, and draw it int fontHeight(0), w(0); wxFont font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT); font.SetWeight( wxBOLD ); mem_dc.SetFont( font ); mem_dc.GetTextExtent( wxT("Tp"), &w, &fontHeight ); txtPt.x = bmpPt.x + m_bmp.GetWidth() + 4; txtPt.y = (rect.height - fontHeight)/2; mem_dc.SetTextForeground( *wxWHITE ); mem_dc.DrawText( wxT("Opened tabs:"), txtPt ); mem_dc.SelectObject( wxNullBitmap ); } dc.DrawBitmap( bmp, 0, 0 ); } void wxTabNavigatorWindow::OnPanelEraseBg(wxEraseEvent &event) { wxUnusedVar(event); } wxformbuilder-3.1.59/src/controls/src/wxFlatNotebook/renderer.cpp0000644000175000017500000016770611143440027025472 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // Name: renderer.cpp // Purpose: implementation of the different renderers used by wxFlatNotebook // Author: Eran Ifrah // Created: 30/12/2005 // Modified: 01/01/2006 // Copyright: Eran Ifrah (c) // Licence: wxWindows license /////////////////////////////////////////////////////////////////////////////// #include #include // for the styles #include #include #ifdef DEVELOPMENT # define FNB_LOG_MSG( msg ) { wxString logmsg; logmsg << msg; wxLogMessage( logmsg ); } #else # define FNB_LOG_MSG( msg ) { wxString logmsg; logmsg << msg; } #endif //----------------------------------------------------------------------------- // Util functions //----------------------------------------------------------------------------- static void DrawButton(wxDC& dc, const wxRect& rect, const bool &focus, const bool &upperTabs) { // Define the middle points wxPoint leftPt, rightPt; if( focus ){ if( upperTabs ){ leftPt = wxPoint(rect.x, rect.y + (rect.height / 10)*8 ); rightPt = wxPoint(rect.x + rect.width - 2, rect.y + (rect.height / 10)*8); } else { leftPt = wxPoint(rect.x, rect.y + (rect.height / 10)*5 ); rightPt = wxPoint(rect.x + rect.width - 2, rect.y + (rect.height / 10)*5); } } else { leftPt = wxPoint(rect.x, rect.y + (rect.height / 2) ); rightPt = wxPoint(rect.x + rect.width - 2, rect.y + (rect.height / 2)); } // Define the top region wxRect top(rect.GetLeftTop(), rightPt); wxRect bottom(leftPt, rect.GetBottomRight()); wxColour topStartColor(wxT("WHITE")); if( !focus ){ topStartColor = wxFNBRenderer::LightColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE), 50); } wxColour topEndColor( wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE)); wxColour bottomStartColor(topEndColor); wxColour bottomEndColor(topEndColor); // Incase we use bottom tabs, switch the colors if( upperTabs ){ if( focus ){ wxFNBRenderer::PaintStraightGradientBox(dc, top, topStartColor, topEndColor); wxFNBRenderer::PaintStraightGradientBox(dc, bottom, bottomStartColor, bottomEndColor); } else { wxFNBRenderer::PaintStraightGradientBox(dc, top, topEndColor , topStartColor); wxFNBRenderer::PaintStraightGradientBox(dc, bottom, bottomStartColor, bottomEndColor); } } else { if( focus ){ wxFNBRenderer::PaintStraightGradientBox(dc, bottom, topEndColor, bottomEndColor); wxFNBRenderer::PaintStraightGradientBox(dc, top,topStartColor, topStartColor); } else { wxFNBRenderer::PaintStraightGradientBox(dc, bottom, bottomStartColor, bottomEndColor); wxFNBRenderer::PaintStraightGradientBox(dc, top, topEndColor, topStartColor); } } dc.SetBrush( *wxTRANSPARENT_BRUSH ); } wxFNBRenderer::wxFNBRenderer() : m_tabXBgBmp(16, 16) , m_xBgBmp(16, 14) , m_leftBgBmp(16, 14) , m_rightBgBmp(16, 14) { } wxFNBRenderer::~wxFNBRenderer() { } int wxFNBRenderer::GetLeftButtonPos(wxWindow* pageContainer) { wxPageContainer *pc = static_cast( pageContainer ); long style = pc->GetParent()->GetWindowStyleFlag(); wxRect rect = pc->GetClientRect(); int clientWidth = rect.width; if(style & wxFNB_NO_X_BUTTON) return clientWidth - 38; else return clientWidth - 54; } int wxFNBRenderer::GetRightButtonPos(wxWindow* pageContainer) { wxPageContainer *pc = static_cast( pageContainer ); long style = pc->GetParent()->GetWindowStyleFlag(); wxRect rect = pc->GetClientRect(); int clientWidth = rect.width; if(style & wxFNB_NO_X_BUTTON) return clientWidth - 22; else return clientWidth - 38; } int wxFNBRenderer::GetDropArrowButtonPos(wxWindow *pageContainer) { return GetRightButtonPos(pageContainer); } int wxFNBRenderer::GetXPos(wxWindow* pageContainer) { wxPageContainer *pc = static_cast( pageContainer ); long style = pc->GetParent()->GetWindowStyleFlag(); wxRect rect = pc->GetClientRect(); int clientWidth = rect.width; if(style & wxFNB_NO_X_BUTTON) return clientWidth; else return clientWidth - 22; } int wxFNBRenderer::GetButtonsAreaLength(wxWindow* pageContainer) { wxPageContainer *pc = static_cast( pageContainer ); long style = pc->GetParent()->GetWindowStyleFlag(); // '' if(style & wxFNB_NO_NAV_BUTTONS && style & wxFNB_NO_X_BUTTON && !(style & wxFNB_DROPDOWN_TABS_LIST)) return 0; // 'x' if((style & wxFNB_NO_NAV_BUTTONS) && !(style & wxFNB_NO_X_BUTTON) && !(style & wxFNB_DROPDOWN_TABS_LIST)) return 22; // '<>' if(!(style & wxFNB_NO_NAV_BUTTONS) && (style & wxFNB_NO_X_BUTTON) && !(style & wxFNB_DROPDOWN_TABS_LIST)) return 53 - 16; // 'vx' if((style & wxFNB_DROPDOWN_TABS_LIST) && !(style & wxFNB_NO_X_BUTTON)) return 22 + 16; // 'v' if((style & wxFNB_DROPDOWN_TABS_LIST) && (style & wxFNB_NO_X_BUTTON)) return 22; // '<>x' return 53; } void wxFNBRenderer::DrawLeftArrow(wxWindow* pageContainer, wxDC& dc) { wxPageContainer *pc = static_cast( pageContainer ); long style = pc->GetParent()->GetWindowStyleFlag(); if(style & wxFNB_NO_NAV_BUTTONS) return; // Make sure that there are pages in the container if(pc->GetPageInfoVector().empty()) return; // Set the bitmap according to the button status wxBitmap arrowBmp; switch(pc->m_nLeftButtonStatus) { case wxFNB_BTN_HOVER: arrowBmp = wxBitmap(left_arrow_hilite_xpm); break; case wxFNB_BTN_PRESSED: arrowBmp = wxBitmap(left_arrow_pressed_xpm); break; case wxFNB_BTN_NONE: default: arrowBmp = wxBitmap(left_arrow_xpm); break; } if(pc->m_nFrom == 0) { // Handle disabled arrow arrowBmp = wxBitmap(left_arrow_disabled_xpm); } arrowBmp.SetMask(new wxMask(arrowBmp, MASK_COLOR)); // Erase old bitmap int posx = GetLeftButtonPos( pc ); dc.DrawBitmap(m_leftBgBmp, posx, 6); // Draw the new bitmap dc.DrawBitmap(arrowBmp, posx, 6, true); } void wxFNBRenderer::DrawRightArrow(wxWindow* pageContainer, wxDC& dc) { wxPageContainer *pc = static_cast( pageContainer ); long style = pc->GetParent()->GetWindowStyleFlag(); if(style & wxFNB_NO_NAV_BUTTONS) return; // Make sure that there are pages in the container if(pc->GetPageInfoVector().empty()) return; // Set the bitmap according to the button status wxBitmap arrowBmp; switch(pc->m_nRightButtonStatus) { case wxFNB_BTN_HOVER: arrowBmp = wxBitmap(right_arrow_hilite_xpm); break; case wxFNB_BTN_PRESSED: arrowBmp = wxBitmap(right_arrow_pressed_xpm); break; case wxFNB_BTN_NONE: default: arrowBmp = wxBitmap(right_arrow_xpm); break; } // Check if the right most tab is visible, if it is // don't rotate right anymore if(pc->GetPageInfoVector()[pc->GetPageInfoVector().GetCount()-1].GetPosition() != wxPoint(-1, -1)) { arrowBmp = wxBitmap(right_arrow_disabled_xpm); } arrowBmp.SetMask(new wxMask(arrowBmp, MASK_COLOR)); // erase old bitmap int posx = GetRightButtonPos( pc ) ; dc.DrawBitmap(m_rightBgBmp, posx, 6); // Draw the new bitmap dc.DrawBitmap(arrowBmp, posx, 6, true); } void wxFNBRenderer::DrawDropDownArrow(wxWindow* pageContainer, wxDC& dc) { wxPageContainer *pc = static_cast( pageContainer ); // Check if this style is enabled long style = pc->GetParent()->GetWindowStyleFlag(); if(! (style & wxFNB_DROPDOWN_TABS_LIST) ) return; // Make sure that there are pages in the container if(pc->GetPageInfoVector().empty()) return; // Set the bitmap according to the button status wxBitmap xbmp; switch(pc->m_nArrowDownButtonStatus) { case wxFNB_BTN_HOVER: xbmp = wxBitmap(down_arrow_hilite_xpm); break; case wxFNB_BTN_PRESSED: xbmp = wxBitmap(down_arrow_pressed_xpm); break; case wxFNB_BTN_NONE: default: xbmp = wxBitmap(down_arrow_xpm); break; } xbmp.SetMask(new wxMask(xbmp, MASK_COLOR)); // erase old bitmap int posx = GetDropArrowButtonPos( pc ); dc.DrawBitmap(m_rightBgBmp, posx, 6); // Draw the new bitmap dc.DrawBitmap(xbmp, posx, 6, true); } void wxFNBRenderer::DrawX(wxWindow* pageContainer, wxDC& dc) { wxPageContainer *pc = static_cast( pageContainer ); // Check if this style is enabled long style = pc->GetParent()->GetWindowStyleFlag(); if(style & wxFNB_NO_X_BUTTON) return; // Make sure that there are pages in the container if(pc->GetPageInfoVector().empty()) return; // Set the bitmap according to the button status wxBitmap xbmp; switch(pc->m_nXButtonStatus) { case wxFNB_BTN_HOVER: xbmp = wxBitmap(x_button_hilite_xpm); break; case wxFNB_BTN_PRESSED: xbmp = wxBitmap(x_button_pressed_xpm); break; case wxFNB_BTN_NONE: default: xbmp = wxBitmap(x_button_xpm); break; } xbmp.SetMask(new wxMask(xbmp, MASK_COLOR)); // erase old bitmap int posx = GetXPos( pc ); dc.DrawBitmap(m_xBgBmp, posx, 6); // Draw the new bitmap dc.DrawBitmap(xbmp, posx, 6, true); } void wxFNBRenderer::PaintStraightGradientBox(wxDC& dc, const wxRect& rect, const wxColour& startColor, const wxColour& endColor, bool vertical) { int rd, gd, bd, high = 0; rd = endColor.Red() - startColor.Red(); gd = endColor.Green() - startColor.Green(); bd = endColor.Blue() - startColor.Blue(); /// Save the current pen and brush wxPen savedPen = dc.GetPen(); wxBrush savedBrush = dc.GetBrush(); if ( vertical ) high = rect.GetHeight()-1; else high = rect.GetWidth()-1; if( high < 1 ) return; for (int i = 0; i <= high; ++i) { int r = startColor.Red() + ((i*rd*100)/high)/100; int g = startColor.Green() + ((i*gd*100)/high)/100; int b = startColor.Blue() + ((i*bd*100)/high)/100; wxPen p(wxColor(r, g, b)); dc.SetPen(p); if ( vertical ) dc.DrawLine(rect.x, rect.y+i, rect.x+rect.width, rect.y+i); else dc.DrawLine(rect.x+i, rect.y, rect.x+i, rect.y+rect.height); } /// Restore the pen and brush dc.SetPen( savedPen ); dc.SetBrush( savedBrush ); } void wxFNBRenderer::DrawTabX(wxWindow* pageContainer, wxDC& dc, const wxRect& rect, const int& tabIdx, const int btnStatus) { wxPageContainer *pc = static_cast( pageContainer ); if(!pc->HasFlag(wxFNB_X_ON_TAB)) return; /// We draw the 'x' on the active tab only if(tabIdx != pc->GetSelection() || tabIdx < 0) return; // Set the bitmap according to the button status wxBitmap xBmp; switch(btnStatus) { case wxFNB_BTN_HOVER: xBmp = wxBitmap(x_button_xpm); break; case wxFNB_BTN_PRESSED: xBmp = wxBitmap(tab_x_button_pressed_xpm); break; case wxFNB_BTN_NONE: default: xBmp = wxBitmap(x_button_xpm); break; } /// Set the masking xBmp.SetMask(new wxMask(xBmp, MASK_COLOR)); // erase old button dc.DrawBitmap(m_tabXBgBmp, rect.x, rect.y); // Draw the new bitmap dc.DrawBitmap(xBmp, rect.x, rect.y, true); // Update the vectpr wxRect rr(rect.x, rect.y, 14, 13); pc->GetPageInfoVector()[tabIdx].SetXRect( rr ); } void wxFNBRenderer::GetBitmap(wxDC &dc, const wxRect &rect, wxBitmap &bmp) { wxMemoryDC mem_dc; mem_dc.SelectObject(bmp); mem_dc.Blit(0, 0, rect.width, rect.height, &dc, rect.x, rect.y); mem_dc.SelectObject(wxNullBitmap); } wxColor wxFNBRenderer::RandomColor() { int r, g, b; r = rand() % 256; // Random value betweem 0-255 g = rand() % 256; // Random value betweem 0-255 b = rand() % 256; // Random value betweem 0-255 return wxColor(r, g, b); } wxColor wxFNBRenderer::LightColour(const wxColour& color, int percent) { int rd, gd, bd, high = 0; wxColor end_color = wxT("WHITE"); rd = end_color.Red() - color.Red(); gd = end_color.Green() - color.Green(); bd = end_color.Blue() - color.Blue(); high = 100; // We take the percent way of the color from color --> white int i = percent; int r = color.Red() + ((i*rd*100)/high)/100; int g = color.Green() + ((i*gd*100)/high)/100; int b = color.Blue() + ((i*bd*100)/high)/100; return wxColor(r, g, b); } void wxFNBRenderer::DrawTabsLine(wxWindow* pageContainer, wxDC& dc, wxCoord selTabX1, wxCoord selTabX2) { wxPageContainer *pc = static_cast( pageContainer ); wxRect clntRect = pc->GetClientRect(); wxRect clientRect, clientRect2, clientRect3; clientRect3 = wxRect(0, 0, clntRect.width, clntRect.height); if( pc->HasFlag(wxFNB_FF2) ){ wxColour fillColor; if( !pc->HasFlag(wxFNB_BOTTOM) ){ fillColor = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE); } else { fillColor = wxColor(wxT("WHITE")); } dc.SetPen( wxPen(fillColor) ); if(pc->HasFlag(wxFNB_BOTTOM)){ dc.DrawLine(1, 0, clntRect.width-1, 0); dc.DrawLine(1, 1, clntRect.width-1, 1); dc.SetPen(wxPen(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNSHADOW))); dc.DrawLine(1, 2, clntRect.width-1, 2); dc.SetPen(wxPen(fillColor)); dc.DrawLine(selTabX1 + 2, 2, selTabX2 - 1, 2); } else { dc.DrawLine(1, clntRect.height, clntRect.width-1, clntRect.height); dc.DrawLine(1, clntRect.height-1, clntRect.width-1, clntRect.height-1); dc.SetPen(wxPen(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNSHADOW))); dc.DrawLine(1, clntRect.height-2, clntRect.width-1, clntRect.height-2); dc.SetPen(wxPen(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE))); dc.DrawLine(selTabX1 + 2, clntRect.height-2, selTabX2-1, clntRect.height-2); } } else { if(pc->HasFlag(wxFNB_BOTTOM)) { clientRect = wxRect(0, 2, clntRect.width, clntRect.height - 2); clientRect2 = wxRect(0, 1, clntRect.width, clntRect.height - 1); } else { clientRect = wxRect(0, 0, clntRect.width, clntRect.height - 2); clientRect2 = wxRect(0, 0, clntRect.width, clntRect.height - 1); } dc.SetBrush(*wxTRANSPARENT_BRUSH); dc.SetPen( wxPen(pc->GetSingleLineBorderColor()) ); dc.DrawRectangle(clientRect2); dc.DrawRectangle(clientRect3); /// Patch ---- Ti-R ---- Enable to have the same color border has the selected tab if(pc->HasFlag(wxFNB_INVERSE_COLOR_LINE_VC8)) dc.SetPen(wxPen(pc->m_colorBorder)); else dc.SetPen(wxPen(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNSHADOW))); dc.DrawRectangle(clientRect); if( !pc->HasFlag(wxFNB_TABS_BORDER_SIMPLE) ) { dc.SetPen(wxPen( pc->HasFlag( wxFNB_VC71) ? wxColour(247, 243, 233) : pc->m_tabAreaColor)); dc.DrawLine(0, 0, 0, clientRect.height+1); if(pc->HasFlag(wxFNB_BOTTOM)) { dc.DrawLine(0, clientRect.height+1, clientRect.width, clientRect.height+1); } else dc.DrawLine(0, 0, clientRect.width, 0); dc.DrawLine(clientRect.width - 1, 0, clientRect.width - 1, clientRect.height+1); } /// Patch ---- Ti-R ---- Enable to have the same color border has the selected tab if(pc->HasFlag(wxFNB_BOTTOM_LINE_COLOR_CHANGE)) { dc.SetPen(wxPen(pc->m_colorBorder)); clientRect3 = wxRect(0, clntRect.height-2, 1, 2); dc.DrawRectangle(clientRect3); clientRect3 = wxRect(clntRect.width-1, clntRect.height-2, 1, 2); dc.DrawRectangle(clientRect3); } } } int wxFNBRenderer::CalcTabWidth(wxWindow *pageContainer, int tabIdx, int tabHeight) { wxPageContainer *pc = static_cast( pageContainer ); int tabWidth, shapePoints(0), width, pom; wxMemoryDC dc; // bitmap must be set before it can be used for anything wxBitmap bmp(10, 10); dc.SelectObject(bmp); /// Patch (SetTextForeground) ---- Ti-R ---- Good Text Colour /// -- old code --- // wxFont normalFont = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT); wxFont normalFont = pc->m_font; wxFont boldFont(normalFont); boldFont.SetWeight(wxFONTWEIGHT_BOLD); if( pc->IsDefaultTabs() ) shapePoints = (int)(tabHeight*tan((double)pc->GetPageInfoVector()[tabIdx].GetTabAngle()/180.0*M_PI)); if(pc->GetSelection() == tabIdx) dc.SetFont(boldFont); else dc.SetFont(normalFont); dc.GetTextExtent(pc->GetPageText(tabIdx), &width, &pom); // Set a minimum size to a tab if(width < 20) width = 20; tabWidth = ((wxFlatNotebook *)pc->m_pParent)->GetPadding() * 2 + width; /// Style to add a small 'x' button on the top right /// of the tab if(pc->HasFlag(wxFNB_X_ON_TAB) && tabIdx == pc->GetSelection()) { int spacer = 9; if( pc->HasFlag(wxFNB_VC8) ) spacer = 4; tabWidth += ((wxFlatNotebook *)pc->m_pParent)->GetPadding() + spacer; } if( pc->IsDefaultTabs() ) // Default style tabWidth += 2 * shapePoints; bool hasImage = (pc->m_ImageList != NULL && pc->GetPageInfoVector()[tabIdx].GetImageIndex() != -1); // For VC71 style, we only add the icon size (16 pixels) if(hasImage) { if( ! pc->IsDefaultTabs() ) tabWidth += (16 + ((wxFlatNotebook*)pc->m_pParent)->GetPadding()); else // Default style tabWidth += (16 + ((wxFlatNotebook*)pc->m_pParent)->GetPadding()) + shapePoints / 2; } return tabWidth; } void wxFNBRenderer::NumberTabsCanFit(wxWindow *pageContainer, std::vector &vTabInfo, int from) { wxPageContainer *pc = static_cast( pageContainer ); int tabHeight, clientWidth; wxRect rect = pc->GetClientRect(); clientWidth = rect.width; /// Empty results vTabInfo.clear(); tabHeight = CalcTabHeight( pageContainer ); // The drawing starts from posx int posx = ((wxFlatNotebook *)pc->m_pParent)->GetPadding(); if( from < 0 ) from = pc->m_nFrom; for(int i = from; i<(int)pc->GetPageInfoVector().GetCount(); i++) { int tabWidth = CalcTabWidth( pageContainer, i, tabHeight ); if(posx + tabWidth + GetButtonsAreaLength( pc ) >= clientWidth) break; /// Add a result to the returned vector wxRect tabRect(posx, VERTICAL_BORDER_PADDING, tabWidth , tabHeight); vTabInfo.push_back(tabRect); /// Advance posx posx += tabWidth; } } void wxFNBRenderer::DrawDragHint(wxWindow *pageContainer, int tabIdx) { wxUnusedVar( pageContainer ); wxUnusedVar( tabIdx ); } int wxFNBRenderer::CalcTabHeight(wxWindow *pageContainer) { int tabHeight; wxMemoryDC dc; wxUnusedVar( pageContainer ); wxBitmap bmp(10, 10); dc.SelectObject(bmp); // For GTK it seems that we must do this steps in order // for the tabs will get the proper height on initialization // on MSW, preforming these steps yields wierd results wxFont normalFont = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT); wxFont boldFont = normalFont; boldFont.SetWeight(wxFONTWEIGHT_BOLD); #ifdef __WXGTK__ dc.SetFont( boldFont ); #endif static int height(-1); static int width(-1); if( height == -1 && width == -1 ) { wxString stam = wxT("Tp"); // Temp data to get the text height; dc.GetTextExtent(stam, &width, &height); } tabHeight = height + wxFNB_HEIGHT_SPACER; // We use 8 pixels as padding #ifdef __WXGTK__ // On GTK the tabs are should be larger tabHeight += 6; #endif return tabHeight; } void wxFNBRenderer::DrawTabs(wxWindow *pageContainer, wxDC &dc, wxEvent &event) { wxPageContainer *pc = static_cast( pageContainer ); #ifndef __WXMAC__ // Works well on MSW & GTK, however this lines should be skipped on MAC if(pc->GetPageInfoVector().empty() || pc->m_nFrom >= (int)pc->GetPageInfoVector().GetCount()) { pc->Hide(); event.Skip(); return; } #endif // Get the text hight int tabHeight = CalcTabHeight(pageContainer); long style = pc->GetParent()->GetWindowStyleFlag(); // Calculate the number of rows required for drawing the tabs wxRect rect = pc->GetClientRect(); // int clientWidth = rect.width; // Set the maximum client size #ifdef __WXMAC__ pc->SetSizeHints(wxSize(GetButtonsAreaLength( pc ), tabHeight)); #endif wxPen borderPen = wxPen(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNSHADOW)); wxBrush backBrush; if(style & wxFNB_VC71) backBrush = wxBrush(wxColour(247, 243, 233)); else backBrush = wxBrush(pc->m_tabAreaColor); wxBrush noselBrush = wxBrush(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE)); wxBrush selBrush = wxBrush(pc->m_activeTabColor); wxSize size = pc->GetSize(); // Background dc.SetTextBackground((style & wxFNB_VC71 ? wxColour(247, 243, 233) : pc->GetBackgroundColour())); dc.SetTextForeground(pc->m_activeTextColor); dc.SetBrush(backBrush); // If border style is set, set the pen to be border pen if(pc->HasFlag(wxFNB_TABS_BORDER_SIMPLE)) dc.SetPen(borderPen); else { wxColor colr = pc->HasFlag( wxFNB_VC71 ) ? wxColour(247, 243, 233) : pc->GetBackgroundColour(); dc.SetPen( wxPen(colr) ); } if( pc->HasFlag(wxFNB_FF2) ){ int lightFactor = pc->HasFlag(wxFNB_BACKGROUND_GRADIENT) ? 70 : 0; PaintStraightGradientBox(dc, pc->GetClientRect(), pc->m_tabAreaColor, LightColour(pc->m_tabAreaColor, lightFactor)); dc.SetBrush( *wxTRANSPARENT_BRUSH ); dc.DrawRectangle(0, 0, size.x, size.y); } else { dc.DrawRectangle(0, 0, size.x, size.y); } // Take 3 bitmaps for the background for the buttons { wxMemoryDC mem_dc; wxRect rect; //--------------------------------------- // X button //--------------------------------------- rect = wxRect(GetXPos( pc ), 6, 16, 14); mem_dc.SelectObject(m_xBgBmp); mem_dc.Blit(0, 0, rect.width, rect.height, &dc, rect.x, rect.y); mem_dc.SelectObject(wxNullBitmap); //--------------------------------------- // Right button //--------------------------------------- rect = wxRect(GetRightButtonPos( pc ), 6, 16, 14); mem_dc.SelectObject(m_rightBgBmp); mem_dc.Blit(0, 0, rect.width, rect.height, &dc, rect.x, rect.y); mem_dc.SelectObject(wxNullBitmap); //--------------------------------------- // Left button //--------------------------------------- rect = wxRect(GetLeftButtonPos( pc ), 6, 16, 14); mem_dc.SelectObject(m_leftBgBmp); mem_dc.Blit(0, 0, rect.width, rect.height, &dc, rect.x, rect.y); mem_dc.SelectObject(wxNullBitmap); } // We always draw the bottom/upper line of the tabs // regradless the style dc.SetPen(borderPen); if( pc->HasFlag(wxFNB_FF2) == false ){ DrawTabsLine(pc, dc); } // Restore the pen dc.SetPen(borderPen); if(pc->HasFlag( wxFNB_VC71 )) { int greyLineYVal = pc->HasFlag( wxFNB_BOTTOM ) ? 0 : size.y - 2; int whiteLineYVal = pc->HasFlag( wxFNB_BOTTOM ) ? 3 : size.y - 3; wxPen pen = wxPen(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE)); dc.SetPen(pen); // Draw thik grey line between the windows area and // the tab area int num = 0; for(; num<3; num++) dc.DrawLine(0, greyLineYVal + num, size.x, greyLineYVal + num); wxPen wbPen = pc->HasFlag(wxFNB_BOTTOM) ? *wxBLACK_PEN : *wxWHITE_PEN; dc.SetPen( wbPen ); dc.DrawLine(1, whiteLineYVal, size.x - 1, whiteLineYVal); // Restore the pen dc.SetPen(borderPen); } #ifdef __WXMAC__ // On MAC, Add these lines so the tab background gets painted if(pc->GetPageInfoVector().empty() || pc->m_nFrom >= (int)pc->GetPageInfoVector().GetCount()) { pc->Hide(); return; } #endif // Draw labels /// Patch (SetTextForeground) ---- Ti-R ---- Good Text Colour /// -- old code --- //wxFont normalFont = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT); wxFont normalFont = pc->m_font; wxFont boldFont = normalFont; boldFont.SetWeight(wxFONTWEIGHT_BOLD); dc.SetFont(boldFont); int posx = ((wxFlatNotebook *)pc->m_pParent)->GetPadding(); int i = 0; // Update all the tabs from 0 to 'pc->m_nFrom' to be non visible for(i=0; im_nFrom; i++) { pc->GetPageInfoVector()[i].SetPosition(wxPoint(-1, -1)); pc->GetPageInfoVector()[i].GetRegion().Clear(); } //---------------------------------------------------------- // Go over and draw the visible tabs //---------------------------------------------------------- wxCoord x1(-1), x2(-1); std::vector vTabsInfo; NumberTabsCanFit(pc, vTabsInfo); for(i=pc->m_nFrom; im_nFrom+(int)vTabsInfo.size(); i++) { dc.SetPen(borderPen); if( !pc->HasFlag(wxFNB_FF2) ){ dc.SetBrush((i==pc->GetSelection()) ? selBrush : noselBrush); } // Now set the font to the correct font dc.SetFont((i==pc->GetSelection()) ? boldFont : normalFont); // Add the padding to the tab width // Tab width: // +-----------------------------------------------------------+ // | PADDING | IMG | IMG_PADDING | TEXT | PADDING | x |PADDING | // +-----------------------------------------------------------+ int tabWidth = CalcTabWidth(pageContainer, i, tabHeight); // By default we clean the tab region pc->GetPageInfoVector()[i].GetRegion().Clear(); // Clean the 'x' buttn on the tab. // A 'Clean' rectanlge, is a rectangle with width or height // with values lower than or equal to 0 pc->GetPageInfoVector()[i].GetXRect().SetSize(wxSize(-1, -1)); // Draw the tab (border, text, image & 'x' on tab) DrawTab(pc, dc, posx, i, tabWidth, tabHeight, pc->m_nTabXButtonStatus); if(pc->GetSelection() == i){ x1 = posx; x2 = posx + tabWidth + 2; } // Restore the text forground dc.SetTextForeground(pc->m_activeTextColor); // Update the tab position & size int posy = pc->HasFlag(wxFNB_BOTTOM) ? 0 : VERTICAL_BORDER_PADDING; pc->GetPageInfoVector()[i].SetPosition(wxPoint(posx, posy)); pc->GetPageInfoVector()[i].SetSize(wxSize(tabWidth, tabHeight)); posx += tabWidth; } // Update all tabs that can not fit into the screen as non-visible for(; i<(int)pc->GetPageInfoVector().GetCount(); i++) { pc->GetPageInfoVector()[i].SetPosition(wxPoint(-1, -1)); pc->GetPageInfoVector()[i].GetRegion().Clear(); } // Draw the left/right/close buttons // Left arrow DrawLeftArrow(pc, dc); DrawRightArrow(pc, dc); DrawX(pc, dc); DrawDropDownArrow(pc, dc); if( pc->HasFlag(wxFNB_FF2) ){ DrawTabsLine(pc, dc, x1, x2); } } //------------------------------------------ // Renderer manager //------------------------------------------ wxFNBRendererMgr::wxFNBRendererMgr() { // register renderers m_renderers[-1] = wxFNBRendererPtr(new wxFNBRendererDefault()); m_renderers[wxFNB_VC71] = wxFNBRendererPtr(new wxFNBRendererVC71()); m_renderers[wxFNB_FANCY_TABS] = wxFNBRendererPtr(new wxFNBRendererFancy()); m_renderers[wxFNB_VC8] = wxFNBRendererPtr(new wxFNBRendererVC8()); m_renderers[wxFNB_FF2] = wxFNBRendererPtr(new wxFNBRendererFirefox2()); } wxFNBRendererMgr::~wxFNBRendererMgr() { } wxFNBRendererPtr wxFNBRendererMgr::GetRenderer(long style) { // Do the ugly switch/case if( style & wxFNB_VC71 ) return m_renderers[wxFNB_VC71]; if( style & wxFNB_FANCY_TABS ) return m_renderers[wxFNB_FANCY_TABS]; if( style & wxFNB_VC8 ) return m_renderers[wxFNB_VC8]; if( style & wxFNB_FF2 ) return m_renderers[wxFNB_FF2]; // the default is to return the default renderer return m_renderers[-1]; } //------------------------------------------ // Default renderer //------------------------------------------ void wxFNBRendererDefault::DrawTab(wxWindow* pageContainer, wxDC &dc, const int &posx, const int &tabIdx, const int &tabWidth, const int &tabHeight, const int btnStatus) { // Default style wxPen borderPen = wxPen(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNSHADOW)); wxPageContainer *pc = static_cast( pageContainer ); wxPoint tabPoints[7]; tabPoints[0].x = posx; tabPoints[0].y = pc->HasFlag(wxFNB_BOTTOM) ? 2 : tabHeight - 2; tabPoints[1].x = (int)(posx+(tabHeight-2)*tan((double)(pc->GetPageInfoVector())[tabIdx].GetTabAngle()/180.0*M_PI)); tabPoints[1].y = pc->HasFlag(wxFNB_BOTTOM) ? tabHeight - (VERTICAL_BORDER_PADDING+2) : (VERTICAL_BORDER_PADDING+2); tabPoints[2].x = tabPoints[1].x+2; tabPoints[2].y = pc->HasFlag(wxFNB_BOTTOM) ? tabHeight - VERTICAL_BORDER_PADDING : VERTICAL_BORDER_PADDING; tabPoints[3].x = (int)(posx+tabWidth-(tabHeight-2)*tan((double)(pc->GetPageInfoVector())[tabIdx].GetTabAngle()/180.0*M_PI))-2; tabPoints[3].y = pc->HasFlag(wxFNB_BOTTOM) ? tabHeight - VERTICAL_BORDER_PADDING : VERTICAL_BORDER_PADDING; tabPoints[4].x = tabPoints[3].x+2; tabPoints[4].y = pc->HasFlag(wxFNB_BOTTOM) ? tabHeight - (VERTICAL_BORDER_PADDING+2) : (VERTICAL_BORDER_PADDING+2); tabPoints[5].x = (int)(tabPoints[4].x+(tabHeight-2)*tan((double)(pc->GetPageInfoVector())[tabIdx].GetTabAngle()/180.0*M_PI)); tabPoints[5].y = pc->HasFlag(wxFNB_BOTTOM) ? 2 : tabHeight - 2; tabPoints[6].x = tabPoints[0].x; tabPoints[6].y = tabPoints[0].y; if(tabIdx == pc->GetSelection()) { // Draw the tab as rounded rectangle dc.DrawPolygon(7, tabPoints); } else { if(tabIdx != pc->GetSelection() - 1) { // Draw a vertical line to the right of the text int pt1x, pt1y, pt2x, pt2y; pt1x = tabPoints[5].x; pt1y = pc->HasFlag(wxFNB_BOTTOM) ? 4 : tabHeight - 6; pt2x = tabPoints[5].x; pt2y = pc->HasFlag(wxFNB_BOTTOM) ? tabHeight - 4 : 4 ; dc.DrawLine(pt1x, pt1y, pt2x, pt2y); } } if(tabIdx == pc->GetSelection()) { wxPen savePen = dc.GetPen(); wxPen whitePen = wxPen(*wxWHITE); whitePen.SetWidth(1); dc.SetPen(whitePen); wxPoint secPt = wxPoint(tabPoints[5].x + 1, tabPoints[5].y); dc.DrawLine(tabPoints[0], secPt); // Restore the pen dc.SetPen(savePen); } // ----------------------------------- // Text and image drawing // ----------------------------------- // Text drawing offset from the left border of the // rectangle int textOffset; // The width of the images are 16 pixels int padding = static_cast( pc->GetParent() )->GetPadding(); int shapePoints = (int)(tabHeight * tan((double)pc->GetPageInfoVector()[tabIdx].GetTabAngle()/180.0*M_PI)); bool hasImage = pc->GetPageInfoVector()[tabIdx].GetImageIndex() != -1; #ifdef __WXMSW__ int imageYCoord = pc->HasFlag(wxFNB_BOTTOM) ? 6 : 8; #else int imageYCoord = pc->HasFlag(wxFNB_BOTTOM) ? 6 : 10; #endif hasImage ? textOffset = padding * 2 + 16 + shapePoints / 2 : textOffset = padding + shapePoints / 2 ; textOffset += 2; if(tabIdx != pc->GetSelection()) { // Set the text background to be like the vertical lines dc.SetTextForeground( pc->GetNonoActiveTextColor() ); } if(hasImage) { int imageXOffset = textOffset - 16 - padding; dc.DrawBitmap((*pc->GetImageList())[pc->GetPageInfoVector()[tabIdx].GetImageIndex()], posx + imageXOffset, imageYCoord, true); } dc.DrawText(pc->GetPageText(tabIdx), posx + textOffset, imageYCoord); // draw 'x' on tab (if enabled) if(pc->HasFlag(wxFNB_X_ON_TAB) && tabIdx == pc->GetSelection()) { int textWidth, textHeight; dc.GetTextExtent(pc->GetPageText(tabIdx), &textWidth, &textHeight); int tabCloseButtonXCoord = posx + textOffset + textWidth + 1; // take a bitmap from the position of the 'x' button (the x on tab button) // this bitmap will be used later to delete old buttons int tabCloseButtonYCoord = imageYCoord; wxRect x_rect(tabCloseButtonXCoord, tabCloseButtonYCoord, 16, 16); GetBitmap(dc, x_rect, m_tabXBgBmp); // Draw the tab DrawTabX(pc, dc, x_rect, tabIdx, btnStatus); } } //------------------------------------------ // Firefox2 renderer //------------------------------------------ void wxFNBRendererFirefox2::DrawTab(wxWindow* pageContainer, wxDC &dc, const int &posx, const int &tabIdx, const int &tabWidth, const int &tabHeight, const int btnStatus) { // Default style wxPen borderPen = wxPen(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNSHADOW)); wxPageContainer *pc = static_cast( pageContainer ); wxPoint tabPoints[7]; tabPoints[0].x = posx + 2; tabPoints[0].y = pc->HasFlag(wxFNB_BOTTOM) ? 2 : tabHeight - 2; tabPoints[1].x = tabPoints[0].x; tabPoints[1].y = pc->HasFlag(wxFNB_BOTTOM) ? tabHeight - (VERTICAL_BORDER_PADDING+2) : (VERTICAL_BORDER_PADDING+2); tabPoints[2].x = tabPoints[1].x+2; tabPoints[2].y = pc->HasFlag(wxFNB_BOTTOM) ? tabHeight - VERTICAL_BORDER_PADDING : VERTICAL_BORDER_PADDING; tabPoints[3].x = posx +tabWidth - 2; tabPoints[3].y = pc->HasFlag(wxFNB_BOTTOM) ? tabHeight - VERTICAL_BORDER_PADDING : VERTICAL_BORDER_PADDING; tabPoints[4].x = tabPoints[3].x+2; tabPoints[4].y = pc->HasFlag(wxFNB_BOTTOM) ? tabHeight - (VERTICAL_BORDER_PADDING+2) : (VERTICAL_BORDER_PADDING+2); tabPoints[5].x = tabPoints[4].x; tabPoints[5].y = pc->HasFlag(wxFNB_BOTTOM) ? 2 : tabHeight - 2; tabPoints[6].x = tabPoints[0].x; tabPoints[6].y = tabPoints[0].y; //------------------------------------ // Paint the tab with gradient //------------------------------------ wxRect rr(tabPoints[2], tabPoints[5]); DrawButton( dc, rr, (pc->GetSelection() == tabIdx) || (pc->HasFlag( wxFNB_PREVIEW_SELECT_TAB ) && pc->GetEnabled(tabIdx) && pc->m_nTabStatus == wxFNB_BTN_HOVER && pc->m_nTabPreviewId == tabIdx) , !pc->HasFlag(wxFNB_BOTTOM)); dc.SetBrush( *wxTRANSPARENT_BRUSH ); dc.SetPen( borderPen ); // Draw the tab as rounded rectangle dc.DrawPolygon(7, tabPoints); // ----------------------------------- // Text and image drawing // ----------------------------------- // Text drawing offset from the left border of the // rectangle int textOffset; // The width of the images are 16 pixels int padding = static_cast( pc->GetParent() )->GetPadding(); int shapePoints = (int)(tabHeight * tan((double)pc->GetPageInfoVector()[tabIdx].GetTabAngle()/180.0*M_PI)); bool hasImage = pc->GetPageInfoVector()[tabIdx].GetImageIndex() != -1; #ifdef __WXMSW__ int imageYCoord = pc->HasFlag(wxFNB_BOTTOM) ? 6 : 8; #else int imageYCoord = pc->HasFlag(wxFNB_BOTTOM) ? 6 : 10; #endif hasImage ? textOffset = padding * 2 + 16 + shapePoints / 2 : textOffset = padding + shapePoints / 2 ; textOffset += 2; if(tabIdx != pc->GetSelection()) { // Set the text background to be like the vertical lines dc.SetTextForeground( pc->GetNonoActiveTextColor() ); } if(hasImage) { int imageXOffset = textOffset - 16 - padding; dc.DrawBitmap((*pc->GetImageList())[pc->GetPageInfoVector()[tabIdx].GetImageIndex()], posx + imageXOffset, imageYCoord, true); } dc.DrawText(pc->GetPageText(tabIdx), posx + textOffset, imageYCoord); // draw 'x' on tab (if enabled) if(pc->HasFlag(wxFNB_X_ON_TAB) && tabIdx == pc->GetSelection()) { int textWidth, textHeight; dc.GetTextExtent(pc->GetPageText(tabIdx), &textWidth, &textHeight); int tabCloseButtonXCoord = posx + textOffset + textWidth + 1; // take a bitmap from the position of the 'x' button (the x on tab button) // this bitmap will be used later to delete old buttons int tabCloseButtonYCoord = imageYCoord; wxRect x_rect(tabCloseButtonXCoord, tabCloseButtonYCoord, 16, 16); GetBitmap(dc, x_rect, m_tabXBgBmp); // Draw the tab DrawTabX(pc, dc, x_rect, tabIdx, btnStatus); } } //------------------------------------------------------------------ // Visual studio 7.1 //------------------------------------------------------------------ void wxFNBRendererVC71::DrawTab(wxWindow* pageContainer, wxDC &dc, const int &posx, const int &tabIdx, const int &tabWidth, const int &tabHeight, const int btnStatus) { // Visual studio 7.1 style wxPen borderPen = wxPen(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNSHADOW)); wxPageContainer *pc = static_cast( pageContainer ); dc.SetPen((tabIdx == pc->GetSelection()) ? wxPen(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE)) : borderPen); dc.SetBrush(((tabIdx == pc->GetSelection()) ? wxBrush(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE)) : wxBrush(wxColour(247, 243, 233)))); if(tabIdx == pc->GetSelection()) { int posy = pc->HasFlag(wxFNB_BOTTOM) ? 0 : VERTICAL_BORDER_PADDING; int tabH = pc->HasFlag(wxFNB_BOTTOM) ? tabHeight - 5 : tabHeight - 3; dc.DrawRectangle(posx, posy, tabWidth, tabH); // Draw a black line on the left side of the // rectangle wxPen pen = wxPen(*wxBLACK); dc.SetPen(pen); int blackLineY1 = VERTICAL_BORDER_PADDING; int blackLineY2 = tabH; dc.DrawLine(posx + tabWidth, blackLineY1, posx + tabWidth, blackLineY2); // To give the tab more 3D look we do the following // Incase the tab is on top, // Draw a thik white line on topof the rectangle // Otherwise, draw a thin (1 pixel) black line at the bottom pen = wxPen(pc->HasFlag(wxFNB_BOTTOM) ? *wxBLACK : *wxWHITE); dc.SetPen(pen); int whiteLinePosY = pc->HasFlag(wxFNB_BOTTOM) ? blackLineY2 : VERTICAL_BORDER_PADDING ; dc.DrawLine(posx , whiteLinePosY, posx + tabWidth + 1, whiteLinePosY); // Draw a white vertical line to the left of the tab dc.SetPen( *wxWHITE_PEN ); if( !pc->HasFlag(wxFNB_BOTTOM) ) blackLineY2 += 1; dc.DrawLine(posx, blackLineY1, posx, blackLineY2); } else { // We dont draw a rectangle for non selected tabs, but only // vertical line on the left int blackLineY1 = pc->HasFlag(wxFNB_BOTTOM) ? VERTICAL_BORDER_PADDING + 2 : VERTICAL_BORDER_PADDING + 1; int blackLineY2 = pc->GetSize().y - 5 ; dc.DrawLine(posx + tabWidth, blackLineY1, posx + tabWidth, blackLineY2); } // ----------------------------------- // Text and image drawing // ----------------------------------- // Text drawing offset from the left border of the // rectangle int textOffset; // The width of the images are 16 pixels int padding = static_cast( pc->GetParent() )->GetPadding(); bool hasImage = pc->GetPageInfoVector()[tabIdx].GetImageIndex() != -1; int imageYCoord = pc->HasFlag(wxFNB_BOTTOM) ? 5 : 8; hasImage ? textOffset = padding * 2 + 16 : textOffset = padding; if(tabIdx != pc->GetSelection()) { // Set the text background to be like the vertical lines dc.SetTextForeground(pc->GetNonoActiveTextColor()); } if(hasImage) { int imageXOffset = textOffset - 16 - padding; dc.DrawBitmap((*pc->GetImageList())[pc->GetPageInfoVector()[tabIdx].GetImageIndex()], posx + imageXOffset, imageYCoord, true); } dc.DrawText(pc->GetPageText(tabIdx), posx + textOffset, imageYCoord); // draw 'x' on tab (if enabled) if(pc->HasFlag(wxFNB_X_ON_TAB) && tabIdx == pc->GetSelection()) { int textWidth, textHeight; dc.GetTextExtent(pc->GetPageText(tabIdx), &textWidth, &textHeight); int tabCloseButtonXCoord = posx + textOffset + textWidth + 1; // take a bitmap from the position of the 'x' button (the x on tab button) // this bitmap will be used later to delete old buttons int tabCloseButtonYCoord = imageYCoord; wxRect x_rect(tabCloseButtonXCoord, tabCloseButtonYCoord, 16, 16); GetBitmap(dc, x_rect, m_tabXBgBmp); // Draw the tab DrawTabX(pc, dc, x_rect, tabIdx, btnStatus); } } //------------------------------------------------------------------ // Fancy style //------------------------------------------------------------------ void wxFNBRendererFancy::DrawTab(wxWindow* pageContainer, wxDC &dc, const int &posx, const int &tabIdx, const int &tabWidth, const int &tabHeight, const int btnStatus) { // Fancy tabs - like with VC71 but with the following differences: // - The Selected tab is colored with gradient color wxPen borderPen = wxPen(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNSHADOW)); wxPageContainer *pc = static_cast( pageContainer ); wxPen pen = (tabIdx == pc->GetSelection()) ? wxPen( pc->GetBorderColour() ) : wxPen(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE)); if(tabIdx == pc->GetSelection()) { int posy = pc->HasFlag(wxFNB_BOTTOM) ? 2 : VERTICAL_BORDER_PADDING; int th = tabHeight - 5; wxRect rect(posx, posy, tabWidth, th); wxColour col2 = (pc->HasFlag( wxFNB_BOTTOM ) ) ? pc->GetGradientColourTo() : pc->GetGradientColourFrom(); wxColour col1 = (pc->HasFlag( wxFNB_BOTTOM ) ) ? pc->GetGradientColourFrom() : pc->GetGradientColourTo(); PaintStraightGradientBox(dc, rect, col1, col2); dc.SetBrush(*wxTRANSPARENT_BRUSH); dc.SetPen(pen); dc.DrawRectangle(rect); // erase the bottom/top line of the rectangle dc.SetPen( wxPen( pc->GetGradientColourFrom() ) ); if(pc->HasFlag(wxFNB_BOTTOM)) dc.DrawLine(rect.x, 2, rect.x + rect.width, 2); else dc.DrawLine(rect.x, rect.y + rect.height - 1, rect.x + rect.width, rect.y + rect.height - 1); } else { // We dont draw a rectangle for non selected tabs, but only // vertical line on the left dc.SetPen(borderPen); dc.DrawLine(posx + tabWidth, VERTICAL_BORDER_PADDING + 3, posx + tabWidth, tabHeight - 4); } // ----------------------------------- // Text and image drawing // ----------------------------------- // Text drawing offset from the left border of the // rectangle int textOffset; // The width of the images are 16 pixels int padding = static_cast( pc->GetParent() )->GetPadding(); bool hasImage = pc->GetPageInfoVector()[tabIdx].GetImageIndex() != -1; #ifdef __WXMSW__ int imageYCoord = pc->HasFlag(wxFNB_BOTTOM) ? 6 : 8; #else int imageYCoord = pc->HasFlag(wxFNB_BOTTOM) ? 6 : 10; #endif hasImage ? textOffset = padding * 2 + 16 : textOffset = padding ; if(tabIdx != pc->GetSelection()) { // Set the text background to be like the vertical lines dc.SetTextForeground(pc->GetNonoActiveTextColor()); } if(hasImage) { int imageXOffset = textOffset - 16 - padding; dc.DrawBitmap((*pc->GetImageList())[pc->GetPageInfoVector()[tabIdx].GetImageIndex()], posx + imageXOffset, imageYCoord, true); } dc.DrawText(pc->GetPageText(tabIdx), posx + textOffset, imageYCoord); // draw 'x' on tab (if enabled) if(pc->HasFlag(wxFNB_X_ON_TAB) && tabIdx == pc->GetSelection()) { int textWidth, textHeight; dc.GetTextExtent(pc->GetPageText(tabIdx), &textWidth, &textHeight); int tabCloseButtonXCoord = posx + textOffset + textWidth + 1; // take a bitmap from the position of the 'x' button (the x on tab button) // this bitmap will be used later to delete old buttons int tabCloseButtonYCoord = imageYCoord; wxRect x_rect(tabCloseButtonXCoord, tabCloseButtonYCoord, 16, 16); GetBitmap(dc, x_rect, m_tabXBgBmp); // Draw the tab DrawTabX(pc, dc, x_rect, tabIdx, btnStatus); } } //------------------------------------------------------------------ // Visual studio 2005 (VS8) //------------------------------------------------------------------ void wxFNBRendererVC8::DrawTabs(wxWindow *pageContainer, wxDC &dc, wxEvent &event) { wxPageContainer *pc = static_cast( pageContainer ); #ifndef __WXMAC__ // Works well on MSW & GTK, however this lines should be skipped on MAC if(pc->GetPageInfoVector().empty() || pc->m_nFrom >= (int)pc->GetPageInfoVector().GetCount()) { pc->Hide(); event.Skip(); return; } #endif // Get the text hight int tabHeight = CalcTabHeight( pageContainer ); // Set the font for measuring the tab height /// Patch (SetTextForeground) ---- Ti-R ---- Good Text Colour /// -- old code --- //wxFont normalFont = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT); wxFont normalFont = pc->m_font; wxFont boldFont = normalFont; boldFont.SetWeight(wxFONTWEIGHT_BOLD); // Calculate the number of rows required for drawing the tabs wxRect rect = pc->GetClientRect(); // Set the maximum client size #ifdef __WXMAC__ pc->SetSizeHints(wxSize(GetButtonsAreaLength( pc ), tabHeight)); #endif wxPen borderPen = wxPen(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNSHADOW)); /// Create brushes wxBrush backBrush; backBrush = wxBrush(pc->m_tabAreaColor); wxBrush noselBrush = wxBrush(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE)); wxBrush selBrush = wxBrush(pc->m_activeTabColor); wxSize size = pc->GetSize(); // Background dc.SetTextBackground(pc->GetBackgroundColour()); dc.SetTextForeground(pc->m_activeTextColor); // If border style is set, set the pen to be border pen if( pc->HasFlag(wxFNB_TABS_BORDER_SIMPLE) ) dc.SetPen(borderPen); else dc.SetPen(*wxTRANSPARENT_PEN); int lightFactor = pc->HasFlag(wxFNB_BACKGROUND_GRADIENT) ? 70 : 0; /// For VC8 style, we color the tab area in gradient coloring PaintStraightGradientBox(dc, pc->GetClientRect(), pc->m_tabAreaColor, LightColour(pc->m_tabAreaColor, lightFactor)); dc.SetBrush(*wxTRANSPARENT_BRUSH); dc.DrawRectangle(0, 0, size.x, size.y); // Take 3 bitmaps for the background for the buttons { wxMemoryDC mem_dc; wxRect rect; //--------------------------------------- // X button //--------------------------------------- rect = wxRect(GetXPos( pc ), 6, 16, 14); mem_dc.SelectObject(m_xBgBmp); mem_dc.Blit(0, 0, rect.width, rect.height, &dc, rect.x, rect.y); mem_dc.SelectObject(wxNullBitmap); //--------------------------------------- // Right button //--------------------------------------- rect = wxRect(GetRightButtonPos( pc ), 6, 16, 14); mem_dc.SelectObject(m_rightBgBmp); mem_dc.Blit(0, 0, rect.width, rect.height, &dc, rect.x, rect.y); mem_dc.SelectObject(wxNullBitmap); //--------------------------------------- // Left button //--------------------------------------- rect = wxRect(GetLeftButtonPos( pc ), 6, 16, 14); mem_dc.SelectObject(m_leftBgBmp); mem_dc.Blit(0, 0, rect.width, rect.height, &dc, rect.x, rect.y); mem_dc.SelectObject(wxNullBitmap); } // We always draw the bottom/upper line of the tabs // regradless the style dc.SetPen(borderPen); DrawTabsLine(pc, dc); // Restore the pen dc.SetPen(borderPen); // Draw labels dc.SetFont(boldFont); int posx; int i = 0, cur = 0; // Update all the tabs from 0 to 'pc->m_nFrom' to be non visible for(i=0; im_nFrom; i++) { pc->GetPageInfoVector()[i].SetPosition(wxPoint(-1, -1)); pc->GetPageInfoVector()[i].GetRegion().Clear(); } // Draw the visible tabs, in VC8 style, we draw them from right to left std::vector vTabsInfo; NumberTabsCanFit(pc, vTabsInfo); int activeTabPosx(0); int activeTabWidth(0); int activeTabHeight(0); for(cur=(int)vTabsInfo.size() - 1; cur>=0; cur--) { /// 'i' points to the index of the currently drawn tab /// in pc->GetPageInfoVector() vector i = pc->m_nFrom + cur; dc.SetPen(borderPen); dc.SetBrush((i==pc->GetSelection()) ? selBrush : noselBrush); // Now set the font to the correct font dc.SetFont((i==pc->GetSelection()) ? boldFont : normalFont); // Add the padding to the tab width // Tab width: // +-----------------------------------------------------------+ // | PADDING | IMG | IMG_PADDING | TEXT | PADDING | x |PADDING | // +-----------------------------------------------------------+ int tabWidth = CalcTabWidth( pageContainer, i, tabHeight ); posx = vTabsInfo[cur].x; // By default we clean the tab region // incase we use the VC8 style which requires // the region, it will be filled by the function // drawVc8Tab pc->GetPageInfoVector()[i].GetRegion().Clear(); // Clean the 'x' buttn on the tab // 'Clean' rectanlge is a rectangle with width or height // with values lower than or equal to 0 pc->GetPageInfoVector()[i].GetXRect().SetSize(wxSize(-1, -1)); // Draw the tab // Incase we are drawing the active tab // we need to redraw so it will appear on top // of all other tabs // when using the vc8 style, we keep the position of the active tab so we will draw it again later if( i == pc->GetSelection() && pc->HasFlag( wxFNB_VC8 ) ) { activeTabPosx = posx; activeTabWidth = tabWidth; activeTabHeight = tabHeight; } else { DrawTab(pc, dc, posx, i, tabWidth, tabHeight, pc->m_nTabXButtonStatus); } // Restore the text forground dc.SetTextForeground(pc->m_activeTextColor); // Update the tab position & size pc->GetPageInfoVector()[i].SetPosition(wxPoint(posx, VERTICAL_BORDER_PADDING)); pc->GetPageInfoVector()[i].SetSize(wxSize(tabWidth, tabHeight)); } // Incase we are in VC8 style, redraw the active tab (incase it is visible) if(pc->GetSelection() >= pc->m_nFrom && pc->GetSelection()< pc->m_nFrom + (int)vTabsInfo.size() ) { DrawTab(pc, dc, activeTabPosx, pc->GetSelection(), activeTabWidth, activeTabHeight, pc->m_nTabXButtonStatus); } // Update all tabs that can not fit into the screen as non-visible int xx; for(xx = pc->m_nFrom + (int)vTabsInfo.size(); xx<(int)pc->GetPageInfoVector().size(); xx++) { pc->GetPageInfoVector()[xx].SetPosition(wxPoint(-1, -1)); pc->GetPageInfoVector()[xx].GetRegion().Clear(); } // Draw the left/right/close buttons // Left arrow DrawLeftArrow(pc, dc); DrawRightArrow(pc, dc); DrawX(pc, dc); DrawDropDownArrow(pc, dc); } void wxFNBRendererVC8::DrawTab(wxWindow* pageContainer, wxDC &dc, const int &posx, const int &tabIdx, const int &tabWidth, const int &tabHeight, const int btnStatus) { // Fancy tabs - like with VC71 but with the following differences: // - The Selected tab is colored with gradient color wxPageContainer *pc = static_cast( pageContainer ); wxPen borderPen = wxPen( pc->GetBorderColour() ); wxPoint tabPoints[8]; // If we draw the first tab or the active tab, // we draw a full tab, else we draw a truncated tab // // X(2) X(3) // X(1) X(4) // // X(5) // // X(0),(7) X(6) // // tabPoints[0].x = pc->HasFlag( wxFNB_BOTTOM ) ? posx : posx + m_factor; tabPoints[0].y = pc->HasFlag( wxFNB_BOTTOM ) ? 2 : tabHeight - 3; tabPoints[1].x = tabPoints[0].x + tabHeight - VERTICAL_BORDER_PADDING - 3 - m_factor; tabPoints[1].y = pc->HasFlag( wxFNB_BOTTOM ) ? tabHeight - (VERTICAL_BORDER_PADDING+2) : (VERTICAL_BORDER_PADDING+2); tabPoints[2].x = tabPoints[1].x + 4; tabPoints[2].y = pc->HasFlag( wxFNB_BOTTOM ) ? tabHeight - VERTICAL_BORDER_PADDING : VERTICAL_BORDER_PADDING; tabPoints[3].x = tabPoints[2].x + tabWidth - 2; tabPoints[3].y = pc->HasFlag( wxFNB_BOTTOM ) ? tabHeight - VERTICAL_BORDER_PADDING : VERTICAL_BORDER_PADDING; tabPoints[4].x = tabPoints[3].x + 1; tabPoints[4].y = pc->HasFlag( wxFNB_BOTTOM ) ? tabPoints[3].y - 1 : tabPoints[3].y + 1; tabPoints[5].x = tabPoints[4].x + 1; tabPoints[5].y = pc->HasFlag( wxFNB_BOTTOM ) ? (tabPoints[4].y - 1 ): tabPoints[4].y + 1; tabPoints[6].x = tabPoints[2].x + tabWidth; tabPoints[6].y = tabPoints[0].y; tabPoints[7].x = tabPoints[0].x; tabPoints[7].y = tabPoints[0].y; pc->GetPageInfoVector()[tabIdx].SetRegion(8, tabPoints); // Draw the polygon wxBrush br = dc.GetBrush(); dc.SetBrush(wxBrush(tabIdx == pc->GetSelection() ? pc->GetActiveTabColour() : pc->GetGradientColourTo() )); /// Patch ---- Ti-R ---- Enable to have the same line color as the selected tab if(pc->HasFlag( wxFNB_INVERSE_COLOR_LINE_VC8 )) dc.SetPen(wxPen(tabIdx == pc->GetSelection() ? pc->GetBorderColour() : wxSystemSettings::GetColour(wxSYS_COLOUR_BTNSHADOW))); else dc.SetPen(wxPen(tabIdx == pc->GetSelection() ? wxSystemSettings::GetColour(wxSYS_COLOUR_BTNSHADOW) : pc->GetBorderColour())); dc.DrawPolygon(8, tabPoints); // Restore the brush dc.SetBrush(br); wxRect rect = pc->GetClientRect(); if(tabIdx != pc->GetSelection() && !pc->HasFlag( wxFNB_BOTTOM )) { /// Patch ---- Ti-R ---- Enable to have the same line color as the selected tab if(pc->HasFlag( wxFNB_INVERSE_COLOR_LINE_VC8 )) { // Top default tabs dc.SetPen(wxPen(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNSHADOW))); } else { // Top default tabs dc.SetPen(wxPen( pc->GetBorderColour() )); } int lineY = rect.height; wxPen curPen = dc.GetPen(); curPen.SetWidth(1); dc.SetPen(curPen); dc.DrawLine(posx, lineY, posx+rect.width, lineY); } // Incase we are drawing the selected tab, we draw the border of it as well // but without the bottom (upper line incase of wxBOTTOM) if(tabIdx == pc->GetSelection()) { wxPen borderPen ; /// Patch ---- Ti-R ---- Enable to have the same line color as the selected tab if(pc->HasFlag( wxFNB_INVERSE_COLOR_LINE_VC8 )) borderPen = pc->GetBorderColour(); else borderPen = wxPen(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNSHADOW)); wxBrush brush(*wxTRANSPARENT_BRUSH); dc.SetPen(borderPen); dc.SetBrush(brush); dc.DrawPolygon(8, tabPoints); // Delete the bottom line (or the upper one, incase we use wxBOTTOM) dc.SetPen(wxPen(wxT("WHITE"))); dc.DrawLine(tabPoints[0], tabPoints[6]); } FillVC8GradientColor(pc, dc, tabPoints, tabIdx == pc->GetSelection(), tabIdx); // Draw a thin line to the right of the non-selected tab if(tabIdx != pc->GetSelection()) { dc.SetPen(wxPen(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE))); dc.DrawLine(tabPoints[4].x-1, tabPoints[4].y, tabPoints[5].x-1, tabPoints[5].y); dc.DrawLine(tabPoints[5].x-1, tabPoints[5].y, tabPoints[6].x-1, tabPoints[6].y); } // Text drawing offset from the left border of the // rectangle int textOffset; // The width of the images are 16 pixels int vc8ShapeLen = tabHeight - VERTICAL_BORDER_PADDING - 2; if( pc->TabHasImage( tabIdx ) ) textOffset = ((wxFlatNotebook *)pc->m_pParent)->GetPadding() * 2 + 16 + vc8ShapeLen; else textOffset = ((wxFlatNotebook *)pc->m_pParent)->GetPadding() + vc8ShapeLen; // Draw the image for the tab if any #ifdef __WXMSW__ int imageYCoord = pc->HasFlag(wxFNB_BOTTOM) ? 6 : 8; #else int imageYCoord = pc->HasFlag(wxFNB_BOTTOM) ? 6 : 10; #endif if( pc->TabHasImage( tabIdx ) ) { int imageXOffset = textOffset - 16 - ((wxFlatNotebook *)pc->m_pParent)->GetPadding(); dc.DrawBitmap((*pc->GetImageList())[pc->GetPageInfoVector()[tabIdx].GetImageIndex()], posx + imageXOffset, imageYCoord, true); } /// Patch (SetTextForeground) ---- Ti-R ---- Good Text Colour /// -- old code --- //wxFont boldFont = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT); wxFont boldFont = pc->m_font; /// Patch (Test GetEnabled) ---- Ti-R ---- change color is disable if(!pc->GetEnabled(tabIdx)) { dc.SetTextForeground(pc->m_disableTextColor); } else { // if selected tab, draw text in bold if( tabIdx == pc->GetSelection() ) { /// Patch (SetTextForeground) ---- Ti-R ---- Good Text Colour dc.SetTextForeground(pc->m_activeTextColor); boldFont.SetWeight(wxFONTWEIGHT_BOLD); } else { /// Patch (SetTextForeground) ---- Ti-R ---- Good Text Colour dc.SetTextForeground(pc->m_nonActiveTextColor); } } dc.SetFont( boldFont ); dc.DrawText(pc->GetPageText(tabIdx), posx + textOffset, imageYCoord); // draw 'x' on tab (if enabled) if(pc->HasFlag(wxFNB_X_ON_TAB) && tabIdx == pc->GetSelection()) { int textWidth, textHeight; dc.GetTextExtent(pc->GetPageText(tabIdx), &textWidth, &textHeight); int tabCloseButtonXCoord = posx + textOffset + textWidth + 1; // take a bitmap from the position of the 'x' button (the x on tab button) // this bitmap will be used later to delete old buttons int tabCloseButtonYCoord = imageYCoord; wxRect x_rect(tabCloseButtonXCoord, tabCloseButtonYCoord, 16, 16); GetBitmap(dc, x_rect, m_tabXBgBmp); wxBitmap bmp( 16, 16 ); // Draw the tab DrawTabX(pc, dc, x_rect, tabIdx, btnStatus); } } void wxFNBRendererVC8::FillVC8GradientColor(wxWindow* pageContainer, wxDC &dc, const wxPoint tabPoints[], const bool bSelectedTab, const int tabIdx) { wxColour p_colorFrom; wxColour p_colorTo; // calculate gradient coefficients wxPageContainer *pc = static_cast( pageContainer ); /// Patch (comment) ---- Ti-R ---- No need anymore, see below /* if( m_first ) { m_first = false; pc->m_colorTo = LightColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE), 0); pc->m_colorFrom = LightColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE), 60); }*/ /// (BEGIN) Patch (m_nTabStatus) ---- Ti-R ---- Set the preview color if( pc->HasFlag( wxFNB_PREVIEW_SELECT_TAB ) && pc->GetEnabled(tabIdx) && pc->m_nTabStatus == wxFNB_BTN_HOVER && pc->m_nTabPreviewId == tabIdx) { p_colorTo = pc->m_colorPreview; p_colorFrom = pc->m_colorPreview; } else { p_colorTo = pc->GetGradientColourTo(); //LightColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE), 0); p_colorFrom = pc->GetGradientColourFrom(); //LightColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE), 60); } /// (END) Patch (m_nTabStatus) ---- Ti-R ---- wxColour col2 = pc->HasFlag( wxFNB_BOTTOM ) ? p_colorTo : p_colorFrom; wxColour col1 = pc->HasFlag( wxFNB_BOTTOM ) ? p_colorFrom : p_colorTo; // If colorful tabs style is set, override the tab color if(pc->HasFlag(wxFNB_COLORFUL_TABS)) { if( !pc->GetPageInfoVector()[tabIdx].GetColor().Ok() ) { // First time, generate color, and keep it in the vector wxColor tabColor(RandomColor()); pc->GetPageInfoVector()[tabIdx].SetColor(tabColor); } if( pc->HasFlag(wxFNB_BOTTOM) ) { col2 = LightColour( pc->GetPageInfoVector()[tabIdx].GetColor() , 50 ); col1 = LightColour( pc->GetPageInfoVector()[tabIdx].GetColor() , 80 ); } else { col1 = LightColour( pc->GetPageInfoVector()[tabIdx].GetColor() , 50 ); col2 = LightColour( pc->GetPageInfoVector()[tabIdx].GetColor() , 80 ); } } int size = abs(tabPoints[2].y - tabPoints[0].y) - 1; double rstep = double((col2.Red() - col1.Red())) / double(size), rf = 0, gstep = double((col2.Green() - col1.Green())) / double(size), gf = 0, bstep = double((col2.Blue() - col1.Blue())) / double(size), bf = 0; wxColour currCol; int y = tabPoints[0].y; // If we are drawing the selected tab, we need also to draw a line // from 0->tabPoints[0].x and tabPoints[6].x -> end, we achieve this // by drawing the rectangle with transparent brush // the line under the selected tab will be deleted by the drwaing loop if( bSelectedTab ) DrawTabsLine(pc, dc); while( true ) { if(pc->HasFlag( wxFNB_BOTTOM )) { if(y > tabPoints[0].y + size) break; } else { if(y < tabPoints[0].y - size) break; } currCol.Set( (unsigned char)(col1.Red() + rf), (unsigned char)(col1.Green() + gf), (unsigned char)(col1.Blue() + bf) ); dc.SetPen(bSelectedTab ? wxPen(pc->m_activeTabColor) : wxPen(currCol)); int startX = GetStartX(tabPoints, y, pc->GetParent()->GetWindowStyleFlag()) ; int endX = GetEndX(tabPoints, y, pc->GetParent()->GetWindowStyleFlag()); dc.DrawLine(startX, y, endX, y); // Draw the border using the 'edge' point /// Patch ---- Ti-R ---- Enable to have the same line color as the selected tab if(pc->HasFlag( wxFNB_INVERSE_COLOR_LINE_VC8 )) dc.SetPen(wxPen(bSelectedTab ? pc->m_colorBorder : wxSystemSettings::GetColour(wxSYS_COLOUR_BTNSHADOW))); else dc.SetPen(wxPen(bSelectedTab ? wxSystemSettings::GetColour(wxSYS_COLOUR_BTNSHADOW) : pc->m_colorBorder)); dc.DrawPoint(startX, y); dc.DrawPoint(endX, y); // Progress the color rf += rstep; gf += gstep; bf += bstep; pc->HasFlag( wxFNB_BOTTOM ) ? y++ : y--; } } int wxFNBRendererVC8::GetStartX(const wxPoint tabPoints[], const int &y, long style) { double x1 = 0, x2 = 0, y1 = 0, y2 = 0; // We check the 3 points to the left bool bBottomStyle = style & wxFNB_BOTTOM ? true : false; bool match = false; if(bBottomStyle) { for(int i=0; i<3; i++) { if(y >= tabPoints[i].y && y < tabPoints[i+1].y) { x1 = tabPoints[i].x; x2 = tabPoints[i+1].x; y1 = tabPoints[i].y; y2 = tabPoints[i+1].y; match = true; break; } } } else { for(int i=0; i<3; i++) { if(y <= tabPoints[i].y && y > tabPoints[i+1].y) { x1 = tabPoints[i].x; x2 = tabPoints[i+1].x; y1 = tabPoints[i].y; y2 = tabPoints[i+1].y; match = true; break; } } } if(!match) return tabPoints[2].x; // According to the equation y = ax + b => x = (y-b)/a // We know the first 2 points double a; if(x2 == x1) return static_cast( x2 ); else a = (y2 - y1) / (x2 - x1); double b = y1 - ((y2 - y1) / (x2 - x1)) * x1; if(a == 0) return static_cast( x1 ); double x = (y - b) / a; return static_cast( x ); } int wxFNBRendererVC8::GetEndX(const wxPoint tabPoints[], const int &y, long style) { double x1 = 0, x2 = 0, y1 = 0, y2 = 0; // We check the 3 points to the left bool bBottomStyle = style & wxFNB_BOTTOM ? true : false; bool match = false; if(bBottomStyle) { for(int i=7; i>3; i--) { if(y >= tabPoints[i].y && y < tabPoints[i-1].y) { x1 = tabPoints[i].x; x2 = tabPoints[i-1].x; y1 = tabPoints[i].y; y2 = tabPoints[i-1].y; match = true; break; } } } else { for(int i=7; i>3; i--) { if(y <= tabPoints[i].y && y > tabPoints[i-1].y) { x1 = tabPoints[i].x; x2 = tabPoints[i-1].x; y1 = tabPoints[i].y; y2 = tabPoints[i-1].y; match = true; break; } } } if(!match) return tabPoints[3].x; // According to the equation y = ax + b => x = (y-b)/a // We know the first 2 points double a = (y2 - y1) / (x2 - x1); // Vertical line if(x1 == x2) return (int)x1; double b = y1 - ((y2 - y1) / (x2 - x1)) * x1; if(a == 0) return (int)x1; double x = (y - b) / a; return (int)x; } void wxFNBRendererVC8::NumberTabsCanFit(wxWindow *pageContainer, std::vector &vTabInfo, int from) { wxPageContainer *pc = static_cast( pageContainer ); int tabHeight, clientWidth; wxRect rect = pc->GetClientRect(); clientWidth = rect.width; /// Empty results vTabInfo.clear(); tabHeight = CalcTabHeight( pageContainer ); // The drawing starts from posx int posx = ((wxFlatNotebook *)pc->m_pParent)->GetPadding(); if( from < 0 ) from = pc->m_nFrom; for(int i = from; i<(int)pc->GetPageInfoVector().GetCount(); i++) { int vc8glitch = tabHeight + wxFNB_HEIGHT_SPACER; int tabWidth = CalcTabWidth( pageContainer, i, tabHeight ); if(posx + tabWidth + vc8glitch + GetButtonsAreaLength( pc ) >= clientWidth) break; /// Add a result to the returned vector wxRect tabRect(posx, VERTICAL_BORDER_PADDING, tabWidth , tabHeight); vTabInfo.push_back(tabRect); /// Advance posx posx += tabWidth + wxFNB_HEIGHT_SPACER; } } wxformbuilder-3.1.59/src/controls/src/wxFlatNotebook/wxFlatNotebook.cpp0000644000175000017500000013307511143440027026622 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // Name: wxFlatNotebook.cpp // Purpose: generic implementation of flat style notebook class. // Author: Eran Ifrah // Modified by: Priyank Bolia // Created: 30/12/2005 // Modified: 01/01/2006 // Copyright: Eran Ifrah (c) // Licence: wxWindows license /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include #include #include #ifdef DEVELOPMENT # define FNB_LOG_MSG( msg ) { wxString logmsg; logmsg << msg; wxLogMessage( logmsg ); } #else # define FNB_LOG_MSG( msg ) { wxString logmsg; logmsg << msg; } #endif static bool InsideRect(const wxRect &rect, const wxPoint &pt) { #if wxCHECK_VERSION(2, 8, 0) return rect.Contains(pt); #else return rect.Inside(pt); #endif } #ifdef DEVELOPMENT #include wxString WhereToString( int where ) { static std::map whereMap; static bool first = true; if( first ) { whereMap[wxFNB_TAB] = wxT("wxFNB_TAB"); whereMap[wxFNB_X] = wxT("wxFNB_X"); whereMap[wxFNB_TAB_X] = wxT("wxFNB_TAB_X"); whereMap[wxFNB_LEFT_ARROW] = wxT("wxFNB_LEFT_ARROW"); whereMap[wxFNB_RIGHT_ARROW] = wxT("wxFNB_RIGHT_ARROW"); whereMap[wxFNB_DROP_DOWN_ARROW] = wxT("wxFNB_DROP_DOWN_ARROW"); whereMap[wxFNB_NOWHERE] = wxT("wxFNB_NOWHERE"); first = false; } return whereMap[where]; } #endif //------------------------------------------------------------------- // Provide user with a nice feedback when tab is being dragged //------------------------------------------------------------------- bool wxFNBDropSource::GiveFeedback(wxDragResult effect) { wxUnusedVar(effect); static_cast( m_win )->DrawDragHint(); return false; } IMPLEMENT_DYNAMIC_CLASS(wxFlatNotebookEvent, wxNotifyEvent) DEFINE_EVENT_TYPE(wxEVT_COMMAND_FLATNOTEBOOK_PAGE_CHANGED) DEFINE_EVENT_TYPE(wxEVT_COMMAND_FLATNOTEBOOK_PAGE_CHANGING) DEFINE_EVENT_TYPE(wxEVT_COMMAND_FLATNOTEBOOK_PAGE_CLOSING) DEFINE_EVENT_TYPE(wxEVT_COMMAND_FLATNOTEBOOK_CONTEXT_MENU) DEFINE_EVENT_TYPE(wxEVT_COMMAND_FLATNOTEBOOK_PAGE_CLOSED) IMPLEMENT_DYNAMIC_CLASS(wxFlatNotebook, wxPanel) WX_DEFINE_OBJARRAY(wxFlatNotebookImageList); WX_DEFINE_OBJARRAY(wxPageInfoArray) WX_DEFINE_OBJARRAY(wxWindowPtrArray) BEGIN_EVENT_TABLE(wxFlatNotebook, wxPanel) EVT_NAVIGATION_KEY(wxFlatNotebook::OnNavigationKey) END_EVENT_TABLE() wxFlatNotebook::wxFlatNotebook(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name) { Init(); Create(parent, id, pos, size, style, name); } void wxFlatNotebook::CleanUp () { wxFNBRendererMgrST::Free(); } wxFlatNotebook::~wxFlatNotebook(void) { } void wxFlatNotebook::Init() { m_popupWin = NULL; m_sendPageChangeEvent = true; m_bForceSelection = false; m_nPadding = 6; m_nFrom = 0; m_pages = NULL; m_mainSizer = new wxBoxSizer(wxVERTICAL); SetSizer(m_mainSizer); } bool wxFlatNotebook::Create(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name) { style |= wxTAB_TRAVERSAL; wxPanel::Create(parent, id, pos, size, style, name); m_pages = new wxPageContainer(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, style); m_pages->m_colorBorder = wxColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNSHADOW)); m_mainSizer = new wxBoxSizer(wxVERTICAL); SetSizer(m_mainSizer); SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE)); // Set default page height wxMemoryDC memDc; wxBitmap bmp(10, 10); memDc.SelectObject(bmp); int width, height; #ifdef __WXGTK__ // For GTK it seems that we must do this steps in order // for the tabs will get the proper height on initialization // on MSW, preforming these steps yields wierd results wxFont normalFont = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT); wxFont boldFont = normalFont; boldFont.SetWeight(wxFONTWEIGHT_BOLD); memDc.SetFont( boldFont ); #endif wxString stam = wxT("Tp"); // Temp data to get the text height; memDc.GetTextExtent(stam, &width, &height); int tabHeight = height + wxFNB_HEIGHT_SPACER; // We use 8 pixels as padding #ifdef __WXGTK__ // On GTK the tabs are should be larger tabHeight += 6; #endif m_pages->SetSizeHints(wxSize(-1, tabHeight)); // Add the tab container to the sizer m_mainSizer->Insert(0, m_pages, 0, wxEXPAND); m_mainSizer->Layout(); m_pages->m_nFrom = m_nFrom; m_pDropTarget = new wxFNBDropTarget(this, &wxFlatNotebook::OnDropTarget); SetDropTarget(m_pDropTarget); return true; } bool wxFlatNotebook::SetFont(const wxFont& font) { if ( m_pages != NULL ) { m_pages->m_font = font; } return true; } wxFont& wxFlatNotebook::GetFont() { return m_pages->m_font; } void wxFlatNotebook::SetActiveTabTextColour(const wxColour& textColour) { m_pages->m_activeTextColor = textColour; } wxDragResult wxFlatNotebook::OnDropTarget(wxCoord x, wxCoord y, int nTabPage, wxWindow * wnd_oldContainer) { return m_pages->OnDropTarget(x, y, nTabPage, wnd_oldContainer); } int wxFlatNotebook::GetPreviousSelection() const { return m_pages->GetPreviousSelection(); } const wxArrayInt &wxFlatNotebook::GetBrowseHistory() const { return m_pages->m_history; } bool wxFlatNotebook::AddPage(wxWindow* window, const wxString& caption, const bool selected, const int imgindex) { return InsertPage(m_windows.GetCount(), window, caption, selected, imgindex); } void wxFlatNotebook::SetImageList(wxFlatNotebookImageList * imglist) { m_pages->SetImageList(imglist); } wxFlatNotebookImageList * wxFlatNotebook::GetImageList() { return m_pages->GetImageList(); } bool wxFlatNotebook::InsertPage(size_t index, wxWindow* page, const wxString& text, bool select, const int imgindex) { // sanity check if (!page) return false; // reparent the window to us page->Reparent(this); if( !m_pages->IsShown() ) m_pages->Show(); index = FNB_MIN((unsigned int)index, (unsigned int)m_windows.GetCount()); // Insert tab bool bSelected = select || m_windows.empty(); int curSel = m_pages->GetSelection(); if(index <= m_windows.GetCount()) { m_windows.Insert(page, index); } else { m_windows.Add(page); } if( !m_pages->InsertPage(index, page, text, bSelected, imgindex) ) return false; if((int)index <= curSel) { curSel++; m_pages->m_iActivePage = (int)curSel; m_pages->DoSetSelection(curSel); } Freeze(); // Check if a new selection was made if(bSelected) { if(curSel >= 0) { // Remove the window from the main sizer m_mainSizer->Detach(m_windows[curSel]); m_windows[curSel]->Hide(); } m_pages->SetSelection(index); } else { // Hide the page page->Hide(); } m_mainSizer->Layout(); Thaw(); Refresh(); return true; } void wxFlatNotebook::SetSelection(size_t page) { if(page >= m_windows.GetCount()) return; // Support for disabed tabs if(!m_pages->GetEnabled(page) && m_windows.GetCount() > 1 && !m_bForceSelection) return; if( m_sendPageChangeEvent ) { // Allow the user to veto the selection int oldSelection = GetSelection(); wxFlatNotebookEvent event(wxEVT_COMMAND_FLATNOTEBOOK_PAGE_CHANGING, GetId()); event.SetSelection( (int)page ); event.SetOldSelection( oldSelection ); event.SetEventObject( this ); GetEventHandler()->ProcessEvent(event); if( !event.IsAllowed() ) { return; } } int curSel = m_pages->GetSelection(); // program allows the page change Freeze(); if(curSel >= 0) { // Remove the window from the main sizer m_mainSizer->Detach(m_windows[curSel]); m_windows[curSel]->Hide(); } if(m_windowStyle & wxFNB_BOTTOM) { m_mainSizer->Insert(0, m_windows[page], 1, wxEXPAND); } else { // We leave a space of 1 pixel around the window m_mainSizer->Add(m_windows[page], 1, wxEXPAND); } m_windows[page]->Show(); m_mainSizer->Layout(); Thaw(); if( page != (size_t)m_pages->m_iActivePage ){ //keep the page history m_pages->PushPageHistory(m_pages->m_iActivePage); } m_pages->m_iActivePage = (int)page; m_pages->DoSetSelection(page); if( m_sendPageChangeEvent ) { // Fire event 'Page Changed' wxFlatNotebookEvent event(wxEVT_COMMAND_FLATNOTEBOOK_PAGE_CHANGED, GetId()); event.SetSelection( (int)page ); event.SetEventObject( this ); GetEventHandler()->ProcessEvent(event); } } void wxFlatNotebook::DeletePage(size_t page, bool notify) { if(page >= m_windows.GetCount()) return; // Fire a closing event if( notify ) { wxFlatNotebookEvent event(wxEVT_COMMAND_FLATNOTEBOOK_PAGE_CLOSING, GetId()); event.SetSelection((int)page); event.SetEventObject(this); GetEventHandler()->ProcessEvent(event); // The event handler allows it? if (!event.IsAllowed()) return; } Freeze(); // Delete the requested page wxWindow *pageRemoved = m_windows[page]; // If the page is the current window, remove it from the sizer // as well if((int)page == m_pages->GetSelection()) { m_mainSizer->Detach(pageRemoved); } // Remove it from the array as well m_windows.RemoveAt(page); // Now we can destroy it; in wxWidgets use Destroy instead of delete pageRemoved->Destroy(); Thaw(); m_pages->DoDeletePage(page); Refresh(); // Fire a closed event if( notify ) { wxFlatNotebookEvent closedEvent(wxEVT_COMMAND_FLATNOTEBOOK_PAGE_CLOSED, GetId()); closedEvent.SetSelection((int)page); closedEvent.SetEventObject(this); GetEventHandler()->ProcessEvent(closedEvent); } } bool wxFlatNotebook::DeleteAllPages() { if(m_windows.empty()) return false; Freeze(); int i = 0; for(; i<(int)m_windows.GetCount(); i++) { delete m_windows[i]; } m_windows.Clear(); Thaw(); // Clear the container of the tabs as well m_pages->DeleteAllPages(); return true; } wxWindow* wxFlatNotebook::GetCurrentPage() const { int sel = m_pages->GetSelection(); if(sel < 0) return NULL; return m_windows[sel]; } wxWindow* wxFlatNotebook::GetPage(size_t page) const { if(page >= m_windows.GetCount()) return NULL; return m_windows[page]; } int wxFlatNotebook::GetPageIndex(wxWindow* win) const { for (size_t i = 0; i < m_windows.GetCount(); ++i) { if (m_windows[i] == win) return (int)i; } return -1; } int wxFlatNotebook::GetSelection() const { return m_pages->GetSelection(); } void wxFlatNotebook::AdvanceSelection(bool bForward) { m_pages->AdvanceSelection(bForward); } int wxFlatNotebook::GetPageCount() const { return (int)m_pages->GetPageCount(); } void wxFlatNotebook::OnNavigationKey(wxNavigationKeyEvent& event) { if ( event.IsWindowChange() ) { if( HasFlag(wxFNB_SMART_TABS) ) { if( !m_popupWin && GetPageCount() > 0) { m_popupWin = new wxTabNavigatorWindow( this ); m_popupWin->ShowModal(); m_popupWin->Destroy(); SetSelection((size_t)GetSelection()); m_popupWin = NULL; } else if( m_popupWin ) { // a dialog is already opened m_popupWin->OnNavigationKey( event ); return; } } else { // change pages AdvanceSelection(event.GetDirection()); } } else { // pass to the parent if ( GetParent() ) { event.SetCurrentFocus(this); GetParent()->ProcessEvent(event); } } } bool wxFlatNotebook::GetPageShapeAngle(int page_index, unsigned int * result) { if(page_index < 0 || page_index >= (int)m_pages->m_pagesInfoVec.GetCount()) return false; *result = m_pages->m_pagesInfoVec[page_index].GetTabAngle(); return true; } void wxFlatNotebook::SetPageShapeAngle(int page_index, unsigned int angle) { if(page_index < 0 || page_index >= (int)m_pages->m_pagesInfoVec.GetCount()) return; if(angle > 15) return; m_pages->m_pagesInfoVec[page_index].SetTabAngle(angle); } void wxFlatNotebook::SetAllPagesShapeAngle(unsigned int angle) { if(angle > 15) return; for(unsigned int i = 0; i < m_pages->m_pagesInfoVec.GetCount(); i++) { m_pages->m_pagesInfoVec[i].SetTabAngle(angle); } Refresh(); } wxSize wxFlatNotebook::GetPageBestSize() { return m_pages->GetClientSize(); } bool wxFlatNotebook::SetPageText(size_t page, const wxString& text) { bool bVal = m_pages->SetPageText(page, text); m_pages->Refresh(); return bVal; } void wxFlatNotebook::SetPadding(const wxSize& padding) { m_nPadding = padding.GetWidth(); } void wxFlatNotebook::SetWindowStyleFlag(long style) { wxPanel::SetWindowStyleFlag(style); if(m_pages) { // For changing the tab position (i.e. placing them top/bottom) // refreshing the tab container is not enough m_sendPageChangeEvent = false; SetSelection(m_pages->m_iActivePage); m_sendPageChangeEvent = true; } } bool wxFlatNotebook::RemovePage(size_t page, bool notify) { if(page >= m_windows.GetCount()) return false; // Fire a closing event if( notify ) { wxFlatNotebookEvent event(wxEVT_COMMAND_FLATNOTEBOOK_PAGE_CLOSING, GetId()); event.SetSelection((int)page); event.SetEventObject(this); GetEventHandler()->ProcessEvent(event); // The event handler allows it? if (!event.IsAllowed()) return false; } Freeze(); // Remove the requested page wxWindow *pageRemoved = m_windows[page]; // If the page is the current window, remove it from the sizer // as well if((int)page == m_pages->GetSelection()) { m_mainSizer->Detach(pageRemoved); } // Remove it from the array as well m_windows.RemoveAt(page); Thaw(); m_pages->DoDeletePage(page); // Fire a closed event if( notify ) { wxFlatNotebookEvent closedEvent(wxEVT_COMMAND_FLATNOTEBOOK_PAGE_CLOSED, GetId()); closedEvent.SetSelection((int)page); closedEvent.SetEventObject(this); GetEventHandler()->ProcessEvent(closedEvent); } return true; } void wxFlatNotebook::SetRightClickMenu(wxMenu* menu) { m_pages->m_pRightClickMenu = menu; } wxString wxFlatNotebook::GetPageText(size_t page) { return m_pages->GetPageText(page); } void wxFlatNotebook::SetGradientColors(const wxColour& from, const wxColour& to, const wxColour& border) { m_pages->m_colorFrom = from; m_pages->m_colorTo = to; m_pages->m_colorBorder = border; } void wxFlatNotebook::SetGradientColorFrom(const wxColour& from) { m_pages->m_colorFrom = from; } void wxFlatNotebook::SetGradientColorTo(const wxColour& to) { m_pages->m_colorTo = to; } void wxFlatNotebook::SetGradientColorBorder(const wxColour& border) { m_pages->m_colorBorder = border; } /// Patch ---- Ti-R ---- Enable to show next tab selected if user click void wxFlatNotebook::SetPreviewSelectColor(const wxColour& select) { m_pages->m_colorPreview = select; } /// Patch ---- Ti-R ---- Set the disable color of the text void wxFlatNotebook::SetDisableTextColour(const wxColour& disable) { m_pages->m_disableTextColor = disable; } /// Gets first gradient colour const wxColour& wxFlatNotebook::GetGradientColorFrom() { return m_pages->m_colorFrom; } /// Gets second gradient colour const wxColour& wxFlatNotebook::GetGradientColorTo() { return m_pages->m_colorTo; } /// Gets the tab border colour const wxColour& wxFlatNotebook::SetGradientColorBorder() { return m_pages->m_colorBorder; } /// Get the active tab text const wxColour& wxFlatNotebook::GetActiveTabTextColour() { return m_pages->m_activeTextColor; } void wxFlatNotebook::SetPageImageIndex(size_t page, int imgindex) { m_pages->SetPageImageIndex(page, imgindex); } int wxFlatNotebook::GetPageImageIndex(size_t page) { return m_pages->GetPageImageIndex(page); } bool wxFlatNotebook::GetEnabled(size_t page) { return m_pages->GetEnabled(page); } void wxFlatNotebook::Enable(size_t page, bool enabled) { if(page >= m_windows.GetCount()) return; m_windows[page]->Enable(enabled); m_pages->Enable(page, enabled); } const wxColour& wxFlatNotebook::GetNonActiveTabTextColour() { return m_pages->m_nonActiveTextColor; } void wxFlatNotebook::SetNonActiveTabTextColour(const wxColour& color) { m_pages->m_nonActiveTextColor = color; } void wxFlatNotebook::SetTabAreaColour(const wxColour& color) { m_pages->m_tabAreaColor = color; } const wxColour& wxFlatNotebook::GetTabAreaColour() { return m_pages->m_tabAreaColor; } void wxFlatNotebook::SetActiveTabColour(const wxColour& color) { m_pages->m_activeTabColor = color; } const wxColour& wxFlatNotebook::GetActiveTabColour() { return m_pages->m_activeTabColor; } long wxFlatNotebook::GetCustomizeOptions() const { return m_pages->GetCustomizeOptions(); } void wxFlatNotebook::SetCustomizeOptions(long options) { m_pages->SetCustomizeOptions(options); } /////////////////////////////////////////////////////////////////////////////////////////// // // wxPageContainer // /////////////////////////////////////////////////////////////////////////////////////////// BEGIN_EVENT_TABLE(wxPageContainer, wxPanel) EVT_PAINT(wxPageContainer::OnPaint) EVT_SIZE(wxPageContainer::OnSize) EVT_LEFT_DOWN(wxPageContainer::OnLeftDown) EVT_LEFT_UP(wxPageContainer::OnLeftUp) EVT_RIGHT_DOWN(wxPageContainer::OnRightDown) EVT_MIDDLE_DOWN(wxPageContainer::OnMiddleDown) EVT_MOTION(wxPageContainer::OnMouseMove) EVT_ERASE_BACKGROUND(wxPageContainer::OnEraseBackground) EVT_LEAVE_WINDOW(wxPageContainer::OnMouseLeave) EVT_ENTER_WINDOW(wxPageContainer::OnMouseEnterWindow) EVT_LEFT_DCLICK(wxPageContainer::OnLeftDClick) END_EVENT_TABLE() wxPageContainer::wxPageContainer(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style) : m_ImageList(NULL) , m_iActivePage(-1) , m_pDropTarget(NULL) , m_nLeftClickZone(wxFNB_NOWHERE) , m_customizeOptions(wxFNB_CUSTOM_ALL) { m_pRightClickMenu = NULL; m_nXButtonStatus = wxFNB_BTN_NONE; m_nArrowDownButtonStatus = wxFNB_BTN_NONE; m_pParent = parent; m_nRightButtonStatus = wxFNB_BTN_NONE; m_nLeftButtonStatus = wxFNB_BTN_NONE; m_nTabXButtonStatus = wxFNB_BTN_NONE; m_customMenu = NULL; /// Patch (m_nTabStatus) ---- Ti-R ---- Enable to show next tab selected if user click m_nTabStatus = wxFNB_BTN_NONE; m_colorTo = wxColour(wxSystemSettings::GetColour(wxSYS_COLOUR_ACTIVECAPTION)); m_colorFrom = wxColor(*wxWHITE); m_activeTabColor = wxColor(*wxWHITE); m_activeTextColor = wxColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNTEXT)); m_nonActiveTextColor = wxColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNTEXT)); m_tabAreaColor = wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE); m_disableTextColor = wxColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNSHADOW)); /// Patch (m_font) ---- Ti-R ---- Enable to change the font m_font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT); /// Patch (m_font) ---- Ti-R ---- Enable to preview the selected tab m_colorPreview = wxColor(193, 210, 238); // Set default page height, this is done according to the system font wxMemoryDC memDc; wxBitmap bmp(10, 10); memDc.SelectObject(bmp); int width, height; #ifdef __WXGTK__ wxFont normalFont = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT); wxFont boldFont = normalFont; boldFont.SetWeight(wxBOLD); memDc.SetFont( boldFont ); #endif memDc.GetTextExtent(wxT("Tp"), &width, &height); int tabHeight = height + wxFNB_HEIGHT_SPACER; // We use 10 pixels as padding wxWindow::Create(parent, id, pos, wxSize(size.x, tabHeight), style | wxNO_BORDER | wxNO_FULL_REPAINT_ON_RESIZE); m_pDropTarget = new wxFNBDropTarget(this, &wxPageContainer::OnDropTarget); SetDropTarget(m_pDropTarget); } wxPageContainer::~wxPageContainer(void) { if(m_pRightClickMenu) { delete m_pRightClickMenu; m_pRightClickMenu = NULL; } if( m_customMenu ) { delete m_customMenu; m_customMenu = NULL; } } void wxPageContainer::OnPaint(wxPaintEvent & event) { wxBufferedPaintDC dc(this); wxFNBRendererPtr render = wxFNBRendererMgrST::Get()->GetRenderer( GetParent()->GetWindowStyleFlag() ); render->DrawTabs(this, dc, event); } void wxPageContainer::PopPageHistory(int page) { int tabIdx(wxNOT_FOUND); int where = m_history.Index(page); while(where != wxNOT_FOUND){ tabIdx = m_history.Item(where); m_history.Remove(page); //remove all appearances of this page where = m_history.Index(page); } //update values if(tabIdx != wxNOT_FOUND){ for(size_t i=0; i tabIdx){ tt--; } } } } void wxPageContainer::PushPageHistory(int page) { if(page == wxNOT_FOUND) return; int where = m_history.Index(page); if(where != wxNOT_FOUND){ m_history.Remove(page); } m_history.Insert(page, 0); } bool wxPageContainer::AddPage(const wxString& caption, const bool selected, const int imgindex) { if(selected) { PushPageHistory(m_iActivePage); m_iActivePage = (int)m_pagesInfoVec.GetCount(); } /// Create page info and add it to the vector wxPageInfo pageInfo(caption, imgindex); m_pagesInfoVec.Add(pageInfo); Refresh(); return true; } bool wxPageContainer::InsertPage(size_t index, wxWindow* /*page*/, const wxString& text, bool select, const int imgindex) { if(select) { PushPageHistory(m_iActivePage); m_iActivePage = (int)index; } wxPageInfo pgInfo(text, imgindex); m_pagesInfoVec.Insert(pgInfo, index); Refresh(); return true; } void wxPageContainer::OnSize(wxSizeEvent& WXUNUSED(event)) { // When resizing the control, try to fit to screen as many tabs as we we can long style = GetParent()->GetWindowStyleFlag(); wxFNBRendererPtr render = wxFNBRendererMgrST::Get()->GetRenderer(style); std::vector vTabInfo; int from = 0; int page = GetSelection(); for(; fromNumberTabsCanFit( this, vTabInfo, from ); if(page - from >= static_cast( vTabInfo.size() )) continue; break; } m_nFrom = from; Refresh(); // Call on paint } void wxPageContainer::OnMiddleDown(wxMouseEvent& event) { // Test if this style is enabled long style = GetParent()->GetWindowStyleFlag(); if(!(style & wxFNB_MOUSE_MIDDLE_CLOSES_TABS)) return; wxPageInfo pgInfo; int tabIdx; int where = HitTest(event.GetPosition(), pgInfo, tabIdx); switch(where) { case wxFNB_TAB: { DeletePage((size_t)tabIdx); break; } default: break; } event.Skip(); } void wxPageContainer::OnShowCustomizeDialog(wxCommandEvent &event) { wxUnusedVar(event); wxFNBCustomizeDialog *dlg = new wxFNBCustomizeDialog(this, m_customizeOptions); dlg->ShowModal(); dlg->Destroy(); } void wxPageContainer::OnRightDown(wxMouseEvent& event) { FNB_LOG_MSG(wxT("OnRightDown") << event.GetPosition().x << wxT(",") << event.GetPosition().y ); wxPageInfo pgInfo; int tabIdx; int where = HitTest(event.GetPosition(), pgInfo, tabIdx); switch(where) { case wxFNB_NOWHERE: { // Incase user right clicked on 'anywhere' and style wxFNB_CUSTOM_DLG is set, // popup the customize dialog long style = GetParent()->GetWindowStyleFlag(); if( style & wxFNB_CUSTOM_DLG ){ if( !m_customMenu ){ m_customMenu = new wxMenu(); wxMenuItem *item = new wxMenuItem(m_customMenu, wxID_ANY, wxT("Properties...")); m_customMenu->Append(item); Connect( item->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( wxPageContainer::OnShowCustomizeDialog )); } PopupMenu(m_customMenu); } } break; case wxFNB_TAB: case wxFNB_TAB_X: { if(!m_pagesInfoVec[tabIdx].GetEnabled()) break; // Set the current tab to be active // if needed if(tabIdx != GetSelection()) { SetSelection((size_t)tabIdx); } // If the owner has defined a context menu for the tabs, // popup the right click menu if (m_pRightClickMenu) PopupMenu(m_pRightClickMenu); else { // send a message to popup a custom menu wxFlatNotebookEvent event(wxEVT_COMMAND_FLATNOTEBOOK_CONTEXT_MENU, GetParent()->GetId()); event.SetSelection((int)tabIdx); event.SetOldSelection((int)m_iActivePage); event.SetEventObject(GetParent()); GetParent()->GetEventHandler()->ProcessEvent(event); } } break; default: break; } } void wxPageContainer::OnLeftDown(wxMouseEvent& event) { wxPageInfo pgInfo; int tabIdx; // Reset buttons status m_nXButtonStatus = wxFNB_BTN_NONE; m_nLeftButtonStatus = wxFNB_BTN_NONE; m_nRightButtonStatus = wxFNB_BTN_NONE; m_nTabXButtonStatus = wxFNB_BTN_NONE; m_nArrowDownButtonStatus = wxFNB_BTN_NONE; /// Patch (m_nTabStatus) ---- Ti-R ---- Enable to show next tab selected if user click m_nTabStatus = wxFNB_BTN_NONE; m_nLeftClickZone = HitTest(event.GetPosition(), pgInfo, tabIdx); switch(m_nLeftClickZone) { case wxFNB_DROP_DOWN_ARROW: m_nArrowDownButtonStatus = wxFNB_BTN_PRESSED; Refresh(); break; case wxFNB_LEFT_ARROW: m_nLeftButtonStatus = wxFNB_BTN_PRESSED; Refresh(); break; case wxFNB_RIGHT_ARROW: m_nRightButtonStatus = wxFNB_BTN_PRESSED; Refresh(); break; case wxFNB_X: m_nXButtonStatus = wxFNB_BTN_PRESSED; Refresh(); break; case wxFNB_TAB_X: m_nTabXButtonStatus = wxFNB_BTN_PRESSED; Refresh(); break; case wxFNB_TAB: { if(m_iActivePage != tabIdx) { // Incase the tab is disabled, we dont allow to choose it if(!m_pagesInfoVec[tabIdx].GetEnabled()) break; SetSelection(tabIdx); } break; } } } void wxPageContainer::RotateLeft() { if(m_nFrom == 0) return; // Make sure that the button was pressed before if(m_nLeftButtonStatus != wxFNB_BTN_PRESSED) return; m_nLeftButtonStatus = wxFNB_BTN_HOVER; // We scroll left with bulks of 5 int scrollLeft = GetNumTabsCanScrollLeft(); m_nFrom -= scrollLeft; if(m_nFrom < 0) m_nFrom = 0; Refresh(); return; } void wxPageContainer::RotateRight() { if(m_nFrom >= (int)m_pagesInfoVec.GetCount() - 1) return; // Make sure that the button was pressed before if(m_nRightButtonStatus != wxFNB_BTN_PRESSED) return; m_nRightButtonStatus = wxFNB_BTN_HOVER; // Check if the right most tab is visible, if it is // don't rotate right anymore if(m_pagesInfoVec[m_pagesInfoVec.GetCount()-1].GetPosition() != wxPoint(-1, -1)) return; m_nFrom += 1; Refresh(); } void wxPageContainer::OnLeftUp(wxMouseEvent& event) { wxPageInfo pgInfo; int tabIdx; // forget the zone that was initially clicked m_nLeftClickZone = wxFNB_NOWHERE; int where = HitTest(event.GetPosition(), pgInfo, tabIdx); switch(where) { case wxFNB_LEFT_ARROW: { RotateLeft(); break; } case wxFNB_RIGHT_ARROW: { RotateRight(); break; } case wxFNB_X: { // Make sure that the button was pressed before if(m_nXButtonStatus != wxFNB_BTN_PRESSED) break; m_nXButtonStatus = wxFNB_BTN_HOVER; DeletePage((size_t)m_iActivePage); break; } case wxFNB_TAB_X: { // Make sure that the button was pressed before if(m_nTabXButtonStatus != wxFNB_BTN_PRESSED) break; m_nTabXButtonStatus = wxFNB_BTN_HOVER; DeletePage((size_t)m_iActivePage); break; } case wxFNB_DROP_DOWN_ARROW: { // Make sure that the button was pressed before if(m_nArrowDownButtonStatus != wxFNB_BTN_PRESSED) break; m_nArrowDownButtonStatus = wxFNB_BTN_NONE; // Refresh the button status wxFNBRendererPtr render = wxFNBRendererMgrST::Get()->GetRenderer( GetParent()->GetWindowStyleFlag() ); wxClientDC dc(this); render->DrawDropDownArrow(this, dc); PopupTabsMenu(); break; } } event.Skip(); } int wxPageContainer::HitTest(const wxPoint& pt, wxPageInfo& pageInfo, int &tabIdx) { wxFNBRendererPtr render = wxFNBRendererMgrST::Get()->GetRenderer( GetParent()->GetWindowStyleFlag() ); wxRect rect = GetClientRect(); int btnLeftPos = render->GetLeftButtonPos(this); int btnRightPos = render->GetRightButtonPos(this); int btnXPos =render->GetXPos(this); long style = GetParent()->GetWindowStyleFlag(); tabIdx = -1; if(m_pagesInfoVec.IsEmpty()) { return wxFNB_NOWHERE; } rect = wxRect(btnXPos, 8, 16, 16); if(InsideRect(rect, pt)) { return (style & wxFNB_NO_X_BUTTON) ? wxFNB_NOWHERE : wxFNB_X; } rect = wxRect(btnRightPos, 8, 16, 16); if( style & wxFNB_DROPDOWN_TABS_LIST ) { rect = wxRect(render->GetDropArrowButtonPos( this ), 8, 16, 16); if(InsideRect(rect, pt)) return wxFNB_DROP_DOWN_ARROW; } if(InsideRect(rect, pt)) { return (style & wxFNB_NO_NAV_BUTTONS) ? wxFNB_NOWHERE : wxFNB_RIGHT_ARROW; } rect = wxRect(btnLeftPos, 8, 16, 16); if(InsideRect(rect, pt)) { return (style & wxFNB_NO_NAV_BUTTONS) ? wxFNB_NOWHERE : wxFNB_LEFT_ARROW; } // Test whether a left click was made on a tab bool bFoundMatch = false; for(size_t cur=m_nFrom; curSetSelection(page); DoSetSelection(page); } void wxPageContainer::DoSetSelection(size_t page) { // Make sure that the selection is visible if(page < m_pagesInfoVec.GetCount()) { //! fix for tabfocus wxWindow* da_page = ((wxFlatNotebook *)m_pParent)->GetPage(page); if ( da_page!=NULL ) da_page->SetFocus(); } if( !IsTabVisible(page) ) { FNB_LOG_MSG( wxT("Tab ") << (int)page << wxT(" is not visible")); FNB_LOG_MSG( wxT("m_nFrom=") << m_nFrom << wxT(", Selection=") << (int)page ); // Try to remove one tab from start and try again if( !CanFitToScreen(page) ) { if( m_nFrom > (int)page ) m_nFrom = (int)page; else { while( m_nFrom < (int)page ) { m_nFrom++; if( CanFitToScreen(page) ) break; } } FNB_LOG_MSG( wxT("Adjusting m_nFrom to=") << m_nFrom); } } else { FNB_LOG_MSG( wxT("Tab ") << (int)page << wxT(" is visible")); } PushPageHistory((int)page); Refresh(); } void wxPageContainer::DeletePage(size_t page) { wxFlatNotebook* book = (wxFlatNotebook*)GetParent(); book->DeletePage(page); book->Refresh(); } bool wxPageContainer::IsTabVisible(size_t page) { int iPage = (int)page; int iLastVisiblePage = GetLastVisibleTab(); return iPage <= iLastVisiblePage && iPage >= m_nFrom; } int wxPageContainer::GetPreviousSelection() const { if(m_history.empty()){ return wxNOT_FOUND; } //return the top of the heap return m_history.Item(0); } void wxPageContainer::DoDeletePage(size_t page) { // Remove the page from the vector wxFlatNotebook* book = (wxFlatNotebook*)GetParent(); PopPageHistory((int)page); // same thing with the active page if (m_iActivePage > (int)page || (int)page >= (int)(m_pagesInfoVec.Count())){ m_iActivePage -= 1; }else if (m_iActivePage == (int)page){ m_iActivePage = GetPreviousSelection(); //PopPageHistory(m_iActivePage); } m_pagesInfoVec.RemoveAt(page); if(m_iActivePage == wxNOT_FOUND && m_pagesInfoVec.Count() > 0){ m_iActivePage = 0; } // Refresh the tabs book->SetForceSelection(true); book->SetSelection(m_iActivePage); book->SetForceSelection(false); if(m_pagesInfoVec.empty()) { // Erase the page container drawings wxClientDC dc(this); dc.Clear(); } } void wxPageContainer::DeleteAllPages() { m_iActivePage = -1; m_history.Clear(); m_nFrom = 0; m_pagesInfoVec.Clear(); // Erase the page container drawings wxClientDC dc(this); dc.Clear(); } void wxPageContainer::OnMouseMove(wxMouseEvent& event) { if (!m_pagesInfoVec.empty() && IsShown()) { const int xButtonStatus = m_nXButtonStatus; const int xTabButtonStatus = m_nTabXButtonStatus; const int rightButtonStatus = m_nRightButtonStatus; const int leftButtonStatus = m_nLeftButtonStatus; const int dropDownButtonStatus = m_nArrowDownButtonStatus; /// Patch (savePreviewId) ---- Ti-R ---- Enable to show next tab selected if user click const int savePreviewId = m_nTabPreviewId; long style = GetParent()->GetWindowStyleFlag(); m_nXButtonStatus = wxFNB_BTN_NONE; m_nRightButtonStatus = wxFNB_BTN_NONE; m_nLeftButtonStatus = wxFNB_BTN_NONE; m_nTabXButtonStatus = wxFNB_BTN_NONE; m_nArrowDownButtonStatus = wxFNB_BTN_NONE; /// Patch (m_nTabStatus) ---- Ti-R ---- Enable to show next tab selected if user click m_nTabStatus = wxFNB_BTN_NONE; wxPageInfo pgInfo; int tabIdx; int where = HitTest(event.GetPosition(), pgInfo, tabIdx); switch ( where ) { case wxFNB_X: if (event.LeftIsDown()) { m_nXButtonStatus = (m_nLeftClickZone==wxFNB_X) ? wxFNB_BTN_PRESSED : wxFNB_BTN_NONE; } else { m_nXButtonStatus = wxFNB_BTN_HOVER; } break; case wxFNB_DROP_DOWN_ARROW: if (event.LeftIsDown()) { m_nArrowDownButtonStatus = (m_nLeftClickZone == wxFNB_DROP_DOWN_ARROW) ? wxFNB_BTN_PRESSED : wxFNB_BTN_NONE; } else { m_nArrowDownButtonStatus = wxFNB_BTN_HOVER; } break; case wxFNB_TAB_X: if (event.LeftIsDown()) { m_nTabXButtonStatus = (m_nLeftClickZone==wxFNB_TAB_X) ? wxFNB_BTN_PRESSED : wxFNB_BTN_NONE; } else { m_nTabXButtonStatus = wxFNB_BTN_HOVER; } break; case wxFNB_RIGHT_ARROW: if (event.LeftIsDown()) { m_nRightButtonStatus = (m_nLeftClickZone==wxFNB_RIGHT_ARROW) ? wxFNB_BTN_PRESSED : wxFNB_BTN_NONE; } else { m_nRightButtonStatus = wxFNB_BTN_HOVER; } break; case wxFNB_LEFT_ARROW: if (event.LeftIsDown()) { m_nLeftButtonStatus = (m_nLeftClickZone==wxFNB_LEFT_ARROW) ? wxFNB_BTN_PRESSED : wxFNB_BTN_NONE; } else { m_nLeftButtonStatus = wxFNB_BTN_HOVER; } break; case wxFNB_TAB: // Call virtual method for showing tooltip ShowTabTooltip(tabIdx); if(!GetEnabled((size_t)tabIdx)) { // Set the cursor to be 'No-entry' ::wxSetCursor(wxCURSOR_NO_ENTRY); } // Support for drag and drop if(event.Dragging() && !(style & wxFNB_NODRAG)) { wxFNBDragInfo draginfo(this, tabIdx); wxFNBDragInfoDataObject dataobject(wxDataFormat(wxT("wxFNB"))); dataobject.SetData(sizeof(wxFNBDragInfo), &draginfo); wxFNBDropSource dragSource(this); dragSource.SetData(dataobject); dragSource.DoDragDrop(wxDrag_DefaultMove); } /// Patch ---- Ti-R ---- Enable to show next tab selected if user click if(style & wxFNB_PREVIEW_SELECT_TAB) { m_nTabStatus = wxFNB_BTN_HOVER; m_nTabPreviewId = tabIdx; } break; default: m_nTabXButtonStatus = wxFNB_BTN_NONE; break; } /// Patch (bRedrawTab) ---- Ti-R ---- Enable to show next tab selected if user click if(m_nTabStatus != wxFNB_BTN_HOVER) m_nTabPreviewId=-1; const bool bRedrawTab = (m_nTabPreviewId != savePreviewId); const bool bRedrawX = m_nXButtonStatus != xButtonStatus; const bool bRedrawDropArrow = m_nArrowDownButtonStatus != dropDownButtonStatus; const bool bRedrawRight = m_nRightButtonStatus != rightButtonStatus; const bool bRedrawLeft = m_nLeftButtonStatus != leftButtonStatus; const bool bRedrawTabX = m_nTabXButtonStatus != xTabButtonStatus; wxFNBRendererPtr render = wxFNBRendererMgrST::Get()->GetRenderer( GetParent()->GetWindowStyleFlag() ); if (bRedrawTab || bRedrawX || bRedrawRight || bRedrawLeft || bRedrawTabX || bRedrawDropArrow) { wxClientDC dc(this); if (bRedrawTab) { Refresh(); } if (bRedrawX) { render->DrawX(this, dc); } if (bRedrawLeft) { render->DrawLeftArrow(this, dc); } if (bRedrawRight) { render->DrawRightArrow(this, dc); } if (bRedrawTabX) { render->DrawTabX(this, dc, pgInfo.GetXRect(), tabIdx, m_nTabXButtonStatus); } if (bRedrawDropArrow) { render->DrawDropDownArrow(this, dc); } } } event.Skip(); } int wxPageContainer::GetLastVisibleTab() { int i; if( m_nFrom < 0) return -1; for(i=m_nFrom; i<(int)m_pagesInfoVec.GetCount(); i++) { if(m_pagesInfoVec[i].GetPosition() == wxPoint(-1, -1)) break; } return (i-1); } int wxPageContainer::GetNumTabsCanScrollLeft() { if( m_nFrom - 1 >= 0){ return 1; } else { return 0; } } bool wxPageContainer::IsDefaultTabs() { long style = GetParent()->GetWindowStyleFlag(); bool res = (style & wxFNB_VC71) || (style & wxFNB_FANCY_TABS) || (style & wxFNB_VC8); return !res; } void wxPageContainer::AdvanceSelection(bool bForward) { int nSel = GetSelection(); if(nSel < 0) return; int nMax = (int)GetPageCount() - 1; if ( bForward ) SetSelection(nSel == nMax ? 0 : nSel + 1); else SetSelection(nSel == 0 ? nMax : nSel - 1); } void wxPageContainer::OnMouseLeave(wxMouseEvent& event) { m_nLeftButtonStatus = wxFNB_BTN_NONE; m_nXButtonStatus = wxFNB_BTN_NONE; m_nRightButtonStatus = wxFNB_BTN_NONE; m_nTabXButtonStatus = wxFNB_BTN_NONE; m_nArrowDownButtonStatus = wxFNB_BTN_NONE; /// Patch (m_nTabStatus) ---- Ti-R ---- Refresh on leave to do not keep the preview if(m_nTabStatus == wxFNB_BTN_HOVER) { m_nTabPreviewId=-1; Refresh(); } m_nTabStatus = wxFNB_BTN_NONE; long style = GetParent()->GetWindowStyleFlag(); wxFNBRendererPtr render = wxFNBRendererMgrST::Get()->GetRenderer(style); wxClientDC dc(this); render->DrawX(this, dc); render->DrawLeftArrow(this, dc); render->DrawRightArrow(this, dc); if(GetSelection() != -1 && IsTabVisible((size_t)GetSelection())) { render->DrawTabX(this, dc, m_pagesInfoVec[GetSelection()].GetXRect(), GetSelection(), m_nTabXButtonStatus); } event.Skip(); } void wxPageContainer::OnMouseEnterWindow(wxMouseEvent& event) { m_nLeftButtonStatus = wxFNB_BTN_NONE; m_nXButtonStatus = wxFNB_BTN_NONE; m_nRightButtonStatus = wxFNB_BTN_NONE; m_nLeftClickZone = wxFNB_BTN_NONE; m_nArrowDownButtonStatus = wxFNB_BTN_NONE; /// Patch (m_nTabStatus) ---- Ti-R ---- Enable to show next tab selected if user click m_nTabStatus = wxFNB_BTN_NONE; event.Skip(); } void wxPageContainer::ShowTabTooltip(int tabIdx) { wxWindow *pWindow = ((wxFlatNotebook *)m_pParent)->GetPage(tabIdx); if( pWindow ) { wxToolTip *pToolTip = pWindow->GetToolTip(); if(pToolTip && pToolTip->GetWindow() == pWindow) SetToolTip(pToolTip->GetTip()); } } void wxPageContainer::SetPageImageIndex(size_t page, int imgindex) { if(page < m_pagesInfoVec.GetCount()) { m_pagesInfoVec[page].SetImageIndex(imgindex); Refresh(); } } int wxPageContainer::GetPageImageIndex(size_t page) { if(page < m_pagesInfoVec.GetCount()) { return m_pagesInfoVec[page].GetImageIndex(); } return -1; } wxDragResult wxPageContainer::OnDropTarget(wxCoord x, wxCoord y, int nTabPage, wxWindow * wnd_oldContainer) { // Disable drag'n'drop for disabled tab if(!((wxPageContainer *)wnd_oldContainer)->m_pagesInfoVec[nTabPage].GetEnabled()) return wxDragCancel; wxLogTrace(wxTraceMask(), _("Old Page Index = %i"), nTabPage); wxPageContainer * oldContainer = (wxPageContainer *)wnd_oldContainer; int nIndex = -1; wxPageInfo pgInfo; int where = HitTest(wxPoint(x, y), pgInfo, nIndex); wxLogTrace(wxTraceMask(), _("OnDropTarget: index by HitTest = %i"), nIndex); wxFlatNotebook * oldNotebook = (wxFlatNotebook *)oldContainer->GetParent(); wxFlatNotebook * newNotebook = (wxFlatNotebook *)GetParent(); if(oldNotebook == newNotebook) { if(nTabPage >= 0) { switch(where) { case wxFNB_TAB: MoveTabPage(nTabPage, nIndex); break; case wxFNB_NOWHERE: { } break; default: break; } } } else if ( GetParent()->GetWindowStyleFlag() & wxFNB_ALLOW_FOREIGN_DND ) { #if defined(__WXMSW__) || defined(__WXGTK__) if(nTabPage >= 0) { wxWindow * window = oldNotebook->GetPage(nTabPage); if(window) { wxString caption = oldContainer->GetPageText(nTabPage); // Pass the image to the new container // incase that the new container (this) does not have image list we dont pass the image // to the new notebook int newIndx( wxNOT_FOUND ); if( m_ImageList ) { int imageindex = oldContainer->GetPageImageIndex(nTabPage); if( imageindex >= 0 ) { wxBitmap bmp( (*oldContainer->GetImageList())[imageindex] ); m_ImageList->Add( bmp ); newIndx = static_cast(m_ImageList->GetCount() - 1); } } oldNotebook->RemovePage( nTabPage ); window->Reparent( newNotebook ); newNotebook->InsertPage(nIndex, window, caption, true, newIndx); } } #endif } return wxDragMove; } void wxPageContainer::MoveTabPage(int nMove, int nMoveTo) { if(nMove == nMoveTo) return; else if(nMoveTo < (int)((wxFlatNotebook *)m_pParent)->GetWindows().GetCount()) nMoveTo++; m_pParent->Freeze(); // Remove the window from the main sizer int nCurSel = ((wxFlatNotebook *)m_pParent)->GetPages()->GetSelection(); ((wxFlatNotebook *)m_pParent)->GetMainSizer()->Detach(((wxFlatNotebook *)m_pParent)->GetWindows().Item(nCurSel)); ((wxFlatNotebook *)m_pParent)->GetWindows().Item(nCurSel)->Hide(); wxWindow *pWindow = ((wxFlatNotebook *)m_pParent)->GetWindows().Item(nMove); ((wxFlatNotebook *)m_pParent)->GetWindows().RemoveAt(nMove); ((wxFlatNotebook *)m_pParent)->GetWindows().Insert(pWindow, nMoveTo-1); wxPageInfo pgInfo = m_pagesInfoVec[nMove]; m_pagesInfoVec.RemoveAt( nMove ); m_pagesInfoVec.Insert(pgInfo, nMoveTo - 1); // Add the page according to the style wxBoxSizer* pSizer = ((wxFlatNotebook *)m_pParent)->GetMainSizer(); long style = GetParent()->GetWindowStyleFlag(); if(style & wxFNB_BOTTOM) { pSizer->Insert(0, pWindow, 1, wxEXPAND); } else { // We leave a space of 1 pixel around the window pSizer->Add(pWindow, 1, wxEXPAND); } pWindow->Show(); pSizer->Layout(); m_iActivePage = nMoveTo-1; m_history.Clear(); DoSetSelection(m_iActivePage); m_pParent->Thaw(); } bool wxPageContainer::CanFitToScreen(size_t page) { // Incase the from is greater than page, // we need to reset the m_nFrom, so in order // to force the caller to do so, we return false if(m_nFrom > (int)page) return false; long style = GetParent()->GetWindowStyleFlag(); wxFNBRendererPtr render = wxFNBRendererMgrST::Get()->GetRenderer(style); std::vector vTabInfo; render->NumberTabsCanFit( this, vTabInfo ); if(static_cast(page) - m_nFrom >= static_cast( vTabInfo.size() )) return false; return true; } int wxPageContainer::GetNumOfVisibleTabs() { int i=m_nFrom; int counter = 0; for(; i<(int)m_pagesInfoVec.GetCount(); i++, ++counter) { if(m_pagesInfoVec[i].GetPosition() == wxPoint(-1, -1)) break; } return counter; } bool wxPageContainer::GetEnabled(size_t page) { if(page >= m_pagesInfoVec.GetCount()) return true; // Seems strange, but this is the default return m_pagesInfoVec[page].GetEnabled(); } void wxPageContainer::Enable(size_t page, bool enabled) { if(page >= m_pagesInfoVec.GetCount()) return ; m_pagesInfoVec[page].Enable(enabled); /// Patch ---- Ti-R ---- Enable to display correctly the tab Refresh(); return; } wxColor wxPageContainer::GetSingleLineBorderColor() { if(HasFlag(wxFNB_FANCY_TABS)) return m_colorFrom; /// Patch ---- Ti-R ---- Enable to have the same line color as the selected tab if(HasFlag(wxFNB_BOTTOM_LINE_COLOR_CHANGE)) return m_activeTabColor; return *wxWHITE; } bool wxPageContainer::HasFlag(int flag) { long style = GetParent()->GetWindowStyleFlag(); bool res = style & flag ? true : false; return res; } void wxPageContainer::ClearFlag(int flag) { long style = GetParent()->GetWindowStyleFlag(); style &= ~( flag ); wxWindowBase::SetWindowStyleFlag(style); } bool wxPageContainer::TabHasImage(int tabIdx) { if(m_ImageList) return m_pagesInfoVec[tabIdx].GetImageIndex() != -1; return false; } void wxPageContainer::OnLeftDClick(wxMouseEvent& event) { wxPageInfo pgInfo; int tabIdx; int where = HitTest(event.GetPosition(), pgInfo, tabIdx); switch(where) { case wxFNB_RIGHT_ARROW: RotateRight(); break; case wxFNB_LEFT_ARROW: RotateLeft(); break; case wxFNB_TAB: if(HasFlag(wxFNB_DCLICK_CLOSES_TABS)) { DeletePage((size_t)tabIdx); } break; case wxFNB_X: { OnLeftDown(event); } break; default: event.Skip(); break; } } void wxPageContainer::PopupTabsMenu() { wxMenu popupMenu; for(size_t i=0; i(i), pi.GetCaption(), pi.GetCaption(), wxITEM_NORMAL); // This code is commented, since there is an alignment problem with wx2.6.3 & Menus // if( TabHasImage(static_cast(i)) ) // item->SetBitmaps( (*m_ImageList)[pi.GetImageIndex()] ); popupMenu.Append( item ); } // connect an event handler to our menu popupMenu.Connect(wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(wxPageContainer::OnTabMenuSelection), NULL, this); PopupMenu( &popupMenu ); } void wxPageContainer::OnTabMenuSelection(wxCommandEvent &event) { int selection = event.GetId(); static_cast(m_pParent)->SetSelection( (size_t)selection ); } // Draw small arrow at the place that the tab will be placed void wxPageContainer::DrawDragHint() { // get the index of tab that will be replaced with the dragged tab wxPageInfo info; int tabIdx; wxPoint pt = ::wxGetMousePosition(); wxPoint client_pt = ScreenToClient(pt); HitTest(client_pt, info, tabIdx); wxFNBRendererMgrST::Get()->GetRenderer( GetParent()->GetWindowStyleFlag() )->DrawDragHint(this, tabIdx); } void wxPageContainer::SetCustomizeOptions(long options) { m_customizeOptions = options; } long wxPageContainer::GetCustomizeOptions() const { return m_customizeOptions; } wxformbuilder-3.1.59/src/controls/src/wxFlatNotebook/fnb_resources.cpp0000644000175000017500000005101111143440027026500 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // Name: fnb_resources.cpp // Purpose: implementation of the resources used by wxFlatNotebook // Author: Eran Ifrah // Created: 30/12/2005 // Modified: 01/01/2006 // Copyright: Eran Ifrah (c) // Licence: wxWindows license /////////////////////////////////////////////////////////////////////////////// #include /////////////////////////////////////////////////////////////////////////////// // // XPM Images required by this control // /////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////// // Images used by the control //////////////////////////////////////////////////////////// /* XPM */ const char *signpost_xpm[] = { /* columns rows colors chars-per-pixel */ "16 16 104 2", " c Black", "M c #3FB524", "3 c #4CBAFF", "{ c #004C00", "1 c #006BE9", "P c #007200", "! c #0065DD", "- c #003FE5", "Q c #0056BC", "* c #0062E4", "t c #0945A7", "7 c #2BBF1F", "W c #0050B8", ") c #D59700", "L c #0E8508", "A c #0047B0", "u c #3D93E5", "x c #0044AD", ": c #46C733", "( c #B18800", "X c #E3C247", "O. c #D69B00", "E c #0041B1", "` c #824400", "| c #C59200", ".. c #7B4000", "*. c #763C00", "G c #056ED4", "f c #088806", "[ c #005100", "p c #006DDF", "g c #007700", "U c #6D6A00", "< c #4A4357", "Z c #0038B7", "% c #E1B024", "K c #16A40B", " . c #986500", "h c #007100", "e c #002C9F", "J c #018101", "C c #4A3D58", "; c #009400", "v c #078BF0", "$. c #AC6F00", "F c #0055BC", "s c #36B01A", "D c #0052B8", ", c #138E00", "= c #0058D3", "5 c #47A9FF", "~ c #006500", "S c #004CB2", "n c #047F02", "T c #572E17", "m c #37BA1A", "X. c #D89D00", "} c #E49C00", "6 c #0084FF", "+ c #D3990C", "l c #0040A6", "a c #008200", "_ c #9C6700", "d c #86EA4D", "O c #DCC042", "# c #C7C334", "&. c #835000", "B c #007900", "k c #0037A9", "#. c #7B3F00", "y c #3879CB", "%. c #A26F00", "N c #007300", ". c #D0A000", "& c #626651", "j c #594855", "' c #0031B3", "q c #007000", "2 c #31AAFF", "Y c #A96700", "] c #0034C6", "R c #0028A7", "@. c #9B6800", "o c #EAD96A", "V c #006700", "4 c #4CACFB", "9 c #9EFF63", "^ c #006400", "o. c #7A4000", "b c #0080E5", "z c #0045AC", "> c #66DD42", "I c #005E00", "c c #125EBE", "H c #0080F5", "w c #584955", "8 c #8BF35A", "@ c #8E9300", "/ c #005800", "+. c #CA9700", "i c #0071DE", "0 c #2DA51D", "$ c #FFDE65", "r c #003098", /* pixels */ " ", " ", " . X o O + ", " @ # $ % & * = - ", " ; : > , < 1 2 3 4 5 6 ", " 7 8 9 0 q w e r t y u i p ", " a s d f g h j k l z x c v b ", " n m M N B V C Z A S D F G H ", " J K L P I U Y T R E W Q ! ", " h ~ ^ / ( ) _ ` ' ] ", " [ { } | ... ", " X.| .o. ", " O.+.@.#. ", " $.%.&.*. ", " ", " " }; unsigned char signpost_alpha[]={ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 174, 240, 238, 148, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 43, 254, 255, 255, 253, 104, 48, 4, 0, 0, 0, 0, 0, 0, 0, 60, 221, 255, 255, 255, 254, 254, 254, 244, 193, 51, 0, 0, 0, 0, 126, 252, 255, 255, 255, 255, 255, 255, 254, 254, 254, 224, 20, 0, 0, 33, 252, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 183, 0, 0, 137, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 128, 0, 0, 211, 254, 254, 255, 255, 255, 255, 246, 147, 216, 254, 225, 81, 0, 0, 0, 20, 162, 246, 234, 248, 255, 255, 238, 0, 0, 29, 11, 0, 0, 0, 0, 0, 0, 11, 20, 231, 255, 255, 235, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 223, 255, 255, 233, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 214, 255, 255, 231, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 137, 240, 236, 131, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; /* XPM */ const char *left_arrow_disabled_xpm[] = { /* width height num_colors chars_per_pixel */ " 16 16 8 1", /* colors */ "` c #008080", ". c #555555", "# c #000000", "a c #000000", "b c #000000", "c c #000000", "d c #000000", "e c #000000", /* pixels */ "````````````````", "````````````````", "````````````````", "````````.```````", "```````..```````", "``````.`.```````", "`````.``.```````", "````.```.```````", "`````.``.```````", "``````.`.```````", "```````..```````", "````````.```````", "````````````````", "````````````````", "````````````````", "````````````````" }; /* XPM */ const char *x_button_pressed_xpm[] = { /* width height num_colors chars_per_pixel */ " 16 16 8 1", /* colors */ "` c #008080", ". c #4766e0", "# c #9e9ede", "a c #000000", "b c #000000", "c c #000000", "d c #000000", "e c #000000", /* pixels */ "````````````````", "`..............`", "`.############.`", "`.############.`", "`.############.`", "`.###aa####aa#.`", "`.####aa##aa##.`", "`.#####aaaa###.`", "`.######aa####.`", "`.#####aaaa###.`", "`.####aa##aa##.`", "`.###aa####aa#.`", "`.############.`", "`..............`", "````````````````", "````````````````" }; /* XPM */ const char *tab_x_button_pressed_xpm[] = { /* width height num_colors chars_per_pixel */ " 16 16 8 1", /* colors */ "` c #008080", ". c #008080", "# c #008080", "a c #000000", "b c #000000", "c c #000000", "d c #000000", "e c #000000", /* pixels */ "````````````````", "`..............`", "`.############.`", "`.############.`", "`.############.`", "`.###aa####aa#.`", "`.####aa##aa##.`", "`.#####aaaa###.`", "`.######aa####.`", "`.#####aaaa###.`", "`.####aa##aa##.`", "`.###aa####aa#.`", "`.############.`", "`..............`", "````````````````", "````````````````" }; /* XPM */ const char *left_arrow_xpm[] = { /* width height num_colors chars_per_pixel */ " 16 16 8 1", /* colors */ "` c #008080", ". c #555555", "# c #000000", "a c #000000", "b c #000000", "c c #000000", "d c #000000", "e c #000000", /* pixels */ "````````````````", "````````````````", "````````````````", "````````.```````", "```````..```````", "``````...```````", "`````....```````", "````.....```````", "`````....```````", "``````...```````", "```````..```````", "````````.```````", "````````````````", "````````````````", "````````````````", "````````````````" }; /* XPM */ const char *x_button_hilite_xpm[] = { /* width height num_colors chars_per_pixel */ " 16 16 8 1", /* colors */ "` c #008080", ". c #4766e0", "# c #c9dafb", "a c #000000", "b c #000000", "c c #000000", "d c #000000", "e c #000000", /* pixels */ "````````````````", "`..............`", "`.############.`", "`.############.`", "`.##aa####aa##.`", "`.###aa##aa###.`", "`.####aaaa####.`", "`.#####aa#####.`", "`.####aaaa####.`", "`.###aa##aa###.`", "`.##aa####aa##.`", "`.############.`", "`.############.`", "`..............`", "````````````````", "````````````````" }; /* XPM */ const char *x_button_xpm[] = { /* width height num_colors chars_per_pixel */ " 16 16 8 1", /* colors */ "` c #008080", ". c #555555", "# c #000000", "a c #000000", "b c #000000", "c c #000000", "d c #000000", "e c #000000", /* pixels */ "````````````````", "````````````````", "````````````````", "````````````````", "````..````..````", "`````..``..`````", "``````....``````", "```````..```````", "``````....``````", "`````..``..`````", "````..````..````", "````````````````", "````````````````", "````````````````", "````````````````", "````````````````" }; /* XPM */ const char *left_arrow_pressed_xpm[] = { /* width height num_colors chars_per_pixel */ " 16 16 8 1", /* colors */ "` c #008080", ". c #4766e0", "# c #9e9ede", "a c #000000", "b c #000000", "c c #000000", "d c #000000", "e c #000000", /* pixels */ "````````````````", "`..............`", "`.############.`", "`.############.`", "`.#######a####.`", "`.######aa####.`", "`.#####aaa####.`", "`.####aaaa####.`", "`.###aaaaa####.`", "`.####aaaa####.`", "`.#####aaa####.`", "`.######aa####.`", "`.#######a####.`", "`..............`", "````````````````", "````````````````" }; /* XPM */ const char *left_arrow_hilite_xpm[] = { /* width height num_colors chars_per_pixel */ " 16 16 8 1", /* colors */ "` c #008080", ". c #4766e0", "# c #c9dafb", "a c #000000", "b c #000000", "c c #000000", "d c #000000", "e c #000000", /* pixels */ "````````````````", "`..............`", "`.############.`", "`.######a#####.`", "`.#####aa#####.`", "`.####aaa#####.`", "`.###aaaa#####.`", "`.##aaaaa#####.`", "`.###aaaa#####.`", "`.####aaa#####.`", "`.#####aa#####.`", "`.######a#####.`", "`.############.`", "`..............`", "````````````````", "````````````````" }; /* XPM */ const char *right_arrow_disabled_xpm[] = { /* width height num_colors chars_per_pixel */ " 16 16 8 1", /* colors */ "` c #008080", ". c #555555", "# c #000000", "a c #000000", "b c #000000", "c c #000000", "d c #000000", "e c #000000", /* pixels */ "````````````````", "````````````````", "````````````````", "```````.````````", "```````..```````", "```````.`.``````", "```````.``.`````", "```````.```.````", "```````.``.`````", "```````.`.``````", "```````..```````", "```````.````````", "````````````````", "````````````````", "````````````````", "````````````````" }; /* XPM */ const char *right_arrow_hilite_xpm[] = { /* width height num_colors chars_per_pixel */ " 16 16 8 1", /* colors */ "` c #008080", ". c #4766e0", "# c #c9dafb", "a c #000000", "b c #000000", "c c #000000", "d c #000000", "e c #000000", /* pixels */ "````````````````", "`..............`", "`.############.`", "`.####a#######.`", "`.####aa######.`", "`.####aaa#####.`", "`.####aaaa####.`", "`.####aaaaa###.`", "`.####aaaa####.`", "`.####aaa#####.`", "`.####aa######.`", "`.####a#######.`", "`.############.`", "`..............`", "````````````````", "````````````````" }; /* XPM */ const char *right_arrow_pressed_xpm[] = { /* width height num_colors chars_per_pixel */ " 16 16 8 1", /* colors */ "` c #008080", ". c #4766e0", "# c #9e9ede", "a c #000000", "b c #000000", "c c #000000", "d c #000000", "e c #000000", /* pixels */ "````````````````", "`..............`", "`.############.`", "`.############.`", "`.#####a######.`", "`.#####aa#####.`", "`.#####aaa####.`", "`.#####aaaa###.`", "`.#####aaaaa##.`", "`.#####aaaa###.`", "`.#####aaa####.`", "`.#####aa#####.`", "`.#####a######.`", "`..............`", "````````````````", "````````````````" }; /* XPM */ const char *right_arrow_xpm[] = { /* width height num_colors chars_per_pixel */ " 16 16 8 1", /* colors */ "` c #008080", ". c #555555", "# c #000000", "a c #000000", "b c #000000", "c c #000000", "d c #000000", "e c #000000", /* pixels */ "````````````````", "````````````````", "````````````````", "```````.````````", "```````..```````", "```````...``````", "```````....`````", "```````.....````", "```````....`````", "```````...``````", "```````..```````", "```````.````````", "````````````````", "````````````````", "````````````````", "````````````````" }; // Arrow down bitmaps /* XPM */ const char *down_arrow_hilite_xpm[] = { /* width height num_colors chars_per_pixel */ " 16 16 8 1", /* colors */ "` c #008080", ". c #4766e0", "# c #c9dafb", "a c #000000", "b c #000000", "c c #000000", "d c #000000", "e c #000000", /* pixels */ "````````````````", "``.............`", "``.###########.`", "``.###########.`", "``.###########.`", "``.#aaaaaaaaa#.`", "``.##aaaaaaa##.`", "``.###aaaaa###.`", "``.####aaa####.`", "``.#####a#####.`", "``.###########.`", "``.###########.`", "``.###########.`", "``.............`", "````````````````", "````````````````" }; /* XPM */ const char *down_arrow_pressed_xpm[] = { /* width height num_colors chars_per_pixel */ " 16 16 8 1", /* colors */ "` c #008080", ". c #4766e0", "# c #9e9ede", "a c #000000", "b c #000000", "c c #000000", "d c #000000", "e c #000000", /* pixels */ "````````````````", "``.............`", "``.###########.`", "``.###########.`", "``.###########.`", "``.###########.`", "``.###########.`", "``.#aaaaaaaaa#.`", "``.##aaaaaaa##.`", "``.###aaaaa###.`", "``.####aaa####.`", "``.#####a#####.`", "``.###########.`", "``.............`", "````````````````", "````````````````" }; /* XPM */ const char *down_arrow_xpm[] = { /* width height num_colors chars_per_pixel */ " 16 16 8 1", /* colors */ "` c #008080", ". c #000000", "# c #000000", "a c #000000", "b c #000000", "c c #000000", "d c #000000", "e c #000000", /* pixels */ "````````````````", "````````````````", "````````````````", "````````````````", "````````````````", "````````````````", "````.........```", "`````.......````", "``````.....`````", "```````...``````", "````````.```````", "````````````````", "````````````````", "````````````````", "````````````````", "````````````````" }; // Arrow down bitmaps const int tab_x_size = 9; // arrow_down_blue.xpm 16x16 unsigned char arrow_down_blue_alpha[]={ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 246, 250, 250, 248, 246, 245, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 2, 11, 11, 0, 255, 255, 255, 255, 255, 255, 0, 11, 11, 2, 0, 0, 7, 190, 254, 254, 255, 255, 255, 255, 255, 255, 254, 254, 186, 5, 0, 0, 0, 15, 209, 255, 255, 255, 255, 255, 255, 255, 255, 206, 13, 0, 0, 0, 0, 0, 28, 226, 255, 255, 255, 255, 255, 255, 223, 25, 0, 0, 0, 0, 0, 0, 0, 43, 238, 255, 255, 255, 255, 236, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 247, 255, 255, 245, 58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 86, 253, 252, 82, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 112, 107, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; /* XPM */ const char *arrow_down_blue_xpm[] = { /* columns rows colors chars-per-pixel */ "16 16 99 2", "a c #3E8FDC", " c Black", "+. c #0068E2", "Y c #77B5F4", "# c #206BC4", " . c #0065E7", "I c #0F68CE", ", c #1C7AD3", ": c #217ED9", "` c #0F62C4", "o. c #377FCB", "U c #89C2FA", "N c #0050B8", "u c #84BBF1", "d c #004DB4", "( c #7DBAF7", "& c #338BE0", "c c #539DE8", "E c #62A9EE", "X. c #3A7DC4", "[ c #2E84DF", "! c #0053E1", "M c #0D56B4", "k c #1F6FCA", "@ c #003BA2", "D c #60A6EB", "o c #0345AC", "w c #1054AA", "A c #8DC4F8", "x c #8DC1F2", "e c #000087", ".. c #006AEC", "b c #4893DD", "g c #00008E", "V c #0067E5", "* c #177BD5", "O. c #0067EA", "] c #0064E8", "9 c #3C8EE0", "% c #4B9AE4", "' c #0061E1", "< c #074DA7", "~ c #0064EC", "s c #1155AA", "> c #217DD8", "G c #559FE9", "F c #5AA3EA", "3 c #3086DD", "X c #074AAF", "^ c #1C73D5", "W c #508CC5", "P c #005BE7", "| c #1C6DC6", "5 c #2982D6", "/ c #91C9FE", "l c #3077CB", "= c #034AA7", "Q c #065ABF", "Z c #8AC5FD", "+ c #0347AC", "- c #246CC4", "p c #4594E4", "J c #4084C2", "L c #0043D9", "K c #0454BA", "q c #3488D9", "@. c #0069E0", "} c #79A7D3", "H c #52A0EB", "j c #005AC2", "m c #115AB4", "y c #2F78CE", "f c #0057C0", "1 c #2A71C9", "2 c #70AFEC", "8 c #7AB7EF", "h c #005AD6", "C c #0D66CA", "6 c #0A50A9", "v c #4E9AE6", "_ c #6498C9", "r c #0054DD", "4 c #2E85DB", "{ c #9BD0FF", "O c #0546A9", "T c #6CAFF0", "R c #67ABF0", ". c #0042AA", ") c #76B7F7", "i c #4796E4", "; c #60A7E7", "B c #003FAF", "t c #0048D1", "n c #246BBA", "7 c #2E76CC", "$ c #7EBCF0", "z c #5696DD", "S c #79B5F0", "0 c #398EE0", /* pixels */ " ", " ", " . X o O + @ ", " # $ % & * = ", " - ; : > , < ", " 1 2 3 4 5 6 ", " 7 8 9 0 q w ", " e r t y u i p a s d f g ", " h j k l z x c v b n m M N B ", " V C Z A S D F G H J K L ", " P I U Y T R E W Q ! ", " ~ ^ / ( ) _ ` ' ", " ] [ { } | . ", " ..X.o.O. ", " +.@. ", " " }; // arrow_up_blue.xpm 16x16 unsigned char arrow_up_blue_alpha[]={ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 95, 110, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72, 250, 252, 85, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 51, 242, 255, 255, 247, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 35, 232, 255, 255, 255, 255, 238, 44, 0, 0, 0, 0, 0, 0, 0, 21, 218, 255, 255, 255, 255, 255, 255, 226, 28, 0, 0, 0, 0, 0, 11, 200, 255, 255, 255, 255, 255, 255, 255, 255, 210, 16, 0, 0, 0, 4, 180, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 192, 7, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 241, 244, 245, 243, 241, 239, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; /* XPM */ const char *arrow_up_blue_xpm[] = { /* columns rows colors chars-per-pixel */ "16 16 93 2", " c Black", "n c #2262AB", "@ c #006BED", "! c #237ED9", "# c #006BF2", "G c #81BAF0", "( c #4B9EE8", "/ c #1B67C2", ": c #BFE1FF", "{ c #0444A8", "B c #005CD7", "2 c #005CDF", "N c #0050B8", ") c #1F81DC", "D c #145AAC", "I c #73B2EC", "T c #2983D9", "> c #7DBAF5", "O c #4998EA", "z c #3F8ADB", "9 c #62A9EC", "5 c #B6DAFD", "h c #004DD2", "s c #519DE5", "t c #B4DAFE", "L c #1057AD", "C c #8FC1F3", "4 c #0768CF", "< c #79B7F5", "a c #549EE7", "* c #257DDA", "J c #398DDF", "R c #0E54A9", ", c #72B3F4", "% c #C6E4FF", "; c #1471D3", "$ c #2881DE", "i c #61A7EB", "m c #115BB5", "u c #66ABEF", "Q c #2681D9", "c c #559FE8", "3 c #0061EC", "- c #0061ED", "K c #358ADC", "k c #1C70CD", "r c #0666CD", "` c #1378D5", "Y c #2E86DD", "[ c #054AAF", "W c #67A9E8", "^ c #084EA6", "q c #0B61C7", "f c #065AC3", " . c #003AA0", "H c #3B8FE1", "8 c #65A9ED", "y c #94C7F8", "v c #4F9CE6", "6 c #7EBAF5", ". c #006FE6", "_ c #197DDB", "F c #2773CB", "} c #0141A0", "E c #1D68C5", "o c #006FF1", "& c #9CCFFF", "j c #0060C2", "| c #013EA0", "0 c #61A9EF", "= c #0066E9", "7 c #6BAEEF", "S c #4191E0", "w c #0060DD", "l c #2373CE", "+ c #509DEC", "U c #3088DD", "M c #0F5DBC", "p c #5AA2E9", "A c #4495E4", "' c #054CA7", "~ c #1F7CD5", "b c #4996E0", "1 c #156ED0", "d c #51A1EC", "Z c #4796E4", "e c #004EE0", "V c #2975CC", "g c #0048D5", "P c #226EC8", "x c #6DB0EE", "X c #006BE1", "] c #0143A8", /* pixels */ " ", " . X ", " o O + @ ", " # $ % & * = ", " - ; : > , < 1 2 ", " 3 4 5 6 7 8 9 0 q w ", " e r t y u i p a s d f g ", " h j k l z x c v b n m M N B ", " V C Z A S D ", " F G H J K L ", " P I U Y T R ", " E W Q ! ~ ^ ", " / ( ) _ ` ' ", " ] [ { } | . ", " ", " " }; ////////////////////////////////////////////////////////////////////////////////////////////////// // // End of XPM Images // ////////////////////////////////////////////////////////////////////////////////////////////////// wxformbuilder-3.1.59/src/controls/src/wxFlatNotebook/fnb_customize_dlg.cpp0000644000175000017500000003277011143440027027351 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // Name: fnb_customize_dlg.cpp // Purpose: customise dialog used by wxFlatNotebook // Author: Eran Ifrah // Created: 30/12/2005 // Modified: 01/01/2006 // Copyright: Eran Ifrah (c) // Licence: wxWindows license /////////////////////////////////////////////////////////////////////////////// #include "wx/wxFlatNotebook/fnb_customize_dlg.h" #include "wx/wxFlatNotebook/wxFlatNotebook.h" #include "wx/sizer.h" #include #include /////////////////////////////////////////////////////////////////////////// wxFNBCustomizeDialog::wxFNBCustomizeDialog( wxWindow* parent, long options, int id, wxString title, wxPoint pos, wxSize size, int style ) : wxDialog( parent, id, title, pos, size, style ) , m_options(options) { wxBoxSizer* mainSizer; mainSizer = new wxBoxSizer( wxVERTICAL ); SetSizer( mainSizer ); mainSizer->Add( CreateOptionsPage(), 1, wxEXPAND | wxALL, 5 ); m_staticline2 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); mainSizer->Add( m_staticline2, 0, wxALL|wxEXPAND, 5 ); wxBoxSizer* btnSizer; btnSizer = new wxBoxSizer( wxHORIZONTAL ); m_close = new wxButton( this, wxID_ANY, wxT("&Close"), wxDefaultPosition, wxDefaultSize, 0 ); btnSizer->Add( m_close, 0, wxALL, 5 ); mainSizer->Add( btnSizer, 0, wxALIGN_CENTER, 5 ); this->Layout(); GetSizer()->Fit(this); ConnectEvents(); } void wxFNBCustomizeDialog::ConnectEvents() { m_close->Connect(wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(wxFNBCustomizeDialog::OnClose), NULL, this); // Connect all checkbox & radiobox controls to the same handler if( m_styles ){ m_styles->Connect(wxID_ANY, wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler(wxFNBCustomizeDialog::OnStyle), NULL, this); } m_navigationStyle->Connect(wxID_ANY, wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler(wxFNBCustomizeDialog::OnStyle), NULL, this); if( m_tabVPosition ){ m_tabVPosition->Connect(wxID_ANY, wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler(wxFNBCustomizeDialog::OnStyle), NULL, this); } m_tabBorder->Connect(wxID_ANY, wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(wxFNBCustomizeDialog::OnStyle), NULL, this); m_hideCloseButton->Connect(wxID_ANY, wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(wxFNBCustomizeDialog::OnStyle), NULL, this); m_mouseMiddleCloseTab->Connect(wxID_ANY, wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(wxFNBCustomizeDialog::OnStyle), NULL, this); m_xButtonOnTab->Connect(wxID_ANY, wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(wxFNBCustomizeDialog::OnStyle), NULL, this); m_dlbClickCloseTab->Connect(wxID_ANY, wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(wxFNBCustomizeDialog::OnStyle), NULL, this); m_smartTabbing->Connect(wxID_ANY, wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(wxFNBCustomizeDialog::OnStyle), NULL, this); if( m_allowDragAndDrop ){ m_allowDragAndDrop->Connect(wxID_ANY, wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(wxFNBCustomizeDialog::OnStyle), NULL, this); } if( m_foreignDnD ){ m_foreignDnD->Connect(wxID_ANY, wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(wxFNBCustomizeDialog::OnStyle), NULL, this); } m_gradient->Connect(wxID_ANY, wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(wxFNBCustomizeDialog::OnStyle), NULL, this); m_colorfulTab->Connect(wxID_ANY, wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(wxFNBCustomizeDialog::OnStyle), NULL, this); } wxPanel *wxFNBCustomizeDialog::CreateOptionsPage() { wxPageContainer *pc = static_cast(GetParent()); wxPanel *page = new wxPanel(this); wxBoxSizer* mainSizer; mainSizer = new wxBoxSizer( wxVERTICAL ); page->SetSizer( mainSizer ); wxString m_stylesChoices[] = { wxT("Default"), wxT("Visual Studio 8.0"), wxT("Visual Studio 7.10"), wxT("Fancy Tabs"), wxT("Firefox 2") }; int m_stylesNChoices = sizeof( m_stylesChoices ) / sizeof( wxString ); // Set the selected tabs' style int selection = 0; bool enableGrad = false, enableColorTab = false; if (pc->HasFlag(wxFNB_FF2) ){ selection = 4; enableGrad = true; enableColorTab = false; } else if( pc->HasFlag(wxFNB_VC71) ){ selection = 2; enableGrad = false; enableColorTab = false; }else if( pc->HasFlag(wxFNB_VC8) ){ selection = 1; enableGrad = true; enableColorTab = true; }else if( pc->HasFlag(wxFNB_FANCY_TABS) ){ selection = 3; enableGrad = false; enableColorTab = false; }else { selection = 0; enableGrad = false; enableColorTab = false; } // can we customize the tab's style? if( m_options & wxFNB_CUSTOM_TAB_LOOK ){ m_styles = new wxRadioBox( page, wxID_ANY, wxT("Visual Style:"), wxDefaultPosition, wxDefaultSize, m_stylesNChoices, m_stylesChoices, 3, wxRA_SPECIFY_COLS ); m_styles->SetSelection(selection); mainSizer->Add( m_styles, 0, wxALL|wxEXPAND, 5 ); }else{ m_styles = NULL; } // can we customize the tab's orientation? if( m_options & wxFNB_CUSTOM_ORIENTATION ){ wxString m_tabVPositionChoices[] = { wxT("Upper Tabs"), wxT("Bottom Tabs") }; int m_tabVPositionNChoices = sizeof( m_tabVPositionChoices ) / sizeof( wxString ); m_tabVPosition = new wxRadioBox( page, wxID_ANY, wxT("Tab Positioning:"), wxDefaultPosition, wxDefaultSize, m_tabVPositionNChoices, m_tabVPositionChoices, 2, wxRA_SPECIFY_COLS ); m_tabVPosition->SetSelection(pc->HasFlag(wxFNB_BOTTOM) ? 1 : 0); mainSizer->Add( m_tabVPosition, 0, wxALL|wxEXPAND, 5 ); }else{ m_tabVPosition = NULL; } // there is no harm in showing this always wxString navigationStyle [] = { wxT("Rotation Arrows"), wxT("Drop Down Tab List"), wxT("None") }; int nChoices = sizeof( navigationStyle ) / sizeof( wxString ); m_navigationStyle = new wxRadioBox( page, wxID_ANY, wxT("Navigation Style:"), wxDefaultPosition, wxDefaultSize, nChoices, navigationStyle, 3, wxRA_SPECIFY_COLS ); if(pc->HasFlag(wxFNB_DROPDOWN_TABS_LIST)){ m_navigationStyle->SetSelection(1); } else if(pc->HasFlag(wxFNB_NO_NAV_BUTTONS) && !pc->HasFlag(wxFNB_DROPDOWN_TABS_LIST)){ m_navigationStyle->SetSelection(2); } else { m_navigationStyle->SetSelection(0); } mainSizer->Add( m_navigationStyle, 0, wxALL|wxEXPAND, 5 ); wxStaticBoxSizer* sbSizer2; sbSizer2 = new wxStaticBoxSizer( new wxStaticBox( page, -1, wxT("General:") ), wxVERTICAL ); wxGridSizer* gSizer1; gSizer1 = new wxGridSizer( 3, 2, 0, 0 ); m_tabBorder = new wxCheckBox( page, wxID_ANY, wxT("Draw Thin Border Around Tab Area"), wxDefaultPosition, wxDefaultSize, 0 ); m_tabBorder->SetValue(pc->HasFlag(wxFNB_TABS_BORDER_SIMPLE)); gSizer1->Add( m_tabBorder, 0, wxALL, 5 ); // do we allow customizing close button options? ( in all forms: dclick, middle click, on tab and right side) m_hideCloseButton = new wxCheckBox( page, wxID_ANY, wxT("Hide Close Button"), wxDefaultPosition, wxDefaultSize, 0 ); m_hideCloseButton->SetValue(pc->HasFlag(wxFNB_NO_X_BUTTON)); m_hideCloseButton->Enable(m_options & wxFNB_CUSTOM_CLOSE_BUTTON ? true : false); gSizer1->Add( m_hideCloseButton, 0, wxALL, 5 ); m_mouseMiddleCloseTab = new wxCheckBox( page, wxID_ANY, wxT("Mouse Middle Button Closes Tab"), wxDefaultPosition, wxDefaultSize, 0 ); m_mouseMiddleCloseTab->SetValue(pc->HasFlag(wxFNB_MOUSE_MIDDLE_CLOSES_TABS)); m_mouseMiddleCloseTab->Enable(m_options & wxFNB_CUSTOM_CLOSE_BUTTON ? true : false); gSizer1->Add( m_mouseMiddleCloseTab, 0, wxALL, 5 ); m_xButtonOnTab = new wxCheckBox( page, wxID_ANY, wxT("Place Close Button On Active Tab"), wxDefaultPosition, wxDefaultSize, 0 ); m_xButtonOnTab->SetValue(pc->HasFlag(wxFNB_X_ON_TAB)); m_xButtonOnTab->Enable(m_options & wxFNB_CUSTOM_CLOSE_BUTTON ? true : false); gSizer1->Add( m_xButtonOnTab, 0, wxALL, 5 ); m_dlbClickCloseTab = new wxCheckBox( page, wxID_ANY, wxT("Double Click Closes Tab"), wxDefaultPosition, wxDefaultSize, 0 ); m_dlbClickCloseTab->SetValue(pc->HasFlag(wxFNB_DCLICK_CLOSES_TABS)); m_dlbClickCloseTab->Enable(m_options & wxFNB_CUSTOM_CLOSE_BUTTON ? true : false); gSizer1->Add( m_dlbClickCloseTab, 0, wxALL, 5 ); m_smartTabbing = new wxCheckBox( page, wxID_ANY, wxT("Enable Smart Tabbing"), wxDefaultPosition, wxDefaultSize, 0 ); m_smartTabbing->SetValue(pc->HasFlag(wxFNB_SMART_TABS)); gSizer1->Add( m_smartTabbing, 0, wxALL, 5 ); sbSizer2->Add( gSizer1, 0, wxEXPAND, 5 ); mainSizer->Add( sbSizer2, 0, wxALL|wxEXPAND, 5 ); if(m_options & wxFNB_CUSTOM_LOCAL_DRAG){ wxStaticBoxSizer* sbSizer4; sbSizer4 = new wxStaticBoxSizer( new wxStaticBox( page, -1, wxT("Drag And Drop:") ), wxHORIZONTAL ); m_allowDragAndDrop = new wxCheckBox( page, wxID_ANY, wxT("Enable Drag And Drop"), wxDefaultPosition, wxDefaultSize, 0 ); m_allowDragAndDrop->SetValue(!pc->HasFlag(wxFNB_NODRAG)); sbSizer4->Add( m_allowDragAndDrop, 0, wxALL, 5 ); m_foreignDnD = new wxCheckBox( page, wxID_ANY, wxT("Allow Drag And Drop from other notebooks"), wxDefaultPosition, wxDefaultSize, 0 ); m_foreignDnD->SetValue(pc->HasFlag(wxFNB_ALLOW_FOREIGN_DND)); m_foreignDnD->Enable(m_allowDragAndDrop->IsChecked() && m_options & wxFNB_CUSTOM_FOREIGN_DRAG); sbSizer4->Add( m_foreignDnD, 0, wxALL, 5 ); mainSizer->Add( sbSizer4, 0, wxALL|wxEXPAND, 5 ); }else{ m_allowDragAndDrop = NULL; m_foreignDnD = NULL; } wxStaticBoxSizer* sbSizer5; sbSizer5 = new wxStaticBoxSizer( new wxStaticBox( page, -1, wxT("Effects:") ), wxHORIZONTAL ); m_gradient = new wxCheckBox( page, wxID_ANY, wxT("Use Gradient painting for tabs area"), wxDefaultPosition, wxDefaultSize, 0 ); m_gradient->SetValue(pc->HasFlag(wxFNB_BACKGROUND_GRADIENT)); sbSizer5->Add( m_gradient, 0, wxALL, 5 ); m_colorfulTab = new wxCheckBox( page, wxID_ANY, wxT("Set Random Colour for Tabs"), wxDefaultPosition, wxDefaultSize, 0 ); m_colorfulTab->SetValue(pc->HasFlag(wxFNB_COLORFUL_TABS)); sbSizer5->Add( m_colorfulTab, 0, wxALL, 5 ); mainSizer->Add( sbSizer5, 0, wxALL|wxEXPAND, 5 ); m_colorfulTab->Enable(enableColorTab); m_gradient->Enable(enableGrad); page->Layout(); return page; } //--------------------------------------------------------- // Event handlers //--------------------------------------------------------- void wxFNBCustomizeDialog::OnClose(wxCommandEvent &event) { wxUnusedVar(event); EndModal(wxID_OK); } void wxFNBCustomizeDialog::OnStyle(wxCommandEvent &event) { wxObject *obj = event.GetEventObject(); wxPageContainer *pc = static_cast(GetParent()); wxFlatNotebook *bookWin = static_cast( pc->GetParent() ); long style = bookWin->GetWindowStyleFlag(); // Handle tab style if( obj == m_styles ){ style &= ~(wxFNB_VC71); style &= ~(wxFNB_VC8); style &= ~(wxFNB_FF2); style &= ~(wxFNB_FANCY_TABS); if(event.GetSelection() == 1){ // vc8 // remove bottom flag if exist style |= wxFNB_VC8; m_gradient->Enable(true); m_colorfulTab->Enable(true); } else if(event.GetSelection() == 2){ //vc71 style |= wxFNB_VC71; m_gradient->Enable(false); m_colorfulTab->Enable(false); } else if(event.GetSelection() == 3){ // fancy style |= wxFNB_FANCY_TABS; m_gradient->Enable(false); m_colorfulTab->Enable(false); } else if(event.GetSelection() == 4){ // ff2 style |= wxFNB_FF2; m_gradient->Enable(true); m_colorfulTab->Enable(false); } else { // by default this two options are not available m_gradient->Enable(false); m_colorfulTab->Enable(false); } } // Handle tab postioninig if( obj == m_tabVPosition ){ if(event.GetSelection() == 0){ // Top // remove bottom flag if exist style &= ~(wxFNB_BOTTOM); } else { style |= wxFNB_BOTTOM; } } // Handle navigation style if( obj == m_navigationStyle ){ if(event.GetSelection() == 0){ // Arrows style &= ~wxFNB_DROPDOWN_TABS_LIST; style &= ~wxFNB_NO_NAV_BUTTONS; } else if(event.GetSelection() == 1){ // list style |= wxFNB_NO_NAV_BUTTONS; style |= wxFNB_DROPDOWN_TABS_LIST; } else { // none style |= wxFNB_NO_NAV_BUTTONS; style &= ~wxFNB_DROPDOWN_TABS_LIST; } } // Simple tab border around tab area if(obj == m_tabBorder){ if(event.IsChecked()){ style |= wxFNB_TABS_BORDER_SIMPLE; } else { style &= ~(wxFNB_TABS_BORDER_SIMPLE); } } // Hide close button if(obj == m_hideCloseButton){ if(event.IsChecked()){ style |= wxFNB_NO_X_BUTTON; } else { style &= ~(wxFNB_NO_X_BUTTON); } } if(obj == m_mouseMiddleCloseTab){ if(event.IsChecked()){ style |= wxFNB_MOUSE_MIDDLE_CLOSES_TABS; } else { style &= ~(wxFNB_MOUSE_MIDDLE_CLOSES_TABS); } } if(obj == m_xButtonOnTab){ if(event.IsChecked()){ style |= wxFNB_X_ON_TAB; } else { style &= ~(wxFNB_X_ON_TAB); } } if(obj == m_dlbClickCloseTab){ if(event.IsChecked()){ style |= wxFNB_DCLICK_CLOSES_TABS; } else { style &= ~(wxFNB_DCLICK_CLOSES_TABS); } } if(obj == m_smartTabbing){ if(event.IsChecked()){ style |= wxFNB_SMART_TABS; } else { style &= ~(wxFNB_SMART_TABS); } } if(obj == m_allowDragAndDrop){ if(event.IsChecked()){ m_foreignDnD->Enable(m_options & wxFNB_CUSTOM_FOREIGN_DRAG ? true : false); style &= ~wxFNB_NODRAG; } else { m_foreignDnD->Enable(false); style |= wxFNB_NODRAG; } } if(obj == m_foreignDnD){ if(event.IsChecked()){ style |= wxFNB_ALLOW_FOREIGN_DND; } else { style &= ~wxFNB_ALLOW_FOREIGN_DND; } } if(obj == m_gradient){ if(event.IsChecked()){ style |= wxFNB_BACKGROUND_GRADIENT; } else { style &= ~wxFNB_BACKGROUND_GRADIENT; } } if(obj == m_colorfulTab){ if(event.IsChecked()){ style |= wxFNB_COLORFUL_TABS; } else { style &= ~wxFNB_COLORFUL_TABS; } } bookWin->SetWindowStyleFlag(style); bookWin->Refresh(); } wxformbuilder-3.1.59/src/controls/src/wxFlatNotebook/xh_fnb.cpp0000644000175000017500000000765211143440027025121 0ustar rrmulderrrmulder///////////////////////////////////////////////////////////////////////////// // Name: xh_fnb.cpp // Purpose: XRC resource for wxFlatNotebook // Author: Armel Asselin // Created: 2006/10/30 // RCS-ID: $Id: $ // Copyright: (c) 2006 Armel Asselin (copied from Vaclav Slavik xh_notbk) // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "xh_notbk.h" #endif // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" #ifdef __BORLANDC__ #pragma hdrstop #endif #if wxUSE_XRC #include "wx/wxFlatNotebook/xh_fnb.h" #include "wx/log.h" #include "wx/notebook.h" #include "wx/imaglist.h" #include "wx/sizer.h" IMPLEMENT_DYNAMIC_CLASS(wxFlatNotebookXmlHandler, wxXmlResourceHandler) wxFlatNotebookXmlHandler::wxFlatNotebookXmlHandler() : wxXmlResourceHandler(), m_isInside(false), m_notebook(NULL) { XRC_ADD_STYLE(wxFNB_DEFAULT_STYLE); XRC_ADD_STYLE(wxFNB_VC71); XRC_ADD_STYLE(wxFNB_FANCY_TABS); XRC_ADD_STYLE(wxFNB_TABS_BORDER_SIMPLE); XRC_ADD_STYLE(wxFNB_NO_X_BUTTON); XRC_ADD_STYLE(wxFNB_NO_NAV_BUTTONS); XRC_ADD_STYLE(wxFNB_MOUSE_MIDDLE_CLOSES_TABS); XRC_ADD_STYLE(wxFNB_BOTTOM); XRC_ADD_STYLE(wxFNB_NODRAG); XRC_ADD_STYLE(wxFNB_VC8); XRC_ADD_STYLE(wxFNB_X_ON_TAB); XRC_ADD_STYLE(wxFNB_BACKGROUND_GRADIENT); XRC_ADD_STYLE(wxFNB_COLORFUL_TABS); XRC_ADD_STYLE(wxFNB_DCLICK_CLOSES_TABS); XRC_ADD_STYLE(wxFNB_SMART_TABS); XRC_ADD_STYLE(wxFNB_DROPDOWN_TABS_LIST); XRC_ADD_STYLE(wxFNB_ALLOW_FOREIGN_DND); AddWindowStyles(); } wxObject *wxFlatNotebookXmlHandler::DoCreateResource() { if (m_class == wxT("notebookpage")) { wxXmlNode *n = GetParamNode(wxT("object")); if ( !n ) n = GetParamNode(wxT("object_ref")); if (n) { bool old_ins = m_isInside; m_isInside = false; wxObject *item = CreateResFromNode(n, m_notebook, NULL); m_isInside = old_ins; wxWindow *wnd = wxDynamicCast(item, wxWindow); if (wnd) { m_notebook->AddPage(wnd, GetText(wxT("label")), GetBool(wxT("selected"))); if ( HasParam(wxT("bitmap")) ) { wxBitmap bmp = GetBitmap(wxT("bitmap"), wxART_OTHER); wxFlatNotebookImageList *imgList = m_notebook->GetImageList(); if ( imgList == NULL ) { imgList = new wxFlatNotebookImageList ( ); m_notebook->SetImageList( imgList ); } imgList->Add(bmp); m_notebook->SetPageImageIndex(m_notebook->GetPageCount()-1, (int)imgList->Count()-1 ); } } else wxLogError(wxT("Error in resource.")); return wnd; } else { wxLogError(wxT("Error in resource: no control within notebook's tag.")); return NULL; } } else { XRC_MAKE_INSTANCE(nb, wxFlatNotebook) nb->Create(m_parentAsWindow, GetID(), GetPosition(), GetSize(), GetStyle(wxT("style")), GetName()); SetupWindow(nb); wxFlatNotebook *old_par = m_notebook; m_notebook = nb; bool old_ins = m_isInside; m_isInside = true; CreateChildren(m_notebook, true/*only this handler*/); m_isInside = old_ins; m_notebook = old_par; return nb; } } bool wxFlatNotebookXmlHandler::CanHandle(wxXmlNode *node) { return ((!m_isInside && IsOfClass(node, wxT("wxFlatNotebook"))) || (m_isInside && IsOfClass(node, wxT("notebookpage")))); } #endif // wxUSE_XRC && wxUSE_NOTEBOOK wxformbuilder-3.1.59/src/controls/src/wxScintilla/wxscintilla.cpp0000644000175000017500000031671411143440027025553 0ustar rrmulderrrmulder//////////////////////////////////////////////////////////////////////////// // Name: wxscintilla.cpp // Purpose: A wxWidgets implementation of Scintilla. This class is the // one meant to be used directly by wx applications. It does not // derive directly from the Scintilla classes, but instead // delegates most things to the real Scintilla class. // This allows the use of Scintilla without polluting the // namespace with all the classes and identifiers from Scintilla. // // Author: Robin Dunn // // Created: 13-Jan-2000 // RCS-ID: $Id: wxscintilla.cpp,v 1.37 2006/09/22 19:42:14 wyo Exp $ // Copyright: (c) 2004 wxCode // Licence: wxWindows ///////////////////////////////////////////////////////////////////////////// #include #include "ScintillaWX.h" #include "wx/wxScintilla/wxscintilla.h" #include #include #include #include #include #ifdef SCI_NAMESPACE // begin [CHANGED] using namespace Scintilla; #endif // end [CHANGED] //---------------------------------------------------------------------- const wxChar* wxSCINameStr = _T("SCIwindow"); #ifdef MAKELONG #undef MAKELONG #endif #define MAKELONG(a, b) ((a) | ((b) << 16)) static long wxColourAsLong(const wxColour& co) { return (((long)co.Blue() << 16) | ((long)co.Green() << 8) | ((long)co.Red())); } static wxColour wxColourFromLong(long c) { wxColour clr; clr.Set((unsigned char)(c & 0xff), (unsigned char)((c >> 8) & 0xff), (unsigned char)((c >> 16) & 0xff)); return clr; } static wxColour wxColourFromSpec(const wxString& spec) { // spec should be a colour name or "#RRGGBB" if (spec.GetChar(0) == _T('#')) { long red, green, blue; red = green = blue = 0; spec.Mid(1,2).ToLong(&red, 16); spec.Mid(3,2).ToLong(&green, 16); spec.Mid(5,2).ToLong(&blue, 16); return wxColour((unsigned char)red, (unsigned char)green, (unsigned char)blue); }else{ return wxColour(spec); } } //---------------------------------------------------------------------- DEFINE_EVENT_TYPE( wxEVT_SCI_CHANGE ) DEFINE_EVENT_TYPE( wxEVT_SCI_STYLENEEDED ) DEFINE_EVENT_TYPE( wxEVT_SCI_CHARADDED ) DEFINE_EVENT_TYPE( wxEVT_SCI_SAVEPOINTREACHED ) DEFINE_EVENT_TYPE( wxEVT_SCI_SAVEPOINTLEFT ) DEFINE_EVENT_TYPE( wxEVT_SCI_ROMODIFYATTEMPT ) DEFINE_EVENT_TYPE( wxEVT_SCI_KEY ) DEFINE_EVENT_TYPE( wxEVT_SCI_DOUBLECLICK ) DEFINE_EVENT_TYPE( wxEVT_SCI_UPDATEUI ) DEFINE_EVENT_TYPE( wxEVT_SCI_MODIFIED ) DEFINE_EVENT_TYPE( wxEVT_SCI_MACRORECORD ) DEFINE_EVENT_TYPE( wxEVT_SCI_MARGINCLICK ) DEFINE_EVENT_TYPE( wxEVT_SCI_NEEDSHOWN ) DEFINE_EVENT_TYPE( wxEVT_SCI_PAINTED ) DEFINE_EVENT_TYPE( wxEVT_SCI_USERLISTSELECTION ) DEFINE_EVENT_TYPE( wxEVT_SCI_URIDROPPED ) DEFINE_EVENT_TYPE( wxEVT_SCI_DWELLSTART ) DEFINE_EVENT_TYPE( wxEVT_SCI_DWELLEND ) DEFINE_EVENT_TYPE( wxEVT_SCI_START_DRAG ) DEFINE_EVENT_TYPE( wxEVT_SCI_DRAG_OVER ) DEFINE_EVENT_TYPE( wxEVT_SCI_DO_DROP ) DEFINE_EVENT_TYPE( wxEVT_SCI_ZOOM ) DEFINE_EVENT_TYPE( wxEVT_SCI_HOTSPOT_CLICK ) DEFINE_EVENT_TYPE( wxEVT_SCI_HOTSPOT_DCLICK ) DEFINE_EVENT_TYPE( wxEVT_SCI_CALLTIP_CLICK ) DEFINE_EVENT_TYPE( wxEVT_SCI_AUTOCOMP_SELECTION ) BEGIN_EVENT_TABLE(wxScintilla, wxControl) EVT_PAINT (wxScintilla::OnPaint) EVT_SCROLLWIN (wxScintilla::OnScrollWin) EVT_SCROLL (wxScintilla::OnScroll) EVT_SIZE (wxScintilla::OnSize) EVT_LEFT_DOWN (wxScintilla::OnMouseLeftDown) // Let Scintilla see the double click as a second click EVT_LEFT_DCLICK (wxScintilla::OnMouseLeftDown) EVT_MOTION (wxScintilla::OnMouseMove) EVT_LEFT_UP (wxScintilla::OnMouseLeftUp) #if defined(__WXGTK__) || defined(__WXMAC__) EVT_RIGHT_UP (wxScintilla::OnMouseRightUp) #else EVT_CONTEXT_MENU (wxScintilla::OnContextMenu) #endif EVT_MOUSEWHEEL (wxScintilla::OnMouseWheel) EVT_MIDDLE_UP (wxScintilla::OnMouseMiddleUp) EVT_CHAR (wxScintilla::OnChar) EVT_KEY_DOWN (wxScintilla::OnKeyDown) EVT_KILL_FOCUS (wxScintilla::OnLoseFocus) EVT_SET_FOCUS (wxScintilla::OnGainFocus) EVT_SYS_COLOUR_CHANGED (wxScintilla::OnSysColourChanged) EVT_ERASE_BACKGROUND (wxScintilla::OnEraseBackground) EVT_MENU_RANGE (10, 16, wxScintilla::OnMenu) EVT_LISTBOX_DCLICK (wxID_ANY, wxScintilla::OnListBox) END_EVENT_TABLE() IMPLEMENT_CLASS(wxScintilla, wxControl) IMPLEMENT_DYNAMIC_CLASS(wxScintillaEvent, wxCommandEvent) #ifdef LINK_LEXERS // forces the linking of the lexer modules int Scintilla_LinkLexers(); #endif //---------------------------------------------------------------------- // Constructor and Destructor wxScintilla::wxScintilla (wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name) { m_swx = NULL; Create (parent, id, pos, size, style, name); } bool wxScintilla::Create (wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name) { #ifdef __WXMAC__ style |= wxVSCROLL | wxHSCROLL; #endif if (!wxControl::Create (parent, id, pos, size, style | wxWANTS_CHARS | wxCLIP_CHILDREN, wxDefaultValidator, name)) { return false; } #ifdef LINK_LEXERS Scintilla_LinkLexers(); #endif m_swx = new ScintillaWX(this); m_stopWatch.Start(); m_lastKeyDownConsumed = FALSE; m_vScrollBar = NULL; m_hScrollBar = NULL; #if wxUSE_UNICODE // Put Scintilla into unicode (UTF-8) mode SetCodePage(wxSCI_CP_UTF8); #endif #if wxCHECK_VERSION(2, 5, 0) // Reduces flicker on GTK+/X11 SetBackgroundStyle(wxBG_STYLE_CUSTOM); #if wxCHECK_VERSION(2, 8, 0) SetInitialBestSize(size); #else SetBestFittingSize(size); #endif #endif return false; } wxScintilla::~wxScintilla() { delete m_swx; } //---------------------------------------------------------------------- // Send message to Scintilla long wxScintilla::SendMsg (int msg, long wp, long lp) { return m_swx->WndProc (msg, wp, lp); } //---------------------------------------------------------------------- // Set the vertical scrollbar to use instead of the ont that's built-in. void wxScintilla::SetVScrollBar (wxScrollBar* bar) { m_vScrollBar = bar; if (bar != NULL) { // ensure that the built-in scrollbar is not visible SetScrollbar(wxVERTICAL, 0, 0, 0); } } // Set the horizontal scrollbar to use instead of the ont that's built-in. void wxScintilla::SetHScrollBar (wxScrollBar* bar) { m_hScrollBar = bar; if (bar != NULL) { // ensure that the built-in scrollbar is not visible SetScrollbar(wxHORIZONTAL, 0, 0, 0); } } //---------------------------------------------------------------------- // BEGIN generated section. The following code is automatically generated // by gen_iface.py from the contents of Scintilla.iface. Do not edit // this file. Edit wxscintilla.cpp.in or gen_iface.py instead and regenerate. // Add text to the document at current position. void wxScintilla::AddText (const wxString& text) { wxWX2MBbuf buf = (wxWX2MBbuf)wx2sci(text); SendMsg (SCI_ADDTEXT, strlen(buf), (long)(const char*)buf); } // Add text to the document w/length parameter, this allows for binary data to be added. void wxScintilla::AddText (const int length, const wxString& text) { wxWX2MBbuf buf = (wxWX2MBbuf)wx2sci(text); SendMsg (SCI_ADDTEXT, length, (long)(const char*)buf); } // Add array of cells to document. void wxScintilla::AddStyledText (const wxMemoryBuffer& data) { SendMsg (SCI_ADDSTYLEDTEXT, data.GetDataLen(), (long)data.GetData()); } // Insert string at a position. void wxScintilla::InsertText (int pos, const wxString& text) { SendMsg (SCI_INSERTTEXT, pos, (long)(const char*)wx2sci(text)); } // Delete all text in the document. void wxScintilla::ClearAll() { SendMsg (SCI_CLEARALL, 0, 0); } // Set all style bytes to 0, remove all folding information. void wxScintilla::ClearDocumentStyle() { SendMsg (SCI_CLEARDOCUMENTSTYLE, 0, 0); } // Returns the number of characters in the document. int wxScintilla::GetLength() { return SendMsg (SCI_GETLENGTH, 0, 0); } // Returns the character byte at the position. int wxScintilla::GetCharAt (int pos) { return (unsigned char)SendMsg (SCI_GETCHARAT, pos, 0); } // Returns the position of the caret. int wxScintilla::GetCurrentPos() { return SendMsg (SCI_GETCURRENTPOS, 0, 0); } // Returns the position of the opposite end of the selection to the caret. int wxScintilla::GetAnchor() { return SendMsg (SCI_GETANCHOR, 0, 0); } // Returns the style byte at the position. int wxScintilla::GetStyleAt (int pos) { return (unsigned char)SendMsg (SCI_GETSTYLEAT, pos, 0); } // Redoes the next action on the undo history. void wxScintilla::Redo() { SendMsg (SCI_REDO, 0, 0); } // Choose between collecting actions into the undo // history and discarding them. void wxScintilla::SetUndoCollection (bool collectUndo) { SendMsg (SCI_SETUNDOCOLLECTION, collectUndo, 0); } // Select all the text in the document. void wxScintilla::SelectAll() { SendMsg (SCI_SELECTALL, 0, 0); } // Remember the current position in the undo history as the position // at which the document was saved. void wxScintilla::SetSavePoint() { SendMsg (SCI_SETSAVEPOINT, 0, 0); } // Retrieve a buffer of cells. wxMemoryBuffer wxScintilla::GetStyledText (int startPos, int endPos) { wxMemoryBuffer buf; if (endPos < startPos) { int temp = startPos; startPos = endPos; endPos = temp; } int len = endPos - startPos; if (!len) return buf; TextRange tr; tr.lpstrText = (char*)buf.GetWriteBuf(len*2+1); tr.chrg.cpMin = startPos; tr.chrg.cpMax = endPos; len = SendMsg (SCI_GETSTYLEDTEXT, 0, (long)&tr); buf.UngetWriteBuf(len); return buf; } // Are there any redoable actions in the undo history? bool wxScintilla::CanRedo() { return SendMsg (SCI_CANREDO, 0, 0) != 0; } // Retrieve the line number at which a particular marker is located. int wxScintilla::MarkerLineFromHandle (int handle) { return SendMsg (SCI_MARKERLINEFROMHANDLE, handle, 0); } // Delete a marker. void wxScintilla::MarkerDeleteHandle (int handle) { SendMsg (SCI_MARKERDELETEHANDLE, handle, 0); } // Is undo history being collected? bool wxScintilla::GetUndoCollection() { return SendMsg (SCI_GETUNDOCOLLECTION, 0, 0) != 0; } // Are white space characters currently visible? // Returns one of SCWS_* constants. int wxScintilla::GetViewWhiteSpace() { return SendMsg (SCI_GETVIEWWS, 0, 0); } // Make white space characters invisible, always visible or visible outside indentation. void wxScintilla::SetViewWhiteSpace (int viewWS) { SendMsg (SCI_SETVIEWWS, viewWS, 0); } // Find the position from a point within the window. int wxScintilla::PositionFromPoint (wxPoint pt) { return SendMsg (SCI_POSITIONFROMPOINT, pt.x, pt.y); } // Find the position from a point within the window but return // INVALID_POSITION if not close to text. int wxScintilla::PositionFromPointClose (int x, int y) { return SendMsg (SCI_POSITIONFROMPOINTCLOSE, x, y); } // Set caret to start of a line and ensure it is visible. void wxScintilla::GotoLine (int line) { SendMsg (SCI_GOTOLINE, line, 0); } // Set caret to a position and ensure it is visible. void wxScintilla::GotoPos (int pos) { SendMsg (SCI_GOTOPOS, pos, 0); } // Set the selection anchor to a position. The anchor is the opposite // end of the selection from the caret. void wxScintilla::SetAnchor (int posAnchor) { SendMsg (SCI_SETANCHOR, posAnchor, 0); } // Retrieve the text of the line containing the caret. // Returns the index of the caret on the line. wxString wxScintilla::GetCurLine (int* linePos) { int len = LineLength(GetCurrentLine()); if (!len) { if (linePos) *linePos = 0; return wxEmptyString; } wxMemoryBuffer mbuf(len+1); char* buf = (char*)mbuf.GetWriteBuf(len+1); int pos = SendMsg (SCI_GETCURLINE, len+1, (long)buf); mbuf.UngetWriteBuf(len); mbuf.AppendByte(0); if (linePos) *linePos = pos; return sci2wx(buf); } // Retrieve the position of the last correctly styled character. int wxScintilla::GetEndStyled() { return SendMsg (SCI_GETENDSTYLED, 0, 0); } // Convert all line endings in the document to one mode. void wxScintilla::ConvertEOLs (int eolMode) { SendMsg (SCI_CONVERTEOLS, eolMode, 0); } // Retrieve the current end of line mode - one of CRLF, CR, or LF. int wxScintilla::GetEOLMode() { return SendMsg (SCI_GETEOLMODE, 0, 0); } // Set the current end of line mode. void wxScintilla::SetEOLMode (int eolMode) { SendMsg (SCI_SETEOLMODE, eolMode, 0); } // Set the current styling position to pos and the styling mask to mask. // The styling mask can be used to protect some bits in each styling byte from modification. void wxScintilla::StartStyling (int pos, int mask) { SendMsg (SCI_STARTSTYLING, pos, mask); } // Change style from current styling position for length characters to a style // and move the current styling position to after this newly styled segment. void wxScintilla::SetStyling (int length, int style) { SendMsg (SCI_SETSTYLING, length, style); } // Is drawing done first into a buffer or direct to the screen? bool wxScintilla::GetBufferedDraw() { return SendMsg (SCI_GETBUFFEREDDRAW, 0, 0) != 0; } // If drawing is buffered then each line of text is drawn into a bitmap buffer // before drawing it to the screen to avoid flicker. void wxScintilla::SetBufferedDraw (bool buffered) { SendMsg (SCI_SETBUFFEREDDRAW, buffered, 0); } // Change the visible size of a tab to be a multiple of the width of a space character. void wxScintilla::SetTabWidth (int tabWidth) { SendMsg (SCI_SETTABWIDTH, tabWidth, 0); } // Retrieve the visible size of a tab. int wxScintilla::GetTabWidth() { return SendMsg (SCI_GETTABWIDTH, 0, 0); } // Set the code page used to interpret the bytes of the document as characters. void wxScintilla::SetCodePage (int codePage) { #if wxUSE_UNICODE wxASSERT_MSG (codePage == wxSCI_CP_UTF8, _T("Only wxSCI_CP_UTF8 may be used when wxUSE_UNICODE is on.")); #else wxASSERT_MSG (codePage != wxSCI_CP_UTF8, _T("wxSCI_CP_UTF8 may not be used when wxUSE_UNICODE is off.")); #endif SendMsg(SCI_SETCODEPAGE, codePage); } // Set use palette (SCI_SETUSEPALETTE) not supported // Set the symbol used for a particular marker number, // and optionally the fore and background colours. void wxScintilla::MarkerDefine (int markerNumber, int markerSymbol) { SendMsg (SCI_MARKERDEFINE, markerNumber, markerSymbol); } // Set the foreground colour used for a particular marker number. void wxScintilla::MarkerSetForeground (int markerNumber, const wxColour& fore) { SendMsg (SCI_MARKERSETFORE, markerNumber, wxColourAsLong(fore)); } // Set the background colour used for a particular marker number. void wxScintilla::MarkerSetBackground (int markerNumber, const wxColour& back) { SendMsg (SCI_MARKERSETBACK, markerNumber, wxColourAsLong(back)); } // Add a marker to a line, returning an ID which can be used to find or delete the marker. int wxScintilla::MarkerAdd (int line, int markerNumber) { return SendMsg (SCI_MARKERADD, line, markerNumber); } // Delete a marker from a line. void wxScintilla::MarkerDelete (int line, int markerNumber) { SendMsg (SCI_MARKERDELETE, line, markerNumber); } // Delete all markers with a particular number from all lines. void wxScintilla::MarkerDeleteAll (int markerNumber) { SendMsg (SCI_MARKERDELETEALL, markerNumber, 0); } // Get a bit mask of all the markers set on a line. int wxScintilla::MarkerGet (int line) { return SendMsg (SCI_MARKERGET, line, 0); } // Find the next line after lineStart that includes a marker in mask. int wxScintilla::MarkerNext (int lineStart, int markerMask) { return SendMsg (SCI_MARKERNEXT, lineStart, markerMask); } // Find the previous line before lineStart that includes a marker in mask. int wxScintilla::MarkerPrevious (int lineStart, int markerMask) { return SendMsg (SCI_MARKERPREVIOUS, lineStart, markerMask); } // Define a marker from a bitmap void wxScintilla::MarkerDefineBitmap (int markerNumber, const wxBitmap& bmp) { // convert bmp to a xpm in a string wxMemoryOutputStream strm; wxImage img = bmp.ConvertToImage(); #if wxCHECK_VERSION(2, 5, 0) if (img.HasAlpha()) img.ConvertAlphaToMask(); #endif img.SaveFile(strm, wxBITMAP_TYPE_XPM); size_t len = strm.GetSize(); char* buff = new char[len+1]; strm.CopyTo(buff, len); buff[len] = 0; SendMsg (SCI_MARKERDEFINEPIXMAP, markerNumber, (long)buff); delete [] buff; } // Add a set of markers to a line. void wxScintilla::MarkerAddSet (int line, int markerSet) { SendMsg (SCI_MARKERADDSET, line, markerSet); } // Set the alpha used for a marker that is drawn in the text area, not the margin. void wxScintilla::MarkerSetAlpha (int markerNumber, int alpha) { SendMsg (SCI_MARKERSETALPHA, markerNumber, alpha); } // Set a margin to be either numeric or symbolic. void wxScintilla::SetMarginType (int margin, int marginType) { SendMsg (SCI_SETMARGINTYPEN, margin, marginType); } // Retrieve the type of a margin. int wxScintilla::GetMarginType (int margin) { return SendMsg (SCI_GETMARGINTYPEN, margin, 0); } // Set the width of a margin to a width expressed in pixels. void wxScintilla::SetMarginWidth (int margin, int pixels) { SendMsg (SCI_SETMARGINWIDTHN, margin, pixels); } // Retrieve the width of a margin in pixels. int wxScintilla::GetMarginWidth (int margin) { return SendMsg (SCI_GETMARGINWIDTHN, margin, 0); } // Set a mask that determines which markers are displayed in a margin. void wxScintilla::SetMarginMask (int margin, int mask) { SendMsg (SCI_SETMARGINMASKN, margin, mask); } // Retrieve the marker mask of a margin. int wxScintilla::GetMarginMask (int margin) { return SendMsg (SCI_GETMARGINMASKN, margin, 0); } // Make a margin sensitive or insensitive to mouse clicks. void wxScintilla::SetMarginSensitive (int margin, bool sensitive) { SendMsg (SCI_SETMARGINSENSITIVEN, margin, sensitive); } // Retrieve the mouse click sensitivity of a margin. bool wxScintilla::GetMarginSensitive (int margin) { return SendMsg (SCI_GETMARGINSENSITIVEN, margin, 0) != 0; } // Clear all the styles and make equivalent to the global default style. void wxScintilla::StyleClearAll() { SendMsg (SCI_STYLECLEARALL, 0, 0); } // Set the foreground colour of a style. void wxScintilla::StyleSetForeground (int style, const wxColour& fore) { SendMsg (SCI_STYLESETFORE, style, wxColourAsLong(fore)); } // Set the background colour of a style. void wxScintilla::StyleSetBackground (int style, const wxColour& back) { SendMsg (SCI_STYLESETBACK, style, wxColourAsLong(back)); } // Set a style to be bold or not. void wxScintilla::StyleSetBold (int style, bool bold) { SendMsg (SCI_STYLESETBOLD, style, bold); } // Set a style to be italic or not. void wxScintilla::StyleSetItalic (int style, bool italic) { SendMsg (SCI_STYLESETITALIC, style, italic); } // Set the size of characters of a style. void wxScintilla::StyleSetSize (int style, int sizePoints) { SendMsg (SCI_STYLESETSIZE, style, sizePoints); } // Set the font of a style. void wxScintilla::StyleSetFaceName (int style, const wxString& fontName) { SendMsg (SCI_STYLESETFONT, style, (long)(const char*)wx2sci(fontName)); } // Set a style to have its end of line filled or not. void wxScintilla::StyleSetEOLFilled (int style, bool filled) { SendMsg (SCI_STYLESETEOLFILLED, style, filled); } // Reset the default style to its state at startup void wxScintilla::StyleResetDefault() { SendMsg (SCI_STYLERESETDEFAULT, 0, 0); } // Set a style to be underlined or not. void wxScintilla::StyleSetUnderline (int style, bool underline) { SendMsg (SCI_STYLESETUNDERLINE, style, underline); } // Set a style to be mixed case, or to force upper or lower case. void wxScintilla::StyleSetCase (int style, int caseMode) { SendMsg (SCI_STYLESETCASE, style, caseMode); } // Set a style to be a hotspot or not. void wxScintilla::StyleSetHotSpot (int style, bool hotspot) { SendMsg (SCI_STYLESETHOTSPOT, style, hotspot); } // Get the alpha of the selection. int wxScintilla::GetSelAlpha () { return SendMsg (SCI_GETSELALPHA, 0, 0); } // Set the alpha of the selection. void wxScintilla::SetSelAlpha (int alpha) { SendMsg (SCI_SETSELALPHA, alpha, 0); } // Set the foreground colour of the selection and whether to use this setting. void wxScintilla::SetSelForeground (bool useSetting, const wxColour& fore) { SendMsg (SCI_SETSELFORE, useSetting, wxColourAsLong(fore)); } // Set the background colour of the selection and whether to use this setting. void wxScintilla::SetSelBackground (bool useSetting, const wxColour& back) { SendMsg (SCI_SETSELBACK, useSetting, wxColourAsLong(back)); } // Set the foreground colour of the caret. void wxScintilla::SetCaretForeground (const wxColour& fore) { SendMsg (SCI_SETCARETFORE, wxColourAsLong(fore), 0); } // When key+modifier combination km is pressed perform msg. void wxScintilla::CmdKeyAssign (int key, int modifiers, int cmd) { SendMsg (SCI_ASSIGNCMDKEY, MAKELONG(key, modifiers), cmd); } // When key+modifier combination km is pressed do nothing. void wxScintilla::CmdKeyClear (int key, int modifiers) { SendMsg (SCI_CLEARCMDKEY, MAKELONG(key, modifiers)); } // Drop all key mappings. void wxScintilla::CmdKeyClearAll() { SendMsg (SCI_CLEARALLCMDKEYS, 0, 0); } // Set the styles for a segment of the document. void wxScintilla::SetStyleBytes (int length, char* styleBytes) { SendMsg (SCI_SETSTYLINGEX, length, (long)styleBytes); } // Set a style to be visible or not. void wxScintilla::StyleSetVisible (int style, bool visible) { SendMsg (SCI_STYLESETVISIBLE, style, visible); } // Get the time in milliseconds that the caret is on and off. int wxScintilla::GetCaretPeriod() { return SendMsg (SCI_GETCARETPERIOD, 0, 0); } // Get the time in milliseconds that the caret is on and off. 0 = steady on. void wxScintilla::SetCaretPeriod (int milliseconds) { SendMsg (SCI_SETCARETPERIOD, milliseconds, 0); } // Set the set of characters making up words for when moving or selecting by word. // First sets deaults like SetCharsDefault. void wxScintilla::SetWordChars (const wxString& characters) { SendMsg (SCI_SETWORDCHARS, 0, (long)(const char*)wx2sci(characters)); } // Start a sequence of actions that is undone and redone as a unit. // May be nested. void wxScintilla::BeginUndoAction() { SendMsg (SCI_BEGINUNDOACTION, 0, 0); } // End a sequence of actions that is undone and redone as a unit. void wxScintilla::EndUndoAction() { SendMsg (SCI_ENDUNDOACTION, 0, 0); } // Set an indicator to plain, squiggle or TT. void wxScintilla::IndicatorSetStyle (int indic, int style) { SendMsg (SCI_INDICSETSTYLE, indic, style); } // Retrieve the style of an indicator. int wxScintilla::IndicatorGetStyle (int indic) { return SendMsg (SCI_INDICGETSTYLE, indic, 0); } // Set the foreground colour of an indicator. void wxScintilla::IndicatorSetForeground (int indic, const wxColour& fore) { SendMsg (SCI_INDICSETFORE, indic, wxColourAsLong(fore)); } // Retrieve the foreground colour of an indicator. wxColour wxScintilla::IndicatorGetForeground (int indic) { long colour = SendMsg (SCI_INDICGETFORE, indic, 0); return wxColourFromLong(colour); } // Set the foreground colour of all whitespace and whether to use this setting. void wxScintilla::SetWhitespaceForeground (bool useSetting, const wxColour& fore) { SendMsg (SCI_SETWHITESPACEFORE, useSetting, wxColourAsLong(fore)); } // Set the background colour of all whitespace and whether to use this setting. void wxScintilla::SetWhitespaceBackground (bool useSetting, const wxColour& back) { SendMsg (SCI_SETWHITESPACEBACK, useSetting, wxColourAsLong(back)); } // Divide each styling byte into lexical class bits (default: 5) and indicator // bits (default: 3). If a lexer requires more than 32 lexical states, then this // is used to expand the possible states. void wxScintilla::SetStyleBits (int bits) { SendMsg (SCI_SETSTYLEBITS, bits, 0); } // Retrieve number of bits in style bytes used to hold the lexical state. int wxScintilla::GetStyleBits() { return SendMsg (SCI_GETSTYLEBITS, 0, 0); } // Used to hold extra styling information for each line. void wxScintilla::SetLineState (int line, int state) { SendMsg (SCI_SETLINESTATE, line, state); } // Retrieve the extra styling information for a line. int wxScintilla::GetLineState (int line) { return SendMsg (SCI_GETLINESTATE, line, 0); } // Retrieve the last line number that has line state. int wxScintilla::GetMaxLineState() { return SendMsg (SCI_GETMAXLINESTATE, 0, 0); } // Is the background of the line containing the caret in a different colour? bool wxScintilla::GetCaretLineVisible() { return SendMsg (SCI_GETCARETLINEVISIBLE, 0, 0) != 0; } // Display the background of the line containing the caret in a different colour. void wxScintilla::SetCaretLineVisible (bool show) { SendMsg (SCI_SETCARETLINEVISIBLE, show, 0); } // Get the colour of the background of the line containing the caret. wxColour wxScintilla::GetCaretLineBackground() { long colour = SendMsg (SCI_GETCARETLINEBACK, 0, 0); return wxColourFromLong (colour); } // Set the colour of the background of the line containing the caret. void wxScintilla::SetCaretLineBackground (const wxColour& back) { SendMsg (SCI_SETCARETLINEBACK, wxColourAsLong(back), 0); } // Set a style to be changeable or not (read only). // Experimental feature, currently buggy. void wxScintilla::StyleSetChangeable (int style, bool changeable) { SendMsg (SCI_STYLESETCHANGEABLE, style, changeable); } // Display a auto-completion list. // The lenEntered parameter indicates how many characters before // the caret should be used to provide context. void wxScintilla::AutoCompShow (int lenEntered, const wxString& itemList) { SendMsg (SCI_AUTOCSHOW, lenEntered, (long)(const char*)wx2sci(itemList)); } // Remove the auto-completion list from the screen. void wxScintilla::AutoCompCancel() { SendMsg (SCI_AUTOCCANCEL, 0, 0); } // Is there an auto-completion list visible? bool wxScintilla::AutoCompActive() { return SendMsg (SCI_AUTOCACTIVE, 0, 0) != 0; } // Retrieve the position of the caret when the auto-completion list was displayed. int wxScintilla::AutoCompPosStart() { return SendMsg (SCI_AUTOCPOSSTART, 0, 0); } // User has selected an item so remove the list and insert the selection. void wxScintilla::AutoCompComplete() { SendMsg (SCI_AUTOCCOMPLETE, 0, 0); } // Define a set of character that when typed cancel the auto-completion list. void wxScintilla::AutoCompStops (const wxString& characterSet) { SendMsg (SCI_AUTOCSTOPS, 0, (long)(const char*)wx2sci(characterSet)); } // Change the separator character in the string setting up an auto-completion list. // Default is space but can be changed if items contain space. void wxScintilla::AutoCompSetSeparator (int separatorCharacter) { SendMsg (SCI_AUTOCSETSEPARATOR, separatorCharacter, 0); } // Retrieve the auto-completion list separator character. int wxScintilla::AutoCompGetSeparator() { return SendMsg (SCI_AUTOCGETSEPARATOR, 0, 0); } // Select the item in the auto-completion list that starts with a string. void wxScintilla::AutoCompSelect (const wxString& text) { SendMsg (SCI_AUTOCSELECT, 0, (long)(const char*)wx2sci(text)); } // Should the auto-completion list be cancelled if the user backspaces to a // position before where the box was created. void wxScintilla::AutoCompSetCancelAtStart (bool cancel) { SendMsg (SCI_AUTOCSETCANCELATSTART, cancel, 0); } // Retrieve whether auto-completion cancelled by backspacing before start. bool wxScintilla::AutoCompGetCancelAtStart() { return SendMsg (SCI_AUTOCGETCANCELATSTART, 0, 0) != 0; } // Define a set of characters that when typed will cause the autocompletion to // choose the selected item. void wxScintilla::AutoCompSetFillUps (const wxString& characterSet) { SendMsg (SCI_AUTOCSETFILLUPS, 0, (long)(const char*)wx2sci(characterSet)); } // Should a single item auto-completion list automatically choose the item. void wxScintilla::AutoCompSetChooseSingle (bool chooseSingle) { SendMsg (SCI_AUTOCSETCHOOSESINGLE, chooseSingle, 0); } // Retrieve whether a single item auto-completion list automatically choose the item. bool wxScintilla::AutoCompGetChooseSingle() { return SendMsg (SCI_AUTOCGETCHOOSESINGLE, 0, 0) != 0; } // Set whether case is significant when performing auto-completion searches. void wxScintilla::AutoCompSetIgnoreCase (bool ignoreCase) { SendMsg (SCI_AUTOCSETIGNORECASE, ignoreCase, 0); } // Retrieve state of ignore case flag. bool wxScintilla::AutoCompGetIgnoreCase() { return SendMsg (SCI_AUTOCGETIGNORECASE, 0, 0) != 0; } // Display a list of strings and send notification when user chooses one. void wxScintilla::UserListShow (int listType, const wxString& itemList) { SendMsg (SCI_USERLISTSHOW, listType, (long)(const char*)wx2sci(itemList)); } // Set whether or not autocompletion is hidden automatically when nothing matches. void wxScintilla::AutoCompSetAutoHide (bool autoHide) { SendMsg (SCI_AUTOCSETAUTOHIDE, autoHide, 0); } // Retrieve whether or not autocompletion is hidden automatically when nothing matches. bool wxScintilla::AutoCompGetAutoHide() { return SendMsg (SCI_AUTOCGETAUTOHIDE, 0, 0) != 0; } // Set whether or not autocompletion deletes any word characters // after the inserted text upon completion. void wxScintilla::AutoCompSetDropRestOfWord (bool dropRestOfWord) { SendMsg (SCI_AUTOCSETDROPRESTOFWORD, dropRestOfWord, 0); } // Retrieve whether or not autocompletion deletes any word characters // after the inserted text upon completion. bool wxScintilla::AutoCompGetDropRestOfWord() { return SendMsg (SCI_AUTOCGETDROPRESTOFWORD, 0, 0) != 0; } // Register an image for use in autocompletion lists. void wxScintilla::RegisterImage (int type, const wxBitmap& bmp) { // convert bmp to a xpm in a string wxMemoryOutputStream strm; wxImage img = bmp.ConvertToImage(); #if wxCHECK_VERSION(2, 5, 0) if (img.HasAlpha()) img.ConvertAlphaToMask(); #endif img.SaveFile(strm, wxBITMAP_TYPE_XPM); size_t len = strm.GetSize(); char* buff = new char[len+1]; strm.CopyTo(buff, len); buff[len] = 0; SendMsg(SCI_REGISTERIMAGE, type, (long)buff); delete [] buff; } // Clear all the registered images. void wxScintilla::ClearRegisteredImages() { SendMsg (SCI_CLEARREGISTEREDIMAGES, 0, 0); } // Retrieve the auto-completion list type-separator character. int wxScintilla::AutoCompGetTypeSeparator() { return SendMsg (SCI_AUTOCGETTYPESEPARATOR, 0, 0); } // Change the type-separator character in the string setting up an auto-completion list. // Default is '?' but can be changed if items contain '?'. void wxScintilla::AutoCompSetTypeSeparator (int separatorCharacter) { SendMsg (SCI_AUTOCSETTYPESEPARATOR, separatorCharacter, 0); } // Set the maximum width, in characters, of auto-completion and user lists. // Set to 0 to autosize to fit longest item, which is the default. void wxScintilla::AutoCompSetMaxWidth (int characterCount) { SendMsg (SCI_AUTOCSETMAXWIDTH, characterCount, 0); } // Get the maximum width, in characters, of auto-completion and user lists. int wxScintilla::AutoCompGetMaxWidth() { return SendMsg (SCI_AUTOCGETMAXWIDTH, 0, 0); } // Set the maximum height, in rows, of auto-completion and user lists. // The default is 5 rows. void wxScintilla::AutoCompSetMaxHeight (int rowCount) { SendMsg (SCI_AUTOCSETMAXHEIGHT, rowCount, 0); } // Set the maximum height, in rows, of auto-completion and user lists. int wxScintilla::AutoCompGetMaxHeight() { return SendMsg (SCI_AUTOCGETMAXHEIGHT, 0, 0); } // Set the number of spaces used for one level of indentation. void wxScintilla::SetIndent (int indentSize) { SendMsg (SCI_SETINDENT, indentSize, 0); } // Retrieve indentation size. int wxScintilla::GetIndent() { return SendMsg (SCI_GETINDENT, 0, 0); } // Indentation will only use space characters if useTabs is false, otherwise // it will use a combination of tabs and spaces. void wxScintilla::SetUseTabs (bool useTabs) { SendMsg (SCI_SETUSETABS, useTabs, 0); } // Retrieve whether tabs will be used in indentation. bool wxScintilla::GetUseTabs() { return SendMsg (SCI_GETUSETABS, 0, 0) != 0; } // Change the indentation of a line to a number of columns. void wxScintilla::SetLineIndentation (int line, int indentSize) { SendMsg (SCI_SETLINEINDENTATION, line, indentSize); } // Retrieve the number of columns that a line is indented. int wxScintilla::GetLineIndentation (int line) { return SendMsg (SCI_GETLINEINDENTATION, line, 0); } // Retrieve the position before the first non indentation character on a line. int wxScintilla::GetLineIndentPosition (int line) { return SendMsg (SCI_GETLINEINDENTPOSITION, line, 0); } // Retrieve the column number of a position, taking tab width into account. int wxScintilla::GetColumn (int pos) { return SendMsg (SCI_GETCOLUMN, pos, 0); } // Show or hide the horizontal scroll bar. void wxScintilla::SetUseHorizontalScrollBar (bool show) { SendMsg (SCI_SETHSCROLLBAR, show, 0); } // Is the horizontal scroll bar visible? bool wxScintilla::GetUseHorizontalScrollBar() { return SendMsg (SCI_GETHSCROLLBAR, 0, 0) != 0; } // Show or hide indentation guides. void wxScintilla::SetIndentationGuides (bool show) { SendMsg (SCI_SETINDENTATIONGUIDES, show, 0); } // Are the indentation guides visible? bool wxScintilla::GetIndentationGuides() { return SendMsg (SCI_GETINDENTATIONGUIDES, 0, 0) != 0; } // Set the highlighted indentation guide column. // 0 = no highlighted guide. void wxScintilla::SetHighlightGuide (int column) { SendMsg (SCI_SETHIGHLIGHTGUIDE, column, 0); } // Get the highlighted indentation guide column. int wxScintilla::GetHighlightGuide() { return SendMsg (SCI_GETHIGHLIGHTGUIDE, 0, 0); } // Get the position after the last visible characters on a line. int wxScintilla::GetLineEndPosition (int line) { return SendMsg (SCI_GETLINEENDPOSITION, line, 0); } // Get the code page used to interpret the bytes of the document as characters. int wxScintilla::GetCodePage() { return SendMsg (SCI_GETCODEPAGE, 0, 0); } // Get the foreground colour of the caret. wxColour wxScintilla::GetCaretForeground() { long colour = SendMsg (SCI_GETCARETFORE, 0, 0); return wxColourFromLong(colour); } // Get use palette (SCI_GETUSEPALETTE) not supported // In read-only mode? bool wxScintilla::GetReadOnly() { return SendMsg (SCI_GETREADONLY, 0, 0) != 0; } // Sets the position of the caret. void wxScintilla::SetCurrentPos (int pos) { SendMsg (SCI_SETCURRENTPOS, pos, 0); } // Sets the position that starts the selection - this becomes the anchor. void wxScintilla::SetSelectionStart (int pos) { SendMsg (SCI_SETSELECTIONSTART, pos, 0); } // Returns the position at the start of the selection. int wxScintilla::GetSelectionStart() { return SendMsg (SCI_GETSELECTIONSTART, 0, 0); } // Sets the position that ends the selection - this becomes the currentPosition. void wxScintilla::SetSelectionEnd (int pos) { SendMsg (SCI_SETSELECTIONEND, pos, 0); } // Returns the position at the end of the selection. int wxScintilla::GetSelectionEnd() { return SendMsg (SCI_GETSELECTIONEND, 0, 0); } // Sets the print magnification added to the point size of each style for printing. void wxScintilla::SetPrintMagnification (int magnification) { SendMsg (SCI_SETPRINTMAGNIFICATION, magnification, 0); } // Returns the print magnification. int wxScintilla::GetPrintMagnification() { return SendMsg (SCI_GETPRINTMAGNIFICATION, 0, 0); } // Modify colours when printing for clearer printed text. void wxScintilla::SetPrintColourMode (int mode) { SendMsg (SCI_SETPRINTCOLOURMODE, mode, 0); } // Returns the print colour mode. int wxScintilla::GetPrintColourMode() { return SendMsg (SCI_GETPRINTCOLOURMODE, 0, 0); } // Find some text in the document. int wxScintilla::FindText (int minPos, int maxPos, const wxString& text, int flags, int* lengthFound) { TextToFind ft; ft.chrg.cpMin = minPos; ft.chrg.cpMax = maxPos; wxWX2MBbuf buf = (wxWX2MBbuf)wx2sci(text); ft.lpstrText = (char*)(const char*)buf; int ret = SendMsg (SCI_FINDTEXT, flags, (long)&ft); if (lengthFound) *lengthFound = ft.chrgText.cpMax - ft.chrgText.cpMin; return ret; } // On Windows, will draw the document into a display context such as a printer. int wxScintilla::FormatRange (bool doDraw, int startPos, int endPos, wxDC* draw, wxDC* target, wxRect renderRect, wxRect pageRect) { RangeToFormat fr; if (endPos < startPos) { int temp = startPos; startPos = endPos; endPos = temp; } fr.hdc = draw; fr.hdcTarget = target; fr.rc.top = renderRect.GetTop(); fr.rc.left = renderRect.GetLeft(); fr.rc.right = renderRect.GetRight(); fr.rc.bottom = renderRect.GetBottom(); fr.rcPage.top = pageRect.GetTop(); fr.rcPage.left = pageRect.GetLeft(); fr.rcPage.right = pageRect.GetRight(); fr.rcPage.bottom = pageRect.GetBottom(); fr.chrg.cpMin = startPos; fr.chrg.cpMax = endPos; return SendMsg (SCI_FORMATRANGE, doDraw, (long)&fr); } // Retrieve the display line at the top of the display. int wxScintilla::GetFirstVisibleLine() { return SendMsg (SCI_GETFIRSTVISIBLELINE, 0, 0); } // Retrieve the contents of a line. wxString wxScintilla::GetLine (int line) { int len = LineLength(line); if (!len) return wxEmptyString; wxMemoryBuffer mbuf(len+1); char* buf = (char*)mbuf.GetWriteBuf(len+1); SendMsg (SCI_GETLINE, line, (long)buf); mbuf.UngetWriteBuf(len); mbuf.AppendByte(0); return sci2wx(buf); } // Returns the number of lines in the document. There is always at least one. int wxScintilla::GetLineCount() { return SendMsg (SCI_GETLINECOUNT, 0, 0); } // Sets the size in pixels of the left margin. void wxScintilla::SetMarginLeft (int pixels) { SendMsg (SCI_SETMARGINLEFT, 0, pixels); } // Returns the size in pixels of the left margin. int wxScintilla::GetMarginLeft() { return SendMsg (SCI_GETMARGINLEFT, 0, 0); } // Sets the size in pixels of the right margin. void wxScintilla::SetMarginRight (int pixels) { SendMsg (SCI_SETMARGINRIGHT, 0, pixels); } // Returns the size in pixels of the right margin. int wxScintilla::GetMarginRight() { return SendMsg (SCI_GETMARGINRIGHT, 0, 0); } // Is the document different from when it was last saved? bool wxScintilla::GetModify() { return SendMsg (SCI_GETMODIFY, 0, 0) != 0; } // Select a range of text. void wxScintilla::SetSelection (int startPos, int endPos) { SendMsg (SCI_SETSEL, startPos, endPos); } // Retrieve the selected text. wxString wxScintilla::GetSelectedText() { int start; int end; GetSelection(&start, &end); int len = end - start; if (!len) return wxEmptyString; wxMemoryBuffer mbuf(len+2); char* buf = (char*)mbuf.GetWriteBuf(len+1); SendMsg (SCI_GETSELTEXT, 0, (long)buf); mbuf.UngetWriteBuf(len); mbuf.AppendByte(0); return sci2wx(buf); } // Retrieve a range of text. wxString wxScintilla::GetTextRange (int startPos, int endPos) { if (endPos < startPos) { int temp = startPos; startPos = endPos; endPos = temp; } int len = endPos - startPos; if (!len) return wxEmptyString; wxMemoryBuffer mbuf(len+1); char* buf = (char*)mbuf.GetWriteBuf(len); TextRange tr; tr.lpstrText = buf; tr.chrg.cpMin = startPos; tr.chrg.cpMax = endPos; SendMsg (SCI_GETTEXTRANGE, 0, (long)&tr); mbuf.UngetWriteBuf(len); mbuf.AppendByte(0); return sci2wx(buf); } // Draw the selection in normal style or with selection highlighted. void wxScintilla::HideSelection (bool hide) { SendMsg (SCI_HIDESELECTION, hide, 0); } // Retrieve the point in the window where a position is displayed. wxPoint wxScintilla::PointFromPosition (int pos) { int x = SendMsg(SCI_POINTXFROMPOSITION, 0, pos); int y = SendMsg(SCI_POINTYFROMPOSITION, 0, pos); return wxPoint (x, y); } // Retrieve the line containing a position. int wxScintilla::LineFromPosition (int pos) { return SendMsg (SCI_LINEFROMPOSITION, pos, 0); } // Retrieve the position at the start of a line. int wxScintilla::PositionFromLine (int line) { return SendMsg (SCI_POSITIONFROMLINE, line, 0); } // Scroll horizontally and vertically. void wxScintilla::LineScroll (int columns, int lines) { SendMsg (SCI_LINESCROLL, columns, lines); } // Ensure the caret is visible. void wxScintilla::EnsureCaretVisible() { SendMsg (SCI_SCROLLCARET, 0, 0); } // Replace the selected text with the argument text. void wxScintilla::ReplaceSelection (const wxString& text) { SendMsg (SCI_REPLACESEL, 0, (long)(const char*)wx2sci(text)); } // Set to read only or read write. void wxScintilla::SetReadOnly (bool readOnly) { SendMsg (SCI_SETREADONLY, readOnly, 0); } // Will a paste succeed? bool wxScintilla::CanPaste() { return SendMsg (SCI_CANPASTE, 0, 0) != 0; } // Are there any undoable actions in the undo history? bool wxScintilla::CanUndo() { return SendMsg (SCI_CANUNDO, 0, 0) != 0; } // Delete the undo history. void wxScintilla::EmptyUndoBuffer() { SendMsg (SCI_EMPTYUNDOBUFFER, 0, 0); } // Undo one action in the undo history. void wxScintilla::Undo() { SendMsg (SCI_UNDO, 0, 0); } // Cut the selection to the clipboard. void wxScintilla::Cut() { SendMsg (SCI_CUT, 0, 0); } // Copy the selection to the clipboard. void wxScintilla::Copy() { SendMsg (SCI_COPY, 0, 0); } // Paste the contents of the clipboard into the document replacing the selection. void wxScintilla::Paste() { SendMsg (SCI_PASTE, 0, 0); } // Clear the selection. void wxScintilla::Clear() { SendMsg (SCI_CLEAR, 0, 0); } // Replace the contents of the document with the argument text. void wxScintilla::SetText (const wxString& text) { SendMsg(SCI_SETTEXT, 0, (long)(const char*)wx2sci(text)); } // Retrieve all the text in the document. wxString wxScintilla::GetText() { int len = GetTextLength(); wxMemoryBuffer mbuf(len+1); // leave room for the null... char* buf = (char*)mbuf.GetWriteBuf(len+1); SendMsg (SCI_GETTEXT, len+1, (long)buf); mbuf.UngetWriteBuf(len); mbuf.AppendByte(0); return sci2wx(buf); } // Retrieve the number of characters in the document. int wxScintilla::GetTextLength() { return SendMsg (SCI_GETTEXTLENGTH, 0, 0); } // Set to overtype (true) or insert mode. void wxScintilla::SetOvertype (bool overtype) { SendMsg (SCI_SETOVERTYPE, overtype, 0); } // Returns true if overtype mode is active otherwise false is returned. bool wxScintilla::GetOvertype() { return SendMsg (SCI_GETOVERTYPE, 0, 0) != 0; } // Set the width of the insert mode caret. void wxScintilla::SetCaretWidth (int pixels) { SendMsg (SCI_SETCARETWIDTH, pixels, 0); } // Returns the width of the insert mode caret. int wxScintilla::GetCaretWidth() { return SendMsg (SCI_GETCARETWIDTH, 0, 0); } // Sets the position that starts the target which is used for updating the // document without affecting the scroll position. void wxScintilla::SetTargetStart (int pos) { SendMsg (SCI_SETTARGETSTART, pos, 0); } // Get the position that starts the target. int wxScintilla::GetTargetStart() { return SendMsg (SCI_GETTARGETSTART, 0, 0); } // Sets the position that ends the target which is used for updating the // document without affecting the scroll position. void wxScintilla::SetTargetEnd (int pos) { SendMsg (SCI_SETTARGETEND, pos, 0); } // Get the position that ends the target. int wxScintilla::GetTargetEnd() { return SendMsg (SCI_GETTARGETEND, 0, 0); } // Replace the target text with the argument text. // Text is counted so it can contain NULs. // Returns the length of the replacement text. int wxScintilla::ReplaceTarget (const wxString& text) { wxWX2MBbuf buf = (wxWX2MBbuf)wx2sci(text); return SendMsg (SCI_REPLACETARGET, strlen(buf), (long)(const char*)buf); } // Replace the target text with the argument text after \d processing. // Text is counted so it can contain NULs. // Looks for \d where d is between 1 and 9 and replaces these with the strings // matched in the last search operation which were surrounded by \( and \). // Returns the length of the replacement text including any change // caused by processing the \d patterns. int wxScintilla::ReplaceTargetRE (const wxString& text) { wxWX2MBbuf buf = (wxWX2MBbuf)wx2sci(text); return SendMsg (SCI_REPLACETARGETRE, strlen(buf), (long)(const char*)buf); } // Search for a counted string in the target and set the target to the found // range. Text is counted so it can contain NULs. // Returns length of range or -1 for failure in which case target is not moved. int wxScintilla::SearchInTarget (const wxString& text) { wxWX2MBbuf buf = (wxWX2MBbuf)wx2sci(text); return SendMsg (SCI_SEARCHINTARGET, strlen(buf), (long)(const char*)buf); } // Set the search flags used by SearchInTarget. void wxScintilla::SetSearchFlags (int flags) { SendMsg (SCI_SETSEARCHFLAGS, flags, 0); } // Get the search flags used by SearchInTarget. int wxScintilla::GetSearchFlags() { return SendMsg (SCI_GETSEARCHFLAGS, 0, 0); } // Show a call tip containing a definition near position pos. void wxScintilla::CallTipShow (int pos, const wxString& definition) { SendMsg (SCI_CALLTIPSHOW, pos, (long)(const char*)wx2sci(definition)); } // Remove the call tip from the screen. void wxScintilla::CallTipCancel() { SendMsg (SCI_CALLTIPCANCEL, 0, 0); } // Is there an active call tip? bool wxScintilla::CallTipActive() { return SendMsg (SCI_CALLTIPACTIVE, 0, 0) != 0; } // Retrieve the position where the caret was before displaying the call tip. int wxScintilla::CallTipPosAtStart() { return SendMsg (SCI_CALLTIPPOSSTART, 0, 0); } // Highlight a segment of the definition. void wxScintilla::CallTipSetHighlight (int startPos, int endPos) { SendMsg (SCI_CALLTIPSETHLT, startPos, endPos); } // Set the background colour for the call tip. void wxScintilla::CallTipSetBackground (const wxColour& back) { SendMsg (SCI_CALLTIPSETBACK, wxColourAsLong(back), 0); } // Set the foreground colour for the call tip. void wxScintilla::CallTipSetForeground (const wxColour& fore) { SendMsg (SCI_CALLTIPSETFORE, wxColourAsLong(fore), 0); } // Set the foreground colour for the highlighted part of the call tip. void wxScintilla::CallTipSetForegroundHighlight (const wxColour& fore) { SendMsg (SCI_CALLTIPSETFOREHLT, wxColourAsLong(fore), 0); } // Enable use of STYLE_CALLTIP and set call tip tab size in pixels. void wxScintilla::CallTipUseStyle (int tabSize) { SendMsg (SCI_CALLTIPUSESTYLE, tabSize, 0); } // Find the display line of a document line taking hidden lines into account. int wxScintilla::VisibleFromDocLine (int line) { return SendMsg (SCI_VISIBLEFROMDOCLINE, line, 0); } // Find the document line of a display line taking hidden lines into account. int wxScintilla::DocLineFromVisible (int lineDisplay) { return SendMsg (SCI_DOCLINEFROMVISIBLE, lineDisplay, 0); } // The number of display lines needed to wrap a document line int wxScintilla::WrapCount (int line) { return SendMsg (SCI_WRAPCOUNT, line, 0); } // Set the fold level of a line. // This encodes an integer level along with flags indicating whether the // line is a header and whether it is effectively white space. void wxScintilla::SetFoldLevel (int line, int level) { SendMsg (SCI_SETFOLDLEVEL, line, level); } // Retrieve the fold level of a line. int wxScintilla::GetFoldLevel (int line) { return SendMsg (SCI_GETFOLDLEVEL, line, 0); } // Find the last child line of a header line. int wxScintilla::GetLastChild (int line, int level) { return SendMsg (SCI_GETLASTCHILD, line, level); } // Find the parent line of a child line. int wxScintilla::GetFoldParent (int line) { return SendMsg (SCI_GETFOLDPARENT, line, 0); } // Make a range of lines visible. void wxScintilla::ShowLines (int lineStart, int lineEnd) { SendMsg (SCI_SHOWLINES, lineStart, lineEnd); } // Make a range of lines invisible. void wxScintilla::HideLines (int lineStart, int lineEnd) { SendMsg (SCI_HIDELINES, lineStart, lineEnd); } // Is a line visible? bool wxScintilla::GetLineVisible (int line) { return SendMsg (SCI_GETLINEVISIBLE, line, 0) != 0; } // Show the children of a header line. void wxScintilla::SetFoldExpanded (int line, bool expanded) { SendMsg (SCI_SETFOLDEXPANDED, line, expanded); } // Is a header line expanded? bool wxScintilla::GetFoldExpanded (int line) { return SendMsg (SCI_GETFOLDEXPANDED, line, 0) != 0; } // Switch a header line between expanded and contracted. void wxScintilla::ToggleFold (int line) { SendMsg (SCI_TOGGLEFOLD, line, 0); } // Ensure a particular line is visible by expanding any header line hiding it. void wxScintilla::EnsureVisible (int line) { SendMsg (SCI_ENSUREVISIBLE, line, 0); } // Set some style options for folding. void wxScintilla::SetFoldFlags (int flags) { SendMsg(SCI_SETFOLDFLAGS, flags, 0); } // Ensure a particular line is visible by expanding any header line hiding it. // Use the currently set visibility policy to determine which range to display. void wxScintilla::EnsureVisibleEnforcePolicy (int line) { SendMsg (SCI_ENSUREVISIBLEENFORCEPOLICY, line, 0); } // Sets whether a tab pressed when caret is within indentation indents. void wxScintilla::SetTabIndents (bool tabIndents) { SendMsg (SCI_SETTABINDENTS, tabIndents, 0); } // Does a tab pressed when caret is within indentation indent? bool wxScintilla::GetTabIndents() { return SendMsg (SCI_GETTABINDENTS, 0, 0) != 0; } // Sets whether a backspace pressed when caret is within indentation unindents. void wxScintilla::SetBackSpaceUnIndents (bool bsUnIndents) { SendMsg (SCI_SETBACKSPACEUNINDENTS, bsUnIndents, 0); } // Does a backspace pressed when caret is within indentation unindent? bool wxScintilla::GetBackSpaceUnIndents() { return SendMsg (SCI_GETBACKSPACEUNINDENTS, 0, 0) != 0; } // Sets the time the mouse must sit still to generate a mouse dwell event. void wxScintilla::SetMouseDwellTime (int periodMilliseconds) { SendMsg (SCI_SETMOUSEDWELLTIME, periodMilliseconds, 0); } // Retrieve the time the mouse must sit still to generate a mouse dwell event. int wxScintilla::GetMouseDwellTime() { return SendMsg (SCI_GETMOUSEDWELLTIME, 0, 0); } // Get position of start of word. int wxScintilla::WordStartPosition (int pos, bool onlyWordCharacters) { return SendMsg (SCI_WORDSTARTPOSITION, pos, onlyWordCharacters); } // Get position of end of word. int wxScintilla::WordEndPosition (int pos, bool onlyWordCharacters) { return SendMsg (SCI_WORDENDPOSITION, pos, onlyWordCharacters); } // Sets whether text is word wrapped. void wxScintilla::SetWrapMode (int mode) { SendMsg (SCI_SETWRAPMODE, mode, 0); } // Retrieve whether text is word wrapped. int wxScintilla::GetWrapMode() { return SendMsg (SCI_GETWRAPMODE, 0, 0); } // Set the display mode of visual flags for wrapped lines. void wxScintilla::SetWrapVisualFlags (int wrapVisualFlags) { SendMsg (SCI_SETWRAPVISUALFLAGS, wrapVisualFlags, 0); } // Retrive the display mode of visual flags for wrapped lines. int wxScintilla::GetWrapVisualFlags() { return SendMsg (SCI_GETWRAPVISUALFLAGS, 0, 0); } // Set the location of visual flags for wrapped lines. void wxScintilla::SetWrapVisualFlagsLocation (int wrapVisualFlagsLocation) { SendMsg (SCI_SETWRAPVISUALFLAGSLOCATION, wrapVisualFlagsLocation, 0); } // Retrive the location of visual flags for wrapped lines. int wxScintilla::GetWrapVisualFlagsLocation() { return SendMsg (SCI_GETWRAPVISUALFLAGSLOCATION, 0, 0); } // Set the start indent for wrapped lines. void wxScintilla::SetWrapStartIndent (int indent) { SendMsg (SCI_SETWRAPSTARTINDENT, indent, 0); } // Retrive the start indent for wrapped lines. int wxScintilla::GetWrapStartIndent() { return SendMsg (SCI_GETWRAPSTARTINDENT, 0, 0); } // Sets the degree of caching of layout information. void wxScintilla::SetLayoutCache (int mode) { SendMsg (SCI_SETLAYOUTCACHE, mode, 0); } // Retrieve the degree of caching of layout information. int wxScintilla::GetLayoutCache() { return SendMsg (SCI_GETLAYOUTCACHE, 0, 0); } // Sets the document width assumed for scrolling. void wxScintilla::SetScrollWidth (int pixels) { SendMsg (SCI_SETSCROLLWIDTH, pixels, 0); } // Retrieve the document width assumed for scrolling. int wxScintilla::GetScrollWidth() { return SendMsg (SCI_GETSCROLLWIDTH, 0, 0); } // Measure the pixel width of some text in a particular style. // NUL terminated text argument. // Does not handle tab or control characters. int wxScintilla::TextWidth (int style, const wxString& text) { return SendMsg (SCI_TEXTWIDTH, style, (long)(const char*)wx2sci(text)); } // Sets the scroll range so that maximum scroll position has // the last line at the bottom of the view (default). // Setting this to false allows scrolling one page below the last line. void wxScintilla::SetEndAtLastLine (bool endAtLastLine) { SendMsg (SCI_SETENDATLASTLINE, endAtLastLine, 0); } // Retrieve whether the maximum scroll position has the last // line at the bottom of the view. bool wxScintilla::GetEndAtLastLine() { return SendMsg (SCI_GETENDATLASTLINE, 0, 0) != 0; } // Retrieve the height of a particular line of text in pixels. int wxScintilla::TextHeight (int line) { return SendMsg (SCI_TEXTHEIGHT, line, 0); } // Show or hide the vertical scroll bar. void wxScintilla::SetUseVerticalScrollBar (bool show) { SendMsg (SCI_SETVSCROLLBAR, show, 0); } // Is the vertical scroll bar visible? bool wxScintilla::GetUseVerticalScrollBar() { return SendMsg (SCI_GETVSCROLLBAR, 0, 0) != 0; } // Add text to the document at current position. void wxScintilla::AppendText (const wxString& text) { wxWX2MBbuf buf = (wxWX2MBbuf)wx2sci(text); SendMsg (SCI_APPENDTEXT, strlen(buf), (long)(const char*)buf); } // Append a string to the end of the document without changing the selection. void wxScintilla::AppendText (int length, const wxString& text) { SendMsg (SCI_APPENDTEXT, length, (long)(const char*)wx2sci(text)); } // Is drawing done in two phases with backgrounds drawn before foregrounds? bool wxScintilla::GetTwoPhaseDraw() { return SendMsg (SCI_GETTWOPHASEDRAW, 0, 0) != 0; } // In twoPhaseDraw mode, drawing is performed in two phases, first the background // and then the foreground. This avoids chopping off characters that overlap the next run. void wxScintilla::SetTwoPhaseDraw (bool twoPhase) { SendMsg (SCI_SETTWOPHASEDRAW, twoPhase, 0); } // Make the target range start and end be the same as the selection range start and end. void wxScintilla::TargetFromSelection() { SendMsg (SCI_TARGETFROMSELECTION, 0, 0); } // Join the lines in the target. void wxScintilla::LinesJoin() { SendMsg (SCI_LINESJOIN, 0, 0); } // Split the lines in the target into lines that are less wide than pixel where possible. void wxScintilla::LinesSplit (int pixels) { SendMsg (SCI_LINESSPLIT, pixels, 0); } // Set the colours used as a chequerboard pattern in the fold margin void wxScintilla::SetFoldMarginColour (bool useSetting, const wxColour& back) { SendMsg (SCI_SETFOLDMARGINCOLOUR, useSetting, wxColourAsLong(back)); } void wxScintilla::SetFoldMarginHiColour (bool useSetting, const wxColour& fore) { SendMsg (SCI_SETFOLDMARGINHICOLOUR, useSetting, wxColourAsLong(fore)); } // Move caret down one line. void wxScintilla::LineDown() { SendMsg (SCI_LINEDOWN, 0, 0); } // Move caret down one line extending selection to new caret position. void wxScintilla::LineDownExtend() { SendMsg (SCI_LINEDOWNEXTEND, 0, 0); } // Move caret up one line. void wxScintilla::LineUp() { SendMsg (SCI_LINEUP, 0, 0); } // Move caret up one line extending selection to new caret position. void wxScintilla::LineUpExtend() { SendMsg (SCI_LINEUPEXTEND, 0, 0); } // Move caret left one character. void wxScintilla::CharLeft() { SendMsg (SCI_CHARLEFT, 0, 0); } // Move caret left one character extending selection to new caret position. void wxScintilla::CharLeftExtend() { SendMsg (SCI_CHARLEFTEXTEND, 0, 0); } // Move caret right one character. void wxScintilla::CharRight() { SendMsg (SCI_CHARRIGHT, 0, 0); } // Move caret right one character extending selection to new caret position. void wxScintilla::CharRightExtend() { SendMsg (SCI_CHARRIGHTEXTEND, 0, 0); } // Move caret left one word. void wxScintilla::WordLeft() { SendMsg (SCI_WORDLEFT, 0, 0); } // Move caret left one word extending selection to new caret position. void wxScintilla::WordLeftExtend() { SendMsg (SCI_WORDLEFTEXTEND, 0, 0); } // Move caret right one word. void wxScintilla::WordRight() { SendMsg (SCI_WORDRIGHT, 0, 0); } // Move caret right one word extending selection to new caret position. void wxScintilla::WordRightExtend() { SendMsg (SCI_WORDRIGHTEXTEND, 0, 0); } // Move caret to first position on line. void wxScintilla::Home() { SendMsg (SCI_HOME, 0, 0); } // Move caret to first position on line extending selection to new caret position. void wxScintilla::HomeExtend() { SendMsg (SCI_HOMEEXTEND, 0, 0); } // Move caret to last position on line. void wxScintilla::LineEnd() { SendMsg (SCI_LINEEND, 0, 0); } // Move caret to last position on line extending selection to new caret position. void wxScintilla::LineEndExtend() { SendMsg (SCI_LINEENDEXTEND, 0, 0); } // Move caret to first position in document. void wxScintilla::DocumentStart() { SendMsg (SCI_DOCUMENTSTART, 0, 0); } // Move caret to first position in document extending selection to new caret position. void wxScintilla::DocumentStartExtend() { SendMsg (SCI_DOCUMENTSTARTEXTEND, 0, 0); } // Move caret to last position in document. void wxScintilla::DocumentEnd() { SendMsg (SCI_DOCUMENTEND, 0, 0); } // Move caret to last position in document extending selection to new caret position. void wxScintilla::DocumentEndExtend() { SendMsg (SCI_DOCUMENTENDEXTEND, 0, 0); } // Move caret one page up. void wxScintilla::PageUp() { SendMsg (SCI_PAGEUP, 0, 0); } // Move caret one page up extending selection to new caret position. void wxScintilla::PageUpExtend() { SendMsg (SCI_PAGEUPEXTEND, 0, 0); } // Move caret one page down. void wxScintilla::PageDown() { SendMsg (SCI_PAGEDOWN, 0, 0); } // Move caret one page down extending selection to new caret position. void wxScintilla::PageDownExtend() { SendMsg (SCI_PAGEDOWNEXTEND, 0, 0); } // Switch from insert to overtype mode or the reverse. void wxScintilla::EditToggleOvertype() { SendMsg (SCI_EDITTOGGLEOVERTYPE, 0, 0); } // Cancel any modes such as call tip or auto-completion list display. void wxScintilla::Cancel() { SendMsg (SCI_CANCEL, 0, 0); } // Delete the selection or if no selection, the character before the caret. void wxScintilla::DeleteBack() { SendMsg (SCI_DELETEBACK, 0, 0); } // If selection is empty or all on one line replace the selection with a tab character. // If more than one line selected, indent the lines. void wxScintilla::Tab() { SendMsg (SCI_TAB, 0, 0); } // Dedent the selected lines. void wxScintilla::BackTab() { SendMsg (SCI_BACKTAB, 0, 0); } // Insert a new line, may use a CRLF, CR or LF depending on EOL mode. void wxScintilla::NewLine() { SendMsg (SCI_NEWLINE, 0, 0); } // Insert a Form Feed character. void wxScintilla::FormFeed() { SendMsg (SCI_FORMFEED, 0, 0); } // Move caret to before first visible character on line. // If already there move to first character on line. void wxScintilla::VCHome() { SendMsg (SCI_VCHOME, 0, 0); } // Like VCHome but extending selection to new caret position. void wxScintilla::VCHomeExtend() { SendMsg (SCI_VCHOMEEXTEND, 0, 0); } // Magnify the displayed text by increasing the sizes by 1 point. void wxScintilla::ZoomIn() { SendMsg (SCI_ZOOMIN, 0, 0); } // Make the displayed text smaller by decreasing the sizes by 1 point. void wxScintilla::ZoomOut() { SendMsg (SCI_ZOOMOUT, 0, 0); } // Delete the word to the left of the caret. void wxScintilla::DelWordLeft() { SendMsg (SCI_DELWORDLEFT, 0, 0); } // Delete the word to the right of the caret. void wxScintilla::DelWordRight() { SendMsg (SCI_DELWORDRIGHT, 0, 0); } // Cut the line containing the caret. void wxScintilla::LineCut() { SendMsg (SCI_LINECUT, 0, 0); } // Delete the line containing the caret. void wxScintilla::LineDelete() { SendMsg (SCI_LINEDELETE, 0, 0); } // Switch the current line with the previous. void wxScintilla::LineTranspose() { SendMsg (SCI_LINETRANSPOSE, 0, 0); } // Duplicate the current line. void wxScintilla::LineDuplicate() { SendMsg (SCI_LINEDUPLICATE, 0, 0); } // Transform the selection to lower case. void wxScintilla::LowerCase() { SendMsg (SCI_LOWERCASE, 0, 0); } // Transform the selection to upper case. void wxScintilla::UpperCase() { SendMsg (SCI_UPPERCASE, 0, 0); } // Scroll the document down, keeping the caret visible. void wxScintilla::LineScrollDown() { SendMsg (SCI_LINESCROLLDOWN, 0, 0); } // Scroll the document up, keeping the caret visible. void wxScintilla::LineScrollUp() { SendMsg (SCI_LINESCROLLUP, 0, 0); } // Delete the selection or if no selection, the character before the caret. // Will not delete the character before at the start of a line. void wxScintilla::DeleteBackNotLine() { SendMsg (SCI_DELETEBACKNOTLINE, 0, 0); } // Move caret to first position on display line. void wxScintilla::HomeDisplay() { SendMsg (SCI_HOMEDISPLAY, 0, 0); } // Move caret to first position on display line extending selection to // new caret position. void wxScintilla::HomeDisplayExtend() { SendMsg (SCI_HOMEDISPLAYEXTEND, 0, 0); } // Move caret to last position on display line. void wxScintilla::LineEndDisplay() { SendMsg (SCI_LINEENDDISPLAY, 0, 0); } // Move caret to last position on display line extending selection to new // caret position. void wxScintilla::LineEndDisplayExtend() { SendMsg (SCI_LINEENDDISPLAYEXTEND, 0, 0); } // These are like their namesakes Home(Extend)?, LineEnd(Extend)?, VCHome(Extend)? // except they behave differently when word-wrap is enabled: // They go first to the start / end of the display line, like (Home|LineEnd)Display // The difference is that, the cursor is already at the point, it goes on to the start // or end of the document line, as appropriate for (Home|LineEnd|VCHome)(Extend)?. void wxScintilla::HomeWrap() { SendMsg (SCI_HOMEWRAP, 0, 0); } void wxScintilla::HomeWrapExtend() { SendMsg (SCI_HOMEWRAPEXTEND, 0, 0); } void wxScintilla::LineEndWrap() { SendMsg (SCI_LINEENDWRAP, 0, 0); } void wxScintilla::LineEndWrapExtend() { SendMsg (SCI_LINEENDWRAPEXTEND, 0, 0); } void wxScintilla::VCHomeWrap() { SendMsg (SCI_VCHOMEWRAP, 0, 0); } void wxScintilla::VCHomeWrapExtend() { SendMsg (SCI_VCHOMEWRAPEXTEND, 0, 0); } // Copy the line containing the caret. void wxScintilla::LineCopy() { SendMsg (SCI_LINECOPY, 0, 0); } // Move the caret inside current view if it's not there already. void wxScintilla::MoveCaretInsideView() { SendMsg (SCI_MOVECARETINSIDEVIEW, 0, 0); } // How many characters are on a line, not including end of line characters? int wxScintilla::LineLength (int line) { return SendMsg (SCI_LINELENGTH, line, 0); } // Highlight the characters at two positions. void wxScintilla::BraceHighlight (int pos1, int pos2) { SendMsg (SCI_BRACEHIGHLIGHT, pos1, pos2); } // Highlight the character at a position indicating there is no matching brace. void wxScintilla::BraceBadLight (int pos) { SendMsg (SCI_BRACEBADLIGHT, pos, 0); } // Find the position of a matching brace or INVALID_POSITION if no match. int wxScintilla::BraceMatch (int pos) { return SendMsg (SCI_BRACEMATCH, pos, 0); } // Are the end of line characters visible? bool wxScintilla::GetViewEOL() { return SendMsg (SCI_GETVIEWEOL, 0, 0) != 0; } // Make the end of line characters visible or invisible. void wxScintilla::SetViewEOL (bool visible) { SendMsg (SCI_SETVIEWEOL, visible, 0); } // Retrieve a pointer to the document object. void* wxScintilla::GetDocPointer() { return (void*)SendMsg (SCI_GETDOCPOINTER); } // Change the document object used. void wxScintilla::SetDocPointer (void* docPointer) { SendMsg (SCI_SETDOCPOINTER, 0, (long)docPointer); } // Set which document modification events are sent to the container. void wxScintilla::SetModEventMask (int mask) { SendMsg (SCI_SETMODEVENTMASK, mask, 0); } // Retrieve the column number which text should be kept within. int wxScintilla::GetEdgeColumn() { return SendMsg (SCI_GETEDGECOLUMN, 0, 0); } // Set the column number of the edge. // If text goes past the edge then it is highlighted. void wxScintilla::SetEdgeColumn (int column) { SendMsg (SCI_SETEDGECOLUMN, column, 0); } // Retrieve the edge highlight mode. int wxScintilla::GetEdgeMode() { return SendMsg (SCI_GETEDGEMODE, 0, 0); } // The edge may be displayed by a line (EDGE_LINE) or by highlighting text that // goes beyond it (EDGE_BACKGROUND) or not displayed at all (EDGE_NONE). void wxScintilla::SetEdgeMode (int mode) { SendMsg (SCI_SETEDGEMODE, mode, 0); } // Retrieve the colour used in edge indication. wxColour wxScintilla::GetEdgeColour() { long colour = SendMsg (SCI_GETEDGECOLOUR, 0, 0); return wxColourFromLong(colour); } // Change the colour used in edge indication. void wxScintilla::SetEdgeColour (const wxColour& colour) { SendMsg (SCI_SETEDGECOLOUR, wxColourAsLong(colour), 0); } // Sets the current caret position to be the search anchor. void wxScintilla::SearchAnchor() { SendMsg (SCI_SEARCHANCHOR, 0, 0); } // Find some text starting at the search anchor. // Does not ensure the selection is visible. int wxScintilla::SearchNext (int flags, const wxString& text) { return SendMsg (SCI_SEARCHNEXT, flags, (long)(const char*)wx2sci(text)); } // Find some text starting at the search anchor and moving backwards. // Does not ensure the selection is visible. int wxScintilla::SearchPrev (int flags, const wxString& text) { return SendMsg (SCI_SEARCHPREV, flags, (long)(const char*)wx2sci(text)); } // Retrieves the number of lines completely visible. int wxScintilla::LinesOnScreen() { return SendMsg (SCI_LINESONSCREEN, 0, 0); } // Set whether a pop up menu is displayed automatically when the user presses // the wrong mouse button. void wxScintilla::UsePopUp (bool allowPopUp) { SendMsg (SCI_USEPOPUP, allowPopUp, 0); } // Is the selection rectangular? The alternative is the more common stream selection. bool wxScintilla::SelectionIsRectangle() { return SendMsg (SCI_SELECTIONISRECTANGLE, 0, 0) != 0; } // Set the zoom level. This number of points is added to the size of all fonts. // It may be positive to magnify or negative to reduce. void wxScintilla::SetZoom (int zoom) { SendMsg (SCI_SETZOOM, zoom, 0); } // Retrieve the zoom level. int wxScintilla::GetZoom() { return SendMsg (SCI_GETZOOM, 0, 0); } // Create a new document object. // Starts with reference count of 1 and not selected into editor. void* wxScintilla::CreateDocument() { return (void*)SendMsg (SCI_CREATEDOCUMENT, 0, 0); } // Extend life of document. void wxScintilla::AddRefDocument (void* docPointer) { SendMsg (SCI_ADDREFDOCUMENT, 0, (long)docPointer); } // Release a reference to the document, deleting document if it fades to black. void wxScintilla::ReleaseDocument (void* docPointer) { SendMsg (SCI_RELEASEDOCUMENT, 0, (long)docPointer); } // Get which document modification events are sent to the container. int wxScintilla::GetModEventMask() { return SendMsg (SCI_GETMODEVENTMASK, 0, 0); } // Change internal focus flag. void wxScintilla::SetSCIFocus (bool focus) { SendMsg (SCI_SETFOCUS, focus, 0); } // Get internal focus flag. bool wxScintilla::GetSCIFocus() { return SendMsg (SCI_GETFOCUS, 0, 0) != 0; } // Change error status - 0 = OK. void wxScintilla::SetStatus (int status) { SendMsg (SCI_SETSTATUS, status, 0); } // Get error status. int wxScintilla::GetStatus() { return SendMsg (SCI_GETSTATUS, 0, 0); } // Set whether the mouse is captured when its button is pressed. void wxScintilla::SetMouseDownCaptures (bool captures) { SendMsg (SCI_SETMOUSEDOWNCAPTURES, captures, 0); } // Get whether mouse gets captured. bool wxScintilla::GetMouseDownCaptures() { return SendMsg (SCI_GETMOUSEDOWNCAPTURES, 0, 0) != 0; } // Sets the cursor to one of the SC_CURSOR* values. void wxScintilla::SetCursorType (int cursorType) { SendMsg(SCI_SETCURSOR, cursorType, 0); } // Get cursor type. int wxScintilla::GetCursorType() { return SendMsg (SCI_GETCURSOR, 0, 0); } // Change the way control characters are displayed: // If symbol is < 32, keep the drawn way, else, use the given character. void wxScintilla::SetControlCharSymbol (int symbol) { SendMsg (SCI_SETCONTROLCHARSYMBOL, symbol, 0); } // Get the way control characters are displayed. int wxScintilla::GetControlCharSymbol() { return SendMsg (SCI_GETCONTROLCHARSYMBOL, 0, 0); } // Move to the previous change in capitalisation. void wxScintilla::WordPartLeft() { SendMsg (SCI_WORDPARTLEFT, 0, 0); } // Move to the previous change in capitalisation extending selection // to new caret position. void wxScintilla::WordPartLeftExtend() { SendMsg (SCI_WORDPARTLEFTEXTEND, 0, 0); } // Move to the change next in capitalisation. void wxScintilla::WordPartRight() { SendMsg (SCI_WORDPARTRIGHT, 0, 0); } // Move to the next change in capitalisation extending selection // to new caret position. void wxScintilla::WordPartRightExtend() { SendMsg (SCI_WORDPARTRIGHTEXTEND, 0, 0); } // Set the way the display area is determined when a particular line // is to be moved to by Find, FindNext, GotoLine, etc. void wxScintilla::SetVisiblePolicy (int visiblePolicy, int visibleSlop) { SendMsg (SCI_SETVISIBLEPOLICY, visiblePolicy, visibleSlop); } // Delete back from the current position to the start of the line. void wxScintilla::DelLineLeft() { SendMsg (SCI_DELLINELEFT, 0, 0); } // Delete forwards from the current position to the end of the line. void wxScintilla::DelLineRight() { SendMsg (SCI_DELLINERIGHT, 0, 0); } // Get and Set the xOffset (ie, horizonal scroll position). void wxScintilla::SetXOffset (int newOffset) { SendMsg (SCI_SETXOFFSET, newOffset, 0); } int wxScintilla::GetXOffset() { return SendMsg (SCI_GETXOFFSET, 0, 0); } // Set the last x chosen value to be the caret x position. void wxScintilla::ChooseCaretX() { SendMsg (SCI_CHOOSECARETX, 0, 0); } // Set the focus to this Scintilla widget (GTK+ specific) // Grab focus (SCI_GRABFOCUS) not supported // Set the way the caret is kept visible when going sideway. // The exclusion zone is given in pixels. void wxScintilla::SetXCaretPolicy (int caretPolicy, int caretSlop) { SendMsg (SCI_SETXCARETPOLICY, caretPolicy, caretSlop); } // Set the way the line the caret is on is kept visible. // The exclusion zone is given in lines. void wxScintilla::SetYCaretPolicy (int caretPolicy, int caretSlop) { SendMsg (SCI_SETYCARETPOLICY, caretPolicy, caretSlop); } // Set printing to line wrapped (SC_WRAP_WORD) or not line wrapped (SC_WRAP_NONE). void wxScintilla::SetPrintWrapMode (int mode) { SendMsg (SCI_SETPRINTWRAPMODE, mode, 0); } // Is printing line wrapped? int wxScintilla::GetPrintWrapMode() { return SendMsg (SCI_GETPRINTWRAPMODE, 0, 0); } // Set a fore colour for active hotspots. void wxScintilla::SetHotspotActiveForeground (bool useSetting, const wxColour& fore) { SendMsg (SCI_SETHOTSPOTACTIVEFORE, useSetting, wxColourAsLong(fore)); } // Set a back colour for active hotspots. void wxScintilla::SetHotspotActiveBackground (bool useSetting, const wxColour& back) { SendMsg (SCI_SETHOTSPOTACTIVEBACK, useSetting, wxColourAsLong(back)); } // Enable / Disable underlining active hotspots. void wxScintilla::SetHotspotActiveUnderline (bool underline) { SendMsg (SCI_SETHOTSPOTACTIVEUNDERLINE, underline, 0); } // Limit hotspots to single line so hotspots on two lines don't merge. void wxScintilla::SetHotspotSingleLine (bool singleLine) { SendMsg(SCI_SETHOTSPOTSINGLELINE, singleLine, 0); } // Move caret between paragraphs (delimited by empty lines). void wxScintilla::ParaDown() { SendMsg (SCI_PARADOWN, 0, 0); } void wxScintilla::ParaDownExtend() { SendMsg (SCI_PARADOWNEXTEND, 0, 0); } void wxScintilla::ParaUp() { SendMsg (SCI_PARAUP, 0, 0); } void wxScintilla::ParaUpExtend() { SendMsg (SCI_PARAUPEXTEND, 0, 0); } // Given a valid document position, return the previous position taking code // page into account. Returns 0 if passed 0. int wxScintilla::PositionBefore (int pos) { return SendMsg (SCI_POSITIONBEFORE, pos, 0); } // Given a valid document position, return the next position taking code // page into account. Maximum value returned is the last position in the document. int wxScintilla::PositionAfter (int pos) { return SendMsg (SCI_POSITIONAFTER, pos, 0); } // Copy a range of text to the clipboard. Positions are clipped into the document. void wxScintilla::CopyRange (int startPos, int endPos) { SendMsg (SCI_COPYRANGE, startPos, endPos); } // Copy argument text to the clipboard. void wxScintilla::CopyText (int length, const wxString& text) { SendMsg (SCI_COPYTEXT, length, (long)(const char*)wx2sci(text)); } // Set the selection mode to stream (SC_SEL_STREAM) or rectangular (SC_SEL_RECTANGLE) or // by lines (SC_SEL_LINES). void wxScintilla::SetSelectionMode (int mode) { SendMsg (SCI_SETSELECTIONMODE, mode, 0); } // Get the mode of the current selection. int wxScintilla::GetSelectionMode() { return SendMsg (SCI_GETSELECTIONMODE, 0, 0); } // Retrieve the position of the start of the selection at the given line (INVALID_POSITION if no selection on this line). int wxScintilla::GetLineSelStartPosition (int line) { return SendMsg (SCI_GETLINESELSTARTPOSITION, line, 0); } // Retrieve the position of the end of the selection at the given line (INVALID_POSITION if no selection on this line). int wxScintilla::GetLineSelEndPosition (int line) { return SendMsg (SCI_GETLINESELENDPOSITION, line, 0); } // Move caret down one line, extending rectangular selection to new caret position. void wxScintilla::LineDownRectExtend() { SendMsg (SCI_LINEDOWNRECTEXTEND, 0, 0); } // Move caret up one line, extending rectangular selection to new caret position. void wxScintilla::LineUpRectExtend() { SendMsg (SCI_LINEUPRECTEXTEND, 0, 0); } // Move caret left one character, extending rectangular selection to new caret position. void wxScintilla::CharLeftRectExtend() { SendMsg (SCI_CHARLEFTRECTEXTEND, 0, 0); } // Move caret right one character, extending rectangular selection to new caret position. void wxScintilla::CharRightRectExtend() { SendMsg (SCI_CHARRIGHTRECTEXTEND, 0, 0); } // Move caret to first position on line, extending rectangular selection to new caret position. void wxScintilla::HomeRectExtend() { SendMsg (SCI_HOMERECTEXTEND, 0, 0); } // Move caret to before first visible character on line. // If already there move to first character on line. // In either case, extend rectangular selection to new caret position. void wxScintilla::VCHomeRectExtend() { SendMsg (SCI_VCHOMERECTEXTEND, 0, 0); } // Move caret to last position on line, extending rectangular selection to new caret position. void wxScintilla::LineEndRectExtend() { SendMsg (SCI_LINEENDRECTEXTEND, 0, 0); } // Move caret one page up, extending rectangular selection to new caret position. void wxScintilla::PageUpRectExtend() { SendMsg (SCI_PAGEUPRECTEXTEND, 0, 0); } // Move caret one page down, extending rectangular selection to new caret position. void wxScintilla::PageDownRectExtend() { SendMsg (SCI_PAGEDOWNRECTEXTEND, 0, 0); } // Move caret to top of page, or one page up if already at top of page. void wxScintilla::StutteredPageUp() { SendMsg (SCI_STUTTEREDPAGEUP, 0, 0); } // Move caret to top of page, or one page up if already at top of page, extending selection to new caret position. void wxScintilla::StutteredPageUpExtend() { SendMsg (SCI_STUTTEREDPAGEUPEXTEND, 0, 0); } // Move caret to bottom of page, or one page down if already at bottom of page. void wxScintilla::StutteredPageDown() { SendMsg (SCI_STUTTEREDPAGEDOWN, 0, 0); } // Move caret to bottom of page, or one page down if already at bottom of page, extending selection to new caret position. void wxScintilla::StutteredPageDownExtend() { SendMsg (SCI_STUTTEREDPAGEDOWNEXTEND, 0, 0); } // Move caret left one word, position cursor at end of word. void wxScintilla::WordLeftEnd() { SendMsg (SCI_WORDLEFTEND, 0, 0); } // Move caret left one word, position cursor at end of word, extending selection to new caret position. void wxScintilla::WordLeftEndExtend() { SendMsg (SCI_WORDLEFTENDEXTEND, 0, 0); } // Move caret right one word, position cursor at end of word. void wxScintilla::WordRightEnd() { SendMsg (SCI_WORDRIGHTEND, 0, 0); } // Move caret right one word, position cursor at end of word, extending selection to new caret position. void wxScintilla::WordRightEndExtend() { SendMsg (SCI_WORDRIGHTENDEXTEND, 0, 0); } // Set the set of characters making up whitespace for when moving or selecting by word. // Should be called after SetWordChars. void wxScintilla::SetWhitespaceChars (const wxString& characters) { SendMsg (SCI_SETWHITESPACECHARS, 0, (long)(const char*)wx2sci(characters)); } // Reset the set of characters for whitespace and word characters to the defaults. void wxScintilla::SetCharsDefault() { SendMsg (SCI_SETCHARSDEFAULT, 0, 0); } // Get currently selected item position in the auto-completion list int wxScintilla::AutoCompGetCurrent() { return SendMsg (SCI_AUTOCGETCURRENT, 0, 0); } // Enlarge the document to a particular size of text bytes. void wxScintilla::Allocate (int bytes) { SendMsg (SCI_ALLOCATE, bytes, 0); } // Target as UTF8 (SCI_TARGETASUTF8) not supported // Set lenght for encode (SCI_SETLENGTHFORENCODE) not supported // Set endoce from UTF8 (SCI_ENCODEDFROMUTF8) not supported // Returns the position of a column on a line taking the width of tabs into account. int wxScintilla::FindColumn (int line, int column) { return SendMsg (SCI_ENCODEDFROMUTF8, line, column); } // Can the caret preferred x position only be changed by explicit movement commands? bool wxScintilla::GetCaretSticky () { return SendMsg (SCI_GETCARETSTICKY, 0, 0) != 0; } // Stop the caret preferred x position changing when the user types. void wxScintilla::SetCaretSticky (bool useCaretStickyBehaviour) { SendMsg (SCI_SETCARETSTICKY, useCaretStickyBehaviour, 0); } // Switch between sticky and non-sticky: meant to be bound to a key. void wxScintilla::ToggleCaretSticky () { SendMsg (SCI_TOGGLECARETSTICKY, 0, 0); } // Enable/Disable convert-on-paste for line endings. void wxScintilla::SetPasteConvertEndings (bool convert) { SendMsg (SCI_SETPASTECONVERTENDINGS, convert, 0); } // Get convert-on-paste setting. bool wxScintilla::GetPasteConvertEndings () { return SendMsg (SCI_GETPASTECONVERTENDINGS, 0, 0) != 0; } // Duplicate the selection. If selection empty duplicate the line containing the caret. void wxScintilla::SelectionDuplicate () { SendMsg (SCI_SELECTIONDUPLICATE, 0, 0); } // Get the background alpha of the caret line. int wxScintilla::GetCaretLineBackgroundAlpha () { return SendMsg (SCI_GETCARETLINEBACKALPHA, 0, 0); } // Set background alpha of the caret line. void wxScintilla::SetCaretLineBackgroundAlpha (int alpha) { SendMsg (SCI_SETCARETLINEBACKALPHA, alpha, 0); } // Start notifying the container of all key presses and commands. void wxScintilla::StartRecord () { SendMsg (SCI_STARTRECORD, 0, 0); } // Stop notifying the container of all key presses and commands. void wxScintilla::StopRecord () { SendMsg (SCI_STOPRECORD, 0, 0); } // Set the lexing language of the document. void wxScintilla::SetLexer (int lexer) { SendMsg (SCI_SETLEXER, lexer, 0); } // Retrieve the lexing language of the document. int wxScintilla::GetLexer () { return SendMsg (SCI_GETLEXER, 0, 0); } // Colourise a segment of the document using the current lexing language. void wxScintilla::Colourise (int startPos, int endPos) { SendMsg (SCI_COLOURISE, startPos, endPos); } // Set up a value that may be used by a lexer for some optional feature. void wxScintilla::SetProperty (const wxString& key, const wxString& value) { SendMsg (SCI_SETPROPERTY, (long)(const char*)wx2sci(key), (long)(const char*)wx2sci(value)); } // Retrieve a value that may be used by a lexer for some optional feature. wxString wxScintilla::GetProperty (const wxString& key) { int len = SendMsg (SCI_GETPROPERTY, (long)(const char*)wx2sci(key), (long)NULL); if (!len) return wxEmptyString; wxMemoryBuffer mbuf (len+1); char* buf = (char*)mbuf.GetWriteBuf (len+1); SendMsg (SCI_GETPROPERTY, (long)(const char*)wx2sci(key), (long)buf); mbuf.UngetWriteBuf (len); mbuf.AppendByte (0); return sci2wx(buf); } wxString wxScintilla::GetPropertyExpanded (const wxString& key) { int len = SendMsg (SCI_GETPROPERTYEXPANDED, (long)(const char*)wx2sci(key), (long)NULL); if (!len) return wxEmptyString; wxMemoryBuffer mbuf(len+1); char* buf = (char*)mbuf.GetWriteBuf(len+1); SendMsg (SCI_GETPROPERTYEXPANDED, (long)(const char*)wx2sci(key), (long)buf); mbuf.UngetWriteBuf (len); mbuf.AppendByte(0); return sci2wx(buf); } int wxScintilla::GetPropertyInt (const wxString& key) { return SendMsg (SCI_GETPROPERTYINT, (long)(const char*)wx2sci(key), 0); } // Retrieve the number of bits the current lexer needs for styling. int wxScintilla::GetStyleBitsNeeded () { return SendMsg (SCI_GETSTYLEBITSNEEDED, 0, 0); } // Set up the key words used by the lexer. void wxScintilla::SetKeyWords (int keywordSet, const wxString& keyWords) { SendMsg (SCI_SETKEYWORDS, keywordSet, (long)(const char*)wx2sci(keyWords)); } // Set the lexing language of the document based on string name. void wxScintilla::SetLexerLanguage (const wxString& language) { SendMsg (SCI_SETLEXERLANGUAGE, 0, (long)(const char*)wx2sci(language)); } // END of generated section //---------------------------------------------------------------------- // Returns the line number of the line with the caret. int wxScintilla::GetCurrentLine () { int line = LineFromPosition (GetCurrentPos()); return line; } // Extract style settings from a spec-string which is composed of one or // more of the following comma separated elements: // // bold turns on bold // italic turns on italics // fore:[name or #RRGGBB] sets the foreground colour // back:[name or #RRGGBB] sets the background colour // face:[facename] sets the font face name to use // size:[num] sets the font size in points // eol turns on eol filling // underline turns on underlining // void wxScintilla::StyleSetSpec (int styleNum, const wxString& spec) { wxStringTokenizer tkz (spec, _T(",")); while (tkz.HasMoreTokens()) { wxString token = tkz.GetNextToken(); wxString option = token.BeforeFirst (':'); wxString val = token.AfterFirst (':'); if (option == _T("bold")) StyleSetBold (styleNum, true); else if (option == _T("italic")) StyleSetItalic (styleNum, true); else if (option == _T("underline")) StyleSetUnderline (styleNum, true); else if (option == _T("eol")) StyleSetEOLFilled (styleNum, true); else if (option == _T("size")) { long points; if (val.ToLong (&points)) StyleSetSize (styleNum, points); } else if (option == _T("face")) StyleSetFaceName (styleNum, val); else if (option == _T("fore")) StyleSetForeground (styleNum, wxColourFromSpec (val)); else if (option == _T("back")) StyleSetBackground (styleNum, wxColourFromSpec (val)); } } // Set style size, face, bold, italic, and underline attributes from // a wxFont's attributes. void wxScintilla::StyleSetFont (int styleNum, const wxFont& font) { #ifdef __WXGTK__ // Ensure that the native font is initialized int x, y; GetTextExtent (_T("X"), &x, &y, NULL, NULL, &font); #endif int size = font.GetPointSize(); wxString faceName = font.GetFaceName(); bool bold = font.GetWeight() == wxBOLD; bool italic = font.GetStyle() == wxITALIC; bool under = font.GetUnderlined(); wxFontEncoding encoding = font.GetEncoding(); StyleSetFontAttr (styleNum, size, faceName, bold, italic, under, encoding); } // Set all font style attributes at once. void wxScintilla::StyleSetFontAttr (int styleNum, int size, const wxString& faceName, bool bold, bool italic, bool underline, wxFontEncoding encoding) { StyleSetSize (styleNum, size); StyleSetFaceName (styleNum, faceName); StyleSetBold (styleNum, bold); StyleSetItalic (styleNum, italic); StyleSetUnderline (styleNum, underline); StyleSetFontEncoding (styleNum, encoding); } // Set the character set of the font in a style. void wxScintilla::StyleSetCharacterSet (int style, int characterSet) { wxFontEncoding encoding; // Translate the Scintilla characterSet to a wxFontEncoding switch (characterSet) { default: case wxSCI_CHARSET_ANSI: case wxSCI_CHARSET_DEFAULT: encoding = wxFONTENCODING_DEFAULT; break; case wxSCI_CHARSET_BALTIC: encoding = wxFONTENCODING_ISO8859_13; break; case wxSCI_CHARSET_CHINESEBIG5: encoding = wxFONTENCODING_CP950; break; case wxSCI_CHARSET_EASTEUROPE: encoding = wxFONTENCODING_ISO8859_2; break; case wxSCI_CHARSET_GB2312: encoding = wxFONTENCODING_CP936; break; case wxSCI_CHARSET_GREEK: encoding = wxFONTENCODING_ISO8859_7; break; case wxSCI_CHARSET_HANGUL: encoding = wxFONTENCODING_CP949; break; case wxSCI_CHARSET_MAC: encoding = wxFONTENCODING_DEFAULT; break; case wxSCI_CHARSET_OEM: encoding = wxFONTENCODING_DEFAULT; break; case wxSCI_CHARSET_RUSSIAN: encoding = wxFONTENCODING_KOI8; break; case wxSCI_CHARSET_SHIFTJIS: encoding = wxFONTENCODING_CP932; break; case wxSCI_CHARSET_SYMBOL: encoding = wxFONTENCODING_DEFAULT; break; case wxSCI_CHARSET_TURKISH: encoding = wxFONTENCODING_ISO8859_9; break; case wxSCI_CHARSET_JOHAB: encoding = wxFONTENCODING_DEFAULT; break; case wxSCI_CHARSET_HEBREW: encoding = wxFONTENCODING_ISO8859_8; break; case wxSCI_CHARSET_ARABIC: encoding = wxFONTENCODING_ISO8859_6; break; case wxSCI_CHARSET_VIETNAMESE: encoding = wxFONTENCODING_DEFAULT; break; case wxSCI_CHARSET_THAI: encoding = wxFONTENCODING_ISO8859_11; break; case wxSCI_CHARSET_CYRILLIC: encoding = wxFONTENCODING_ISO8859_5; break; case wxSCI_CHARSET_8859_15: encoding = wxFONTENCODING_ISO8859_15; break; } // We just have Scintilla track the wxFontEncoding for us. It gets used // in Font::Create in PlatWX.cpp. We add one to the value so that the // effective wxFONENCODING_DEFAULT == SC_SHARSET_DEFAULT and so when // Scintilla internally uses SC_CHARSET_DEFAULT we will translate it back // to wxFONENCODING_DEFAULT in Font::Create. SendMsg (SCI_STYLESETCHARACTERSET, style, encoding+1); } // Set the font encoding to be used by a style. void wxScintilla::StyleSetFontEncoding(int style, wxFontEncoding encoding) { SendMsg (SCI_STYLESETCHARACTERSET, style, encoding+1); } // Perform one of the operations defined by the wxSCI_CMD_* constants. void wxScintilla::CmdKeyExecute (int cmd) { SendMsg (cmd); } // Set the left and right margin in the edit area, measured in pixels. void wxScintilla::SetMargins (int left, int right) { SetMarginLeft (left); SetMarginRight (right); } // Retrieve the start and end positions of the current selection. void wxScintilla::GetSelection (int* startPos, int* endPos) { if (startPos != NULL) *startPos = SendMsg (SCI_GETSELECTIONSTART); if (endPos != NULL) *endPos = SendMsg (SCI_GETSELECTIONEND); } // Scroll enough to make the given line visible void wxScintilla::ScrollToLine (int line) { m_swx->DoScrollToLine (line); } // Scroll enough to make the given column visible void wxScintilla::ScrollToColumn (int column) { m_swx->DoScrollToColumn (column); } bool wxScintilla::SaveFile (const wxString& filename) { wxFile file (filename, wxFile::write); if (!file.IsOpened()) return false; bool success = file.Write (GetText(), *wxConvCurrent); if (success) { SetSavePoint(); } return success; } bool wxScintilla::LoadFile (const wxString& filename) { wxFile file (filename, wxFile::read); if (!file.IsOpened()) return false; // get the file size (assume it is not huge file...) size_t len = file.Length(); bool success = false; if (len > 0) { #if wxUSE_UNICODE wxMemoryBuffer buffer (len+1); success = (file.Read (buffer.GetData(), len) == (int)len); if (success) { ((char*)buffer.GetData())[len] = 0; SetText (wxString (buffer, *wxConvCurrent, len)); } #else wxString buffer; success = (file.Read (wxStringBuffer (buffer, len), len) == (int)len); if (success) { SetText (buffer); } #endif }else if (len == 0) { success = true; // empty file is ok SetText (wxEmptyString); }else{ success = false; // len == wxInvalidOffset } if (success) { EmptyUndoBuffer(); SetSavePoint(); } return success; } #if SCI_USE_DND wxDragResult wxScintilla::DoDragOver (wxCoord x, wxCoord y, wxDragResult def) { return m_swx->DoDragOver (x, y, def); } bool wxScintilla::DoDropText (long x, long y, const wxString& data) { return m_swx->DoDropText (x, y, data); } wxDragResult wxScintilla::DoDragEnter (wxCoord x, wxCoord y, wxDragResult def) { return m_swx->DoDragOver (x, y, def); } void wxScintilla::DoDragLeave () { m_swx->DoDragLeave (); } #endif void wxScintilla::SetUseAntiAliasing (bool useAA) { m_swx->SetUseAntiAliasing (useAA); } bool wxScintilla::GetUseAntiAliasing() { return m_swx->GetUseAntiAliasing(); } #if wxCHECK_VERSION(2, 5, 0) // Raw text handling for UTF-8 void wxScintilla::AddTextRaw (const char* text) { SendMsg (SCI_ADDTEXT, strlen(text), (long)text); } void wxScintilla::InsertTextRaw (int pos, const char* text) { SendMsg (SCI_INSERTTEXT, pos, (long)text); } wxCharBuffer wxScintilla::GetCurLineRaw (int* linePos) { int len = LineLength (GetCurrentLine()); if (!len) { if (linePos) *linePos = 0; wxCharBuffer empty; return empty; } wxCharBuffer buf(len); int pos = SendMsg (SCI_GETCURLINE, len, (long)buf.data()); if (linePos) *linePos = pos; return buf; } wxCharBuffer wxScintilla::GetLineRaw (int line) { int len = LineLength (line); if (!len) { wxCharBuffer empty; return empty; } wxCharBuffer buf(len); SendMsg (SCI_GETLINE, line, (long)buf.data()); return buf; } wxCharBuffer wxScintilla::GetSelectedTextRaw() { int start; int end; GetSelection (&start, &end); int len = end - start; if (!len) { wxCharBuffer empty; return empty; } wxCharBuffer buf(len); SendMsg (SCI_GETSELTEXT, 0, (long)buf.data()); return buf; } wxCharBuffer wxScintilla::GetTextRangeRaw (int startPos, int endPos) { if (endPos < startPos) { int temp = startPos; startPos = endPos; endPos = temp; } int len = endPos - startPos; if (!len) { wxCharBuffer empty; return empty; } wxCharBuffer buf(len); TextRange tr; tr.lpstrText = buf.data(); tr.chrg.cpMin = startPos; tr.chrg.cpMax = endPos; SendMsg (SCI_GETTEXTRANGE, 0, (long)&tr); return buf; } void wxScintilla::SetTextRaw (const char* text) { SendMsg (SCI_SETTEXT, 0, (long)text); } wxCharBuffer wxScintilla::GetTextRaw() { int len = GetTextLength(); wxCharBuffer buf(len); SendMsg (SCI_GETTEXT, len, (long)buf.data()); return buf; } void wxScintilla::AppendTextRaw (const char* text) { SendMsg (SCI_APPENDTEXT, strlen(text), (long)text); } #endif //---------------------------------------------------------------------- // Event handlers void wxScintilla::OnPaint (wxPaintEvent& WXUNUSED(evt)) { wxPaintDC dc(this); m_swx->DoPaint (&dc, GetUpdateRegion().GetBox()); } void wxScintilla::OnScrollWin (wxScrollWinEvent& evt) { if (evt.GetOrientation() == wxHORIZONTAL) m_swx->DoHScroll (evt.GetEventType(), evt.GetPosition()); else m_swx->DoVScroll (evt.GetEventType(), evt.GetPosition()); } void wxScintilla::OnScroll (wxScrollEvent& evt) { wxScrollBar* sb = wxDynamicCast (evt.GetEventObject(), wxScrollBar); if (sb) { if (sb->IsVertical()) m_swx->DoVScroll (evt.GetEventType(), evt.GetPosition()); else m_swx->DoHScroll (evt.GetEventType(), evt.GetPosition()); } } void wxScintilla::OnSize (wxSizeEvent& WXUNUSED(evt)) { if (m_swx) { wxSize sz = GetClientSize(); m_swx->DoSize (sz.x, sz.y); } } void wxScintilla::OnMouseLeftDown (wxMouseEvent& evt) { SetFocus(); wxPoint pt = evt.GetPosition(); m_swx->DoLeftButtonDown (Point(pt.x, pt.y), m_stopWatch.Time(), evt.ShiftDown(), evt.ControlDown(), evt.AltDown()); } void wxScintilla::OnMouseMove (wxMouseEvent& evt) { wxPoint pt = evt.GetPosition(); m_swx->DoLeftButtonMove (Point(pt.x, pt.y)); } void wxScintilla::OnMouseLeftUp (wxMouseEvent& evt) { wxPoint pt = evt.GetPosition(); m_swx->DoLeftButtonUp (Point(pt.x, pt.y), m_stopWatch.Time(), evt.ControlDown()); } void wxScintilla::OnMouseRightUp (wxMouseEvent& evt) { wxPoint pt = evt.GetPosition(); m_swx->DoContextMenu (Point(pt.x, pt.y)); } void wxScintilla::OnMouseMiddleUp (wxMouseEvent& evt) { wxPoint pt = evt.GetPosition(); m_swx->DoMiddleButtonUp (Point(pt.x, pt.y)); } void wxScintilla::OnContextMenu (wxContextMenuEvent& evt) { wxPoint pt = evt.GetPosition(); ScreenToClient (&pt.x, &pt.y); /* Show context menu at event point if it's within the window, or at caret location if not */ wxHitTest ht = this->HitTest(pt); if (ht != wxHT_WINDOW_INSIDE) { pt = this->PointFromPosition (this->GetCurrentPos()); } m_swx->DoContextMenu (Point(pt.x, pt.y)); } void wxScintilla::OnMouseWheel (wxMouseEvent& evt) { m_swx->DoMouseWheel (evt.GetWheelRotation(), evt.GetWheelDelta(), evt.GetLinesPerAction(), evt.ControlDown(), evt.IsPageScroll()); } void wxScintilla::OnChar (wxKeyEvent& evt) { // On (some?) non-US keyboards the AltGr key is required to enter some // common characters. It comes to us as both Alt and Ctrl down so we need // to let the char through in that case, otherwise if only ctrl or only // alt let's skip it. bool ctrl = evt.ControlDown(); #ifdef __WXMAC__ // On the Mac the Alt key is just a modifier key (like Shift) so we need // to allow the char events to be processed when Alt is pressed. // TODO: Should we check MetaDown instead in this case? bool alt = false; #else bool alt = evt.AltDown(); #endif bool skip = ((ctrl || alt) && ! (ctrl && alt)); if (!m_lastKeyDownConsumed && !skip) { #if wxUSE_UNICODE #if !wxCHECK_VERSION(2, 5, 0) int key = evt.m_rawCode; #else int key = evt.GetUnicodeKey(); #endif bool keyOk = true; // if the unicode key code is not really a unicode character (it may // be a function key or etc., the platforms appear to always give us a // small value in this case) then fallback to the ascii key code but // don't do anything for function keys or etc. if (key <= 127) { key = evt.GetKeyCode(); keyOk = (key <= 127); } if (keyOk) { m_swx->DoAddChar (key); return; } #else int key = evt.GetKeyCode(); #if !wxCHECK_VERSION(2, 5, 0) if ( (key <= WXK_START || key > WXK_NUMPAD_DIVIDE)) { #else if ( (key <= WXK_START || key > WXK_COMMAND)) { #endif m_swx->DoAddChar (key); return; } #endif } evt.Skip(); } void wxScintilla::OnKeyDown (wxKeyEvent& evt) { int processed = m_swx->DoKeyDown (evt, &m_lastKeyDownConsumed); if (!processed && !m_lastKeyDownConsumed) { evt.Skip(); } } void wxScintilla::OnLoseFocus (wxFocusEvent& evt) { m_swx->DoLoseFocus(); evt.Skip(); } void wxScintilla::OnGainFocus (wxFocusEvent& evt) { m_swx->DoGainFocus(); evt.Skip(); } void wxScintilla::OnSysColourChanged (wxSysColourChangedEvent& WXUNUSED(evt)) { m_swx->DoSysColourChange(); } void wxScintilla::OnEraseBackground (wxEraseEvent& WXUNUSED(evt)) { // do nothing to help avoid flashing } void wxScintilla::OnMenu (wxCommandEvent& evt) { m_swx->DoCommand (evt.GetId()); } void wxScintilla::OnListBox (wxCommandEvent& WXUNUSED(evt)) { m_swx->DoOnListBox (); } void wxScintilla::OnIdle (wxIdleEvent& evt) { m_swx->DoOnIdle (evt); } wxSize wxScintilla::DoGetBestSize() const { // What would be the best size for a wxSintilla? // Just give a reasonable minimum until something else can be figured out. return wxSize(600,440); } //---------------------------------------------------------------------- // Turn notifications from Scintilla into events void wxScintilla::NotifyChange() { wxScintillaEvent evt (wxEVT_SCI_CHANGE, GetId()); evt.SetEventObject (this); GetEventHandler()->ProcessEvent(evt); } static void SetEventText (wxScintillaEvent& evt, const char* text, size_t length) { if(!text) return; evt.SetText(sci2wx(text, length)); } void wxScintilla::NotifyParent (SCNotification* _scn) { SCNotification& scn = *_scn; wxScintillaEvent evt (0, GetId()); evt.SetEventObject (this); evt.SetPosition (scn.position); evt.SetKey (scn.ch); evt.SetModifiers (scn.modifiers); switch (scn.nmhdr.code) { case SCN_STYLENEEDED: evt.SetEventType (wxEVT_SCI_STYLENEEDED); break; case SCN_CHARADDED: evt.SetEventType (wxEVT_SCI_CHARADDED); break; case SCN_SAVEPOINTREACHED: evt.SetEventType (wxEVT_SCI_SAVEPOINTREACHED); break; case SCN_SAVEPOINTLEFT: evt.SetEventType (wxEVT_SCI_SAVEPOINTLEFT); break; case SCN_MODIFYATTEMPTRO: evt.SetEventType (wxEVT_SCI_ROMODIFYATTEMPT); break; case SCN_KEY: evt.SetEventType (wxEVT_SCI_KEY); break; case SCN_DOUBLECLICK: evt.SetEventType (wxEVT_SCI_DOUBLECLICK); break; case SCN_UPDATEUI: evt.SetEventType (wxEVT_SCI_UPDATEUI); break; case SCN_MODIFIED: evt.SetEventType (wxEVT_SCI_MODIFIED); evt.SetModificationType (scn.modificationType); SetEventText (evt, scn.text, scn.length); evt.SetLength (scn.length); evt.SetLinesAdded (scn.linesAdded); evt.SetLine (scn.line); evt.SetFoldLevelNow (scn.foldLevelNow); evt.SetFoldLevelPrev (scn.foldLevelPrev); break; case SCN_MACRORECORD: evt.SetEventType (wxEVT_SCI_MACRORECORD); evt.SetMessage (scn.message); evt.SetWParam (scn.wParam); evt.SetLParam (scn.lParam); break; case SCN_MARGINCLICK: evt.SetEventType (wxEVT_SCI_MARGINCLICK); evt.SetMargin (scn.margin); break; case SCN_NEEDSHOWN: evt.SetEventType (wxEVT_SCI_NEEDSHOWN); evt.SetLength (scn.length); break; case SCN_PAINTED: evt.SetEventType (wxEVT_SCI_PAINTED); break; case SCN_USERLISTSELECTION: evt.SetEventType (wxEVT_SCI_USERLISTSELECTION); evt.SetListType (scn.listType); SetEventText (evt, scn.text, strlen(scn.text)); break; case SCN_URIDROPPED: evt.SetEventType (wxEVT_SCI_URIDROPPED); SetEventText (evt, scn.text, strlen(scn.text)); break; case SCN_DWELLSTART: evt.SetEventType (wxEVT_SCI_DWELLSTART); evt.SetX (scn.x); evt.SetY (scn.y); break; case SCN_DWELLEND: evt.SetEventType (wxEVT_SCI_DWELLEND); evt.SetX (scn.x); evt.SetY (scn.y); break; case SCN_ZOOM: evt.SetEventType (wxEVT_SCI_ZOOM); break; case SCN_HOTSPOTCLICK: evt.SetEventType (wxEVT_SCI_HOTSPOT_CLICK); break; case SCN_HOTSPOTDOUBLECLICK: evt.SetEventType (wxEVT_SCI_HOTSPOT_DCLICK); break; case SCN_CALLTIPCLICK: evt.SetEventType (wxEVT_SCI_CALLTIP_CLICK); break; case SCN_AUTOCSELECTION: evt.SetEventType (wxEVT_SCI_AUTOCOMP_SELECTION); break; default: return; } GetEventHandler()->ProcessEvent (evt); } //---------------------------------------------------------------------- //---------------------------------------------------------------------- //---------------------------------------------------------------------- wxScintillaEvent::wxScintillaEvent (wxEventType commandType, int id) : wxCommandEvent (commandType, id) { m_position = 0; m_key = 0; m_modifiers = 0; m_modificationType = 0; m_length = 0; m_linesAdded = 0; m_line = 0; m_foldLevelNow = 0; m_foldLevelPrev = 0; m_margin = 0; m_message = 0; m_wParam = 0; m_lParam = 0; m_listType = 0; m_x = 0; m_y = 0; m_dragAllowMove = FALSE; #if wxUSE_DRAG_AND_DROP m_dragResult = wxDragNone; #endif } bool wxScintillaEvent::GetShift() const { return (m_modifiers & SCI_SHIFT) != 0; } bool wxScintillaEvent::GetControl() const { return (m_modifiers & SCI_CTRL) != 0; } bool wxScintillaEvent::GetAlt() const { return (m_modifiers & SCI_ALT) != 0; } wxScintillaEvent::wxScintillaEvent (const wxScintillaEvent& event) : wxCommandEvent(event) { m_position = event.m_position; m_key = event.m_key; m_modifiers = event.m_modifiers; m_modificationType = event.m_modificationType; m_text = event.m_text; m_length = event.m_length; m_linesAdded = event.m_linesAdded; m_line = event.m_line; m_foldLevelNow = event.m_foldLevelNow; m_foldLevelPrev = event.m_foldLevelPrev; m_margin = event.m_margin; m_message = event.m_message; m_wParam = event.m_wParam; m_lParam = event.m_lParam; m_listType = event.m_listType; m_x = event.m_x; m_y = event.m_y; m_dragText = event.m_dragText; m_dragAllowMove = event.m_dragAllowMove; #if wxUSE_DRAG_AND_DROP m_dragResult = event.m_dragResult; #endif } //---------------------------------------------------------------------- //---------------------------------------------------------------------- wxformbuilder-3.1.59/src/controls/src/wxScintilla/ScintillaWX.h0000644000175000017500000001426511143440026025053 0ustar rrmulderrrmulder//////////////////////////////////////////////////////////////////////////// // Name: ScintillaWX.h // Purpose: A wxWidgets implementation of Scintilla. A class derived // from ScintillaBase that uses the "wx platform" defined in // PlatWX.cpp. This class is one end of a bridge between // the wx world and the Scintilla world. It needs a peer // object of type wxScintilla to function. // // Author: Robin Dunn // // Created: 13-Jan-2000 // RCS-ID: $Id: ScintillaWX.h,v 1.9 2006/06/06 19:16:25 wyo Exp $ // Copyright: (c) 2000 by Total Control Software // Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// #ifndef __ScintillaWX_h__ #define __ScintillaWX_h__ // [CHANGED] BEGIN #include #include #include #include #include "Platform.h" #include "Scintilla.h" #include "ScintillaWidget.h" #ifdef SCI_LEXER #include "SciLexer.h" #include "PropSet.h" #include "Accessor.h" #include "KeyWords.h" #endif #include "ContractionState.h" #include "SVector.h" #include "SplitVector.h" #include "Partitioning.h" #include "RunStyles.h" #include "CellBuffer.h" #include "CallTip.h" #include "KeyMap.h" #include "Indicator.h" #include "XPM.h" #include "LineMarker.h" #include "Style.h" #include "AutoComplete.h" #include "ViewStyle.h" #include "CharClassify.h" #include "Decoration.h" #include "Document.h" #include "PositionCache.h" #include "Editor.h" #include "SString.h" #include "ScintillaBase.h" #include #include #include #include // [CHANGED] END #ifdef WXMAKINGDLL_SCI #define WXDLLIMPEXP_SCI WXEXPORT #elif defined(WXUSINGDLL) #define WXDLLIMPEXP_SCI WXIMPORT #else // not making nor using DLL #define WXDLLIMPEXP_SCI #endif class WXDLLIMPEXP_SCI wxScintilla; // forward class ScintillaWX; #ifndef SCI_SCOPE // begin [CHANGED] #ifdef SCI_NAMESPACE #define SCI_SCOPE( x ) Scintilla::x #else #define SCI_SCOPE( x ) x #endif #endif // end [CHANGED] //---------------------------------------------------------------------- // Helper classes #if wxUSE_DRAG_AND_DROP class wxSCIDropTarget : public wxTextDropTarget { public: void SetScintilla(ScintillaWX* swx) { this->swx = swx; } bool OnDropText(wxCoord x, wxCoord y, const wxString& data); wxDragResult OnEnter(wxCoord x, wxCoord y, wxDragResult def); wxDragResult OnDragOver(wxCoord x, wxCoord y, wxDragResult def); void OnLeave(); private: ScintillaWX* swx; }; #endif //---------------------------------------------------------------------- class ScintillaWX : public SCI_SCOPE( ScintillaBase ) { public: ScintillaWX(wxScintilla* win); ~ScintillaWX(); // base class virtuals virtual void Initialise(); virtual void Finalise(); virtual void StartDrag(); virtual bool SetIdle(bool on); virtual void SetTicking(bool on); virtual void SetMouseCapture(bool on); virtual bool HaveMouseCapture(); virtual void ScrollText(int linesToMove); virtual void SetVerticalScrollPos(); virtual void SetHorizontalScrollPos(); virtual bool ModifyScrollBars(int nMax, int nPage); virtual void Copy(); virtual void Paste(); virtual void CopyToClipboard(const SCI_SCOPE(SelectionText) &selectedText); virtual void CreateCallTipWindow( SCI_SCOPE(PRectangle) rc); virtual void AddToPopUp(const char *label, int cmd = 0, bool enabled = true); virtual void ClaimSelection(); virtual long DefWndProc(unsigned int iMessage, unsigned long wParam, long lParam); virtual long WndProc(unsigned int iMessage, unsigned long wParam, long lParam); virtual void NotifyChange(); virtual void NotifyParent( SCI_SCOPE(SCNotification) scn); virtual void CancelModes(); virtual void UpdateSystemCaret(); // Event delegates void DoPaint(wxDC* dc, wxRect rect); void DoHScroll(int type, int pos); void DoVScroll(int type, int pos); void DoSize(int width, int height); void DoLoseFocus(); void DoGainFocus(); void DoSysColourChange(); void DoLeftButtonDown( SCI_SCOPE(Point) pt, unsigned int curTime, bool shift, bool ctrl, bool alt); // [CHANGED] void DoLeftButtonUp(SCI_SCOPE(Point) pt, unsigned int curTime, bool ctrl); // [CHANGED] void DoLeftButtonMove(SCI_SCOPE(Point) pt); // [CHANGED] void DoMiddleButtonUp(SCI_SCOPE(Point) pt); // [CHANGED] void DoMouseWheel(int rotation, int delta, int linesPerAction, int ctrlDown, bool isPageScroll); void DoAddChar(int key); int DoKeyDown(const wxKeyEvent& event, bool* consumed); void DoTick() { Tick(); } void DoOnIdle(wxIdleEvent& evt); void DoStartDrag(); #if wxUSE_DRAG_AND_DROP bool DoDropText(long x, long y, const wxString& data); wxDragResult DoDragEnter(wxCoord x, wxCoord y, wxDragResult def); wxDragResult DoDragOver(wxCoord x, wxCoord y, wxDragResult def); void DoDragLeave(); #endif void DoCommand(int ID); void DoContextMenu(SCI_SCOPE(Point) pt); // [CHANGED] void DoOnListBox(); // helpers void FullPaint(); bool CanPaste(); bool GetHideSelection() { return hideSelection; } void DoScrollToLine(int line); void DoScrollToColumn(int column); void ClipChildren(wxDC& dc, SCI_SCOPE(PRectangle) rect); void SetUseAntiAliasing(bool useAA); bool GetUseAntiAliasing(); private: bool capturedMouse; bool focusEvent; wxScintilla* sci; #if wxUSE_DRAG_AND_DROP wxSCIDropTarget* dropTarget; wxDragResult dragResult; bool dragRectangle; wxTimer* startDragTimer; #endif int wheelRotation; // For use in creating a system caret bool HasCaretSizeChanged(); bool CreateSystemCaret(); bool DestroySystemCaret(); #ifdef __WXMSW__ #if wxCHECK_VERSION(2, 5, 0) HBITMAP sysCaretBitmap; int sysCaretWidth; int sysCaretHeight; #endif #endif friend class wxSCICallTip; }; //---------------------------------------------------------------------- #endif wxformbuilder-3.1.59/src/controls/src/wxScintilla/ScintillaWX.cpp0000644000175000017500000010255111143440026025402 0ustar rrmulderrrmulder//////////////////////////////////////////////////////////////////////////// // Name: ScintillaWX.cxx // Purpose: A wxWidgets implementation of Scintilla. A class derived // from ScintillaBase that uses the "wx platform" defined in // PlatformWX.cxx This class is one end of a bridge between // the wx world and the Scintilla world. It needs a peer // object of type wxScintilla to function. // // Author: Robin Dunn // // Created: 13-Jan-2000 // RCS-ID: $Id: ScintillaWX.cpp,v 1.26 2006/09/22 19:42:14 wyo Exp $ // Copyright: (c) 2000 by Total Control Software // Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// #include "ScintillaWX.h" //?#include "ExternalLexer.h" #include "PlatWX.h" #include "wx/wxScintilla/wxscintilla.h" #include #ifdef __WXMSW__ #include // GetHwndOf() #endif #ifdef SCI_NAMESPACE // begin [CHANGED] using namespace Scintilla; #endif // end [CHANGED] //---------------------------------------------------------------------- // Helper classes class wxSCITimer : public wxTimer { public: wxSCITimer(ScintillaWX* swx) { this->swx = swx; } void Notify() { swx->DoTick(); } private: ScintillaWX* swx; }; #if wxUSE_DRAG_AND_DROP class wxStartDragTimer : public wxTimer { public: wxStartDragTimer(ScintillaWX* swx) { this->swx = swx; } void Notify() { swx->DoStartDrag(); } private: ScintillaWX* swx; }; bool wxSCIDropTarget::OnDropText(wxCoord x, wxCoord y, const wxString& data) { return swx->DoDropText(x, y, data); } wxDragResult wxSCIDropTarget::OnEnter(wxCoord x, wxCoord y, wxDragResult def) { return swx->DoDragEnter(x, y, def); } wxDragResult wxSCIDropTarget::OnDragOver(wxCoord x, wxCoord y, wxDragResult def) { return swx->DoDragOver(x, y, def); } void wxSCIDropTarget::OnLeave() { swx->DoDragLeave(); } #endif #if wxUSE_POPUPWIN && wxSCI_USE_POPUP #include #define wxSCICallTipBase wxPopupWindow #define param2 wxBORDER_NONE // popup's 2nd param is flags #else #define wxSCICallTipBase wxWindow #define param2 -1 // wxWindow's 2nd param is ID #endif #include class wxSCICallTip : public wxSCICallTipBase { public: wxSCICallTip(wxWindow* parent, CallTip* ct, ScintillaWX* swx) : wxSCICallTipBase(parent, param2), m_ct(ct), m_swx(swx), m_cx(-1), m_cy(-1) { } ~wxSCICallTip() { #if wxUSE_POPUPWIN && wxSCI_USE_POPUP && defined(__WXGTK__) wxRect rect = GetRect(); rect.x = m_cx; rect.y = m_cy; GetParent()->Refresh(false, &rect); #endif } bool AcceptsFocus() const { return false; } void OnPaint(wxPaintEvent& WXUNUSED(evt)) { wxBufferedPaintDC dc(this); Surface* surfaceWindow = Surface::Allocate(); surfaceWindow->Init(&dc, m_ct->wDraw.GetID()); m_ct->PaintCT(surfaceWindow); surfaceWindow->Release(); delete surfaceWindow; } void OnFocus(wxFocusEvent& event) { GetParent()->SetFocus(); event.Skip(); } void OnLeftDown(wxMouseEvent& event) { wxPoint pt = event.GetPosition(); Point p(pt.x, pt.y); m_ct->MouseClick(p); m_swx->CallTipClick(); } #if wxUSE_POPUPWIN && wxSCI_USE_POPUP virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO) { if (x != -1) { m_cx = x; GetParent()->ClientToScreen(&x, NULL); } if (y != -1) { m_cy = y; GetParent()->ClientToScreen(NULL, &y); } wxSCICallTipBase::DoSetSize(x, y, width, height, sizeFlags); } #endif wxPoint GetMyPosition() { return wxPoint(m_cx, m_cy); } private: CallTip* m_ct; ScintillaWX* m_swx; int m_cx, m_cy; DECLARE_EVENT_TABLE() }; BEGIN_EVENT_TABLE(wxSCICallTip, wxSCICallTipBase) EVT_PAINT(wxSCICallTip::OnPaint) EVT_SET_FOCUS(wxSCICallTip::OnFocus) EVT_LEFT_DOWN(wxSCICallTip::OnLeftDown) END_EVENT_TABLE() //---------------------------------------------------------------------- #if wxUSE_DATAOBJ static wxTextFileType wxConvertEOLMode(int scintillaMode) { wxTextFileType type; switch (scintillaMode) { case wxSCI_EOL_CRLF: type = wxTextFileType_Dos; break; case wxSCI_EOL_CR: type = wxTextFileType_Mac; break; case wxSCI_EOL_LF: type = wxTextFileType_Unix; break; default: type = wxTextBuffer::typeDefault; break; } return type; } #endif // wxUSE_DATAOBJ static int wxCountLines(const char* text, int scintillaMode) { char eolchar; switch (scintillaMode) { case wxSCI_EOL_CRLF: case wxSCI_EOL_LF: eolchar = '\n'; break; case wxSCI_EOL_CR: eolchar = '\r'; break; default: return 0; } int count = 0; int i = 0; while (text[i] != 0) { if (text[i] == eolchar) { count++; } i++; } return count; } //---------------------------------------------------------------------- // Constructor/Destructor ScintillaWX::ScintillaWX(wxScintilla* win) { capturedMouse = false; focusEvent = false; wMain = win; sci = win; wheelRotation = 0; Initialise(); #ifdef __WXMSW__ #if wxCHECK_VERSION(2, 5, 0) sysCaretBitmap = 0; sysCaretWidth = 0; sysCaretHeight = 0; #endif #endif #if wxUSE_DRAG_AND_DROP startDragTimer = new wxStartDragTimer(this); #endif } ScintillaWX::~ScintillaWX() { #if wxUSE_DRAG_AND_DROP delete startDragTimer; #endif Finalise(); } //---------------------------------------------------------------------- // base class virtuals void ScintillaWX::Initialise() { //ScintillaBase::Initialise(); #if wxUSE_DRAG_AND_DROP dropTarget = new wxSCIDropTarget; dropTarget->SetScintilla(this); sci->SetDropTarget(dropTarget); dragRectangle = false; #endif #ifdef __WXMAC__ vs.extraFontFlag = false; // UseAntiAliasing #else vs.extraFontFlag = true; // UseAntiAliasing #endif } void ScintillaWX::Finalise() { ScintillaBase::Finalise(); SetTicking(false); SetIdle(false); DestroySystemCaret(); } void ScintillaWX::StartDrag() { #if wxUSE_DRAG_AND_DROP // We defer the starting of the DnD, otherwise the LeftUp of a normal // click could be lost and the STC will think it is doing a DnD when the // user just wanted a normal click. startDragTimer->Start (200, true); #endif } void ScintillaWX::DoStartDrag() { #if wxUSE_DRAG_AND_DROP wxString dragText = sci2wx (drag.s, drag.len); // Send an event to allow the drag text to be changed wxScintillaEvent evt(wxEVT_SCI_START_DRAG, sci->GetId()); evt.SetEventObject (sci); evt.SetDragText (dragText); evt.SetDragAllowMove (true); evt.SetPosition (wxMin(sci->GetSelectionStart(), sci->GetSelectionEnd())); sci->GetEventHandler()->ProcessEvent (evt); dragText = evt.GetDragText(); dragRectangle = drag.rectangular; if (dragText.Length()) { wxDropSource source(sci); wxTextDataObject data(dragText); wxDragResult result; source.SetData(data); dropWentOutside = true; result = source.DoDragDrop(evt.GetDragAllowMove()); if (result == wxDragMove && dropWentOutside) ClearSelection(); inDragDrop = ddNone; // [CHANGED] SetDragPosition (invalidPosition); } #endif } bool ScintillaWX::SetIdle(bool on) { if (idler.state != on) { // connect or disconnect the EVT_IDLE handler if (on) sci->Connect(wxID_ANY, wxEVT_IDLE, (wxObjectEventFunction) (wxEventFunction) (wxIdleEventFunction) &wxScintilla::OnIdle); else sci->Disconnect(wxID_ANY, wxEVT_IDLE, (wxObjectEventFunction) (wxEventFunction) (wxIdleEventFunction) &wxScintilla::OnIdle); idler.state = on; } return idler.state; } void ScintillaWX::SetTicking(bool on) { wxSCITimer* stiTimer; if (timer.ticking != on) { timer.ticking = on; if (timer.ticking) { stiTimer = new wxSCITimer(this); stiTimer->Start(timer.tickSize); timer.tickerID = stiTimer; } else { stiTimer = (wxSCITimer*)timer.tickerID; stiTimer->Stop(); delete stiTimer; timer.tickerID = 0; } } timer.ticksToWait = caret.period; } void ScintillaWX::SetMouseCapture(bool on) { if (mouseDownCaptures) { if (on && !capturedMouse) sci->CaptureMouse(); else if (!on && capturedMouse && sci->HasCapture()) sci->ReleaseMouse(); capturedMouse = on; } } bool ScintillaWX::HaveMouseCapture() { return capturedMouse; } void ScintillaWX::ScrollText(int linesToMove) { int dy = vs.lineHeight * (linesToMove); sci->ScrollWindow(0, dy); sci->Update(); } void ScintillaWX::SetVerticalScrollPos() { if (sci->m_vScrollBar == NULL) { // Use built-in scrollbar sci->SetScrollPos(wxVERTICAL, topLine); } else { // otherwise use the one that's been given to us sci->m_vScrollBar->SetThumbPosition(topLine); } } void ScintillaWX::SetHorizontalScrollPos() { if (sci->m_hScrollBar == NULL) { // Use built-in scrollbar sci->SetScrollPos(wxHORIZONTAL, xOffset); } else { // otherwise use the one that's been given to us sci->m_hScrollBar->SetThumbPosition(xOffset); } } const int H_SCROLL_STEP = 20; bool ScintillaWX::ModifyScrollBars(int nMax, int nPage) { bool modified = false; int vertEnd = nMax; if (!verticalScrollBarVisible) vertEnd = 0; // Check the vertical scrollbar if (sci->m_vScrollBar == NULL) { // Use built-in scrollbar int sbMax = sci->GetScrollRange(wxVERTICAL); int sbThumb = sci->GetScrollThumb(wxVERTICAL); int sbPos = sci->GetScrollPos(wxVERTICAL); if (sbMax != vertEnd || sbThumb != nPage) { sci->SetScrollbar(wxVERTICAL, sbPos, nPage, vertEnd+1); modified = true; } } else { // otherwise use the one that's been given to us int sbMax = sci->m_vScrollBar->GetRange(); int sbPage = sci->m_vScrollBar->GetPageSize(); int sbPos = sci->m_vScrollBar->GetThumbPosition(); if (sbMax != vertEnd || sbPage != nPage) { sci->m_vScrollBar->SetScrollbar(sbPos, nPage, vertEnd+1, nPage); modified = true; } } // Check the horizontal scrollbar PRectangle rcText = GetTextRectangle(); int horizEnd = scrollWidth; if (horizEnd < 0) horizEnd = 0; if (!horizontalScrollBarVisible || (wrapState != eWrapNone)) horizEnd = 0; int pageWidth = rcText.Width(); if (sci->m_hScrollBar == NULL) { // Use built-in scrollbar int sbMax = sci->GetScrollRange(wxHORIZONTAL); int sbThumb = sci->GetScrollThumb(wxHORIZONTAL); int sbPos = sci->GetScrollPos(wxHORIZONTAL); if ((sbMax != horizEnd) || (sbThumb != pageWidth) || (sbPos != 0)) { sci->SetScrollbar(wxHORIZONTAL, sbPos, pageWidth, horizEnd); modified = true; if (scrollWidth < pageWidth) { HorizontalScrollTo(0); } } } else { // otherwise use the one that's been given to us int sbMax = sci->m_hScrollBar->GetRange(); int sbThumb = sci->m_hScrollBar->GetPageSize(); int sbPos = sci->m_hScrollBar->GetThumbPosition(); if ((sbMax != horizEnd) || (sbThumb != pageWidth) || (sbPos != 0)) { sci->m_hScrollBar->SetScrollbar(sbPos, pageWidth, horizEnd, pageWidth); modified = true; if (scrollWidth < pageWidth) { HorizontalScrollTo(0); } } } return modified; } void ScintillaWX::NotifyChange() { sci->NotifyChange(); } void ScintillaWX::NotifyParent(SCNotification scn) { sci->NotifyParent(&scn); } // This method is overloaded from ScintillaBase in order to prevent the // AutoComplete window from being destroyed when it gets the focus. There is // a side effect that the AutoComp will also not be destroyed when switching // to another window, but I think that is okay. void ScintillaWX::CancelModes() { if (! focusEvent) AutoCompleteCancel(); ct.CallTipCancel(); Editor::CancelModes(); } void ScintillaWX::Copy() { if (currentPos != anchor) { SelectionText st; CopySelectionRange(&st); CopyToClipboard(st); } } void ScintillaWX::Paste() { pdoc->BeginUndoAction(); ClearSelection(); #if wxUSE_DATAOBJ wxTextDataObject data; wxString textString; wxWX2MBbuf buf; int len = 0; bool rectangular = false; if (wxTheClipboard->Open()) { wxTheClipboard->UsePrimarySelection(false); wxCustomDataObject selData(wxDF_PRIVATE); bool gotRectData = wxTheClipboard->GetData(selData); if (gotRectData && selData.GetSize()>1) { const char* rectBuf = (const char*)selData.GetData(); rectangular = rectBuf[0] == (char)1; len = selData.GetDataSize()-1; char* buffer = new char[len]; memcpy (buffer, rectBuf+1, len); textString = sci2wx(buffer, len); delete buffer; } else { bool gotData = wxTheClipboard->GetData(data); if (gotData) { textString = wxTextBuffer::Translate (data.GetText(), wxConvertEOLMode(pdoc->eolMode)); } } data.SetText(wxEmptyString); // free the data object content wxTheClipboard->Close(); } buf = (wxWX2MBbuf)wx2sci(textString); len = strlen(buf); int newPos = 0; if (rectangular) { int newLine = pdoc->LineFromPosition (currentPos) + wxCountLines (buf, pdoc->eolMode); int newCol = pdoc->GetColumn(currentPos); PasteRectangular (currentPos, buf, len); newPos = pdoc->FindColumn (newLine, newCol); } else { pdoc->InsertString (currentPos, buf, len); newPos = currentPos + len; } SetEmptySelection (newPos); #endif // wxUSE_DATAOBJ pdoc->EndUndoAction(); NotifyChange(); Redraw(); } void ScintillaWX::CopyToClipboard (const SelectionText& st) { #if wxUSE_CLIPBOARD if (wxTheClipboard->Open()) { wxTheClipboard->UsePrimarySelection (false); wxString text = wxTextBuffer::Translate (sci2wx(st.s, st.len-1)); // composite object will hold "plain text" for pasting in other programs and a custom // object for local use that remembers what kind of selection was made (stream or // rectangular). wxDataObjectComposite* obj = new wxDataObjectComposite(); wxCustomDataObject* rectData = new wxCustomDataObject (wxDF_PRIVATE); char* buffer = new char[st.len+1]; buffer[0] = (st.rectangular)? (char)1 : (char)0; memcpy (buffer+1, st.s, st.len); rectData->SetData (st.len+1, buffer); delete buffer; obj->Add (rectData, true); obj->Add (new wxTextDataObject (text)); wxTheClipboard->SetData (obj); wxTheClipboard->Close(); } #else wxUnusedVar(st); #endif // wxUSE_CLIPBOARD } bool ScintillaWX::CanPaste() { #if wxUSE_CLIPBOARD bool canPaste = false; bool didOpen; if (Editor::CanPaste()) { didOpen = !wxTheClipboard->IsOpened(); if ( didOpen ) wxTheClipboard->Open(); if (wxTheClipboard->IsOpened()) { wxTheClipboard->UsePrimarySelection(false); canPaste = wxTheClipboard->IsSupported(wxUSE_UNICODE ? wxDF_UNICODETEXT : wxDF_TEXT); if (didOpen) wxTheClipboard->Close(); } } return canPaste; #else return false; #endif // wxUSE_CLIPBOARD } void ScintillaWX::CreateCallTipWindow(PRectangle) { if (! ct.wCallTip.Created() ) { ct.wCallTip = new wxSCICallTip(sci, &ct, this); ct.wDraw = ct.wCallTip; } } void ScintillaWX::AddToPopUp(const char *label, int cmd, bool enabled) { if (!label[0]) ((wxMenu*)popup.GetID())->AppendSeparator(); else ((wxMenu*)popup.GetID())->Append(cmd, wxGetTranslation(sci2wx(label))); if (!enabled) ((wxMenu*)popup.GetID())->Enable(cmd, enabled); } // This is called by the Editor base class whenever something is selected void ScintillaWX::ClaimSelection() { #if 0 // Until wxGTK is able to support using both the primary selection and the // clipboard at the same time I think it causes more problems than it is // worth to implement this method. Selecting text should not clear the // clipboard. --Robin #ifdef __WXGTK__ // Put the selected text in the PRIMARY selection if (currentPos != anchor) { SelectionText st; CopySelectionRange(&st); if (wxTheClipboard->Open()) { wxTheClipboard->UsePrimarySelection(true); wxString text = sci2wx(st.s, st.len); wxTheClipboard->SetData(new wxTextDataObject(text)); wxTheClipboard->UsePrimarySelection(false); wxTheClipboard->Close(); } } #endif #endif } void ScintillaWX::UpdateSystemCaret() { #ifdef __WXMSW__ if (hasFocus) { if (HasCaretSizeChanged()) { DestroySystemCaret(); CreateSystemCaret(); } Point pos = LocationFromPosition(currentPos); #if wxCHECK_VERSION(2, 5, 0) ::SetCaretPos(pos.x, pos.y); #endif } #endif } bool ScintillaWX::HasCaretSizeChanged() { #ifdef __WXMSW__ #if !wxCHECK_VERSION(2, 5, 0) return false; #else if (( (0 != vs.caretWidth) && (sysCaretWidth != vs.caretWidth) ) || (0 != vs.lineHeight) && (sysCaretHeight != vs.lineHeight)) { return true; } #endif #endif return false; } bool ScintillaWX::CreateSystemCaret() { #ifdef __WXMSW__ #if !wxCHECK_VERSION(2, 5, 0) return false; #else sysCaretWidth = vs.caretWidth; if (0 == sysCaretWidth) { sysCaretWidth = 1; } sysCaretHeight = vs.lineHeight; int bitmapSize = (((sysCaretWidth + 15) & ~15) >> 3) * sysCaretHeight; char *bits = new char[bitmapSize]; memset(bits, 0, bitmapSize); sysCaretBitmap = ::CreateBitmap(sysCaretWidth, sysCaretHeight, 1, 1, reinterpret_cast(bits)); delete [] bits; BOOL retval = ::CreateCaret(GetHwndOf(sci), sysCaretBitmap, sysCaretWidth, sysCaretHeight); ::ShowCaret(GetHwndOf(sci)); return retval != 0; #endif #else return false; #endif } bool ScintillaWX::DestroySystemCaret() { #ifdef __WXMSW__ #if !wxCHECK_VERSION(2, 5, 0) return false; #else ::HideCaret(GetHwndOf(sci)); BOOL retval = ::DestroyCaret(); if (sysCaretBitmap) { ::DeleteObject(sysCaretBitmap); sysCaretBitmap = 0; } return retval != 0; #endif #else return false; #endif } //---------------------------------------------------------------------- long ScintillaWX::DefWndProc(unsigned int /*iMessage*/, unsigned long /*wParam*/, long /*lParam*/) { return 0; } long ScintillaWX::WndProc(unsigned int iMessage, unsigned long wParam, long lParam) { switch (iMessage) { case SCI_CALLTIPSHOW: { // NOTE: This is copied here from scintilla/src/ScintillaBase.cxx // because of the little tweak that needs done below for wxGTK. // When updating new versions double check that this is still // needed, and that any new code there is copied here too. Point pt = LocationFromPosition(wParam); char* defn = reinterpret_cast(lParam); AutoCompleteCancel(); pt.y += vs.lineHeight; PRectangle rc = ct.CallTipStart(currentPos, pt, defn, vs.styles[STYLE_DEFAULT].fontName, vs.styles[STYLE_DEFAULT].sizeZoomed, CodePage(), vs.styles[STYLE_DEFAULT].characterSet, wMain); // If the call-tip window would be out of the client // space, adjust so it displays above the text. PRectangle rcClient = GetClientRectangle(); if (rc.bottom > rcClient.bottom) { #ifdef __WXGTK__ int offset = int(vs.lineHeight * 1.25) + rc.Height(); #else int offset = vs.lineHeight + rc.Height(); #endif rc.top -= offset; rc.bottom -= offset; } // Now display the window. CreateCallTipWindow(rc); ct.wCallTip.SetPositionRelative(rc, wMain); ct.wCallTip.Show(); break; } /*? TODO #ifdef SCI_LEXER case SCI_LOADLEXERLIBRARY: LexerManager::GetInstance()->Load((const char*)lParam); break; #endif ?*/ default: return ScintillaBase::WndProc(iMessage, wParam, lParam); } return 0; } //---------------------------------------------------------------------- // Event delegates void ScintillaWX::DoPaint(wxDC* dc, wxRect rect) { paintState = painting; Surface* surfaceWindow = Surface::Allocate(); surfaceWindow->Init(dc, wMain.GetID()); rcPaint = PRectangleFromwxRect(rect); PRectangle rcClient = GetClientRectangle(); paintingAllText = rcPaint.Contains(rcClient); ClipChildren(*dc, rcPaint); Paint(surfaceWindow, rcPaint); delete surfaceWindow; if (paintState == paintAbandoned) { // Painting area was insufficient to cover new styling or brace // highlight positions FullPaint(); } paintState = notPainting; } void ScintillaWX::DoHScroll(int type, int pos) { int xPos = xOffset; PRectangle rcText = GetTextRectangle(); int pageWidth = rcText.Width() * 2 / 3; if (type == wxEVT_SCROLLWIN_LINEUP || type == wxEVT_SCROLL_LINEUP) xPos -= H_SCROLL_STEP; else if (type == wxEVT_SCROLLWIN_LINEDOWN || type == wxEVT_SCROLL_LINEDOWN) xPos += H_SCROLL_STEP; else if (type == wxEVT_SCROLLWIN_PAGEUP || type == wxEVT_SCROLL_PAGEUP) xPos -= pageWidth; else if (type == wxEVT_SCROLLWIN_PAGEDOWN || type == wxEVT_SCROLL_PAGEDOWN) { xPos += pageWidth; if (xPos > scrollWidth - rcText.Width()) { xPos = scrollWidth - rcText.Width(); } } else if (type == wxEVT_SCROLLWIN_TOP || type == wxEVT_SCROLL_TOP) xPos = 0; else if (type == wxEVT_SCROLLWIN_BOTTOM || type == wxEVT_SCROLL_BOTTOM) xPos = scrollWidth; else if (type == wxEVT_SCROLLWIN_THUMBTRACK || type == wxEVT_SCROLL_THUMBTRACK) xPos = pos; HorizontalScrollTo(xPos); } void ScintillaWX::DoVScroll(int type, int pos) { int topLineNew = topLine; if (type == wxEVT_SCROLLWIN_LINEUP || type == wxEVT_SCROLL_LINEUP) topLineNew -= 1; else if (type == wxEVT_SCROLLWIN_LINEDOWN || type == wxEVT_SCROLL_LINEDOWN) topLineNew += 1; else if (type == wxEVT_SCROLLWIN_PAGEUP || type == wxEVT_SCROLL_PAGEUP) topLineNew -= LinesToScroll(); else if (type == wxEVT_SCROLLWIN_PAGEDOWN || type == wxEVT_SCROLL_PAGEDOWN) topLineNew += LinesToScroll(); else if (type == wxEVT_SCROLLWIN_TOP || type == wxEVT_SCROLL_TOP) topLineNew = 0; else if (type == wxEVT_SCROLLWIN_BOTTOM || type == wxEVT_SCROLL_BOTTOM) topLineNew = MaxScrollPos(); else if (type == wxEVT_SCROLLWIN_THUMBTRACK || type == wxEVT_SCROLL_THUMBTRACK) topLineNew = pos; ScrollTo(topLineNew); } void ScintillaWX::DoMouseWheel(int rotation, int delta, int linesPerAction, int ctrlDown, bool isPageScroll ) { int topLineNew = topLine; int lines; if (ctrlDown) { // Zoom the fonts if Ctrl key down if (rotation < 0) { KeyCommand(SCI_ZOOMIN); } else { KeyCommand(SCI_ZOOMOUT); } } else { // otherwise just scroll the window if ( !delta ) delta = 120; wheelRotation += rotation; lines = wheelRotation / delta; wheelRotation -= lines * delta; if (lines != 0) { if (isPageScroll) lines = lines * LinesOnScreen(); // lines is either +1 or -1 else lines *= linesPerAction; topLineNew -= lines; ScrollTo(topLineNew); } } } void ScintillaWX::DoSize(int WXUNUSED(width), int WXUNUSED(height)) { ChangeSize(); } void ScintillaWX::DoLoseFocus(){ focusEvent = true; SetFocusState(false); focusEvent = false; DestroySystemCaret(); } void ScintillaWX::DoGainFocus(){ focusEvent = true; SetFocusState(true); focusEvent = false; DestroySystemCaret(); CreateSystemCaret(); } void ScintillaWX::DoSysColourChange() { InvalidateStyleData(); } void ScintillaWX::DoLeftButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, bool alt) { ButtonDown(pt, curTime, shift, ctrl, alt); } void ScintillaWX::DoLeftButtonUp(Point pt, unsigned int curTime, bool ctrl) { ButtonUp(pt, curTime, ctrl); #if wxUSE_DRAG_AND_DROP if (startDragTimer->IsRunning()) { startDragTimer->Stop(); SetDragPosition(invalidPosition); SetEmptySelection(PositionFromLocation(pt)); ShowCaretAtCurrentPosition(); } #endif } void ScintillaWX::DoLeftButtonMove(Point pt) { ButtonMove(pt); } #ifdef __WXGTK__ void ScintillaWX::DoMiddleButtonUp(Point pt) { // Set the current position to the mouse click point and // then paste in the PRIMARY selection, if any. wxGTK only. int newPos = PositionFromLocation(pt); MovePositionTo(newPos, noSel, true); pdoc->BeginUndoAction(); wxTextDataObject data; bool gotData = false; if (wxTheClipboard->Open()) { wxTheClipboard->UsePrimarySelection(true); gotData = wxTheClipboard->GetData(data); wxTheClipboard->UsePrimarySelection(false); wxTheClipboard->Close(); } if (gotData) { wxString text = wxTextBuffer::Translate (data.GetText(), wxConvertEOLMode(pdoc->eolMode)); data.SetText(wxEmptyString); // free the data object content wxWX2MBbuf buf = (wxWX2MBbuf)wx2sci(text); int len = strlen(buf); pdoc->InsertString(currentPos, buf, len); SetEmptySelection(currentPos + len); } pdoc->EndUndoAction(); NotifyChange(); Redraw(); ShowCaretAtCurrentPosition(); EnsureCaretVisible(); } #else void ScintillaWX::DoMiddleButtonUp(Point WXUNUSED(pt)) { } #endif void ScintillaWX::DoAddChar(int key) { #if wxUSE_UNICODE wxChar wszChars[2]; wszChars[0] = (wxChar)key; wszChars[1] = 0; wxWX2MBbuf buf = (wxWX2MBbuf)wx2sci(wszChars); AddCharUTF((char*)buf.data(), strlen(buf)); #else AddChar((char)key); #endif } int ScintillaWX::DoKeyDown(const wxKeyEvent& evt, bool* consumed) { int key = evt.GetKeyCode(); bool shift = evt.ShiftDown(), ctrl = evt.ControlDown(), alt = evt.AltDown(); if (ctrl && key >= 1 && key <= 26 && key != WXK_BACK) key += 'A' - 1; switch (key) { case WXK_DOWN: // fall through case WXK_NUMPAD_DOWN: key = SCK_DOWN; break; case WXK_UP: // fall through case WXK_NUMPAD_UP: key = SCK_UP; break; case WXK_LEFT: // fall through case WXK_NUMPAD_LEFT: key = SCK_LEFT; break; case WXK_RIGHT: // fall through case WXK_NUMPAD_RIGHT: key = SCK_RIGHT; break; case WXK_HOME: // fall through case WXK_NUMPAD_HOME: key = SCK_HOME; break; case WXK_END: // fall through case WXK_NUMPAD_END: key = SCK_END; break; #if !wxCHECK_VERSION(2, 7, 0) case WXK_PRIOR: // fall through case WXK_NUMPAD_PRIOR: // fall through #endif case WXK_PAGEUP: // fall through case WXK_NUMPAD_PAGEUP: key = SCK_PRIOR; break; #if !wxCHECK_VERSION(2, 7, 0) case WXK_NEXT: // fall through case WXK_NUMPAD_NEXT: // fall through #endif case WXK_PAGEDOWN: // fall through case WXK_NUMPAD_PAGEDOWN: key = SCK_NEXT; break; case WXK_DELETE: key = SCK_DELETE; break; case WXK_INSERT: key = SCK_INSERT; break; case WXK_ESCAPE: key = SCK_ESCAPE; break; case WXK_BACK: key = SCK_BACK; break; case WXK_TAB: key = SCK_TAB; break; case WXK_RETURN: // fall through case WXK_NUMPAD_ENTER: key = SCK_RETURN; break; case WXK_ADD: // fall through case WXK_NUMPAD_ADD: key = SCK_ADD; break; case WXK_SUBTRACT: // fall through case WXK_NUMPAD_SUBTRACT: key = SCK_SUBTRACT; break; case WXK_DIVIDE: // fall through case WXK_NUMPAD_DIVIDE: key = SCK_DIVIDE; break; case WXK_CONTROL: key = 0; break; case WXK_ALT: key = 0; break; case WXK_SHIFT: key = 0; break; case WXK_MENU: key = 0; break; } #ifdef __WXMAC__ if ( evt.MetaDown() ) { // check for a few common Mac Meta-key combos and remap them to Ctrl // for Scintilla switch ( key ) { case 'Z': // Undo case 'X': // Cut case 'C': // Copy case 'V': // Paste case 'A': // Select All ctrl = true; break; } } #endif int rv = KeyDown(key, shift, ctrl, alt, consumed); if (key) return rv; else return 1; } void ScintillaWX::DoCommand(int ID) { Command(ID); } void ScintillaWX::DoContextMenu(Point pt) { if (displayPopupMenu) ContextMenu(pt); } void ScintillaWX::DoOnListBox() { AutoCompleteCompleted(); } void ScintillaWX::DoOnIdle(wxIdleEvent& evt) { if ( Idle() ) evt.RequestMore(); else SetIdle(false); } //---------------------------------------------------------------------- #if wxUSE_DRAG_AND_DROP bool ScintillaWX::DoDropText(long x, long y, const wxString& data) { SetDragPosition(invalidPosition); wxString text = wxTextBuffer::Translate (data, wxConvertEOLMode(pdoc->eolMode)); // Send an event to allow the drag details to be changed wxScintillaEvent evt(wxEVT_SCI_DO_DROP, sci->GetId()); evt.SetEventObject(sci); evt.SetDragResult(dragResult); evt.SetX(x); evt.SetY(y); evt.SetPosition(PositionFromLocation(Point(x,y))); evt.SetDragText(text); sci->GetEventHandler()->ProcessEvent(evt); dragResult = evt.GetDragResult(); if (dragResult == wxDragMove || dragResult == wxDragCopy) { DropAt(evt.GetPosition(), wx2sci(evt.GetDragText()), dragResult == wxDragMove, dragRectangle); return true; } return false; } wxDragResult ScintillaWX::DoDragEnter(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y), wxDragResult def) { dragResult = def; return dragResult; } wxDragResult ScintillaWX::DoDragOver(wxCoord x, wxCoord y, wxDragResult def) { SetDragPosition(PositionFromLocation(Point(x, y))); // Send an event to allow the drag result to be changed wxScintillaEvent evt(wxEVT_SCI_DRAG_OVER, sci->GetId()); evt.SetEventObject(sci); evt.SetDragResult(def); evt.SetX(x); evt.SetY(y); evt.SetPosition(PositionFromLocation(Point(x,y))); sci->GetEventHandler()->ProcessEvent(evt); dragResult = evt.GetDragResult(); return dragResult; } void ScintillaWX::DoDragLeave() { SetDragPosition(invalidPosition); } #endif //---------------------------------------------------------------------- // Force the whole window to be repainted void ScintillaWX::FullPaint() { #ifndef __WXMAC__ sci->Refresh(false); #endif sci->Update(); } void ScintillaWX::DoScrollToLine(int line) { ScrollTo(line); } void ScintillaWX::DoScrollToColumn(int column) { HorizontalScrollTo(column * vs.spaceWidth); } #ifdef __WXGTK__ void ScintillaWX::ClipChildren(wxDC& dc, PRectangle rect) { // wxGTK > 2.5 doesn't appear to need this explicit clipping code any longer #if !wxCHECK_VERSION(2, 5, 0) wxRegion rgn(wxRectFromPRectangle(rect)); if (ac.Active()) { wxRect childRect = ((wxWindow*)ac.lb->GetID())->GetRect(); rgn.Subtract(childRect); } if (ct.inCallTipMode) { wxSCICallTip* tip = (wxSCICallTip*)ct.wCallTip.GetID(); wxRect childRect = tip->GetRect(); #if wxUSE_POPUPWIN && wxSCI_USE_POPUP childRect.SetPosition(tip->GetMyPosition()); #endif rgn.Subtract(childRect); } dc.SetClippingRegion(rgn); #endif } #else void ScintillaWX::ClipChildren(wxDC& WXUNUSED(dc), PRectangle WXUNUSED(rect)) { } #endif void ScintillaWX::SetUseAntiAliasing(bool useAA) { vs.extraFontFlag = useAA; InvalidateStyleRedraw(); } bool ScintillaWX::GetUseAntiAliasing() { return vs.extraFontFlag; } //---------------------------------------------------------------------- //---------------------------------------------------------------------- wxformbuilder-3.1.59/src/controls/src/wxScintilla/PlatWX.h0000644000175000017500000000110511143440026024016 0ustar rrmulderrrmulder// Scintilla source code edit control // PlatWX.cxx - implementation of platform facilities on wxWidgets // Copyright 1998-1999 by Neil Hodgson // Robin Dunn // The License.txt file describes the conditions under which this software may be distributed. #ifndef PLATWX_H #define PLATWX_H #ifdef SCI_NAMESPACE namespace Scintilla { #endif wxRect wxRectFromPRectangle(PRectangle prc); PRectangle PRectangleFromwxRect(wxRect rc); wxColour wxColourFromCA(const ColourAllocated& ca); #ifdef SCI_NAMESPACE } #endif #endif wxformbuilder-3.1.59/src/controls/src/wxScintilla/PlatWX.cpp0000644000175000017500000012127411143440026024363 0ustar rrmulderrrmulder// Scintilla source code edit control // PlatWX.cxx - implementation of platform facilities on wxWidgets // Copyright 1998-1999 by Neil Hodgson // Robin Dunn // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include #include #include #include #include #ifdef wxHAVE_RAW_BITMAP #include #endif #include "Platform.h" #include "PlatWX.h" #include "wx/wxScintilla/wxscintilla.h" #ifdef SCI_NAMESPACE using namespace Scintilla; namespace Scintilla { #endif Point Point::FromLong(long lpoint) { return Point(lpoint & 0xFFFF, lpoint >> 16); } wxRect wxRectFromPRectangle(PRectangle prc) { wxRect r(prc.left, prc.top, prc.Width(), prc.Height()); return r; } PRectangle PRectangleFromwxRect(wxRect rc) { return PRectangle(rc.GetLeft(), rc.GetTop(), rc.GetRight()+1, rc.GetBottom()+1); } wxColour wxColourFromCA(const ColourAllocated& ca) { ColourDesired cd(ca.AsLong()); return wxColour((unsigned char)cd.GetRed(), (unsigned char)cd.GetGreen(), (unsigned char)cd.GetBlue()); } //---------------------------------------------------------------------- Palette::Palette() { used = 0; allowRealization = false; size = 100; entries = new ColourPair[size]; } Palette::~Palette() { Release(); delete []entries; entries = 0; } void Palette::Release() { used = 0; delete []entries; size = 100; entries = new ColourPair[size]; } // This method either adds a colour to the list of wanted colours (want==true) // or retrieves the allocated colour back to the ColourPair. // This is one method to make it easier to keep the code for wanting and retrieving in sync. void Palette::WantFind(ColourPair &cp, bool want) { if (want) { for (int i=0; i < used; i++) { if (entries[i].desired == cp.desired) return; } if (used >= size) { int sizeNew = size * 2; ColourPair *entriesNew = new ColourPair[sizeNew]; for (int j=0; jSetNoAntiAliasing (!extraFontFlag); id = font; } void Font::Release() { if (id) delete (wxFont*)id; id = 0; } //---------------------------------------------------------------------- class SurfaceImpl : public Surface { private: wxDC* hdc; bool hdcOwned; wxBitmap* bitmap; int x; int y; bool unicodeMode; public: SurfaceImpl(); ~SurfaceImpl(); virtual void Init(WindowID wid); virtual void Init(SurfaceID sid, WindowID wid); virtual void InitPixMap(int width, int height, Surface *surface_, WindowID wid); virtual void Release(); virtual bool Initialised(); virtual void PenColour(ColourAllocated fore); virtual int LogPixelsY(); virtual int DeviceHeightFont(int points); virtual void MoveTo(int x_, int y_); virtual void LineTo(int x_, int y_); virtual void Polygon(Point *pts, int npts, ColourAllocated fore, ColourAllocated back); virtual void RectangleDraw(PRectangle rc, ColourAllocated fore, ColourAllocated back); virtual void FillRectangle(PRectangle rc, ColourAllocated back); virtual void FillRectangle(PRectangle rc, Surface &surfacePattern); virtual void RoundedRectangle(PRectangle rc, ColourAllocated fore, ColourAllocated back); virtual void AlphaRectangle(PRectangle rc, int cornerSize, ColourAllocated fill, int alphaFill, ColourAllocated outline, int alphaOutline, int flags); virtual void Ellipse(PRectangle rc, ColourAllocated fore, ColourAllocated back); virtual void Copy(PRectangle rc, Point from, Surface &surfaceSource); virtual void DrawTextNoClip(PRectangle rc, Font &font_, int ybase, const char *s, int len, ColourAllocated fore, ColourAllocated back); virtual void DrawTextClipped(PRectangle rc, Font &font_, int ybase, const char *s, int len, ColourAllocated fore, ColourAllocated back); virtual void DrawTextTransparent(PRectangle rc, Font &font_, int ybase, const char *s, int len, ColourAllocated fore); virtual void MeasureWidths(Font &font_, const char *s, int len, int *positions); virtual int WidthText(Font &font_, const char *s, int len); virtual int WidthChar(Font &font_, char ch); virtual int Ascent(Font &font_); virtual int Descent(Font &font_); virtual int InternalLeading(Font &font_); virtual int ExternalLeading(Font &font_); virtual int Height(Font &font_); virtual int AverageCharWidth(Font &font_); virtual int SetPalette(Palette *pal, bool inBackGround); virtual void SetClip(PRectangle rc); virtual void FlushCachedState(); virtual void SetUnicodeMode(bool unicodeMode_); virtual void SetDBCSMode(int codePage); void BrushColour(ColourAllocated back); void SetFont(Font &font_); }; SurfaceImpl::SurfaceImpl() : hdc(0), hdcOwned(0), bitmap(0), x(0), y(0), unicodeMode(0) {} SurfaceImpl::~SurfaceImpl() { Release(); } void SurfaceImpl::Init(WindowID wid) { #if 0 Release(); hdc = new wxMemoryDC(); hdcOwned = true; #else // On Mac and GTK the DC is not really valid until it has a bitmap // selected into it. So instead of just creating the DC with no bitmap, // go ahead and give it one. InitPixMap(1,1,NULL,wid); #endif } void SurfaceImpl::Init(SurfaceID hdc_, WindowID) { Release(); hdc = (wxDC*)hdc_; } void SurfaceImpl::InitPixMap(int width, int height, Surface *WXUNUSED(surface_), WindowID) { Release(); hdc = new wxMemoryDC(); hdcOwned = true; if (width < 1) width = 1; if (height < 1) height = 1; bitmap = new wxBitmap(width, height); ((wxMemoryDC*)hdc)->SelectObject(*bitmap); } void SurfaceImpl::Release() { if (bitmap) { ((wxMemoryDC*)hdc)->SelectObject(wxNullBitmap); delete bitmap; bitmap = 0; } if (hdcOwned) { delete hdc; hdc = 0; hdcOwned = false; } } bool SurfaceImpl::Initialised() { return hdc != 0; } void SurfaceImpl::PenColour(ColourAllocated fore) { hdc->SetPen(wxPen(wxColourFromCA(fore), 1, wxSOLID)); } void SurfaceImpl::BrushColour(ColourAllocated back) { hdc->SetBrush(wxBrush(wxColourFromCA(back), wxSOLID)); } void SurfaceImpl::SetFont(Font &font_) { if (font_.GetID()) { hdc->SetFont(*((wxFont*)font_.GetID())); } } int SurfaceImpl::LogPixelsY() { return hdc->GetPPI().y; } int SurfaceImpl::DeviceHeightFont(int points) { return points; } void SurfaceImpl::MoveTo(int x_, int y_) { x = x_; y = y_; } void SurfaceImpl::LineTo(int x_, int y_) { hdc->DrawLine(x,y, x_,y_); x = x_; y = y_; } void SurfaceImpl::Polygon(Point *pts, int npts, ColourAllocated fore, ColourAllocated back) { PenColour(fore); BrushColour(back); hdc->DrawPolygon(npts, (wxPoint*)pts); } void SurfaceImpl::RectangleDraw(PRectangle rc, ColourAllocated fore, ColourAllocated back) { PenColour(fore); BrushColour(back); hdc->DrawRectangle(wxRectFromPRectangle(rc)); } void SurfaceImpl::FillRectangle(PRectangle rc, ColourAllocated back) { BrushColour(back); hdc->SetPen(*wxTRANSPARENT_PEN); hdc->DrawRectangle(wxRectFromPRectangle(rc)); } void SurfaceImpl::FillRectangle(PRectangle rc, Surface &surfacePattern) { wxBrush br; if (((SurfaceImpl&)surfacePattern).bitmap) br = wxBrush(*((SurfaceImpl&)surfacePattern).bitmap); else // Something is wrong so display in red br = wxBrush(*wxRED, wxSOLID); hdc->SetPen(*wxTRANSPARENT_PEN); hdc->SetBrush(br); hdc->DrawRectangle(wxRectFromPRectangle(rc)); } void SurfaceImpl::RoundedRectangle(PRectangle rc, ColourAllocated fore, ColourAllocated back) { PenColour(fore); BrushColour(back); hdc->DrawRoundedRectangle(wxRectFromPRectangle(rc), 4); } void SurfaceImpl::AlphaRectangle (PRectangle rc, int cornerSize, ColourAllocated fill, int alphaFill, ColourAllocated outline, int alphaOutline, int WXUNUSED(flags)) { #ifdef wxHAVE_RAW_BITMAP wxUnusedVar(cornerSize); int x, y; wxRect r = wxRectFromPRectangle(rc); wxBitmap bmp(r.width, r.height, 32); wxAlphaPixelData pixData(bmp); pixData.UseAlpha(); wxAlphaPixelData::Iterator p(pixData); // Set the fill pixels ColourDesired cdf(fill.AsLong()); int red = cdf.GetRed(); int green = cdf.GetGreen(); int blue = cdf.GetBlue(); #ifdef __WXMSW__ int aFill = alphaFill; #else int aFill = 0xff; #endif for (y=0; yDrawBitmap(bmp, r.x, r.y, true); #else wxUnusedVar(cornerSize); wxUnusedVar(alphaFill); wxUnusedVar(alphaOutline); RectangleDraw(rc, outline, fill); #endif } void SurfaceImpl::Ellipse(PRectangle rc, ColourAllocated fore, ColourAllocated back) { PenColour(fore); BrushColour(back); hdc->DrawEllipse(wxRectFromPRectangle(rc)); } void SurfaceImpl::Copy(PRectangle rc, Point from, Surface &surfaceSource) { wxRect r = wxRectFromPRectangle(rc); hdc->Blit(r.x, r.y, r.width, r.height, ((SurfaceImpl&)surfaceSource).hdc, from.x, from.y, wxCOPY); } void SurfaceImpl::DrawTextNoClip(PRectangle rc, Font &font, int ybase, const char *s, int len, ColourAllocated fore, ColourAllocated back) { SetFont(font); hdc->SetTextForeground(wxColourFromCA(fore)); hdc->SetTextBackground(wxColourFromCA(back)); FillRectangle(rc, back); // ybase is where the baseline should be, but wxWin uses the upper left // corner, so I need to calculate the real position for the text... hdc->DrawText(sci2wx(s, len), rc.left, ybase - font.ascent); } void SurfaceImpl::DrawTextClipped(PRectangle rc, Font &font, int ybase, const char *s, int len, ColourAllocated fore, ColourAllocated back) { SetFont(font); hdc->SetTextForeground(wxColourFromCA(fore)); hdc->SetTextBackground(wxColourFromCA(back)); FillRectangle(rc, back); hdc->SetClippingRegion(wxRectFromPRectangle(rc)); // see comments above hdc->DrawText(sci2wx(s, len), rc.left, ybase - font.ascent); hdc->DestroyClippingRegion(); } void SurfaceImpl::DrawTextTransparent(PRectangle rc, Font &font, int ybase, const char *s, int len, ColourAllocated fore) { SetFont(font); hdc->SetTextForeground(wxColourFromCA(fore)); hdc->SetBackgroundMode(wxTRANSPARENT); // ybase is where the baseline should be, but wxWin uses the upper left // corner, so I need to calculate the real position for the text... hdc->DrawText(sci2wx(s, len), rc.left, ybase - font.ascent); hdc->SetBackgroundMode(wxSOLID); } void SurfaceImpl::MeasureWidths(Font &font, const char *s, int len, int *positions) { wxString str = sci2wx(s, len); SetFont(font); #if !wxCHECK_VERSION(2, 5, 0) #ifndef __WXMAC__ // Calculate the position of each character based on the widths of // the previous characters int* tpos = new int[len+1]; int totalWidth = 0; size_t i; for (i=0; iGetTextExtent(str[i], &w, &h); totalWidth += w; tpos[i] = totalWidth; } #else // Instead of a running total, remeasure from the begining of the // text for each character's position. This is because with AA fonts // on OS X widths can be fractions of pixels wide when more than one // are drawn together, so the sum of all character widths is not necessarily // (and probably not) the same as the whole string width. int* tpos = new int[len+1]; size_t i; for (i=0; iGetTextExtent(str.Left(i+1), &w, &h); tpos[i] = w; } #endif #else wxArrayInt tpos; hdc->GetPartialTextExtents(str, tpos); #endif #if wxUSE_UNICODE // Map the widths for UCS-2 characters back to the UTF-8 input string // NOTE: I don't think this is right for when sizeof(wxChar) > 2, ie wxGTK2 // so figure it out and fix it! int j = 0; size_t ui = 0; while ((int)j < len) { unsigned char uch = (unsigned char)s[j]; positions[j++] = tpos[ui]; if (uch >= 0x80) { if (uch < (0x80 + 0x40 + 0x20)) { positions[j++] = tpos[ui]; } else { positions[j++] = tpos[ui]; positions[j++] = tpos[ui]; } } ui++; } #else // If not unicode then just use the widths we have #if !wxCHECK_VERSION(2, 5, 0) memcpy(positions, tpos, len * sizeof(*tpos)); #else #if wxUSE_STL std::copy(tpos.begin(), tpos.end(), positions); #else memcpy(positions, tpos.begin(), len * sizeof(int)); #endif #endif #endif #if !wxCHECK_VERSION(2, 5, 0) delete [] tpos; #endif } int SurfaceImpl::WidthText(Font &font, const char *s, int len) { SetFont(font); int w; int h; hdc->GetTextExtent(sci2wx(s, len), &w, &h); return w; } int SurfaceImpl::WidthChar(Font &font, char ch) { SetFont(font); int w; int h; char s[2] = { ch, 0 }; hdc->GetTextExtent(sci2wx(s, 1), &w, &h); return w; } #define EXTENT_TEST wxT(" `~!@#$%^&*()-_=+\\|[]{};:\"\'<,>.?/1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ") int SurfaceImpl::Ascent(Font &font) { SetFont(font); int w, h, d, e; hdc->GetTextExtent(EXTENT_TEST, &w, &h, &d, &e); font.ascent = h - d; return font.ascent; } int SurfaceImpl::Descent(Font &font) { SetFont(font); int w, h, d, e; hdc->GetTextExtent(EXTENT_TEST, &w, &h, &d, &e); return d; } int SurfaceImpl::InternalLeading(Font &WXUNUSED(font)) { return 0; } int SurfaceImpl::ExternalLeading(Font &font) { SetFont(font); int w, h, d, e; hdc->GetTextExtent(EXTENT_TEST, &w, &h, &d, &e); return e; } int SurfaceImpl::Height(Font &font) { SetFont(font); return hdc->GetCharHeight() + 1; } int SurfaceImpl::AverageCharWidth(Font &font) { SetFont(font); return hdc->GetCharWidth(); } int SurfaceImpl::SetPalette(Palette *WXUNUSED(pal), bool WXUNUSED(inBackGround)) { return 0; } void SurfaceImpl::SetClip(PRectangle rc) { hdc->SetClippingRegion(wxRectFromPRectangle(rc)); } void SurfaceImpl::FlushCachedState() { } void SurfaceImpl::SetUnicodeMode(bool unicodeMode_) { unicodeMode=unicodeMode_; } void SurfaceImpl::SetDBCSMode(int WXUNUSED(codePage)) { // dbcsMode = codePage == SC_CP_DBCS; } Surface *Surface::Allocate() { return new SurfaceImpl; } //---------------------------------------------------------------------- inline wxWindow* GETWIN(WindowID id) { return (wxWindow*)id; } Window::~Window() { } void Window::Destroy() { if (id) { Show(false); GETWIN(id)->Destroy(); } id = 0; } bool Window::HasFocus() { return wxWindow::FindFocus() == GETWIN(id); } PRectangle Window::GetPosition() { if (! id) return PRectangle(); wxRect rc(GETWIN(id)->GetPosition(), GETWIN(id)->GetSize()); return PRectangleFromwxRect(rc); } void Window::SetPosition(PRectangle rc) { wxRect r = wxRectFromPRectangle(rc); GETWIN(id)->SetSize(r); } void Window::SetPositionRelative(PRectangle rc, Window) { SetPosition(rc); // ???? } PRectangle Window::GetClientPosition() { if (! id) return PRectangle(); wxSize sz = GETWIN(id)->GetClientSize(); return PRectangle(0, 0, sz.x, sz.y); } void Window::Show(bool show) { GETWIN(id)->Show(show); } void Window::InvalidateAll() { GETWIN(id)->Refresh(false); } void Window::InvalidateRectangle(PRectangle rc) { wxRect r = wxRectFromPRectangle(rc); GETWIN(id)->Refresh(false, &r); } void Window::SetFont(Font &font) { GETWIN(id)->SetFont(*((wxFont*)font.GetID())); } void Window::SetCursor(Cursor curs) { int cursorId; switch (curs) { case cursorText: cursorId = wxCURSOR_IBEAM; break; case cursorArrow: cursorId = wxCURSOR_ARROW; break; case cursorUp: cursorId = wxCURSOR_ARROW; // ** no up arrow... wxCURSOR_UPARROW; break; case cursorWait: cursorId = wxCURSOR_WAIT; break; case cursorHoriz: cursorId = wxCURSOR_SIZEWE; break; case cursorVert: cursorId = wxCURSOR_SIZENS; break; case cursorReverseArrow: cursorId = wxCURSOR_RIGHT_ARROW; break; case cursorHand: cursorId = wxCURSOR_HAND; break; default: cursorId = wxCURSOR_ARROW; break; } #ifdef __WXMOTIF__ wxCursor wc = wxStockCursor(cursorId) ; #else wxCursor wc = wxCursor(cursorId) ; #endif if(curs != cursorLast) { GETWIN(id)->SetCursor(wc); cursorLast = curs; } } void Window::SetTitle (const char *s) { GETWIN(id)->SetLabel (sci2wx(s)); } #ifdef SCI_NAMESPACE } #endif //---------------------------------------------------------------------- // Helper classes for ListBox // This is a simple subclass of wxListView that just resets focus to the // parent when it gets it. class wxSCIListBox : public wxListView { public: wxSCIListBox (wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style) : wxListView() { #ifdef __WXMSW__ Hide(); // don't flicker as we move it around... #endif Create(parent, id, pos, size, style); } void OnFocus(wxFocusEvent& event) { GetParent()->SetFocus(); event.Skip(); } void OnKillFocus(wxFocusEvent& WXUNUSED(event)) { // Do nothing. Prevents base class from resetting the colors... } #ifdef __WXMAC__ // For some reason I don't understand yet the focus doesn't really leave // the listbox like it should, so if we get any events feed them back to // the wxSintilla void OnKeyDown(wxKeyEvent& event) { GetGrandParent()->GetEventHandler()->ProcessEvent(event); } void OnChar(wxKeyEvent& event) { GetGrandParent()->GetEventHandler()->ProcessEvent(event); } // And we need to force the focus back when being destroyed ~wxSCIListBox() { GetGrandParent()->SetFocus(); } #endif private: DECLARE_EVENT_TABLE() }; BEGIN_EVENT_TABLE(wxSCIListBox, wxListView) EVT_SET_FOCUS( wxSCIListBox::OnFocus) EVT_KILL_FOCUS(wxSCIListBox::OnKillFocus) #ifdef __WXMAC__ EVT_KEY_DOWN( wxSCIListBox::OnKeyDown) EVT_CHAR( wxSCIListBox::OnChar) #endif END_EVENT_TABLE() #if wxUSE_POPUPWIN //----------------------------------- #include // TODO: Refactor these two classes to have a common base (or a mix-in) to get // rid of the code duplication. (Either that or convince somebody to // implement wxPopupWindow for the Mac!!) // // In the meantime, be careful to duplicate any changes as needed... // A popup window to place the wxSCIListBox upon class wxSCIListBoxWin : public wxPopupWindow { private: wxListView* lv; CallBackAction doubleClickAction; void* doubleClickActionData; public: wxSCIListBoxWin(wxWindow* parent, wxWindowID id, Point WXUNUSED(location)) : wxPopupWindow(parent, wxBORDER_NONE) { SetBackgroundColour(*wxBLACK); // for our simple border lv = new wxSCIListBox(parent, id, wxDefaultPosition, wxDefaultSize, wxLC_REPORT | wxLC_SINGLE_SEL | wxLC_NO_HEADER | wxBORDER_NONE); lv->SetCursor(wxCursor(wxCURSOR_ARROW)); lv->InsertColumn(0, wxEmptyString); lv->InsertColumn(1, wxEmptyString); // NOTE: We need to fool the wxListView into thinking that it has the // focus so it will use the normal selection colour and will look // "right" to the user. But since the wxPopupWindow or its children // can't receive focus then we have to pull a fast one and temporarily // parent the listctrl on the STC window and then call SetFocus and // then reparent it back to the popup. lv->SetFocus(); lv->Reparent(this); #ifdef __WXMSW__ lv->Show(); #endif } // Set position in client coords virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO) { #if !wxCHECK_VERSION(2, 5, 0) if (x != -1) { #else if (x != wxDefaultCoord) { #endif GetParent()->ClientToScreen(&x, NULL); } #if !wxCHECK_VERSION(2, 5, 0) if (y != -1) { #else if (y != wxDefaultCoord) { #endif GetParent()->ClientToScreen(NULL, &y); } wxPopupWindow::DoSetSize(x, y, width, height, sizeFlags); } // return position as if it were in client coords virtual void DoGetPosition( int *x, int *y ) const { int sx, sy; wxPopupWindow::DoGetPosition(&sx, &sy); GetParent()->ScreenToClient(&sx, &sy); if (x) *x = sx; if (y) *y = sy; } bool Destroy() { if ( !wxPendingDelete.Member(this) ) wxPendingDelete.Append(this); return true; } int IconWidth() { wxImageList* il = lv->GetImageList(wxIMAGE_LIST_SMALL); if (il != NULL) { int w, h; il->GetSize(0, w, h); return w; } return 0; } void SetDoubleClickAction(CallBackAction action, void *data) { doubleClickAction = action; doubleClickActionData = data; } void OnFocus(wxFocusEvent& event) { GetParent()->SetFocus(); event.Skip(); } void OnSize(wxSizeEvent& event) { // resize the child wxSize sz = GetSize(); sz.x -= 2; sz.y -= 2; lv->SetSize(1, 1, sz.x, sz.y); // reset the column widths lv->SetColumnWidth(0, IconWidth()+4); lv->SetColumnWidth(1, sz.x - 2 - lv->GetColumnWidth(0) - wxSystemSettings::GetMetric(wxSYS_VSCROLL_X)); event.Skip(); } void OnActivate(wxListEvent& WXUNUSED(event)) { doubleClickAction(doubleClickActionData); } wxListView* GetLB() { return lv; } private: DECLARE_EVENT_TABLE() }; BEGIN_EVENT_TABLE(wxSCIListBoxWin, wxPopupWindow) EVT_SET_FOCUS ( wxSCIListBoxWin::OnFocus) EVT_SIZE ( wxSCIListBoxWin::OnSize) EVT_LIST_ITEM_ACTIVATED(wxID_ANY, wxSCIListBoxWin::OnActivate) END_EVENT_TABLE() #else // wxUSE_POPUPWIN ----------------------------------- // A normal window to place the wxSCIListBox upon. class wxSCIListBoxWin : public wxWindow { private: wxListView* lv; CallBackAction doubleClickAction; void* doubleClickActionData; public: wxSCIListBoxWin(wxWindow* parent, wxWindowID id, Point location) : wxWindow(parent, id, wxPoint(location.x, location.y), wxSize(0,0), wxSIMPLE_BORDER) { lv = new wxSCIListBox(this, id, wxDefaultPosition, wxDefaultSize, wxLC_REPORT | wxLC_SINGLE_SEL | wxLC_NO_HEADER | wxNO_BORDER); lv->SetCursor(wxCursor(wxCURSOR_ARROW)); lv->InsertColumn(0, wxEmptyString); lv->InsertColumn(1, wxEmptyString); // Eventhough we immediately reset the focus to the parent, this helps // things to look right... lv->SetFocus(); Hide(); } // On OSX and (possibly others) there can still be pending // messages/events for the list control when Scintilla wants to // close it, so do a pending delete of it instead of destroying // immediately. bool Destroy() { #ifdef __WXMAC__ // The bottom edge of this window is not getting properly // refreshed upon deletion, so help it out... wxWindow* p = GetParent(); wxRect r(GetPosition(), GetSize()); r.SetHeight(r.GetHeight()+1); p->Refresh(false, &r); #endif if ( !wxPendingDelete.Member(this) ) wxPendingDelete.Append(this); return true; } int IconWidth() { wxImageList* il = lv->GetImageList(wxIMAGE_LIST_SMALL); if (il != NULL) { int w, h; il->GetSize(0, w, h); return w; } return 0; } void SetDoubleClickAction(CallBackAction action, void *data) { doubleClickAction = action; doubleClickActionData = data; } void OnFocus(wxFocusEvent& event) { GetParent()->SetFocus(); event.Skip(); } void OnSize(wxSizeEvent& event) { // resize the child wxSize sz = GetClientSize(); lv->SetSize(sz); // reset the column widths lv->SetColumnWidth(0, IconWidth()+4); lv->SetColumnWidth(1, sz.x - 2 - lv->GetColumnWidth(0) - wxSystemSettings::GetMetric(wxSYS_VSCROLL_X)); event.Skip(); } #ifdef __WXMAC__ virtual bool Show(bool show = true) { bool rv = wxWindow::Show(show); GetParent()->Refresh(false); return rv; } #endif void OnActivate(wxListEvent& WXUNUSED(event)) { doubleClickAction(doubleClickActionData); } wxListView* GetLB() { return lv; } private: DECLARE_EVENT_TABLE() }; BEGIN_EVENT_TABLE(wxSCIListBoxWin, wxWindow) EVT_SET_FOCUS ( wxSCIListBoxWin::OnFocus) EVT_SIZE ( wxSCIListBoxWin::OnSize) EVT_LIST_ITEM_ACTIVATED(wxID_ANY, wxSCIListBoxWin::OnActivate) END_EVENT_TABLE() #endif // wxUSE_POPUPWIN ----------------------------------- inline wxSCIListBoxWin* GETLBW(WindowID win) { return ((wxSCIListBoxWin*)win); } inline wxListView* GETLB(WindowID win) { return GETLBW(win)->GetLB(); } //---------------------------------------------------------------------- class ListBoxImpl : public ListBox { private: int lineHeight; bool unicodeMode; int desiredVisibleRows; int aveCharWidth; size_t maxStrWidth; Point location; // Caret location at which the list is opened wxImageList* imgList; wxArrayInt* imgTypeMap; public: ListBoxImpl(); ~ListBoxImpl(); virtual void SetFont(Font &font); virtual void Create(Window &parent, int ctrlID, Point location_, int lineHeight_, bool unicodeMode_); virtual void SetAverageCharWidth(int width); virtual void SetVisibleRows(int rows); virtual int GetVisibleRows() const; virtual PRectangle GetDesiredRect(); virtual int CaretFromEdge(); virtual void Clear(); virtual void Append(char *s, int type = -1); virtual void Append(const wxString& text, int type); virtual int Length(); virtual void Select(int n); virtual int GetSelection(); virtual int Find(const char *prefix); virtual void GetValue(int n, char *value, int len); virtual void RegisterImage(int type, const char *xpm_data); virtual void ClearRegisteredImages(); virtual void SetDoubleClickAction(CallBackAction, void *); virtual void SetList(const char* list, char separator, char typesep); }; ListBoxImpl::ListBoxImpl() : lineHeight(10), unicodeMode(false), desiredVisibleRows(5), aveCharWidth(8), maxStrWidth(0), imgList(NULL), imgTypeMap(NULL) { } ListBoxImpl::~ListBoxImpl() { if (imgList) { delete imgList; imgList = NULL; } if (imgTypeMap) { delete imgTypeMap; imgTypeMap = NULL; } } void ListBoxImpl::SetFont(Font &font) { GETLB(id)->SetFont(*((wxFont*)font.GetID())); } void ListBoxImpl::Create (Window &parent, int ctrlID, Point location_, int lineHeight_, bool unicodeMode_) { lineHeight = lineHeight_; unicodeMode = unicodeMode_; maxStrWidth = 0; id = new wxSCIListBoxWin (GETWIN(parent.GetID()), ctrlID, location_); if (imgList != NULL) GETLB(id)->SetImageList (imgList, wxIMAGE_LIST_SMALL); } void ListBoxImpl::SetAverageCharWidth(int width) { aveCharWidth = width; } void ListBoxImpl::SetVisibleRows(int rows) { desiredVisibleRows = rows; } int ListBoxImpl::GetVisibleRows() const { return desiredVisibleRows; } PRectangle ListBoxImpl::GetDesiredRect() { // wxListCtrl doesn't have a DoGetBestSize, so instead we kept track of // the max size in Append and calculate it here... int maxw = maxStrWidth * aveCharWidth; int maxh ; // give it a default if there are no lines, and/or add a bit more if (maxw == 0) maxw = 100; maxw += aveCharWidth * 3 + GETLBW(id)->IconWidth() + wxSystemSettings::GetMetric(wxSYS_VSCROLL_X); if (maxw > 350) maxw = 350; // estimate a desired height int count = GETLB(id)->GetItemCount(); if (count) { wxRect rect; GETLB(id)->GetItemRect(0, rect); maxh = count * rect.GetHeight(); if (maxh > 140) // TODO: Use desiredVisibleRows?? maxh = 140; // Try to make the size an exact multiple of some number of lines int lines = maxh / rect.GetHeight(); maxh = (lines + 1) * rect.GetHeight() + 2; } else maxh = 100; PRectangle rc; rc.top = 0; rc.left = 0; rc.right = maxw; rc.bottom = maxh; return rc; } int ListBoxImpl::CaretFromEdge() { return 4 + GETLBW(id)->IconWidth(); } void ListBoxImpl::Clear() { GETLB(id)->DeleteAllItems(); } void ListBoxImpl::Append(char *s, int type) { Append(sci2wx(s), type); } void ListBoxImpl::Append(const wxString& text, int type) { long count = GETLB(id)->GetItemCount(); long itemID = GETLB(id)->InsertItem(count, wxEmptyString); GETLB(id)->SetItem(itemID, 1, text); maxStrWidth = wxMax(maxStrWidth, text.length()); if (type != -1) { wxCHECK_RET(imgTypeMap, wxT("Unexpected NULL imgTypeMap")); long idx = imgTypeMap->Item(type); GETLB(id)->SetItemImage(itemID, idx, idx); } } int ListBoxImpl::Length() { return GETLB(id)->GetItemCount(); } void ListBoxImpl::Select(int n) { bool select = true; if (n == -1) { n = 0; select = false; } GETLB(id)->Focus(n); GETLB(id)->Select(n, select); } int ListBoxImpl::GetSelection() { return GETLB(id)->GetFirstSelected(); } int ListBoxImpl::Find(const char *WXUNUSED(prefix)) { // No longer used return wxNOT_FOUND; } void ListBoxImpl::GetValue(int n, char *value, int len) { wxListItem item; item.SetId(n); item.SetColumn(1); item.SetMask(wxLIST_MASK_TEXT); GETLB(id)->GetItem(item); strncpy(value, wx2sci(item.GetText()), len); value[len-1] = '\0'; } void ListBoxImpl::RegisterImage(int type, const char *xpm_data) { wxMemoryInputStream stream(xpm_data, strlen(xpm_data)+1); wxImage img(stream, wxBITMAP_TYPE_XPM); wxBitmap bmp(img); if (! imgList) { // assumes all images are the same size imgList = new wxImageList(bmp.GetWidth(), bmp.GetHeight(), true); imgTypeMap = new wxArrayInt; } int idx = imgList->Add(bmp); // do we need to extend the mapping array? wxArrayInt& itm = *imgTypeMap; if ( itm.GetCount() < (size_t)type+1) itm.Add(-1, type - itm.GetCount() + 1); // Add an item that maps type to the image index itm[type] = idx; } void ListBoxImpl::ClearRegisteredImages() { if (imgList) { delete imgList; imgList = NULL; } if (imgTypeMap) { delete imgTypeMap; imgTypeMap = NULL; } if (id) GETLB(id)->SetImageList(NULL, wxIMAGE_LIST_SMALL); } void ListBoxImpl::SetDoubleClickAction(CallBackAction action, void *data) { GETLBW(id)->SetDoubleClickAction(action, data); } void ListBoxImpl::SetList(const char* list, char separator, char typesep) { GETLB(id)->Freeze(); Clear(); wxStringTokenizer tkzr(sci2wx(list), (wxChar)separator); while (tkzr.HasMoreTokens()) { wxString token = tkzr.GetNextToken(); long type = -1; int pos = token.Find(typesep); if (pos != -1) { token.Mid(pos+1).ToLong(&type); token.Truncate(pos); } Append (token, (int)type); } GETLB(id)->Thaw(); } ListBox::ListBox() { } ListBox::~ListBox() { } ListBox *ListBox::Allocate() { return new ListBoxImpl(); } #ifdef SCI_NAMESPACE namespace Scintilla { #endif //---------------------------------------------------------------------- Menu::Menu() : id(0) { } void Menu::CreatePopUp() { Destroy(); id = new wxMenu(); } void Menu::Destroy() { if (id) delete (wxMenu*)id; id = 0; } void Menu::Show(Point pt, Window &w) { GETWIN(w.GetID())->PopupMenu((wxMenu*)id, pt.x - 4, pt.y); Destroy(); } //---------------------------------------------------------------------- DynamicLibrary *DynamicLibrary::Load(const char *WXUNUSED(modulePath)) { wxFAIL_MSG(wxT("Dynamic lexer loading not implemented yet")); return NULL; } //---------------------------------------------------------------------- ColourDesired Platform::Chrome() { wxColour c; c = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE); return ColourDesired(c.Red(), c.Green(), c.Blue()); } ColourDesired Platform::ChromeHighlight() { wxColour c; c = wxSystemSettings::GetColour(wxSYS_COLOUR_3DHIGHLIGHT); return ColourDesired(c.Red(), c.Green(), c.Blue()); } const char *Platform::DefaultFont() { static char buf[128]; strcpy(buf, wxNORMAL_FONT->GetFaceName().mbc_str()); return buf; } int Platform::DefaultFontSize() { return wxNORMAL_FONT->GetPointSize(); } unsigned int Platform::DoubleClickTime() { return 500; // **** ::GetDoubleClickTime(); } bool Platform::MouseButtonBounce() { return false; } void Platform::DebugDisplay(const char *s) { wxLogDebug(sci2wx(s)); } bool Platform::IsKeyDown(int WXUNUSED(key)) { return false; // I don't think we'll need this. } long Platform::SendScintilla(WindowID w, unsigned int msg, unsigned long wParam, long lParam) { wxScintilla* sci = (wxScintilla*)w; return sci->SendMsg(msg, wParam, lParam); } long Platform::SendScintillaPointer(WindowID w, unsigned int msg, unsigned long wParam, void *lParam) { wxScintilla* sci = (wxScintilla*)w; return sci->SendMsg(msg, wParam, (long)lParam); } // These are utility functions not really tied to a platform int Platform::Minimum(int a, int b) { if (a < b) return a; else return b; } int Platform::Maximum(int a, int b) { if (a > b) return a; else return b; } #define TRACE void Platform::DebugPrintf(const char *format, ...) { #ifdef TRACE char buffer[2000]; va_list pArguments; va_start(pArguments, format); vsprintf(buffer,format,pArguments); va_end(pArguments); Platform::DebugDisplay(buffer); #endif } static bool assertionPopUps = true; bool Platform::ShowAssertionPopUps(bool assertionPopUps_) { bool ret = assertionPopUps; assertionPopUps = assertionPopUps_; return ret; } void Platform::Assert(const char *c, const char *file, int line) { char buffer[2000]; sprintf(buffer, "Assertion [%s] failed at %s %d", c, file, line); if (assertionPopUps) { /*int idButton = */ wxMessageBox(sci2wx(buffer), wxT("Assertion failure"), wxICON_HAND | wxOK); // if (idButton == IDRETRY) { // ::DebugBreak(); // } else if (idButton == IDIGNORE) { // // all OK // } else { // abort(); // } } else { strcat(buffer, "\r\n"); Platform::DebugDisplay(buffer); abort(); } } int Platform::Clamp(int val, int minVal, int maxVal) { if (val > maxVal) val = maxVal; if (val < minVal) val = minVal; return val; } bool Platform::IsDBCSLeadByte(int WXUNUSED(codePage), char WXUNUSED(ch)) { return false; } int Platform::DBCSCharLength(int WXUNUSED(codePage), const char *WXUNUSED(s)) { return 1; } int Platform::DBCSCharMaxLength() { return 1; } #ifdef __APPLE__ // [CHANGED] bool Platform::WaitMouseMoved( #ifdef SCI_NAMESPACE Scintilla:: #endif Point pt) { return false; /*::Point mpt; mpt.v = pt.x; mpt.h = pt.y; return ::WaitMouseMoved(mpt);*/} // [CHANGED] #endif // [CHAMGED] ElapsedTime::ElapsedTime() { wxLongLong localTime = wxGetLocalTimeMillis(); littleBit = localTime.GetLo(); bigBit = localTime.GetHi(); } double ElapsedTime::Duration(bool reset) { wxLongLong prevTime(bigBit, littleBit); wxLongLong localTime = wxGetLocalTimeMillis(); if(reset) { littleBit = localTime.GetLo(); bigBit = localTime.GetHi(); } wxLongLong duration = localTime - prevTime; double result = duration.ToDouble(); result /= 1000.0; return result; } #ifdef SCI_NAMESPACE } // end namespace Scintilla #endif //---------------------------------------------------------------------- #if wxUSE_UNICODE #include "UniConversion.h" // Convert using Scintilla's functions instead of wx's, Scintilla's are more // forgiving and won't assert... wxString sci2wx(const char* str, size_t len) { if (!len) return wxEmptyString; size_t wclen = UCS2Length(str, len); wxWCharBuffer buffer(wclen+1); size_t actualLen = UCS2FromUTF8(str, len, buffer.data(), wclen+1); return wxString(buffer.data(), actualLen); } const wxWX2MBbuf wx2stc(const wxString& str) { const wchar_t* wcstr = str.c_str(); size_t wclen = str.length(); size_t len = UTF8Length(wcstr, wclen); wxCharBuffer buffer(len+1); UTF8FromUCS2(wcstr, wclen, buffer.data(), len); // TODO check NULL termination!! return buffer; } #endif wxformbuilder-3.1.59/src/controls/build/propgrid/premake.lua0000644000175000017500000002437511143440026024470 0ustar rrmulderrrmulder--***************************************************************************** --* Author: RJP Computing --* Date: 12/15/2006 --* Version: 1.00-beta --* Copyright (C) 2006 RJP Computing --* --* This program is free software; you can redistribute it and/or --* modify it under the terms of the GNU General Public License --* as published by the Free Software Foundation; either version 2 --* of the License, or (at your option) any later version. --* --* This program is distributed in the hope that it will be useful, --* but WITHOUT ANY WARRANTY; without even the implied warranty of --* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --* GNU General Public License for more details. --* --* You should have received a copy of the GNU General Public License --* along with this program; if not, write to the Free Software --* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --* --* NOTES: --* - use the '/' slash for all paths. --***************************************************************************** function trim (s) return (string.gsub(s, "^%s*(.-)%s*$", "%1")) end -- wxWidgets version local wx_ver = "28" local wx_ver_minor = "" local wx_custom = "_wxfb" --******* Initial Setup ************ --* Most of the setting are set here. --********************************** -- Set the name of your package. package.name = "wxPropGrid" -- Set this if you want a different name for your target than the package's name. local targetName = "propgrid" -- Set the kind of package you want to create. -- Options: exe | winexe | lib | dll package.kind = "dll" -- Set the files to include. package.files = { matchfiles( "../../src/propgrid/*.cpp", "../../include/wx/propgrid/*.h") } -- Set the include paths. package.includepaths = { "../../include" } -- Set the defines. package.defines = { "WXMAKINGDLL_PROPGRID", "MONOLITHIC" } --------------------------- DO NOT EDIT BELOW ---------------------------------- --******* GENAERAL SETUP ********** --* Settings that are not dependant --* on the operating system. --********************************* -- Package options addoption( "unicode", "Use the Unicode character set" ) addoption( "with-wx-shared", "Link against wxWidgets as a shared library" ) if ( not windows ) then addoption( "disable-wx-debug", "Compile against a wxWidgets library without debugging" ) end -- Common setup package.language = "c++" -- Set object output directory. if ( options["unicode"] ) then package.config["Debug"].objdir = ".objsud" package.config["Release"].objdir = ".objsu" else package.config["Debug"].objdir = ".objsd" package.config["Release"].objdir = ".objs" end -- Set debug flags if ( options["disable-wx-debug"] and ( not windows ) ) then debug_option = "--debug=no" debug_macro = { "NDEBUG", "__WXFB_DEBUG__" } else debug_option = "--debug=yes" debug_macro = { "DEBUG", "_DEBUG", "__WXDEBUG__" } end -- Set the default targetName if none is specified. if ( string.len( targetName ) == 0 ) then targetName = package.name end -- Set the build options. package.buildflags = { "extra-warnings" } package.config["Release"].buildflags = { "no-symbols", "optimize-speed" } if ( options["unicode"] ) then table.insert( package.buildflags, "unicode" ) end if ( string.find( target or "", ".*-gcc" ) or target == "gnu" ) then table.insert( package.buildflags, "no-import-lib" ) table.insert( package.config["Debug"].buildoptions, "-O0" ) table.insert( package.config["Release"].buildoptions, "-fno-strict-aliasing" ) end -- Set the defines. if ( options["with-wx-shared"] ) then table.insert( package.defines, "WXUSINGDLL" ) end if ( options["unicode"] ) then table.insert( package.defines, { "UNICODE", "_UNICODE" } ) end table.insert( package.defines, "__WX__" ) table.insert( package.config["Debug"].defines, debug_macro ) table.insert( package.config["Release"].defines, "NDEBUG" ) if ( windows ) then --******* WINDOWS SETUP *********** --* Settings that are Windows specific. --********************************* -- Set wxWidgets include paths if ( target == "cb-gcc" ) then table.insert( package.includepaths, "$(#WX.include)" ) else table.insert( package.includepaths, "$(WXWIN)/include" ) end -- Set the correct 'setup.h' include path. if ( options["with-wx-shared"] ) then if ( options["unicode"] ) then if ( target == "cb-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(#WX.lib)/gcc_dll/mswud" ) table.insert( package.config["Release"].includepaths, "$(#WX.lib)/gcc_dll/mswu" ) elseif ( target == "gnu" or target == "cl-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/gcc_dll/mswud" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/gcc_dll/mswu" ) else table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/vc_dll/mswud" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/vc_dll/mswu" ) end else if ( target == "cb-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(#WX.lib)/gcc_dll/mswd" ) table.insert( package.config["Release"].includepaths, "$(#WX.lib)/gcc_dll/msw" ) elseif ( target == "gnu" or target == "cl-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/gcc_dll/mswd" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/gcc_dll/msw" ) else table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/vc_dll/mswd" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/vc_dll/msw" ) end end else if ( options["unicode"] ) then if ( target == "cb-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(#WX.lib)/gcc_lib/mswud" ) table.insert( package.config["Release"].includepaths, "$(#WX.lib)/gcc_lib/mswu" ) elseif ( target == "gnu" or target == "cl-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/gcc_lib/mswud" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/gcc_lib/mswu" ) else table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/vc_lib/mswud" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/vc_lib/mswu" ) end else if ( target == "cb-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(#WX.lib)/gcc_lib/mswd" ) table.insert( package.config["Release"].includepaths, "$(#WX.lib)/gcc_lib/msw" ) elseif ( target == "gnu" or target == "cl-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/gcc_lib/mswd" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/gcc_lib/msw" ) else table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/vc_lib/mswd" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/vc_lib/msw" ) end end end -- Set the linker options. if ( options["with-wx-shared"] ) then if ( target == "cb-gcc" ) then table.insert( package.libpaths, "$(#WX.lib)/gcc_dll" ) elseif ( target == "gnu" or target == "cl-gcc" ) then table.insert( package.libpaths, "$(WXWIN)/lib/gcc_dll" ) else table.insert( package.libpaths, "$(WXWIN)/lib/vc_dll" ) end else if ( target == "cb-gcc" ) then table.insert( package.libpaths, "$(#WX.lib)/gcc_lib" ) elseif ( target == "gnu" or target == "cl-gcc" ) then table.insert( package.libpaths, "$(WXWIN)/lib/gcc_lib" ) else table.insert( package.libpaths, "$(WXWIN)/lib/vc_lib" ) end end -- Set wxWidgets libraries to link. if ( options["unicode"] ) then table.insert( package.config["Release"].links, "wxmsw"..wx_ver.."u" ) table.insert( package.config["Debug"].links, "wxmsw"..wx_ver.."ud" ) else table.insert( package.config["Release"].links, "wxmsw"..wx_ver ) table.insert( package.config["Debug"].links, "wxmsw"..wx_ver.."d" ) end -- Set the Windows defines. table.insert( package.defines, { "__WXMSW__", "WIN32", "_WINDOWS" } ) -- Set the targets. if ( string.find( target or "", ".*-gcc" ) or target == "gnu" ) then if ( options["unicode"] ) then package.config["Debug"].target = "wxmsw"..wx_ver..wx_ver_minor.."umd_"..targetName.."_gcc"..wx_custom package.config["Release"].target = "wxmsw"..wx_ver..wx_ver_minor.."um_"..targetName.."_gcc"..wx_custom else package.config["Debug"].target = "wxmsw"..wx_ver..wx_ver_minor.."md_"..targetName.."_gcc"..wx_custom package.config["Release"].target = "wxmsw"..wx_ver..wx_ver_minor.."m_"..targetName.."_gcc"..wx_custom end else if ( options["unicode"] ) then package.config["Debug"].target = "wxmsw"..wx_ver..wx_ver_minor.."umd_"..targetName.."_vc"..wx_custom package.config["Release"].target = "wxmsw"..wx_ver..wx_ver_minor.."um_"..targetName.."_vc"..wx_custom else package.config["Debug"].target = "wxmsw"..wx_ver..wx_ver_minor.."md_"..targetName.."_vc"..wx_custom package.config["Release"].target = "wxmsw"..wx_ver..wx_ver_minor.."m_"..targetName.."_vc"..wx_custom end end else --******* LINUX/MAC SETUP ************* --* Settings that are Linux/Mac specific. --************************************* -- Ignore resource files in Linux/Mac. table.insert( package.excludes, matchrecursive( "*.rc" ) ) table.insert( package.buildoptions, "-fPIC" ) -- Set wxWidgets build options. table.insert( package.config["Debug"].buildoptions, "`wx-config "..debug_option.." --cflags`" ) table.insert( package.config["Release"].buildoptions, "`wx-config --debug=no --cflags`" ) -- Set the wxWidgets link options. table.insert( package.config["Debug"].linkoptions, "`wx-config "..debug_option.." --libs`" ) table.insert( package.config["Release"].linkoptions, "`wx-config --libs`" ) -- Add buildflag for proper dll building. if ( macosx ) then table.insert( package.buildflags, "dylib" ) end -- Get wxWidgets lib names local wxconfig = io.popen("wx-config " .. debug_option .. " --basename") local debugBasename = trim( wxconfig:read("*a") ) wxconfig:close() wxconfig = io.popen("wx-config --debug=no --basename") local basename = trim( wxconfig:read("*a") ) wxconfig:close() wxconfig = io.popen("wx-config --release") local release = trim( wxconfig:read("*a") ) wxconfig:close() -- Set the targets. package.config["Debug"].target = debugBasename .. "_" .. targetName .. "-" .. release .. wx_custom package.config["Release"].target = basename .. "_" .. targetName .. "-" .. release .. wx_custom end wxformbuilder-3.1.59/src/controls/build/propgrid/Makefile0000644000175000017500000000762711143440026024002 0ustar rrmulderrrmulder# C++ Windowed Executable Makefile autogenerated by premake # Don't edit this file! Instead edit `premake.lua` then rerun `make` ifndef CONFIG CONFIG=Release endif ifeq ($(CONFIG),Release) BINDIR := ../../../../output/lib/wxformbuilder LIBDIR := ../../../.. OBJDIR := .objsu OUTDIR := ../../../../output/lib/wxformbuilder CPPFLAGS := -MMD -D "WXMAKINGDLL_PROPGRID" -D "MONOLITHIC" -D "WXUSINGDLL" -D "UNICODE" -D "_UNICODE" -D "__WX__" -D "NDEBUG" -I "../../include" CFLAGS += $(CPPFLAGS) $(TARGET_ARCH) -fPIC -O3 -Wall -fPIC -fno-strict-aliasing `wx-config --debug=no --cflags` CXXFLAGS := $(CFLAGS) LDFLAGS += -L$(BINDIR) -L$(LIBDIR) -shared -s `wx-config --libs` LDDEPS := RESFLAGS := -D "WXMAKINGDLL_PROPGRID" -D "MONOLITHIC" -D "WXUSINGDLL" -D "UNICODE" -D "_UNICODE" -D "__WX__" -D "NDEBUG" -I "../../include" TARGET := libwx_gtk2u_propgrid-2.8_wxfb.so BLDCMD = $(CXX) -o $(OUTDIR)/$(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(TARGET_ARCH) endif ifeq ($(CONFIG),Debug) BINDIR := ../../../../output/lib/wxformbuilder LIBDIR := ../../../.. OBJDIR := .objsud OUTDIR := ../../../../output/lib/wxformbuilder CPPFLAGS := -MMD -D "WXMAKINGDLL_PROPGRID" -D "MONOLITHIC" -D "WXUSINGDLL" -D "UNICODE" -D "_UNICODE" -D "__WX__" -D "NDEBUG" -D "__WXFB_DEBUG__" -I "../../include" CFLAGS += $(CPPFLAGS) $(TARGET_ARCH) -fPIC -g -Wall -fPIC -O0 `wx-config --debug=no --cflags` CXXFLAGS := $(CFLAGS) LDFLAGS += -L$(BINDIR) -L$(LIBDIR) -shared `wx-config --debug=no --libs` LDDEPS := RESFLAGS := -D "WXMAKINGDLL_PROPGRID" -D "MONOLITHIC" -D "WXUSINGDLL" -D "UNICODE" -D "_UNICODE" -D "__WX__" -D "NDEBUG" -D "__WXFB_DEBUG__" -I "../../include" TARGET := libwx_gtk2u_propgrid-2.8_wxfb.so BLDCMD = $(CXX) -o $(OUTDIR)/$(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(TARGET_ARCH) endif OBJECTS := \ $(OBJDIR)/props.o \ $(OBJDIR)/propgrid.o \ $(OBJDIR)/manager.o \ $(OBJDIR)/advprops.o \ $(OBJDIR)/odcombo.o \ $(OBJDIR)/extras.o \ MKDIR_TYPE := msdos CMD := $(subst \,\\,$(ComSpec)$(COMSPEC)) ifeq (,$(CMD)) MKDIR_TYPE := posix endif ifeq (/bin/sh.exe,$(SHELL)) MKDIR_TYPE := posix endif ifeq ($(MKDIR_TYPE),posix) CMD_MKBINDIR := mkdir -p $(BINDIR) CMD_MKLIBDIR := mkdir -p $(LIBDIR) CMD_MKOUTDIR := mkdir -p $(OUTDIR) CMD_MKOBJDIR := mkdir -p $(OBJDIR) else CMD_MKBINDIR := $(CMD) /c if not exist $(subst /,\\,$(BINDIR)) mkdir $(subst /,\\,$(BINDIR)) CMD_MKLIBDIR := $(CMD) /c if not exist $(subst /,\\,$(LIBDIR)) mkdir $(subst /,\\,$(LIBDIR)) CMD_MKOUTDIR := $(CMD) /c if not exist $(subst /,\\,$(OUTDIR)) mkdir $(subst /,\\,$(OUTDIR)) CMD_MKOBJDIR := $(CMD) /c if not exist $(subst /,\\,$(OBJDIR)) mkdir $(subst /,\\,$(OBJDIR)) endif .PHONY: clean $(OUTDIR)/$(TARGET): $(OBJECTS) $(LDDEPS) $(RESOURCES) @echo Linking wxPropGrid -@$(CMD_MKBINDIR) -@$(CMD_MKLIBDIR) -@$(CMD_MKOUTDIR) @$(BLDCMD) clean: @echo Cleaning wxPropGrid ifeq ($(MKDIR_TYPE),posix) -@rm -f $(OUTDIR)/$(TARGET) -@rm -rf $(OBJDIR) else -@if exist $(subst /,\,$(OUTDIR)/$(TARGET)) del /q $(subst /,\,$(OUTDIR)/$(TARGET)) -@if exist $(subst /,\,$(OBJDIR)) del /q $(subst /,\,$(OBJDIR)) -@if exist $(subst /,\,$(OBJDIR)) rmdir /s /q $(subst /,\,$(OBJDIR)) endif $(OBJDIR)/props.o: ../../src/propgrid/props.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/propgrid.o: ../../src/propgrid/propgrid.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/manager.o: ../../src/propgrid/manager.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/advprops.o: ../../src/propgrid/advprops.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/odcombo.o: ../../src/propgrid/odcombo.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/extras.o: ../../src/propgrid/extras.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -include $(OBJECTS:%.o=%.d) wxformbuilder-3.1.59/src/controls/build/wxFlatNotebook/premake.lua0000644000175000017500000002441511143440026025603 0ustar rrmulderrrmulder--***************************************************************************** --* Author: RJP Computing --* Date: 12/15/2006 --* Version: 1.00-beta --* Copyright (C) 2006 RJP Computing --* --* This program is free software; you can redistribute it and/or --* modify it under the terms of the GNU General Public License --* as published by the Free Software Foundation; either version 2 --* of the License, or (at your option) any later version. --* --* This program is distributed in the hope that it will be useful, --* but WITHOUT ANY WARRANTY; without even the implied warranty of --* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --* GNU General Public License for more details. --* --* You should have received a copy of the GNU General Public License --* along with this program; if not, write to the Free Software --* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --* --* NOTES: --* - use the '/' slash for all paths. --***************************************************************************** function trim (s) return (string.gsub(s, "^%s*(.-)%s*$", "%1")) end -- wxWidgets version local wx_ver = "28" local wx_ver_minor = "" local wx_custom = "_wxfb" --******* Initial Setup ************ --* Most of the setting are set here. --********************************** -- Set the name of your package. package.name = "wxFlatNotebook" -- Set this if you want a different name for your target than the package's name. local targetName = "flatnotebook" -- Set the kind of package you want to create. -- Options: exe | winexe | lib | dll package.kind = "dll" -- Set the files to include. package.files = { matchfiles( "../../src/wxFlatNotebook/*.cpp", "../../include/wx/wxFlatNotebook/*.h" ) } -- Set the include paths. package.includepaths = { "../../include" } -- Set the defines. package.defines = { "WXMAKINGDLL_FNB", "MONOLITHIC" } --------------------------- DO NOT EDIT BELOW ---------------------------------- --******* GENAERAL SETUP ********** --* Settings that are not dependant --* on the operating system. --********************************* -- Package options addoption( "unicode", "Use the Unicode character set" ) addoption( "with-wx-shared", "Link against wxWidgets as a shared library" ) if ( not windows ) then addoption( "disable-wx-debug", "Compile against a wxWidgets library without debugging" ) end -- Common setup package.language = "c++" -- Set object output directory. if ( options["unicode"] ) then package.config["Debug"].objdir = ".objsud" package.config["Release"].objdir = ".objsu" else package.config["Debug"].objdir = ".objsd" package.config["Release"].objdir = ".objs" end -- Set debug flags if ( options["disable-wx-debug"] and ( not windows ) ) then debug_option = "--debug=no" debug_macro = { "NDEBUG", "__WXFB_DEBUG__" } else debug_option = "--debug=yes" debug_macro = { "DEBUG", "_DEBUG", "__WXDEBUG__" } end -- Set the default targetName if none is specified. if ( string.len( targetName ) == 0 ) then targetName = package.name end -- Set the build options. package.buildflags = { "extra-warnings" } package.config["Release"].buildflags = { "no-symbols", "optimize-speed" } if ( options["unicode"] ) then table.insert( package.buildflags, "unicode" ) end if ( string.find( target or "", ".*-gcc" ) or target == "gnu" ) then table.insert( package.buildflags, "no-import-lib" ) table.insert( package.config["Debug"].buildoptions, "-O0" ) table.insert( package.config["Release"].buildoptions, "-fno-strict-aliasing" ) end -- Set the defines. if ( options["with-wx-shared"] ) then table.insert( package.defines, "WXUSINGDLL" ) end if ( options["unicode"] ) then table.insert( package.defines, { "UNICODE", "_UNICODE" } ) end table.insert( package.defines, "__WX__" ) table.insert( package.config["Debug"].defines, debug_macro ) table.insert( package.config["Release"].defines, "NDEBUG" ) if ( windows ) then --******* WINDOWS SETUP *********** --* Settings that are Windows specific. --********************************* -- Set wxWidgets include paths if ( target == "cb-gcc" ) then table.insert( package.includepaths, "$(#WX.include)" ) else table.insert( package.includepaths, "$(WXWIN)/include" ) end -- Set the correct 'setup.h' include path. if ( options["with-wx-shared"] ) then if ( options["unicode"] ) then if ( target == "cb-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(#WX.lib)/gcc_dll/mswud" ) table.insert( package.config["Release"].includepaths, "$(#WX.lib)/gcc_dll/mswu" ) elseif ( target == "gnu" or target == "cl-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/gcc_dll/mswud" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/gcc_dll/mswu" ) else table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/vc_dll/mswud" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/vc_dll/mswu" ) end else if ( target == "cb-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(#WX.lib)/gcc_dll/mswd" ) table.insert( package.config["Release"].includepaths, "$(#WX.lib)/gcc_dll/msw" ) elseif ( target == "gnu" or target == "cl-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/gcc_dll/mswd" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/gcc_dll/msw" ) else table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/vc_dll/mswd" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/vc_dll/msw" ) end end else if ( options["unicode"] ) then if ( target == "cb-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(#WX.lib)/gcc_lib/mswud" ) table.insert( package.config["Release"].includepaths, "$(#WX.lib)/gcc_lib/mswu" ) elseif ( target == "gnu" or target == "cl-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/gcc_lib/mswud" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/gcc_lib/mswu" ) else table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/vc_lib/mswud" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/vc_lib/mswu" ) end else if ( target == "cb-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(#WX.lib)/gcc_lib/mswd" ) table.insert( package.config["Release"].includepaths, "$(#WX.lib)/gcc_lib/msw" ) elseif ( target == "gnu" or target == "cl-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/gcc_lib/mswd" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/gcc_lib/msw" ) else table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/vc_lib/mswd" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/vc_lib/msw" ) end end end -- Set the linker options. if ( options["with-wx-shared"] ) then if ( target == "cb-gcc" ) then table.insert( package.libpaths, "$(#WX.lib)/gcc_dll" ) elseif ( target == "gnu" or target == "cl-gcc" ) then table.insert( package.libpaths, "$(WXWIN)/lib/gcc_dll" ) else table.insert( package.libpaths, "$(WXWIN)/lib/vc_dll" ) end else if ( target == "cb-gcc" ) then table.insert( package.libpaths, "$(#WX.lib)/gcc_lib" ) elseif ( target == "gnu" or target == "cl-gcc" ) then table.insert( package.libpaths, "$(WXWIN)/lib/gcc_lib" ) else table.insert( package.libpaths, "$(WXWIN)/lib/vc_lib" ) end end -- Set wxWidgets libraries to link. if ( options["unicode"] ) then table.insert( package.config["Release"].links, "wxmsw"..wx_ver.."u" ) table.insert( package.config["Debug"].links, "wxmsw"..wx_ver.."ud" ) else table.insert( package.config["Release"].links, "wxmsw"..wx_ver ) table.insert( package.config["Debug"].links, "wxmsw"..wx_ver.."d" ) end -- Set the Windows defines. table.insert( package.defines, { "__WXMSW__", "WIN32", "_WINDOWS" } ) -- Set the targets. if ( string.find( target or "", ".*-gcc" ) or target == "gnu" ) then if ( options["unicode"] ) then package.config["Debug"].target = "wxmsw"..wx_ver..wx_ver_minor.."umd_"..targetName.."_gcc"..wx_custom package.config["Release"].target = "wxmsw"..wx_ver..wx_ver_minor.."um_"..targetName.."_gcc"..wx_custom else package.config["Debug"].target = "wxmsw"..wx_ver..wx_ver_minor.."md_"..targetName.."_gcc"..wx_custom package.config["Release"].target = "wxmsw"..wx_ver..wx_ver_minor.."m_"..targetName.."_gcc"..wx_custom end else if ( options["unicode"] ) then package.config["Debug"].target = "wxmsw"..wx_ver..wx_ver_minor.."umd_"..targetName.."_vc"..wx_custom package.config["Release"].target = "wxmsw"..wx_ver..wx_ver_minor.."um_"..targetName.."_vc"..wx_custom else package.config["Debug"].target = "wxmsw"..wx_ver..wx_ver_minor.."md_"..targetName.."_vc"..wx_custom package.config["Release"].target = "wxmsw"..wx_ver..wx_ver_minor.."m_"..targetName.."_vc"..wx_custom end end else --******* LINUX/MAC SETUP ************* --* Settings that are Linux/Mac specific. --************************************* -- Ignore resource files in Linux/Mac. table.insert( package.excludes, matchrecursive( "*.rc" ) ) table.insert( package.buildoptions, "-fPIC" ) -- Set wxWidgets build options. table.insert( package.config["Debug"].buildoptions, "`wx-config "..debug_option.." --cflags`" ) table.insert( package.config["Release"].buildoptions, "`wx-config --debug=no --cflags`" ) -- Set the wxWidgets link options. table.insert( package.config["Debug"].linkoptions, "`wx-config "..debug_option.." --libs`" ) table.insert( package.config["Release"].linkoptions, "`wx-config --libs`" ) -- Add buildflag for proper dll building. if ( macosx ) then table.insert( package.buildflags, "dylib" ) end -- Get wxWidgets lib names local wxconfig = io.popen("wx-config " .. debug_option .. " --basename") local debugBasename = trim( wxconfig:read("*a") ) wxconfig:close() wxconfig = io.popen("wx-config --debug=no --basename") local basename = trim( wxconfig:read("*a") ) wxconfig:close() wxconfig = io.popen("wx-config --release") local release = trim( wxconfig:read("*a") ) wxconfig:close() -- Set the targets. package.config["Debug"].target = debugBasename .. "_" .. targetName .. "-" .. release .. wx_custom package.config["Release"].target = basename .. "_" .. targetName .. "-" .. release .. wx_custom end wxformbuilder-3.1.59/src/controls/build/wxFlatNotebook/Makefile0000644000175000017500000001000011143440026025075 0ustar rrmulderrrmulder# C++ Shared Library Makefile autogenerated by premake # Don't edit this file! Instead edit `premake.lua` then rerun `make` ifndef CONFIG CONFIG=Release endif ifeq ($(CONFIG),Release) BINDIR := ../../../../output/lib/wxformbuilder LIBDIR := ../../../.. OBJDIR := .objsu OUTDIR := ../../../../output/lib/wxformbuilder CPPFLAGS := -MMD -D "WXMAKINGDLL_FNB" -D "MONOLITHIC" -D "WXUSINGDLL" -D "UNICODE" -D "_UNICODE" -D "__WX__" -D "NDEBUG" -I "../../include" CFLAGS += $(CPPFLAGS) $(TARGET_ARCH) -fPIC -O3 -Wall -fPIC -fno-strict-aliasing `wx-config --debug=no --cflags` CXXFLAGS := $(CFLAGS) LDFLAGS += -L$(BINDIR) -L$(LIBDIR) -shared -s `wx-config --libs` LDDEPS := RESFLAGS := -D "WXMAKINGDLL_FNB" -D "MONOLITHIC" -D "WXUSINGDLL" -D "UNICODE" -D "_UNICODE" -D "__WX__" -D "NDEBUG" -I "../../include" TARGET := libwx_gtk2u_flatnotebook-2.8_wxfb.so BLDCMD = $(CXX) -o $(OUTDIR)/$(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(TARGET_ARCH) endif ifeq ($(CONFIG),Debug) BINDIR := ../../../../output/lib/wxformbuilder LIBDIR := ../../../.. OBJDIR := .objsud OUTDIR := ../../../../output/lib/wxformbuilder CPPFLAGS := -MMD -D "WXMAKINGDLL_FNB" -D "MONOLITHIC" -D "WXUSINGDLL" -D "UNICODE" -D "_UNICODE" -D "__WX__" -D "NDEBUG" -D "__WXFB_DEBUG__" -I "../../include" CFLAGS += $(CPPFLAGS) $(TARGET_ARCH) -fPIC -g -Wall -fPIC -O0 `wx-config --debug=no --cflags` CXXFLAGS := $(CFLAGS) LDFLAGS += -L$(BINDIR) -L$(LIBDIR) -shared `wx-config --debug=no --libs` LDDEPS := RESFLAGS := -D "WXMAKINGDLL_FNB" -D "MONOLITHIC" -D "WXUSINGDLL" -D "UNICODE" -D "_UNICODE" -D "__WX__" -D "NDEBUG" -D "__WXFB_DEBUG__" -I "../../include" TARGET := libwx_gtk2u_flatnotebook-2.8_wxfb.so BLDCMD = $(CXX) -o $(OUTDIR)/$(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(TARGET_ARCH) endif OBJECTS := \ $(OBJDIR)/xh_fnb.o \ $(OBJDIR)/fnb_customize_dlg.o \ $(OBJDIR)/fnb_resources.o \ $(OBJDIR)/wxFlatNotebook.o \ $(OBJDIR)/renderer.o \ $(OBJDIR)/popup_dlg.o \ MKDIR_TYPE := msdos CMD := $(subst \,\\,$(ComSpec)$(COMSPEC)) ifeq (,$(CMD)) MKDIR_TYPE := posix endif ifeq (/bin/sh.exe,$(SHELL)) MKDIR_TYPE := posix endif ifeq ($(MKDIR_TYPE),posix) CMD_MKBINDIR := mkdir -p $(BINDIR) CMD_MKLIBDIR := mkdir -p $(LIBDIR) CMD_MKOUTDIR := mkdir -p $(OUTDIR) CMD_MKOBJDIR := mkdir -p $(OBJDIR) else CMD_MKBINDIR := $(CMD) /c if not exist $(subst /,\\,$(BINDIR)) mkdir $(subst /,\\,$(BINDIR)) CMD_MKLIBDIR := $(CMD) /c if not exist $(subst /,\\,$(LIBDIR)) mkdir $(subst /,\\,$(LIBDIR)) CMD_MKOUTDIR := $(CMD) /c if not exist $(subst /,\\,$(OUTDIR)) mkdir $(subst /,\\,$(OUTDIR)) CMD_MKOBJDIR := $(CMD) /c if not exist $(subst /,\\,$(OBJDIR)) mkdir $(subst /,\\,$(OBJDIR)) endif .PHONY: clean $(OUTDIR)/$(TARGET): $(OBJECTS) $(LDDEPS) $(RESOURCES) @echo Linking wxFlatNotebook -@$(CMD_MKBINDIR) -@$(CMD_MKLIBDIR) -@$(CMD_MKOUTDIR) @$(BLDCMD) clean: @echo Cleaning wxFlatNotebook ifeq ($(MKDIR_TYPE),posix) -@rm -f $(OUTDIR)/$(TARGET) -@rm -rf $(OBJDIR) else -@if exist $(subst /,\,$(OUTDIR)/$(TARGET)) del /q $(subst /,\,$(OUTDIR)/$(TARGET)) -@if exist $(subst /,\,$(OBJDIR)) del /q $(subst /,\,$(OBJDIR)) -@if exist $(subst /,\,$(OBJDIR)) rmdir /s /q $(subst /,\,$(OBJDIR)) endif $(OBJDIR)/xh_fnb.o: ../../src/wxFlatNotebook/xh_fnb.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/fnb_customize_dlg.o: ../../src/wxFlatNotebook/fnb_customize_dlg.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/fnb_resources.o: ../../src/wxFlatNotebook/fnb_resources.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/wxFlatNotebook.o: ../../src/wxFlatNotebook/wxFlatNotebook.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/renderer.o: ../../src/wxFlatNotebook/renderer.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/popup_dlg.o: ../../src/wxFlatNotebook/popup_dlg.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -include $(OBJECTS:%.o=%.d) wxformbuilder-3.1.59/src/controls/build/wxScintilla/premake.lua0000644000175000017500000002514511143440026025137 0ustar rrmulderrrmulder--***************************************************************************** --* Author: RJP Computing --* Date: 12/15/2006 --* Version: 1.00-beta --* Copyright (C) 2006 RJP Computing --* --* This program is free software; you can redistribute it and/or --* modify it under the terms of the GNU General Public License --* as published by the Free Software Foundation; either version 2 --* of the License, or (at your option) any later version. --* --* This program is distributed in the hope that it will be useful, --* but WITHOUT ANY WARRANTY; without even the implied warranty of --* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --* GNU General Public License for more details. --* --* You should have received a copy of the GNU General Public License --* along with this program; if not, write to the Free Software --* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --* --* NOTES: --* - use the '/' slash for all paths. --***************************************************************************** function trim (s) return (string.gsub(s, "^%s*(.-)%s*$", "%1")) end -- wxWidgets version local wx_ver = "28" local wx_ver_minor = "" local wx_custom = "_wxfb" --******* Initial Setup ************ --* Most of the setting are set here. --********************************** -- Set the name of your package. package.name = "wxScintilla" -- Set this if you want a different name for your target than the package's name. local targetName = "scintilla" -- Set the kind of package you want to create. -- Options: exe | winexe | lib | dll package.kind = "dll" -- Set the files to include. package.files = { matchfiles( "../../src/wxScintilla/*.cpp", "../../include/wx/wxScintilla/*.h" ), matchrecursive( "../../src/wxScintilla/scintilla/*.cxx", "../../src/wxScintilla/scintilla/*.h" ) } -- Set the include paths. package.includepaths = { "../../include", "../../src/wxScintilla", "../../src/wxScintilla/scintilla/include", "../../src/wxScintilla/scintilla/src" } -- Set libraries to link. if ( windows ) then package.links = { "Gdi32" } end -- Set the defines. package.defines = { "WXMAKINGDLL_SCI", "MONOLITHIC", "LINK_LEXERS", "SCI_LEXER", "SCI_NAMESPACE", "__WX__" } --------------------------- DO NOT EDIT BELOW ---------------------------------- --******* GENAERAL SETUP ********** --* Settings that are not dependant --* on the operating system. --********************************* -- Package options addoption( "unicode", "Use the Unicode character set" ) addoption( "with-wx-shared", "Link against wxWidgets as a shared library" ) if ( not windows ) then addoption( "disable-wx-debug", "Compile against a wxWidgets library without debugging" ) end -- Common setup package.language = "c++" -- Set object output directory. if ( options["unicode"] ) then package.config["Debug"].objdir = ".objsud" package.config["Release"].objdir = ".objsu" else package.config["Debug"].objdir = ".objsd" package.config["Release"].objdir = ".objs" end -- Set debug flags if ( options["disable-wx-debug"] and ( not windows ) ) then debug_option = "--debug=no" debug_macro = { "NDEBUG", "__WXFB_DEBUG__" } else debug_option = "--debug=yes" debug_macro = { "DEBUG", "_DEBUG", "__WXDEBUG__" } end -- Set the default targetName if none is specified. if ( string.len( targetName ) == 0 ) then targetName = package.name end -- Set the build options. package.config["Release"].buildflags = { "no-symbols", "optimize-speed" } if ( options["unicode"] ) then table.insert( package.buildflags, "unicode" ) end if ( string.find( target or "", ".*-gcc" ) or target == "gnu" ) then table.insert( package.buildflags, "no-import-lib" ) table.insert( package.config["Debug"].buildoptions, "-O0" ) table.insert( package.config["Release"].buildoptions, "-fno-strict-aliasing" ) end -- Set the defines. if ( options["with-wx-shared"] ) then table.insert( package.defines, "WXUSINGDLL" ) end if ( options["unicode"] ) then table.insert( package.defines, { "UNICODE", "_UNICODE" } ) end table.insert( package.config["Debug"].defines, debug_macro ) table.insert( package.config["Release"].defines, "NDEBUG" ) if ( windows ) then --******* WINDOWS SETUP *********** --* Settings that are Windows specific. --********************************* -- Set wxWidgets include paths if ( target == "cb-gcc" ) then table.insert( package.includepaths, "$(#WX.include)" ) else table.insert( package.includepaths, "$(WXWIN)/include" ) end -- Set the correct 'setup.h' include path. if ( options["with-wx-shared"] ) then if ( options["unicode"] ) then if ( target == "cb-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(#WX.lib)/gcc_dll/mswud" ) table.insert( package.config["Release"].includepaths, "$(#WX.lib)/gcc_dll/mswu" ) elseif ( target == "gnu" or target == "cl-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/gcc_dll/mswud" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/gcc_dll/mswu" ) else table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/vc_dll/mswud" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/vc_dll/mswu" ) end else if ( target == "cb-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(#WX.lib)/gcc_dll/mswd" ) table.insert( package.config["Release"].includepaths, "$(#WX.lib)/gcc_dll/msw" ) elseif ( target == "gnu" or target == "cl-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/gcc_dll/mswd" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/gcc_dll/msw" ) else table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/vc_dll/mswd" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/vc_dll/msw" ) end end else if ( options["unicode"] ) then if ( target == "cb-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(#WX.lib)/gcc_lib/mswud" ) table.insert( package.config["Release"].includepaths, "$(#WX.lib)/gcc_lib/mswu" ) elseif ( target == "gnu" or target == "cl-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/gcc_lib/mswud" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/gcc_lib/mswu" ) else table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/vc_lib/mswud" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/vc_lib/mswu" ) end else if ( target == "cb-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(#WX.lib)/gcc_lib/mswd" ) table.insert( package.config["Release"].includepaths, "$(#WX.lib)/gcc_lib/msw" ) elseif ( target == "gnu" or target == "cl-gcc" ) then table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/gcc_lib/mswd" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/gcc_lib/msw" ) else table.insert( package.config["Debug"].includepaths, "$(WXWIN)/lib/vc_lib/mswd" ) table.insert( package.config["Release"].includepaths, "$(WXWIN)/lib/vc_lib/msw" ) end end end -- Set the linker options. if ( options["with-wx-shared"] ) then if ( target == "cb-gcc" ) then table.insert( package.libpaths, "$(#WX.lib)/gcc_dll" ) elseif ( target == "gnu" or target == "cl-gcc" ) then table.insert( package.libpaths, "$(WXWIN)/lib/gcc_dll" ) else table.insert( package.libpaths, "$(WXWIN)/lib/vc_dll" ) end else if ( target == "cb-gcc" ) then table.insert( package.libpaths, "$(#WX.lib)/gcc_lib" ) elseif ( target == "gnu" or target == "cl-gcc" ) then table.insert( package.libpaths, "$(WXWIN)/lib/gcc_lib" ) else table.insert( package.libpaths, "$(WXWIN)/lib/vc_lib" ) end end -- Set wxWidgets libraries to link. if ( options["unicode"] ) then table.insert( package.config["Release"].links, "wxmsw"..wx_ver.."u" ) table.insert( package.config["Debug"].links, "wxmsw"..wx_ver.."ud" ) else table.insert( package.config["Release"].links, "wxmsw"..wx_ver ) table.insert( package.config["Debug"].links, "wxmsw"..wx_ver.."d" ) end -- Set the Windows defines. table.insert( package.defines, { "__WXMSW__", "WIN32", "_WINDOWS" } ) -- Set the targets. if ( string.find( target or "", ".*-gcc" ) or target == "gnu" ) then if ( options["unicode"] ) then package.config["Debug"].target = "wxmsw"..wx_ver..wx_ver_minor.."umd_"..targetName.."_gcc"..wx_custom package.config["Release"].target = "wxmsw"..wx_ver..wx_ver_minor.."um_"..targetName.."_gcc"..wx_custom else package.config["Debug"].target = "wxmsw"..wx_ver..wx_ver_minor.."md_"..targetName.."_gcc"..wx_custom package.config["Release"].target = "wxmsw"..wx_ver..wx_ver_minor.."m_"..targetName.."_gcc"..wx_custom end else if ( options["unicode"] ) then package.config["Debug"].target = "wxmsw"..wx_ver..wx_ver_minor.."umd_"..targetName.."_vc"..wx_custom package.config["Release"].target = "wxmsw"..wx_ver..wx_ver_minor.."um_"..targetName.."_vc"..wx_custom else package.config["Debug"].target = "wxmsw"..wx_ver..wx_ver_minor.."md_"..targetName.."_vc"..wx_custom package.config["Release"].target = "wxmsw"..wx_ver..wx_ver_minor.."m_"..targetName.."_vc"..wx_custom end end else --******* LINUX/MAC SETUP ************* --* Settings that are Linux/Mac specific. --************************************* -- Ignore resource files in Linux/Mac. table.insert( package.excludes, matchrecursive( "*.rc" ) ) table.insert( package.buildoptions, "-fPIC" ) -- Set wxWidgets build options. table.insert( package.config["Debug"].buildoptions, "`wx-config "..debug_option.." --cflags`" ) table.insert( package.config["Release"].buildoptions, "`wx-config --debug=no --cflags`" ) -- Set the wxWidgets link options. table.insert( package.config["Debug"].linkoptions, "`wx-config "..debug_option.." --libs`" ) table.insert( package.config["Release"].linkoptions, "`wx-config --libs`" ) -- Set the Linux defines. if ( linux ) then table.insert( package.defines, { "GTK" } ) end -- Add buildflag for proper dll building. if ( macosx ) then table.insert( package.buildflags, "dylib" ) end -- Get wxWidgets lib names local wxconfig = io.popen("wx-config " .. debug_option .. " --basename") local debugBasename = trim( wxconfig:read("*a") ) wxconfig:close() wxconfig = io.popen("wx-config --debug=no --basename") local basename = trim( wxconfig:read("*a") ) wxconfig:close() wxconfig = io.popen("wx-config --release") local release = trim( wxconfig:read("*a") ) wxconfig:close() -- Set the targets. package.config["Debug"].target = debugBasename .. "_" .. targetName .. "-" .. release .. wx_custom package.config["Release"].target = basename .. "_" .. targetName .. "-" .. release .. wx_custom end wxformbuilder-3.1.59/src/controls/build/wxScintilla/Makefile0000644000175000017500000004551311143440026024451 0ustar rrmulderrrmulder# C++ Shared Library Makefile autogenerated by premake # Don't edit this file! Instead edit `premake.lua` then rerun `make` ifndef CONFIG CONFIG=Release endif ifeq ($(CONFIG),Release) BINDIR := ../../../../output/lib/wxformbuilder LIBDIR := ../../../.. OBJDIR := .objsu OUTDIR := ../../../../output/lib/wxformbuilder CPPFLAGS := -MMD -D "WXMAKINGDLL_SCI" -D "MONOLITHIC" -D "LINK_LEXERS" -D "SCI_LEXER" -D "SCI_NAMESPACE" -D "__WX__" -D "WXUSINGDLL" -D "UNICODE" -D "_UNICODE" -D "GTK" -D "NDEBUG" -I "../../include" -I "../../src/wxScintilla" -I "../../src/wxScintilla/scintilla/include" -I "../../src/wxScintilla/scintilla/src" CFLAGS += $(CPPFLAGS) $(TARGET_ARCH) -fPIC -O3 -fPIC -fno-strict-aliasing `wx-config --debug=no --cflags` CXXFLAGS := $(CFLAGS) LDFLAGS += -L$(BINDIR) -L$(LIBDIR) -shared -s `wx-config --libs` LDDEPS := RESFLAGS := -D "WXMAKINGDLL_SCI" -D "MONOLITHIC" -D "LINK_LEXERS" -D "SCI_LEXER" -D "SCI_NAMESPACE" -D "__WX__" -D "WXUSINGDLL" -D "UNICODE" -D "_UNICODE" -D "GTK" -D "NDEBUG" -I "../../include" -I "../../src/wxScintilla" -I "../../src/wxScintilla/scintilla/include" -I "../../src/wxScintilla/scintilla/src" TARGET := libwx_gtk2u_scintilla-2.8_wxfb.so BLDCMD = $(CXX) -o $(OUTDIR)/$(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(TARGET_ARCH) endif ifeq ($(CONFIG),Debug) BINDIR := ../../../../output/lib/wxformbuilder LIBDIR := ../../../.. OBJDIR := .objsud OUTDIR := ../../../../output/lib/wxformbuilder CPPFLAGS := -MMD -D "WXMAKINGDLL_SCI" -D "MONOLITHIC" -D "LINK_LEXERS" -D "SCI_LEXER" -D "SCI_NAMESPACE" -D "__WX__" -D "WXUSINGDLL" -D "UNICODE" -D "_UNICODE" -D "GTK" -D "NDEBUG" -D "__WXFB_DEBUG__" -I "../../include" -I "../../src/wxScintilla" -I "../../src/wxScintilla/scintilla/include" -I "../../src/wxScintilla/scintilla/src" CFLAGS += $(CPPFLAGS) $(TARGET_ARCH) -fPIC -g -fPIC -O0 `wx-config --debug=no --cflags` CXXFLAGS := $(CFLAGS) LDFLAGS += -L$(BINDIR) -L$(LIBDIR) -shared `wx-config --debug=no --libs` LDDEPS := RESFLAGS := -D "WXMAKINGDLL_SCI" -D "MONOLITHIC" -D "LINK_LEXERS" -D "SCI_LEXER" -D "SCI_NAMESPACE" -D "__WX__" -D "WXUSINGDLL" -D "UNICODE" -D "_UNICODE" -D "GTK" -D "NDEBUG" -D "__WXFB_DEBUG__" -I "../../include" -I "../../src/wxScintilla" -I "../../src/wxScintilla/scintilla/include" -I "../../src/wxScintilla/scintilla/src" TARGET := libwx_gtk2u_scintilla-2.8_wxfb.so BLDCMD = $(CXX) -o $(OUTDIR)/$(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(TARGET_ARCH) endif OBJECTS := \ $(OBJDIR)/PlatWX.o \ $(OBJDIR)/ScintillaWX.o \ $(OBJDIR)/wxscintilla.o \ $(OBJDIR)/ExternalLexer.o \ $(OBJDIR)/PositionCache.o \ $(OBJDIR)/LineMarker.o \ $(OBJDIR)/LexD.o \ $(OBJDIR)/Style.o \ $(OBJDIR)/LexSpecman.o \ $(OBJDIR)/LexPython.o \ $(OBJDIR)/LexPOV.o \ $(OBJDIR)/LexCsound.o \ $(OBJDIR)/KeyMap.o \ $(OBJDIR)/LexCPP.o \ $(OBJDIR)/LexPLM.o \ $(OBJDIR)/ViewStyle.o \ $(OBJDIR)/LexRuby.o \ $(OBJDIR)/LexYAML.o \ $(OBJDIR)/LexNsis.o \ $(OBJDIR)/RESearch.o \ $(OBJDIR)/LexPS.o \ $(OBJDIR)/ScintillaBase.o \ $(OBJDIR)/LexKix.o \ $(OBJDIR)/LexVB.o \ $(OBJDIR)/LexVHDL.o \ $(OBJDIR)/AutoComplete.o \ $(OBJDIR)/Decoration.o \ $(OBJDIR)/Indicator.o \ $(OBJDIR)/DocumentAccessor.o \ $(OBJDIR)/LexCrontab.o \ $(OBJDIR)/CallTip.o \ $(OBJDIR)/LexInno.o \ $(OBJDIR)/LexProgress.o \ $(OBJDIR)/LexAda.o \ $(OBJDIR)/LexCaml.o \ $(OBJDIR)/Document.o \ $(OBJDIR)/LexScriptol.o \ $(OBJDIR)/CellBuffer.o \ $(OBJDIR)/UniConversion.o \ $(OBJDIR)/LexBullant.o \ $(OBJDIR)/LexAVE.o \ $(OBJDIR)/LexEiffel.o \ $(OBJDIR)/ContractionState.o \ $(OBJDIR)/LexCmake.o \ $(OBJDIR)/LexAPDL.o \ $(OBJDIR)/LexGAP.o \ $(OBJDIR)/LexBaan.o \ $(OBJDIR)/LexMSSQL.o \ $(OBJDIR)/LexCSS.o \ $(OBJDIR)/LexSpice.o \ $(OBJDIR)/LexLua.o \ $(OBJDIR)/LexOthers.o \ $(OBJDIR)/LexBasic.o \ $(OBJDIR)/LexVerilog.o \ $(OBJDIR)/LexOpal.o \ $(OBJDIR)/LexMetapost.o \ $(OBJDIR)/LexForth.o \ $(OBJDIR)/LexEScript.o \ $(OBJDIR)/LexAU3.o \ $(OBJDIR)/LexTeX.o \ $(OBJDIR)/LexSQL.o \ $(OBJDIR)/LexTADS3.o \ $(OBJDIR)/LexHaskell.o \ $(OBJDIR)/LexLisp.o \ $(OBJDIR)/KeyWords.o \ $(OBJDIR)/LexLout.o \ $(OBJDIR)/LexAsm.o \ $(OBJDIR)/Editor.o \ $(OBJDIR)/LexFlagship.o \ $(OBJDIR)/LexBash.o \ $(OBJDIR)/XPM.o \ $(OBJDIR)/LexGui4Cli.o \ $(OBJDIR)/LexAsn1.o \ $(OBJDIR)/CharClassify.o \ $(OBJDIR)/LexRebol.o \ $(OBJDIR)/LexFortran.o \ $(OBJDIR)/RunStyles.o \ $(OBJDIR)/LexCLW.o \ $(OBJDIR)/LexMMIXAL.o \ $(OBJDIR)/LexSmalltalk.o \ $(OBJDIR)/LexMPT.o \ $(OBJDIR)/WindowAccessor.o \ $(OBJDIR)/LexConf.o \ $(OBJDIR)/PropSet.o \ $(OBJDIR)/LexHTML.o \ $(OBJDIR)/LexPerl.o \ $(OBJDIR)/LexPB.o \ $(OBJDIR)/LexPascal.o \ $(OBJDIR)/StyleContext.o \ $(OBJDIR)/LexMatlab.o \ $(OBJDIR)/LexTCL.o \ $(OBJDIR)/LexErlang.o \ MKDIR_TYPE := msdos CMD := $(subst \,\\,$(ComSpec)$(COMSPEC)) ifeq (,$(CMD)) MKDIR_TYPE := posix endif ifeq (/bin/sh.exe,$(SHELL)) MKDIR_TYPE := posix endif ifeq ($(MKDIR_TYPE),posix) CMD_MKBINDIR := mkdir -p $(BINDIR) CMD_MKLIBDIR := mkdir -p $(LIBDIR) CMD_MKOUTDIR := mkdir -p $(OUTDIR) CMD_MKOBJDIR := mkdir -p $(OBJDIR) else CMD_MKBINDIR := $(CMD) /c if not exist $(subst /,\\,$(BINDIR)) mkdir $(subst /,\\,$(BINDIR)) CMD_MKLIBDIR := $(CMD) /c if not exist $(subst /,\\,$(LIBDIR)) mkdir $(subst /,\\,$(LIBDIR)) CMD_MKOUTDIR := $(CMD) /c if not exist $(subst /,\\,$(OUTDIR)) mkdir $(subst /,\\,$(OUTDIR)) CMD_MKOBJDIR := $(CMD) /c if not exist $(subst /,\\,$(OBJDIR)) mkdir $(subst /,\\,$(OBJDIR)) endif .PHONY: clean $(OUTDIR)/$(TARGET): $(OBJECTS) $(LDDEPS) $(RESOURCES) @echo Linking wxScintilla -@$(CMD_MKBINDIR) -@$(CMD_MKLIBDIR) -@$(CMD_MKOUTDIR) @$(BLDCMD) clean: @echo Cleaning wxScintilla ifeq ($(MKDIR_TYPE),posix) -@rm -f $(OUTDIR)/$(TARGET) -@rm -rf $(OBJDIR) else -@if exist $(subst /,\,$(OUTDIR)/$(TARGET)) del /q $(subst /,\,$(OUTDIR)/$(TARGET)) -@if exist $(subst /,\,$(OBJDIR)) del /q $(subst /,\,$(OBJDIR)) -@if exist $(subst /,\,$(OBJDIR)) rmdir /s /q $(subst /,\,$(OBJDIR)) endif $(OBJDIR)/PlatWX.o: ../../src/wxScintilla/PlatWX.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/ScintillaWX.o: ../../src/wxScintilla/ScintillaWX.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/wxscintilla.o: ../../src/wxScintilla/wxscintilla.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/ExternalLexer.o: ../../src/wxScintilla/scintilla/src/ExternalLexer.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/PositionCache.o: ../../src/wxScintilla/scintilla/src/PositionCache.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/LineMarker.o: ../../src/wxScintilla/scintilla/src/LineMarker.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/LexD.o: ../../src/wxScintilla/scintilla/src/LexD.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/Style.o: ../../src/wxScintilla/scintilla/src/Style.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/LexSpecman.o: ../../src/wxScintilla/scintilla/src/LexSpecman.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/LexPython.o: ../../src/wxScintilla/scintilla/src/LexPython.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/LexPOV.o: ../../src/wxScintilla/scintilla/src/LexPOV.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/LexCsound.o: ../../src/wxScintilla/scintilla/src/LexCsound.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/KeyMap.o: ../../src/wxScintilla/scintilla/src/KeyMap.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/LexCPP.o: ../../src/wxScintilla/scintilla/src/LexCPP.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/LexPLM.o: ../../src/wxScintilla/scintilla/src/LexPLM.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/ViewStyle.o: ../../src/wxScintilla/scintilla/src/ViewStyle.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/LexRuby.o: ../../src/wxScintilla/scintilla/src/LexRuby.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/LexYAML.o: ../../src/wxScintilla/scintilla/src/LexYAML.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/LexNsis.o: ../../src/wxScintilla/scintilla/src/LexNsis.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/RESearch.o: ../../src/wxScintilla/scintilla/src/RESearch.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/LexPS.o: ../../src/wxScintilla/scintilla/src/LexPS.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/ScintillaBase.o: ../../src/wxScintilla/scintilla/src/ScintillaBase.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/LexKix.o: ../../src/wxScintilla/scintilla/src/LexKix.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/LexVB.o: ../../src/wxScintilla/scintilla/src/LexVB.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/LexVHDL.o: ../../src/wxScintilla/scintilla/src/LexVHDL.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/AutoComplete.o: ../../src/wxScintilla/scintilla/src/AutoComplete.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/Decoration.o: ../../src/wxScintilla/scintilla/src/Decoration.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/Indicator.o: ../../src/wxScintilla/scintilla/src/Indicator.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/DocumentAccessor.o: ../../src/wxScintilla/scintilla/src/DocumentAccessor.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/LexCrontab.o: ../../src/wxScintilla/scintilla/src/LexCrontab.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/CallTip.o: ../../src/wxScintilla/scintilla/src/CallTip.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/LexInno.o: ../../src/wxScintilla/scintilla/src/LexInno.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/LexProgress.o: ../../src/wxScintilla/scintilla/src/LexProgress.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/LexAda.o: ../../src/wxScintilla/scintilla/src/LexAda.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/LexCaml.o: ../../src/wxScintilla/scintilla/src/LexCaml.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/Document.o: ../../src/wxScintilla/scintilla/src/Document.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/LexScriptol.o: ../../src/wxScintilla/scintilla/src/LexScriptol.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/CellBuffer.o: ../../src/wxScintilla/scintilla/src/CellBuffer.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/UniConversion.o: ../../src/wxScintilla/scintilla/src/UniConversion.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/LexBullant.o: ../../src/wxScintilla/scintilla/src/LexBullant.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/LexAVE.o: ../../src/wxScintilla/scintilla/src/LexAVE.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/LexEiffel.o: ../../src/wxScintilla/scintilla/src/LexEiffel.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/ContractionState.o: ../../src/wxScintilla/scintilla/src/ContractionState.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/LexCmake.o: ../../src/wxScintilla/scintilla/src/LexCmake.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/LexAPDL.o: ../../src/wxScintilla/scintilla/src/LexAPDL.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/LexGAP.o: ../../src/wxScintilla/scintilla/src/LexGAP.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/LexBaan.o: ../../src/wxScintilla/scintilla/src/LexBaan.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/LexMSSQL.o: ../../src/wxScintilla/scintilla/src/LexMSSQL.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/LexCSS.o: ../../src/wxScintilla/scintilla/src/LexCSS.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/LexSpice.o: ../../src/wxScintilla/scintilla/src/LexSpice.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/LexLua.o: ../../src/wxScintilla/scintilla/src/LexLua.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/LexOthers.o: ../../src/wxScintilla/scintilla/src/LexOthers.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/LexBasic.o: ../../src/wxScintilla/scintilla/src/LexBasic.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/LexVerilog.o: ../../src/wxScintilla/scintilla/src/LexVerilog.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/LexOpal.o: ../../src/wxScintilla/scintilla/src/LexOpal.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/LexMetapost.o: ../../src/wxScintilla/scintilla/src/LexMetapost.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/LexForth.o: ../../src/wxScintilla/scintilla/src/LexForth.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/LexEScript.o: ../../src/wxScintilla/scintilla/src/LexEScript.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/LexAU3.o: ../../src/wxScintilla/scintilla/src/LexAU3.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/LexTeX.o: ../../src/wxScintilla/scintilla/src/LexTeX.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/LexSQL.o: ../../src/wxScintilla/scintilla/src/LexSQL.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/LexTADS3.o: ../../src/wxScintilla/scintilla/src/LexTADS3.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/LexHaskell.o: ../../src/wxScintilla/scintilla/src/LexHaskell.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/LexLisp.o: ../../src/wxScintilla/scintilla/src/LexLisp.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/KeyWords.o: ../../src/wxScintilla/scintilla/src/KeyWords.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/LexLout.o: ../../src/wxScintilla/scintilla/src/LexLout.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/LexAsm.o: ../../src/wxScintilla/scintilla/src/LexAsm.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/Editor.o: ../../src/wxScintilla/scintilla/src/Editor.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/LexFlagship.o: ../../src/wxScintilla/scintilla/src/LexFlagship.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/LexBash.o: ../../src/wxScintilla/scintilla/src/LexBash.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/XPM.o: ../../src/wxScintilla/scintilla/src/XPM.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/LexGui4Cli.o: ../../src/wxScintilla/scintilla/src/LexGui4Cli.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/LexAsn1.o: ../../src/wxScintilla/scintilla/src/LexAsn1.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/CharClassify.o: ../../src/wxScintilla/scintilla/src/CharClassify.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/LexRebol.o: ../../src/wxScintilla/scintilla/src/LexRebol.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/LexFortran.o: ../../src/wxScintilla/scintilla/src/LexFortran.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/RunStyles.o: ../../src/wxScintilla/scintilla/src/RunStyles.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/LexCLW.o: ../../src/wxScintilla/scintilla/src/LexCLW.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/LexMMIXAL.o: ../../src/wxScintilla/scintilla/src/LexMMIXAL.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/LexSmalltalk.o: ../../src/wxScintilla/scintilla/src/LexSmalltalk.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/LexMPT.o: ../../src/wxScintilla/scintilla/src/LexMPT.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/WindowAccessor.o: ../../src/wxScintilla/scintilla/src/WindowAccessor.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/LexConf.o: ../../src/wxScintilla/scintilla/src/LexConf.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/PropSet.o: ../../src/wxScintilla/scintilla/src/PropSet.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/LexHTML.o: ../../src/wxScintilla/scintilla/src/LexHTML.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/LexPerl.o: ../../src/wxScintilla/scintilla/src/LexPerl.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/LexPB.o: ../../src/wxScintilla/scintilla/src/LexPB.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/LexPascal.o: ../../src/wxScintilla/scintilla/src/LexPascal.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/StyleContext.o: ../../src/wxScintilla/scintilla/src/StyleContext.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/LexMatlab.o: ../../src/wxScintilla/scintilla/src/LexMatlab.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/LexTCL.o: ../../src/wxScintilla/scintilla/src/LexTCL.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< $(OBJDIR)/LexErlang.o: ../../src/wxScintilla/scintilla/src/LexErlang.cxx -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -include $(OBJECTS:%.o=%.d) wxformbuilder-3.1.59/output/plugins/additional/icons/calendar.xpm0000644000175000017500000001026311143440026025514 0ustar rrmulderrrmulder/* XPM */ static const unsigned char * calendar_xpm[] = { "22 22 197 2", " c None", "! c black", "# c #1A67A7", "$ c #4783BC", "% c #4E87BF", "& c #4C87BE", "' c #4D87BE", "( c #4A85BE", ") c #427FBC", "* c #417FBB", "+ c #3979BA", ", c #3A79BA", "- c #3B7AB9", ". c #1D69A7", "0 c #3C7BBA", "1 c #95B0EB", "2 c #8CAAE6", "3 c #8AA8E6", "4 c #759AE1", "5 c #86A6E5", "6 c #8FADE7", "7 c #3C71D4", "8 c #ABC1ED", "9 c #B5C6F3", ": c #2F72B7", "; c #1F64B5", "< c #4173D7", "= c #3C71D3", "> c #3D71D4", "? c #3D72D4", "@ c #376DD2", "A c #3F73D4", "B c #7A9EE2", "C c #88A8E5", "D c #2E67D0", "E c #B5C8EF", "F c #A8BEEF", "G c #1963B4", "H c #1660B2", "I c #346FC7", "J c #3A75C5", "K c #3B76C6", "L c #3773C2", "M c #3672C2", "N c #3671C1", "O c #3873C3", "P c #3A75C6", "Q c #447BC4", "R c #4B82C8", "S c #3E78C7", "T c #3F78C6", "U c #3A73C8", "V c #1861B3", "W c #0F5CAE", "X c #81A9D6", "Y c #E7EFF4", "Z c #E7EFF5", "[ c #CFD8DD", "] c #CBD4D9", "^ c #CBD3D9", "_ c #D0D9DE", "` c #C6CFD4", "a c #D5DDE2", "b c #E7F0F5", "c c #C0C9D0", "d c #D3DDE3", "e c #E5EEF4", "f c #80A7D6", "g c #115EAE", "h c #92B4DD", "i c white", "j c #EAE9E7", "k c #E7E6E4", "l c #E7E5E4", "m c #ECEAE9", "n c #E1E0DE", "o c #F0EEED", "p c #DDDBDA", "q c #F3F2F0", "r c #1561AF", "s c #95B6DF", "t c #EAEAEA", "u c #E7E7E7", "v c #E6E6E6", "w c #EBEBEB", "x c #E2E2E2", "y c #F0F0F0", "z c #DDDDDD", "{ c #F2F2F2", "| c #1A64B2", "} c #89AAD1", "~ c #E6E6E5", " ! c #DADADA", "!! c #D8D8D8", "#! c #DBDBDB", "$! c #D5D5D5", "%! c #E0E3EB", "&! c #EAEDF6", "'! c #E9EDF6", "(! c #D7DBE2", ")! c #DEDFE0", "*! c #2067B3", "+! c #89A9CF", ",! c #E2E2DF", "-! c #E2E1E1", ".! c #D7D7D7", "0! c #E1E1E1", "1! c #D6D6D6", "2! c #BA9344", "3! c #BA9242", "4! c #BC9643", "5! c #A8843D", "6! c #D3CEC4", "7! c #E4E4E6", "8! c #2268B2", "9! c #9BBBE0", ":! c #EEEEEE", ";! c #ECECEC", "! c #C79A32", "?! c #FCF47B", "@! c #FCE153", "A! c #B08019", "B! c #E5DDCD", "C! c #256BB3", "D! c #9EBCDF", "E! c #EDEDED", "F! c #CBA239", "G! c #FFED3C", "H! c #FFBB00", "I! c #AD6D00", "J! c #E6E0D5", "K! c #2A6FB4", "L! c #9EBCDE", "M! c #FCFCFB", "N! c #FBFBFC", "O! c #FBFBFB", "P! c #FCFCFC", "Q! c #E8E6E6", "R! c #B4861F", "S! c #CD9B1F", "T! c #C57A00", "U! c #975900", "V! c #E4DDCE", "W! c #FCFDFE", "X! c #2E73B7", "Y! c #97B4D5", "Z! c #E7E7E5", "[! c #E0E1E1", "]! c #BAA781", "^! c #B5A078", "_! c #B6A47D", "`! c #B5A07A", "a! c #DEDBD4", "b! c #E9E9EB", "c! c #3075B6", "d! c #A3C0DF", "e! c #FBFBFA", "f! c #F1F1F1", "g! c #F9FDFF", "h! c #F2F6FC", "i! c #F5F5F6", "j! c #FBFAFA", "k! c #3477B7", "l! c #A9C4E3", "m! c #F7F7F6", "n! c #F6F6F5", "o! c #F5F4F4", "p! c #F3F3F3", "q! c #F9F9F8", "r! c #F2F1F1", "s! c #FAFAF9", "t! c #3A7AB8", "u! c #A7C4E1", "v! c #FFFFFE", "w! c #F8F7F6", "x! c #F9F8F7", "y! c #FBFAF9", "z! c #F4F4F3", "{! c #FCFBFA", "|! c #4884BC", "}! c #8FB2DA", "~! c #95B8D7", " # c #99BBDA", "!# c #96B8D7", "## c #96B8D6", "$# c #95B7D6", "%# c #95B6D5", "&# c #94B6D5", "'# c #97B9D8", "(# c #1565A3", ")# c #427FB9", "*# c #3075B3", "+# c #2F75B2", ",# c #3076B3", "-# c #3075B2", " ", " ", "# $ % & & & & & & & & & & & ' ( ) * + , - . ", "0 1 2 2 2 2 2 2 2 2 2 2 2 2 3 4 5 6 7 8 9 : ", "; < = = > ? = = ? > = = ? 7 @ A B C D E F G ", "H I J K L M K K M L K K N O J P Q R S T U V ", "W X Y Z [ ] Z Z ^ _ Z Z ` a Z b c d Z e f W ", "g h i i j k i i l m i i n o i i p q i i h g ", "r s i i t u i i v w i i x y i i z { i i s r ", "| } ~ v !!!v v !!#!v v $!%!&!'!(!)!~ ~ } | ", "*!+!,!-!!!.!x 0!1!!!x x $!2!3!4!5!6!7!,!+!*!", "8!9!i i :!;!i i w !?!@!A!B!i i 9!8!", "C!D!i i c #FFD317", "? c #FFDB2D", "@ c #FFE03B", "A c #F5F5F5", "B c #CFCFCF", "C c #C9C9C9", "D c #C4C4C4", "E c #F7F7F7", "F c #FFD824", "G c #FFDE38", "H c #FFE54B", "I c #D5D5D5", "J c #DCDCDC", "K c #FBFBFB", "L c #FFCF08", "M c #FFD314", "N c #FFDE35", "O c #FCE85A", "P c #768300", "Q c #FEFEFE", "R c #FFD212", "S c #FFD721", "T c #FFDD32", "U c #FFE345", "V c #FFE854", "W c #6FA22E", "X c #2B9116", "Y c #DEDEDE", "Z c #D2D2D2", "[ c #CCCCCC", "] c #FFD61E", "^ c #FFE241", "_ c #A5BE43", "` c #0E7407", "a c #5BC62E", "b c #C6C6C6", "c c #B7B7B7", "d c #B1B1B1", "e c #B5B5B5", "f c #BCBCBC", "g c #F3F3F3", "h c #FFE13E", "i c #FFE851", "j c #FFED64", "k c #3C871C", "l c #49B225", "m c #54C32B", "n c #BDBDBD", "o c #B3B3B3", "p c #C0C0C0", "q c #B8B8B8", "r c #D18A1A", "s c #788400", "t c #4ABE25", "u c #E8E8E8", "v c #F1F1F1", "w c #ECECEC", "x c #BEBEBE", "y c #CBCBCB", "z c #C5C5C5", "{ c #D3D3D3", "| c #E2E2E2", "} c #A7A7A7", "~ c #AFAFAF", " ! c #ABABAB", "!! c #A8A8A8", "#! c #A4A4A4", "$! c #A0A0A0", "%! c #ACACAC", "&! c #A3A3A3", "'! c #A9A9A9", "(! c #AEAEAE", ")! c #A2A2A2", "*! c #B9B9B9", "+! c #B6B6B6", ",! c #E1E1E1", "-! c #DFDFDF", ".! c #E0E0E0", "0! c #EEEEEE", " # # # # # # # # # # # # # # # # # # ", " # $ % & ' ( & % ) * + , ) ( - . 0 # ", " # 1 2 3 3 3 3 3 3 2 4 5 6 7 8 9 : # ", " # ; 3 < < = > ? @ 3 A B 7 5 C D E # ", " # 0 3 < = > F G H 3 A I J ( - I E # ", " # K 3 L M F N H O P ; $ $ $ $ 0 Q # ", " # K 3 R S T U V W X 0 J Y Z [ [ ; # ", " # 0 3 ] T ^ V _ ` a 4 b c d e f g # ", " # E 3 ? h i j k l m : n o p f q 4 # ", " # E r 3 3 3 s X m t 0 , ' ' u u Q # ", " # 1 ) ' ' % u + + + v w ' * * % Q # ", " # 0 q n p [ 8 f 9 5 x y z 8 { | Q # ", " # 4 } ~ !!!d #!$!~ %!&!'!(!D | Q # ", " # 4 )! !d %!%!f ~ *!c %!o +![ ,!1 # ", " # 4 -!( ( .!| g 0!, , 0!) ) * w Q # ", " # 1 $ $ $ $ $ $ $ K K K K K K K ; # ", " # 0 q n p [ 8 f 9 5 x y z 8 { | Q # ", " # 4 } ~ !!!d #!$!~ %!&!'!(!D | Q # ", " # 4 )! !d %!%!f ~ *!c %!o +![ ,!1 # ", " # 4 -!( ( .!| g 0!, , 0!) ) * w Q # ", " # 1 $ $ $ $ $ $ $ K K K K K K K ; # ", " # # # # # # # # # # # # # # # # # # "};wxformbuilder-3.1.59/output/plugins/additional/icons/toggle_button.xpm0000644000175000017500000000152711143440026026622 0ustar rrmulderrrmulder/* XPM */ static const unsigned char * toggle_button_xpm[] = { "22 22 14 1", " c None", "! c black", "# c #CFD9EC", "$ c #003399", "% c #CBEBFF", "& c #C7EAFF", "' c #D0EDFF", "( c #D9F0FF", ") c #E3F4FF", "* c #E8F6FF", "+ c #ECF7FF", ", c #F0F9FF", "- c #F4FBFF", ". c #FAFDFF", " ", " ", " ", " ", " ", " ", "#$$$$$$$$$$$$$$$$$$$$#", "$%%%%%%%%%%%%%%%%%%%%$", "$&&&&&&!!&&!&&&!&&&&'$", "$'''''!''!'!!''!''''($", "$(((((!((!(!(!(!(((()$", "$)))))!))!)!)!)!))))*$", "$+++++!++!+!++!!++++,$", "$------!!--!---!-----$", "$....................$", "#$$$$$$$$$$$$$$$$$$$$#", " ", " ", " ", " ", " ", " "};wxformbuilder-3.1.59/output/plugins/additional/icons/scrollbar.xpm0000644000175000017500000000225211143440026025725 0ustar rrmulderrrmulder/* XPM */ static const unsigned char * scrollbar_xpm[] = { "21 21 40 1", " c None", "! c black", "# c #333366", "$ c #B3E1F5", "% c #AADBF3", "& c #A3D7F1", "' c #97CFEF", "( c #8DC7EC", ") c #EBEAEB", "* c #8FC8ED", "+ c #86C3EB", ", c #7ABAE9", "- c #BDE8F8", ". c #B5E3F6", "0 c #808080", "1 c #9AD0EF", "2 c #E3E4E3", "3 c #AEDEF4", "4 c #A5D8F2", "5 c #93CBEE", "6 c #CBF1FB", "7 c #DCDCDD", "8 c #B8E5F6", "9 c #AFDFF5", ": c #D2F7FD", "; c #BAE6F7", "< c #D7D7D6", "= c #C3ECF9", "> c #9FD3F0", "? c #D4F8FC", "@ c #D0D0D0", "A c #DEFFFF", "B c #D9FCFE", "C c #CDF4FB", "D c #C7EFF9", "E c #CCCBCC", "F c #CCCBCB", "G c #D3F7FD", "H c #CCF3FB", "I c #BDE9F7", " ", " ", " ", " ", " ", " ", " ####################", " #$%&'(#))))))#&'*+,#", " #-.0&1#222222#3405+#", " #60034#777777#89005#", " #:00;$#<<<<<<#=;00>#", " #?:0=-#@@@@@@#6=0$%#", " #AB?CD#EEFEEF#GHDI.#", " ####################", " ", " ", " ", " ", " ", " ", " "};wxformbuilder-3.1.59/output/plugins/additional/icons/colourPickerIcon.xpm0000644000175000017500000000170311143440026027214 0ustar rrmulderrrmulder/* XPM */ static const unsigned char * colourpickericon_xpm[] = { "22 22 21 1", " c None", "! c black", "# c #CFD9EC", "$ c #003399", "% c #FAFDFF", "& c #C5C5C5", "' c #9B0032", "( c #668EB0", ") c #9CB7CF", "* c #EBF2F9", "+ c #CBEBFF", ", c #C3D9EE", "- c #AECCE8", ". c #DCE9F5", "0 c #96BCE1", "1 c #71A5D6", "2 c #96B3CD", "3 c #B7B6AC", "4 c #BA945C", "5 c #D6BD9A", "6 c #F9E9D0", " ", "#$$$$$$$$$$$$$$$$$$$$#", "$%%%%%%%%%%%%%%%%%%%%$", "$&''''''''''''''''''&$", "$&'!'!!'!'''!'!''!''&$", "$&!''!'!'!'!!''!'!!'&$", "$&'!'!!'!!''!'!''!''&$", "$&!''!'''!'((((!'!''&$", "$&''''''''()**)(''''&$", "$++++++++()*,,*)(++++$", "#$$$$$$$()*,--,*)($$$#", " (*,----,*( ", " (.011110.( ", " (2.0110.2( ", " 3(2.00.2(43 ", " 3(2..2(4543 ", " 3((((456543 ", " 33333456543", " 345654", " 34543", " 343 ", " 3 "};wxformbuilder-3.1.59/output/plugins/additional/icons/grid.xpm0000644000175000017500000000131711143440026024670 0ustar rrmulderrrmulder/* XPM */ static char * C:\devel\wxGlade\icons\grid_xpm[] = { "22 22 5 1", " c None", ". c #000000", "+ c #6C77B5", "@ c #C9C7C7", "# c #FFFFFF", "..................... ", ".++++@++++@++++@++++. ", ".++++@++++@++++@++++. ", ".@@@@@@@@@@@@@@@@@@@. ", ".++++@####@####@####. ", ".++++@####@####@####. ", ".@@@@@@@@@@@@@@@@@@@. ", ".++++@####@####@####. ", ".++++@####@####@####. ", ".@@@@@@@@@@@@@@@@@@@. ", ".++++@####@####@####. ", ".++++@####@####@####. ", ".@@@@@@@@@@@@@@@@@@@. ", ".++++@####@####@####. ", ".++++@####@####@####. ", ".@@@@@@@@@@@@@@@@@@@. ", ".++++@####@####@####. ", ".++++@####@####@####. ", ".@@@@@@@@@@@@@@@@@@@. ", ".++++@####@####@####. ", "..................... " " "}; wxformbuilder-3.1.59/output/plugins/additional/icons/spin_ctrl.xpm0000644000175000017500000000151711143440026025742 0ustar rrmulderrrmulder/* XPM */ static const unsigned char * spin_ctrl_xpm[] = { "21 21 17 1", " c None", "! c black", "# c #333366", "$ c white", "% c #F8FFFF", "& c #F3FFFF", "' c #F1FFFF", "( c #EEFFFF", ") c #9BCDFF", "* c #A5D5FF", "+ c #808080", ", c #EBFFFF", "- c #AAD9FF", ". c #C2EAFF", "0 c #E5FFFF", "1 c #E2FFFF", "2 c #DFFFFF", " ", " ", " ", " ", " ", " ####################", " #$$$$$%%&&'(#))))))#", " #$$!$%$!!''(#**++**#", " #$!!$%!&'!(,#-++++-#", " #$$!&&!&'!,,#......#", " #%%!''!'(!00#000000#", " #&&!''!((!11#.++++.#", " #%!!!((!!011#**++*-#", " #'((,,001112#))))))#", " ####################", " ", " ", " ", " ", " ", " "};wxformbuilder-3.1.59/output/plugins/additional/icons/spinbtn.xpm0000644000175000017500000000207711143440026025424 0ustar rrmulderrrmulder/* XPM */ static const unsigned char * spinbtn_xpm[] = { "21 21 33 1", " c None", "! c black", "# c #333366", "$ c #DEFFFF", "% c #D4F8FC", "& c #D2F7FD", "' c #CBF1FB", "( c #BDE8F8", ") c #B3E1F5", "* c #D9FCFE", "+ c #808080", ", c #B5E3F6", "- c #AADBF3", ". c #A3D7F1", "0 c #CDF4FB", "1 c #C3ECF9", "2 c #BAE6F7", "3 c #AEDEF4", "4 c #97CFEF", "5 c #C7EFF9", "6 c #A5D8F2", "7 c #9AD0EF", "8 c #8DC7EC", "9 c #D3F7FD", ": c #B8E5F6", "; c #CCF3FB", "< c #AFDFF5", "= c #8FC8ED", "> c #BDE9F7", "? c #93CBEE", "@ c #86C3EB", "A c #9FD3F0", "B c #7ABAE9", " ", " ", " ", " ", " ######## ", " #$%&'()# ", " #*&++,-# ", " #%++++.# ", " #0123.4# ", " #5()678# ", " ######## ", " #9'1:3.# ", " #;12<64# ", " #5++++=# ", " #>)++?@# ", " #,-A?@B# ", " ######## ", " ", " ", " ", " "};wxformbuilder-3.1.59/output/plugins/additional/icons/filePicker.xpm0000644000175000017500000000351611143440026026023 0ustar rrmulderrrmulder/* XPM */ static const unsigned char * filepicker_xpm[] = { "22 22 82 1", " c None", "! c #888A85", "# c #878984", "$ c black", "% c white", "& c #DEDEDE", "' c #E1E1E1", "( c #E0E0E0", ") c #E1E0E1", "* c #E1E1E2", "+ c #E2E2E2", ", c #E3E3E3", "- c #E4E4E3", ". c #E4E4E4", "0 c #E4E5E5", "1 c #E5E5E5", "2 c #DFDFDF", "3 c #A8A9A6", "4 c #A8AAA6", "5 c #A9AAA7", "6 c #E4E3E3", "7 c #E5E4E4", "8 c #E6E6E5", "9 c #E6E6E6", ": c #E6E6E7", "; c #E7E6E7", "< c #E6E7E7", "= c #E7E7E7", "> c #729FCF", "? c #E8E8E8", "@ c #E3E4E4", "A c #A8C2CC", "B c #EDF1D6", "C c #C0D4C4", "D c #9AB8D8", "E c #E9E9E9", "F c #ADAFAC", "G c #B1C8C7", "H c #F4F5E4", "I c #D1DFC3", "J c #668EB0", "K c #EAEBEA", "L c #A3BFCF", "M c #9BB9D9", "N c #9CB7CF", "O c #EBF2F9", "P c #8998AD", "Q c #8999AE", "R c #8A9AAF", "S c #C3D9EE", "T c #E7E6E6", "U c #6D7A92", "V c #6E7B92", "W c #AECCE8", "X c #E7E8E7", "Y c #AEAFAD", "Z c #EAEAEA", "[ c #DCE9F5", "] c #96BCE1", "^ c #71A5D6", "_ c #E9E8E8", "` c #AAACA9", "a c #ABACA9", "b c #ACACAA", "c c #96B3CD", "d c #E9E9E8", "e c #E9EAEA", "f c #EBEBEB", "g c #B7B6AC", "h c #BA945C", "i c #ACADAA", "j c #D6BD9A", "k c #EAEAEB", "l c #ECEDEC", "m c #EDEDEE", "n c #F9E9D0", "o c #ECECEC", "p c #ECEDED", "q c #EEEEED", "r c #EFEEEF", "s c #F0F0F0", "t c #868883", "!!!!!!!!!!!!!!!!!# ", "!%%%%%%%%%%%%%%%%! ", "!%&'()*++,-..01.%! ", "!%2+'33334555551%! ", "!%(,++67..89:;<=%! ", "!%'.,>>>>>>>>>>?%! ", "!%+9@>ABCDDDDD>E%! ", "!%F97>GHIDDJJJJK%! ", "!%.%1>DLDMJNOONJ%! ", "!%1=8>PQRJNOSSONJ! ", "!%9?T>UVJNOSWWSONJ ", "!%9EX>>>JOSWWWWSOJ ", "!%YE??EZJ[]^^^^][J ", "!%=%_`abJc[]^^][cJ ", "!%?Z?defgJc[]][cJh ", "!%?Z_`aiigJc[[cJhjh ", "!%?fEEkflmgJJJJhjnjh ", "!%?fEkopqrsggggghjnjh ", "!%%%%%%%%%%%%%%%ghjnjh", "t!!!!!!!!!!!!!!!!ghjhg", " ghg ", " g "};wxformbuilder-3.1.59/output/plugins/additional/icons/datepicker.xpm0000644000175000017500000000760511143440026026064 0ustar rrmulderrrmulder/* XPM */ static const unsigned char * datepicker_xpm[] = { "22 22 178 2", " c None", "! c #1A67A7", "# c #4783BC", "$ c #4E87BF", "% c #4C87BE", "& c #4D87BE", "' c #4A85BE", "( c #427FBC", ") c #417FBB", "* c #3979BA", "+ c #3A79BA", ", c #3B7AB9", "- c #1D69A7", ". c #3C7BBA", "0 c #95B0EB", "1 c #8CAAE6", "2 c #8AA8E6", "3 c #759AE1", "4 c #86A6E5", "5 c #8FADE7", "6 c #3C71D4", "7 c #ABC1ED", "8 c #B5C6F3", "9 c #2F72B7", ": c #1F64B5", "; c #4173D7", "< c #3C71D3", "= c #3D71D4", "> c #3D72D4", "? c #376DD2", "@ c #3F73D4", "A c #7A9EE2", "B c #88A8E5", "C c #2E67D0", "D c #B5C8EF", "E c #A8BEEF", "F c #1963B4", "G c #1660B2", "H c #346FC7", "I c #3A75C5", "J c #3B76C6", "K c #3773C2", "L c #3672C2", "M c #3671C1", "N c #3873C3", "O c #3A75C6", "P c #447BC4", "Q c #4B82C8", "R c #3E78C7", "S c #3F78C6", "T c #3A73C8", "U c #1861B3", "V c #0F5CAE", "W c #81A9D6", "X c #E7EFF4", "Y c #E7EFF5", "Z c #CFD8DD", "[ c #BA9344", "] c #BA9242", "^ c #BC9643", "_ c #A8843D", "` c #D0D9DE", "a c #C6CFD4", "b c #D5DDE2", "c c #E7F0F5", "d c #C0C9D0", "e c #D3DDE3", "f c #E5EEF4", "g c #80A7D6", "h c #115EAE", "i c #92B4DD", "j c white", "k c #EAE9E7", "l c #C79A32", "m c #FCF47B", "n c #FCE153", "o c #B08019", "p c #ECEAE9", "q c #E1E0DE", "r c #F0EEED", "s c #DDDBDA", "t c #F3F2F0", "u c #1561AF", "v c #95B6DF", "w c #EAEAEA", "x c #CBA239", "y c #FFED3C", "z c #FFBB00", "{ c #AD6D00", "| c #EBEBEB", "} c #E2E2E2", "~ c #F0F0F0", " ! c #DDDDDD", "!! c #F2F2F2", "#! c #1A64B2", "$! c #89AAD1", "%! c #E6E6E5", "&! c #E6E6E6", "'! c #DADADA", "(! c #B4861F", ")! c #CD9B1F", "*! c #C57A00", "+! c #975900", ",! c #DBDBDB", "-! c #668EB0", ".! c #E9EDF6", "0! c #D7DBE2", "1! c #DEDFE0", "2! c #2067B3", "3! c #89A9CF", "4! c #E2E2DF", "5! c #E2E1E1", "6! c #D8D8D8", "7! c #BAA781", "8! c #B5A078", "9! c #B6A47D", ":! c #B5A07A", ";! c #9CB7CF", "! c #2268B2", "?! c #9BBBE0", "@! c #EEEEEE", "A! c #ECECEC", "B! c #C3D9EE", "C! c #256BB3", "D! c #9EBCDF", "E! c #EFEFEF", "F! c #EDEDED", "G! c #AECCE8", "H! c #2A6FB4", "I! c #9EBCDE", "J! c #FCFCFB", "K! c #FBFBFC", "L! c #FBFBFB", "M! c #FCFCFC", "N! c #FCFDFE", "O! c #2E73B7", "P! c #97B4D5", "Q! c #E7E7E5", "R! c #E7E7E7", "S! c #E1E1E1", "T! c #DCE9F5", "U! c #96BCE1", "V! c #71A5D6", "W! c #E9E9EB", "X! c #3075B6", "Y! c #A3C0DF", "Z! c #FBFBFA", "[! c #F1F1F1", "]! c #96B3CD", "^! c #FBFAFA", "_! c #3477B7", "`! c #A9C4E3", "a! c #F7F7F6", "b! c #F6F6F5", "c! c #B7B6AC", "d! c #BA945C", "e! c #3A7AB8", "f! c #A7C4E1", "g! c #FFFFFE", "h! c #F9F9F8", "i! c #F8F7F6", "j! c #D6BD9A", "k! c #4884BC", "l! c #8FB2DA", "m! c #95B8D7", "n! c #99BBDA", "o! c #96B8D7", "p! c #96B8D6", "q! c #95B7D6", "r! c #F9E9D0", "s! c #1565A3", "t! c #427FB9", "u! c #3075B3", "v! c #2F75B2", "w! c #3076B3", "x! c black", "! # $ % % % % % % % % % % % & ' ( ) * + , - ", ". 0 1 1 1 1 1 1 1 1 1 1 1 1 2 3 4 5 6 7 8 9 ", ": ; < < = > < < > = < < > 6 ? @ A B C D E F ", "G H I J K L J J L K J J M N I O P Q R S T U ", "V W X Y Z [ ] ^ _ ` Y Y a b Y c d e Y f g V ", "h i j j k l m n o p j j q r j j s t j j i h ", "u v j j w x y z { | j j } ~ j j !!!j j v u ", "#!$!%!&!'!(!)!*!+!,!&!-!-!-!-!.!0!1!%!%!$!#!", "2!3!4!5!6!7!8!9!:!6!-!;!!?!j j @!A!j j | -!;!!", "C!D!j j E!F!j j -!;! c #F6F6F6", "? c #CACACA", "@ c #FEFEFD", "A c #EAECF4", "B c #D0D5E9", "C c #C3CAE3", "D c #CED4E8", "E c #E8EBF3", "F c #AEADAC", "G c #A7A7A7", "H c #ABABAB", "I c #979797", "J c #FFFFFE", "K c #EBEDF5", "L c #B3BCDC", "M c #B5BEDE", "N c #CAD0E8", "O c #CCD2E8", "P c #C6CDE6", "Q c #BEC5E0", "R c #DFE1EA", "S c #F1F0ED", "T c #E4E4E4", "U c #E3E3E3", "V c #E6E6E6", "W c #434343", "X c #E2E5F0", "Y c #99A4D2", "Z c #D4D8EE", "[ c #F2F2FB", "] c #E2E5F4", "^ c #D6DCEF", "_ c #D3D9EE", "` c #E2E6F4", "a c #B6BEDF", "b c #D1D6E4", "c c #F7F6F3", "d c #EFEFEF", "e c #EBEBEB", "f c #FBFBFB", "g c #FAFBFA", "h c #7987C3", "i c #CCD0EC", "j c #DEE0F3", "k c #C1C9E7", "l c #C6CCE8", "m c #C0C8E5", "n c #B5BEE1", "o c #C2CAE7", "p c #DDE0F2", "q c #D2D6EF", "r c #8895CB", "s c #EEEFF5", "t c #FDFDFC", "u c #F7F7F7", "v c #B2BAD8", "w c #6F7CC5", "x c #C2C8E9", "y c #A7B1DC", "z c #7E8ECA", "{ c #8A99CF", "| c #909ED1", "} c #98A5D5", "~ c #D5DAEE", " ! c #D6DAF0", "!! c #BBC2E5", "#! c #909AD4", "$! c #A1AAD1", "%! c #F9F9F9", "&! c #5E6EAF", "'! c #344AA7", "(! c #8B98D1", ")! c #8896CF", "*! c #6F80C3", "+! c #5C70BA", ",! c #576CB8", "-! c #8493CC", ".! c #F7F7FD", "0! c #C2C7E9", "1! c #8590D2", "2! c #4E60AF", "3! c #F5F5F4", "4! c #414141", "5! c #FAF9F5", "6! c #31469A", "7! c #0F2A93", "8! c #2F47A3", "9! c #9CA6D8", ":! c #B3BBE1", ";! c #556AB6", "! c #B7BEE3", "?! c #B9BFE6", "@! c #7581CB", "A! c #2A409C", "B! c #E5E6E9", "C! c #F6F5F5", "D! c #F5F4EF", "E! c #2D4296", "F! c #0C2792", "G! c #1B3598", "H! c #707FC4", "I! c #CCD0EE", "J! c #C8CDEA", "K! c #8D9ACE", "L! c #A6B1DA", "M! c #243DA2", "N! c #6374BF", "O! c #A9B0E1", "P! c #5F70BE", "Q! c #152E90", "R! c #E3E4E7", "S! c #F4F3F2", "T! c #404040", "U! c #F8F7F1", "V! c #495B9D", "W! c #052290", "X! c #3D53AA", "Y! c #A9B0DF", "Z! c #C4CAE9", "[! c #6B7CBF", "]! c #7484C6", "^! c #4358B2", "_! c #596ABC", "`! c #949CD9", "a! c #6474C1", "b! c #32479C", "c! c #E8E8E7", "d! c #F3F3F3", "e! c #FCFBF5", "f! c #818AB0", "g! c #0F2B95", "h! c #031F8C", "i! c #384EA7", "j! c #CACEEC", "k! c #B7BFE1", "l! c #3B52AA", "m! c #485DB2", "n! c #475CB2", "o! c #384EA9", "p! c #5767BA", "q! c #354DAA", "r! c #616EA0", "s! c #F7F6F0", "t! c #3E3E3E", "u! c #F1F1F0", "v! c #D0D1D2", "w! c #22388C", "x! c #19359C", "y! c #344BA8", "z! c #D1D5EE", "{! c #C4CBE6", "|! c #6677C0", "}! c #5669B8", "~! c #3950AA", " # c #2842A1", "!# c #2640A2", "## c #2F4599", "$# c #BCBEC6", "%# c #F5F4F3", "&# c #E7E7E7", "'# c #E9E9EA", "(# c #F2F1EE", ")# c #989BAB", "*# c #213892", "+# c #5A6DBF", ",# c #939FD5", "-# c #7181C4", ".# c #7D8BCA", "0# c #7485C7", "1# c #677AC4", "2# c #334AA0", "3# c #7B829E", "4# c #F1F0EB", "5# c #EBECEC", "6# c #3C3C3C", "7# c #E8E8E8", "8# c #EDECE8", "9# c #9296A6", ":# c #4C5B98", ";# c #6F7EC0", "<# c #A7B0DE", "=# c #B5BDE5", "># c #99A4D9", "?# c #808EC8", "@# c #49599A", "A# c #7E849D", "B# c #E9E8E2", "C# c #EAEAEA", "D# c #E1E1E1", "E# c #EDEDED", "F# c #E8E8E9", "G# c #EFEEEA", "H# c #C9C8C7", "I# c #9193A2", "J# c #8A8DA6", "K# c #9195AD", "L# c #898DA6", "M# c #8D90A0", "N# c #BFBFC0", "O# c #E9E9E9", "P# c #DEDEDE", "Q# c #3A3A3A", "R# c #EEEEEE", "S# c #E5E5E5", "T# c #ECEBEB", "U# c #EDECE9", "V# c #E2E1DE", "W# c #DCDCD9", "X# c #E1E0DD", "Y# c #ECEBE9", "Z# c #EDEDEC", "[# c #2D2D2D", "]# c #E2E2E2", "^# c #DFDFDF", "_# c #DCDCDC", "`# c #DBDBDB", "a# c #DADADA", "b# c #D7D7D7", "c# c #D6D6D6", "d# c #D5D5D5", "e# c #D4D4D4", "f# c #D3D3D3", "g# c #C1C1C1", "h# c #343434", "i# c #292929", "j# c #2B2B2B", "k# c #282828", "l# c #272727", " # $ $ $ $ $ $ $ $ $ $ % & ", " ' ( ( ) ) ) ) ) ) ) ) * + , - ", " . ( 0 * * * * * * * * 1 2 3 4 5 ", " 6 ) 0 * * * * * * * * 1 % 7 ( 8 9 ", " 6 ) 0 * * * * : ( ( ( ; < = > > ? 9 ", " 6 ) 0 * * @ ) A B C D E 3 F G G H I 9 ", " 6 0 0 * J K L M N O O P Q R S T U V W ", " 6 * * J X Y Z [ ] ^ _ ` ] a b c d e W ", " 6 f 0 g h i j k l m n o p q r s t u W ", " 6 f ( v w x y z { | } ~ !!!#!$!J u W ", " 6 %!J &!'!(!)!*!+!,!-!.!j 0!1!2!3!> 4! ", " 6 %!5!6!7!8!9!:!;!!?!@!A!B!C!4! ", " 6 1 D!E!F!G!H!I!J!K!L!M!N!O!P!Q!R!S!T! ", " 6 > U!V!W!G!X!Y!Z![!]!^!_!`!a!b!c!d T! ", " 6 d!e!f!g!h!i!j!k!l!m!n!o!p!q!r!s!e t! ", " 6 3 u!v!w!x!y!z!{!|!}!~! #!###$#%#&#t! ", " 6 7 '#(#)#*#+#,#-#.#]!0#1#2#3#4#5#U 6# ", " 6 d 7#'#8#9#:#;#<#=#>#?#@#A#B#e C#D#6# ", " 6 E#&#&#F#G#H#I#J#K#L#M#N#8#C#&#O#P#Q# ", " 6 R#S#V V V T#U#V#W#X#Y#Z#7#&#&#O#P#Q# ", " [#]#]#^#^#, _#_#_#`#a#b#c#d#e#f#c#g#h# ", " i#j#j#j#j#j#j#j#i#i#i#i#k#k#k#i#l# "};wxformbuilder-3.1.59/output/plugins/additional/icons/checklistbox.xpm0000644000175000017500000000252211143440026026424 0ustar rrmulderrrmulder/* XPM */ static const unsigned char * checklistbox_xpm[] = { "22 22 48 1", " c None", "! c black", "# c #333366", "$ c white", "% c #DEFFFF", "& c #D4F8FC", "' c #D2F7FD", "( c #CBF1FB", ") c #BDE8F8", "* c #B3E1F5", "+ c #D9FCFE", ", c #808080", "- c #B5E3F6", ". c #AADBF3", "0 c #A3D7F1", "1 c #CDF4FB", "2 c #C3ECF9", "3 c #BAE6F7", "4 c #AEDEF4", "5 c #97CFEF", "6 c #C7EFF9", "7 c #A5D8F2", "8 c #9AD0EF", "9 c #8DC7EC", ": c #0066CC", "; c #3CBA00", "< c #CCCBCC", "= c #D0D0D0", "> c #D7D7D6", "? c #DCDCDD", "@ c #E3E4E3", "A c #EBEAEB", "B c #CCCBCB", "C c #F9FFFF", "D c #F5FFFF", "E c #D3F7FD", "F c #B8E5F6", "G c #EDFFFF", "H c #CCF3FB", "I c #AFDFF5", "J c #ECFFFF", "K c #8FC8ED", "L c #E3FFFF", "M c #BDE9F7", "N c #93CBEE", "O c #86C3EB", "P c #9FD3F0", "Q c #7ABAE9", " ", " ", " ", "######################", "#$$$$$$$$$$$$$#%&'()*#", "#$###$$$$$$$$$#+',,-.#", "#$#$#$#######$#&,,,,0#", "#$###$$$$$$$$$#123405#", "#$$$$$$$$$$$$$#6)*789#", "#:###:::::::::########", "#:#;#$$$$$$$$:#<=>?@A#", "#:###:::::::::#B=>?@A#", "#CCCCCCC$CCCCC########", "#D###DDDDDDDDD#E(2F40#", "#G#G#G#######G#H23I75#", "#G###JJJJJGGGJ#6,,,,K#", "#JJLJJLJJLJLJL#M*,,NO#", "#LLLLLLLLLLLLL#-.PNOQ#", "######################", " ", " ", " "};wxformbuilder-3.1.59/output/plugins/additional/icons/hyperlink_ctrl.xpm0000644000175000017500000000201211143440026026765 0ustar rrmulderrrmulder/* XPM */ static const unsigned char * hyperlink_ctrl_xpm[] = { "22 22 26 1", " c None", "! c black", "# c #0066CC", "$ c white", "% c #0B0B0B", "& c #ADADAD", "' c #9F9F9F", "( c #A6A6A6", ") c #0F0F0F", "* c #767676", "+ c #D1D1D1", ", c #D3D3D3", "- c #C0C0C0", ". c #BCBCBC", "0 c #8B8B8B", "1 c #FBFBFB", "2 c #F9F9F9", "3 c #1B1B1B", "4 c #AEAEAE", "5 c #F4F4F4", "6 c #FCFCFC", "7 c #FDFDFD", "8 c #1C1C1C", "9 c #D4D4D4", ": c #FEFEFE", "; c #F8F8F8", " ", " ", " # ", " # ", " # ", " ## ### ## ", " # # # # ", " ### # ! # ", " # # # !$!# ", " ### ##!$! ## ", " !$!!% ", " #######!!$&'(!## ", " )*!$+,-.! ", " !0$$$12! ", " 345667$! ", " !$167$! ", " 89:;:! ", " !$1$! ", " !!!!! ", " ", " ", " "};wxformbuilder-3.1.59/output/plugins/additional/icons/custom_control.xpm0000644000175000017500000000765311143440026027026 0ustar rrmulderrrmulder/* XPM */ static const unsigned char * custom_control_xpm[] = { "22 22 180 2", " c None", "! c black", "# c #626262", "$ c #656565", "% c #666666", "& c #EDEDED", "' c #ECECEC", "( c #EBEBEB", ") c #E9E9E9", "* c #E7E7E7", "+ c #E5E5E5", ", c #E2E2E2", "- c #DFDFDF", ". c #DDDDDD", "0 c #DBDBDB", "1 c #D9D9D9", "2 c #D7D7D7", "3 c #D8D8D8", "4 c #D6D6D6", "5 c #D3D3D3", "6 c #D1D1D1", "7 c #CDCDCD", "8 c #CBCBCB", "9 c #C6C6C6", ": c #C4C4C4", "; c #BFBFBF", "< c #BBBBBB", "= c #B7B7B7", "> c #B2B2B2", "? c #AFAFAF", "@ c #ABABAB", "A c #D4D4D4", "B c #CFCFCF", "C c #CCCCCC", "D c #C9C9C9", "E c #C5C5C5", "F c #C1C1C1", "G c #BDBDBD", "H c #B9B9B9", "I c #B4B4B4", "J c #B1B1B1", "K c #AEAEAE", "L c #A7A7A7", "M c #CCCDCF", "N c #9EB1D9", "O c #7497DF", "P c #698FDE", "Q c #6A8FDC", "R c #668DDC", "S c #6B8ED6", "T c #889DC6", "U c #AEAFB2", "V c #CDCED1", "W c #94ACDE", "X c #6E94E1", "Y c #9FBAF1", "Z c #C2D3F6", "[ c #CFDCF7", "] c #D2DFF8", "^ c #ABC1ED", "_ c #7392D3", "` c #7793CA", "a c #AAACAF", "b c #9EB2DB", "c c #618DE6", "d c #AAC4FA", "e c #D1DEF9", "f c #EEF3FC", "g c #EEF3FE", "h c #F6F9FE", "i c #EDF2FD", "j c #BBCFF9", "k c #658AD6", "l c #7E94C0", "m c #A8A8A8", "n c #A4A4A4", "o c #E8E8E8", "p c #D0D0D0", "q c #6993E7", "r c #7CA2F0", "s c #A8C4FC", "t c #E2EAFA", "u c #DAE6FE", "v c #A6C3FE", "w c #C1D3F9", "x c #FBFCFD", "y c #B1CAFD", "z c #749AE8", "{ c #4A79DA", "| c #A5A5A5", "} c #A2A2A2", "~ c #E6E6E6", " ! c #CACACA", "!! c #447DF1", "#! c #75A0F9", "$! c #81AAFD", "%! c #A7C3FD", "&! c #90B4FE", "'! c #84A9F6", "(! c #CBD9F5", ")! c #E1EAFD", "*! c #6F9CF7", "+! c #4681FA", ",! c #1C64F6", "-! c #A0A0A0", ".! c #3273F8", "0! c #5D91FB", "1! c #5E93FE", "2! c #6898FA", "3! c #C4D4F6", "4! c #E4ECFC", "5! c #87ACF7", "6! c #4782FB", "7! c #3F7EFF", "8! c #105EFE", "9! c #9E9E9E", ":! c #3374FA", ";! c #4884FE", "! c #6F9BF3", "?! c #EDF2FB", "@! c #8FB3FB", "A! c #4A85FC", "B! c #4582FF", "C! c #1861F8", "D! c #5A8AEC", "E! c #3F7DFD", "F! c #4F88FD", "G! c #6092F8", "H! c #ADC5F7", "I! c #6093FC", "J! c #3577FD", "K! c #3E73DE", "L! c #7997D3", "M! c #3E7AF2", "N! c #5A8FFA", "O! c #5A90FE", "P! c #7EA5F4", "Q! c #DAE4F8", "R! c #85ACFD", "S! c #588FFE", "T! c #5A8EF8", "U! c #2B6CEE", "V! c #798EB9", "W! c #688ACF", "X! c #477CE9", "Y! c #628FEA", "Z! c #7CA5F8", "[! c #B1C9FB", "]! c #7EA6F8", "^! c #608DE8", "_! c #3C73E5", "`! c #7089BB", "a! c #9FA1A4", "b! c #718EC9", "c! c #5582DD", "d! c #3C74E6", "e! c #3B73E5", "f! c #366FE6", "g! c #4C79D7", "h! c #7D91BA", "i! c #A4A5A8", "j! c #A3A3A3", "k! c #E3E3E3", "l! c #BEBEBE", "m! c #B8B8B8", "n! c #ADADAD", "o! c #AAAAAA", "p! c #9C9C9C", "q! c #E1E1E1", "r! c #C3C3C3", "s! c #C0C0C0", "t! c #BABABA", "u! c #A1A1A1", "v! c #9F9F9F", "w! c #BCBCBC", "x! c #B6B6B6", "y! c #B3B3B3", "z! c #9D9D9D", " ", " # $ $ % % $ $ $ % $ $ $ % % % # ", " # % & & ' ( ) * + , , - . 0 1 2 $ # ", " $ & & 3 4 5 6 7 8 9 : ; < = > ? @ $ ", " $ ( 4 A 6 B C D E F G H I J K @ L % ", " $ ( 4 A 6 M N O P Q R S T U K @ L % ", " $ ( 4 A V W X Y Z [ ] ^ _ ` a @ L % ", " $ ) 5 6 b c d e f g h i j k l m n % ", " $ o p B q r s t u v w x y z { | } $ ", " $ ~ 7 !!!#!$!%!&!'!(!)!*!+!,!} -!% ", " % + D 9 .!0!1!1!2!3!4!5!6!7!8!-!9!$ ", " $ ) 5 6 :!;!!?!@!A!B!7!C!m n % ", " $ o p B D!E! c #EBF0F3", "? c #93B4D7", "@ c #77A0CE", "A c #6795C6", "B c #F1F3F3", "C c #F9F9F8", "D c #A2BFDD", "E c #D6E1EC", "F c #8AADD2", "G c #6290C4", "H c #D9E1EA", "I c #F4F4F2", "J c #F3F3F2", "K c #DBE4EE", "L c #9BB9DA", "M c #A0BBD8", "N c #5D8CC0", "O c #BCCDDF", "P c #F2F2F1", "Q c #F7F8F7", "R c #8FB1D6", "S c #E5EBF0", "T c #B9CBDF", "U c #5887BD", "V c #9FB7D5", "W c #F2F2F0", "X c #C3D4E6", "Y c #ACC3DD", "Z c #D1DCE7", "[ c #5483BA", "] c #82A2C8", "^ c #668EB0", "_ c #F0F2F4", "` c #76A0CD", "a c #AEC4DC", "b c #B2C6DD", "c c #B0C4DB", "d c #A5BCD6", "e c #4F7EB6", "f c #9CB7CF", "g c #EBF2F9", "h c #ABC3DD", "i c #A8C0DC", "j c #C5D4E4", "k c #C4D3E3", "l c #C1D0E0", "m c #BFCEDF", "n c #C3D9EE", "o c #E2E9EF", "p c #7BA1CC", "q c #F2F3F3", "r c #F5F5F3", "s c #AECCE8", "t c #F5F6F6", "u c #87AAD0", "v c #BBCDE0", "w c #F3F3F1", "x c #BBCDE2", "y c #6793C5", "z c #F2F3F2", "{ c #DCE9F5", "| c #96BCE1", "} c #71A5D6", "~ c #BDCFE1", " ! c #6490C3", "!! c #5E8BBF", "#! c #ABC1D9", "$! c #EDEEEF", "%! c #EAECED", "&! c #96B3CD", "'! c #F1F1F0", "(! c #F1F1EF", ")! c #B7B6AC", "*! c #BA945C", "+! c #F0F0EE", ",! c #EFEFED", "-! c #D6BD9A", ".! c white", "0! c #F9E9D0", "1! c #888A85", "! ! # # $ % & ' ( ) * + , - . ! 0 ", "! # # $ 2 & ' 3 4 5 + , . . 6 ! 0 ", "# 7 $ 2 & ' 8 9 : ; , . . 6 < ! 0 ", "7 $ 2 & ' = > ? @ A B . 6 < < ! 0 ", "$ 2 & ' = C D E F G H 6 < I J ! 0 ", "2 & 8 = C K L , M N O < I J P ! 0 ", "& 8 = C Q R S . T U V I J P W ! 0 ", "8 = C + X Y . 6 Z [ ] ^ ^ ^ ^ ! 0 ", "= C + _ ` a b c d e ^ f g g f ^ 0 ", "* + , h i j k l m ^ f g n n g f ^ ", "+ , o p q r < J ^ f g n s s n g f ^ ", ", t u v r < J w ^ g n s s s s n g ^ ", ". x y z < J w W ^ { | } } } } | { ^ ", "~ !!!#!$!w W %!^ &!{ | } } | { &!^ ", "6 < I J P W '!(!)!^ &!{ | | { &!^ *! ", "< I J P W '!(!+!,!)!^ &!{ { &!^ *!-!*! ", ".!.!.!.!.!.!.!.!.!.!)!^ ^ ^ ^ *!-!0!-!*! ", "1!1!1!1!1!1!1!1!1!1!1!)!)!)!)!)!*!-!0!-!*! ", " )!*!-!0!-!*!", " )!*!-!*!)!", " )!*!)! ", " )! "};wxformbuilder-3.1.59/output/plugins/additional/icons/dirPicker.xpm0000644000175000017500000000340411143440026025656 0ustar rrmulderrrmulder/* XPM */ static const unsigned char * dirpicker_xpm[] = { "22 22 77 1", " c None", "! c #70716F", "# c #6D6F6B", "$ c #676965", "% c #656663", "& c black", "' c #D0D0D0", "( c #A6A6A5", ") c #8E8E8D", "* c #5D5F5B", "+ c #585A56", ", c #575955", "- c #565854", ". c #555753", "0 c #686967", "1 c #A8A8A8", "2 c #AAAAAA", "3 c #ADADAD", "4 c #6480A4", "5 c #3465A4", "6 c #396091", "7 c #D2D2D2", "8 c #AFC7E3", "9 c #A7C2E0", ": c #9EBCDD", "; c #89AED6", "< c #5F615D", "= c #668EB0", "> c #9CB7CF", "? c #EBF2F9", "@ c #C3D9EE", "A c #95B3D4", "B c #AECCE8", "C c #86A4C5", "D c #366196", "E c #88AED6", "F c #88ADD5", "G c #7C9CBE", "H c #386093", "I c #A3BFDE", "J c #82AAD4", "K c #82A9D4", "L c #81A9D4", "M c #80A8D4", "N c #DCE9F5", "O c #96BCE1", "P c #71A5D6", "Q c #6F8BAD", "R c #3A5D89", "S c #677E9C", "T c #A5C2E0", "U c #7BA5D2", "V c #7AA4D2", "W c #7AA5D2", "X c #96B3CD", "Y c #58779F", "Z c #3C5574", "[ c #A5A8AA", "] c #758EB2", "^ c #8DB2D9", "_ c #73A1D0", "` c #73A0D0", "a c #72A0D0", "b c #B7B6AC", "c c #BA945C", "d c #436792", "e c #40423F", "f c #ADC1D4", "g c #94B5D7", "h c #6C9CCE", "i c #6D9CCE", "j c #6B9CCE", "k c #6B9BCE", "l c #D6BD9A", "m c #191A19", "n c #272926", "o c #F9E9D0", "!#####$$% ", "#'''''''$ ", "#()))))))*+,-..0 ", "#'1111111111123. ", "$(455555555555555556 ", "$7589999999999999995 ", "$(5:;;;;;;;;;;;;;;95 ", "<75:;;;;;;;====;;;:5 ", "<(5:;;;;;;=>??>=;;:5 ", ".75:;;;;;=>?@@?>=;A5 ", ".(5:;;;;=>?@BB@?>=CD ", ".759;;EF=?@BBBB@?=GH ", ".(5IJKLM=NOPPPPON=QR ", ".7STUVWV=XNOPPONX=YZ ", ".[]^_``ab=XNOONX=cde ", ".fghijjkkb=XNNX=clcm ", "n555555555b====clolc ", " bbbbbclolc ", " bclolc", " bclcb", " bcb ", " b "};wxformbuilder-3.1.59/output/plugins/additional/icons/genericdir_ctrl.xpm0000644000175000017500000000127611143440026027106 0ustar rrmulderrrmulder/* XPM */ static const unsigned char * genericdir_ctrl_xpm[] = { "21 21 7 1", " c None", "! c black", "# c #3E9ADE", "$ c #386093", "% c white", "& c #C5C5C5", "' c #555753", " ", " ####################", " #$$$%!!%%!%%%%%%%%%#", " #$&$%!%%%%%%%%%%%%%#", " #$$$%!!%%!%%%%%%%%%#", " #%'%%%%%%%%%%%%%%%%#", " #%'%%%$$%%%!%%%!%!%#", " #%'%%%$$$%!!%!%!!%%#", " #%'%%%$$$%!%%!%!%!!#", " #%'%%%'%%%%%%%%%%%%#", " #%'%%%$$%%%!%%%%%!%#", " #%'%%%$$$%!%%!%!!%%#", " #%'%%%$$$%!%%!%!%!!#", " #%'%%%'%%%%%%%%%%%%#", " #%'%%%$$%%%%%%!%%%%#", " #%'%%%$$$%!!%!!%!!!#", " #%'%%%$$$%!%!%!%!!%#", " #$$$%!!%%!%%%%%%%%%#", " #$&$%!%!%%%%%%%%%%%#", " #$$$%!!%%!%%%%%%%%%#", " ####################"};wxformbuilder-3.1.59/output/plugins/additional/xml/additional.cppcode0000644000175000017500000011073711143440026026360 0ustar rrmulderrrmulder wxformbuilder-3.1.59/output/plugins/additional/xml/additional.xml0000644000175000017500000012567611143440026025553 0ustar rrmulderrrmulder m_treeCtrl m_htmlWin wxVSCROLL|wxHSCROLL|wxNO_BORDER|wxWANTS_CHARS m_richText m_checkList m_grid 5 5 1 1 0 0 0 0 0 1 30 0 1 80 z m_toggleBtn Toggle me! 0 m_colourPicker m_fontPicker 100 m_filePicker Select a file *.* m_dirPicker Select a folder m_datePicker m_calendar m_scrollBar 0 100 1 1 m_spinCtrl 0 10 0 m_spinBtn m_hyperlink wxFB Website http://www.wxformbuilder.org wxSUNKEN_BORDER m_genericDirCtrl 0 0 m_customControl wxformbuilder-3.1.59/output/plugins/common/icons/toolSeparator.xpm0000644000175000017500000000220111143440026025752 0ustar rrmulderrrmulder/* XPM */ static const unsigned char * toolseparator_xpm[] = { "22 22 34 1", " c None", "! c black", "# c #ACA899", "$ c #ECE9D8", "% c #666699", "& c white", "' c #003399", "( c #FAFDFF", ") c #F4FBFF", "* c #EBE8D7", "+ c #0083D7", ", c #1E92DF", "- c #F2FAFF", ". c #EBF7FF", "0 c #E2F4FF", "1 c #0A87DA", "2 c #2F9AE3", "3 c #E6F6FF", "4 c #DFF3FF", "5 c #D6EFFF", "6 c #168EDD", "7 c #2394E1", "8 c #329BE5", "9 c #42A2E8", ": c #DBF1FF", "; c #CBEBFF", "< c #C8C8C8", "= c #D2EDFF", "> c #C9EAFF", "? c #C1E7FF", "@ c #48A5E9", "A c #E1DECE", "B c #E3E0D0", "C c #E1DDCE", " ", " ", " ", " ", " ", " ", "######################", "$$$$$$$$$$$#$$$$$$$$$$", "$$%%%%$$$$&#$$$''''$$$", "$$%&()%*$$&#$$'+&&,'$$", "$$%(-.0%$$&#$$'1&&2'$$", "$$%-345%$$&#$$'6789'$$", "$$%3:5;%$$&#$$'<<<<'$$", "$$%:=>?%$$&#$$'<@<<'$$", "$$%%%%%%$$&#$$A''''B$$", "CACCCAACCA&CCCCCACCACC", "######################", " ", " ", " ", " ", " "};wxformbuilder-3.1.59/output/plugins/common/icons/button16x16.xpm0000644000175000017500000000130011143440026025134 0ustar rrmulderrrmulder/* XPM */ static const unsigned char * button16x16_xpm[] = { "16 16 21 1", " c None", "! c black", "# c #002692", "$ c #E2F2FE", "% c #FEFFFF", "& c #FCFFFF", "' c white", "( c #5D5E5A", ") c #DCECF7", "* c #FAFDFE", "+ c #EDFFFE", ", c #D3F2FF", "- c #E9F8FD", ". c #E1F1FC", "0 c #DFF0FD", "1 c #F2FDFE", "2 c #D5EEFE", "3 c #CFE7F7", "4 c #D5F5FF", "5 c #DCFBFF", "6 c #D6EFFA", " ", " ", " ", " ", " ############## ", "#$$$$$$$$$$$$$$#", "#%&''(('('(%%&'#", "#$)*(++((,(-.01#", "#23+(++(((00000#", "#4,56((6(6(6666#", "#33333333333333#", " ############## ", " ", " ", " ", " "};wxformbuilder-3.1.59/output/plugins/common/icons/document.xpm0000644000175000017500000000374211143440026024745 0ustar rrmulderrrmulder/* XPM */ static const unsigned char * document_xpm[] = { "22 22 92 1", " c None", "! c #86ACDC", "# c #8DB0DC", "$ c #7BA7DC", "% c #7AA6DC", "& c #7AA4DA", "' c #79A2D8", "( c #79A1D8", ") c #76A0D5", "* c #759ED4", "+ c #739DD2", ", c #729ACF", "- c #7099CE", ". c #6F96CB", "0 c #6C94C9", "1 c #7A99C4", "2 c #7193C2", "3 c black", "4 c #85ACDC", "5 c #CEDCF1", "6 c #A0C1EA", "7 c #92B9E8", "8 c #C5C8CD", "9 c #FF6444", ": c #A7C4E8", "; c #6E90C0", "< c #7AA4DB", "= c #79A3DA", "> c #78A1D7", "? c #769FD5", "@ c #749ED3", "A c #739CD1", "B c #7097CD", "C c #6E95CB", "D c #6B91C7", "E c #698FC4", "F c #678DC3", "G c #668BC0", "H c #D4D4D4", "I c #D3D3D3", "J c #6387BD", "K c #79A3D9", "L c white", "M c #6085BA", "N c #FDFDFD", "O c #FCFCFC", "P c #FBFBFB", "Q c #FAFAFA", "R c #F8F8F8", "S c #F7F7F7", "T c #F5F5F5", "U c #5E81B7", "V c #6F97CC", "W c #6E94CA", "X c #6C92C8", "Y c #CECECE", "Z c #D6D6D6", "[ c #F4F4F4", "] c #F3F3F3", "^ c #5C7EB5", "_ c #688EC3", "` c #6488BE", "a c #F2F2F2", "b c #5A7CB2", "c c #587AB0", "d c #5678AD", "e c #5475AC", "f c #5373AA", "g c #D2D2D2", "h c #D0D0D0", "i c #CDCDCD", "j c #CBCBCB", "k c #CACACA", "l c #C8C8C8", "m c #C6C6C6", "n c #C5C5C5", "o c #C3C3C3", "p c #C2C2C2", "q c #AFAFAF", "r c #5172A9", "s c #6C90C3", "t c #6185BB", "u c #5F83B9", "v c #5E80B6", "w c #5C7EB4", "x c #587BB1", "y c #5779AE", "z c #5676AD", "{ c #5475AB", "| c #5373A9", "} c #5171A9", "~ c #506FA2", "!#$%&'()*+,-.012 ", "45677777787879:; ", "$<='>?@A,BC0DEFG ", " c #A0A1F2", ", c #A2A2F7", "< c #A3A3FC", "1 c #A5A5FF", "2 c #B3B5E5", "3 c #B4B5FA", "4 c #B6B8F0", "5 c #C0C0C0", "6 c #C4C4F3", "7 c #C8C8F7", "8 c #CBCBF8", "9 c #D1D1F7", "0 c #D4D4FC", "q c #D8D8FF", "w c #DFDFFE", "e c #E2E2FE", "r c #E3E3FF", "t c #E4E4FF", "y c #E5E5FF", "u c #E6E6FF", "i c #E7E7FF", "p c #E9E9FE", "a c #E9E9FF", "s c #EAEAFF", "d c #EBEBFF", "f c #EDEDFF", "g c #EFEFFF", "h c #F0F0FF", "j c #F1F1FF", "k c #F3F3FF", "l c #F6F6FF", "z c #F7F7FF", "x c #FCFCFF", "c c gray100", "v c None", /* pixels */ "vvvvvvvvvvvvvvvvvvvvvv", "vvvvvvvvvvvvvvvvvvvvvv", "vvvvvvvvvvvvvvvvvvvvvv", "vvvovvvvvvvvvo5vvvvvvv", "vvvocvcvcvcvco5vvvvvvv", "vvvoccccccccco5vvvvvvv", "vvvoccccccccco5vvvvvvv", "vvvoccccccccco5vvvvvvv", "vvvoooooooo11o5vvvvvvv", "vvvoccccccc1035vvvvvvv", "vvvocccccccjjg;vvvvvv", "vvvovvvvvvv;ggpp$vvvvv", "vvvvvvvvvvv=ppptrOvvvv", "vvvvvvvvvvv*ttr:. vvvv", "vvvvvvvvvvv&w+92vvvvvv", "vvvvvvvvvvv#+v%q%vvvvv", "vvvvvvvvvvv@vv%86%vvvv", "vvvvvvvvvvvvvvv%%%vvvv", "vvvvvvvvvvvvvvvvvvvvvv", "vvvvvvvvvvvvvvvvvvvvvv" }; wxformbuilder-3.1.59/output/plugins/common/icons/bitmap_button.xpm0000644000175000017500000000620411143440026025772 0ustar rrmulderrrmulder/* XPM */ static char *bitmap_button_xpm[] = { /* columns rows colors chars-per-pixel */ "22 22 127 2", " c #006600", ". c #036D01", "X c #056B02", "o c #0A7005", "O c #0E7407", "+ c #17751E", "@ c #003399", "# c #0C9106", "$ c #15840B", "% c #1FA810", "& c #288F14", "* c #2B9116", "= c #3C871C", "- c #30863F", "; c #28AA14", ": c #2FB018", "> c #3BA81D", ", c #3BB71D", "< c #3EB81F", "1 c #378B48", "2 c #388B48", "3 c #3E8E48", "4 c #43AE22", "5 c #44B522", "6 c #47BC23", "7 c #49B225", "8 c #4ABE25", "9 c #768300", "0 c #788400", "q c #6FA22E", "w c #64A678", "e c #54C32B", "r c #57C42B", "t c #5BC62E", "y c #9C0E0F", "u c #9D0E0F", "i c #9E0F0F", "p c #AF0B00", "a c #AF1407", "s c #AB575F", "d c #AF595F", "f c #B55B5F", "g c #BA5D5F", "h c #D92000", "j c #D92B08", "k c #F93000", "l c #FF3300", "z c #D94C21", "x c #FF440C", "c c #FF440D", "v c #FF5C1F", "b c #FF5D1F", "n c #FF7935", "m c magenta", "M c #A5BE43", "N c #CC9900", "B c #D18A1A", "V c #F99048", "C c #FFCC00", "Z c #FFCC01", "A c #FFCF08", "S c #FFD00A", "D c #FFD00B", "F c #FFD212", "G c #FFD314", "H c #FFD317", "J c #FFD519", "K c #FFD61E", "L c #FFD721", "P c #FFD824", "I c #FFD926", "U c #FFDA29", "Y c #FFDB2D", "T c #FFDC30", "R c #FFDD32", "E c #FFDE35", "W c #FFDE38", "Q c #FFE03B", "! c #FFE13E", "~ c #DFC269", "^ c #FFE241", "/ c #FFE345", "( c #FFE448", ") c #FFE54B", "_ c #FFE851", "` c #FFE854", "' c #FCE85A", "] c #FFE958", "[ c #FFED64", "{ c #80BBA8", "} c #BEB6C7", "| c #87C0B1", " . c #8FC2B1", ".. c #9EC9B1", "X. c #BFE4F3", "o. c #C3B8C7", "O. c #D9C1C7", "+. c #DEC2C7", "@. c #D6DEEF", "#. c #C2E7FF", "$. c #C3E7FF", "%. c #C2E8FF", "&. c #C3E8FF", "*. c #C8E9FF", "=. c #C8EAFF", "-. c #CEEBFF", ";. c #CEECFF", ":. c #D2E8E4", ">. c #D5EEFF", ",. c #D5EFFF", "<. c #DCF1FF", "1. c #DDF1FF", "2. c #DCF2FF", "3. c #DDF2FF", "4. c #E4F4FF", "5. c #E4F5FF", "6. c #EBF7FF", "7. c #EAF8FF", "8. c #EBF8FF", "9. c #F1F9FF", "0. c #F1FAFF", "q. c #F6FBFF", "w. c #F7FBFF", "e. c #F6FCFF", "r. c #F7FCFF", "t. c #FAFDFF", "y. c None", /* pixels */ "y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.", "y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.", "y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.", "y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.", "y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.", "y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.", "@.@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @.", "@ t.t.t.t.t.t.~ N N N N N N ~ t.t.t.t.t.t.@ ", "@ q.t.q.e.w.e.N C C D H Y Q N e.q.q.q.q.e.@ ", "@ 0.0.0.+.g y N C D H P W ) N 0.0.0.0.0.0.@ ", "@ 6.8.O.p h k N A G P E ) ' 9 :.7.6.7.6.6.@ ", "@ 4.4.f h l c N F L R / ` q * o ..4.4.4.4.@ ", "@ 1.1.y k x b N K R ^ ` M O t > 3 1.1.1.1.@ ", "@ >.>.d j b n N Y ! _ [ = 7 e 6 $ w >.>.>.@ ", "@ ;.-.o.a z V B N N N 0 * e 8 , ; . .;.;.@ ", "@ =.=.=.} s y s } =.X.X 4 5 < : % # 1 =.=.@ ", "@ $.&.$.$.&.$.$.&.&.$.{ - + 1 | $.$.@ ", "@.@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @.", "y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.", "y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.", "y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.", "y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y." }; wxformbuilder-3.1.59/output/plugins/common/icons/static_text.xpm0000644000175000017500000000132711143440026025457 0ustar rrmulderrrmulder/* XPM */ static char *static_text_xpm[] = { /* columns rows colors chars-per-pixel */ "22 22 3 1", " c black", ". c magenta", "X c None", /* pixels */ "XXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXX XXXXXXXXXXXX", "XXXXXXXXX XXXXXXXXXXXX", "XXXXXXXXX XXXXXXXXXXXX", "XXXXX XX XXX XXXXX", "XXXXXXX X XX X XXXXXXX", "XXXXX X XX X XXXXXXX", "XXXX XX X XX X XXXXXXX", "XXXXX X XXX XXXXX", "XXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXX" }; wxformbuilder-3.1.59/output/plugins/common/icons/tool.xpm0000644000175000017500000000364011143440026024101 0ustar rrmulderrrmulder/* XPM */ static char *tool_xpm[] = { /* columns rows colors chars-per-pixel */ "22 22 85 1", " c #6984C9", ". c #778ACD", "X c magenta", "o c #CC9900", "O c #FFE300", "+ c #FFE800", "@ c #FFE900", "# c #FFEC00", "$ c #FFED00", "% c #FFEE00", "& c #FFF200", "* c #FFF600", "= c #FFFD00", "- c yellow", "; c #ACA899", ": c #8995D4", "> c #9494CD", ", c #9695D0", "< c #9797D5", "1 c #939EDD", "2 c #9D9FD5", "3 c #9998DA", "4 c #9B9AE0", "5 c #9D9DE6", "6 c #9E9FEC", "7 c #9EA9E6", "8 c #A2A9DF", "9 c #A0A1F2", "0 c #A2A2F7", "q c #A3A3FC", "w c #A5A5FF", "e c #B3B5E5", "r c #B4B5FA", "t c #B6B8F0", "y c #C4C4F3", "u c #C8C8F7", "i c #CBCBF8", "p c #D4D3EF", "a c #D1D1F7", "s c #D8D8FF", "d c #DFDFFE", "f c #E1DDCE", "g c #E1DECD", "h c #E1DECE", "j c #E3DFCF", "k c #E3E0CF", "l c #E3E0D0", "z c #E5E1D1", "x c #E5E1D2", "c c #E5E2D1", "v c #E5E2D2", "b c #E6E3D3", "n c #E7E3D3", "m c #E6E4D3", "M c #E8E5D4", "N c #E8E5D5", "B c #E9E5D4", "V c #E9E5D5", "C c #E8E6D4", "Z c #E9E7D6", "A c #EAE6D6", "S c #EAE7D6", "D c #EBE8D7", "F c #ECE8D7", "G c #EBE8D8", "H c #ECE9D8", "J c #E2E2FE", "K c #E3E3FF", "L c #E4E4FF", "P c #E5E5FF", "I c #E6E6FF", "U c #E7E7FF", "Y c #E9E9FE", "T c #E9E9FF", "R c #EAEAFF", "E c #EBEBFF", "W c #EDEDFF", "Q c #EFEFFF", "! c #F0F0FF", "~ c #F1F1FF", "^ c #F3F3FF", "/ c #F6F6FF", "( c #F7F7FF", ") c #FCFCFF", "_ c None", /* pixels */ "______________________", "______________________", "______________________", "______________________", "______________________", ";;;;;;;;;;;;;;;;;;;;;;", "HHHHHHffffffffffHHHHFH", "HHHHHfHHooHHHHHHfHHHHH", "HHAAFfFo--oDDFDDfAAFFF", "ZAAZZfZo-oooooZDfZAAZZ", "ZZnZZfZoo*%$wwoZfZmZZZ", "zzZvvfmoo%%@wprvfZzbvv", "zvvvvfvoo$@Oq)uvfvvvvv", "vjjjkfkkoooo0((tfffkkk", "ffffffffffff9^!Q7fffff", ";;;;;;;;;;;;6QWEE1;;;;", "____________5EEIKJ:___", "____________4IIK8. ___", "____________3d>ae_____", "____________<>_2s2____", "____________>__2iy2___", "________________222___" }; wxformbuilder-3.1.59/output/plugins/common/icons/doc_parent_frame.xpm0000644000175000017500000000241511143440026026413 0ustar rrmulderrrmulder/* XPM */ static const unsigned char * doc_parent_frame_xpm[] = { "22 22 43 1", " c None", "! c black", "# c #A7C4E8", "$ c #5E81B7", "% c #92B9E8", "& c #CEDCF1", "' c #A0C1EA", "( c #C5C8CD", ") c #FF6444", "* c #6E90C0", "+ c #668BC0", ", c #7BA7DC", "- c #7AA4DB", ". c #79A3DA", "0 c #79A2D8", "1 c #78A1D7", "2 c #769FD5", "3 c #749ED3", "4 c #739CD1", "5 c #729ACF", "6 c #7097CD", "7 c #6E95CB", "8 c #6C94C9", "9 c #6B91C7", ": c #698FC4", "; c #678DC3", "< c #787878", "= c #6387BD", "> c #6085BA", "? c #5C7EB5", "@ c #5A7CB2", "A c #587AB0", "B c #5678AD", "C c #5475AC", "D c #5373AA", "E c #5172A9", "F c #5C7EB4", "G c #587BB1", "H c #5779AE", "I c #5676AD", "J c #5475AB", "K c #5373A9", "L c #5171A9", " ", " ", "#$$$$$$$$$$$$$$$$$$$$#", "$%&&'%%%%%%%%((%(%%)#*", "$%&&%%%%%%%%%((%(%%)%+", "$,,-.00123345667899:;+", "$<<<<<<<<<<<<<<<<<<<<=", "$<<<<<<<<<<<<<<<<<<<<>", "$<<<<<<<<<<<<<<<<<<<<$", "$<<<<<<<<<<<<<<<<<<<<$", "$<<<<<<<<<<<<<<<<<<< c #30B920", ", c #30B921", "< c #56B750", "1 c #57B751", "2 c #41C52B", "3 c #47C82F", "4 c #4BCB32", "5 c #59D43B", "6 c #66C25B", "7 c #66C25C", "8 c #6BE047", "9 c magenta", "0 c #91E07A", "q c #92E17A", "w c #8787A1", "e c #8989A3", "r c #9797A8", "t c #9898A8", "y c #9C9CAC", "u c #9E9EAE", "i c #9797B0", "p c #89BE87", "a c #89BF87", "s c #ADADBE", "d c #AFAFC0", "f c #B6B6C7", "g c #B6B7C7", "h c #BABAC0", "j c #BCBCC1", "k c #BDBDC2", "l c #BFBFC5", "z c #99E680", "x c #9AE780", "c c #A5D39B", "v c #A6D59D", "b c #B3DFA7", "n c #B5E0A9", "m c #D0D0BF", "M c #C7EFB7", "N c #C7EFB8", "B c #C8C8C8", "V c #C9CAC9", "C c #CACACA", "Z c #CBCBCA", "A c #CCCDCD", "S c #CECECE", "D c #CFCFD0", "F c #D2D2D1", "G c LightGray", "H c #D5D6D6", "J c #D7D7D7", "K c #DADADA", "L c #DBDBDA", "P c #DEDEDD", "I c #DFDFDF", "U c #DCDCE0", "Y c #DEDDE2", "T c #DFDFE4", "R c #E1E1E6", "E c #E3E4E3", "W c #E4E4E4", "Q c #E7E7E8", "! c #E9E9E9", "~ c #ECEBEC", "^ c #EEEEEE", "/ c #F0F0EF", "( c #F2F2F3", ") c #F3F3F2", "_ c #F3F4F3", "` c #F7F7F6", "' c gray97", "] c None", /* pixels */ "]]]]]]]]]]]]]]]]]]]]]]", "]]]]]]ooooo]]]]]]]]]]]", "]]]mm]ooooo]mmmmmmm]]]", "]]m]]]]]]]]]]]]]]]]m]]", "]m]]]]]]]]]]]]]]]]]]m]", "]m]]]]]]OXXO]]]]]]]]m]", "]m]]]] Orhky+ ]]]]]]m]", "]m]]] %BBADGJw ]]]]]m]", "]m]]]OBBa16cLI#]]]]]m]", "]m]]OtAa=-:3bWsO]]]]m]", "]m]]XkA1-;,40!UX]]]]m]", "]m]]XlG7:,25z^TX]]]]m]", "]m]]OyJv3458M(gO]]]]m]", "]m]]]+LPn0zM)`&]]]]]m]", "]m]]] eW!~(_'i ]]]]]m]", "]m]]]] $dUTg* ]]]]]]m]", "]m]]]]]]OXXO]]]]]]]]m]", "]m]]]]]]]]]]]]]]]]]]m]", "]]m]]]]]]]]]]]]]]]]m]]", "]]]mmmmmmmmmmmmmmmm]]]", "]]]]]]]]]]]]]]]]]]]]]]", "]]]]]]]]]]]]]]]]]]]]]]" }; wxformbuilder-3.1.59/output/plugins/common/icons/doc_mdi_parent_frame.xpm0000644000175000017500000000375611143440026027255 0ustar rrmulderrrmulder/* XPM */ static const unsigned char * doc_mdi_parent_frame_xpm[] = { "22 22 92 1", " c None", "! c black", "# c #A7C4E8", "$ c #5E81B7", "% c #92B9E8", "& c #CEDCF1", "' c #A0C1EA", "( c #C5C8CD", ") c #FF6444", "* c #6E90C0", "+ c #668BC0", ", c #7BA7DC", "- c #7AA4DB", ". c #79A3DA", "0 c #79A2D8", "1 c #78A1D7", "2 c #769FD5", "3 c #749ED3", "4 c #739CD1", "5 c #729ACF", "6 c #7097CD", "7 c #6E95CB", "8 c #6C94C9", "9 c #6B91C7", ": c #698FC4", "; c #678DC3", "< c #787878", "= c #6387BD", "> c #86ACDC", "? c #8DB0DC", "@ c #7AA6DC", "A c #7AA4DA", "B c #79A1D8", "C c #76A0D5", "D c #759ED4", "E c #739DD2", "F c #7099CE", "G c #6F96CB", "H c #7A99C4", "I c #7193C2", "J c #6085BA", "K c #85ACDC", "L c #D4D4D4", "M c #D3D3D3", "N c #79A3D9", "O c white", "P c #5C7EB5", "Q c #FDFDFD", "R c #FCFCFC", "S c #FBFBFB", "T c #FAFAFA", "U c #F8F8F8", "V c #F7F7F7", "W c #F5F5F5", "X c #5A7CB2", "Y c #F4F4F4", "Z c #F3F3F3", "[ c #F2F2F2", "] c #587AB0", "^ c #5678AD", "_ c #6F97CC", "` c #5475AC", "a c #6C92C8", "b c #CECECE", "c c #D6D6D6", "d c #D2D2D2", "e c #D0D0D0", "f c #CDCDCD", "g c #CBCBCB", "h c #CACACA", "i c #C8C8C8", "j c #C6C6C6", "k c #C5C5C5", "l c #C3C3C3", "m c #C2C2C2", "n c #AFAFAF", "o c #5172A9", "p c #5373AA", "q c #6C90C3", "r c #688EC3", "s c #6488BE", "t c #6185BB", "u c #5F83B9", "v c #5E80B6", "w c #5C7EB4", "x c #587BB1", "y c #5779AE", "z c #5676AD", "{ c #5475AB", "| c #5373A9", "} c #5171A9", "~ c #506FA2", " ", " ", "#$$$$$$$$$$$$$$$$$$$$#", "$%&&'%%%%%%%%((%(%%)#*", "$%&&%%%%%%%%%((%(%%)%+", "$,,-.00123345667899:;+", "$<<<<<<<<<<<<<<<<<<<<=", "$<>?,@A0BCDE5FG8HI<< c #A8D8FF", ", c #AAD8FF", "< c #AAD9FF", "1 c #ACDAFF", "2 c #AEDCFF", "3 c #AFDCFF", "4 c #B0DDFF", "5 c #B4E0FF", "6 c #B5E0FF", "7 c #B7E2FF", "8 c #B8E3FF", "9 c #BAE4FF", "0 c #BAE5FF", "q c #BBE6FF", "w c #BDE6FF", "e c #BDE7FF", "r c #BFE8FF", "t c #C0E8FF", "y c #C1E9FF", "u c #C2EAFF", "i c #C3ECFF", "p c #C5ECFF", "a c #C6EDFF", "s c #C9EFFF", "d c #CAF0FF", "f c #CEF3FF", "g c #DFFFFF", "h c LightCyan", "j c #E1FFFF", "k c #E2FFFF", "l c #E3FFFF", "z c #E4FFFF", "x c #E5FFFF", "c c #E6FFFF", "v c #E7FFFF", "b c #E8FFFF", "n c #E9FFFF", "m c #EBFFFF", "M c #ECFFFF", "N c #EDFFFF", "B c #EEFFFF", "V c #EFFFFF", "C c azure", "Z c #F1FFFF", "A c #F2FFFF", "S c #F3FFFF", "D c #F4FFFF", "F c #F5FFFF", "G c #F6FFFF", "H c #F7FFFF", "J c #F8FFFF", "K c #F9FFFF", "L c #FAFFFF", "P c #FBFFFF", "I c #FCFFFF", "U c #FDFFFF", "Y c #FEFFFF", "T c gray100", "R c None", /* pixels */ "RRRRRRRRRRRRRRRRRRRRRR", "RRRRRRRRRRRRRRRRRRRRRR", "RRRRRRRRRRRRRRRRRRRRRR", "RRRRRRRRRRRRRRRRRRRRRR", "RRRRRRRRRRRRRRRRRRRRRR", "RRRRRRRRRRRRRRRRRRRRRR", "......................", ".TTTTTTTJJSSZB.O@@--<.", ".TTTTTJTJJZZZB.+@-:14.", ".TT TJJSZZBBm.@-<145.", ".TTTJ SSSZBmmm.-oooo9.", ".TJ ZZZBmmxx.<2oo9e.", ".T SS ZBBBmxkk.255eei.", ".SJ BBmxxkkk.58euas.", ".JSZBBmmxxkkkg.9euadf.", "......................", "RRRRRRRRRRRRRRRRRRRRRR", "RRRRRRRRRRRRRRRRRRRRRR", "RRRRRRRRRRRRRRRRRRRRRR", "RRRRRRRRRRRRRRRRRRRRRR", "RRRRRRRRRRRRRRRRRRRRRR", "RRRRRRRRRRRRRRRRRRRRRR" }; wxformbuilder-3.1.59/output/plugins/common/icons/text_ctrl.xpm0000644000175000017500000000207411143440026025134 0ustar rrmulderrrmulder/* XPM */ static char *text_ctrl_xpm[] = { /* columns rows colors chars-per-pixel */ "22 22 27 1", " c black", ". c #3E9ADE", "X c magenta", "o c #808080", "O c #EAFFFF", "+ c #EBFFFF", "@ c #ECFFFF", "# c #EDFFFF", "$ c #EEFFFF", "% c #EFFFFF", "& c azure", "* c #F1FFFF", "= c #F2FFFF", "- c #F3FFFF", "; c #F4FFFF", ": c #F5FFFF", "> c #F6FFFF", ", c #F7FFFF", "< c #F8FFFF", "1 c #F9FFFF", "2 c #FAFFFF", "3 c #FBFFFF", "4 c #FCFFFF", "5 c #FDFFFF", "6 c #FEFFFF", "7 c gray100", "8 c None", /* pixels */ "8888888888888888888888", "8888888888888888888888", "8888888888888888888888", "8888888888888888888888", "8888888888888888888888", "......................", ".77777777777777777777.", ".777777o7o77777777777.", ".77 777o777771171117.", ".7777 71o11711111711-.", ".11 11o11--11------.", ".- 1- 1-o------------.", ".-- -o-o#--#-######.", ".--###########OOOOOOO.", "......................", "8888888888888888888888", "8888888888888888888888", "8888888888888888888888", "8888888888888888888888", "8888888888888888888888", "8888888888888888888888", "8888888888888888888888" }; wxformbuilder-3.1.59/output/plugins/common/icons/dialog.xpm0000644000175000017500000001151111143440026024357 0ustar rrmulderrrmulder/* XPM */ static const unsigned char * dialog_xpm[] = { "22 22 231 2", " c None", "! c black", "# c #C9D8EB", "$ c #81A5D7", "% c #90B7E7", "& c #86B1E6", "' c #84B1E6", "( c #84B0E5", ") c #84AFE5", "* c #84AEE3", "+ c #83ADE2", ", c #82ACE1", "- c #81ABE0", ". c #80AADF", "0 c #7FA8DD", "1 c #7EA7DC", "2 c #7DA7DC", "3 c #7DA6DA", "4 c #7CA4D9", "5 c #7AA3D8", "6 c #7FA5D7", "7 c #81A3D2", "8 c #81A8D9", "9 c #8AB1E0", ": c #90B7E6", "; c #8FB6E6", "< c #8EB6E6", "= c #8EB6E5", "> c #8EB5E5", "? c #8CB1E0", "@ c #789DCE", "A c #80AADD", "B c #7FAADE", "C c #7FABDF", "D c #80ABE0", "E c #80ACE0", "F c #7EA8DD", "G c #739ACF", "H c #7DA8DC", "I c #8DB2DF", "J c #99BAE2", "K c #99BBE2", "L c #9ABBE3", "M c #9ABBE2", "N c #94B5DE", "O c #779BCF", "P c #85ABDC", "Q c #BFD2EA", "R c #EBEFF3", "S c #E8EDF3", "T c #E8EDF2", "U c #E8ECF2", "V c #E7ECF2", "W c #DDE5EE", "X c #8DA8D2", "Y c #86ABDC", "Z c #FEFBF6", "[ c #F2F1F0", "] c #E0DFDD", "^ c #DAD9D7", "_ c #DAD8D7", "` c #D9D8D6", "a c #E1DFDE", "b c #F4F2F0", "c c #EBECEF", "d c #91ABD2", "e c #86AADB", "f c #C7D7E9", "g c #E9E9E9", "h c #C8C9C8", "i c #C6C6C6", "j c #CECECE", "k c #CDCDCD", "l c #E6E9ED", "m c #8EA9D0", "n c #85AADA", "o c #CAD7E9", "p c #EAE9E7", "q c #C9C9C8", "r c #DBDBDB", "s c #F6F6F6", "t c #F8F7F6", "u c white", "v c #8CA6CE", "w c #84A8D8", "x c #C6D5E7", "y c #E8E7E6", "z c #C8C8C7", "{ c #E0E0E0", "| c #FFFEFD", "} c #8AA4CC", "~ c #82A7D7", " ! c #C2D2E5", "!! c #E7E7E7", "#! c #CFCFCF", "$! c #E2E2E2", "%! c #FCFCFC", "&! c #FBFAF9", "'! c #E4E7EB", "(! c #89A2CA", ")! c #82A6D6", "*! c #C2D0E5", "+! c #F2F0EF", ",! c #EBECEB", "-! c #E7E7E6", ".! c #EBEBEB", "0! c #F1F1F1", "1! c #F0F0F1", "2! c #F1F1F0", "3! c #F0F1F1", "4! c #E3E5E9", "5! c #88A1C9", "6! c #81A5D4", "7! c #C0CEE3", "8! c #F2F0ED", "9! c #F1F0EE", ":! c #F1F0ED", ";! c #EFEEED", "! c #87A0C8", "?! c #7FA3D2", "@! c #C0CEE1", "A! c #E8E9EA", "B! c #D7DDE8", "C! c #D4DCE8", "D! c #D5DCE8", "E! c #D6DCE8", "F! c #E3E5EB", "G! c #E3E2E2", "H! c #EDEEF2", "I! c #D3DDEC", "J! c #CFDAEC", "K! c #D0DAEB", "L! c #D1DBEC", "M! c #E6EAF2", "N! c #DEE1E5", "O! c #859FC6", "P! c #7CA0CF", "Q! c #C0CEDF", "R! c #CAD3E4", "S! c #7D9CD7", "T! c #7094D6", "U! c #7195D6", "V! c #7597D7", "W! c #B8C6E2", "X! c #E2E1E0", "Y! c #CED8EA", "Z! c #789AD8", "[! c #6A8FD6", "]! c #6B91D5", "^! c #7194D6", "_! c #BBCAE7", "`! c #DEE1E4", "a! c #829BC3", "b! c #7B9ECE", "c! c #BECBDD", "d! c #D1D7E4", "e! c #97AEDA", "f! c #8DA8D9", "g! c #8EA9D9", "h! c #91AAD9", "i! c #C3CEE3", "j! c #E0E0DE", "k! c #DDE2EC", "l! c #A8BCE1", "m! c #A0B6E0", "n! c #A1B7E0", "o! c #A4B9E0", "p! c #D1D9EB", "q! c #DDDFE4", "r! c #8198C0", "s! c #7A9CCC", "t! c #BBC8DC", "u! c #E9E8E7", "v! c #E4E5E6", "w! c #E4E5E5", "x! c #E6E7E7", "y! c #DCDEE3", "z! c #8098C0", "{! c #BBC7DC", "|! c #ECEAE7", "}! c #EAE9E6", "~! c #EAE9E5", " # c #E9E8E6", "!# c #E6E5E4", "## c #E7E6E5", "$# c #EEEDEC", "%# c #EEEEEC", "&# c #EEEEED", "'# c #F1EEEC", "(# c #DDDEE2", ")# c #6C8FC2", "*# c #99AFD3", "+# c #B9C8DD", ",# c #B7C6DC", "-# c #B6C5DA", ".# c #B5C4DA", "0# c #B5C3DA", "1# c #B3C2D8", "2# c #B4C2D8", "3# c #B2C0D6", "4# c #B0BED5", "5# c #AFBED4", "6# c #AFBED3", "7# c #AFBDD3", "8# c #AFBCD3", "9# c #AEBCD2", ":# c #AEBBD1", ";# c #B1BDD2", "<# c #A7B6CF", "=# c #708CBD", "># c #5A7BAB", "?# c #6486B4", "@# c #6283B2", "A# c #6081B0", "B# c #5F7FAF", "C# c #5E7DAD", "D# c #5C7CAC", "E# c #5B7AAA", "F# c #5977A7", "G# c #5776A5", "H# c #5675A5", "I# c #5574A3", "J# c #5472A1", "K# c #5470A1", "L# c #536FA0", "M# c #516E9E", "N# c #516E9D", "O# c #506D9D", "P# c #4F6B9C", " ", " ", "# $ % & ' ( ) * + , - . . 0 1 2 3 4 5 6 7 # ", "8 9 : ; ; ; ; ; ; ; < = = = > > > > > = ? @ ", "A B C D D D D D D D D D D D D D E E E E F G ", "H I J J J J J J J K L L L L L L L L L M N O ", "P Q R S S S S S T U V V V V V V V V V R W X ", "Y # Z [ ] ^ ^ ^ ^ ^ ^ ^ _ ` ` ` ` ` a b c d ", "e f b g h i j j j j j j k k k k k k a b l m ", "n o b p q r s s s s s s s s t u u u u b l v ", "w x b y z { u u u u u u u u | u u u u b l } ", "~ !b !!#!$!%!%!%!%!%!%!%!%!&!u u u u b '!(! ", ")!*!+!,!-!.!0!0!1!2!2!0!3!1!1!1!1!1!1!1!4!5! ", "6!7!8!9!9!9!:!;!! ", "?!@!b A!B!C!D!E!F!G!;!;!;!H!I!J!K!L!M!b N!O! ", "P!Q!b R!S!T!U!V!W!X!;!;!;!Y!Z![!]!^!_!b `!a! ", "b!c!b d!e!f!g!h!i!j!;!;!;!k!l!m!n!o!p!b q!r! ", "s!t!u!v!v!w!w!x!x!x!b b b b b b b b b b y!z! ", "s!{!|!}!~!}!}! #!#j!##$#$#%#%#%#&#%#%#'#(#z! ", ")#*#+#,#-#.#0#1#2#2#3#4#4#5#6#7#8#9#:#;#<#=# ", "# >#?#@#A#B#C#D#E#F#G#H#H#I#J#K#L#M#N#O#P## ", " ", " ", " "};wxformbuilder-3.1.59/output/plugins/common/icons/submenu.xpm0000644000175000017500000000345411143440026024605 0ustar rrmulderrrmulder/* XPM */ static char *submenu_xpm[] = { /* columns rows colors chars-per-pixel */ "22 22 77 1", " c #333366", ". c #0066CC", "X c #6984C9", "o c #778ACD", "O c magenta", "+ c #ACA899", "@ c #8995D4", "# c #9494CD", "$ c #9695D0", "% c #9797D5", "& c #939EDD", "* c #9D9FD5", "= c #9998DA", "- c #9B9AE0", "; c #9D9DE6", ": c #9E9FEC", "> c #9EA9E6", ", c #A2A9DF", "< c #A0A1F2", "1 c #A2A2F7", "2 c #A3A3FC", "3 c #A5A5FF", "4 c #B3B5E5", "5 c #B4B5FA", "6 c #B6B8F0", "7 c #C0C0C0", "8 c #C4C4F3", "9 c #C8C8F7", "0 c #CBCBF8", "q c #D1D1F7", "w c #D4D4FC", "e c #D8D8FF", "r c #DFDFFE", "t c #E2E2FE", "y c #E3E3FF", "u c #E4E4FF", "i c #E5E5FF", "p c #E6E6FF", "a c #E7E7FF", "s c #E9E9FE", "d c #E9E9FF", "f c #EAEAFF", "g c #EBEBFF", "h c #EDEDFF", "j c #EFEFFF", "k c LightCyan", "l c #E1FFFF", "z c #E3FFFF", "x c #E4FFFF", "c c #E5FFFF", "v c #E7FFFF", "b c #E8FFFF", "n c #E9FFFF", "m c #EBFFFF", "M c #ECFFFF", "N c #EDFFFF", "B c #EEFFFF", "V c #EFFFFF", "C c #F0F0FF", "Z c #F1F1FF", "A c #F3F3FF", "S c #F6F6FF", "D c #F7F7FF", "F c azure", "G c #F1FFFF", "H c #F2FFFF", "J c #F3FFFF", "K c #F4FFFF", "L c #F9FFFF", "P c #FAFFFF", "I c #FBFFFF", "U c #FCFCFF", "Y c #FCFFFF", "T c #FDFFFF", "R c #FEFFFF", "E c gray100", "W c None", /* pixels */ "EEEEEEEEE WWWWWWWWWWWW", "E LL 7WWWWWWWWWWW", "LEELELLLL 7WWWWWWWWWWW", ".......E. W", ".EEEEE.EE EEEEEEEEE W", ".......E. E EL 7", "KKJJJJBBB EEELELLLL 7", " ......... 7", "W777777777 .EEEEE... 7", "WWWWWWWWWW ....33... 7", "WWWWWWWWWW KJJJ3w5BB+7", "WWWWWWWWWW 2L9++ 7", "WWWWWWWWWW BBBm1DS6m 7", "WWWWWWWWWW m 7", "WWWWWWWWWW mmcc:Chss&7", "WWWWWWWWWW cccc;ssaiy@", "WWWWWWWWWW l -iiy,oX", "WWWWWWWWWW kllk=r#q4 7", "WWWWWWWWWW %# *e*7", "WWWWWWWWWWW7777$77*08*", "WWWWWWWWWWWWWWWWWWW***", "WWWWWWWWWWWWWWWWWWWWWW" }; wxformbuilder-3.1.59/output/plugins/common/icons/toolbar.xpm0000644000175000017500000000313111143440026024561 0ustar rrmulderrrmulder/* XPM */ static char *toolbar_xpm[] = { /* columns rows colors chars-per-pixel */ "22 22 63 1", " c #003399", ". c #666699", "X c #0083D7", "o c #0A87DA", "O c #168EDD", "+ c #1E92DF", "@ c #2394E1", "# c #2F9AE3", "$ c #329BE5", "% c #42A2E8", "& c #48A5E9", "* c magenta", "= c #CC9900", "- c #FFDA00", "; c #FFDE00", ": c #FFE200", "> c #FFE300", ", c #FFE700", "< c #FFE800", "1 c #FFE900", "2 c #FFEC00", "3 c #FFED00", "4 c #FFEE00", "5 c #FFF200", "6 c #FFF600", "7 c #FFFD00", "8 c yellow", "9 c #ACA899", "0 c #C8C8C8", "q c #C1E7FF", "w c #C9EAFF", "e c #CBEBFF", "r c #D2EDFF", "t c #D4EFFF", "y c #D6EFFF", "u c #DBF1FF", "i c #DDF2FF", "p c #DFF3FF", "a c #E1DDCE", "s c #E1DECD", "d c #E1DECE", "f c #E3E0CF", "g c #E3E0D0", "h c #E5E1D1", "j c #E5E2D2", "k c #E6E3D3", "l c #E6E4D3", "z c #E8E5D4", "x c #EAE7D6", "c c #EBE8D7", "v c #ECE8D7", "b c #ECE9D8", "n c #E2F4FF", "m c #E6F6FF", "M c #E8F6FF", "N c #EBF7FF", "B c #F0F9FF", "V c #F2FAFF", "C c #F4FBFF", "Z c #F8FDFF", "A c #FAFDFF", "S c gray100", "D c None", /* pixels */ "DDDDDDDDDDDDDDDDDDDDDD", "DDDDDDDDDDDDDDDDDDDDDD", "DDDDDDDDDDDDDDDDDDDDDD", "DDDDDDDDDDDDDDDDDDDDDD", "DDDDDDDDDDDDDDDDDDDDDD", "DDDDDDDDDDDDDDDDDDDDDD", "9999999999999999999999", "bbbbbbbbbbbbbbbbbbbbbb", "....bbcc==bbbbbbb b", ".SAC.cb=77=ccvcc XSS+ ", ".AVNn.x=7=====cx oSS# ", ".Vmpy.x==653,:=x O@$% ", ".muye.l==53,:;=j 0000 ", ".urwq.l==3,,;-=j 0&00 ", "......dg======ggd g", "adaaaddaadaaaaaadaadaa", "9999999999999999999999", "DDDDDDDDDDDDDDDDDDDDDD", "DDDDDDDDDDDDDDDDDDDDDD", "DDDDDDDDDDDDDDDDDDDDDD", "DDDDDDDDDDDDDDDDDDDDDD", "DDDDDDDDDDDDDDDDDDDDDD" }; wxformbuilder-3.1.59/output/plugins/common/icons/panel.xpm0000644000175000017500000000145711143440026024227 0ustar rrmulderrrmulder/* XPM */ static const unsigned char * panel_xpm[] = { "22 22 12 1", " c None", "! c #FBFBFB", "# c white", "$ c #F8F8F8", "% c black", "& c #F5F5F5", "' c #DDE2EC", "( c #708CBD", ") c #FDFDFD", "* c #FCFCFC", "+ c #F1F1F1", ", c #F3F3F3", "!!########$######### ", "&'''''''''''''''''''( ", ")'''''''''''''''''''( ", "#'''''''''''''''''''( ", "#'''''''''''''''''''( ", "*'''''''''''''''''''( ", "#'''''''''''''''''''( ", ")'''''''''''''''''''( ", "!'''''''''''''''''''( ", "#'''''''''''''''''''( ", "#'''''''''''''''''''( ", "!'''''''''''''''''''( ", "#'''''''''''''''''''( ", "$'''''''''''''''''''( ", "#'''''''''''''''''''( ", "+'''''''''''''''''''( ", "#'''''''''''''''''''( ", "#'''''''''''''''''''( ", ",'''''''''''''''''''( ", "#'''''''''''''''''''( ", " (((((((((((((((((((( ", " "};wxformbuilder-3.1.59/output/plugins/common/icons/list_ctrl.xpm0000644000175000017500000000263111143440026025122 0ustar rrmulderrrmulder/* XPM */ static char *list_ctrl_xpm[] = { /* columns rows colors chars-per-pixel */ "22 22 50 1", " c #333366", ". c #0066CC", "X c magenta", "o c #CBC7B8", "O c #D4D1C2", "+ c #D4D1C3", "@ c #D5D1C2", "# c #D5D1C3", "$ c #D4D2C2", "% c #D4D2C3", "& c #D5D2C3", "* c #DEFFFF", "= c #E1DFD0", "- c #E1DFD1", "; c #E2DFD0", ": c #E2DFD1", "> c #E1E0D0", ", c #E1E0D1", "< c #E2E0D0", "1 c #E2E0D1", "2 c #EBEADB", "3 c LightCyan", "4 c #E1FFFF", "5 c #E2FFFF", "6 c #E3FFFF", "7 c #E4FFFF", "8 c #E6FFFF", "9 c #E7FFFF", "0 c #E8FFFF", "q c #E9FFFF", "w c #EAFFFF", "e c #ECFFFF", "r c #EDFFFF", "t c #EEFFFF", "y c #EFFFFF", "u c azure", "i c #F1FFFF", "p c #F2FFFF", "a c #F3FFFF", "s c #F4FFFF", "d c #F6FFFF", "f c #F7FFFF", "g c #F9FFFF", "h c #FAFFFF", "j c #FBFFFF", "k c #FCFFFF", "l c #FDFFFF", "z c #FEFFFF", "x c gray100", "c c None", /* pixels */ "cccccccccccccccccccccc", "cccccccccccccccccccccc", " ", " 22222222222222222222 ", " 2222222222ox22222222 ", " 1:111::1=,ox:11::::1 ", " $$$$$$$OOOOOOOO$$$$$ ", " xxxxxxxxxxxxxxxjjsie ", " xxxxxxxxxxxxxjjjsiie ", " x xxxxx siew ", " xxxxxxxxxxxxxjjssiew ", " xxxxxxxxxxxxjjssiew8 ", " .................... ", " .xxxx........xxxx... ", " .................... ", " xxxxxxxxxxxxssieww85 ", " xxxxxxxxxxjssiiew855 ", " x xxjjjs 5* ", " xxxxxxxxxjjsiiew855* ", " ", "cccccccccccccccccccccc", "cccccccccccccccccccccc" }; wxformbuilder-3.1.59/output/plugins/common/icons/gauge.xpm0000644000175000017500000000270211143440026024212 0ustar rrmulderrrmulder/* XPM */ static char *gauge_xpm[] = { /* columns rows colors chars-per-pixel */ "22 22 53 1", " c #333366", ". c #009900", "X c #12A50C", "o c #13A50C", "O c #13A50D", "+ c #12A60C", "@ c #13A60D", "# c #2DB71E", "$ c #2DB71F", "% c #2EB71E", "& c #2EB71F", "* c #2EB81F", "= c #4CCC33", "- c #4DCC33", "; c #6CE147", ": c #6BE148", "> c #6CE048", ", c #6CE148", "< c magenta", "1 c #DEFFFF", "2 c #DFFFFF", "3 c LightCyan", "4 c #E1FFFF", "5 c #E2FFFF", "6 c #E3FFFF", "7 c #E4FFFF", "8 c #E5FFFF", "9 c #E6FFFF", "0 c #E7FFFF", "q c #E8FFFF", "w c #E9FFFF", "e c #EAFFFF", "r c #EBFFFF", "t c #ECFFFF", "y c #EDFFFF", "u c #EEFFFF", "i c azure", "p c #F1FFFF", "a c #F2FFFF", "s c #F3FFFF", "d c #F4FFFF", "f c #F5FFFF", "g c #F6FFFF", "h c #F7FFFF", "j c #F8FFFF", "k c #F9FFFF", "l c #FAFFFF", "z c #FBFFFF", "x c #FCFFFF", "c c #FDFFFF", "v c #FEFFFF", "b c gray100", "n c None", /* pixels */ "nnnnnnnnnnnnnnnnnnnnnn", "nnnnnnnnnnnnnnnnnnnnnn", "nnnnnnnnnnnnnnnnnnnnnn", "nnnnnnnnnnnnnnnnnnnnnn", "nnnnnnnnnnnnnnnnnnnnnn", "nnnnnnnnnnnnnnnnnnnnnn", "n n", " bbbbbbbbbbbbbbbbbkkb ", " b...b...b...k...kkgg ", " bXXXbXXXgXXXgXXXuugu ", " k%%*g%%%g#%*u&&%uuue ", " g---u---u=--e---e666 ", " u::;u:,:e::,6,;:6616 ", " ee6e6666666661611111 ", "n n", "nnnnnnnnnnnnnnnnnnnnnn", "nnnnnnnnnnnnnnnnnnnnnn", "nnnnnnnnnnnnnnnnnnnnnn", "nnnnnnnnnnnnnnnnnnnnnn", "nnnnnnnnnnnnnnnnnnnnnn", "nnnnnnnnnnnnnnnnnnnnnn", "nnnnnnnnnnnnnnnnnnnnnn" }; wxformbuilder-3.1.59/output/plugins/common/icons/menuitem.xpm0000644000175000017500000000266611143440026024756 0ustar rrmulderrrmulder/* XPM */ static char *menuitem_xpm[] = { /* columns rows colors chars-per-pixel */ "22 22 52 1", " c #333366", ". c #0066CC", "X c #6984C9", "o c #778ACD", "O c magenta", "+ c #8995D4", "@ c #9494CD", "# c #9695D0", "$ c #9797D5", "% c #939EDD", "& c #9D9FD5", "* c #9998DA", "= c #9B9AE0", "- c #9D9DE6", "; c #9E9FEC", ": c #9EA9E6", "> c #A2A9DF", ", c #A0A1F2", "< c #A2A2F7", "1 c #A3A3FC", "2 c #A5A5FF", "3 c #B3B5E5", "4 c #B4B5FA", "5 c #B6B8F0", "6 c #C0C0C0", "7 c #C4C4F3", "8 c #C8C8F7", "9 c #CBCBF8", "0 c #D1D1F7", "q c #D4D4FC", "w c #D8D8FF", "e c #DFDFFE", "r c #E2E2FE", "t c #E3E3FF", "y c #E4E4FF", "u c #E5E5FF", "i c #E6E6FF", "p c #E7E7FF", "a c #E9E9FE", "s c #E9E9FF", "d c #EAEAFF", "f c #EBEBFF", "g c #EDEDFF", "h c #EFEFFF", "j c #F0F0FF", "k c #F1F1FF", "l c #F3F3FF", "z c #F6F6FF", "x c #F7F7FF", "c c #FCFCFF", "v c gray100", "b c None", /* pixels */ "bbbbbbbbbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbbbbbbbbb", "bbb bbbbbbbbb 6bbbbbbb", "bbb vbvbvbvbv 6bbbbbbb", "bbb vvvvvvvvv 6bbbbbbb", "bbb vvvvvvvvv 6bbbbbbb", "bbb ......... 6bbbbbbb", "bbb .vvvvvv.. 6bbbbbbb", "bbb .......22 6bbbbbbb", "bbb vvvvvvv2q46bbbbbbb", "bbb vvvvvvv1v86bbbbbbb", "bbb vbvbvbvoXbbbb", "bbbbbbbbbbb*e@03bbbbbb", "bbbbbbbbbbb$@b&w&bbbbb", "bbbbbbbbbbb#bb&97&bbbb", "bbbbbbbbbbbbbbb&&&bbbb", "bbbbbbbbbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbbbbbbbbb" }; wxformbuilder-3.1.59/output/plugins/common/icons/checkbox.xpm0000644000175000017500000000201311143440026024703 0ustar rrmulderrrmulder/* XPM */ static char *checkbox_xpm[] = { /* columns rows colors chars-per-pixel */ "22 22 24 1", " c #333366", ". c #009900", "X c magenta", "o c #D5D5D5", "O c gray84", "+ c #D8D8D8", "@ c #DADADA", "# c gainsboro", "$ c #DFDFDF", "% c #E1E1E1", "& c gray89", "* c #E6E6E5", "= c #E6E6E6", "- c gray91", "; c gray92", ": c #EEEEEE", "> c gray94", ", c gray95", "< c gray96", "1 c gray97", "2 c #F9F9F9", "3 c #FBFBFB", "4 c gray99", "5 c None", /* pixels */ "5555555555555555555555", "5555555555555555555555", "5555555555555555555555", "5555555555555555555555", "5555555555555555555555", "5555 555555", "5555 OOO@@$%*-- 555555", "5555 OOO#$&&*.- 555555", "5555 OO#$&&*..: 555555", "5555 O$%%&*...> 555555", "5555 %.%&*...>, 555555", "5555 %..*...>,< 555555", "5555 %.....>,<1 555555", "5555 &=...>,<12 555555", "5555 *-;.>><124 555555", "5555 -;:>,<1244 555555", "5555 555555", "5555555555555555555555", "5555555555555555555555", "5555555555555555555555", "5555555555555555555555", "5555555555555555555555" }; wxformbuilder-3.1.59/output/plugins/common/icons/radio_button.xpm0000644000175000017500000000306511143440026025616 0ustar rrmulderrrmulder/* XPM */ static const unsigned char * radio_button_xpm[] = { "22 22 63 1", " c None", "! c black", "# c #696989", "$ c #472E75", "% c #343466", "& c #9797A8", "' c #BABAC0", "( c #BDBDC2", ") c #9C9CAC", "* c #6C6D8D", "+ c #7E7E97", ", c #C8C8C8", "- c #CCCDCD", ". c #CFCFD0", "0 c #D3D3D3", "1 c #D7D7D7", "2 c #8787A1", "3 c #89BF87", "4 c #57B751", "5 c #66C25B", "6 c #A5D39B", "7 c #DBDBDA", "8 c #DFDFDF", "9 c #727393", ": c #9898A8", "; c #009900", "< c #11A40B", "= c #2AB51C", "> c #47C82F", "? c #B3DFA7", "@ c #E4E4E4", "A c #ADADBE", "B c #1AAB12", "C c #30B921", "D c #4BCB32", "E c #91E07A", "F c #E9E9E9", "G c #DCDCE0", "H c #BFBFC5", "I c #66C25C", "J c #41C52B", "K c #59D43B", "L c #99E680", "M c #EEEEEE", "N c #DFDFE4", "O c #A6D59D", "P c #6BE047", "Q c #C7EFB7", "R c #F2F2F3", "S c #B6B7C7", "T c #DEDEDD", "U c #B5E0A9", "V c #F3F3F2", "W c #F7F7F6", "X c #7A7A9B", "Y c #8989A3", "Z c #ECEBEC", "[ c #F3F4F3", "] c #F7F7F7", "^ c #9797B0", "_ c #747495", "` c #AFAFC0", "a c #7B7B9C", " ", " ", " ", " ", " ", " #$$# ", " %#&'()*% ", " %+,,-.012% ", " #,,3456789 ", " #:-3;<=>?@A# ", " $(-4DKPQRS# ", " *7TUELQVWX ", " %Y@FZR[]^% ", " %_`GNSa% ", " #$$# ", " ", " ", " ", " ", " "};wxformbuilder-3.1.59/output/plugins/common/icons/button.xpm0000644000175000017500000000172211143440026024436 0ustar rrmulderrrmulder/* XPM */ static char *button_xpm[] = { /* columns rows colors chars-per-pixel */ "22 22 20 1", " c black", ". c #003399", "X c magenta", "o c #CFD9EC", "O c #C7EAFF", "+ c #CBEBFF", "@ c #D0EDFF", "# c #D2EEFF", "$ c #D9F0FF", "% c #E0F3FF", "& c #E3F4FF", "* c #E8F6FF", "= c #ECF7FF", "- c #F0F9FF", "; c #F4FAFF", ": c #F4FBFF", "> c #F6FCFF", ", c #FAFDFF", "< c #FBFDFF", "1 c None", /* pixels */ "1111111111111111111111", "1111111111111111111111", "1111111111111111111111", "1111111111111111111111", "1111111111111111111111", "1111111111111111111111", "o....................o", ".,,,,,,,,,,,,,,,,,,,,.", ".:::::: :: :::::::::.", ".===== == = == =====-.", ".&&&&& && & & &&&&&&*.", ".$$$$$ $$ $ $$$$$$$&.", ".@@@@@ @@ @ @ @@+@@@$.", ".OOOOOO OO OO OO++O@.", ".++++++++++++++++++++.", "o....................o", "1111111111111111111111", "1111111111111111111111", "1111111111111111111111", "1111111111111111111111", "1111111111111111111111", "1111111111111111111111" }; wxformbuilder-3.1.59/output/plugins/common/icons/static_line.xpm0000644000175000017500000000135011143440026025416 0ustar rrmulderrrmulder/* XPM */ static char *static_line_xpm[] = { /* columns rows colors chars-per-pixel */ "22 22 4 1", " c magenta", ". c #ACA899", "X c gray100", "o c None", /* pixels */ "oooooooooooooooooooooo", "oooooooooooooooooooooo", "oooooooooooooooooooooo", "oooooooooooooooooooooo", "oooooooooooooooooooooo", "oooooooooooooooooooooo", "oooooooooooooooooooooo", "oooooooooooooooooooooo", "oooooooooooooooooooooo", "o...................oo", "ooXXXXXXXXXXXXXXXXXXXo", "oooooooooooooooooooooo", "oooooooooooooooooooooo", "oooooooooooooooooooooo", "oooooooooooooooooooooo", "oooooooooooooooooooooo", "oooooooooooooooooooooo", "oooooooooooooooooooooo", "oooooooooooooooooooooo", "oooooooooooooooooooooo", "oooooooooooooooooooooo", "oooooooooooooooooooooo" }; wxformbuilder-3.1.59/output/plugins/common/icons/menubar.xpm0000644000175000017500000000266511143440026024563 0ustar rrmulderrrmulder/* XPM */ static char *menubar_xpm[] = { /* columns rows colors chars-per-pixel */ "22 22 52 1", " c #333366", ". c #0066CC", "X c #6984C9", "o c #778ACD", "O c magenta", "+ c #8995D4", "@ c #9494CD", "# c #9695D0", "$ c #9797D5", "% c #939EDD", "& c #9D9FD5", "* c #9998DA", "= c #9B9AE0", "- c #9D9DE6", "; c #9E9FEC", ": c #9EA9E6", "> c #A2A9DF", ", c #A0A1F2", "< c #A2A2F7", "1 c #A3A3FC", "2 c #A5A5FF", "3 c #B3B5E5", "4 c #B4B5FA", "5 c #B6B8F0", "6 c #C0C0C0", "7 c #C4C4F3", "8 c #C8C8F7", "9 c #CBCBF8", "0 c #D4C7FC", "q c #D1D1F7", "w c #D8D8FF", "e c #DFDFFE", "r c #E2E2FE", "t c #E3E3FF", "y c #E4E4FF", "u c #E5E5FF", "i c #E6E6FF", "p c #E7E7FF", "a c #E9E9FE", "s c #E9E9FF", "d c #EAEAFF", "f c #EBEBFF", "g c #EDEDFF", "h c #EFEFFF", "j c #F0F0FF", "k c #F1F1FF", "l c #F3F3FF", "z c #F6F6FF", "x c #F7F7FF", "c c #FCFCFF", "v c gray100", "b c None", /* pixels */ "bbbbbbbbbbbbbbbbbbbbbb", " b", " .......vvvvvvvvvvvvvb", " .vvvvv.v....vv.....vb", " .......vvvvvvvvvvvvvb", " b", "b vvvvvvvv bbbbbbbbbbb", "b v......v 6bbbbbbbbbb", "b vvvvvvvv 6b22bbbbbbb", "b v....vvv 6b204bbbbbb", "b vvvvvvvv 6b2v8bbbbbb", "b v......v 6boXbb", "b vvvvvvvv 6b*e@q3bbbb", "b v......v 6b$@b&w&bbb", "b vvvvvvvv 6b#bb&97&bb", "b 6bbbbb&&&bb", "bb6666666666bbbbbbbbbb", "bbbbbbbbbbbbbbbbbbbbbb" }; wxformbuilder-3.1.59/output/plugins/common/icons/menu.xpm0000644000175000017500000000347011143440026024071 0ustar rrmulderrrmulder/* XPM */ static char *menu_xpm[] = { /* columns rows colors chars-per-pixel */ "22 22 78 1", " c #333366", ". c #0066CC", "X c #6984C9", "o c #778ACD", "O c magenta", "+ c #8995D4", "@ c #9494CD", "# c #9695D0", "$ c #9797D5", "% c #939EDD", "& c #9D9FD5", "* c #9998DA", "= c #9B9AE0", "- c #9D9DE6", "; c #9E9FEC", ": c #9EA9E6", "> c #A2A9DF", ", c #A0A1F2", "< c #A2A2F7", "1 c #A3A3FC", "2 c #A5A5FF", "3 c #B3B5E5", "4 c #B4B5FA", "5 c #B6B8F0", "6 c #C0C0C0", "7 c #C4C4F3", "8 c #C8C8F7", "9 c #CBCBF8", "0 c #D1D1F7", "q c #D3D4FC", "w c #D8D8FF", "e c #DFDFFE", "r c #DFFFFF", "t c #E2E2FE", "y c #E3E3FF", "u c #E4E4FF", "i c #E5E5FF", "p c #E6E6FF", "a c #E7E7FF", "s c #E9E9FE", "d c #E9E9FF", "f c #EAEAFF", "g c #EBEBFF", "h c #EDEDFF", "j c #EFEFFF", "k c LightCyan", "l c #E1FFFF", "z c #E3FFFF", "x c #E4FFFF", "c c #E5FFFF", "v c #E6FFFF", "b c #E7FFFF", "n c #E8FFFF", "m c #E9FFFF", "M c #EAFFFF", "N c #EBFFFF", "B c #ECFFFF", "V c #EDFFFF", "C c #EEFFFF", "Z c #F0F0FF", "A c #F1F1FF", "S c #F3F3FF", "D c #F6F6FF", "F c #F7F7FF", "G c azure", "H c #F1FFFF", "J c #F2FFFF", "K c #F3FFFF", "L c #F4FFFF", "P c #F9FFFF", "I c #FAFFFF", "U c #FBFFFF", "Y c #FCFCFF", "T c #FCFFFF", "R c #FDFFFF", "E c #FEFFFF", "W c gray100", "Q c None", /* pixels */ "QQQQQQQQQQQQQQQQQQQQQQ", "QQQQQQQQQQQQQQQQQQQQQQ", "QQQQ QQQQQQQ", "QQQQ WWWWWWUWW QQQQQQQ", "QQQQ W UU 6QQQQQQ", "QQQQ WWWUUUULU 6QQQQQQ", "QQQQ ......... 6QQQQQQ", "QQQQ .WWWWW... 6QQQQQQ", "QQQQ .......22 6QQQQQQ", "QQQQ LLLHHHH2q46QQQQQQ", "QQQQ 1W86QQQQQQ", "QQQQ BBBBBBMoXQQQ", "QQQQ zzrrrrr*e@03QQQQQ", "QQQQ $@ &w&QQQQ", "QQQQQ6666666#66&97&QQQ", "QQQQQQQQQQQQQQQQ&&&QQQ", "QQQQQQQQQQQQQQQQQQQQQQ", "QQQQQQQQQQQQQQQQQQQQQQ" }; wxformbuilder-3.1.59/output/plugins/common/icons/list_box.xpm0000644000175000017500000000332011143440026024742 0ustar rrmulderrrmulder/* XPM */ static char *list_box_xpm[] = { /* columns rows colors chars-per-pixel */ "22 22 71 1", " c #333366", ". c #0066CC", "X c #7ABAE9", "o c magenta", "O c #808080", "+ c #85C1EB", "@ c #86C3EB", "# c #8DC7EC", "$ c #8FC8ED", "% c #91CAEE", "& c #93CBEE", "* c #97CFEF", "= c #99CFF0", "- c #9AD0EF", "; c #9FD3F0", ": c #A1D5F1", "> c #A3D7F1", ", c #A3D6F2", "< c #A5D8F2", "1 c #A6D9F2", "2 c #AADBF3", "3 c #AEDEF4", "4 c #AFDFF5", "5 c #B0DFF5", "6 c #B2E1F5", "7 c #B3E1F5", "8 c #B5E3F6", "9 c #B8E5F6", "0 c #BAE6F7", "q c #BDE9F7", "w c #BEE8F7", "e c #BDE8F8", "r c #CCCBCB", "t c #CCCBCC", "y c #D0D0D0", "u c gray84", "i c #D7D7D6", "p c #DCDCDD", "a c #DDDCDD", "s c #C2ECF8", "d c #C3ECF9", "f c #C4EEF9", "g c #C7EFF9", "h c #C8EFFA", "j c #CBF1FB", "k c #CCF3FB", "l c #CDF4FB", "z c #D0F6FC", "x c #D2F7FD", "c c #D3F7FD", "v c #D4F8FC", "b c #D8FAFD", "n c #D9FCFE", "m c #DEFFFF", "M c #E3E4E3", "N c #EAEBEB", "B c #EBEAEB", "V c #E3FFFF", "C c #E4FFFF", "Z c #E7FFFF", "A c #E8FFFF", "S c #ECFFFF", "D c #EDFFFF", "F c azure", "G c #F1FFFF", "H c #F5FFFF", "J c #F6FFFF", "K c #F9FFFF", "L c #FAFFFF", "P c gray100", "I c None", /* pixels */ "IIIIIIIIIIIIIIIIIIIIII", "IIIIIIIIIIIIIIIIIIIIII", "IIIIIIIIIIIIIIIIIIIIII", " ", " PPPPPPPPPPPPP mvxje7 ", " PPPPPPPPPPPPP nxOO82 ", " P P vOOOO> ", " PPPPPPPPPPPPP ld03>* ", " PPPPPPPPPPPPP ge7<-# ", " ............. ", " .PPPPPPPPPPP. tyipMB ", " ............. ryipMB ", " KKKKKKKPKKKKK ", " HHHHHHHHHHHHH cjd93> ", " D D kd04<* ", " DDDSSSSSSDDDS gOOOO$ ", " SSVSSVSSVSVSV q7OO&@ ", " VVVVVVVVVVVVV 82;&@X ", " ", "IIIIIIIIIIIIIIIIIIIIII", "IIIIIIIIIIIIIIIIIIIIII", "IIIIIIIIIIIIIIIIIIIIII" }; wxformbuilder-3.1.59/output/plugins/common/icons/statusbar.xpm0000644000175000017500000000165211143440026025135 0ustar rrmulderrrmulder/* XPM */ static char *statusbar_xpm[] = { /* columns rows colors chars-per-pixel */ "22 22 17 1", " c #716F64", ". c magenta", "X c #ACA899", "o c #BBB9AC", "O c #BBB9AD", "+ c #BBBAAD", "@ c #BCB9AD", "# c #CDCBBD", "$ c #CECBBD", "% c #CECCBD", "& c #DFDCCD", "* c #DFDDCD", "= c #E0DCCD", "- c #E0DDCD", "; c #E0DDCE", ": c #ECE9D8", "> c None", /* pixels */ ">>>>>>>>>>>>>>>>>>>>>>", ">>>>>>>>>>>>>>>>>>>>>>", ">>>>>>>>>>>>>>>>>>>>>>", ">>>>>>>>>>>>>>>>>>>>>>", ">>>>>>>>>>>>>>>>>>>>>>", ">>>>>>>>>>>>>>>>>>>>>>", ">>>>>>>>>>>>>>>>>>>>>>", "OO@OO@O@OO@OOOO@O@OOO ", "$%$%$%%%%%%$$%$$$$$$$ ", "&*&&&&&&&&***&&****** ", "::::::::::::::::::::: ", "::::::::::::::::::X:: ", "::::::::::::::::::::: ", "::::::::::::::::X:X:: ", "::::::::::::::::::::: ", "::::::::::::::X:X:X:: ", "::::::::::::::::::::: ", " ", ">>>>>>>>>>>>>>>>>>>>>>", ">>>>>>>>>>>>>>>>>>>>>>", ">>>>>>>>>>>>>>>>>>>>>>", ">>>>>>>>>>>>>>>>>>>>>>" }; wxformbuilder-3.1.59/output/plugins/common/icons/frame.xpm0000644000175000017500000000316711143440026024222 0ustar rrmulderrrmulder/* XPM */ static const unsigned char * frame_xpm[] = { "22 22 68 1", " c None", "! c black", "# c #A7C4E8", "$ c #5E81B7", "% c #92B9E8", "& c #CEDCF1", "' c #A0C1EA", "( c #C5C8CD", ") c #FF6444", "* c #6E90C0", "+ c #668BC0", ", c #7BA7DC", "- c #7AA4DB", ". c #79A3DA", "0 c #79A2D8", "1 c #78A1D7", "2 c #769FD5", "3 c #749ED3", "4 c #739CD1", "5 c #729ACF", "6 c #7097CD", "7 c #6E95CB", "8 c #6C94C9", "9 c #6B91C7", ": c #698FC4", "; c #678DC3", "< c #D4D4D4", "= c #D3D3D3", "> c #6387BD", "? c white", "@ c #6085BA", "A c #FDFDFD", "B c #FCFCFC", "C c #FBFBFB", "D c #FAFAFA", "E c #F8F8F8", "F c #F7F7F7", "G c #F5F5F5", "H c #F4F4F4", "I c #F3F3F3", "J c #5C7EB5", "K c #F2F2F2", "L c #5A7CB2", "M c #587AB0", "N c #5678AD", "O c #5475AC", "P c #5373AA", "Q c #AFAFAF", "R c #CECECE", "S c #D6D6D6", "T c #D2D2D2", "U c #D0D0D0", "V c #CDCDCD", "W c #CBCBCB", "X c #CACACA", "Y c #C8C8C8", "Z c #C6C6C6", "[ c #C5C5C5", "] c #C3C3C3", "^ c #C2C2C2", "_ c #5172A9", "` c #5C7EB4", "a c #587BB1", "b c #5779AE", "c c #5676AD", "d c #5475AB", "e c #5373A9", "f c #5171A9", " ", " ", "#$$$$$$$$$$$$$$$$$$$$#", "$%&&'%%%%%%%%((%(%%)#*", "$%&&%%%%%%%%%((%(%%)%+", "$,,-.00123345667899:;+", "$<<<<<<<<<<<<<<<<====>", "$????????????????????@", "$?AAAAAAAAAABCCDEFFG?$", "$?AAAAAAAAAABCCDEFFG?$", "$?AAAAAAABBCDEEFGHHI?J", "$?AAAAABCDDEFGGHIKKK?L", "$?BBBCCDEFFGHIIKKKKK?M", "$?BBBCCDEFFGHIIKKKKK?M", "$?DDDEEFGHHIKKKKKKKK?N", "$?FFFGGHIKKKKKKKKKKK?O", "$????????????????????P", "$????????????????????P", "$QRRS< c #1871CE", ", c #207CD5", "< c #4825B6", "1 c #5123B9", "2 c #7B1ACA", "3 c #7E1ACB", "4 c #3389DA", "5 c #3A8FDD", "6 c #6295AA", "7 c #5190D5", "8 c #4797E0", "9 c #509CE3", "0 c #569EE1", "q c #57A3E5", "w c #60A9E7", "e c #65ABE8", "r c #6DB1EB", "t c #75B7ED", "y c #79BAEE", "u c #7DBCEF", "i c #990000", "p c #AF4200", "a c #FF3300", "s c #FF3906", "d c #FF410D", "f c #FF4A16", "g c #FF4B16", "h c #FF5520", "j c #FF5620", "k c #FF602B", "l c #FF612A", "z c #FF612B", "x c #FF6D36", "c c #FF6E36", "v c #FF7A42", "b c #FF7A43", "n c magenta", "m c #AB8A1F", "M c #A99227", "N c #838E5F", "B c #BFB870", "V c #CB9500", "C c #CB9A06", "Z c #D8A500", "A c #DEAB00", "S c #D8A809", "D c #D5A119", "F c #D8AC15", "G c #DEB317", "H c #C7A62F", "J c #D8B124", "K c #DEBE37", "L c #E8B500", "P c #E8BA0E", "I c #E3A737", "U c #FF874E", "Y c #FF874F", "T c #FF945A", "R c #FF945B", "E c #E9A441", "W c #F3A957", "Q c #FFA166", "! c #FFA167", "~ c #FFAD72", "^ c #FFAE72", "/ c #FFB97D", "( c #F6C300", ") c #F7C400", "_ c #F6C70C", "` c #F6C70D", "' c #FFCC00", "] c #FECD07", "[ c #FECE07", "{ c #FFCE07", "} c #FFD10F", "| c #FFD419", " . c #FFD519", ".. c #FFD41A", "X. c #FFD51A", "o. c #E8C939", "O. c #E8C83A", "+. c #F7D129", "@. c #F7D229", "#. c #FFD825", "$. c #FFD925", "%. c #FFDC32", "&. c #FFDD32", "*. c #FFE13F", "=. c #E8D151", "-. c #E8D152", ";. c #F7D940", ":. c #F7DA41", ">. c #FFE54C", ",. c #FFE54D", "<. c #FFE64D", "1. c #F6E25F", "2. c #FFEA5A", "3. c #FFEE67", "4. c #FFEF67", "5. c #FFEE68", "6. c #F6E870", "7. c #F6E871", "8. c #F7EC7B", "9. c #F7ED7C", "0. c #FFF274", "q. c #FFF374", "w. c #FEF57C", "e. c #FEF57D", "r. c #FFF77F", "t. c #94A584", "y. c #A8B38B", "u. c #81BFF1", "i. c #85C2F1", "p. c #89C4F3", "a. c #91CAF5", "s. c #97CFF6", "d. c #9DD3F9", "f. c #B1CBC1", "g. c #A4D7FA", "h. c #FFF680", "j. c #FFF780", "k. c #FFFA8A", "l. c None", /* pixels */ "l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.", "l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.", "l.l.i i i i i i i i l.l.l.l.l.l.l.l.l.l.l.l.", "l.i a s d g h z c v i l.l.l.l.l.l.l.l.l.l.l.", "l.i s d g h z c v Y i l.l.l.l.l.l.l.l.l.l.l.", "l.i d g j j c b Y T i l.l.Z Z Z l.l.l.l.l.l.", "l.i g h z c b Y T ! p Z L ) [ _ P S l.l.l.l.", "l.i h k c b Y R ! E A ) ' [ } .#.@.G l.l.l.", "l.i k c v Y T ! W Z ( ' [ } .#.%.*.:.F l.l.", "l.i c v Y T ! ^ I L ' [ } .#.%.*.>.2.o.l.l.", "l.i v Y T ! ^ / D ) [ } .#.%.>.>.2.3.3.Z l.", "l.l.i i i i i i V [ } .#.%.&.>.2.4.7.e.Z l.", "l.l.l.l.l.3 o ; M _ .#.&.&.<.2.4.q.e.6.Z l.", "l.l.l.l.l.. > , N P #.%.>.>.2.5.q.j.k.=.l.l.", "l.l.l.l.1 : 4 5 6 S @.*.<.2.5.q.j.k.8.J l.l.", "l.l.l.2 $ 8 9 q w t.G :.2.5.q.j.k.9.K l.l.l.", "l.l.l.X 0 e r t u i.y.F o.1.e.6.=.J l.l.l.l.", "l.l.< 7 y u.p.a.s.d.g.f.B H C m J l.l.l.l.l.", "l.l. + + # % & & & - - - - - O l.l.l.l.l.l.", "l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.", "l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.", "l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l." }; wxformbuilder-3.1.59/output/plugins/common/icons/slider.xpm0000644000175000017500000000155311143440026024407 0ustar rrmulderrrmulder/* XPM */ static char *slider_xpm[] = { /* columns rows colors chars-per-pixel */ "22 22 13 1", " c #716F64", ". c #66CC33", "X c magenta", "o c #BBB9AD", "O c #D4D1C2", "+ c #D4D1C3", "@ c #E2DFCF", "# c #E3DFCF", "$ c #E3DFD0", "% c #E2E0CF", "& c #E2E0D0", "* c #ECE9D8", "= c None", /* pixels */ "======================", "======================", "======================", "======================", "======================", "===== ==============", "==== ... =============", "==== *$+ =============", "==== *@+ =============", "=ooo *@+ oooooooooooo=", "o*** *@+ ************o", "=ooo *%+ oooooooooooo=", "==== *@+ =============", "==== *&+ =============", "==== ... =============", "===== ==============", "======================", "======================", "======================", "======================", "======================", "======================" }; wxformbuilder-3.1.59/output/plugins/common/icons/combo_box.xpm0000644000175000017500000000337711143440026025102 0ustar rrmulderrrmulder/* XPM */ static char *combo_box_xpm[] = { /* columns rows colors chars-per-pixel */ "22 22 74 1", " c black", ". c #333366", "X c magenta", "o c #808080", "O c #9BCDFF", "+ c #9ECFFF", "@ c #9ED0FF", "# c #A0D2FF", "$ c #A1D2FF", "% c #A2D3FF", "& c #A3D4FF", "* c #A4D4FF", "= c #A4D5FF", "- c #A5D5FF", "; c #A7D6FF", ": c #A7D7FF", "> c #A8D8FF", ", c #AAD8FF", "< c #AAD9FF", "1 c #ACDAFF", "2 c #AEDCFF", "3 c #AFDCFF", "4 c #B0DDFF", "5 c #B4E0FF", "6 c #B5E0FF", "7 c #B7E2FF", "8 c #B8E3FF", "9 c #BAE4FF", "0 c #BAE5FF", "q c #BBE6FF", "w c #BDE6FF", "e c #BDE7FF", "r c #BFE8FF", "t c #C0E8FF", "y c #C1E9FF", "u c #C2EAFF", "i c #C3ECFF", "p c #C5ECFF", "a c #C6EDFF", "s c #C9EFFF", "d c #CAF0FF", "f c #CEF3FF", "g c #DFFFFF", "h c LightCyan", "j c #E1FFFF", "k c #E2FFFF", "l c #E3FFFF", "z c #E4FFFF", "x c #E5FFFF", "c c #E7FFFF", "v c #E8FFFF", "b c #E9FFFF", "n c #EBFFFF", "m c #ECFFFF", "M c #EDFFFF", "N c #EEFFFF", "B c #EFFFFF", "V c azure", "C c #F1FFFF", "Z c #F2FFFF", "A c #F3FFFF", "S c #F4FFFF", "D c #F5FFFF", "F c #F6FFFF", "G c #F7FFFF", "H c #F8FFFF", "J c #F9FFFF", "K c #FAFFFF", "L c #FBFFFF", "P c #FCFFFF", "I c #FDFFFF", "U c #FEFFFF", "Y c gray100", "T c None", /* pixels */ "TTTTTTTTTTTTTTTTTTTTTT", "TTTTTTTTTTTTTTTTTTTTTT", "TTTTTTTTTTTTTTTTTTTTTT", "TTTTTTTTTTTTTTTTTTTTTT", "TTTTTTTTTTTTTTTTTTTTTT", "TTTTTTTTTTTTTTTTTTTTTT", "......................", ".YYYYYYYHHAACN.O+#==<.", ".YYYYYHYoHoCNN.+#=;14.", ".YY YHHAoCNNn.#=<144.", ".YYYH AAAoNnnn.=ooooe.", ".YH CCConnxx.<2oo9e.", ".Y AA CNNonxkk.255eei.", ".AH NNoxokkk.58euas.", ".HACNNNnxxkkkg.9euadf.", "......................", "TTTTTTTTTTTTTTTTTTTTTT", "TTTTTTTTTTTTTTTTTTTTTT", "TTTTTTTTTTTTTTTTTTTTTT", "TTTTTTTTTTTTTTTTTTTTTT", "TTTTTTTTTTTTTTTTTTTTTT", "TTTTTTTTTTTTTTTTTTTTTT" }; wxformbuilder-3.1.59/output/plugins/common/icons/frame16x16.png0000644000175000017500000000065211143440026024704 0ustar rrmulderrrmulderPNG  IHDRagAMA7tEXtSoftwareAdobe ImageReadyqe< wxformbuilder-3.1.59/output/plugins/common/xml/common.xml0000644000175000017500000006373411143440026024107 0ustar rrmulderrrmulder m_button MyButton 0 m_bpButton m_staticText MyLabel -1 m_textCtrl 0 m_bitmap m_comboBox Combo! m_choice 0 m_listBox m_listCtrl m_checkBox Check Me! 0 m_radioBox wxRadioBox "Radio Button" 0 1 m_radioBtn RadioBtn 0 m_staticline m_slider 50 0 100 m_gauge 100 wxformbuilder-3.1.59/output/plugins/common/xml/menutoolbar.cppcode0000644000175000017500000001624311143440026025754 0ustar rrmulderrrmulder wxformbuilder-3.1.59/output/plugins/common/xml/common.cppcode0000644000175000017500000005324211143440026024715 0ustar rrmulderrrmulder wxformbuilder-3.1.59/output/plugins/common/xml/menutoolbar.xml0000644000175000017500000002060111143440026025130 0ustar rrmulderrrmulder m_statusBar 1 m_menubar MyMenuBar m_menu MyMenu m_menu MyMenu m_menuItem MyMenuItem wxID_ANY 0 1 m_separator m_toolBar 1 5 m_tool tool wxID_ANY wxformbuilder-3.1.59/output/plugins/common/xml/forms.xml0000644000175000017500000002053611143440026023736 0ustar rrmulderrrmulder wxTAB_TRAVERSAL 500,300 1 wxTAB_TRAVERSAL 500,300 wxformbuilder-3.1.59/output/plugins/layout/icons/sizer16x16.xpm0000644000175000017500000000072011143440026025007 0ustar rrmulderrrmulder/* XPM */ static const unsigned char * sizer16x16_xpm[] = { "16 16 5 1", " c None", "! c black", "# c #00287C", "$ c #0046D9", "% c #6C9DFF", " ############ ", " #$%%%%%%%%%%$# ", " #% %# ", " #% %# ", " #$%%%%%%%%%%$# ", " ############## ", " #$%%%%%%%%%%$# ", " #% %# ", " #% %# ", " #$%%%%%%%%%%$# ", " ############## ", " #$%%%%%%%%%%$# ", " #% %# ", " #% %# ", " #$%%%%%%%%%%$# ", " ############ "};wxformbuilder-3.1.59/output/plugins/layout/icons/stddialogbuttonsizer.xpm0000644000175000017500000000170311143440026027432 0ustar rrmulderrrmulder/* XPM */ static const unsigned char * stddialogbuttonsizer_xpm[] = { "21 21 24 1", " c None", "! c black", "# c #0000FF", "$ c #4949FF", "% c #9B9BFF", "& c #002692", "' c #E2F2FE", "( c #FEFFFF", ") c #FCFFFF", "* c white", "+ c #5D5E5A", ", c #DCECF7", "- c #FAFDFE", ". c #EDFFFE", "0 c #D3F2FF", "1 c #E9F8FD", "2 c #E1F1FC", "3 c #DFF0FD", "4 c #F2FDFE", "5 c #D5EEFE", "6 c #CFE7F7", "7 c #D5F5FF", "8 c #DCFBFF", "9 c #D6EFFA", " ", " ", " ################### ", "#$%%%%%%%%%%%%%%%%%$#", "# %#", "# %#", "# &&&&&&&&&&&&&& %#", "# &''''''''''''''& %#", "# &()**++*+*+(()*& %#", "# &',-+..++0+1234& %#", "# &56.+..+++33333& %#", "# &7089++9+9+9999& %#", "# &66666666666666& %#", "# &&&&&&&&&&&&&& %#", "# %#", "# %#", "#$%%%%%%%%%%%%%%%%%$#", " ################### ", " ", " ", " "};wxformbuilder-3.1.59/output/plugins/layout/icons/grid_sizer.xpm0000644000175000017500000000120111143440026025301 0ustar rrmulderrrmulder/* XPM */ static char * grid_sizer_xpm[] = { "21 21 4 1", " c None", ". c #0000FF", "+ c #4949FF", "@ c #9B9BFF", " ", " ................. ", " .+@@@@@@+.+@@@@@@+. ", " .@ @.@ @. ", " .@ @.@ @. ", " .@ @.@ @. ", " .@ @.@ @. ", " .@ @.@ @. ", " .@ @.@ @. ", " .+@@@@@@+.+@@@@@@+. ", " ................... ", " .+@@@@@@+.+@@@@@@+. ", " .@ @.@ @. ", " .@ @.@ @. ", " .@ @.@ @. ", " .@ @.@ @. ", " .@ @.@ @. ", " .@ @.@ @. ", " .+@@@@@@+.+@@@@@@+. ", " ................. ", " "}; wxformbuilder-3.1.59/output/plugins/layout/icons/staticbox_sizer.xpm0000644000175000017500000000130011143440026026354 0ustar rrmulderrrmulder/* XPM */ static const unsigned char * staticbox_sizer_xpm[] = { "21 21 7 1", " c None", "! c black", "# c #003399", "$ c #B7B79B", "% c #0000FF", "& c #4949FF", "' c #9B9BFF", " ", " ##### ", " $$ ##### $$$$$$$ ", " $ $ ", " $ %%%%%%%%%%%%%% $", " $ %&''''''''''''&% $", " $ %' '% $", " $ %' '% $", " $ %' '% $", " $ %&''''''''''''&% $", " $ %%%%%%%%%%%%%%%% $", " $ %&''''''''''''&% $", " $ %' '% $", " $ %' '% $", " $ %' '% $", " $ %&''''''''''''&% $", " $ %%%%%%%%%%%%%% $", " $ $ ", " $$$$$$$$$$$$$$$$ ", " ", " "};wxformbuilder-3.1.59/output/plugins/layout/icons/grid_bag_sizer.xpm0000644000175000017500000000124111143440026026116 0ustar rrmulderrrmulder/* XPM */ static const unsigned char * grid_bag_sizer_xpm[] = { "21 21 5 1", " c None", "! c black", "# c #0000FF", "$ c #4949FF", "% c #9B9BFF", " ", " ################# ", " #$%%%%%%$#$%%%%%%$# ", " #% %#% %# ", " #% %#% %# ", " #% %#$%%%%%%$# ", " #% %########## ", " #% %#$%%%%%%$# ", " #% %#% %# ", " #$%%%%%%$#% %# ", " ##########% %# ", " #$%%%%%%$#% %# ", " #% %#% %# ", " #% %#$%%%%%%$# ", " #% %########## ", " #% %#$%%%%%%$# ", " #% %#% %# ", " #% %#% %# ", " #$%%%%%%$#$%%%%%%$# ", " ################# ", " "};wxformbuilder-3.1.59/output/plugins/layout/icons/flex_grid_sizer.xpm0000644000175000017500000000120611143440026026324 0ustar rrmulderrrmulder/* XPM */ static char * flex_grid_sizer_xpm[] = { "21 21 4 1", " c None", ". c #0000FF", "+ c #4949FF", "@ c #9B9BFF", " ", " ................. ", " .+@@@@@@+.+@@@@@@+. ", " .@ @.@ @. ", " .@ @.@ @. ", " .+@@@@@@+.+@@@@@@+. ", " ................... ", " .+@@@@@@+.+@@@@@@+. ", " .@ @.@ @. ", " .@ @.@ @. ", " .@ @.@ @. ", " .@ @.@ @. ", " .@ @.@ @. ", " .@ @.@ @. ", " .@ @.@ @. ", " .@ @.@ @. ", " .@ @.@ @. ", " .@ @.@ @. ", " .+@@@@@@+.+@@@@@@+. ", " ................. ", " "}; wxformbuilder-3.1.59/output/plugins/layout/icons/spacer.xpm0000644000175000017500000000115611143440026024426 0ustar rrmulderrrmulder/* XPM */ static char * spacer_xpm[] = { "21 21 3 1", " c None", ". c #000000", "+ c #929292", " ", " ", " ", " ", " ", " ", " . . ", " .+ .+ ", " .+ . . .+ ", " .+ .. .. .+ ", " .+.............. .+ ", " .+ ..++++++++..++.+ ", " .+ .+ .++ .+ ", " .+ + + .+ ", " .+ .+ ", " + + ", " ", " ", " ", " ", " "}; wxformbuilder-3.1.59/output/plugins/layout/icons/sizer.xpm0000644000175000017500000000117611143440026024307 0ustar rrmulderrrmulder/* XPM */ static char * sizer_2_xpm[] = { "21 21 4 1", " c None", ". c #0000FF", "+ c #4949FF", "@ c #9B9BFF", " ", " ................. ", " .+@@@@@@@@@@@@@@@+. ", " .@ @. ", " .@ @. ", " .@ @. ", " .+@@@@@@@@@@@@@@@+. ", " ................... ", " .+@@@@@@@@@@@@@@@+. ", " .@ @. ", " .@ @. ", " .@ @. ", " .+@@@@@@@@@@@@@@@+. ", " ................... ", " .+@@@@@@@@@@@@@@@+. ", " .@ @. ", " .@ @. ", " .@ @. ", " .+@@@@@@@@@@@@@@@+. ", " ................. ", " "}; wxformbuilder-3.1.59/output/plugins/layout/xml/layout.cppcode0000644000175000017500000002137611143440026024772 0ustar rrmulderrrmulder wxformbuilder-3.1.59/output/plugins/layout/xml/layout.xml0000644000175000017500000002615511143440026024155 0ustar rrmulderrrmulder 5 0 0 -1 1 1 label wxID_ANY 2 2 0 0 0 0 2 2 m_sdbSizer 1 0 0 0 0 1 0 0 0 0 wxformbuilder-3.1.59/output/plugins/containers/icons/scrollwin.xpm0000644000175000017500000000231011143440026026006 0ustar rrmulderrrmulder/* XPM */ static const unsigned char * scrollwin_xpm[] = { "21 21 42 1", " c None", "! c black", "# c #FBFBFB", "$ c #DDE2EC", "% c #708CBD", "& c #DEFFFF", "' c #D4F8FC", "( c #D2F7FD", ") c #CBF1FB", "* c #BDE8F8", "+ c #B3E1F5", ", c #D9FCFE", "- c #808080", ". c #B5E3F6", "0 c #AADBF3", "1 c #A3D7F1", "2 c #CDF4FB", "3 c #C3ECF9", "4 c #BAE6F7", "5 c #AEDEF4", "6 c #97CFEF", "7 c #C7EFF9", "8 c #A5D8F2", "9 c #9AD0EF", ": c #8DC7EC", "; c #CCCBCC", "< c #D0D0D0", "= c #D7D7D6", "> c #DCDCDD", "? c #E3E4E3", "@ c #EBEAEB", "A c #CCCBCB", "B c #D3F7FD", "C c #B8E5F6", "D c #CCF3FB", "E c #AFDFF5", "F c #8FC8ED", "G c #BDE9F7", "H c #93CBEE", "I c #86C3EB", "J c #9FD3F0", "K c #7ABAE9", " ", " ####################", " #$$$$$$$$$$$%%%%%%%%", " #$$$$$$$$$$$%&'()*+%", " #$$$$$$$$$$$%,(--.0%", " #$$$$$$$$$$$%'----1%", " #$$$$$$$$$$$%234516%", " #$$$$$$$$$$$%7*+89:%", " #$$$$$$$$$$$%%%%%%%%", " #$$$$$$$$$$$%;<=>?@%", " #$$$$$$$$$$$%A<=>?@%", " #$$$$$$$$$$$%;<=>?@%", " #$$$$$$$$$$$%;<=>?@%", " #$$$$$$$$$$$%A<=>?@%", " #$$$$$$$$$$$%%%%%%%%", " #$$$$$$$$$$$%B)3C51%", " #$$$$$$$$$$$%D34E86%", " #$$$$$$$$$$$%7----F%", " #$$$$$$$$$$$%G+--HI%", " #$$$$$$$$$$$%.0JHIK%", " %%%%%%%%%%%%%%%%%%%%"};wxformbuilder-3.1.59/output/plugins/containers/icons/splitter_window.xpm0000644000175000017500000000145011143440026027233 0ustar rrmulderrrmulder/* XPM */ static const unsigned char * splitter_window_xpm[] = { "21 21 14 1", " c None", "! c black", "# c white", "$ c #708CBD", "% c #FEFEFE", "& c #FBFBFB", "' c #FCFCFC", "( c #DDE2EC", ") c #DADADA", "* c #F2F2F2", "+ c #333366", ", c #D9D9D9", "- c #D8D8D8", ". c #F8F8F8", " ", " ##########$######%&'", " '((((((((($#((((((($", " %((((((((($%((((((($", " %((((((((($%((((((($", " %((((((((($%((((((($", " %((((((((($%((((((($", " %((((((((($%((((((($", " %((((((((($%((((((($", " %((((((((($%((((((($", " %((((((((($%((((((($", " %((((((((($#(((()(($", " %((((((((($*((((((($", " %(((((($$$$$((((((($", " %(((((($###$((((((($", " %(((((($'+#$(()(((($", " %(((((($###$((((((($", " %(((((($$$$$((((((($", " %,((((((((((((((((($", " #((((((((($#((((((-$", " #$$$$$$$$$$.$$$$$$$$"};wxformbuilder-3.1.59/output/plugins/containers/icons/choicebook.xpm0000644000175000017500000000206111143440026026102 0ustar rrmulderrrmulder/* XPM */ static const unsigned char * choicebook_xpm[] = { "21 21 32 1", " c None", "! c black", "# c #333366", "$ c white", "% c #F8FFFF", "& c #F1FFFF", "' c #EEFFFF", "( c #9ECFFF", ") c #9ED0FF", "* c #A5D5FF", "+ c #A7D7FF", ", c #ACDAFF", "- c #B0DDFF", ". c #F3FFFF", "0 c #EBFFFF", "1 c #AAD9FF", "2 c #B4E0FF", "3 c #808080", "4 c #BAE4FF", "5 c #E5FFFF", "6 c #AEDCFF", "7 c #BDE7FF", "8 c #E2FFFF", "9 c #C3ECFF", ": c #B8E3FF", "; c #C2EAFF", "< c #C6EDFF", "= c #C9EFFF", "> c #DDE2EC", "? c #848284", "@ c #EBEBEB", "A c #D2D2D2", " ", " ####################", " #$$$%$%%&&&'#()*+,-#", " #$$!!$.&&''0#)*1,-2#", " #$$$%!.&'000#*33334#", " #%%!!!&'0055#163347#", " #.!..!''0588#622779#", " #%%!!!055888#2:7;<=#", " ####################", " #>>>>>>>>>>>>>>>>>>#", " #>????????????????>#", " #>?$$$$$$$$$$$$$$?>#", " #>?$$$$$$$$$$$$$$?>#", " #>????????????????>#", " #>>>>>>>>@@@@@@@@?>#", " #>>>>>>>>@A!AA!A!?>#", " #>>>>>>>>@!A!A!!A?>#", " #>>>>>>>>@A!AA!A!?>#", " #>>>>>>>>?????????>#", " #>>>>>>>>>>>>>>>>>>#", " ####################"};wxformbuilder-3.1.59/output/plugins/containers/icons/listbook.xpm0000644000175000017500000000144111143440026025624 0ustar rrmulderrrmulder/* XPM */ static const unsigned char * listbook_xpm[] = { "21 21 14 1", " c None", "! c black", "# c #333366", "$ c white", "% c #DDE2EC", "& c #808080", "' c #0066CC", "( c #F9FFFF", ") c #F5FFFF", "* c #EBEBEB", "+ c #ECFFFF", ", c #EDFFFF", "- c #E3FFFF", ". c #848284", " ", " ####################", " #$$$$$$$#%%%%%%%%%%#", " #$$$$$$$#%&&&&&&&&&#", " #$$$$$$$#%&$$$$$$$$#", " #$#####$#%&$$$$$$$$#", " #$$$$$$$#%&&&&&&&&&#", " #$$$$$$$#%%%%%%%%%%#", " #$$$$$$$#%&&&&&&&&&#", " #'''''''#%&$$$$$$$$#", " #'$$$$$'#%&$$$$$$$$#", " #'''''''#%&&&&&&&&&#", " #(((((((#%%%%%%%%%%#", " #(((((((#%%%%%%%%%%#", " #)))))))#%%*******%#", " #)#####)#%*+!++!+!*#", " #+++++,,#%*!+!+!!+*#", " #+++++,,#%*+!++!+!*#", " #++++-++#%*********#", " #-------#%%.......%#", " ####################"};wxformbuilder-3.1.59/output/plugins/containers/icons/panel.xpm0000644000175000017500000000145711143440026025104 0ustar rrmulderrrmulder/* XPM */ static const unsigned char * panel_xpm[] = { "22 22 12 1", " c None", "! c #FBFBFB", "# c white", "$ c #F8F8F8", "% c black", "& c #F5F5F5", "' c #DDE2EC", "( c #708CBD", ") c #FDFDFD", "* c #FCFCFC", "+ c #F1F1F1", ", c #F3F3F3", "!!########$######### ", "&'''''''''''''''''''( ", ")'''''''''''''''''''( ", "#'''''''''''''''''''( ", "#'''''''''''''''''''( ", "*'''''''''''''''''''( ", "#'''''''''''''''''''( ", ")'''''''''''''''''''( ", "!'''''''''''''''''''( ", "#'''''''''''''''''''( ", "#'''''''''''''''''''( ", "!'''''''''''''''''''( ", "#'''''''''''''''''''( ", "$'''''''''''''''''''( ", "#'''''''''''''''''''( ", "+'''''''''''''''''''( ", "#'''''''''''''''''''( ", "#'''''''''''''''''''( ", ",'''''''''''''''''''( ", "#'''''''''''''''''''( ", " (((((((((((((((((((( ", " "};wxformbuilder-3.1.59/output/plugins/containers/icons/notebook.xpm0000644000175000017500000000126711143440026025624 0ustar rrmulderrrmulder/* XPM */ static const unsigned char * notebook_xpm[] = { "21 21 7 1", " c None", "! c black", "# c white", "$ c #708CBD", "% c #D8D8D8", "& c #989898", "' c #DDE2EC", " ", " ", " ", " ######$####$####$ ", " #%%%%%$&&&&$&&&&$ ", " #%%%%%$&&&&$&&&&$ ", " #%%%%%$&&&&$&&&&$ ", " #'''''############$ ", " #'''''''''''''''''$ ", " #'''''''''''''''''$ ", " #'''''''''''''''''$ ", " #'''''''''''''''''$ ", " #'''''''''''''''''$ ", " #'''''''''''''''''$ ", " #'''''''''''''''''$ ", " #'''''''''''''''''$ ", " #'''''''''''''''''$ ", " #$$$$$$$$$$$$$$$$$$ ", " ", " ", " "};wxformbuilder-3.1.59/output/plugins/containers/icons/auinotebook.xpm0000644000175000017500000000141011143440026026311 0ustar rrmulderrrmulder/* XPM */ static const unsigned char * auinotebook_xpm[] = { "21 21 12 1", " c None", "! c black", "# c #708CBD", "$ c #9F9F9F", "% c #B8B8B8", "& c #525252", "' c #C5C5C5", "( c #FFFBF0", ") c #393939", "* c #D2D2D2", "+ c #EBEBEB", ", c #DDE2EC", " ", " ####################", " #$$$$$$$$$$$$$$$$$$#", " #%%&&&&&&&&%%%%%%%%#", " #'&(((()()(&'''''''#", " #*&+++++)++&*******#", " #&&++++)+)+&&&&&&&&#", " #$$$$$$$$$$$$$$$$$$#", " #&&&&&&&&&&&&&&&&&&#", " #,,,,,,,,,,,,,,,,,,#", " #,,,,,,,,,,,,,,,,,,#", " #,,,,,,,,,,,,,,,,,,#", " #,,,,,,,,,,,,,,,,,,#", " #,,,,,,,,,,,,,,,,,,#", " #,,,,,,,,,,,,,,,,,,#", " #,,,,,,,,,,,,,,,,,,#", " #,,,,,,,,,,,,,,,,,,#", " #,,,,,,,,,,,,,,,,,,#", " #,,,,,,,,,,,,,,,,,,#", " #,,,,,,,,,,,,,,,,,,#", " ####################"};wxformbuilder-3.1.59/output/plugins/containers/xml/containers.xml0000644000175000017500000003151311143440026025627 0ustar rrmulderrrmulder wxTAB_TRAVERSAL m_panel m_splitter 0 -1 0.0 0 wxHSCROLL|wxVSCROLL m_scrolledWindow 5 5 m_notebook a page 0 m_auinotebook -1 a page 0 m_listbook a page 0 m_choicebook a page 0 wxformbuilder-3.1.59/output/plugins/containers/xml/containers.cppcode0000644000175000017500000003053411143440026026446 0ustar rrmulderrrmulder wxformbuilder-3.1.59/src/controls/src/wxScintilla/scintilla/License.txt0000644000175000017500000000154411143440026026602 0ustar rrmulderrrmulderLicense for Scintilla and SciTE Copyright 1998-2003 by Neil Hodgson All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. NEIL HODGSON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NEIL HODGSON BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. wxformbuilder-3.1.59/src/controls/src/wxScintilla/scintilla/version.txt0000644000175000017500000000000511143440026026674 0ustar rrmulderrrmulder174 wxformbuilder-3.1.59/src/controls/src/wxScintilla/scintilla/README.txt0000644000175000017500000000026111143440026026150 0ustar rrmulderrrmulderThis directory contains copies of the scintilla/src and scintilla/include directories from the Scintilla source distribution. The current version of the Scintilla code is 1.62 wxformbuilder-3.1.59/src/controls/include/wx/propgrid/manager.h0000644000175000017500000012317411143440026025103 0ustar rrmulderrrmulder///////////////////////////////////////////////////////////////////////////// // Name: manager.h // Purpose: wxPropertyGridManager // Author: Jaakko Salli // Modified by: // Created: Jan-14-2005 // RCS-ID: $Id: // Copyright: (c) Jaakko Salli // Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_PROPGRID_MANAGER_H_ #define _WX_PROPGRID_MANAGER_H_ #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma interface "manager.cpp" #endif #include // ----------------------------------------------------------------------- #ifndef SWIG extern WXDLLIMPEXP_PG const wxChar *wxPropertyGridManagerNameStr; #endif /** \class wxPropertyGridPage \ingroup classes \brief Holder of property grid page information. You can subclass this and give instance in wxPropertyGridManager::AddPage. It inherits from wxEvtHandler and can be used to process events specific to this page (id of events will still be same as manager's). If you don't want to use it to process all events of the page, you need to return false in the derived wxPropertyGridPage::IsHandlingAllEvents. Please note that wxPropertyGridPage lacks many non-const property manipulation functions found in wxPropertyGridManager. Please use parent manager (m_manager member variable) when needed.

Derived from

wxPropertyGridState\n wxPropertyContainerMethods\n wxEvtHandler\n wxObject\n

Include files

Event handling

wxPropertyGridPage receives events emitted by its wxPropertyGridManager, but only those events that are specific to that page. If wxPropertyGridPage::IsHandlingAllEvents returns false, then unhandled events are sent to the manager's parent, as usual. */ class WXDLLIMPEXP_PG wxPropertyGridPage : public wxEvtHandler, public wxPropertyContainerMethods, public wxPropertyGridState { friend class wxPropertyGridManager; #ifndef SWIG DECLARE_CLASS(wxPropertyGridPage) #endif public: wxPropertyGridPage(); virtual ~wxPropertyGridPage(); /** See wxPropertyGrid::AppendIn. */ inline wxPGId AppendIn( wxPGId id, wxPGProperty* property ) { return DoInsert((wxPGPropertyWithChildren*)(wxPGProperty*)id,-1,property); } /** See wxPropertyGrid::AppendIn. */ inline wxPGId AppendIn( wxPGPropNameStr name, wxPGProperty* property ) { return DoInsert((wxPGPropertyWithChildren*)(wxPGProperty*)BaseGetPropertyByName(name),-1,property); } /** Return pointer to contained property grid state. */ inline wxPropertyGridState* GetStatePtr() { return this; } /** See wxPropertyGrid::Insert. */ wxPGId Insert( wxPGId id, int index, wxPGProperty* property ); /** See wxPropertyGrid::Insert. */ wxPGId Insert( wxPGPropNameStr name, int index, wxPGProperty* property ); /** Do any member initialization in this method. \remarks - Called every time the page is added into a manager. - You can add properties to the page here. */ virtual void Init() {}; /** Return false here to indicate unhandled events should be propagated to manager's parent, as normal. */ virtual bool IsHandlingAllEvents() const { return true; } #ifndef SWIG protected: virtual void RefreshProperty( wxPGProperty* p ); //virtual bool ProcessEvent( wxEvent& event ); wxPropertyGridManager* m_manager; wxString m_label; int m_id; // toolbar index private: bool m_isDefault; // is this base page object? private: DECLARE_EVENT_TABLE() #endif }; // ----------------------------------------------------------------------- #define wxPG_IMPLEMENT_PGMAN_METHOD_NORET1_P1_BODY(NAME,AT1) \ { \ wxPGProperty* p = wxPGIdToPtr(id); \ wxASSERT_MSG(p,wxT("invalid property id")); \ if ( p ) \ { \ wxPropertyGridState* pState = p->GetParentState(); \ wxASSERT( pState != (wxPropertyGridState*) NULL ); \ if ( pState == m_pPropGrid->m_pState ) m_pPropGrid->NAME(id,_av1_); \ else pState->NAME(p,_av1_); \ } \ } // _P1 version doesn't have overloaded version that accepts name instead of id. #define wxPG_IMPLEMENT_PGMAN_METHOD_NORET1_P1(NAME,AT1) \ wxPG_IPAM_DECL void wxPropertyGridManager::NAME( wxPGId id, AT1 _av1_ ) \ wxPG_IMPLEMENT_PGMAN_METHOD_NORET1_P1_BODY(NAME,AT1) #define wxPG_IMPLEMENT_PGMAN_METHOD_NORET1_P1_INBODY(NAME,AT1) \ wxPG_IPAM_DECL void NAME( wxPGId id, AT1 _av1_ ) \ wxPG_IMPLEMENT_PGMAN_METHOD_NORET1_P1_BODY(NAME,AT1) // This is for mirroring wxPropertyGrid methods with ease. // Needs to be in here because of inlines. #define wxPG_IMPLEMENT_PGMAN_METHOD_NORET1(NAME,AT1) \ wxPG_IMPLEMENT_PGMAN_METHOD_NORET1_P1(NAME,AT1) \ wxPG_IPAM_DECL void wxPropertyGridManager::NAME( wxPGPropNameStr name, AT1 _av1_ ) \ { \ wxPGId id = GetPropertyByNameI(name); \ if ( !wxPGIdIsOk(id) ) return; \ NAME(id,_av1_); \ } #define wxPG_IMPLEMENT_PGMAN_METHOD_NORET1_INBODY(NAME,AT1) \ wxPG_IMPLEMENT_PGMAN_METHOD_NORET1_P1_INBODY(NAME,AT1) \ wxPG_IPAM_DECL void NAME( wxPGPropNameStr name, AT1 _av1_ ) \ { \ NAME(GetPropertyByNameI(name),_av1_); \ } //class wxPropertyGridPageData; #define wxPG_IPAM_DECL inline /** \class wxPropertyGridManager \ingroup classes \brief wxPropertyGridManager is an efficient multi-page version of wxPropertyGrid, which can optionally have toolbar for mode and page selection, help text box, and a compactor button. Use window flags to select which ones to include.

Derived from

wxPropertyContainerMethods\n wxWindow\n wxEvtHandler\n wxObject\n

Include files

Window styles

@link wndflags Additional Window Styles@endlink

Event handling

To process input from a propertygrid control, use these event handler macros to direct input to member functions that take a wxPropertyGridEvent argument.
EVT_PG_SELECTED (id, func)Property is selected.
EVT_PG_CHANGED (id, func)Property value is modified.
EVT_PG_HIGHLIGHTED (id, func)Mouse moves over property. Event's property is NULL if hovered on area that is not a property.
EVT_PG_PAGE_CHANGED (id, func)User changed page in manager.
EVT_PG_ITEM_COLLAPSED (id, func)User collapses a property or category.
EVT_PG_ITEM_EXPANDED (id, func)User expands a property or category.
EVT_BUTTON (id, func)Button in a property editor was clicked. Only occurs if the property doesn't handle button clicks itself.
EVT_TEXT (id, func)wxTextCtrl based editor was updated (but property value was not yet modified)
\sa @link wxPropertyGridEvent wxPropertyGridEvent@endlink */ // BM_MANAGER class WXDLLIMPEXP_PG wxPropertyGridManager : public wxPanel, public wxPropertyContainerMethods { #ifndef SWIG DECLARE_CLASS(wxPropertyGridManager) #endif friend class wxPropertyGridPage; public: #ifdef SWIG %pythonAppend wxPropertyGridManager { self._setOORInfo(self) self.DoDefaultTypeMappings() self.edited_objects = {} self.DoDefaultValueTypeMappings() if not hasattr(self.__class__,'_vt2setter'): self.__class__._vt2setter = {} } %pythonAppend wxPropertyGridManager() "" wxPropertyGridManager( wxWindow *parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxPGMAN_DEFAULT_STYLE, const wxChar* name = wxPyPropertyGridManagerNameStr ); %RenameCtor(PrePropertyGridManager, wxPropertyGridManager()); #else /** Two step constructor. Call Create when this constructor is called to build up the wxPropertyGridManager. */ wxPropertyGridManager(); /** The default constructor. The styles to be used are styles valid for the wxWindow. \sa @link wndflags Additional Window Styles@endlink */ wxPropertyGridManager( wxWindow *parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxPGMAN_DEFAULT_STYLE, const wxChar* name = wxPropertyGridManagerNameStr ); /** Destructor */ virtual ~wxPropertyGridManager(); #endif /** Creates new property page. Note that the first page is not created automatically. \param label A label for the page. This may be shown as a toolbar tooltip etc. \param bmp Bitmap image for toolbar. If wxNullBitmap is used, then a built-in default image is used. \param pageObj wxPropertyGridPage instance. Manager will take ownership of this object. NULL indicates that a default page instance should be created. \retval Returns index to the page created. \remarks If toolbar is used, it is highly recommended that the pages are added when the toolbar is not turned off using window style flag switching. */ inline int AddPage( const wxString& label = wxEmptyString, const wxBitmap& bmp = wxPG_NULL_BITMAP, wxPropertyGridPage* pageObj = (wxPropertyGridPage*) NULL ) { return InsertPage(-1,label,bmp,pageObj); } /** See wxPropertyGrid::Append. */ inline wxPGId AppendCategory( const wxString& label, const wxString& name = wxPG_LABEL ) { wxCHECK( m_targetState, wxNullProperty ); return m_targetState->Append( new wxPropertyCategoryClass(label,name) ); } /** See wxPropertyGrid::Append. */ inline wxPGId Append( wxPGProperty* property ) { wxCHECK( m_targetState, wxNullProperty ); wxCHECK_MSG( m_selPage >= 0, wxNullProperty, wxT("You need to add a page before adding properties") ); return m_targetState->Append(property); } inline wxPGId Append( const wxString& label, const wxString& name, const wxString& value = wxEmptyString ) { wxCHECK( m_targetState, wxNullProperty ); wxCHECK_MSG( m_selPage >= 0, wxNullProperty, wxT("You need to add a page before adding properties") ); return m_targetState->Append( wxStringProperty(label,name,value) ); } inline wxPGId Append( const wxString& label, const wxString& name, int value ) { wxCHECK( m_targetState, wxNullProperty ); wxCHECK_MSG( m_selPage >= 0, wxNullProperty, wxT("You need to add a page before adding properties") ); return m_targetState->Append( wxIntProperty(label,name,value) ); } inline wxPGId Append( const wxString& label, const wxString& name, double value ) { wxCHECK( m_targetState, wxNullProperty ); wxCHECK_MSG( m_selPage >= 0, wxNullProperty, wxT("You need to add a page before adding properties") ); return m_targetState->Append( wxFloatProperty(label,name,value) ); } inline wxPGId Append( const wxString& label, const wxString& name, bool value ) { wxCHECK( m_targetState, wxNullProperty ); wxCHECK_MSG( m_selPage >= 0, wxNullProperty, wxT("You need to add a page before adding properties") ); return m_targetState->Append( wxBoolProperty(label,name,value) ); } /** See wxPropertyGrid::AppendIn. */ inline wxPGId AppendIn( wxPGId id, wxPGProperty* property ) { wxCHECK( m_targetState, wxNullProperty ); wxCHECK_MSG( m_selPage >= 0, wxNullProperty, wxT("You need to add a page before adding properties") ); return m_targetState->DoInsert((wxPGPropertyWithChildren*)(wxPGProperty*)id,-1,property); } /** See wxPropertyGrid::AppendIn. */ inline wxPGId AppendIn( wxPGPropNameStr name, wxPGProperty* property ) { wxCHECK( m_targetState, wxNullProperty ); wxCHECK_MSG( m_selPage >= 0, wxNullProperty, wxT("You need to add a page before adding properties") ); return m_targetState->DoInsert((wxPGPropertyWithChildren*)(wxPGProperty*)m_targetState->BaseGetPropertyByName(name),-1,property); } /** Returns true if all property grid data changes have been committed. Usually only returns false if value in active editor has been invalidated by a wxValidator. */ inline bool CanClose() { return m_pPropGrid->CanClose(); } void ClearModifiedStatus ( wxPGId id ); inline void ClearModifiedStatus () { m_pPropGrid->ClearModifiedStatus(); } /** Clears the target page. */ /*inline void ClearTargetPage() { ClearPage(m_targetPage); }*/ /** Deletes all properties on given page. */ void ClearPage( int page ); bool ClearPropertyValue( wxPGId id ); bool ClearPropertyValue( wxPGPropNameStr name ); /** Collapses given item. Returns true if it was collapsable and previously expanded. */ bool Collapse( wxPGId id ); bool Collapse( wxPGPropNameStr name ); /** Collapses all items that can be collapsed. \retval Return false if failed (may fail if editor value cannot be validated). */ inline bool CollapseAll() { return m_targetState->ExpandAll(0); } /** Compacts (arg is true) or expands the propertygrid (i.e. low priority items are already hidden or shown). */ bool Compact( bool compact ); /** Two step creation. Whenever the control is created without any parameters, use Create to actually create it. Don't access the control's public methods before this is called. \sa @link wndflags Additional Window Styles@endlink */ bool Create( wxWindow *parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxPGMAN_DEFAULT_STYLE, const wxChar* name = wxPropertyGridManagerNameStr ); /** Disables a property. */ inline bool DisableProperty( wxPGId id ) { return EnableProperty (id,false); } /** Disables a property. */ inline bool DisableProperty( wxPGPropNameStr name ) { return EnableProperty (name,false); } /** Enables or disables (shows/hides) categories according to parameter enable. WARNING: Not tested properly, use at your own risk. */ inline bool EnableCategories( bool enable ) { long fl = m_windowStyle | wxPG_HIDE_CATEGORIES; if ( enable ) fl = m_windowStyle & ~(wxPG_HIDE_CATEGORIES); SetWindowStyleFlag(m_windowStyle); return true; } /** Enables or disables a property on target page. */ bool EnableProperty( wxPGId id, bool enable = true ); bool EnableProperty( wxPGPropNameStr name, bool enable = true ); /** Selects page, scrolls and/or expands items to ensure that the given item is visible. Returns true if something was actually done. */ bool EnsureVisible( wxPGId id ); /** Selects page, scrolls and/or expands items to ensure that the given item is visible. Returns true if something was actually done. */ inline bool EnsureVisible( wxPGPropNameStr name ) { return EnsureVisible(GetPropertyByNameI(name)); } /** Expands given item. Returns true if it was expandable and previously collapsed. */ bool Expand( wxPGId id ); bool Expand( wxPGPropNameStr name ); /** Expands all parents on target page. \retval Return false if failed (may fail if editor value cannot be validated). */ bool ExpandAll() { return m_targetState->ExpandAll(1); } /** Returns number of children of the root property of the selected page. */ inline size_t GetChildrenCount() { return GetChildrenCount( wxPGIdGen(m_pPropGrid->m_pState->m_properties) ); } /** Returns number of children of the root property of given page. */ size_t GetChildrenCount( int pageIndex ); /** Returns number of children for the property. NB: Cannot be in container methods class due to name hiding. */ inline size_t GetChildrenCount( wxPGId id ) const { wxPG_PROP_ID_CALL_PROLOG_RETVAL(0) return p->GetChildCount(); } /** Returns number of children for the property. */ inline size_t GetChildrenCount( wxPGPropNameStr name ) { wxPG_PROP_NAME_CALL_PROLOG_RETVAL(0) return p->GetChildCount(); } /** Returns height of the description text box. */ int GetDescBoxHeight() const; /** Returns id of first item (in target page), whether it is a category or a property. */ inline wxPGId GetFirst() const { return m_targetState->GetFirst(); } /** Returns id of first category (in target page). */ inline wxPGId GetFirstCategory() const { return m_targetState->GetFirstCategory (); } /** Returns id of first property that is not a category (from target page). */ inline wxPGId GetFirstProperty() const { return m_targetState->GetFirstProperty(); } /** Returns pointer to the contained wxPropertyGrid. This does not change after wxPropertyGridManager has been created, so you can safely obtain pointer once and use it for the entire lifetime of the instance. */ inline wxPropertyGrid* GetGrid() { wxASSERT(m_pPropGrid); return m_pPropGrid; }; /** Returns id of last child of given property. \remarks Returns even sub-properties. */ inline wxPGId GetLastChild( wxPGId id ) { wxPG_PROP_ID_CALL_PROLOG_RETVAL(wxNullProperty) wxPGPropertyWithChildren* pwc = (wxPGPropertyWithChildren*) p; if ( !pwc->GetParentingType() || !pwc->GetCount() ) return wxNullProperty; return wxPGIdGen(pwc->Last()); } inline wxPGId GetLastChild( wxPGPropNameStr name ) { wxPG_PROP_NAME_CALL_PROLOG_RETVAL(wxNullProperty) return GetLastChild( wxPGIdGen(p) ); } /** Returns id of next category after a given property (which does not have to be category). */ inline wxPGId GetNextCategory( wxPGId id ) const { wxCHECK( m_targetState, wxNullProperty ); return m_targetState->GetNextCategory(id); } /** Returns id of next property (from target page). This does not iterate to sub-properties or categories. */ inline wxPGId GetNextProperty( wxPGId id ) const { wxCHECK( m_targetState, wxNullProperty ); return m_targetState->GetNextProperty(id); } /** Returns page object for given page index. */ inline wxPropertyGridPage* GetPage( unsigned int ind ) const { return (wxPropertyGridPage*)m_arrPages.Item(ind); } /** Returns index for a page name. If no match is found, wxNOT_FOUND is returned. */ int GetPageByName( const wxChar* name ) const; /** Returns index for a relevant propertygrid state. If no match is found, wxNOT_FOUND is returned. */ int GetPageByState( wxPropertyGridState* pstate ) const; /** Returns number of managed pages. */ size_t GetPageCount() const; /** Returns name of given page. */ const wxString& GetPageName( int index ) const; /** Returns "root property" of the given page. It does not have name, etc. and it is not visible. It is only useful for accessing its children. */ wxPGId GetPageRoot( int index ) const; /** Returns id of previous property (in target page). */ inline wxPGId GetPrevProperty( wxPGId id ) const { return m_targetState->GetPrevProperty(id); } /** Returns id of previous item under the same parent. */ inline wxPGId GetPrevSibling( wxPGId id ) { return wxPropertyGridState::GetPrevSibling(id); } inline wxPGId GetPrevSibling( wxPGPropNameStr name ) { wxPG_PROP_NAME_CALL_PROLOG_RETVAL(wxNullProperty) return wxPropertyGridState::GetPrevSibling(wxPGIdGen(p)); } /** Returns id of property with given label (case-sensitive). If there is no property with such label, returned property id is invalid ( i.e. it will return false with IsOk method). If there are multiple properties with identical name, most recent added is returned. */ wxPGId GetPropertyByLabel( const wxString& name, wxPropertyGridState** ppState = (wxPropertyGridState**)NULL ) const; /** Returns id of property's nearest parent category. If no category found, returns invalid wxPGId. */ inline wxPGId GetPropertyCategory( wxPGId id ) const { return m_pPropGrid->GetPropertyCategory(id); } wxPGId GetPropertyCategory( wxPGPropNameStr name ) const { return m_pPropGrid->GetPropertyCategory(name); } /** Returns cell background colour of a property. */ inline wxColour GetPropertyColour( wxPGId id ) const { return m_pPropGrid->GetPropertyColour(id); } inline wxColour GetPropertyColour( wxPGPropNameStr name ) const { return m_pPropGrid->GetPropertyColour(name); } /** Returns cell text colour of a property. */ inline wxColour GetPropertyTextColour( wxPGId id ) const { return m_pPropGrid->GetPropertyTextColour(id); } inline wxColour GetPropertyTextColour( wxPGPropNameStr name ) const { return m_pPropGrid->GetPropertyTextColour(name); } /** Returns a wxVariant list containing wxVariant versions of all property values. Order is not guaranteed, but generally it should match the visible order in the grid. \param flags Use wxKEEP_STRUCTURE to retain category structure; each sub category will be its own wxVariantList of wxVariant. \remarks This works on the target page (*not* the selected page). */ #ifndef SWIG wxVariant GetPropertyValues( const wxString& listname = wxEmptyString, wxPGId baseparent = wxNullProperty, long flags = 0 ) const { return m_targetState->GetPropertyValues(listname,baseparent,flags); } #endif /** Returns "root property" of the target page. It does not have name, etc. and it is not visible. It is only useful for accessing its children. */ wxPGId GetRoot() const { return wxPGIdGen(m_targetState->m_properties); } /** Returns index to currently selected page. */ inline int GetSelectedPage() const { return m_selPage; } /** Shortcut for GetGrid()->GetSelection(). */ inline wxPGId GetSelectedProperty() const { return m_pPropGrid->GetSelection(); } /** Synonyme for GetSelectedPage. */ inline int GetSelection() const { return m_selPage; } /** Returns index of page that is target for insert operations etc. */ inline int GetTargetPage() const { return m_targetPage; } /** Returns a pointer to the toolbar currently associated with the wxPropertyGridManager (if any). */ inline wxToolBar* GetToolBar() const { return m_pToolbar; } inline void InitAllTypeHandlers() { wxPropertyGrid::InitAllTypeHandlers(); } /** See wxPropertyGrid::Insert. */ inline wxPGId Insert( wxPGId id, int index, wxPGProperty* property ) { wxCHECK( m_targetState, wxNullProperty ); wxPGId res_id = m_targetState->DoInsert((wxPGPropertyWithChildren*)wxPGIdToPtr(id),index,property); if ( m_targetState == m_pPropGrid->m_pState ) m_pPropGrid->DrawItems ( property, (wxPGProperty*) NULL ); return res_id; } /** See wxPropertyGrid::Insert. */ inline wxPGId Insert( wxPGPropNameStr name, int index, wxPGProperty* property ) { wxCHECK( m_targetState, wxNullProperty ); wxPG_PROP_NAME_CALL_PROLOG_RETVAL(wxNullProperty) wxPGId res_id = m_targetState->DoInsert((wxPGPropertyWithChildren*)p,index,property); if ( m_targetState == m_pPropGrid->m_pState ) m_pPropGrid->DrawItems( property, (wxPGProperty*) NULL ); return res_id; } /** Creates new property page. Note that the first page is not created automatically. \param index Add to this position. -1 will add as the last item. \param label A label for the page. This may be shown as a toolbar tooltip etc. \param bmp Bitmap image for toolbar. If wxNullBitmap is used, then a built-in default image is used. \param pageObj wxPropertyGridPage instance. Manager will take ownership of this object. If NULL, default page object is constructed. \retval Returns index to the page created. */ virtual int InsertPage( int index, const wxString& label, const wxBitmap& bmp = wxNullBitmap, wxPropertyGridPage* pageObj = (wxPropertyGridPage*) NULL ); /** Returns true if any property on any page has been modified by the user. */ bool IsAnyModified() const; /** Returns true if updating is frozen (ie. Freeze() called but not yet Thaw() ). */ inline bool IsFrozen() const { return (m_pPropGrid->m_frozen>0)?true:false; } /** Returns true if any property on given page has been modified by the user. */ bool IsPageModified( size_t index ) const; /** Returns true if property is a category. NB: SHOULD BE IN METHODS CLASS. */ /* inline bool IsPropertyCategory( wxPGId id ) const { wxPG_PROP_ID_CALL_PROLOG_RETVAL(false) return (p->GetParentingType()>0)?true:false; } inline bool IsPropertyCategory( wxPGPropNameStr name ) { wxPG_PROP_NAME_CALL_PROLOG_RETVAL(false) return (p->GetParentingType()>0)?true:false; } */ /** Disables item's textctrl if other way of editing is available. */ void LimitPropertyEditing( wxPGId id, bool limit = true ); void LimitPropertyEditing( wxPGPropNameStr name, bool limit = true ); virtual void Refresh( bool eraseBackground = true, const wxRect* rect = (const wxRect*) NULL ); /** Removes a page. \retval Returns false if it was not possible to remove page in question. */ virtual bool RemovePage( int page ); /** Select and displays a given page. Also makes it target page for insert operations etc. \param index Index of page being seleced. Can be -1 to select nothing. */ void SelectPage( int index ); /** Select and displays a given page. */ inline void SelectPage( const wxChar* name ) { SelectPage( GetPageByName(name) ); } /** Select a property. */ inline bool SelectProperty( wxPGId id, bool focus = false ) { return wxPGIdToPtr(id)->GetParentState()->DoSelectProperty(id,focus); } inline bool SelectProperty( wxPGPropNameStr name, bool focus = false ) { wxPG_PROP_NAME_CALL_PROLOG_RETVAL(false) return p->GetParentState()->DoSelectProperty(p,focus); } /** Sets label and text in description box. */ void SetDescription( const wxString& label, const wxString& content ); /** Sets text colour of a category caption (but not it's children). */ inline void SetCaptionTextColour( wxPGId id, const wxColour& col ) { m_pPropGrid->SetCaptionTextColour( id, col ); } inline void SetCaptionTextColour( wxPGPropNameStr name, const wxColour& col ) { m_pPropGrid->SetCaptionTextColour( name, col ); } /** Sets the current category - Append will add non-categories under this one. */ inline void SetCurrentCategory( wxPGId id ) { wxPropertyCategoryClass* pc = (wxPropertyCategoryClass*)wxPGIdToPtr(id); #ifdef __WXDEBUG__ if ( pc ) wxASSERT( pc->GetParentingType() > 0 ); #endif m_targetState->m_currentCategory = pc; } /** Sets the current category - Append will add non-categories under this one. */ inline void SetCurrentCategory( wxPGPropNameStr name ) { wxPG_PROP_NAME_CALL_PROLOG() SetCurrentCategory(wxPGIdGen(p)); } /** Sets y coordinate of the description box splitter. */ void SetDescBoxHeight( int ht, bool refresh = true ); /** All properties added/inserted will have given priority by default. \param priority can be wxPG_HIGH (default) or wxPG_LOW. */ inline void SetDefaultPriority( int priority ) { m_pPropGrid->SetDefaultPriority(priority); } /** Same as SetDefaultPriority(wxPG_HIGH). */ inline void ResetDefaultPriority() { m_pPropGrid->ResetDefaultPriority(); } /** Sets property attribute for all applicapple properties. Be sure to use this method after all properties have been added to the grid. */ void SetPropertyAttributeAll( int attrid, wxVariant value ); /** Sets label of a property. */ void SetPropertyLabel( wxPGId id, const wxString& newlabel ); void SetPropertyLabel( wxPGPropNameStr name, const wxString& newlabel ); /** Sets background colour of property and all its children. Colours of captions are not affected. Background brush cache is optimized for often set colours to be set last. NOTE: This function is deprecated. Use SetPropertyBackgroundColour. */ inline void SetPropertyColour( wxPGId id, const wxColour& col ) { m_pPropGrid->SetPropertyBackgroundColour( id, col ); } inline void SetPropertyColour( wxPGPropNameStr name, const wxColour& col ) { m_pPropGrid->SetPropertyBackgroundColour( name, col ); } /** Sets background colour of property and all its children. Colours of captions are not affected. Background brush cache is optimized for often set colours to be set last. */ inline void SetPropertyBackgroundColour( wxPGId id, const wxColour& col ) { m_pPropGrid->SetPropertyBackgroundColour( id, col ); } inline void SetPropertyBackgroundColour( wxPGPropNameStr name, const wxColour& col ) { m_pPropGrid->SetPropertyBackgroundColour( name, col ); } /** Sets text colour of property and all its children. */ inline void SetPropertyTextColour( wxPGId id, const wxColour& col ) { m_pPropGrid->SetPropertyTextColour( id, col ); } inline void SetPropertyTextColour( wxPGPropNameStr name, const wxColour& col ) { m_pPropGrid->SetPropertyTextColour( name, col ); } /** Sets background and text colour of property and all its children to the default. */ inline void SetPropertyColourToDefault( wxPGId id ) { m_pPropGrid->SetPropertyColourToDefault(id); } inline void SetPropertyColourToDefault ( wxPGPropNameStr name ) { m_pPropGrid->SetPropertyColourToDefault(name); } /** Sets property value. \remarks Actual name of this method is SetPropertyValue. It may be shown incorrectly due to limitations in Doxygen C preprocessor. */ void SetPropertyValueLong( wxPGId id, long value ); #ifndef __WXPYTHON__ void SetPropertyValue( wxPGId id, int value ); #endif void SetPropertyValueDouble( wxPGId id, double value ); void SetPropertyValueBool( wxPGId id, bool value ); void SetPropertyValueString( wxPGId id, const wxString& value ); void SetPropertyValueArrstr2( wxPGId id, const wxArrayString& value ); void SetPropertyValueWxObjectPtr( wxPGId id, wxObject* value ); #ifndef __WXPYTHON__ void SetPropertyValue( wxPGId id, void* value ); void SetPropertyValue( wxPGId id, wxVariant& value ); #endif void SetPropertyValueLong( wxPGPropNameStr name, long value ); #ifndef __WXPYTHON__ void SetPropertyValue( wxPGPropNameStr name, int value ); #endif void SetPropertyValueDouble( wxPGPropNameStr name, double value ); void SetPropertyValueBool( wxPGPropNameStr name, bool value ); void SetPropertyValueString( wxPGPropNameStr name, const wxString& value ); void SetPropertyValueWxObjectPtr( wxPGPropNameStr name, wxObject* value ); #ifndef __WXPYTHON__ void SetPropertyValue( wxPGPropNameStr name, void* value ); void SetPropertyValue( wxPGPropNameStr name, wxVariant& value ); void SetPropertyValueArrstr2( wxPGPropNameStr name, const wxArrayString& value ); wxPG_IMPLEMENT_PGMAN_METHOD_NORET1_INBODY(SetPropertyValueArrint2,const wxArrayInt&) #else wxPG_IMPLEMENT_PGMAN_METHOD_NORET1_P1_INBODY(SetPropertyValueArrint2,const wxArrayInt&) #endif #if wxUSE_DATETIME wxPG_IMPLEMENT_PGMAN_METHOD_NORET1_INBODY(SetPropertyValueDatetime,wxDateTime) #endif wxPG_IMPLEMENT_PGMAN_METHOD_NORET1_INBODY(SetPropertyValuePoint,const wxPoint&) wxPG_IMPLEMENT_PGMAN_METHOD_NORET1_INBODY(SetPropertyValueSize,const wxSize&) wxPG_IMPLEMENT_PGMAN_METHOD_NORET1_INBODY(SetPropertyValueLongLong,const wxLongLong&) wxPG_IMPLEMENT_PGMAN_METHOD_NORET1_INBODY(SetPropertyValueULongLong,const wxULongLong&) #ifdef __WXPYTHON__ wxPG_IMPLEMENT_PGMAN_METHOD_NORET1_INBODY(SetPropertyValuePyObject,PyObject*) #endif #ifndef __WXPYTHON__ inline void SetPropertyValue( wxPGId id, wxObject& value ) { SetPropertyValue(id,&value); } inline void SetPropertyValue( wxPGPropNameStr name, wxObject& value ) { SetPropertyValue(name,&value); } inline void SetPropertyValue( wxPGId id, const wxChar* value ) { SetPropertyValue(id,wxString(value)); } inline void SetPropertyValue( wxPGPropNameStr name, const wxChar* value ) { SetPropertyValue(name,wxString(value)); } /** Sets various property values from a list of wxVariants. If property with name is missing from the grid, new property is created under given default category (or root if omitted). Works on target page. */ void SetPropertyValues( const wxVariantList& list, wxPGId defaultCategory ) { m_targetState->SetPropertyValues(list,defaultCategory); } inline void SetPropertyValues( const wxVariant& list, wxPGId defaultCategory ) { SetPropertyValues(list.GetList(),defaultCategory); } inline void SetPropertyValues( const wxVariantList& list, const wxString& defaultCategory = wxEmptyString ) { SetPropertyValues(list,GetPropertyByName(defaultCategory)); } inline void SetPropertyValues( const wxVariant& list, const wxString& defaultCategory = wxEmptyString ) { SetPropertyValues(list.GetList(),GetPropertyByName(defaultCategory)); } #endif /** Sets property's value to unspecified. If it has children (it may be category), then the same thing is done to them. */ #ifdef wxPG_COMPATIBILITY_1_0_0 void SetPropertyValueUnspecified( wxPGId id ); void SetPropertyValueUnspecified( wxPGPropNameStr name ); #else void SetPropertyUnspecified( wxPGId id ); void SetPropertyUnspecified( wxPGPropNameStr name ); #endif /** Moves splitter as left as possible, while still allowing all labels to be shown in full. \param subProps If false, will still allow sub-properties (ie. properties which parent is not root or category) to be cropped. \param allPages If true, takes labels on all pages into account. */ void SetSplitterLeft( bool subProps = false, bool allPages = true ); inline void SetSplitterPosition( int newx, bool refresh = true ) { m_pPropGrid->SetSplitterPosition(newx,refresh); } /** Synonyme for SelectPage(name). */ inline void SetStringSelection( const wxChar* name ) { SelectPage( GetPageByName(name) ); } /** Sets page to which append, insert, etc. will add items. Every time a page is changed, target page is automatically switched to that. */ void SetTargetPage( int index ); /** Sets page to which append, insert, etc. will add items. Every time a page is changed, target page is automatically switched to that. */ inline void SetTargetPage( const wxChar* name ) { SetTargetPage( GetPageByName(name) ); } /** Sorts all items at all levels of the target page (except sub-properties). */ inline void Sort() { m_pPropGrid->Sort(wxPGIdGen(m_targetState->m_properties)); } /** Sorts children of a category. */ inline void Sort( wxPGId id ) { m_pPropGrid->Sort(id); } /** Sorts children of a category. */ inline void Sort( wxPGPropNameStr name ) { m_pPropGrid->Sort( GetPropertyByNameI(name) ); } /** Deselect current selection, if any (from current page). \retval false if editor could not be closed. */ inline bool ClearSelection() { return m_pPropGrid->ClearSelection(); } #ifdef SWIG %pythoncode { def GetValuesFromPage(self,page,dict_=None,as_strings=False): "Same as GetValues, but returns values from specific page only." "" "For argument descriptions, see GetValues." if dict_ is None: dict_ = {} elif hasattr(dict_,'__dict__'): dict_ = dict_.__dict__ if not as_strings: getter = self.GetPropertyValue else: getter = self.GetPropertyValueAsString root = self.GetPageRoot(page) self._GetValues(root,self.GetFirstChild(root),dict_,getter) return dict_ def GetValues(self,dict_=None,as_strings=False): "Returns values in the grid." "" "dict_: if not given, then a new one is created. dict_ can be" " object as well, in which case it's __dict__ is used." "as_strings: if True, then string representations of values" " are fetched instead of native types. Useful for config and such." "" "Return value: dictionary with values. It is always a dictionary," "so if dict_ was object with __dict__ attribute, then that attribute" "is returned." if dict_ is None: dict_ = {} elif hasattr(dict_,'__dict__'): dict_ = dict_.__dict__ if not as_strings: getter = self.GetPropertyValue else: getter = self.GetPropertyValueAsString for page in range(0,self.GetPageCount()): root = self.GetPageRoot(page) self._GetValues(root,self.GetFirstChild(root),dict_,getter) return dict_ GetPropertyValues = GetValues } #endif protected: // // Subclassing helpers // /** Creates property grid for the manager. Override to use subclassed wxPropertyGrid. */ virtual wxPropertyGrid* CreatePropertyGrid() const; public: #ifndef DOXYGEN // // Overridden functions - no documentation required. // virtual wxSize DoGetBestSize() const; void SetId( wxWindowID winid ); virtual void Freeze(); virtual void Thaw(); virtual void SetExtraStyle ( long exStyle ); virtual bool SetFont ( const wxFont& font ); virtual void SetWindowStyleFlag ( long style ); #ifndef SWIG // // Event handlers // void OnMouseMove( wxMouseEvent &event ); void OnMouseClick( wxMouseEvent &event ); void OnMouseUp( wxMouseEvent &event ); void OnMouseEntry( wxMouseEvent &event ); void OnPaint( wxPaintEvent &event ); void OnToolbarClick( wxCommandEvent &event ); void OnResize( wxSizeEvent& event ); void OnCompactorClick( wxCommandEvent& event ); void OnPropertyGridSelect( wxPropertyGridEvent& event ); protected: wxPropertyGrid* m_pPropGrid; wxArrayPtrVoid m_arrPages; #if wxUSE_TOOLBAR wxToolBar* m_pToolbar; #endif wxStaticText* m_pTxtHelpCaption; wxStaticText* m_pTxtHelpContent; wxButton* m_pButCompactor; wxPropertyGridState* m_targetState; wxPropertyGridPage* m_emptyPage; long m_iFlags; // Selected page index. int m_selPage; int m_width; int m_height; int m_extraHeight; int m_splitterY; int m_splitterHeight; int m_nextTbInd; int m_dragOffset; wxCursor m_cursorSizeNS; int m_nextDescBoxSize; int m_targetPage; unsigned char m_dragStatus; unsigned char m_onSplitter; virtual wxPGId DoGetPropertyByName( wxPGPropNameStr name ) const; /** Select and displays a given page. */ virtual bool DoSelectPage( int index ); virtual void RefreshProperty( wxPGProperty* p ); // Sets some members to defaults. void Init1(); // Initializes some members. void Init2( int style ); /*#ifdef __WXMSW__ virtual WXDWORD MSWGetStyle(long flags, WXDWORD *exstyle) const; #endif*/ /** Recalculates new positions for components, according to the given size. */ void RecalculatePositions( int width, int height ); /** (Re)creates/destroys controls, according to the window style bits. */ void RecreateControls(); void RefreshHelpBox( int new_splittery, int new_width, int new_height ); void RepaintSplitter( wxDC& dc, int new_splittery, int new_width, int new_height, bool desc_too ); void SetDescribedProperty( wxPGProperty* p ); virtual bool ProcessEvent( wxEvent& event ); private: DECLARE_EVENT_TABLE() #endif // #ifndef SWIG #endif // #ifndef DOXYGEN }; // ----------------------------------------------------------------------- #ifndef __wxPG_SOURCE_FILE__ #undef wxPG_IPAM_DECL #undef wxPG_IMPLEMENT_PGMAN_METHOD_NORET1 #endif // ----------------------------------------------------------------------- #endif // _WX_PROPGRID_MANAGER_H_ wxformbuilder-3.1.59/src/controls/include/wx/propgrid/odcombo.h0000644000175000017500000011343511143440026025112 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // Name: odcombo.h // Purpose: wxPGOwnerDrawnComboBox and related classes interface // Author: Jaakko Salli // Modified by: // Created: Jan-25-2005 // RCS-ID: $Id: // Copyright: (c) 2005 Jaakko Salli // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_PROPGRID_ODCOMBO_H_ #define _WX_PROPGRID_ODCOMBO_H_ #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma interface "odcombo.h" #endif #include "wx/renderer.h" // Item counts in GUI components were changed in 2.7.0 #if wxCHECK_VERSION(2,7,0) #define wxODCCount unsigned int #define wxODCIndex unsigned int #else #define wxODCCount int #define wxODCIndex int #endif // wxRect: Inside(<=2.7.0) or Contains(>2.7.0)? #if !wxCHECK_VERSION(2,7,1) #define wxPGRectContains Inside #else #define wxPGRectContains Contains #endif class WXDLLEXPORT wxTextCtrl; class WXDLLEXPORT wxButton; #ifdef WXMAKINGLIB_PROPGRID #define WXDLLEXPORT_PGODC #elif defined(WXMAKINGDLL_PROPGRID) #define WXDLLEXPORT_PGODC WXEXPORT #elif defined(WXUSINGDLL) #define WXDLLEXPORT_PGODC WXIMPORT #else // not making nor using DLL #define WXDLLEXPORT_PGODC #endif class WXDLLEXPORT_PGODC wxPGComboPopup; class WXDLLEXPORT_PGODC wxPGComboControlBase; class WXDLLEXPORT_PGODC wxPGOwnerDrawnComboBox; // ---------------------------------------------------------------------------- // New window styles for wxPGComboControlBase enum { // Double-clicking causes value to cycle (ie. call to popup's CycleValue method). wxPGCC_DCLICK_CYCLES = 0x0100, // Use keyboard behaviour alternate to platform default: // Up an down keys will show popup instead of cycling value. wxPGCC_ALT_KEYS = 0x0200, }; #define wxPGCC_PROCESS_ENTER 0 // ---------------------------------------------------------------------------- // wxPGComboControlBase: a base class for generic control that looks like // a wxComboBox but allows completely custom popup (in addition to other // customizations). // ---------------------------------------------------------------------------- // wxComboControl internal flags enum { // First those that can be passed to Customize. // It is Windows style for all flags to be clear. // Button is preferred outside the border (GTK style) wxPGCC_BUTTON_OUTSIDE_BORDER = 0x0001, // Show popup on mouse up instead of mouse down (which is the Windows style) wxPGCC_POPUP_ON_MOUSE_UP = 0x0002, // All text is not automatically selected on click wxPGCC_NO_TEXT_AUTO_SELECT = 0x0004, // Drop-button stays depressed while the popup is open wxPGCC_BUTTON_STAYS_DOWN = 0x0008, // Button covers the entire control wxPGCC_FULL_BUTTON = 0x0010, // Internal use: signals creation is complete wxPGCC_IFLAG_CREATED = 0x0100, // Internal use: really put button outside wxPGCC_IFLAG_BUTTON_OUTSIDE = 0x0200, // Internal use: SetTextIndent has been called wxPGCC_IFLAG_INDENT_SET = 0x0400, // Internal use: Set wxTAB_TRAVERSAL to parent when popup is dismissed wxPGCC_IFLAG_PARENT_TAB_TRAVERSAL = 0x0800, // Button has bitmap or has non-standard size wxPGCC_IFLAG_HAS_NONSTANDARD_BUTTON = 0x1000 }; // Flags used by PreprocessMouseEvent and HandleButtonMouseEvent enum { wxPGCC_MF_ON_BUTTON = 0x0001, // cursor is on dropbutton area }; // Namespace for wxComboControl feature flags struct wxPGComboControlFeatures { enum { MovableButton = 0x0001, // Button can be on either side of control BitmapButton = 0x0002, // Button may be replace with bitmap ButtonSpacing = 0x0004, // Non-bitmap button can have spacing from // the edge of the control TextIndent = 0x0008, // SetTextIndent can be used PaintControl = 0x0010, // Combo control itself can be custom painted PaintWritable = 0x0020, // A variable-width area in front of writable // combo control's textctrl can be custom // painted Borderless = 0x0040, // wxNO_BORDER window style works // There is no feature flags for... // PushButtonBitmapBackground - if its in renderer native, then it should be // not an issue to have it automatically under the bitmap. All = MovableButton|BitmapButton| ButtonSpacing|TextIndent| PaintControl|PaintWritable| Borderless, }; }; class wxPGComboPopupWindow; class WXDLLEXPORT_PGODC wxPGComboControlBase : public wxControl { friend class wxPGComboPopup; friend class wxPGComboPopupWindow; public: // ctors and such wxPGComboControlBase() : wxControl() { Init(); } bool Create(wxWindow *parent, wxWindowID id, const wxString& value, const wxPoint& pos, const wxSize& size, long style, const wxValidator& validator, const wxString& name); virtual ~wxPGComboControlBase(); virtual bool Destroy(); // show/hide popup window virtual void ShowPopup(); virtual void HidePopup(); // Override for totally custom combo action virtual void OnButtonClick(); // return true if the popup is currently shown inline bool IsPopupShown() const { return m_isPopupShown; } // set interface class instance derived from wxPGComboPopup void SetPopup( wxPGComboPopup* iface ); // get interface class instance derived from wxPGComboPopup wxPGComboPopup* GetPopup() const { return m_popupInterface; } // get the popup window containing the popup control wxWindow *GetPopupWindow() const { return m_winPopup; } // get the popup control/panel in window wxWindow *GetPopupControl() const { return m_popup; } // Get the text control which is part of the combobox. inline wxTextCtrl *GetTextCtrl() const { return m_text; } // get the dropdown button which is part of the combobox // note: its not necessarily a wxButton or wxBitmapButton inline wxWindow *GetButton() const { return m_btn; } // forward these methods to all subcontrols virtual bool Enable(bool enable = true); virtual bool Show(bool show = true); virtual bool SetFont(const wxFont& font); #if wxUSE_TOOLTIPS virtual void DoSetToolTip( wxToolTip *tip ); #endif // wxTextCtrl methods - for readonly combo they should return // without errors. virtual wxString GetValue() const; virtual void SetValue(const wxString& value); virtual void Copy(); virtual void Cut(); virtual void Paste(); virtual void SetInsertionPoint(long pos); virtual void SetInsertionPointEnd(); virtual long GetInsertionPoint() const; virtual long GetLastPosition() const; virtual void Replace(long from, long to, const wxString& value); virtual void Remove(long from, long to); virtual void SetSelection(long from, long to); virtual void Undo(); // Returns the text field rectangle, including any image that is painted with it. inline const wxRect& GetTextRect() const { return m_tcArea; } // // Popup customization methods // // Sets minimum width of the popup. If wider than combo control, it will extend to the left. // Remarks: // * Value -1 indicates the default. // * Custom popup may choose to ignore this (wxPGOwnerDrawnComboBox does not). inline void SetPopupMinWidth( int width ) { m_widthMinPopup = width; } // Sets preferred maximum height of the popup. // Remarks: // * Value -1 indicates the default. // * Custom popup may choose to ignore this (wxPGOwnerDrawnComboBox does not). inline void SetPopupMaxHeight( int height ) { m_heightPopup = height; } // Extends popup size horizontally, relative to the edges of the combo control. // Remarks: // * Popup minimum width may override extLeft (ie. it has higher precedence). // * Values 0 indicate default. // * Custom popup may not take this fully into account (wxPGOwnerDrawnComboBox takes). inline void SetPopupExtents( int extLeft, int extRight ) { m_extLeft = extLeft; m_extRight = extRight; } // Set width, in pixels, of custom paint area in writable combo. // In read-only, used to indicate area that is not covered by the // focus rectangle (which may or may not be drawn, depending on the // popup type). void SetCustomPaintWidth( int width ); inline int GetCustomPaintWidth() const { return m_widthCustomPaint; } // Set position of dropdown button. // width: 0 > for specific custom width, negative to adjust to smaller than default // height: 0 > for specific custom height, negative to adjust to smaller than default // side: wxLEFT or wxRIGHT, indicates on which side the button will be placed. // spacingX: empty space on sides of the button. Default is 0. // Remarks: // There is no spacingY - the button will be centered vertically. void SetButtonPosition( int width = 0, int height = 0, int side = wxRIGHT, int spacingX = 0 /*, int spacingY = 0*/ ); // // Sets dropbutton to be drawn with custom bitmaps. // // bmpNormal: drawn when cursor is not on button // blankButtonBg: Draw blank button background below the image. // NOTE! This is only properly supported on platforms with appropriate // method in wxRendererNative. // bmpPressed: drawn when button is depressed // bmpHover: drawn when cursor hovers on button. This is ignored on platforms // that do not generally display hover differently. // bmpDisabled: drawn when combobox is disabled. void SetButtonBitmaps( const wxBitmap& bmpNormal, bool blankButtonBg = false, const wxBitmap& bmpPressed = wxNullBitmap, const wxBitmap& bmpHover = wxNullBitmap, const wxBitmap& bmpDisabled = wxNullBitmap ); // // This will set the space in pixels between left edge of the control and the // text, regardless whether control is read-only (ie. no wxTextCtrl) or not. // Platform-specific default can be set with value-1. // Remarks // * This method may do nothing on some native implementations. void SetTextIndent( int indent ); // Returns actual indentation in pixels. inline wxCoord GetTextIndent() const { return m_absIndent; } // // Utilies needed by the popups or native implementations // // Draws focus background (on combo control) in a way typical on platform. // Unless you plan to paint your own focus indicator, you should always call this // in your wxPGComboPopup::PaintComboControl implementation. // In addition, it sets pen and text colour to what looks good and proper // against the background. // flags: wxRendererNative flags: wxCONTROL_ISSUBMENU: is drawing a list item instead of combo control // wxCONTROL_SELECTED: list item is selected // wxCONTROL_DISABLED: control/item is disabled virtual void DrawFocusBackground( wxDC& dc, const wxRect& rect, int flags ); // Returns true if focused. Differs from FindFocus in that takes // child controls into account. bool IsFocused() const { const wxWindow* curFocus = FindFocus(); if ( curFocus == this || (m_text && curFocus == m_text) ) return true; return false; } // Returns true if focus indicator should be drawn. inline bool ShouldDrawFocus() const { const wxWindow* curFocus = FindFocus(); return ( !m_isPopupShown && (curFocus == this || (m_btn && curFocus == m_btn)) && (m_windowStyle & wxCB_READONLY) ); } // These methods return references to appropriate dropbutton bitmaps inline const wxBitmap& GetBitmapNormal() const { return m_bmpNormal; } inline const wxBitmap& GetBitmapPressed() const { return m_bmpPressed; } inline const wxBitmap& GetBitmapHover() const { return m_bmpHover; } inline const wxBitmap& GetBitmapDisabled() const { return m_bmpDisabled; } // Return internal flags inline wxUint32 GetInternalFlags() const { return m_iFlags; } // Return true if Create has finished inline bool IsCreated() const { return m_iFlags & wxPGCC_IFLAG_CREATED ? true : false; } // Popup may use these as callbacks to measure and draw list items. // (wxPGOwnerDrawnComboBox uses these, obviously) // item: -1 means item is the combo control itself // flags: wxPGCC_PAINTING_CONTROL is set if painting to combo control instead of list // return value: OnDrawListItem must return true if it did anything virtual bool OnDrawListItem( wxDC& dc, const wxRect& rect, int item, int flags ); // Return item height, or -1 for text height (default) virtual wxCoord OnMeasureListItem( int item ); // Return item width, or -1 for calculating from text extent (default) virtual wxCoord OnMeasureListItemWidth( int item ); // Returns true if can and should send focus event to the main control from // textctrl input handler. inline bool ConsumingTextCtrlFocusEvent() { if ( m_skipTextCtrlFocusEvents == 0 ) return true; m_skipTextCtrlFocusEvents--; return false; } // NOTE: // I basicly needed to add callback methods into wxComboControlBase - otherwise it // will not be easily possible to use wxPGVListBoxComboPopup from simultaneously existing // wxComboControl and wxPGGenericComboControl (since some native implementations // might not have all the features, I really would like to have this options). protected: // // Override these for customization purposes // // called from wxSizeEvent handler virtual void OnResize() = 0; // Return native text identation (for pure text, not textctrl) virtual wxCoord GetNativeTextIndent() const; // Called in syscolourchanged handler and base create virtual void OnThemeChange(); // Creates wxTextCtrl. // extraStyle: Extra style parameters void CreateTextCtrl( int extraStyle, const wxValidator& validator ); // Installs standard input handler to combo void InstallInputHandlers(); // Flags for DrawButton. enum { Button_PaintBackground = 0x0001, // Paints control background below the button Button_BitmapOnly = 0x0002 // Only paints the bitmap }; // Draws dropbutton. Using wxRenderer or bitmaps, as appropriate. // Flags are defined above. void DrawButton( wxDC& dc, const wxRect& rect, int flags = Button_PaintBackground ); // Call if cursor is on button area or mouse is captured for the button. //bool HandleButtonMouseEvent( wxMouseEvent& event, bool isInside ); bool HandleButtonMouseEvent( wxMouseEvent& event, int flags ); // Conversion to double-clicks and some basic filtering // returns true if event was consumed or filtered (event type is also set to 0 in this case) //bool PreprocessMouseEvent( wxMouseEvent& event, bool isOnButtonArea ); bool PreprocessMouseEvent( wxMouseEvent& event, int flags ); // // This will handle left_down and left_dclick events outside button in a Windows-like manner. // If you need alternate behaviour, it is recommended you manipulate and filter events to it // instead of building your own handling routine (for reference, on wxEVT_LEFT_DOWN it will // toggle popup and on wxEVT_LEFT_DCLICK it will do the same or run the popup's dclick method, // if defined - you should pass events of other types of it for common processing). void HandleNormalMouseEvent( wxMouseEvent& event ); // Creates popup window, calls interface->Create(), etc void CreatePopup(); // common code to be called on popup hide/dismiss void OnPopupDismiss(); // Dispatches command event from the control //void SendEvent( int evtType = wxEVT_COMMAND_COMBOBOX_SELECTED, int selection, ); // override the base class virtuals involved in geometry calculations virtual void DoMoveWindow(int x, int y, int width, int height); virtual wxSize DoGetBestSize() const; // Recalculates button and textctrl areas. Called when size or button setup change. // btnWidth: default/calculated width of the dropbutton. 0 means unchanged, // just recalculate. void CalculateAreas( int btnWidth = 0 ); // Standard textctrl positioning routine. Just give it platform-dependant // textctrl coordinate adjustment. void PositionTextCtrl( int textCtrlXAdjust, int textCtrlYAdjust ); // event handlers void OnSizeEvent(wxSizeEvent& event); void OnFocusEvent(wxFocusEvent& event); void OnKeyEvent(wxKeyEvent& event); void OnTextCtrlEvent(wxCommandEvent& event); void OnSysColourChanged(wxSysColourChangedEvent& event); // Set customization flags (directs how wxComboControlBase helpers behave) void Customize( wxUint32 flags ) { m_iFlags |= flags; } // Dispatches size event and refreshes void RecalcAndRefresh(); // This is used when m_text is hidden (readonly). wxString m_valueString; // the text control and button we show all the time wxTextCtrl* m_text; wxWindow* m_btn; // wxPopupWindow or similar containing the window managed by the interface. wxWindow* m_winPopup; // the popup control/panel wxWindow* m_popup; // popup interface wxPGComboPopup* m_popupInterface; // this is input etc. handler the text control wxEvtHandler* m_textEvtHandler; // this is for the top level window wxEvtHandler* m_toplevEvtHandler; // this is for the control in popup wxEvtHandler* m_popupExtraHandler; // needed for "instant" double-click handling //wxLongLong m_timeLastMouseUp; // used to prevent immediate re-popupping incase closed popup // by clicking on the combo control (needed because of inconsistent // transient implementation across platforms). wxLongLong m_timeCanAcceptClick; // how much popup should expand to the left/right of the control wxCoord m_extLeft; wxCoord m_extRight; // minimum popup width wxCoord m_widthMinPopup; // preferred popup height wxCoord m_heightPopup; // how much of writable combo is custom-paint by callback? // also used to indicate area that is not covered by "blue" // selection indicator. wxCoord m_widthCustomPaint; // absolute text indentation, in pixels wxCoord m_absIndent; // Width of the "fake" border wxCoord m_widthCustomBorder; // The button and textctrl click/paint areas wxRect m_tcArea; wxRect m_btnArea; // current button state (uses renderer flags) int m_btnState; // button position int m_btnWid; int m_btnHei; int m_btnSide; int m_btnSpacingX; // last default button width int m_btnWidDefault; // custom dropbutton bitmaps wxBitmap m_bmpNormal; wxBitmap m_bmpPressed; wxBitmap m_bmpHover; wxBitmap m_bmpDisabled; // area used by the button wxSize m_btnSize; // platform-dependant customization and other flags wxUint32 m_iFlags; // draw blank button background under bitmap? bool m_blankButtonBg; // is the popup window currenty shown? bool m_isPopupShown; // TODO: Remove after real popup works ok. unsigned char m_fakePopupUsage; wxByte m_skipTextCtrlFocusEvents; private: void Init(); DECLARE_EVENT_TABLE() DECLARE_ABSTRACT_CLASS(wxPGComboControlBase) }; class WXDLLEXPORT_PGODC wxPGGenericComboControl : public wxPGComboControlBase { public: // ctors and such wxPGGenericComboControl() : wxPGComboControlBase() { Init(); } wxPGGenericComboControl(wxWindow *parent, wxWindowID id = wxID_ANY, const wxString& value = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxComboBoxNameStr) : wxPGComboControlBase() { Init(); (void)Create(parent, id, value, pos, size, style, validator, name); } bool Create(wxWindow *parent, wxWindowID id = wxID_ANY, const wxString& value = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxComboBoxNameStr); virtual ~wxPGGenericComboControl(); static int GetFeatures() { return wxPGComboControlFeatures::All; } protected: virtual void OnResize(); // event handlers //void OnSizeEvent( wxSizeEvent& event ); void OnPaintEvent( wxPaintEvent& event ); void OnMouseEvent( wxMouseEvent& event ); private: void Init(); DECLARE_EVENT_TABLE() DECLARE_DYNAMIC_CLASS(wxPGGenericComboControl) }; #if defined(__WXMSW__) && !defined(__WXUNIVERSAL__) class WXDLLEXPORT_PGODC wxPGComboControl : public wxPGComboControlBase { public: // ctors and such wxPGComboControl() : wxPGComboControlBase() { Init(); } wxPGComboControl(wxWindow *parent, wxWindowID id = wxID_ANY, const wxString& value = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxComboBoxNameStr) : wxPGComboControlBase() { Init(); (void)Create(parent, id, value, pos, size, style, validator, name); } bool Create(wxWindow *parent, wxWindowID id = wxID_ANY, const wxString& value = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxComboBoxNameStr); virtual ~wxPGComboControl(); //virtual void DrawFocusBackground( wxDC& dc, const wxRect& rect, int flags ); static int GetFeatures() { return wxPGComboControlFeatures::All; } protected: // customization virtual void OnResize(); virtual wxCoord GetNativeTextIndent() const; virtual void OnThemeChange(); // event handlers //void OnSizeEvent( wxSizeEvent& event ); void OnPaintEvent( wxPaintEvent& event ); void OnMouseEvent( wxMouseEvent& event ); private: void Init(); DECLARE_EVENT_TABLE() DECLARE_DYNAMIC_CLASS(wxPGComboControl) }; #else class WXDLLEXPORT_PGODC wxPGComboControl : public wxPGGenericComboControl { public: // ctors and such wxPGComboControl() : wxPGGenericComboControl() {} wxPGComboControl(wxWindow *parent, wxWindowID id = wxID_ANY, const wxString& value = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxComboBoxNameStr) : wxPGGenericComboControl() { (void)Create(parent, id, value, pos, size, style, validator, name); } bool Create(wxWindow *parent, wxWindowID id = wxID_ANY, const wxString& value = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxComboBoxNameStr) { return wxPGGenericComboControl::Create(parent,id,value,pos,size,style,validator,name); } virtual ~wxPGComboControl() {} protected: private: DECLARE_DYNAMIC_CLASS(wxPGComboControl) }; #endif // ---------------------------------------------------------------------------- // wxComboPopupInterface is the interface class that lies between // the wxPGOwnerDrawnComboBox and its popup window. // ---------------------------------------------------------------------------- // wxComboPopup internal flags enum { wxPGCP_IFLAG_CREATED = 0x0001, // Set by wxComboControlBase after Create is called }; class WXDLLEXPORT_PGODC wxPGComboPopup { friend class wxPGComboControlBase; public: wxPGComboPopup(wxPGComboControl *combo) { m_combo = combo; m_iFlags = 0; } virtual ~wxPGComboPopup(); // Create the popup child control. // Return true for success. virtual bool Create(wxWindow* parent) = 0; // We must have an associated control which is subclassed by the combobox. virtual wxWindow *GetControl() = 0; // Called immediately after the popup is shown virtual void OnPopup(); // Called when popup is dismissed virtual void OnDismiss(); // Called just prior to displaying popup. // Default implementation does nothing. virtual void SetStringValue( const wxString& value ); // Gets displayed string representation of the value. virtual wxString GetStringValue() const = 0; // This is called to custom paint in the combo control itself (ie. not the popup). // Default implementation draws value as string. virtual void PaintComboControl( wxDC& dc, const wxRect& rect ); // Receives key events from the parent wxComboControl. // Events not handled should be skipped, as usual. virtual void OnComboKeyEvent( wxKeyEvent& event ); // Implement if you need to support special action when user // double-clicks on the parent wxComboControl. virtual void OnComboDoubleClick(); // Return final size of popup. Called on every popup, just prior to OnShow. // minWidth = preferred minimum width for window // prefHeight = preferred height. Only applies if > 0, // maxHeight = max height for window, as limited by screen size // and should only be rounded down, if necessary. virtual wxSize GetAdjustedSize( int minWidth, int prefHeight, int maxHeight ); // Return true if you want delay call to Create until the popup is shown // for the first time. It is more efficient, but note that it is often // more convenient to have the control created immediately. // Default returns false. virtual bool LazyCreate(); // // Utilies // // Hides the popup void Dismiss(); // Returns true if Create has been called. inline bool IsCreated() const { return (m_iFlags & wxPGCP_IFLAG_CREATED) ? true : false; } protected: wxPGComboControl* m_combo; wxUint32 m_iFlags; }; // New window styles for wxPGOwnerDrawnComboBox enum { // Causes double-clicking to cycle the item instead of showing // the popup. Shift-pressed causes cycling direction to reverse. //wxODCB_DOUBLE_CLICK_CYCLES = wxPGCC_SPECIAL_DOUBLE_CLICK, // if used, control itself is not custom paint using callback // even if this is not used, writable combo is never custom paint // until SetCustomPaintWidth is called wxODCB_STD_CONTROL_PAINT = 0x0400 }; // // Callback flags // enum { // when set, we are painting the selected item in control, // not in the popup wxPGCC_PAINTING_CONTROL = 0x0001 }; // // Callback arguments: // pCb: combo box in question // item: index of item drawn or measured // dc: device context to draw on. NULL reference when measuring. // rect: draw call: rectangle in device context to limit the drawing on. Use rect.x and rect.y // as the origin. // measure call: initially width and height are -1. You need to set rect.height to whatever // is the height of the given item. // flags: see above /* typedef void (wxEvtHandler::* wxComboPaintCallback)( wxPGComboControl* pCb, int item, wxDC& dc, wxRect& rect, int flags ); */ #include "wx/vlbox.h" // ---------------------------------------------------------------------------- // wxPGVListBoxComboPopup is a wxVListBox customized to act as a popup control. // // Notes: // wxOwnerDrawnComboBox uses this as its popup. However, it always derives // from native wxComboControl. If you need to use this popup with // wxPGGenericComboControl, then remember that vast majority of item manipulation // functionality is implemented in the wxPGVListBoxComboPopup class itself. // // ---------------------------------------------------------------------------- class wxPGVListBoxComboPopup : public wxVListBox, public wxPGComboPopup { friend class wxPGOwnerDrawnComboBox; public: // ctor and dtor wxPGVListBoxComboPopup(wxPGComboControl* combo/*, wxComboPaintCallback callback*/); virtual ~wxPGVListBoxComboPopup(); // required virtuals virtual bool Create(wxWindow* parent); virtual wxWindow *GetControl() { return this; } virtual void SetStringValue( const wxString& value ); virtual wxString GetStringValue() const; // more customization virtual void OnPopup(); virtual wxSize GetAdjustedSize( int minWidth, int prefHeight, int maxHeight ); virtual void PaintComboControl( wxDC& dc, const wxRect& rect ); virtual void OnComboKeyEvent( wxKeyEvent& event ); virtual void OnComboDoubleClick(); //virtual bool CycleValue( bool forward ); //virtual bool OnComboDoubleClick(); virtual bool LazyCreate(); // Item management void SetSelection( int item ); void Insert( const wxString& item, int pos ); int Append(const wxString& item); void Clear(); void Delete( wxODCIndex item ); void SetItemClientData(wxODCIndex n, void* clientData, wxClientDataType clientDataItemsType); void *GetItemClientData(wxODCIndex n) const; void SetString( int item, const wxString& str ); wxString GetString( int item ) const; wxODCCount GetCount() const; int FindString(const wxString& s) const; int GetSelection() const; void Populate( int n, const wxString choices[] ); void ClearClientDatas(); // helpers inline int GetItemAtPosition( const wxPoint& pos ) { return HitTest(pos); } inline wxCoord GetTotalHeight() const { return EstimateTotalHeight(); } inline wxCoord GetLineHeight(int line) const { return OnMeasureItem(line); } protected: // Called by OnComboDoubleClick and OnComboKeyEvent bool HandleKey( int keycode, bool saturate ); // sends combobox select event from the parent combo control void SendComboBoxEvent( int selection ); void DismissWithEvent(); // Re-calculates width for given item void CheckWidth( int pos ); virtual wxCoord OnGetRowHeight(size_t n) const { return OnMeasureItem(n); } // wxVListBox implementation virtual void OnDrawItem(wxDC& dc, const wxRect& rect, size_t n) const; virtual wxCoord OnMeasureItem(size_t n) const; void OnDrawBackground(wxDC& dc, const wxRect& rect, size_t n) const; // filter mouse move events happening outside the list box // move selection with cursor void OnMouseMove(wxMouseEvent& event); void OnMouseWheel(wxMouseEvent& event); void OnKey(wxKeyEvent& event); void OnLeftClick(wxMouseEvent& event); wxArrayString m_strings; wxArrayPtrVoid m_clientDatas; wxArrayInt m_widths; // cached line widths wxString m_stringValue; wxFont m_font; int m_value; // selection int m_itemHover; // on which item the cursor is int m_widestWidth; // width of widest item thus far int m_avgCharWidth; int m_baseImageWidth; // how much per item drawn in addition to text int m_itemHeight; // default item height (calculate from font size // and used in the absence of callback) wxClientDataType m_clientDataItemsType; private: // has the mouse been released on this control? bool m_clicked; DECLARE_EVENT_TABLE() }; // ---------------------------------------------------------------------------- // wxPGOwnerDrawnComboBox: a generic wxComboBox that allows custom paint items. // // ---------------------------------------------------------------------------- class WXDLLEXPORT_PGODC wxPGOwnerDrawnComboBox : public wxPGComboControl, public wxItemContainer { friend class wxPGComboPopupWindow; friend class wxPGComboControlBase; public: // ctors and such wxPGOwnerDrawnComboBox() : wxPGComboControl() { Init(); } wxPGOwnerDrawnComboBox(wxWindow *parent, wxWindowID id, const wxString& value, const wxPoint& pos, const wxSize& size, int n, const wxString choices[], //wxComboPaintCallback callback, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxComboBoxNameStr) : wxPGComboControl() { Init(); (void)Create(parent, id, value, pos, size, n, choices, /*callback,*/ style, validator, name); } bool Create(wxWindow *parent, wxWindowID id, const wxString& value = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxComboBoxNameStr); wxPGOwnerDrawnComboBox(wxWindow *parent, wxWindowID id, const wxString& value, const wxPoint& pos, const wxSize& size, const wxArrayString& choices, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxComboBoxNameStr); bool Create(wxWindow *parent, wxWindowID id, const wxString& value = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, int n = 0, const wxString choices[] = (const wxString *) NULL, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxComboBoxNameStr); bool Create(wxWindow *parent, wxWindowID id, const wxString& value, const wxPoint& pos, const wxSize& size, const wxArrayString& choices, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxComboBoxNameStr); virtual ~wxPGOwnerDrawnComboBox(); // wxControlWithItems methods virtual void Clear(); virtual void Delete(wxODCIndex n); virtual wxODCCount GetCount() const; virtual wxString GetString(wxODCIndex n) const; virtual void SetString(wxODCIndex n, const wxString& s); virtual int FindString(const wxString& s) const; virtual void Select(int n); virtual int GetSelection() const; void SetSelection(int n) { Select(n); } wxCONTROL_ITEMCONTAINER_CLIENTDATAOBJECT_RECAST protected: // clears all allocated client datas void ClearClientDatas(); virtual int DoAppend(const wxString& item); virtual int DoInsert(const wxString& item, wxODCIndex pos); virtual void DoSetItemClientData(wxODCIndex n, void* clientData); virtual void* DoGetItemClientData(wxODCIndex n) const; virtual void DoSetItemClientObject(wxODCIndex n, wxClientData* clientData); virtual wxClientData* DoGetItemClientObject(wxODCIndex n) const; #if wxCHECK_VERSION(2,9,0) virtual int DoInsertItems(const wxArrayStringsAdapter& items, unsigned int pos, void **clientData, wxClientDataType type); virtual void DoClear() { Clear(); } virtual void DoDeleteOneItem(unsigned int pos) { Delete(pos); } #endif // overload m_popupInterface member so we can access specific popup interface easier wxPGVListBoxComboPopup* m_popupInterface; private: void Init(); DECLARE_EVENT_TABLE() DECLARE_DYNAMIC_CLASS(wxPGOwnerDrawnComboBox) }; #endif // _WX_PROPGRID_ODCOMBO_H_ wxformbuilder-3.1.59/src/controls/include/wx/propgrid/extras.h0000644000175000017500000000110311143440026024762 0ustar rrmulderrrmulder///////////////////////////////////////////////////////////////////////////// // Name: extras.h // Purpose: wxPropertyGrid Extras Header // Author: Jaakko Salli // Modified by: // Created: Mar-05-2006 // RCS-ID: $Id: // Copyright: (c) Jaakko Salli // Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// #ifndef WX_PROPGRID_EXTRAS_H #define WX_PROPGRID_EXTRAS_H // // In wxPython version this file will have additional property and // editor control headers. // #endif // WX_PROPGRID_EXTRAS_H wxformbuilder-3.1.59/src/controls/include/wx/propgrid/advprops.h0000644000175000017500000004066311143440026025330 0ustar rrmulderrrmulder///////////////////////////////////////////////////////////////////////////// // Name: advprops.h // Purpose: wxPropertyGrid Advanced Properties (font, colour, etc.) // Author: Jaakko Salli // Modified by: // Created: Sep-25-2004 // RCS-ID: $Id: // Copyright: (c) Jaakko Salli // Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_PROPGRID_ADVPROPS_H_ #define _WX_PROPGRID_ADVPROPS_H_ #include #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma interface "advprops.cpp" #endif // ----------------------------------------------------------------------- // // Additional Value Type Handlers // #ifndef SWIG WX_PG_DECLARE_VALUE_TYPE_WITH_DECL(wxColour,WXDLLIMPEXP_PG) WX_PG_DECLARE_VALUE_TYPE_VOIDP_WITH_DECL(wxArrayInt,WXDLLIMPEXP_PG) #if wxUSE_DATETIME #include WX_PG_DECLARE_VALUE_TYPE_BUILTIN_WITH_DECL(wxDateTime,WXDLLIMPEXP_PG) #endif bool WXDLLIMPEXP_PG operator == (const wxArrayInt& array1, const wxArrayInt& array2); #endif // // Additional Property Editors // #if wxUSE_SPINBTN WX_PG_DECLARE_EDITOR_WITH_DECL(SpinCtrl,WXDLLIMPEXP_PG) #endif #if wxUSE_DATEPICKCTRL && defined(wxPG_ALLOW_WXADV) WX_PG_DECLARE_EDITOR_WITH_DECL(DatePickerCtrl,WXDLLIMPEXP_PG) #endif // ----------------------------------------------------------------------- // Web colour is currently unsupported #define wxPG_COLOUR_WEB_BASE 0x10000 //#define wxPG_TO_WEB_COLOUR(A) ((wxUint32)(A+wxPG_COLOUR_WEB_BASE)) #define wxPG_COLOUR_CUSTOM 0xFFFFFF /** \class wxColourPropertyValue \ingroup classes \brief Because text, background and other colours tend to differ between platforms, wxSystemColourProperty must be able to select between system colour and, when necessary, to pick a custom one. wxSystemColourProperty value makes this possible. */ class WXDLLIMPEXP_PG wxColourPropertyValue : public wxObject { public: /** An integer value relating to the colour, and which exact meaning depends on the property with which it is used. For wxSystemColourProperty: Any of wxSYS_COLOUR_XXX, or any web-colour ( use wxPG_TO_WEB_COLOUR macro - (currently unsupported) ), or wxPG_COLOUR_CUSTOM. For custom colour properties without values array specified: index or wxPG_COLOUR_CUSTOM For custom colour properties with values array specified: m_arrValues[index] or wxPG_COLOUR_CUSTOM */ wxUint32 m_type; /** Resulting colour. Should be correct regardless of type. */ wxColour m_colour; wxColourPropertyValue() { } inline void Init( wxUint32 type, const wxColour& colour ) { m_type = type; m_colour = colour; } inline wxColourPropertyValue( const wxColour& colour ) { m_type = wxPG_COLOUR_CUSTOM; m_colour = colour; } inline wxColourPropertyValue( wxUint32 type ) { m_type = type; } inline wxColourPropertyValue( wxUint32 type, const wxColour& colour ) { Init( type, colour ); } #ifndef SWIG private: DECLARE_DYNAMIC_CLASS(wxColourPropertyValue) #endif }; #ifndef SWIG bool WXDLLIMPEXP_PG operator == (const wxColourPropertyValue&, const wxColourPropertyValue&); WX_PG_DECLARE_VALUE_TYPE_WITH_DECL(wxColourPropertyValue,WXDLLIMPEXP_PG) #endif /** \class wxFontPropertyValue \ingroup classes \brief Because the class wxFont cannot be a container for invalid font data (like default values). */ class WXDLLIMPEXP_PG wxFontPropertyValue : public wxObject { public: int m_pointSize; ///< Point Size int m_family; ///< Family int m_style; ///< Style int m_weight; ///< Weight bool m_underlined; ///< Underlined wxString m_faceName; ///< Face Name inline void InitDefaults() { m_pointSize = -1; m_family = wxFONTFAMILY_DEFAULT; m_style = wxFONTSTYLE_NORMAL; m_weight = wxFONTWEIGHT_NORMAL; m_underlined = false; m_faceName = wxEmptyString; } wxFontPropertyValue() { InitDefaults(); } inline wxFontPropertyValue( const wxFont& font ) { if ( !font.IsOk() ) { InitDefaults(); } else { m_pointSize = font.GetPointSize(); m_family = font.GetFamily(); m_style = font.GetStyle(); m_weight = font.GetWeight(); m_underlined = font.GetUnderlined(); m_faceName = font.GetFaceName(); } } inline wxFontPropertyValue( int pointSize, int family = wxFONTFAMILY_DEFAULT, int style = wxFONTSTYLE_NORMAL, int weight = wxFONTWEIGHT_NORMAL, bool underlined = false, const wxString& faceName = wxEmptyString ) : m_pointSize( pointSize ), m_family( family ), m_style( style ), m_weight( weight ), m_underlined( underlined ), m_faceName( faceName ) { } wxFont GetFont() const { int pointSize = m_pointSize <= 0 ? wxNORMAL_FONT->GetPointSize() : m_pointSize; return wxFont( pointSize, m_family, m_style, m_weight, m_underlined, m_faceName ); } // Duplicate wxFont's interface for backward compatiblity #define MAKE_GET_AND_SET( NAME, TYPE, VARIABLE ) \ TYPE Get##NAME() const { return VARIABLE; } \ void Set##NAME( TYPE value ){ VARIABLE = value; } MAKE_GET_AND_SET( PointSize, int, m_pointSize ) MAKE_GET_AND_SET( Family, int, m_family ) MAKE_GET_AND_SET( Style, int, m_style ) MAKE_GET_AND_SET( Weight, int, m_weight ) MAKE_GET_AND_SET( Underlined, bool, m_underlined ) MAKE_GET_AND_SET( FaceName, wxString, m_faceName ) // Allow implicit cast to wxFont /*operator wxFont() const { return GetFont(); }*/ #ifndef SWIG private: DECLARE_DYNAMIC_CLASS(wxFontPropertyValue) #endif }; #ifndef SWIG bool WXDLLIMPEXP_PG operator == (const wxFontPropertyValue&, const wxFontPropertyValue&); WX_PG_DECLARE_VALUE_TYPE_WITH_DECL(wxFontPropertyValue,WXDLLIMPEXP_PG) #endif #ifndef SWIG #define wxPG_EMPTY_CPV (*((wxColourPropertyValue*)NULL)) #define wxPG_NORMAL_FONT (*wxNORMAL_FONT) #else #define wxPG_EMPTY_CPV wxCPV_wxPG_EMPTY #define wxPG_NORMAL_FONT wxFONT_wxPG_NORMAL_FONT #endif // ----------------------------------------------------------------------- // Declare part of custom colour property macro pairs. #define WX_PG_DECLARE_CUSTOM_COLOUR_PROPERTY_WITH_DECL(NAME,DECL) \ extern DECL wxPGProperty* wxPG_CONSTFUNC(NAME)( const wxString& label, const wxString& name = wxPG_LABEL, const wxColourPropertyValue& value = wxPG_EMPTY_CPV ); \ extern DECL wxPGPropertyClassInfo NAME##ClassInfo; #define WX_PG_DECLARE_CUSTOM_COLOUR_PROPERTY(NAME) \ extern wxPGProperty* wxPG_CONSTFUNC(NAME)( const wxString& label, const wxString& name = wxPG_LABEL, const wxColourPropertyValue& value = wxPG_EMPTY_CPV ); \ extern wxPGPropertyClassInfo NAME##ClassInfo; #define WX_PG_DECLARE_CUSTOM_COLOUR_PROPERTY_USES_WXCOLOUR_WITH_DECL(NAME,DECL) \ extern DECL wxPGProperty* wxPG_CONSTFUNC(NAME)( const wxString& label, const wxString& name = wxPG_LABEL, const wxColour& value = wxPG_COLOUR_BLACK ); \ extern DECL wxPGPropertyClassInfo NAME##ClassInfo; #define WX_PG_DECLARE_CUSTOM_COLOUR_PROPERTY_USES_WXCOLOUR(NAME) \ extern wxPGProperty* wxPG_CONSTFUNC(NAME)( const wxString& label, const wxString& name = wxPG_LABEL, const wxColour& value = wxPG_COLOUR_BLACK ); \ extern wxPGPropertyClassInfo NAME##ClassInfo; // Declare advanced properties. WX_PG_DECLARE_PROPERTY_WITH_DECL(wxFontProperty,const wxFontPropertyValue&,wxFontPropertyValue(),WXDLLIMPEXP_PG) WX_PG_DECLARE_PROPERTY_WITH_DECL(wxSystemColourProperty,const wxColourPropertyValue&,wxPG_EMPTY_CPV,WXDLLIMPEXP_PG) WX_PG_DECLARE_PROPERTY_WITH_DECL(wxCursorProperty,int,wxCURSOR_NONE,WXDLLIMPEXP_PG) WX_PG_DECLARE_PROPERTY_WITH_DECL(wxDateProperty,const wxDateTime&,wxDateTime(),WXDLLIMPEXP_PG) #if wxUSE_IMAGE || defined(SWIG) #include WX_PG_DECLARE_PROPERTY_WITH_DECL(wxImageFileProperty,const wxString&,wxEmptyString,WXDLLIMPEXP_PG) #endif WX_PG_DECLARE_CUSTOM_COLOUR_PROPERTY_USES_WXCOLOUR_WITH_DECL(wxColourProperty,WXDLLIMPEXP_PG) // MultiChoice is trickier. #ifndef __WXPYTHON__ extern WXDLLIMPEXP_PG wxPGProperty* wxMultiChoiceProperty(const wxString& label, const wxString& name, const wxArrayString& choices = wxArrayString(), const wxArrayInt& value = wxPG_EMPTY_ARRAYINT); extern WXDLLIMPEXP_PG wxPGProperty* wxMultiChoiceProperty(const wxString& label, const wxString& name, const wxPGChoices& choices, const wxArrayInt& value = wxPG_EMPTY_ARRAYINT); extern WXDLLIMPEXP_PG wxPGProperty* wxMultiChoiceProperty(const wxString& label, const wxString& name, const wxArrayInt& value); #else extern WXDLLIMPEXP_PG wxPGProperty* wxMultiChoiceProperty(const wxString& label, const wxString& name = wxPG_LABEL, const wxArrayString& choices = wxArrayString(), // This crazyness is needed for Python 2.3 (which uses // VC6) compatibility. #ifndef SWIG const wxArrayInt& value = (*((wxArrayInt*)NULL))); #else const wxArrayInt& value = wxArrayInt()); #endif #endif // ----------------------------------------------------------------------- // // Define property classes *only* if propdev.h was included // #if defined(_WX_PROPGRID_PROPDEV_H_) //#ifndef SWIG // ----------------------------------------------------------------------- class WXDLLIMPEXP_PG wxFontPropertyClass : public wxPGPropertyWithChildren { WX_PG_DECLARE_PROPERTY_CLASS() public: wxFontPropertyClass( const wxString& label, const wxString& name, const wxFontPropertyValue& value ); virtual ~wxFontPropertyClass(); WX_PG_DECLARE_PARENTAL_TYPE_METHODS() virtual wxString GetValueAsString( int argFlags = 0 ) const; WX_PG_DECLARE_EVENT_METHODS() WX_PG_DECLARE_PARENTAL_METHODS() //WX_PG_DECLARE_CUSTOM_PAINT_METHODS() protected: wxFontPropertyValue m_value_wxFont; }; // ----------------------------------------------------------------------- /** If set, then match from list is searched for a custom colour. */ #define wxPG_PROP_TRANSLATE_CUSTOM wxPG_PROP_CLASS_SPECIFIC_1 class WXDLLIMPEXP_PG wxSystemColourPropertyClass : public wxEnumPropertyClass { WX_PG_DECLARE_PROPERTY_CLASS() public: wxSystemColourPropertyClass( const wxString& label, const wxString& name, const wxColourPropertyValue& value ); ~wxSystemColourPropertyClass(); WX_PG_DECLARE_BASIC_TYPE_METHODS() WX_PG_DECLARE_EVENT_METHODS() WX_PG_DECLARE_CUSTOM_PAINT_METHODS() WX_PG_DECLARE_ATTRIBUTE_METHODS() // Helper function to show the colour dialog bool QueryColourFromUser( wxPropertyGrid* propgrid, wxWindow* primary ); // Default is to use wxSystemSettings::GetColour(index). Override to use // custom colour tables etc. virtual long GetColour( int index ); protected: // Special constructors to be used by derived classes. wxSystemColourPropertyClass( const wxString& label, const wxString& name, const wxChar** labels, const long* values, wxPGChoices* choicesCache, const wxColourPropertyValue& value ); wxSystemColourPropertyClass( const wxString& label, const wxString& name, const wxChar** labels, const long* values, wxPGChoices* choicesCache, const wxColour& value ); void Init ( int type, const wxColour& colour ); // Translates colour to a int value, return wxNOT_FOUND if no match. int ColToInd ( const wxColour& colour ); wxColourPropertyValue m_value; }; // ----------------------------------------------------------------------- #ifndef SWIG class WXDLLIMPEXP_PG wxCursorPropertyClass : public wxEnumPropertyClass { WX_PG_DECLARE_DERIVED_PROPERTY_CLASS() public: wxCursorPropertyClass( const wxString& label, const wxString& name, int value ); virtual ~wxCursorPropertyClass(); WX_PG_DECLARE_CUSTOM_PAINT_METHODS() }; #endif // ----------------------------------------------------------------------- #if wxUSE_IMAGE || defined(SWIG) WXDLLIMPEXP_PG const wxString& wxPGGetDefaultImageWildcard(); class WXDLLIMPEXP_PG wxImageFilePropertyClass : public wxFilePropertyClass { WX_PG_DECLARE_DERIVED_PROPERTY_CLASS() public: wxImageFilePropertyClass( const wxString& label, const wxString& name, const wxString& value ); virtual ~wxImageFilePropertyClass (); virtual void DoSetValue ( wxPGVariant value ); WX_PG_DECLARE_CUSTOM_PAINT_METHODS() protected: wxBitmap* m_pBitmap; // final thumbnail area wxImage* m_pImage; // intermediate thumbnail area }; #endif #if wxUSE_CHOICEDLG && !defined(SWIG) //|| defined(SWIG) class WXDLLIMPEXP_PG wxMultiChoicePropertyClass : public wxPGProperty { WX_PG_DECLARE_PROPERTY_CLASS() public: wxMultiChoicePropertyClass( const wxString& label, const wxString& name, const wxArrayString& strings, const wxArrayInt& value ); wxMultiChoicePropertyClass( const wxString& label, const wxString& name = wxPG_LABEL, const wxArrayInt& value = wxArrayInt() ); wxMultiChoicePropertyClass( const wxString& label, const wxString& name, const wxPGChoices& choices, const wxArrayInt& value = wxArrayInt() ); virtual ~wxMultiChoicePropertyClass(); virtual void DoSetValue( wxPGVariant value ); virtual wxPGVariant DoGetValue() const; virtual wxString GetValueAsString( int flags = 0 ) const; virtual bool SetValueFromString( const wxString& text, int flags ); WX_PG_DECLARE_EVENT_METHODS() virtual int GetChoiceInfo( wxPGChoiceInfo* choiceinfo ); protected: void SetValueI( const wxArrayInt& arr ); // I stands for internal void GenerateValueAsString(); // Returns translation of values into string indices. wxArrayInt GetValueAsIndices() const; wxPGChoices m_choices; // Holds strings (any values given are ignored). wxArrayInt m_value_wxArrayInt; // Actual value. wxString m_display; // Cache displayed text since generating it is relatively complicated. }; #endif // wxUSE_CHOICEDLG // ----------------------------------------------------------------------- #if wxUSE_DATETIME && !defined(SWIG) class WXDLLIMPEXP_PG wxDatePropertyClass : public wxPGProperty { WX_PG_DECLARE_PROPERTY_CLASS() public: wxDatePropertyClass( const wxString& label, const wxString& name, const wxDateTime& value ); virtual ~wxDatePropertyClass(); virtual void DoSetValue( wxPGVariant value ); virtual wxPGVariant DoGetValue() const; virtual wxString GetValueAsString( int flags = 0 ) const; virtual bool SetValueFromString( const wxString& text, int flags ); //WX_PG_DECLARE_EVENT_METHODS() WX_PG_DECLARE_ATTRIBUTE_METHODS() inline void SetFormat( const wxString& format ) { m_format = format; } inline const wxString& GetFormat() const { return m_format; } inline void SetDateValue( const wxDateTime& dt ) { m_valueDateTime = dt; } inline const wxDateTime& GetDateValue() const { return m_valueDateTime; } inline long GetDatePickerStyle() const { return m_dpStyle; } protected: wxDateTime m_valueDateTime; wxString m_format; long m_dpStyle; // DatePicker style static wxString ms_defaultDateFormat; static wxString DetermineDefaultDateFormat( bool showCentury ); }; #endif // ----------------------------------------------------------------------- //#endif // #ifndef SWIG #endif // _WX_PROPGRID_PROPDEV_H_ #endif // _WX_PROPGRID_ADVPROPS_H_ wxformbuilder-3.1.59/src/controls/include/wx/propgrid/propgrid.h0000644000175000017500000075366411143440026025334 0ustar rrmulderrrmulder///////////////////////////////////////////////////////////////////////////// // Name: propgrid.h // Purpose: wxPropertyGrid // Author: Jaakko Salli // Modified by: // Created: Sep-25-2004 // RCS-ID: $Id: // Copyright: (c) Jaakko Salli // Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// #ifndef __WX_PROPGRID_PROPGRID_H__ #define __WX_PROPGRID_PROPGRID_H__ #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma interface "propgrid.cpp" #endif #include #include #include #include #include #include #include #include #include #include // NB: Do *NOT * remove this. #if defined(SWIG) || defined(SWIG_TYPE_TABLE) #ifndef __WXPYTHON__ #define __WXPYTHON__ #endif #endif // // In case DOXYGEN was not specified... #if !defined(DOXYGEN) && !defined(_WX_WINDOW_H_BASE_) && !defined(SWIG) // I've tried to get this auto-defined in Doxygen config, but have not // succeeded thus far... so using a hack here. #define DOXYGEN #endif // Doxygen special includes #ifdef DOXYGEN #include "pg_dox_mainpage.h" #include "propdev.h" #endif // // Need to define some things for DOXYGEN #ifdef DOXYGEN #define wxUSE_VALIDATORS 1 #define wxUSE_DATETIME 1 #define wxUSE_TOOLTIPS 1 #define wxUSE_SPINBTN 1 #define wxUSE_DATEPICKCTRL 1 #endif // // Check some wxUSE_FOOs #ifndef wxUSE_VALIDATORS #error "wxUSE_VALIDATORS not defined" #endif #ifndef wxUSE_DATETIME #error "wxUSE_DATETIME not defined" #endif #ifndef wxUSE_DATEPICKCTRL #error "wxUSE_DATEPICKCTRL not defined" #endif // Uncomment next line to allow wxAdv linkage (required for DatePickerCtrl editor) // #define wxPG_ALLOW_WXADV #if defined(__WXPYTHON__) #include #undef wxPG_ALLOW_WXADV #define wxPG_ALLOW_WXADV #endif // Defines for component version. // The following symbols should be updated for each new component release // since some kind of tests, like those of AM_WXCODE_CHECKFOR_COMPONENT_VERSION() // for "configure" scripts under unix, use them. #define wxPROPGRID_MAJOR 1 #define wxPROPGRID_MINOR 2 #define wxPROPGRID_RELEASE 10 // For non-Unix systems (i.e. when building without a configure script), // users of this component can use the following macro to check if the // current version is at least major.minor.release #define wxCHECK_PROPGRID_VERSION(major,minor,release) \ (wxPROPGRID_MAJOR > (major) || \ (wxPROPGRID_MAJOR == (major) && wxPROPGRID_MINOR > (minor)) || \ (wxPROPGRID_MAJOR == (major) && wxPROPGRID_MINOR == (minor) && wxPROPGRID_RELEASE >= (release))) // Legacy version number #define wxPG_VERSION ((wxPROPGRID_MAJOR*1000)+(wxPROPGRID_MINOR*100)+(wxPROPGRID_RELEASE*10)) // ----------------------------------------------------------------------- // // Here are some platform dependent defines // NOTE: More in propertygrid.cpp // #ifndef SWIG #if defined(__WXMSW__) // tested #define wxPG_XBEFORETEXT 5 // space between vertical line and value text #define wxPG_XBEFOREWIDGET 1 // space between vertical line and value editor control #define wxPG_TEXTCTRLXADJUST 3 // x position adjustment for wxTextCtrl (and like) #define wxPG_ICON_WIDTH 9 // comment to use bitmap buttons #define wxPG_USE_RENDERER_NATIVE 0 // 1 if wxRendererNative should be employed #define wxPG_DOUBLE_BUFFER 1 // 1 to use double-buffer that guarantees flicker-free painting #define wxPG_HEAVY_GFX 1 // 1 for prettier appearance #define wxPG_SUPPORT_TOOLTIPS 1 // Enable tooltips #elif defined(__WXGTK__) // tested #define wxPG_XBEFORETEXT 6 // space between vertical line and value text #define wxPG_XBEFOREWIDGET 1 // space between vertical line and value editor control #define wxPG_TEXTCTRLXADJUST 3 // x position adjustment for wxTextCtrl (and like) #define wxPG_ICON_WIDTH 9 // comment to use bitmap buttons #define wxPG_USE_RENDERER_NATIVE 0 // 1 if wxRendererNative should be employed #define wxPG_DOUBLE_BUFFER 1 // 1 to use double-buffer that guarantees flicker-free painting #define wxPG_HEAVY_GFX 1 // 1 for prettier appearance #define wxPG_SUPPORT_TOOLTIPS 1 // Enable tooltips #elif defined(__WXMAC__) // *not* tested #define wxPG_XBEFORETEXT 5 // space between vertical line and value text #define wxPG_XBEFOREWIDGET 1 // space between vertical line and value editor widget #define wxPG_TEXTCTRLXADJUST 3 // x position adjustment for wxTextCtrl (and like) #define wxPG_ICON_WIDTH 11 // comment to use bitmap buttons #define wxPG_USE_RENDERER_NATIVE 1 // 1 if wxRendererNative should be employed #define wxPG_DOUBLE_BUFFER 0 // 1 to use double-buffer that guarantees flicker-free painting #define wxPG_HEAVY_GFX 1 // 1 for prettier appearance #define wxPG_SUPPORT_TOOLTIPS 1 // Enable tooltips #else // defaults // tested on: none. #define wxPG_XBEFORETEXT 6 // space between vertical line and value text #define wxPG_XBEFOREWIDGET 1 // space between vertical line and value editor widget #define wxPG_TEXTCTRLXADJUST 3 // x position adjustment for wxTextCtrl (and like) #define wxPG_ICON_WIDTH 9 // comment to use bitmap buttons #define wxPG_USE_RENDERER_NATIVE 0 // 1 if wxRendererNative should be employed #define wxPG_DOUBLE_BUFFER 0 // 1 to use double-buffer that guarantees flicker-free painting #define wxPG_HEAVY_GFX 0 // 1 for prettier appearance #define wxPG_SUPPORT_TOOLTIPS 0 // Enable tooltips #endif // #if defined(__WXMSW__) #if defined(__WXWINCE__) #define wxPG_SMALL_SCREEN 1 #undef wxPG_DOUBLE_BUFFER #define wxPG_DOUBLE_BUFFER 0 #else #define wxPG_SMALL_SCREEN 0 #endif #endif // #ifndef SWIG // Undefine wxPG_ICON_WIDTH to use supplied xpm bitmaps instead // (for tree buttons) //#undef wxPG_ICON_WIDTH // Need to force disable tooltips? #if !wxUSE_TOOLTIPS #undef wxPG_SUPPORT_TOOLTIPS #define wxPG_SUPPORT_TOOLTIPS 0 #endif // Set 1 to include basic properties ( ~48k in 0.9.9.2 ) #define wxPG_INCLUDE_BASICPROPS 1 // Set 1 to include advanced properties (wxFontProperty, wxColourProperty, etc.) ( ~32k in 0.9.9.2 ) #define wxPG_INCLUDE_ADVPROPS 1 // Set 1 include wxPropertyGridManager ( ~36k in 0.9.9.1 ) //#define wxPG_INCLUDE_MANAGER 1 // Set 1 to include checkbox editor class ( ~4k in 0.9.9.1 ) #define wxPG_INCLUDE_CHECKBOX 1 // 1 to allow user data for each property #define wxPG_USE_CLIENT_DATA 1 // NOTE: This is not supported as 1. #define wxPG_INCLUDE_WXOBJECT 0 // ----------------------------------------------------------------------- #ifdef wxPG_COMPATIBILITY_1_0_0 #define wxRECURSE wxPG_RECURSE #define wxKEEP_STRUCTURE wxPG_KEEP_STRUCTURE #define wxPGConstants wxPGChoices #define wxPG_EX_CLASSIC_SPACING 0 #define wxPGCtrlClass wxWindow #define wxCCustomTextCtrl wxTextCtrl #define wxCCustomComboBox wxPGOwnerDrawnComboBox #define wxCCustomButton wxButton #endif // #ifdef wxPG_COMPATIBILITY_1_0_0 #ifdef __WXPYTHON__ #define wxPG_PGVARIANT_IS_VARIANT 1 // 1 #define wxPG_VALUETYPE_IS_STRING 0 // 1 #else #define wxPG_PGVARIANT_IS_VARIANT 0 #define wxPG_VALUETYPE_IS_STRING 0 #endif #ifndef SWIG #if !wxCHECK_VERSION(2,9,0) #if !defined(wxUniChar) #define wxUniChar wxChar #endif //#define wxPGGetIterChar(str, i) str[i] #define wxPGGetIterChar(str, i) *i #else #define wxPGGetIterChar(str, i) *i #endif #endif // ----------------------------------------------------------------------- // // wxPython special considerations // // TODO: Using wxPG_GETVALUE_CONST yields some ugly function // names, so might as well make those GetPropertyValueAsXXX non-static // for regular C++ build as well.s // #if !wxPG_VALUETYPE_IS_STRING #define wxPG_VALUETYPE_MSGVAL const wxPGValueType* #else #define wxPG_VALUETYPE_MSGVAL wxString #endif #ifndef __WXPYTHON__ // Some Strings are returned as const wxChar* in C++, and as wxString in wxPython // (using just wxString for everything would've been better, but the current scheme // is necessary for better backwards compatibility). #define wxPG_CONST_WXCHAR_PTR const wxChar* #define wxPG_CONST_WXCHAR_DEFVAL ((const wxChar*)NULL) #define wxPG_TO_WXCHAR_PTR(A) A #define wxPG_PYTHON_STATIC static #define wxPG_GETVALUE_CONST // In C++ we can stick with overloaded methods #define SetPropertyValueLong SetPropertyValue #define SetPropertyValueDouble SetPropertyValue #define SetPropertyValueBool SetPropertyValue #define SetPropertyValueString SetPropertyValue #define SetPropertyValueWxObjectPtr SetPropertyValue #define SetPropertyValuePoint SetPropertyValue #define SetPropertyValueSize SetPropertyValue #define SetPropertyValueArrint2 SetPropertyValue #define SetPropertyValueArrstr2 SetPropertyValue #define SetPropertyValueDatetime SetPropertyValue #define SetPropertyValueLongLong SetPropertyValue #define SetPropertyValueULongLong SetPropertyValue #else // Some Strings are returned as const wxChar* in C++, and as wxString in wxPython // (using just wxString for everything would've been better, but the current scheme // is necessary for better backwards compatibility). #define wxPG_CONST_WXCHAR_PTR wxString #define wxPG_CONST_WXCHAR_DEFVAL wxEmptyString #define wxPG_TO_WXCHAR_PTR(A) (A.c_str()) // Declaring GetValues as static will yield problems #define wxPG_PYTHON_STATIC #define wxPG_GETVALUE_CONST const // Because SWIG has problems combining overloaded functions and // Python object-to-wxXXX conversion, we need to use Python proxy // functions for these value setters. #define SetPropertyValueArrstr2 _SetPropertyValueArrstr #define SetPropertyValueArrint2 _SetPropertyValueArrint #endif // wxPG_CHECK_FOO_DBG - on Release and wxPython builds, show wxLogWarning instead // (so that the program flow is not interrupted, but the message can still be seen). #if !defined(__WXDEBUG__) || defined(__WXPYTHON__) #define wxPG_CHECK_RET_DBG(A,B) \ if ( !(A) ) { wxLogWarning(B); return; } #define wxPG_CHECK_MSG_DBG(A,B,C) \ if ( !(A) ) { wxLogWarning(C); return B; } #else #define wxPG_CHECK_RET_DBG(A,B) wxCHECK_RET(A,B) #define wxPG_CHECK_MSG_DBG(A,B,C) wxCHECK_MSG(A,B,C) #endif // ----------------------------------------------------------------------- // Our very custom dynamic object macros. Should only be used // directly in an abstract (typeless etc.) base property classes. #if wxPG_INCLUDE_WXOBJECT #error "wxPG_INCLUDE_WXOBJECT is not currently supported (as of 1.0.0b)." #define WX_PG_DECLARE_GETCLASSNAME #define WX_PG_DECLARE_GETCLASSINFO #else #define WX_PG_DECLARE_GETCLASSNAME virtual wxPG_CONST_WXCHAR_PTR GetClassName() const; #define WX_PG_DECLARE_GETCLASSINFO virtual const wxPGPropertyClassInfo* GetClassInfo() const; #endif // ----------------------------------------------------------------------- #ifdef WXMAKINGLIB_PROPGRID #define WXDLLIMPEXP_PG #elif defined(WXMAKINGDLL_PROPGRID) #define WXDLLIMPEXP_PG WXEXPORT #elif defined(WXUSINGDLL) #define WXDLLIMPEXP_PG WXIMPORT #else // not making nor using DLL #define WXDLLIMPEXP_PG #endif // ----------------------------------------------------------------------- #if wxPG_PGVARIANT_IS_VARIANT #define wxPGVariant wxVariant #else class WXDLLIMPEXP_PG wxPGVariant; #endif #ifndef SWIG class WXDLLIMPEXP_PG wxPGValueType; class WXDLLIMPEXP_PG wxPGEditor; class WXDLLIMPEXP_PG wxPGProperty; class WXDLLIMPEXP_PG wxPGPropertyWithChildren; class WXDLLIMPEXP_PG wxPropertyCategoryClass; class WXDLLIMPEXP_PG wxPGChoices; class WXDLLIMPEXP_PG wxPropertyGridState; class WXDLLIMPEXP_PG wxPropertyContainerMethods; class WXDLLIMPEXP_PG wxPropertyGrid; class WXDLLIMPEXP_PG wxPropertyGridEvent; class WXDLLIMPEXP_PG wxPropertyGridManager; class WXDLLIMPEXP_PG wxPGOwnerDrawnComboBox; class WXDLLIMPEXP_PG wxPGCustomComboControl; struct wxPGPaintData; extern WXDLLIMPEXP_PG const wxChar *wxPropertyGridNameStr; #endif // #ifndef SWIG #ifdef __WXPYTHON__ class wxPGPyEditor; #endif // #ifndef __WXPYTHON__ /** @defgroup miscellaneous wxPropertyGrid Miscellanous This section describes some miscellanous values, types and macros. @{ */ #if wxPG_PGVARIANT_IS_VARIANT #define wxPG_EMPTY_ARRAYINT wxArrayInt() #define wxPG_EMPTY_ARRAYSTRING wxArrayString() #elif !defined(SWIG) #define wxPG_EMPTY_ARRAYINT (*((wxArrayInt*)NULL)) #define wxPG_EMPTY_ARRAYSTRING (*((wxArrayString*)NULL)) #else #define wxPG_EMPTY_ARRAYINT wxArrayInt_wxPG_EMPTY #define wxPG_EMPTY_ARRAYSTRING wxArrayString_wxPG_EMPTY #endif #if !defined(SWIG) #define wxPG_LABEL (*((wxString*)NULL)) // Used to tell wxPGProperty to use label as name as well. #define wxPG_NULL_BITMAP wxNullBitmap #define wxPG_COLOUR_BLACK (*wxBLACK) #else #define wxPG_LABEL wxString_wxPG_LABEL #define wxPG_NULL_BITMAP wxBitmap_NULL #define wxPG_COLOUR_BLACK wxColour_BLACK #endif // #ifndef SWIG // Used to indicate wxPGChoices::Add etc that the value is actually not given // by the caller. #define wxPG_INVALID_VALUE INT_MAX /** Convert Red, Green and Blue to a single 32-bit value. */ #define wxPG_COLOUR(R,G,B) ((wxUint32)(R+(G<<8)+(B<<16))) /** Return this in GetImageSize() to indicate that the custom painted property image is flexible. That is, it will paint (dropdown) list item images with PREFWID,PREFHEI size. */ #define wxPG_FLEXIBLE_SIZE(PREFWID,PREFHEI) wxSize(-(PREFWID),-(PREFHEI)) #define wxPG_FULL_CUSTOM_PAINT_WIDTH -99999 /** Return this in GetImageSize() to indicate that the property is custom painted completely (ie. the text as well). */ #define wxPG_FULL_CUSTOM_PAINT_SIZE(HEI) \ wxSize(wxPG_FULL_CUSTOM_PAINT_WIDTH,HEI) /** Return this in GetImageSize() to indicate that the property is custom painted completely (ie. the text as well), and with flexible height. */ #define wxPG_FULL_CUSTOM_PAINT_FLEXIBLE_SIZE(PREFHEI) \ wxSize(wxPG_FULL_CUSTOM_PAINT_WIDTH,-(PREFHEI)) /** This callback function is used by atleast wxCustomProperty to facilitiate easy custom action on button press. \param propGrid related wxPropertyGrid \param property related wxPGProperty \param ctrl If not NULL (for example, not selected), a wxWindow* or equivalent \param data Value depends on the context. \retval True if changed value of the property. */ typedef bool (*wxPropertyGridCallback)(wxPropertyGrid* propGrid, wxPGProperty* property, wxWindow* ctrl, int data); /** This callback function is used by atleast wxCustomProperty to facilitiate drawing items in drop down list. Works very much like wxPGProperty::OnCustomPaint. */ typedef void (*wxPGPaintCallback)(wxPGProperty* property, wxDC& dc, const wxRect& rect, wxPGPaintData& paintdata); /** Use this with wxPropertyGrid::IsPropertyKindOf. For example, as in \code pg->IsPropertyKindOf(WX_PG_CLASSINFO(wxStringProperty)) \endcode */ #define WX_PG_CLASSINFO(NAME) NAME##ClassInfo /** @} */ // ----------------------------------------------------------------------- /** @defgroup wndflags wxPropertyGrid Window Styles SetWindowStyleFlag method can be used to modify some of these at run-time. @{ */ /** This will cause Sort() automatically after an item is added. When inserting a lot of items in this mode, it may make sense to use Freeze() before operations and Thaw() afterwards to increase performance. */ #define wxPG_AUTO_SORT 0x00000010 /** Categories are not initially shown (even if added). IMPORTANT NOTE: If you do not plan to use categories, then this style will waste resources. This flag can also be changed using wxPropertyGrid::EnableCategories method. */ #define wxPG_HIDE_CATEGORIES 0x00000020 /* This style combines non-categoric mode and automatic sorting. */ #define wxPG_ALPHABETIC_MODE (wxPG_HIDE_CATEGORIES|wxPG_AUTO_SORT) /** Modified values are shown in bold font. Changing this requires Refresh() to show changes. */ #define wxPG_BOLD_MODIFIED 0x00000040 /** When wxPropertyGrid is resized, splitter moves to the center. This behaviour stops once the user manually moves the splitter. */ #define wxPG_SPLITTER_AUTO_CENTER 0x00000080 /** Display tooltips for cell text that cannot be shown completely. If wxUSE_TOOLTIPS is 0, then this doesn't have any effect. */ #define wxPG_TOOLTIPS 0x00000100 /** Disables margin and hides all expand/collapse buttons that would appear outside the margin (for sub-properties). Toggling this style automatically expands all collapsed items. */ #define wxPG_HIDE_MARGIN 0x00000200 /** This style prevents user from moving the splitter. */ #define wxPG_STATIC_SPLITTER 0x00000400 /** Combination of other styles that make it impossible for user to modify the layout. */ #define wxPG_STATIC_LAYOUT (wxPG_HIDE_MARGIN|wxPG_STATIC_SPLITTER) /** Disables wxTextCtrl based editors for properties which can be edited in another way. Equals calling wxPropertyGrid::LimitPropertyEditing for all added properties. */ #define wxPG_LIMITED_EDITING 0x00000800 #ifdef DOXYGEN /** wxTAB_TRAVERSAL allows using Tab/Shift-Tab to travel between properties in grid. Travelling forwards from last property will navigate to the next control, and backwards from first will navigate to the previous one. */ #define wxTAB_TRAVERSAL 0x00080000 #endif /** wxPropertyGridManager only: Show toolbar for mode and page selection. */ #define wxPG_TOOLBAR 0x00001000 /** wxPropertyGridManager only: Show adjustable text box showing description or help text, if available, for currently selected property. */ #define wxPG_DESCRIPTION 0x00002000 /** wxPropertyGridManager only: Show compactor button that toggles hidden state of low-priority properties. */ #define wxPG_COMPACTOR 0x00004000 /** NOTE: wxPG_EX_xxx are extra window styles and must be set using SetExtraStyle() member function. Speeds up switching to wxPG_HIDE_CATEGORIES mode. Initially, if wxPG_HIDE_CATEGORIES is not defined, the non-categorized data storage is not activated, and switching the mode first time becomes somewhat slower. wxPG_EX_INIT_NOCAT activates the non-categorized data storage right away. IMPORTANT NOTE: If you do plan not switching to non-categoric mode, or if you don't plan to use categories at all, then using this style will result in waste of resources. */ #define wxPG_EX_INIT_NOCAT 0x00001000 /** Extended window style that sets wxPropertyGridManager toolbar to not use flat style. */ #define wxPG_EX_NO_FLAT_TOOLBAR 0x00002000 /** This extra style allows editing more similar to some Microsoft/Mono provided property sheet controls. Currently this includes (but more may be added later, incase I missed something): * Pressing ENTER in control, in addition to confirming changes, will unfocus it. * Pressing ESC doesn't cancel edit (but still unfocuses the editor). Note that ESC and ENTER events in editor controls are relayed to the wxPropertyGrid itself, so that they can be detected by the application. */ //#define wxPG_EX_ALTERNATE_KEYS 0x00004000 /** Shows alphabetic/categoric mode buttons from toolbar. */ #define wxPG_EX_MODE_BUTTONS 0x00008000 /** Show property help strings as tool tips instead as text on the status bar. You can set the help strings using SetPropertyHelpString member function. */ #define wxPG_EX_HELP_AS_TOOLTIPS 0x00010000 /** Prevent TAB from focusing to wxButtons. This behaviour was default in version 1.2.0 and earlier. NOTE! Tabbing to button doesn't work yet. Problem seems to be that on wxMSW atleast the button doesn't properly propagate key events (yes, I'm using wxWANTS_CHARS). */ //#define wxPG_EX_NO_TAB_TO_BUTTON 0x00020000 /** Set this style to have labels of disabled properties become greyed along with the values. */ #define wxPG_EX_GREY_LABEL_WHEN_DISABLED 0x00040000 /** Allows relying on native double-buffering. */ #define wxPG_EX_NATIVE_DOUBLE_BUFFERING 0x00080000 /** Process all events immediately, if possible. That is, ProcessEvent is called instead of AddPendingEvent. */ #define wxPG_EX_PROCESS_EVENTS_IMMEDIATELY 0x00100000 /** Set this style to let user have ability to set values of properties to unspecified state. Currently, this applies to following properties: - wxIntProperty, wxUIntProperty, and wxFloatProperty: Clear the text field. */ #define wxPG_EX_AUTO_UNSPECIFIED_VALUES 0x00200000 /** Combines various styles. */ #define wxPG_DEFAULT_STYLE (0) /** Combines various styles. */ #define wxPGMAN_DEFAULT_STYLE (0) /** @} */ /** Flags for wxPropertyGrid::GetPropertyValues and wxPropertyGridManager::GetPropertyValues. */ #define wxPG_KEEP_STRUCTURE 0x00000010 /** Flags for wxPropertyGrid::SetPropertyAttribute etc */ #define wxPG_RECURSE 0x00000020 #define wxPG_RECURSE_STARTS 0x00000040 #define wxPG_FORCE 0x00000080 // ----------------------------------------------------------------------- // Property priorities #define wxPG_LOW 1 #define wxPG_HIGH 2 // ----------------------------------------------------------------------- // Misc argument flags. #define wxPG_FULL_VALUE 0x00000001 // Get/Store full value instead of displayed value. #define wxPG_REPORT_ERROR 0x00000002 #define wxPG_PROPERTY_SPECIFIC 0x00000004 #define wxPG_EDITABLE_VALUE 0x00000008 // Get/Store value that must be editable in wxTextCtrl // ----------------------------------------------------------------------- #if defined(__WXPYTHON__) #define wxPG_ID_IS_PTR 1 #else #define wxPG_ID_IS_PTR 0 #endif #if wxPG_ID_IS_PTR #define wxNullProperty ((wxPGProperty*)NULL) #define wxPGId wxPGProperty* #define wxPGIdGen(PTR) PTR #define wxPGIdToPtr(ID) ((wxPGProperty*)ID) #define wxPGIdIsOk(ID) ( ID != ((wxPGProperty*)NULL) ) #else #define wxNullProperty wxPGId(NULL) /** \class wxPGId \ingroup classes \brief Simple wrapper for the wxPGProperty pointer. NB: This class exists because: - Abstract wxPGId would allow both flexibility and speed (for possible native'ish implementations, altough this doesn't make sense anymore). - wxPG methods should be mostly used for property manipulation (or such vision I had at first), and since wxPGId id = pg->Append(...) is faster tow write, it seemed useful. *However* in future I may just start using wxPG_ID_IS_PTR by the default. It might even result into slightly smaller code (altough I have checked out some MSVC generated assembly, and it seems to optimize out the wrapper in usual scenarios). */ class WXDLLIMPEXP_PG wxPGId { public: inline wxPGId() { m_ptr = (wxPGProperty*) NULL; } ~wxPGId() {} bool IsOk() const { return ( m_ptr != NULL ); } bool operator == (const wxPGId& other) { return m_ptr == other.m_ptr; } inline const wxString& GetName() const; #ifndef SWIG inline wxPGId( wxPGProperty* ptr ) { m_ptr = ptr; } inline wxPGId( wxPGProperty& ref ) { m_ptr = &ref; } operator wxPGProperty* () { return m_ptr; } wxPGProperty* GetPropertyPtr() const { return m_ptr; } #endif // #ifndef SWIG wxPGProperty& GetProperty() const { return *m_ptr; } private: wxPGProperty* m_ptr; }; #define wxPGIdGen(PTR) wxPGId(PTR) #define wxPGIdToPtr(ID) ID.GetPropertyPtr() #define wxPGIdIsOk(ID) ID.IsOk() #endif // wxPG_ID_IS_PTR // ----------------------------------------------------------------------- WXDLLIMPEXP_PG void wxPGTypeOperationFailed ( const wxPGProperty* p, const wxChar* typestr, const wxChar* op ); WXDLLIMPEXP_PG void wxPGGetFailed ( const wxPGProperty* p, const wxChar* typestr ); // ----------------------------------------------------------------------- /** @defgroup propflags wxPGProperty Flags @{ */ // NOTE: Do not change order of these, and if you add // any, remember also to update gs_property_flag_to_string // in propgrid.cpp. /** Indicates bold font. */ #define wxPG_PROP_MODIFIED 0x0001 /** Disables ('greyed' text and editor does not activate) property. */ #define wxPG_PROP_DISABLED 0x0002 /** Hider button will hide this property. */ #define wxPG_PROP_HIDEABLE 0x0004 /** This property has custom paint image just in front of its value. If property only draws custom images into a popup list, then this flag should not be set. */ #define wxPG_PROP_CUSTOMIMAGE 0x0008 /** Do not create text based editor for this property (but button-triggered dialog and choice are ok). */ #define wxPG_PROP_NOEDITOR 0x0010 /** Value is unspecified. */ #define wxPG_PROP_UNSPECIFIED 0x0020 /** Indicates the bit useable by derived properties. */ #define wxPG_PROP_CLASS_SPECIFIC_1 0x0040 /** Indicates the bit useable by derived properties. */ #define wxPG_PROP_CLASS_SPECIFIC_2 0x0080 /** Property value cannot be modified. However, editor may be created so that the value can be easily copied. */ #define wxPG_PROP_READONLY 0x0100 /** @} */ // Amalgam of flags that should be inherited by sub-properties #define wxPG_INHERITED_PROPFLAGS (wxPG_PROP_HIDEABLE|wxPG_PROP_NOEDITOR) // ----------------------------------------------------------------------- /** @defgroup attrids wxPropertyGrid Property Attribute Identifiers wxPropertyGrid::SetPropertyAttribute accepts one of these as attrid argument when used with one of the built-in property classes. @{ */ /** wxBoolProperty specific, int, default 0. When 1 sets bool property to use checkbox instead of choice. */ #define wxPG_BOOL_USE_CHECKBOX 64 /** wxBoolProperty specific, int, default 0. When 1 sets bool property value to cycle on double click (instead of showing the popup listbox). */ #define wxPG_BOOL_USE_DOUBLE_CLICK_CYCLING 65 /** wxFloatProperty (and similar) specific, int, default -1. Sets the (max) precision used when floating point value is rendered as text. The default -1 means infinite precision. */ #define wxPG_FLOAT_PRECISION 66 /** The text will be echoed as asterisks (wxTE_PASSWORD will be passed to textctrl etc). */ #define wxPG_STRING_PASSWORD 67 /** Define base used by a wxUIntProperty. Valid constants are wxPG_BASE_OCT, wxPG_BASE_DEC, wxPG_BASE_HEX and wxPG_BASE_HEXL (lowercase characters). */ #define wxPG_UINT_BASE 68 /** Define prefix rendered to wxUIntProperty. Accepted constants wxPG_PREFIX_NONE, wxPG_PREFIX_0x, and wxPG_PREFIX_DOLLAR_SIGN. Note: Only wxPG_PREFIX_NONE works with Decimal and Octal numbers. */ #define wxPG_UINT_PREFIX 69 /** wxFileProperty/wxImageFileProperty specific, wxChar*, default is detected/varies. Sets the wildcard used in the triggered wxFileDialog. Format is the same. */ #define wxPG_FILE_WILDCARD 70 /** wxFileProperty/wxImageFileProperty specific, int, default 1. When 0, only the file name is shown (i.e. drive and directory are hidden). */ #define wxPG_FILE_SHOW_FULL_PATH 71 /** Specific to wxFileProperty and derived properties, wxString, default empty. If set, then the filename is shown relative to the given path string. */ #define wxPG_FILE_SHOW_RELATIVE_PATH 72 /** Specific to wxFileProperty and derived properties, wxString, default is empty. Sets the initial path of where to look for files. */ #define wxPG_FILE_INITIAL_PATH 73 /** Specific to wxFileProperty and derivatives, wxString, default is empty. Sets a specific title for the dir dialog. */ #define wxPG_FILE_DIALOG_TITLE 74 /** Specific to wxFileProperty and derivatives, int, default is -1. Sets a filter index for the dir dialog. */ #define wxPG_FILE_FILTER_INDEX 75 /** Specific to wxDirProperty, wxString, default is empty. Sets a specific message for the dir dialog. */ #define wxPG_DIR_DIALOG_MESSAGE 76 /** Sets displayed date format for wxDateProperty. */ #define wxPG_DATE_FORMAT 77 /** Sets wxDatePickerCtrl window style used with wxDateProperty. Default is wxDP_DEFAULT | wxDP_SHOWCENTURY. */ #define wxPG_DATE_PICKER_STYLE 78 #ifdef wxPG_COMPATIBILITY_1_0_0 /** wxCustomProperty specific, wxPGEditor*. Set editor control. Editor pointer is stored in variable named wxPGEditor_EDITORNAME. So the basic built-in editors are at wxPGEditor_TextCtrl, wxPGEditor_Choice, wxPGEditor_ComboBox, wxPGEditor_CheckBox, wxPGEditor_TextCtrlAndButton, and wxPGEditor_ChoiceAndButton. */ #define wxPG_CUSTOM_EDITOR 128 /** wxCustomProperty specific, wxBitmap*. Sets a small bitmap. Value must be given as pointer and it is then copied. If you give it wxNullBitmap, then the current image (if any) is deleted. */ #define wxPG_CUSTOM_IMAGE 129 /** wxCustomProperty specific, void*. Sets callback function (of type wxPropertyGridCallback) that is called whenever button is pressed. */ #define wxPG_CUSTOM_CALLBACK 130 #endif // wxPG_COMPATIBILITY_1_0_0 /** wxCustomProperty specific, void*. Sets callback function (of type wxPGPaintCallback) that is called whenever image in front of property needs to be repainted. This attribute takes precedence over bitmap set with wxPG_CUSTOM_IMAGE, and it is only proper way to draw images to wxCustomProperty's drop down choices list. \remarks Callback must handle measure calls (i.e. when rect.x < 0, set paintdata.m_drawnHeight to height of item in question). */ #define wxPG_CUSTOM_PAINT_CALLBACK 131 /** wxCustomProperty specific, int, default 0. Setting to 1 makes children private, similar to other properties with children. \remarks - Children must be added when this attribute has value 0. Otherwise there will be an assertion failure. - Changed event occurs on the parent only. */ #define wxPG_CUSTOM_PRIVATE_CHILDREN 132 /** wxColourProperty and its kind, int, default 1. Setting this attribute to 0 hides custom colour from property's list of choices. */ #define wxPG_COLOUR_ALLOW_CUSTOM 151 /** First attribute id that is guaranteed not to be used built-in properties. */ #define wxPG_USER_ATTRIBUTE 192 /** @} */ // // Valid constants for wxPG_UINT_BASE attribute // (long because of wxVariant constructor) #define wxPG_BASE_OCT (long)8 #define wxPG_BASE_DEC (long)10 #define wxPG_BASE_HEX (long)16 #define wxPG_BASE_HEXL (long)32 // // Valid constants for wxPG_UINT_PREFIX attribute #define wxPG_PREFIX_NONE (long)0 #define wxPG_PREFIX_0x (long)1 #define wxPG_PREFIX_DOLLAR_SIGN (long)2 // ----------------------------------------------------------------------- // Value type. // Value type declarer, with optional declaration part (with creator function). #define WX_PG_DECLARE_VALUE_TYPE_WITH_DECL(VALUETYPE,DECL) \ extern DECL const wxPGValueType *wxPGValueType_##VALUETYPE; \ extern DECL wxPGValueType* wxPGNewVT##VALUETYPE(); // Value type declarer (with creator function). #define WX_PG_DECLARE_VALUE_TYPE(VALUETYPE) \ extern const wxPGValueType *wxPGValueType_##VALUETYPE; \ wxPGValueType* wxPGNewVT##VALUETYPE(); // Value type declarer, with optional declaration part. #define WX_PG_DECLARE_VALUE_TYPE_BUILTIN_WITH_DECL(VALUETYPE,DECL) \ extern DECL const wxPGValueType *wxPGValueType_##VALUETYPE; // Value type accessor. #if !wxPG_VALUETYPE_IS_STRING #define wxPG_VALUETYPE(T) wxPGValueType_##T #define wxPG_VALUETYPE_PTR(T) wxPGValueType_##T #else #define wxPG_VALUETYPE(T) wxT(#T) #define wxPG_VALUETYPE_PTR(T) wxPropertyContainerMethods::GetValueType(wxT(#T)) #endif // Like wxPG_VALUETYPE, but casts pointer to exact class. #define wxPG_VALUETYPE_EXACT(T) ((wxPGValueType##VALUETYPE##Class)wxPGValueType##T) // Declare builtin value types. WX_PG_DECLARE_VALUE_TYPE_BUILTIN_WITH_DECL(none,WXDLLIMPEXP_PG) WX_PG_DECLARE_VALUE_TYPE_BUILTIN_WITH_DECL(wxString,WXDLLIMPEXP_PG) WX_PG_DECLARE_VALUE_TYPE_BUILTIN_WITH_DECL(long,WXDLLIMPEXP_PG) WX_PG_DECLARE_VALUE_TYPE_BUILTIN_WITH_DECL(bool,WXDLLIMPEXP_PG) WX_PG_DECLARE_VALUE_TYPE_BUILTIN_WITH_DECL(double,WXDLLIMPEXP_PG) WX_PG_DECLARE_VALUE_TYPE_BUILTIN_WITH_DECL(void,WXDLLIMPEXP_PG) WX_PG_DECLARE_VALUE_TYPE_BUILTIN_WITH_DECL(wxArrayString,WXDLLIMPEXP_PG) #ifdef __WXPYTHON__ WX_PG_DECLARE_VALUE_TYPE_BUILTIN_WITH_DECL(PyObject,WXDLLIMPEXP_PG) #endif // // With wxWidgets 2.9 and later we demand native C++ RTTI support #if wxCHECK_VERSION(2,9,0) #ifdef wxNO_RTTI #error "You need to enable compiler RTTI support when using wxWidgets 2.9.0 or later" #endif #define WX_PG_DECLARE_DYNAMIC_CLASS_VARIANTDATA(A) #define WX_PG_IMPLEMENT_DYNAMIC_CLASS_VARIANTDATA(A, B) #else #define WX_PG_DECLARE_DYNAMIC_CLASS_VARIANTDATA DECLARE_DYNAMIC_CLASS #define WX_PG_IMPLEMENT_DYNAMIC_CLASS_VARIANTDATA IMPLEMENT_DYNAMIC_CLASS #endif // VDC = wxVariantData Class #define WX_PG_DECLARE_VALUE_TYPE_VDC(VALUETYPE) \ wxVariantData_##VALUETYPE : public wxPGVariantDataWxObj \ { \ WX_PG_DECLARE_DYNAMIC_CLASS_VARIANTDATA(wxVariantData_##VALUETYPE) \ protected: \ VALUETYPE m_value; \ public: \ wxVariantData_##VALUETYPE(); \ wxVariantData_##VALUETYPE(const VALUETYPE& value); \ virtual void Copy(wxVariantData& data); \ virtual bool Eq(wxVariantData& data) const; \ virtual wxString GetType() const; \ virtual void* GetValuePtr(); \ inline const VALUETYPE& GetValue () const { return m_value; } // Value type declarer for void* that need auto-generated . #define WX_PG_DECLARE_VALUE_TYPE_VOIDP_WITH_DECL(VALUETYPE,DECL) \ class DECL WX_PG_DECLARE_VALUE_TYPE_VDC(VALUETYPE) \ }; \ extern DECL const wxPGValueType *wxPGValueType_##VALUETYPE; #define WX_PG_DECLARE_VALUE_TYPE_VOIDP(VALUETYPE) \ class WX_PG_DECLARE_VALUE_TYPE_VDC(VALUETYPE) \ }; \ WX_PG_DECLARE_VALUE_TYPE(VALUETYPE) #ifndef SWIG /** \class wxPGVariantDataWxObj \ingroup classes \brief Identical to wxVariantDataWxObjectPtr except that it deletes the ptr on destruction. */ class WXDLLIMPEXP_PG wxPGVariantDataWxObj : public wxVariantData { public: wxPGVariantDataWxObj(); virtual ~wxPGVariantDataWxObj(); #if wxUSE_STD_IOSTREAM virtual bool Write(wxSTD ostream& str) const; #endif virtual bool Write(wxString& str) const; #if wxUSE_STD_IOSTREAM virtual bool Read(wxSTD istream& str); #endif virtual bool Read(wxString& str); virtual void* GetValuePtr() = 0; }; #endif // #ifndef SWIG #if !wxCHECK_VERSION(2,9,0) typedef wxList wxVariantList; #endif // ----------------------------------------------------------------------- // Editor class. // Editor accessor. #define wxPG_EDITOR(T) wxPGEditor_##T // Declare editor class, with optional part. #define WX_PG_DECLARE_EDITOR_WITH_DECL(EDITOR,DECL) \ extern DECL wxPGEditor* wxPGEditor_##EDITOR; \ extern DECL wxPGEditor* wxPGConstruct##EDITOR##EditorClass(); // Declare editor class. #define WX_PG_DECLARE_EDITOR(EDITOR) \ extern wxPGEditor* wxPGEditor_##EDITOR; \ extern wxPGEditor* wxPGConstruct##EDITOR##EditorClass(); // Declare builtin editor classes. WX_PG_DECLARE_EDITOR_WITH_DECL(TextCtrl,WXDLLIMPEXP_PG) WX_PG_DECLARE_EDITOR_WITH_DECL(Choice,WXDLLIMPEXP_PG) WX_PG_DECLARE_EDITOR_WITH_DECL(ComboBox,WXDLLIMPEXP_PG) WX_PG_DECLARE_EDITOR_WITH_DECL(TextCtrlAndButton,WXDLLIMPEXP_PG) #if wxPG_INCLUDE_CHECKBOX WX_PG_DECLARE_EDITOR_WITH_DECL(CheckBox,WXDLLIMPEXP_PG) #endif WX_PG_DECLARE_EDITOR_WITH_DECL(ChoiceAndButton,WXDLLIMPEXP_PG) // ----------------------------------------------------------------------- /** \class wxPGValueType \ingroup classes \brief wxPGValueType is base class for property value types. */ class WXDLLIMPEXP_PG wxPGValueType { public: virtual ~wxPGValueType() = 0; /** Returns type name. If there is wxVariantData for this type, then name should be the same that the class uses (otherwise wxT("void*")). */ virtual wxPG_CONST_WXCHAR_PTR GetTypeName() const = 0; /** Returns custom type name. If this is base for a type, should not be overridden, as the default implementation already does good thing and calls GetTypeName. Otherwise, should be an unique string, such as the class name etc. */ virtual wxPG_CONST_WXCHAR_PTR GetCustomTypeName() const; /** Returns default value. */ virtual wxPGVariant GetDefaultValue() const = 0; /** Creates wxVariant with supplied value and name. */ virtual wxVariant GenerateVariant( wxPGVariant value, const wxString& name ) const = 0; /** Creates new property instance with "proper" class. Initial value is set to default. */ virtual wxPGProperty* GenerateProperty( const wxString& label, const wxString& name ) const = 0; /** Sets property value from wxVariant. */ virtual void SetValueFromVariant( wxPGProperty* property, wxVariant& value ) const = 0; /** Returns type that can be passed to CreatePropertyByType. */ inline wxPG_CONST_WXCHAR_PTR GetType() const { return GetCustomTypeName(); } protected: }; // ----------------------------------------------------------------------- // wxVariant definition macro (sans functional eq-operator) #define WX_PG_DECLARE_VARIANT_DATA(CLASSNAME, DATATYPE, DECL) \ class DECL CLASSNAME : public wxVariantData \ { \ DECLARE_DYNAMIC_CLASS(CLASSNAME) \ public: \ CLASSNAME() { } \ CLASSNAME(const DATATYPE& value) { m_value = value; } \ inline DATATYPE GetValue() const { return m_value; } \ inline const DATATYPE& GetValueRef() const { return m_value; } \ inline void SetValue(const DATATYPE& value) { m_value = value; } \ virtual bool Eq(wxVariantData&) const { return false; } \ virtual wxString GetType() const { return wxT(#DATATYPE); } \ virtual wxVariantData* Clone() { return new CLASSNAME; } \ virtual void Copy(wxVariantData &data) { ((CLASSNAME&)data).SetValue(m_value); } \ virtual bool Read(wxString &) { return false; } \ virtual bool Write(wxString &) const { return true; } \ protected: \ DATATYPE m_value; \ }; #define WX_PG_DECLARE_VARIANT_DATA_PTR(CLASSNAME, DATATYPE, DECL) \ class DECL CLASSNAME : public wxVariantData \ { \ DECLARE_DYNAMIC_CLASS(CLASSNAME) \ public: \ CLASSNAME() { } \ CLASSNAME(DATATYPE* value) { m_value = value; } \ inline void SetValue(DATATYPE* value) { m_value = value; } \ inline DATATYPE* GetValue() const { return m_value; } \ virtual bool Eq(wxVariantData&) const { return false; } \ virtual wxString GetType() const { return wxT(#DATATYPE); } \ virtual wxVariantData* Clone() { return new CLASSNAME; } \ virtual void Copy(wxVariantData &data) { ((CLASSNAME&)data).SetValue(m_value); } \ virtual bool Read(wxString &) { return false; } \ virtual bool Write(wxString &) const { return true; } \ protected: \ DATATYPE* m_value; \ }; #if wxPG_PGVARIANT_IS_VARIANT #define wxPGVariantToWxObjectPtr(A,B) wxDynamicCast(A.GetWxObjectPtr(),B); #define wxPGVariantGetWxObjectPtr(A) A.GetWxObjectPtr() #define wxPGVariantToWxObject(A) (*A.GetWxObjectPtr()) #define wxPGVariantToDateTime(A) A.GetDateTime() #define wxPGVariantToWxPoint(A) ((wxPGVariantDataPoint*)(A.GetData()))->GetValueRef() #define wxPGVariantToWxSize(A) ((wxPGVariantDataSize*)(A.GetData()))->GetValueRef() #define wxPGVariantToWxLongLong(A) ((wxPGVariantDataLongLong*)(A.GetData()))->GetValueRef() #define wxPGVariantToWxULongLong(A) ((wxPGVariantDataULongLong*)(A.GetData()))->GetValueRef() #define wxPGVariantToArrayInt(A) ((wxPGVariantDataArrayInt*)(A.GetData()))->GetValueRef() #define wxPGVariantToPyObject(A) ((wxPGVariantDataPyObject*)(A.GetData()))->GetValue() #define wxPGVariantFromWxObject(A) wxVariant((wxObject*)A) #define wxPGVariantFromLong(A) wxVariant(((long)A)) #if !defined(SWIG) WX_PG_DECLARE_VARIANT_DATA(wxPGVariantDataPoint, wxPoint, WXDLLIMPEXP_PG) WX_PG_DECLARE_VARIANT_DATA(wxPGVariantDataSize, wxSize, WXDLLIMPEXP_PG) WX_PG_DECLARE_VARIANT_DATA(wxPGVariantDataArrayInt, wxArrayInt, WXDLLIMPEXP_PG) WX_PG_DECLARE_VARIANT_DATA(wxPGVariantDataLongLong, wxLongLong, WXDLLIMPEXP_PG) WX_PG_DECLARE_VARIANT_DATA(wxPGVariantDataULongLong, wxULongLong, WXDLLIMPEXP_PG) #ifdef __WXPYTHON__ WX_PG_DECLARE_VARIANT_DATA_PTR(wxPGVariantDataPyObject, PyObject, WXDLLIMPEXP_PG) #endif // We need this because wxVariant lacks all necessary constructors inline wxVariant wxPGVariantCreator(long a) { return wxVariant((long)a); } inline wxVariant wxPGVariantCreator(int a) { return wxVariant((long)a); } inline wxVariant wxPGVariantCreator(bool a) { return wxVariant(a); } inline wxVariant wxPGVariantCreator(const double& a) { return wxVariant(a); } inline wxVariant wxPGVariantCreator(const wxString& a) { return wxVariant(a); } // NB: This may look dangerous. However, the wxVariant lives only a very short // time, so it is very unlikely they value will be modified by some // "third party". inline wxVariant wxPGVariantCreator(const wxObject* a) { return wxVariant((wxObject*)a); } inline wxVariant wxPGVariantCreator(const wxObject& a) { return wxVariant((wxObject*)(&a)); } inline wxVariant wxPGVariantCreator(wxObject* a) { return wxVariant(a); } inline wxVariant wxPGVariantCreator(wxObject& a) { return wxVariant(&a); } inline wxVariant wxPGVariantCreator(void* a) { return wxVariant(a); } inline wxVariant wxPGVariantCreator(const wxArrayString& a) { return wxVariant((wxArrayString&)a); } inline wxVariant wxPGVariantCreator(const wxArrayInt& a) { return wxVariant(new wxPGVariantDataArrayInt(a)); } inline wxVariant wxPGVariantCreator(const wxPoint& a) { return wxVariant(new wxPGVariantDataPoint(a)); } inline wxVariant wxPGVariantCreator(const wxSize& a) { return wxVariant(new wxPGVariantDataSize(a)); } inline wxVariant wxPGVariantCreator(const wxLongLong& a) { return wxVariant(new wxPGVariantDataLongLong(a)); } inline wxVariant wxPGVariantCreator(const wxULongLong& a) { return wxVariant(new wxPGVariantDataULongLong(a)); } #ifdef __WXPYTHON__ inline wxVariant wxPGVariantCreator(PyObject* a) { return wxVariant(new wxPGVariantDataPyObject(a)); } #endif #if wxUSE_DATETIME inline wxVariant wxPGVariantCreator(const wxDateTime& a) { return wxVariant(a); } #endif #endif // !defined(SWIG) #else // !wxPG_PGVARIANT_IS_VARIANT union wxPGVariantUnion { long m_long; void* m_ptr; bool m_bool; }; // // Very simple value wrapper class // // NB: It only holds the pointers for a short period, so don't // worry about it not making copies. class WXDLLIMPEXP_PG wxPGVariant { public: /** Constructor for none. */ wxPGVariant() { m_v.m_ptr = (void*)NULL; } #ifndef SWIG /** Constructor for long integer. */ wxPGVariant( long v_long ) { m_v.m_long = v_long; } /** Constructor for integer. */ wxPGVariant( int v_long ) { m_v.m_long = v_long; } /** Constructor for bool. */ wxPGVariant( bool value ) { m_v.m_bool = value; } /** Constructor for float. */ wxPGVariant( const double& v_ptr ) { m_v.m_ptr = (void*)&v_ptr; } /** Constructor for wxString*. */ wxPGVariant( const wxString& v_ptr ) { m_v.m_ptr = (void*)&v_ptr; } /** Constructor for wxArrayString*. */ wxPGVariant( const wxArrayString& v_ptr ) { m_v.m_ptr = (void*)&v_ptr; } /** Constructor for wxArrayInt. */ wxPGVariant( const wxArrayInt& v_ptr ) { m_v.m_ptr = (void*)&v_ptr; } /** Constructor for wxPoint. */ wxPGVariant( const wxPoint& v_ptr ) { m_v.m_ptr = (void*)&v_ptr; } /** Constructor for wxSize. */ wxPGVariant( const wxSize& v_ptr ) { m_v.m_ptr = (void*)&v_ptr; } /** Constructor for wxLongLong. */ wxPGVariant( const wxLongLong& v_ptr ) { m_v.m_ptr = (void*)&v_ptr; } /** Constructor for wxULongLong. */ wxPGVariant( const wxULongLong& v_ptr ) { m_v.m_ptr = (void*)&v_ptr; } /** Constructor for wxObject&. */ wxPGVariant( const wxObject& v_ptr ) { m_v.m_ptr = (void*)&v_ptr; } /** Constructor for wxObject*. */ wxPGVariant( const wxObject* v_ptr ) { m_v.m_ptr = (void*)v_ptr; } /** Constructor for void*. */ wxPGVariant( void* v_ptr ) { m_v.m_ptr = v_ptr; } #if wxUSE_DATETIME /** Constructor for wxDateTime ptr. */ wxPGVariant( const wxDateTime& dt ) { m_v.m_ptr = (void*) &dt; } #endif /** Returns value as long integer. */ inline long GetLong() const { return m_v.m_long; } /** Returns value as boolean integer. */ inline bool GetBool() const { return m_v.m_bool; } /** Returns value as floating point number. */ inline double GetDouble() const { return *((double*)m_v.m_ptr); } /** Returns value as floating point number ptr. */ inline double* GetDoublePtr() const { return (double*) m_v.m_ptr; } /** Returns value as a wxString. */ inline const wxString& GetString() const { return *((const wxString*)m_v.m_ptr); } /** Returns value as a reference to a wxArrayString. */ inline wxArrayString& GetArrayString() const { wxArrayString* temp = (wxArrayString*)m_v.m_ptr; return *temp; } inline const wxObject& GetWxObject() const { return *((const wxObject*)m_v.m_ptr); } inline wxObject* GetWxObjectPtr() const { return (wxObject*)m_v.m_ptr; } /** Returns value as void*. */ inline void* GetVoidPtr() const { return m_v.m_ptr; } #if wxUSE_DATETIME /** Returns value as const wxDateTime&. */ inline const wxDateTime& GetDateTime() const { return *((const wxDateTime*)m_v.m_ptr); } #endif #endif // #ifndef SWIG /** Returns value as long integer without type checking. */ inline long GetRawLong() const { return m_v.m_long; } /** Returns value as void* without type checking. */ inline void* GetRawPtr() const { return m_v.m_ptr; } #undef wxPG_ASSERT_VARIANT_GET /** Value in portable format. */ wxPGVariantUnion m_v; }; #define wxPGVariantGetWxObjectPtr(A) ((wxObject*)A.GetRawPtr()) #define wxPGVariantToWxObjectPtr(A,B) wxDynamicCast((wxObject*)A.GetRawPtr(),B); #define wxPGVariantToWxObject(A) A.GetWxObject() #define wxPGVariantToDateTime(A) *((wxDateTime*)A.GetVoidPtr()) #define wxPGVariantToWxPoint(A) *((wxPoint*)wxPGVariantToVoidPtr(A)) #define wxPGVariantToWxSize(A) *((wxSize*)wxPGVariantToVoidPtr(A)) #define wxPGVariantToWxLongLong(A) *((wxLongLong*)wxPGVariantToVoidPtr(A)) #define wxPGVariantToWxULongLong(A) *((wxULongLong*)wxPGVariantToVoidPtr(A)) #define wxPGVariantToArrayInt(A) *((wxArrayInt*)A.GetVoidPtr()) #define wxPGVariantFromWxObject(A) *((const wxObject*)A) #define wxPGVariantFromLong(A) wxPGVariant(A) #define wxPGVariantCreator wxPGVariant #endif // !wxPG_PGVARIANT_IS_VARIANT // Helper macros #define wxPGVariantToString(A) A.GetString() #define wxPGVariantToLong(A) A.GetLong() #define wxPGVariantToBool(A) A.GetBool() #define wxPGVariantToDouble(A) A.GetDouble() #define wxPGVariantToArrayString(A) A.GetArrayString() #define wxPGVariantToVoidPtr(A) A.GetVoidPtr() #define wxPGVariantFromString(A) A #define wxPGVariantFromDouble(A) A #define wxPGVariantFromArrayString(A) A #define wxPGVariantFromBool(A) A // ----------------------------------------------------------------------- // // Property class declaration helper macros // (wxPGRootPropertyClass and wxPropertyCategory require this). // #define WX_PG_DECLARE_CLASSINFO() \ WX_PG_DECLARE_GETCLASSNAME \ WX_PG_DECLARE_GETCLASSINFO // We don't want to create SWIG interface for DoGetEditorClass (we'll use GetEditor instead) #ifndef SWIG #define WX_PG_DECLARE_DOGETEDITORCLASS virtual const wxPGEditor* DoGetEditorClass() const; #else #define WX_PG_DECLARE_DOGETEDITORCLASS #endif #define WX_PG_DECLARE_PROPERTY_CLASS() \ public: \ virtual wxPG_VALUETYPE_MSGVAL GetValueType() const; \ WX_PG_DECLARE_DOGETEDITORCLASS \ WX_PG_DECLARE_CLASSINFO() \ private: // Added for SWIG (which apparently doesn't support 0-argument macros) // NB: Othwise, this is *identical* to WX_PG_DECLARE_PROPERTY_CLASS() #define WX_PG_DECLARE_PROPERTY_CLASS_NOPARENS \ public: \ virtual wxPG_VALUETYPE_MSGVAL GetValueType() const; \ WX_PG_DECLARE_DOGETEDITORCLASS \ WX_PG_DECLARE_CLASSINFO() \ private: #ifndef SWIG // ----------------------------------------------------------------------- // wxPGPropertyClassInfo typedef wxPGProperty* (*wxPGPropertyConstructor) (const wxString&,const wxString&); /** \class wxPGPropertyClassInfo \ingroup classes \brief Class info structure for wxPGProperty derivatives (may be deprecated in a future release). */ struct wxPGPropertyClassInfo { /** One returned by GetPropertyClassName */ const wxChar* m_name; /** Classinfo of the base property class. */ const wxPGPropertyClassInfo* m_baseInfo; /** Simple property constructor function. */ wxPGPropertyConstructor m_constructor; }; // Use this macro to register your custom property classes. #define wxPGRegisterPropertyClass(NAME) \ wxPropertyGrid::RegisterPropertyClass(wxT(#NAME),&NAME##ClassInfo) // ----------------------------------------------------------------------- // Structure for relaying choice/list info. struct wxPGChoiceInfo { const wxChar** m_arrWxChars; wxString* m_arrWxString; wxPGChoices* m_choices; int m_itemCount; }; // ----------------------------------------------------------------------- /** \class wxPGPropertyDataExt \ingroup classes \brief wxPGPropertyDataExt is data extension class for wxPGProperty. */ class WXDLLIMPEXP_PG wxPGPropertyDataExt { public: wxPGPropertyDataExt() { #if wxUSE_VALIDATORS m_validator = (wxValidator*) NULL; #endif m_customEditor = (wxPGEditor*) NULL; m_valueBitmap = (wxBitmap*) NULL; } ~wxPGPropertyDataExt() { // Do not delete m_customEditor #if wxUSE_VALIDATORS delete m_validator; #endif delete m_valueBitmap; } // For conviency, declare all members public. wxString m_helpString; // Help shown in statusbar or help box. const wxPGEditor* m_customEditor; // Overrides editor returned by property class #if wxUSE_VALIDATORS // NOTE: This is candidate for hash mapping. wxValidator* m_validator; // Editor is going to get this validator #endif wxBitmap* m_valueBitmap; // Show this in front of the value }; #endif // ----------------------------------------------------------------------- /** \class wxPGProperty \ingroup classes \brief wxPGProperty, alias wxBasePropertyClass, is base class for properties. Information here is provided primarily for anyone who creates new properties, since all operations on properties should be done via wxPropertyGrid's or wxPropertyGridManager's methods. \remarks - When changing name of a property, it is essential to use wxPropertyGrid::SetPropertyName (that's why there is no SetName method). */ class WXDLLIMPEXP_PG wxPGProperty { #ifndef SWIG friend class wxPGPropertyWithChildren; friend class wxPropertyGrid; friend class wxPropertyContainerMethods; friend class wxPropertyGridState; #endif public: // PYSWIG is a special symbol used by my custom scripts. Code to remove it // automatically should be added in future. #ifndef PYSWIG /** Basic constructor. Should not be necessary to override. */ wxPGProperty(); #endif /** Constructor. Real used property classes should have constructor of this style: \code // If MyValueType is a class, then it should be a constant reference // (e.g. const MyValueType& ) instead. wxMyProperty( const wxString& label, const wxString& name, MyValueType value ) : wxPGProperty { // Only required if MyValueType is not built-in default // (wxString, long, double, bool, and wxArrayString are; // wxFont, wxColour, etc. are not). wxPG_INIT_REQUIRED_TYPE(MyValueType) DoSetValue(value); // Generally recommended way to set the initial value. // If has child properties (i.e. wxPGPropertyWithChildren is used // as the parent class), then create children here. For example: // AddChild( new wxStringProperty( wxT("Subprop 1"), wxPG_LABEL, value.GetSubProp1() ) ); } \endcode Of course, in this example, wxPGProperty could also be wxPGPropertyWithChildren (if it has sub-properties) or actually any other property class. */ wxPGProperty( const wxString& label, const wxString& name ); /** Virtual destructor. It is customary for derived properties to override this. */ virtual ~wxPGProperty(); /** Sets property's internal value. \param value Simple container with GetString(), GetLong() etc. methods. Currently recommended means to extract value is to use wxPGVariantToXXX(value) macro. \remarks Example pseudo-implementation with comments: \code void wxMyProperty::DoSetValue ( wxPGVariant value ) { // A) Get value. For example const wxMyValueType* pvalue = wxPGVariantToWxObjectPtr(value,wxMyValueType); // or: const wxString& str = wxPGVariantToString(value); // or: long val = wxPGVariantToLong(value); // B) If value is wxObject or void based with NULL default, then handle that: if ( pvalue ) m_value = *pvalue; else pmyvalue->SetToDefault(); // Otherwise // m_value = *pvalue; // is sufficient. // C) If has children, this should be here (before displaying in control). RefreshChildren(); } \endcode */ virtual void DoSetValue( wxPGVariant value ); /** Returns properly constructed wxPGVariant. */ virtual wxPGVariant DoGetValue() const; /** Returns text representation of property's value. \param argFlags If wxPG_FULL_VALUE is set, returns complete, storable value instead of displayable one (they may be different). */ virtual wxString GetValueAsString( int argFlags = 0 ) const; /** Converts string to a value, and if succesfull, calls DoSetValue() on it. Default behaviour is to do nothing. \param text String to get the value from. \param report_error If true, invalid string will be reported (prefer to use wxLogError). \retval true if value was changed. */ virtual bool SetValueFromString( const wxString& text, int flags = 0 ); /** Converts integer to a value, and if succesfull, calls DoSetValue() on it. Default behaviour is to do nothing. \param value Int to get the value from. \param flags If has wxPG_FULL_VALUE, then the value given is a actual value and not an index. \retval true if value was changed. */ virtual bool SetValueFromInt( long value, int flags = 0 ); /** Returns size of the custom painted image in front of property. This method must be overridden to return non-default value if OnCustomPaint is to be called. \remarks - If flexible image size is desired, return wxPG_FLEXIBLE_SIZE(wid,hei). OnCustomPaint is then called to measure items as well (see for wxPGProperty::OnCustomPaint for measure call specs). - If entire property, including text, is to be custom painted, then wxPG_FULL_CUSTOM_PAINT_SIZE(hei) or wxPG_FULL_CUSTOM_PAINT_FLEXIBLE_SIZE(hei) is to be returned. - Default behaviour is to return wxSize(0,0), which means no image. - Default image width or height is indicated with dimension -1. */ virtual wxSize GetImageSize() const; /** Events received by editor widgets are processed here. Note that editor class usually processes most events. Some, such as button press events of TextCtrlAndButton class, should be handled here. Also, if custom handling for regular events is desired, then that can also be done (for example, wxSystemColourProperty custom handles wxEVT_COMMAND_CHOICE_SELECTED). \param event Associated wxEvent. \retval Should return true if any changes in value should be reported. This is case, for example, when enter is pressed in wxTextCtrl. */ virtual bool OnEvent( wxPropertyGrid* propgrid, wxWindow* wnd_primary, wxEvent& event ); #if wxPG_INCLUDE_WXOBJECT inline wxPG_CONST_WXCHAR_PTR GetClassName() const { return GetClassInfo()->GetClassName(); } #else /** Returns classname (for example, "wxStringProperty" for wxStringProperty) of a property class. */ virtual wxPG_CONST_WXCHAR_PTR GetClassName() const = 0; #endif /** Returns pointer to the object that has methods related to the value type of this property. Keep atleast this method abstract so the class is kept abstract. */ #ifndef __WXPYTHON__ virtual const wxPGValueType* GetValueType() const = 0; #else #ifndef SWIG virtual const wxPGValueType* GetValueType() const; #endif // Implement this in Python virtual wxString GetType() const; #endif #if !wxPG_VALUETYPE_IS_STRING const wxPGValueType* GetValueTypePtr() const { return GetValueType(); } #else const wxPGValueType* GetValueTypePtr() const; #endif #ifndef SWIG /** Returns pointer to an instance of editor class. */ virtual const wxPGEditor* DoGetEditorClass() const; #endif #ifdef __WXPYTHON__ /** Returns name of editor used. Takes precendence in the wxPython bindings. */ virtual wxString GetEditor() const; #endif #if wxUSE_VALIDATORS /** Returns pointer to the wxValidator that should be used with the editor of this property (NULL for no validator). Setting validator explicitly via SetPropertyValidator will override this. In most situations, code like this should work well (macros are used to maintain one actual validator instance, so on the second call the function exits within the first macro): \code wxValidator* wxMyPropertyClass::DoGetValidator () const { WX_PG_DOGETVALIDATOR_ENTRY() wxMyValidator* validator = new wxMyValidator(...); ... prepare validator... WX_PG_DOGETVALIDATOR_EXIT(validator) } \endcode \remarks You can get common filename validator by returning wxFilePropertyClass::GetClassValidator(). wxDirProperty, for example, uses it. */ virtual wxValidator* DoGetValidator () const; #endif // #if wxUSE_VALIDATORS /** Returns 0 for normal items. 1 for categories, -1 for other properties with children, -2 for wxCustomProperty (mostly like -1 ones but with few expections). \remarks Should not be overridden by new custom properties. Usually only used internally. */ inline signed char GetParentingType() const { return m_parentingType; } /** Returns current value's index to the choice control. May also return, through pointer arguments, strings that should be inserted to that control. Irrelevant to classes which do not employ wxPG_EDITOR(Choice) or similar. \remarks - If returns -1 in choiceinfo->m_itemCount, then in that case this class be derived from wxBaseEnumPropertyClass (see propdev.h) and GetEntry is used to fill an array (slower, but handier if you don't store your labels as arrays of strings). - Must not crash even if property's set of choices is uninitialized (i.e. it points to wxPGGlobalVars->m_emptyConstants). */ virtual int GetChoiceInfo( wxPGChoiceInfo* choiceinfo ); /** Override to paint an image in front of the property value text or drop-down list item (but only if wxPGProperty::GetImageSize is overridden as well). If property's GetImageSize() returns size that has height != 0 but less than row height ( < 0 has special meanings), wxPropertyGrid calls this method to draw a custom image in a limited area in front of the editor control or value text/graphics, and if control has drop-down list, then the image is drawn there as well (even in the case GetImageSize() returned higher height than row height). NOTE: Following applies when GetImageSize() returns a "flexible" height ( using wxPG_FLEXIBLE_SIZE(W,H) macro), which implies variable height items: If rect.x is < 0, then this is a measure item call, which means that dc is invalid and only thing that should be done is to set paintdata.m_drawnHeight to the height of the image of item at index paintdata.m_choiceItem. This call may be done even as often as once every drop-down popup show. \param dc wxDC to paint on. \param rect Box reserved for custom graphics. Includes surrounding rectangle, if any. If x is < 0, then this is a measure item call (see above). \param paintdata wxPGPaintData structure with much useful data. \remarks - You can actually exceed rect width, but if you do so then paintdata.m_drawnWidth must be set to the full width drawn in pixels. - Due to technical reasons, rect's height will be default even if custom height was reported during measure call. - Changing font and text colour affects the text drawn next to the painted image (which is done immediately after the OnCustomPaint call finishes). - Brush is guaranteed to be default background colour. It has been already used to clear the background of area being painted. It can be modified. - Pen is guaranteed to be 1-wide 'black' (or whatever is the proper colour) pen for drawing framing rectangle. It can be changed as well. \sa @link GetValueAsString @endlink */ virtual void OnCustomPaint( wxDC& dc, const wxRect& rect, wxPGPaintData& paintdata ); /** Sets an attribute of this property. This is quite property class specific, and there are no common attributes. Note that attribute may be specific to a property instance, or it may affect all properties of its class. \param id Identifier of attribute \param value Value for that attribute. */ virtual void SetAttribute( int id, wxVariant& value ); /** Adds entry to property's wxPGChoices and editor control (if it is active). Returns index of item added. */ inline int AppendChoice( const wxString& label, int value = wxPG_INVALID_VALUE ) { return InsertChoice(label,-1,value); } /** Removes entry from property's wxPGChoices and editor control (if it is active). If selected item is deleted, then the value is set to unspecified. */ void DeleteChoice( int index ); /** Returns comma-delimited string of property attributes. */ wxString GetAttributes( unsigned int flagmask = 0xFFFF ); #if !wxPG_INCLUDE_WXOBJECT /** Returns classinfo of the property class. */ virtual const wxPGPropertyClassInfo* GetClassInfo() const = 0; #endif /** Returns property's label. */ inline const wxString& GetLabel() const { return m_label; } #ifndef SWIG /** Returns wxPropertyGridState to which this property belongs. */ wxPropertyGridState* GetParentState() const; #endif /** Returns property's name (alternate way to access property). */ inline const wxString& GetName() const { return m_name; } inline void DoSetName(const wxString& str) { m_name = str; } /** If property did not have data extension, one is created now (returns true in that case). */ bool EnsureDataExt(); /** Gets pre-calculated top y coordinate of property graphics. This cannot be relied on all times (wxPropertyGrid knows when :) ), and value is -1 if property is not visible. */ inline int GetY() const { return m_y; } void UpdateControl( wxWindow* primary ); inline wxString GetDisplayedString() const { return GetValueAsString(0); } /** Returns property id. */ inline wxPGId GetId() { return wxPGIdGen(this); } /** Returns property grid where property lies. */ wxPropertyGrid* GetGrid() const; /** Returns highest level non-category, non-root parent. Useful when you have nested wxCustomProperties/wxParentProperties. \remarks Thus, if immediate parent is root or category, this will return the property itself. */ wxPGProperty* GetMainParent() const; /** Return parent of property */ inline wxPGPropertyWithChildren* GetParent() const { return m_parent; } /** Returns true if property is valid and wxPropertyGrid methods can operate on it safely. */ inline bool IsOk() const { return (( m_y >= -1 )?true:false); } typedef short FlagType; #ifndef __WXPYTHON__ typedef void* ClientDataType; #else typedef PyObject* ClientDataType; #endif inline bool IsFlagSet( FlagType flag ) const { return ( m_flags & flag ) ? true : false; } inline bool IsValueUnspecified() const { return ( m_flags & wxPG_PROP_UNSPECIFIED ) ? true : false; } bool HasFlag( FlagType flag ) const { return ( m_flags & flag ) ? true : false; } /** Initializes the property. Usually only called in the constructor. */ void Init( const wxString& label, const wxString& name ); /** Returns true if extra children can be added for this property (i.e. it is wxPropertyCategory or wxCustomProperty) */ inline bool CanHaveExtraChildren() const { return ( m_parentingType == 1 || m_parentingType == -2 ); } /** Returns property's data extension (NULL if none). */ inline wxPGPropertyDataExt* GetDataExt() { return m_dataExt; } unsigned int GetFlags() const { return (unsigned int)m_flags; } const wxPGEditor* GetEditorClass() const; #ifndef __WXPYTHON__ /** Returns type name of property that is compatible with CreatePropertyByType. and wxVariant::GetType. */ inline const wxChar* GetType() const { return GetValueTypePtr()->GetType(); } #endif /** Adds entry to property's wxPGChoices and editor control (if it is active). Returns index of item added. */ int InsertChoice( const wxString& label, int index, int value = wxPG_INVALID_VALUE ); bool IsKindOf( wxPGPropertyClassInfo& info ); /** Returns true if this is a sub-property. */ inline bool IsSubProperty() const { wxPGProperty* parent = (wxPGProperty*)m_parent; if ( parent && parent->GetParentingType() < 0 && parent->m_y > -2 ) return true; return false; } /** Returns last visible sub-property, recursively. */ const wxPGProperty* GetLastVisibleSubItem() const; inline int GetMaxLength() const { return (int) m_maxLen; } #ifdef SWIG %pythoncode { def GetValue(self): return self.GetGrid().GetPropertyValue(self) } #else /** Returns value as wxVariant. */ wxVariant GetValueAsVariant() const; #endif /** Returns true if containing grid uses wxPG_EX_AUTO_UNSPECIFIED_VALUES. */ bool UsesAutoUnspecified() const; inline wxBitmap* GetValueImage() const { if ( m_dataExt ) return m_dataExt->m_valueBitmap; return (wxBitmap*) NULL; } /** Returns number of children (always 0 for normal properties). */ size_t GetChildCount() const; inline unsigned int GetArrIndex() const { return m_arrIndex; } inline unsigned int GetDepth() const { return (unsigned int)m_depth; } /** Returns position in parent's array. */ inline unsigned int GetIndexInParent() const { return (unsigned int)m_arrIndex; } /** Hides or reveals the property. \param hide true for hide, false for reveal. */ inline bool Hide( bool hide ); inline bool IsEnabled() const { return ( m_flags & wxPG_PROP_DISABLED ) ? false : true; } /** If property's editor is created this forces its recreation. Useful in SetAttribute etc. Returns true if actually did anything. */ bool RecreateEditor(); inline void SetAttrib( int id, wxVariant value ) { SetAttribute(id,value); } /** Sets attributes from a comma-delimited string. */ void SetAttributes( const wxString& attributes ); /** Sets editor for a property. */ #ifndef SWIG inline void SetEditor( const wxPGEditor* editor ) { EnsureDataExt(); m_dataExt->m_customEditor = editor; } #endif /** Sets editor for a property. */ inline void SetEditor( const wxString& editorName ); /** Changes value of a property with choices, but only works if the value type is long or string. */ void SetChoiceSelection( int newValue, const wxPGChoiceInfo& choiceInfo ); /** Set wxBitmap in front of the value. This bitmap will be ignored if property class has implemented OnCustomPaint. */ void SetValueImage( wxBitmap& bmp ); /** If property has choices and they are not yet exclusive, new such copy of them will be created. */ void SetChoicesExclusive(); void SetFlag( FlagType flag ) { m_flags |= flag; } inline void SetHelpString( const wxString& helpString ) { EnsureDataExt(); m_dataExt->m_helpString = helpString; } inline void SetLabel( const wxString& label ) { m_label = label; } inline void SetValueToUnspecified() { m_flags |= wxPG_PROP_UNSPECIFIED; } #if wxUSE_VALIDATORS /** Sets wxValidator for a property*/ inline void SetValidator( const wxValidator& validator ) { EnsureDataExt(); m_dataExt->m_validator = wxDynamicCast(validator.Clone(),wxValidator); } /** Gets assignable version of property's validator. */ inline wxValidator* GetValidator() const { if ( m_dataExt ) return m_dataExt->m_validator; return DoGetValidator(); } #endif // #if wxUSE_VALIDATORS inline bool StdValidationProcedure( wxPGVariant value ) { DoSetValue( value ); return true; } /** Updates property value in case there were last minute changes. If value was unspecified, it will be set to default. Use only for properties that have TextCtrl-based editor. \remarks If you have code similar to \code // Update the value in case of last minute changes if ( primary && propgrid->IsEditorsValueModified() ) GetEditorClass()->CopyValueFromControl( this, primary ); \endcode in wxPGProperty::OnEvent wxEVT_COMMAND_BUTTON_CLICKED handler, then replace it with call to this method. \retval True if value changed. */ bool PrepareValueForDialogEditing( wxPropertyGrid* propgrid ); #if wxPG_USE_CLIENT_DATA inline ClientDataType GetClientData() const { return m_clientData; } /** Sets client data (void*) of a property. \remarks This untyped client data has to be deleted manually. */ inline void SetClientData( ClientDataType clientData ) { #ifdef __WXPYTHON__ if ( m_clientData ) Py_DECREF( m_clientData ); Py_INCREF( clientData ); #endif m_clientData = clientData; } #endif /** Sets new set of choices for property. */ bool SetChoices( wxPGChoices& choices ); /** Sets new set of choices for property. */ inline bool SetChoices( const wxArrayString& labels, const wxArrayInt& values = wxPG_EMPTY_ARRAYINT ); /** Set max length of text editor. */ inline bool SetMaxLength( int maxLen ); inline wxString GetHelpString() const { if (m_dataExt) return m_dataExt->m_helpString; return wxEmptyString; } void ClearFlag( FlagType flag ) { m_flags &= ~(flag); } // Use, for example, to detect if item is inside collapsed section. bool IsSomeParent( wxPGProperty* candidate_parent ) const; // Shows error as a tooltip or something similar (depends on platform). void ShowError( const wxString& msg ); #if defined(__WXPYTHON__) && !defined(SWIG) // This is the python object that contains and owns the C++ representation. PyObject* m_scriptObject; #endif #ifndef SWIG protected: // Called in constructors. void Init(); wxString m_label; wxString m_name; wxPGPropertyWithChildren* m_parent; #if wxPG_USE_CLIENT_DATA ClientDataType m_clientData; #endif wxPGPropertyDataExt* m_dataExt; // Optional data extension. unsigned int m_arrIndex; // Index in parent's property array. int m_y; // This could be short int. short m_maxLen; // Maximum length (mainly for string properties). // Could be in some sort of wxBaseStringProperty, but currently, // for maximum flexibility and compatibility, we'll stick it here. // Anyway, we had 3 excess bytes to use so short int will fit in // just fine. FlagType m_flags; // 1 = category // 0 = no children // -1 = has fixed-set of sub-properties // -2 = this is wxCustomProperty (sub-properties can be added) signed char m_parentingType; unsigned char m_depth; // Root has 0, categories etc. at that level 1, etc. // m_depthBgCol indicates width of background colour between margin and item // (essentially this is category's depth, if none then equals m_depth). unsigned char m_depthBgCol; unsigned char m_bgColIndex; // Background brush index. unsigned char m_fgColIndex; // Foreground colour index. #endif // #ifndef SWIG }; extern WXDLLIMPEXP_PG wxPGPropertyClassInfo wxBasePropertyClassInfo; // // wxPGId comparison operators. // TODO: Are these really used? // #if !defined(__WXPYTHON__) inline bool operator==(const wxPGId& id, const wxString& b) { wxASSERT(wxPGIdIsOk(id)); const wxString& a = wxPGIdToPtr(id)->GetName(); return (a.Len() == b.Len()) && (a.Cmp(b) == 0); } inline bool operator==(const wxPGId& id, const wxChar* b) { wxASSERT(wxPGIdIsOk(id)); return wxPGIdToPtr(id)->GetName().Cmp(b) == 0; } #endif // !defined(__WXPYTHON__) // For dual-pointer-usage reasons, we need to use this trickery // instead of wxObjArray. wxPGValueType hash map is declared // in propdev.h. typedef wxArrayPtrVoid wxPGArrayProperty; // Always use wxString based hashmap with unicode, stl, swig and GCC 4.0+ #if !defined(SWIG) WX_DECLARE_STRING_HASH_MAP_WITH_DECL(void*, wxPGHashMapS2P, class WXDLLIMPEXP_PG); #else class WXDLLIMPEXP_PG wxPGHashMapS2P; #endif #define wxPGPropNameStr const wxString& #define wxPGNameConv(STR) STR // ----------------------------------------------------------------------- #ifndef SWIG WX_DECLARE_VOIDPTR_HASH_MAP_WITH_DECL(void*, wxPGHashMapP2P, class WXDLLIMPEXP_PG); #else class WXDLLIMPEXP_PG wxPGHashMapP2P; #endif // #ifndef SWIG // ----------------------------------------------------------------------- /** \class wxPGPropertyWithChildren \ingroup classes \brief wxPGPropertyWithChildren, alias wxParentPropertyClass, is a base class for new properties that have sub-properties. For example, wxFontProperty and wxFlagsProperty descend from this class. */ class WXDLLIMPEXP_PG wxPGPropertyWithChildren : public wxPGProperty { #ifndef SWIG friend class wxPGProperty; friend class wxPropertyGridState; friend class wxPropertyGrid; #endif //_WX_PG_DECLARE_PROPERTY_CLASS(wxPGPropertyWithChildren) public: /** Special constructor only used in special cases. */ wxPGPropertyWithChildren(); /** When new class is derived, call this constructor. \param label Label for the property. */ wxPGPropertyWithChildren( const wxString& label, const wxString& name ); /** Destructor. */ virtual ~wxPGPropertyWithChildren(); //virtual int GetParentingType() const; /** Advanced variant of GetValueAsString() that forms a string that contains sequence of text representations of sub-properties. */ // Advanced version that gives property list and index to this item virtual wxString GetValueAsString( int argFlags = 0 ) const; /** This overridden version converts comma or semicolon separated tokens into child values. */ virtual bool SetValueFromString( const wxString& text, int flags ); /** Refresh values of child properties. */ virtual void RefreshChildren(); /** Called after child property p has been altered. The value of this parent property should now be updated accordingly. */ virtual void ChildChanged( wxPGProperty* p ); /** This is used by properties that have fixed sub-properties. */ void AddChild( wxPGProperty* prop ); /** This is used by Insert etc. */ void AddChild2( wxPGProperty* prop, int index = -1, bool correct_mode = true ); /** Returns number of sub-properties. */ inline size_t GetCount() const { return m_children.GetCount(); } /** Returns sub-property at index i. */ inline wxPGProperty* Item( size_t i ) const { return (wxPGProperty*)m_children.Item(i); } /** Returns last sub-property. */ wxPGProperty* Last() const { return (wxPGProperty*)m_children.Last(); } /** Returns index of given sub-property. */ inline int Index( const wxPGProperty* p ) const { return m_children.Index((void*)p); } /** Deletes all sub-properties. */ void Empty(); inline bool IsExpanded() const { return ( m_expanded > 0 ) ? true : false; } // Puts correct indexes to children void FixIndexesOfChildren( size_t starthere = 0 ); #ifndef SWIG // Returns wxPropertyGridState in which this property resides. wxPropertyGridState* GetParentState() const { return m_parentState; } #endif wxPGProperty* GetItemAtY( unsigned int y, unsigned int lh ); /** Returns (direct) child property with given name (or NULL if not found). */ wxPGProperty* GetPropertyByName( const wxString& name ) const; #ifndef SWIG // Call for after sub-properties added with AddChild void PrepareSubProperties(); inline void SetParentState( wxPropertyGridState* pstate ) { m_parentState = pstate; } // Call after fixed sub-properties added/removed after creation. // if oldSelInd >= 0 and < new max items, then selection is // moved to it. void SubPropsChanged( int oldSelInd = -1 ); protected: wxPropertyGridState* m_parentState; wxPGArrayProperty m_children; unsigned char m_expanded; #endif // SWIG }; extern WXDLLIMPEXP_PG wxPGPropertyClassInfo wxBaseParentPropertyClassInfo; // ----------------------------------------------------------------------- /** \class wxPGRootPropertyClass \ingroup classes \brief Root parent property. */ class WXDLLIMPEXP_PG wxPGRootPropertyClass : public wxPGPropertyWithChildren { public: WX_PG_DECLARE_PROPERTY_CLASS_NOPARENS public: /** Constructor. */ wxPGRootPropertyClass(); virtual ~wxPGRootPropertyClass(); protected: }; // ----------------------------------------------------------------------- /** \class wxPropertyCategoryClass \ingroup classes \brief Category (caption) property. */ class WXDLLIMPEXP_PG wxPropertyCategoryClass : public wxPGPropertyWithChildren { WX_PG_DECLARE_PROPERTY_CLASS_NOPARENS public: /** Special constructor only used in special cases. */ wxPropertyCategoryClass(); /** Construct. \param label Label for the category. \remarks All non-category properties appended will have most recently added category. */ wxPropertyCategoryClass( const wxString& label, const wxString& name = wxPG_LABEL ); ~wxPropertyCategoryClass(); /** Must be overridden with function that doesn't do anything. */ virtual wxString GetValueAsString( int argFlags ) const; inline int GetTextExtent() const { return m_textExtent; } void CalculateTextExtent( wxWindow* wnd, wxFont& font ); void SetTextColIndex( unsigned int colInd ) { m_capFgColIndex = (wxByte) colInd; } unsigned int GetTextColIndex() const { return (unsigned int) m_capFgColIndex; } protected: int m_textExtent; // pre-calculated length of text wxByte m_capFgColIndex; // caption text colour index }; // ----------------------------------------------------------------------- #ifndef SWIG typedef void* wxPGChoicesId; class WXDLLIMPEXP_PG wxPGChoicesData { public: // Constructor sets m_refCount to 1. wxPGChoicesData(); ~wxPGChoicesData(); wxArrayString m_arrLabels; wxArrayInt m_arrValues; // So that multiple properties can use the same set int m_refCount; }; #define wxPGChoicesEmptyData ((wxPGChoicesData*)NULL) #endif // SWIG /** \class wxPGChoices \ingroup classes \brief Helper class for managing constant (key=value) sequences. */ class WXDLLIMPEXP_PG wxPGChoices { public: /** Basic constructor. */ wxPGChoices() { Init(); } /** Copy constructor. */ wxPGChoices( wxPGChoices& a ) { wxASSERT(a.m_data); m_data = a.m_data; a.m_data->m_refCount++; } /** Constructor. */ wxPGChoices( const wxChar** labels, const long* values = NULL ) { Init(); Set(labels,values); } /** Constructor. */ wxPGChoices( const wxArrayString& labels, const wxArrayInt& values = wxPG_EMPTY_ARRAYINT ) { Init(); Set(labels,values); } /** Simple interface constructor. */ inline wxPGChoices( wxPGChoicesData* data ) { wxASSERT(data); m_data = data; data->m_refCount++; } /** Destructor. */ ~wxPGChoices() { Free (); } void AssignData( wxPGChoicesData* data ); inline void Assign( const wxPGChoices& a ) { AssignData(a.m_data); } /** Adds to current. If did not have own copies, creates them now. If was empty, identical to set except that creates copies. */ void Add( const wxChar** labels, const long* values = NULL ); /** Version that works with wxArrayString. */ void Add( const wxArrayString& arr, const long* values = NULL ); /** Version that works with wxArrayString and wxArrayInt. */ void Add( const wxArrayString& arr, const wxArrayInt& arrint ); /** Adds single item. */ void Add( const wxChar* label, int value = wxPG_INVALID_VALUE ); /** Adds single item. */ void AddAsSorted( const wxString& label, int value = wxPG_INVALID_VALUE ); inline void EnsureData() { if ( m_data == wxPGChoicesEmptyData ) m_data = new wxPGChoicesData(); } /** Returns reference to wxArrayString of labels for you to modify. */ inline wxArrayString& GetLabels() { wxASSERT( m_data->m_refCount != 0xFFFFFFF ); return m_data->m_arrLabels; } /** Returns reference to wxArrayInt of values for you to modify. */ inline wxArrayInt& GetValues() { wxASSERT( m_data->m_refCount != 0xFFFFFFF ); return m_data->m_arrValues; } /** Returns false if this is a constant empty set of choices, which should not be modified. */ bool IsOk () const { return ( m_data != wxPGChoicesEmptyData ); } /** Gets a unsigned number identifying this list. */ wxPGChoicesId GetId() const { return (wxPGChoicesId) m_data; }; /** Removes count items starting at position nIndex. */ inline void RemoveAt(size_t nIndex, size_t count = 1) { wxASSERT( m_data->m_refCount != 0xFFFFFFF ); wxPGChoicesData* data = m_data; data->m_arrLabels.RemoveAt(nIndex,count); if ( data->m_arrValues.GetCount() ) data->m_arrValues.RemoveAt(nIndex,count); } #ifndef SWIG /** Does not create copies for itself. */ void Set( const wxChar** labels, const long* values = NULL ) { Free(); Add(labels,values); } /** Version that works with wxArrayString. TODO: Deprecate this. */ void Set( wxArrayString& arr, const long* values = (const long*) NULL ) { Free(); Add(arr,values); } #endif // SWIG /** Version that works with wxArrayString and wxArrayInt. */ void Set( const wxArrayString& labels, const wxArrayInt& values = wxPG_EMPTY_ARRAYINT ) { Free(); if ( &values ) Add(labels,values); else Add(labels); } // Creates exclusive copy of current choices inline void SetExclusive() { if ( m_data->m_refCount != 1 ) { wxPGChoicesData* data = new wxPGChoicesData; data->m_arrLabels = m_data->m_arrLabels; data->m_arrValues = m_data->m_arrValues; Free(); m_data = data; } } inline const wxString& GetLabel( size_t ind ) const { return m_data->m_arrLabels[ind]; } inline const wxArrayString& GetLabels() const { return m_data->m_arrLabels; } inline size_t GetCount () const { wxASSERT_MSG( m_data, wxT("When checking if wxPGChoices is valid, use IsOk() instead of GetCount()") ); return m_data->m_arrLabels.GetCount(); } inline int GetValue( size_t ind ) const { return m_data->m_arrValues[ind]; } inline const wxArrayInt& GetValues() const { return m_data->m_arrValues; } inline int Index( const wxString& str ) const { return m_data->m_arrLabels.Index(str); } /** Inserts single item. */ #if wxCHECK_VERSION(2,9,0) void Insert( const wxString& label, int index, int value = wxPG_INVALID_VALUE ); #else void Insert( const wxChar* label, int index, int value = wxPG_INVALID_VALUE ); #endif // Returns data, increases refcount. inline wxPGChoicesData* GetData() { wxASSERT( m_data->m_refCount != 0xFFFFFFF ); m_data->m_refCount++; return m_data; } // Returns plain data ptr - no refcounting stuff is done. inline wxPGChoicesData* GetDataPtr() const { return m_data; } // Changes ownership of data to you. inline wxPGChoicesData* ExtractData() { wxPGChoicesData* data = m_data; m_data = wxPGChoicesEmptyData; return data; } inline void AddString( const wxString& str ) { m_data->m_arrLabels.Add(str); } inline void AddInt( int val ) { m_data->m_arrValues.Add(val); } inline void SetLabels( wxArrayString& arr ) { m_data->m_arrLabels = arr; } inline void SetValues( wxArrayInt& arr ) { m_data->m_arrValues = arr; } #ifndef SWIG inline void SetLabels( const wxArrayString& arr ) { m_data->m_arrLabels = arr; } inline void SetValues( const wxArrayInt& arr ) { m_data->m_arrValues = arr; } protected: wxPGChoicesData* m_data; void Init(); void Free(); #endif }; // ----------------------------------------------------------------------- // Property declaration. // Doxygen will only generate warnings here #ifndef DOXYGEN #define wxPG_CONSTFUNC(PROP) PROP #define wxPG_PROPCLASS(PROP) PROP##Class // Macro based constructor. #define wxPG_NEWPROPERTY(PROP,LABEL,NAME,VALUE) wx##PROP##Property(LABEL,NAME,VALUE) #define wxPG_DECLARE_PROPERTY_CLASSINFO(NAME) \ extern wxPGPropertyClassInfo NAME##ClassInfo; #define wxPG_DECLARE_PROPERTY_CLASSINFO_WITH_DECL(NAME,DECL) \ extern DECL wxPGPropertyClassInfo NAME##ClassInfo; #define WX_PG_DECLARE_PROPERTY_WITH_DECL(NAME,VALARG,DEFVAL,DECL) \ extern DECL wxPGProperty* wxPG_CONSTFUNC(NAME)( const wxString& label, const wxString& name = wxPG_LABEL, VALARG value = DEFVAL ); \ extern DECL wxPGPropertyClassInfo NAME##ClassInfo; #define WX_PG_DECLARE_PROPERTY(NAME,VALARG,DEFVAL) \ extern wxPGProperty* wxPG_CONSTFUNC(NAME)( const wxString& label, const wxString& name = wxPG_LABEL, VALARG value = DEFVAL ); \ wxPG_DECLARE_PROPERTY_CLASSINFO(NAME) // // Specific macro-based declarations. // #define WX_PG_DECLARE_STRING_PROPERTY_WITH_DECL(NAME,DECL) \ extern DECL wxPGProperty* wxPG_CONSTFUNC(NAME)( const wxString& label, const wxString& name= wxPG_LABEL, const wxString& value = wxEmptyString ); \ extern DECL wxPGPropertyClassInfo NAME##ClassInfo; #define WX_PG_DECLARE_STRING_PROPERTY(NAME) \ extern wxPGProperty* wxPG_CONSTFUNC(NAME)( const wxString& label, const wxString& name= wxPG_LABEL, const wxString& value = wxEmptyString ); \ wxPG_DECLARE_PROPERTY_CLASSINFO(NAME) #define WX_PG_DECLARE_CUSTOM_FLAGS_PROPERTY_WITH_DECL(NAME,DECL) \ WX_PG_DECLARE_PROPERTY_WITH_DECL(NAME,long,-1,DECL) #define WX_PG_DECLARE_CUSTOM_FLAGS_PROPERTY(NAME) \ WX_PG_DECLARE_PROPERTY(NAME,long,-1) #define WX_PG_DECLARE_CUSTOM_ENUM_PROPERTY_WITH_DECL(NAME,DECL) \ WX_PG_DECLARE_PROPERTY_WITH_DECL(NAME,int,-1,DECL) #define WX_PG_DECLARE_CUSTOM_ENUM_PROPERTY(NAME) \ WX_PG_DECLARE_PROPERTY(NAME,int,-1) #define WX_PG_DECLARE_ARRAYSTRING_PROPERTY_WITH_DECL(NAME,DECL) \ extern DECL wxPGProperty* wxPG_CONSTFUNC(NAME)( const wxString& label, const wxString& name = wxPG_LABEL, const wxArrayString& value = wxArrayString() ); \ extern DECL wxPGPropertyClassInfo NAME##ClassInfo; #define WX_PG_DECLARE_ARRAYSTRING_PROPERTY(NAME) \ extern wxPGProperty* wxPG_CONSTFUNC(NAME)( const wxString& label, const wxString& name = wxPG_LABEL, const wxArrayString& value = wxArrayString() ); \ wxPG_DECLARE_PROPERTY_CLASSINFO(NAME) // Declare basic property classes. WX_PG_DECLARE_PROPERTY_WITH_DECL(wxStringProperty,const wxString&,wxEmptyString,WXDLLIMPEXP_PG) WX_PG_DECLARE_PROPERTY_WITH_DECL(wxIntProperty,long,0,WXDLLIMPEXP_PG) WX_PG_DECLARE_PROPERTY_WITH_DECL(wxUIntProperty,unsigned long,0,WXDLLIMPEXP_PG) WX_PG_DECLARE_PROPERTY_WITH_DECL(wxFloatProperty,double,0.0,WXDLLIMPEXP_PG) WX_PG_DECLARE_PROPERTY_WITH_DECL(wxBoolProperty,bool,false,WXDLLIMPEXP_PG) WX_PG_DECLARE_PROPERTY_WITH_DECL(wxLongStringProperty,const wxString&,wxEmptyString,WXDLLIMPEXP_PG) WX_PG_DECLARE_PROPERTY_WITH_DECL(wxFileProperty,const wxString&,wxEmptyString,WXDLLIMPEXP_PG) WX_PG_DECLARE_PROPERTY_WITH_DECL(wxArrayStringProperty,const wxArrayString&,wxArrayString(),WXDLLIMPEXP_PG) WX_PG_DECLARE_STRING_PROPERTY_WITH_DECL(wxDirProperty,WXDLLIMPEXP_PG) // Enum and Flags Properties require special attention. #ifndef SWIG extern WXDLLIMPEXP_PG wxPGProperty* wxEnumProperty( const wxString& label, const wxString& name, const wxChar** labels = (const wxChar**) NULL, const long* values = NULL, int value = 0 ); extern WXDLLIMPEXP_PG wxPGProperty* wxEnumProperty( const wxString& label, const wxString& name, const wxArrayString& labels, int value = 0 ); extern WXDLLIMPEXP_PG wxPGProperty* wxEnumProperty( const wxString& label, const wxString& name, wxPGChoices& constants, int value = 0 ); extern WXDLLIMPEXP_PG wxPGProperty* wxEnumProperty( const wxString& label, const wxString& name, const wxArrayString& choices, const wxArrayInt& values, int value = 0 ); #else // Separate for SWIG inorder to have more default arguments extern WXDLLIMPEXP_PG wxPGProperty* wxEnumProperty( const wxString& label, const wxString& name = wxPG_LABEL, const wxArrayString& choices = wxArrayString(), const wxArrayInt& values = wxArrayInt(), int value = 0 ); #endif // SWIG extern WXDLLIMPEXP_PG wxPGPropertyClassInfo wxEnumPropertyClassInfo; #ifndef SWIG extern WXDLLIMPEXP_PG wxPGProperty* wxEditEnumProperty( const wxString& label, const wxString& name, const wxChar** labels = (const wxChar**) NULL, const long* values = NULL, const wxString& value = wxEmptyString ); extern WXDLLIMPEXP_PG wxPGProperty* wxEditEnumProperty( const wxString& label, const wxString& name, const wxArrayString& labels, const wxString& value = wxEmptyString ); extern WXDLLIMPEXP_PG wxPGProperty* wxEditEnumProperty( const wxString& label, const wxString& name, wxPGChoices& constants, const wxString& value = wxEmptyString ); extern WXDLLIMPEXP_PG wxPGProperty* wxEditEnumProperty( const wxString& label, const wxString& name, const wxArrayString& choices, const wxArrayInt& values, const wxString& value = wxEmptyString ); #else // Separate for SWIG inorder to have more default arguments extern WXDLLIMPEXP_PG wxPGProperty* wxEditEnumProperty( const wxString& label, const wxString& name = wxPG_LABEL, const wxArrayString& choices = wxArrayString(), const wxArrayInt& values = wxArrayInt(), const wxString& value = wxEmptyString ); #endif // SWIG extern WXDLLIMPEXP_PG wxPGPropertyClassInfo wxEditEnumPropertyClassInfo; #ifndef SWIG extern WXDLLIMPEXP_PG wxPGProperty* wxFlagsProperty( const wxString& label, const wxString& name, const wxChar** labels = (const wxChar**) NULL, const long* values = NULL, int value = 0 ); extern WXDLLIMPEXP_PG wxPGProperty* wxFlagsProperty( const wxString& label, const wxString& name, const wxArrayString& labels, int value = 0 ); extern WXDLLIMPEXP_PG wxPGProperty* wxFlagsProperty( const wxString& label, const wxString& name, wxPGChoices& constants, int value = 0 ); extern WXDLLIMPEXP_PG wxPGProperty* wxFlagsProperty( const wxString& label, const wxString& name, const wxArrayString& flag_labels, const wxArrayInt& values, int value = 0 ); #else // Separate for SWIG inorder to have more default arguments extern WXDLLIMPEXP_PG wxPGProperty* wxFlagsProperty( const wxString& label, const wxString& name = wxPG_LABEL, const wxArrayString& flag_labels = wxArrayString(), const wxArrayInt& values = wxArrayInt(), int value = 0 ); #endif // SWIG extern WXDLLIMPEXP_PG wxPGPropertyClassInfo wxFlagsPropertyClassInfo; // wxCustomProperty doesn't have value argument. extern WXDLLIMPEXP_PG wxPGProperty* wxCustomProperty( const wxString& label, const wxString& name = wxPG_LABEL ); extern WXDLLIMPEXP_PG wxPGPropertyClassInfo wxCustomPropertyClassInfo; // wxParentProperty doesn't have value argument. extern WXDLLIMPEXP_PG wxPGProperty* wxParentProperty( const wxString& label, const wxString& name ); extern WXDLLIMPEXP_PG wxPGPropertyClassInfo wxParentPropertyClassInfo; // wxPropertyCategory doesn't have value argument. extern WXDLLIMPEXP_PG wxPGProperty* wxPropertyCategory ( const wxString& label, const wxString& name = wxPG_LABEL ); extern WXDLLIMPEXP_PG wxPGPropertyClassInfo wxPropertyCategoryClassInfo; #endif // DOXYGEN #ifndef wxDynamicCastVariantData #define wxDynamicCastVariantData wxDynamicCast #endif // FIXME: Should this be out-of-inline? inline wxObject* wxPG_VariantToWxObject( wxVariant& variant, wxClassInfo* classInfo ) { if ( !variant.IsValueKindOf(classInfo) ) return (wxObject*) NULL; wxVariantData* vdata = variant.GetData(); wxPGVariantDataWxObj* vdataWxObj = wxDynamicCastVariantData(vdata, wxPGVariantDataWxObj); if ( vdataWxObj ) return (wxObject*) vdataWxObj->GetValuePtr(); return variant.GetWxObjectPtr(); } // // Redefine wxGetVariantCast to also take propertygrid variantdata // classes into account. // TODO: Remove after persistent wxObject classes added (i.e. // GetWxObjectPtr works for all). // #undef wxGetVariantCast #define wxGetVariantCast(var,classname) (classname*)wxPG_VariantToWxObject(var,&classname::ms_classInfo) // TODO: After a while, remove this. #define WX_PG_VARIANT_TO_WXOBJECT(VARIANT,CLASSNAME) (CLASSNAME*)wxPG_VariantToWxObject(VARIANT,&CLASSNAME::ms_classInfo) //#define WX_PG_VARIANT_TO_WXOBJECT(VARIANT,CLASSNAME) wxGetVariantCast(VARIANT,CLASSNAME) // ----------------------------------------------------------------------- #ifndef SWIG // We won't need this class from wxPython /** \class wxPropertyGridState \ingroup classes \brief Contains information of a single wxPropertyGrid page. */ // BM_STATE class WXDLLIMPEXP_PG wxPropertyGridState { friend class wxPGProperty; friend class wxPropertyGrid; friend class wxPropertyGridManager; public: /** Constructor. */ wxPropertyGridState(); /** Destructor. */ virtual ~wxPropertyGridState(); /** Base append. */ wxPGId Append( wxPGProperty* property ); wxPGId AppendIn( wxPGPropertyWithChildren* pwc, const wxString& label, const wxString& propname, wxVariant& value ); /** Returns property by its name. */ wxPGId BaseGetPropertyByName( wxPGPropNameStr name ) const; /** Called in, for example, wxPropertyGrid::Clear. */ void Clear(); void ClearModifiedStatus( wxPGProperty* p ); static void ClearPropertyAndChildrenFlags( wxPGProperty* p, long flags ); static void SetPropertyAndChildrenFlags( wxPGProperty* p, long flags ); bool ClearPropertyValue( wxPGProperty* p ); inline bool ClearSelection() { return DoSelectProperty(wxPGIdGen((wxPGProperty*)NULL)); } bool Collapse( wxPGProperty* p ); /** Override this member function to add custom behaviour on property deletion. */ virtual void DoDelete( wxPGProperty* item ); /** Override this member function to add custom behaviour on property insertion. */ virtual wxPGId DoInsert( wxPGPropertyWithChildren* parent, int index, wxPGProperty* property ); bool EnableCategories( bool enable ); /** Enables or disables given property and its subproperties. */ bool EnableProperty( wxPGProperty* p, bool enable ); bool Expand( wxPGProperty* p ); bool ExpandAll( unsigned char do_expand ); /** Returns id of first item, whether it is a category or property. */ inline wxPGId GetFirst() const { wxPGProperty* p = (wxPGProperty*) NULL; if ( m_properties->GetCount() ) p = m_properties->Item(0); return wxPGIdGen(p); } wxPGId GetFirstCategory() const; wxPGId GetFirstProperty() const; wxPropertyGrid* GetGrid() const { return m_pPropGrid; } wxPGId GetNextCategory( wxPGId id ) const; wxPGId GetNextProperty( wxPGId id ) const; static wxPGId GetNextSibling( wxPGId id ); static wxPGId GetPrevSibling( wxPGId id ); wxPGId GetPrevProperty( wxPGId id ) const; wxPGId GetPropertyByLabel( const wxString& name, wxPGPropertyWithChildren* parent = (wxPGPropertyWithChildren*) NULL ) const; wxVariant GetPropertyValues( const wxString& listname, wxPGId baseparent, long flags ) const; inline wxPGProperty* GetSelection() const { return m_selected; } /** Used by SetSplitterLeft. */ int GetLeftSplitterPos( wxClientDC& dc, wxPGPropertyWithChildren* pwc, bool subProps ); inline bool IsDisplayed() const; inline bool IsInNonCatMode() const { return (bool)(m_properties == m_abcArray); } /** Only inits arrays, doesn't migrate things or such. */ void InitNonCatMode (); void LimitPropertyEditing ( wxPGProperty* p, bool limit = true ); bool DoSelectProperty( wxPGProperty* p, unsigned int flags = 0 ); void SetPropertyLabel( wxPGProperty* p, const wxString& newlabel ); bool SetPropertyPriority( wxPGProperty* p, int priority ); void SetPropVal( wxPGProperty* p, const wxPGVariant& value ); bool SetPropertyValue( wxPGProperty* p, const wxPGValueType* typeclass, const wxPGVariant& value ); bool SetPropertyValue( wxPGProperty* p, const wxChar* typestring, const wxPGVariant& value ); bool SetPropertyValueString( wxPGProperty* p, const wxString& value ); bool SetPropertyValue( wxPGProperty* p, wxVariant& value ); bool SetPropertyValueWxObjectPtr( wxPGProperty* p, wxObject* value ); /** Sets value (long integer) of a property. */ inline void SetPropertyValueLong( wxPGProperty* p, long value ) { SetPropertyValue( p, wxPG_VALUETYPE(long), wxPGVariantFromLong(value) ); } /** Sets value (integer) of a property. */ inline void SetPropertyValue( wxPGProperty* p, int value ) { SetPropertyValue( p, wxPG_VALUETYPE(long), wxPGVariantFromLong((long)value) ); } /** Sets value (floating point) of a property. */ inline void SetPropertyValueDouble( wxPGProperty* p, double value ) { SetPropertyValue( p, wxPG_VALUETYPE(double), wxPGVariantFromDouble(value) ); } /** Sets value (bool) of a property. */ inline void SetPropertyValueBool( wxPGProperty* p, bool value ) { SetPropertyValue( p, wxPG_VALUETYPE(bool), wxPGVariantFromLong(value?(long)1:(long)0) ); } /** Sets value (wxArrayString) of a property. */ inline void SetPropertyValueArrstr2( wxPGProperty* p, const wxArrayString& value ) { SetPropertyValue( p, wxPG_VALUETYPE(wxArrayString), wxPGVariantFromArrayString(value) ); } /** Sets value (void*) of a property. */ inline void SetPropertyValue( wxPGProperty* p, void* value ) { SetPropertyValue( p, wxPG_VALUETYPE(void), value ); } /** Sets value (wxPoint&) of a property. */ inline void SetPropertyValuePoint( wxPGProperty* p, const wxPoint& value ) { wxASSERT(p); SetPropertyValue( p, wxT("wxPoint"), wxPGVariantCreator(value) ); } /** Sets value (wxSize&) of a property. */ inline void SetPropertyValueSize( wxPGProperty* p, const wxSize& value ) { wxASSERT(p); SetPropertyValue( p, wxT("wxSize"), wxPGVariantCreator(value) ); } /** Sets value (wxArrayInt&) of a property. */ inline void SetPropertyValueArrint2( wxPGProperty* p, const wxArrayInt& value ) { wxASSERT(p); SetPropertyValue( p, wxT("wxArrayInt"), wxPGVariantCreator(value)); } #if wxUSE_DATETIME /** Sets value (wxDateTime&) of a property. */ inline void SetPropertyValueDatetime( wxPGProperty* p, const wxDateTime& value ) { wxASSERT(p); SetPropertyValue( p, wxT("datetime"), wxPGVariantCreator(value) ); } #endif #ifdef __WXPYTHON__ inline void SetPropertyValuePyObject( wxPGProperty* p, PyObject* value ) { SetPropertyValue( p, wxPG_VALUETYPE(PyObject), wxPGVariantCreator(value) ); } #endif /** Sets value (wxLongLong&) of a property. */ inline void SetPropertyValueLongLong( wxPGProperty* p, const wxLongLong& value ) { wxASSERT(p); SetPropertyValue( p, wxT("wxLongLong"), wxPGVariantCreator(value) ); } /** Sets value (wxULongLong&) of a property. */ inline void SetPropertyValueULongLong( wxPGProperty* p, const wxULongLong& value ) { wxASSERT(p); SetPropertyValue( p, wxT("wxULongLong"), wxPGVariantCreator(value) ); } void SetPropertyValues( const wxVariantList& list, wxPGId default_category ); void SetPropertyUnspecified( wxPGProperty* p ); #ifdef wxPG_COMPATIBILITY_1_0_0 #define SetPropertyValueUnspecified SetPropertyUnspecified #endif void Sort( wxPGProperty* p ); void Sort(); protected: #ifndef DOXYGEN int PrepareToAddItem ( wxPGProperty* property, wxPGPropertyWithChildren* scheduledParent ); /** If visible, then this is pointer to wxPropertyGrid. This shall *never* be NULL to indicate that this state is not visible. */ wxPropertyGrid* m_pPropGrid; /** Pointer to currently used array. */ wxPGPropertyWithChildren* m_properties; /** Array for categoric mode. */ wxPGRootPropertyClass m_regularArray; /** Array for root of non-categoric mode. */ wxPGRootPropertyClass* m_abcArray; /** Dictionary for name-based access. */ wxPGHashMapS2P m_dictName; /** Most recently added category. */ wxPropertyCategoryClass* m_currentCategory; /** Pointer to selected property. */ wxPGProperty* m_selected; /** 1 if m_lastCaption is also the bottommost caption. */ unsigned char m_lastCaptionBottomnest; /** 1 items appended/inserted, so stuff needs to be done before drawing; If m_bottomy == 0, then calcylatey's must be done. Otherwise just sort. */ unsigned char m_itemsAdded; /** 1 if any value is modified. */ unsigned char m_anyModified; #endif // #ifndef DOXYGEN }; #endif // #ifndef SWIG inline bool wxPGProperty::SetChoices( const wxArrayString& labels, const wxArrayInt& values ) { wxPGChoices chs(labels,values); return SetChoices(chs); } // ----------------------------------------------------------------------- /* wxASSERT_MSG( wxPGIdIsOk(id), \ wxT("invalid property id") ); \ */ // Helper macro that does necessary preparations when calling // some wxPGProperty's member function. #define wxPG_PROP_ID_CALL_PROLOG() \ wxPGProperty *p = wxPGIdToPtr(id); \ wxCHECK_RET( p, wxT("invalid property id") ); #define wxPG_PROP_NAME_CALL_PROLOG() \ wxPGProperty *p = wxPGIdToPtr(GetPropertyByNameI(name)); \ if ( !p ) return; #define wxPG_PROP_ID_CALL_PROLOG_RETVAL(RVAL) \ wxPGProperty *p = wxPGIdToPtr(id); \ wxCHECK_MSG( p, RVAL, wxT("invalid property id") ); #define wxPG_PROP_NAME_CALL_PROLOG_RETVAL(RVAL) \ wxPGProperty *p = wxPGIdToPtr(GetPropertyByNameI(name)); \ if ( !p ) return RVAL; // GetPropertyName version used internally. Use GetPropertyName for slight speed advantage, // or GetPropertyNameA for nice assertion (essential for wxPython bindings). #define GetPropertyByNameI GetPropertyByNameA // FOR BACKWARDS COMPATIBILITY #define GetPropertyByNameWithAssert GetPropertyByNameA /** \class wxPropertyContainerMethods \ingroup classes \brief In order to have most same base methods, both wxPropertyGrid and wxPropertyGridManager must derive from this. */ class WXDLLIMPEXP_PG wxPropertyContainerMethods // BM_METHODS { public: /** Destructor */ virtual ~wxPropertyContainerMethods() { }; /** Adds choice to a property that can accept one. \remarks - If you need to make sure that you modify only the set of choices of a single property (and not also choices of other properties with initially identical set), call wxPropertyGrid::SetPropertyChoicesPrivate. - This usually only works for wxEnumProperty and derivatives (wxFlagsProperty can get accept new items but its items may not get updated). */ void AddPropertyChoice( wxPGId id, const wxString& label, int value = wxPG_INVALID_VALUE ); inline void AddPropertyChoice( wxPGPropNameStr name, const wxString& label, int value = wxPG_INVALID_VALUE ) { wxPG_PROP_NAME_CALL_PROLOG() AddPropertyChoice(wxPGIdGen(p),label,value); } /** Inorder to add new items into a property with fixed children (for instance, wxFlagsProperty), you need to call this method. After populating has been finished, you need to call EndAddChildren. */ void BeginAddChildren( wxPGId id ); inline void BeginAddChildren( wxPGPropNameStr name ) { wxPG_PROP_NAME_CALL_PROLOG() BeginAddChildren(wxPGIdGen(p)); } /** Called after population of property with fixed children has finished. */ void EndAddChildren( wxPGId id ); inline void EndAddChildren( wxPGPropNameStr name ) { wxPG_PROP_NAME_CALL_PROLOG() EndAddChildren(wxPGIdGen(p)); } /** Inserts choice to a property that can accept one. See AddPropertyChoice for more details. */ void InsertPropertyChoice( wxPGId id, const wxString& label, int index, int value = wxPG_INVALID_VALUE ); inline void InsertPropertyChoice( wxPGPropNameStr name, const wxString& label, int index, int value = wxPG_INVALID_VALUE ) { wxPG_PROP_NAME_CALL_PROLOG() InsertPropertyChoice(wxPGIdGen(p),label,index,value); } /** Deletes choice from a property. If selected item is deleted, then the value is set to unspecified. See AddPropertyChoice for more details. */ void DeletePropertyChoice( wxPGId id, int index ); inline void DeletePropertyChoice( wxPGPropNameStr name, int index ) { wxPG_PROP_NAME_CALL_PROLOG() DeletePropertyChoice(wxPGIdGen(p),index); } /** Constructs a property. Class used is given as the first string argument. It may be either normal property class name, such as "wxIntProperty" or a short one such as "Int". */ static wxPGProperty* CreatePropertyByClass(const wxString &classname, const wxString &label, const wxString &name); /** Constructs a property. Value type name used is given as the first string argument. It may be "string", "long", etc. Any value returned by wxVariant::GetType fits there. Otherwise, this is similar as CreatePropertyByClass. \remarks Cannot generate property category. */ static wxPGProperty* CreatePropertyByType(const wxString &valuetype, const wxString &label, const wxString &name); /** Deletes a property by id. If category is deleted, all children are automatically deleted as well. */ void Delete( wxPGId id ); /** Deletes a property by name. */ inline void Delete( wxPGPropNameStr name ) { wxPG_PROP_NAME_CALL_PROLOG() Delete( wxPGIdGen(p) ); } /** Returns id of first child of given property. \remarks Does not return sub-properties! */ inline wxPGId GetFirstChild( wxPGId id ) { wxPG_PROP_ID_CALL_PROLOG_RETVAL(wxNullProperty) wxPGPropertyWithChildren* pwc = (wxPGPropertyWithChildren*) p; if ( pwc->GetParentingType()==0 || pwc->GetParentingType()==-1 || !pwc->GetCount() ) return wxNullProperty; return wxPGIdGen(pwc->Item(0)); } inline wxPGId GetFirstChild( wxPGPropNameStr name ) { wxPG_PROP_NAME_CALL_PROLOG_RETVAL(wxNullProperty) return GetFirstChild( wxPGIdGen(p) ); } /** Returns next item under the same parent. */ inline wxPGId GetNextSibling( wxPGId id ) { return wxPropertyGridState::GetNextSibling(id); } inline wxPGId GetNextSibling( wxPGPropNameStr name ) { wxPG_PROP_NAME_CALL_PROLOG_RETVAL(wxNullProperty) return wxPropertyGridState::GetNextSibling(wxPGIdGen(p)); } /** Returns comma-delimited string with property's attributes (both pseudo-attributes such as "Disabled" and "Modified" and real attributes such as "BoolUseCheckbox" - actual names may vary). \param flagmask Combination of property flags that should be included (in addition to any other attributes). For example, to avoid adding Modified attribute use ~(wxPG_PROP_MODIFIED). \remarks Atleast in 1.2.x and earlier this does not return complete list of attributes (for example, no floating point precision) and some attributes have generic names (such as "Special1" instead of "UseCheckbox" etc) */ inline wxString GetPropertyAttributes( wxPGId id, unsigned int flagmask = 0xFFFF ) const { wxPG_PROP_ID_CALL_PROLOG_RETVAL(m_emptyString) return p->GetAttributes(flagmask); } /** Sets attributes from a string generated by GetPropertyAttributes. \remarks Performance may not be top-notch. */ inline static void SetPropertyAttributes( wxPGId id, const wxString& attributes ) { wxPG_PROP_ID_CALL_PROLOG() p->SetAttributes(attributes); } inline void SetPropertyAttributes( wxPGPropNameStr name, const wxString& attributes ) const { wxPG_PROP_NAME_CALL_PROLOG() p->SetAttributes(attributes); } /** Returns id of property with given name (case-sensitive). If there is no property with such name, returned property id is invalid ( i.e. it will return false with IsOk method). \remarks - Sub-properties (i.e. properties which have parent that is not category or root) can not be accessed globally by their name. Instead, use "." in place of "". */ wxPGId GetPropertyByName( wxPGPropNameStr name ) const; /** Returns id of a sub-property 'subname' of property 'name'. Same as calling GetPropertyByNameI(wxT("name.subname")), albeit slightly faster. */ wxPGId GetPropertyByName( wxPGPropNameStr name, wxPGPropNameStr subname ) const; /** Returns writable reference to property's list of choices (and relevant values). If property does not have any choices, will return reference to an invalid set of choices that will return false on IsOk call. */ wxPGChoices& GetPropertyChoices( wxPGId id ); wxPGChoices& GetPropertyChoices( wxPGPropNameStr name ); /** Gets name of property's constructor function. */ inline wxPG_CONST_WXCHAR_PTR GetPropertyClassName( wxPGId id ) const { wxPG_PROP_ID_CALL_PROLOG_RETVAL(wxPG_CONST_WXCHAR_DEFVAL) return p->GetClassName(); } /** Gets name of property's constructor function. */ inline wxPG_CONST_WXCHAR_PTR GetPropertyClassName( wxPGPropNameStr name ) const { wxPG_PROP_NAME_CALL_PROLOG_RETVAL(wxPG_CONST_WXCHAR_DEFVAL) return p->GetClassName(); } #if wxPG_USE_CLIENT_DATA /** Returns client data (void*) of a property. */ inline wxPGProperty::ClientDataType GetPropertyClientData( wxPGId id ) const { wxPG_PROP_ID_CALL_PROLOG_RETVAL(NULL) return p->GetClientData(); } /** Returns client data (void*) of a property. */ inline wxPGProperty::ClientDataType GetPropertyClientData( wxPGPropNameStr name ) const { wxPG_PROP_NAME_CALL_PROLOG_RETVAL(NULL) return p->GetClientData(); } #endif /** Returns property's editor. */ inline const wxPGEditor* GetPropertyEditor( wxPGId id ) const { wxPG_PROP_ID_CALL_PROLOG_RETVAL(NULL) return p->GetEditorClass(); } inline const wxPGEditor* GetPropertyEditor( wxPGPropNameStr name ) const { wxPG_PROP_NAME_CALL_PROLOG_RETVAL(NULL) return p->GetEditorClass(); } /** Returns property's custom value image (NULL of none). */ inline wxBitmap* GetPropertyImage( wxPGId id ) const { wxPG_PROP_ID_CALL_PROLOG_RETVAL(NULL) if ( p->GetDataExt() ) return p->GetDataExt()->m_valueBitmap; return (wxBitmap*) NULL; } inline wxBitmap* GetPropertyImage( wxPGPropNameStr name ) const { wxPG_PROP_NAME_CALL_PROLOG_RETVAL(NULL) return GetPropertyImage(wxPGIdGen(p)); } /** Returns property's position under its parent. */ inline unsigned int GetPropertyIndex( wxPGId id ) { wxPG_PROP_ID_CALL_PROLOG_RETVAL(INT_MAX) return p->GetIndexInParent(); } /** Returns property's position under its parent. */ inline unsigned int GetPropertyIndex( wxPGPropNameStr name ) { wxPG_PROP_NAME_CALL_PROLOG_RETVAL(INT_MAX) return p->GetIndexInParent(); } /** Returns label of a property. */ inline const wxString& GetPropertyLabel( wxPGId id ) { wxPG_PROP_ID_CALL_PROLOG_RETVAL(m_emptyString) return p->GetLabel(); } inline const wxString& GetPropertyLabel( wxPGPropNameStr name ) { wxPG_PROP_NAME_CALL_PROLOG_RETVAL(m_emptyString) return p->GetLabel(); } /** Returns name of a property. Note that obviously there is no name-version of this member function. */ inline const wxString& GetPropertyName( wxPGId id ) { wxPG_PROP_ID_CALL_PROLOG_RETVAL(m_emptyString) return p->GetName(); } /** Returns parent item of a property. */ inline wxPGId GetPropertyParent( wxPGId id ) { wxPG_PROP_ID_CALL_PROLOG_RETVAL(wxNullProperty) return p->GetParent(); } /** Returns parent item of a property. */ inline wxPGId GetPropertyParent( wxPGPropNameStr name ) { wxPG_PROP_NAME_CALL_PROLOG_RETVAL(wxNullProperty) return p->GetParent(); } /** Returns priority of a property (wxPG_HIGH or wxPG_LOW). */ inline int GetPropertyPriority( wxPGId id ) { wxPG_PROP_ID_CALL_PROLOG_RETVAL(wxPG_HIGH) if ( p && p->IsFlagSet(wxPG_PROP_HIDEABLE) ) return wxPG_LOW; return wxPG_HIGH; } /** Returns priority of a property (wxPG_HIGH or wxPG_LOW). */ inline int GetPropertyPriority( wxPGPropNameStr name ) { wxPG_PROP_NAME_CALL_PROLOG_RETVAL(wxPG_HIGH) return GetPropertyPriority(wxPGIdGen(p)); } /** Returns pointer to a property. */ inline wxPGProperty* GetPropertyPtr( wxPGId id ) const { return wxPGIdToPtr(id); } /** Returns pointer to a property. */ inline wxPGProperty* GetPropertyPtr( wxPGPropNameStr name ) const { return wxPGIdToPtr(GetPropertyByName(name)); } /** Returns help string associated with a property. */ inline wxString GetPropertyHelpString( wxPGId id ) const { wxPG_PROP_ID_CALL_PROLOG_RETVAL(m_emptyString) return p->GetHelpString(); } /** Returns help string associated with a property. */ inline wxString GetPropertyHelpString( wxPGPropNameStr name ) const { wxPG_PROP_NAME_CALL_PROLOG_RETVAL(m_emptyString) return p->GetHelpString(); } /** Returns short name for property's class. For example, "wxPropertyCategory" translates to "Category" and "wxIntProperty" to "Int". */ wxPG_PYTHON_STATIC wxString GetPropertyShortClassName( wxPGId id ); #if wxUSE_VALIDATORS /** Returns validator of a property as a reference, which you can pass to any number of SetPropertyValidator. */ inline wxValidator* GetPropertyValidator( wxPGId id ) { wxPG_PROP_ID_CALL_PROLOG_RETVAL(NULL) return p->GetValidator(); } inline wxValidator* GetPropertyValidator( wxPGPropNameStr name ) { wxPG_PROP_NAME_CALL_PROLOG_RETVAL(NULL) return p->GetValidator(); } #endif #ifndef SWIG /** Returns value as wxVariant. To get wxObject pointer from it, you will have to use WX_PG_VARIANT_TO_WXOBJECT(VARIANT,CLASSNAME) macro. If property value is unspecified, Null variant is returned. */ inline wxVariant GetPropertyValue( wxPGId id ) { wxPG_PROP_ID_CALL_PROLOG_RETVAL(wxVariant()) return p->GetValueAsVariant(); } /** Returns value as wxVariant. To get wxObject pointer from it, you will have to use WX_PG_VARIANT_TO_WXOBJECT(VARIANT,CLASSNAME) macro. If property value is unspecified, Null variant is returned. */ inline wxVariant GetPropertyValue( wxPGPropNameStr name ) { wxPG_PROP_NAME_CALL_PROLOG_RETVAL(wxVariant()) return p->GetValueAsVariant(); } #endif wxPG_PYTHON_STATIC wxString GetPropertyValueAsString( wxPGId id ) wxPG_GETVALUE_CONST; wxPG_PYTHON_STATIC long GetPropertyValueAsLong( wxPGId id ) wxPG_GETVALUE_CONST; #ifndef SWIG wxPG_PYTHON_STATIC inline int GetPropertyValueAsInt( wxPGId id ) wxPG_GETVALUE_CONST { return (int)GetPropertyValueAsLong(id); } #endif wxPG_PYTHON_STATIC bool GetPropertyValueAsBool( wxPGId id ) wxPG_GETVALUE_CONST; wxPG_PYTHON_STATIC double GetPropertyValueAsDouble( wxPGId id ) wxPG_GETVALUE_CONST; wxPG_PYTHON_STATIC const wxObject* GetPropertyValueAsWxObjectPtr( wxPGId id ) wxPG_GETVALUE_CONST; wxPG_PYTHON_STATIC void* GetPropertyValueAsVoidPtr( wxPGId id ) wxPG_GETVALUE_CONST; #define wxPG_PROP_ID_GETPROPVAL_CALL_PROLOG_RETVAL(TYPENAME, DEFVAL) \ wxPG_PROP_ID_CALL_PROLOG_RETVAL(DEFVAL) \ if ( wxStrcmp(p->GetValueTypePtr()->GetCustomTypeName(),TYPENAME) != 0 ) \ { \ wxPGGetFailed(p,TYPENAME); \ return DEFVAL; \ } #if !wxPG_PGVARIANT_IS_VARIANT wxPG_PYTHON_STATIC const wxArrayString& GetPropertyValueAsArrayString( wxPGId id ) wxPG_GETVALUE_CONST; #else wxPG_PYTHON_STATIC inline wxArrayString GetPropertyValueAsArrayString( wxPGId id ) wxPG_GETVALUE_CONST { wxPG_PROP_ID_GETPROPVAL_CALL_PROLOG_RETVAL(wxT("arrstring"), wxArrayString()) return wxPGVariantToArrayString(p->DoGetValue()); } #endif #if !wxPG_PGVARIANT_IS_VARIANT wxPG_PYTHON_STATIC inline const wxPoint& GetPropertyValueAsPoint( wxPGId id ) wxPG_GETVALUE_CONST { wxPG_PROP_ID_GETPROPVAL_CALL_PROLOG_RETVAL(wxT("wxPoint"), *((const wxPoint*)NULL)) return wxPGVariantToWxPoint(p->DoGetValue()); } #else wxPG_PYTHON_STATIC inline wxPoint GetPropertyValueAsPoint( wxPGId id ) wxPG_GETVALUE_CONST { wxPG_PROP_ID_GETPROPVAL_CALL_PROLOG_RETVAL(wxT("wxPoint"), wxPoint()) return wxPGVariantToWxPoint(p->DoGetValue()); } #endif #if !wxPG_PGVARIANT_IS_VARIANT wxPG_PYTHON_STATIC inline const wxSize& GetPropertyValueAsSize( wxPGId id ) wxPG_GETVALUE_CONST { wxPG_PROP_ID_GETPROPVAL_CALL_PROLOG_RETVAL(wxT("wxSize"), *((const wxSize*)NULL)) return wxPGVariantToWxSize(p->DoGetValue()); } #else wxPG_PYTHON_STATIC inline wxSize GetPropertyValueAsSize( wxPGId id ) wxPG_GETVALUE_CONST { wxPG_PROP_ID_GETPROPVAL_CALL_PROLOG_RETVAL(wxT("wxSize"), wxSize()) return wxPGVariantToWxSize(p->DoGetValue()); } #endif #if !wxPG_PGVARIANT_IS_VARIANT wxPG_PYTHON_STATIC inline const wxLongLong& GetPropertyValueAsLongLong( wxPGId id ) wxPG_GETVALUE_CONST { wxPG_PROP_ID_GETPROPVAL_CALL_PROLOG_RETVAL(wxT("wxLongLong"), *((const wxLongLong*)NULL)) return wxPGVariantToWxLongLong(p->DoGetValue()); } #else wxPG_PYTHON_STATIC inline wxLongLong GetPropertyValueAsLongLong( wxPGId id ) wxPG_GETVALUE_CONST { wxPG_PROP_ID_GETPROPVAL_CALL_PROLOG_RETVAL(wxT("wxLongLong"), wxLongLong()) return wxPGVariantToWxLongLong(p->DoGetValue()); } #endif #if !wxPG_PGVARIANT_IS_VARIANT wxPG_PYTHON_STATIC inline const wxULongLong& GetPropertyValueAsULongLong( wxPGId id ) wxPG_GETVALUE_CONST { wxPG_PROP_ID_GETPROPVAL_CALL_PROLOG_RETVAL(wxT("wxULongLong"), *((const wxULongLong*)NULL)) return wxPGVariantToWxULongLong(p->DoGetValue()); } #else wxPG_PYTHON_STATIC inline wxULongLong GetPropertyValueAsULongLong( wxPGId id ) wxPG_GETVALUE_CONST { wxPG_PROP_ID_GETPROPVAL_CALL_PROLOG_RETVAL(wxT("wxULongLong"), wxULongLong()) return wxPGVariantToWxULongLong(p->DoGetValue()); } #endif #if !wxPG_PGVARIANT_IS_VARIANT wxPG_PYTHON_STATIC inline const wxArrayInt& GetPropertyValueAsArrayInt( wxPGId id ) wxPG_GETVALUE_CONST { wxPG_PROP_ID_GETPROPVAL_CALL_PROLOG_RETVAL(wxT("wxArrayInt"), wxPG_EMPTY_ARRAYINT) return wxPGVariantToArrayInt(p->DoGetValue()); } #else wxPG_PYTHON_STATIC inline wxArrayInt GetPropertyValueAsArrayInt( wxPGId id ) wxPG_GETVALUE_CONST { wxPG_PROP_ID_GETPROPVAL_CALL_PROLOG_RETVAL(wxT("wxArrayInt"), wxArrayInt()) wxArrayInt arr = wxPGVariantToArrayInt(p->DoGetValue()); return arr; } #endif #if wxUSE_DATETIME wxPG_PYTHON_STATIC inline wxDateTime GetPropertyValueAsDateTime( wxPGId id ) wxPG_GETVALUE_CONST { wxPG_PROP_ID_CALL_PROLOG_RETVAL(wxDateTime()) if ( wxStrcmp(p->GetValueTypePtr()->GetCustomTypeName(),wxT("datetime")) != 0 ) { wxPGGetFailed(p,wxT("datetime")); return wxDateTime(); } return p->DoGetValue().GetDateTime(); } #endif #ifdef __WXPYTHON__ wxPG_PYTHON_STATIC PyObject* GetPropertyValueAsPyObject( wxPGId id ) wxPG_GETVALUE_CONST; #endif inline wxString GetPropertyValueAsString( wxPGPropNameStr name ) const { return GetPropertyValueAsString( GetPropertyByNameI(name) ); } inline long GetPropertyValueAsLong( wxPGPropNameStr name ) const { return GetPropertyValueAsLong( GetPropertyByNameI(name) ); } #ifndef SWIG inline int GetPropertyValueAsInt( wxPGPropNameStr name ) const { return GetPropertyValueAsInt( GetPropertyByNameI(name) ); } #endif inline bool GetPropertyValueAsBool( wxPGPropNameStr name ) const { return GetPropertyValueAsBool( GetPropertyByNameI(name) ); } inline double GetPropertyValueAsDouble( wxPGPropNameStr name ) const { return GetPropertyValueAsDouble( GetPropertyByNameI(name) ); } inline const wxObject* GetPropertyValueAsWxObjectPtr ( wxPGPropNameStr name ) const { return GetPropertyValueAsWxObjectPtr( GetPropertyByNameI(name) ); } #if !wxPG_PGVARIANT_IS_VARIANT inline const wxArrayString& GetPropertyValueAsArrayString ( wxPGPropNameStr name ) const { return GetPropertyValueAsArrayString( GetPropertyByNameI(name) ); } inline const wxPoint& GetPropertyValueAsPoint( wxPGPropNameStr name ) const { return GetPropertyValueAsPoint( GetPropertyByNameI(name) ); } inline const wxSize& GetPropertyValueAsSize( wxPGPropNameStr name ) const { return GetPropertyValueAsSize( GetPropertyByNameI(name) ); } inline const wxArrayInt& GetPropertyValueAsArrayInt( wxPGPropNameStr name ) const { return GetPropertyValueAsArrayInt( GetPropertyByNameI(name) ); } #else inline wxArrayString GetPropertyValueAsArrayString ( wxPGPropNameStr name ) const { return GetPropertyValueAsArrayString( GetPropertyByNameI(name) ); } inline wxPoint GetPropertyValueAsPoint( wxPGPropNameStr name ) const { return GetPropertyValueAsPoint( GetPropertyByNameI(name) ); } inline wxSize GetPropertyValueAsSize( wxPGPropNameStr name ) const { return GetPropertyValueAsSize( GetPropertyByNameI(name) ); } inline wxArrayInt GetPropertyValueAsArrayInt( wxPGPropNameStr name ) const { return GetPropertyValueAsArrayInt( GetPropertyByNameI(name) ); } #endif #if wxUSE_DATETIME inline wxDateTime GetPropertyValueAsDateTime( wxPGPropNameStr name ) const { return GetPropertyValueAsDateTime( GetPropertyByNameI(name) ); } #endif #ifdef __WXPYTHON__ inline PyObject* GetPropertyValueAsPyObject( wxPGPropNameStr name ) const { return GetPropertyValueAsPyObject( GetPropertyByNameI(name) ); } #endif /** Returns a wxPGValueType class instance that describes the property's data type. */ wxPG_VALUETYPE_MSGVAL GetPropertyValueType( wxPGId id ) { wxPG_PROP_ID_CALL_PROLOG_RETVAL(wxPG_VALUETYPE(none)) return p->GetValueType(); } wxPG_VALUETYPE_MSGVAL GetPropertyValueType( wxPGPropNameStr name ) { wxPG_PROP_NAME_CALL_PROLOG_RETVAL(wxPG_VALUETYPE(none)) return p->GetValueType(); } /** Returns property value type name. */ inline wxString GetPVTN( wxPGId id ) { wxPG_PROP_ID_CALL_PROLOG_RETVAL(m_emptyString) const wxPGValueType* vt = p->GetValueTypePtr(); return vt->GetCustomTypeName(); } inline wxString GetPVTN( wxPGPropNameStr name ) { wxPG_PROP_NAME_CALL_PROLOG_RETVAL(m_emptyString) const wxPGValueType* vt = p->GetValueTypePtr(); return vt->GetCustomTypeName(); } /** Returns property value type identifier. */ inline size_t GetPVTI( wxPGId id ) { wxPG_PROP_ID_CALL_PROLOG_RETVAL(0) const wxPGValueType* vt = p->GetValueTypePtr(); return size_t(vt); } inline size_t GetPVTI( wxPGPropNameStr name ) { wxPG_PROP_NAME_CALL_PROLOG_RETVAL(0) const wxPGValueType* vt = p->GetValueTypePtr(); return size_t(vt); } #ifndef SWIG inline wxPropertyGridState* GetState() const { return m_pState; } #endif /** Returns value type class instance for given type name. */ static wxPGValueType* GetValueType( const wxString &type ); #if wxPG_VALUETYPE_IS_STRING /** Return value type class instance for given value type class name. */ static wxPGValueType* GetValueTypeByName( const wxString &className ); #endif /** Hides or reveals a property. \param hide If true, hides property, otherwise reveals it. \remarks Hiding properties is not compatible with priority system. Using both at the same time will yield unpredictable results. */ bool HideProperty( wxPGId id, bool hide = true ); inline bool HideProperty( wxPGPropNameStr name ) { wxPG_PROP_NAME_CALL_PROLOG_RETVAL(false) return HideProperty(wxPGIdGen(p)); } #if wxPG_INCLUDE_ADVPROPS /** Initializes additional property editors (SpinCtrl etc.). Causes references to most object files in the library, so calling this may cause significant increase in executable size when linking with static library. */ static void RegisterAdditionalEditors(); #else static inline void RegisterAdditionalEditors() { } #endif #if wxPG_INCLUDE_ADVPROPS /** Initializes *all* property types. Causes references to most object files in the library, so calling this may cause significant increase in executable size when linking with static library. */ static void InitAllTypeHandlers(); #else static inline void InitAllTypeHandlers() { } #endif /** Returns true if property is enabled. */ inline bool IsPropertyEnabled( wxPGId id ) const { wxPG_PROP_ID_CALL_PROLOG_RETVAL(false) return (!(p->GetFlags() & wxPG_PROP_DISABLED))?true:false; } /** Returns true if property is enabled. */ inline bool IsPropertyEnabled( wxPGPropNameStr name ) { wxPG_PROP_NAME_CALL_PROLOG_RETVAL(false) return (!(p->GetFlags() & wxPG_PROP_DISABLED))?true:false; } /** Returns true if property is shown (ie. hideproperty with true not called for it). */ inline bool IsPropertyShown( wxPGId id ) const { wxPG_PROP_ID_CALL_PROLOG_RETVAL(false) return (!(p->GetFlags() & wxPG_PROP_HIDEABLE))?true:false; } /** Returns true if property is shown (ie. hideproperty with true not called for it). */ inline bool IsPropertyShown( wxPGPropNameStr name ) { wxPG_PROP_NAME_CALL_PROLOG_RETVAL(false) return (!(p->GetFlags() & wxPG_PROP_HIDEABLE))?true:false; } /** Returns true if property's value type has name typestr. */ inline bool IsPropertyValueType( wxPGId id, const wxChar* typestr ) { wxPG_PROP_ID_CALL_PROLOG_RETVAL(false) return (wxStrcmp(p->GetValueTypePtr()->GetTypeName(),typestr) == 0); } #if !wxPG_VALUETYPE_IS_STRING /** Returns true if property's value type is valuetype */ inline bool IsPropertyValueType( wxPGId id, const wxPGValueType* valuetype ) { wxPG_PROP_ID_CALL_PROLOG_RETVAL(false) return ( p->GetValueTypePtr() == valuetype ); } #endif /** Returns true if property's value type has same name as a class. */ inline bool IsPropertyValueType( wxPGId id, const wxClassInfo* classinfo ) { return IsPropertyValueType(id,classinfo->GetClassName()); } /** Returns true if property's value type has name typestr. */ inline bool IsPropertyValueType( wxPGPropNameStr name, const wxChar* typestr ) { wxPG_PROP_NAME_CALL_PROLOG_RETVAL(false) return (wxStrcmp(p->GetValueTypePtr()->GetTypeName(),typestr) == 0); } #if !wxPG_VALUETYPE_IS_STRING /** Returns true if property's value type is valuetype */ inline bool IsPropertyValueType( wxPGPropNameStr name, const wxPGValueType* valuetype ) { wxPG_PROP_NAME_CALL_PROLOG_RETVAL(false) return ( p->GetValueType() == valuetype ); } #endif /** Returns true if property's value type has same name as a class. */ inline bool IsPropertyValueType( wxPGPropNameStr name, const wxClassInfo* classinfo ) { wxPG_PROP_NAME_CALL_PROLOG_RETVAL(false) return IsPropertyValueType(wxPGIdGen(p),classinfo->GetClassName()); } /** Returns true if given property is expanded. Naturally, always returns false for properties that cannot be expanded. */ static bool IsPropertyExpanded( wxPGId id ); inline bool IsPropertyExpanded( wxPGPropNameStr name ) { wxPG_PROP_NAME_CALL_PROLOG_RETVAL(false) return IsPropertyExpanded(wxPGIdGen(p)); } /** Returns true if property is of certain type. \param info Preferably use WX_PG_CLASSINFO(PROPERTYNAME). Alternative is PROPERTYNAMEClassInfo. */ static inline bool IsPropertyKindOf( wxPGId id, wxPGPropertyClassInfo& info ) { wxPG_PROP_ID_CALL_PROLOG_RETVAL(false) return p->IsKindOf(info); } inline bool IsPropertyKindOf( wxPGPropNameStr name, wxPGPropertyClassInfo& info ) { wxPG_PROP_NAME_CALL_PROLOG_RETVAL(false) return p->IsKindOf(info); } /** Returns true if property has been modified after value set or modify flag clear by software. NOTE: Try to use IsPropertyModified instead. */ inline bool IsModified( wxPGId id ) const { return IsPropertyModified(id); } inline bool IsModified( wxPGPropNameStr name ) { return IsPropertyModified(name); } /** Returns true if property is a category. */ inline bool IsPropertyCategory( wxPGId id ) const { wxPG_PROP_ID_CALL_PROLOG_RETVAL(false) return (p->GetParentingType()>0)?true:false; } inline bool IsPropertyCategory( wxPGPropNameStr name ) { wxPG_PROP_NAME_CALL_PROLOG_RETVAL(false) return (p->GetParentingType()>0)?true:false; } /** Returns true if property has been modified after value set or modify flag clear by software. */ inline bool IsPropertyModified( wxPGId id ) const { wxPG_PROP_ID_CALL_PROLOG_RETVAL(false) return ( (p->GetFlags() & wxPG_PROP_MODIFIED) ? true : false ); } inline bool IsPropertyModified( wxPGPropNameStr name ) { wxPG_PROP_NAME_CALL_PROLOG_RETVAL(false) return ( (p->GetFlags() & wxPG_PROP_MODIFIED) ? true : false ); } /** Returns true if property value is set to unspecified. */ #ifdef wxPG_COMPATIBILITY_1_0_0 inline bool IsPropertyValueUnspecified( wxPGId id ) const #else inline bool IsPropertyUnspecified( wxPGId id ) const #endif { wxPG_PROP_ID_CALL_PROLOG_RETVAL(false) return ( (p->GetFlags() & wxPG_PROP_UNSPECIFIED) ? true : false ); } #ifdef wxPG_COMPATIBILITY_1_0_0 inline bool IsPropertyValueUnspecified( wxPGPropNameStr name ) { return IsPropertyValueUnspecified(GetPropertyByNameI(name)); } #else inline bool IsPropertyUnspecified( wxPGPropNameStr name ) { wxPG_PROP_NAME_CALL_PROLOG_RETVAL(false) return IsPropertyUnspecified(wxPGIdGen(p)); } #endif /** Basic property classes are registered by the default, but this registers advanced ones as well. */ static void RegisterAdvancedPropertyClasses(); /** Registers property class info with specific name. Preferably use wxPGRegisterPropertyClass(PROPERTYNAME) macro. */ static bool RegisterPropertyClass( const wxChar* name, wxPGPropertyClassInfo* classinfo ); /** Replaces property with id with newly created property. For example, this code replaces existing property named "Flags" with one that will have different set of items: \code pg->ReplaceProperty(wxT("Flags"), wxFlagsProperty(wxT("Flags"),wxPG_LABEL,newItems)) \endcode For more info, see wxPropertyGrid::Insert. */ wxPGId ReplaceProperty( wxPGId id, wxPGProperty* property ); inline wxPGId ReplaceProperty( wxPGPropNameStr name, wxPGProperty* property ) { wxPG_PROP_NAME_CALL_PROLOG_RETVAL(wxNullProperty) return ReplaceProperty(wxPGIdGen(p),property); } /** Lets user to set the strings listed in the choice dropdown of a wxBoolProperty. Defaults are "True" and "False", so changing them to, say, "Yes" and "No" may be useful in some less technical applications. */ static void SetBoolChoices( const wxChar* true_choice, const wxChar* false_choice ); /** Set choices of a property to specified set of labels and values. */ static inline void SetPropertyChoices(wxPGId id, wxPGChoices& choices) { wxPG_PROP_ID_CALL_PROLOG() p->SetChoices(choices); } /** Set choices of a property to specified set of labels and values. */ inline void SetPropertyChoices(wxPGPropNameStr name, wxPGChoices& choices) { wxPG_PROP_NAME_CALL_PROLOG() p->SetChoices(choices); } /** If property's set of choices is shared, then calling this method converts it to private. */ inline void SetPropertyChoicesExclusive( wxPGId id ) { wxPG_PROP_ID_CALL_PROLOG() p->SetChoicesExclusive(); } inline void SetPropertyChoicesExclusive( wxPGPropNameStr name ) { wxPG_PROP_NAME_CALL_PROLOG() p->SetChoicesExclusive(); } /** Sets an attribute of a property. Ids and relevants values are totally specific to property classes and may affect either the given instance or all instances of that class. See \ref attrids for list of built-in attributes. \param argFlags Optional. Use wxPG_RECURSE to set the attribute to child properties as well. \remarks wxVariant doesn't have int constructor (as of 2.5.4), so you will need to cast int values (including most numeral constants) to long. */ inline void SetPropertyAttribute( wxPGId id, int attrid, wxVariant value, long argFlags = 0 ) { DoSetPropertyAttribute(id,attrid,value,argFlags); } inline void SetPropertyAttribute( wxPGPropNameStr name, int attrid, wxVariant value, long argFlags = 0 ) { wxPG_PROP_NAME_CALL_PROLOG() DoSetPropertyAttribute(wxPGIdGen(p),attrid,value,argFlags); } #ifndef SWIG /** Sets editor control of a property. As editor argument, use wxPG_EDITOR(EditorName), where basic built-in editor names are TextCtrl, Choice, ComboBox, CheckBox, TextCtrlAndButton, and ChoiceAndButton. Additional editors include SpinCtrl and DatePickerCtrl, which also require wxPropertyGrid::RegisterAdditionalEditors() call prior using. */ inline void SetPropertyEditor( wxPGId id, const wxPGEditor* editor ) { wxPG_PROP_ID_CALL_PROLOG() wxCHECK_RET( editor, wxT("unknown/NULL editor") ); p->SetEditor(editor); RefreshProperty(p); } inline void SetPropertyEditor( wxPGPropNameStr name, const wxPGEditor* editor ) { wxPG_PROP_NAME_CALL_PROLOG() wxCHECK_RET( editor, wxT("unknown/NULL editor") ); p->SetEditor(editor); RefreshProperty(p); } #endif // #ifndef SWIG /** Sets editor control of a property. As editor argument, use editor name string, such as wxT("TextCtrl") or wxT("Choice"). */ inline void SetPropertyEditor( wxPGId id, const wxString& editorName ) { SetPropertyEditor(id,GetEditorByName(editorName)); } inline void SetPropertyEditor( wxPGPropNameStr name, const wxString& editorName ) { SetPropertyEditor(name,GetEditorByName(editorName)); } #if wxPG_USE_CLIENT_DATA /** Sets client data (void*) of a property. \remarks This untyped client data has to be deleted manually. */ inline void SetPropertyClientData( wxPGId id, wxPGProperty::ClientDataType clientData ) { wxPG_PROP_ID_CALL_PROLOG() p->SetClientData(clientData); } /** Sets client data (void*) of a property. \remarks This untyped client data has to be deleted manually. */ inline void SetPropertyClientData( wxPGPropNameStr name, wxPGProperty::ClientDataType clientData ) { wxPG_PROP_NAME_CALL_PROLOG() p->SetClientData(clientData); } #endif /** Associates the help string with property. \remarks By default, text is shown either in the manager's "description" text box or in the status bar. If extra window style wxPG_EX_HELP_AS_TOOLTIPS is used, then the text will appear as a tooltip. */ inline void SetPropertyHelpString( wxPGId id, const wxString& helpString ) { wxPG_PROP_ID_CALL_PROLOG() p->SetHelpString(helpString); } inline void SetPropertyHelpString( wxPGPropNameStr name, const wxString& helpString ) { wxPG_PROP_NAME_CALL_PROLOG() p->SetHelpString(helpString); } /** Set wxBitmap in front of the value. \remarks - Bitmap will be ignored if property class has implemented OnCustomPaint. - Bitmap will be scaled to a size returned by wxPropertyGrid::GetImageSize(); */ inline void SetPropertyImage( wxPGId id, wxBitmap& bmp ) { wxPG_PROP_ID_CALL_PROLOG() p->SetValueImage(bmp); RefreshProperty(p); } inline void SetPropertyImage( wxPGPropNameStr name, wxBitmap& bmp ) { wxPG_PROP_NAME_CALL_PROLOG() p->SetValueImage(bmp); RefreshProperty(p); } /** Sets max length of property's text. */ bool SetPropertyMaxLength( wxPGId id, int maxLen ); /** Sets max length of property's text. */ inline bool SetPropertyMaxLength( wxPGPropNameStr name, int maxLen ) { wxPG_PROP_NAME_CALL_PROLOG_RETVAL(false) return SetPropertyMaxLength(wxPGIdGen(p),maxLen); } /** Property is to be hidden/shown when hider button is toggled or when wxPropertyGrid::Compact is called. */ bool SetPropertyPriority( wxPGId id, int priority ); /** Property is to be hidden/shown when hider button is toggled or when wxPropertyGrid::Compact is called. */ inline bool SetPropertyPriority( wxPGPropNameStr name, int priority ) { wxPG_PROP_NAME_CALL_PROLOG_RETVAL(false) return SetPropertyPriority(wxPGIdGen(p),priority); } #if wxUSE_VALIDATORS /** Sets validator of a property. For example \code // Allow property's value range from -100 to 100 wxIntPropertyValidator validator(-100,100); wxPGId id = pg->Append( wxIntProperty(wxT("Value 1",wxPG_LABEL,0)) ); pg->SetPropertyValidator( id, validator ); \endcode */ inline void SetPropertyValidator( wxPGId id, const wxValidator& validator ) { wxPG_PROP_ID_CALL_PROLOG() p->SetValidator(validator); } inline void SetPropertyValidator( wxPGPropNameStr name, const wxValidator& validator ) { wxPG_PROP_NAME_CALL_PROLOG() p->SetValidator(validator); } #endif /** Toggles priority of a property between wxPG_HIGH and wxPG_LOW. */ inline void TogglePropertyPriority( wxPGId id ) { int priority = wxPG_LOW; if ( GetPropertyPriority(id) == wxPG_LOW ) priority = wxPG_HIGH; SetPropertyPriority(id,priority); } /** Toggles priority of a property between wxPG_HIGH and wxPG_LOW. */ inline void TogglePropertyPriority( wxPGPropNameStr name ) { wxPG_PROP_NAME_CALL_PROLOG() TogglePropertyPriority(wxPGIdGen(p)); } #ifdef SWIG %pythoncode { def MapType(class_,factory): "Registers Python type/class to property mapping.\n\nfactory: Property builder function/class." global _type2property try: mappings = _type2property except NameError: raise AssertionError("call only after a propertygrid or manager instance constructed") mappings[class_] = factory def DoDefaultTypeMappings(self): "Map built-in properties." global _type2property try: mappings = _type2property return except NameError: mappings = {} _type2property = mappings mappings[str] = StringProperty mappings[unicode] = StringProperty mappings[int] = IntProperty mappings[float] = FloatProperty mappings[bool] = BoolProperty mappings[list] = ArrayStringProperty mappings[tuple] = ArrayStringProperty mappings[wx.Font] = FontProperty mappings[wx.Colour] = ColourProperty mappings[wx.Size] = SizeProperty mappings[wx.Point] = PointProperty mappings[wx.FontData] = FontDataProperty def GetPropertyValue(self,p): "Returns Python object value for property.\n\nCaches getters on value type id basis for performance purposes." global _vt2getter vtid = self.GetPVTI(p) if not vtid: raise TypeError("Property '%s' doesn't have valid value type"%(p.GetName())) try: getter = _vt2getter[vtid] except KeyError: cls = PropertyContainerMethods vtn = self.GetPVTN(p) if vtn == 'long': getter = cls.GetPropertyValueAsLong elif vtn == 'string': getter = cls.GetPropertyValueAsString elif vtn == 'double': getter = cls.GetPropertyValueAsDouble elif vtn == 'bool': getter = cls.GetPropertyValueAsBool elif vtn == 'arrstring': getter = cls.GetPropertyValueAsArrayString elif vtn == 'wxArrayInt': getter = cls.GetPropertyValueAsArrayInt elif vtn == 'PyObject': getter = cls.GetPropertyValueAsPyObject elif vtn == 'datetime': getter = cls.GetPropertyValueAsDateTime elif vtn == 'wxPoint': getter = cls.GetPropertyValueAsPoint elif vtn == 'wxSize': getter = cls.GetPropertyValueAsSize elif vtn.startswith('wx'): getter = cls.GetPropertyValueAsWxObjectPtr elif not vtn: if p: raise ValueError("no property with name '%s'"%p) else: raise ValueError("NULL property") else: raise AssertionError("Unregistered property grid value type '%s'"%vtn) _vt2getter[vtid] = getter return getter(self,p) def SetPropertyValueArrstr(self,p,v): "NB: We must implement this in Python because SWIG has problems combining" " conversion of list to wxArrayXXX and overloaded arguments." if not isinstance(p,basestring): self._SetPropertyValueArrstr(p,v) else: self._SetPropertyValueArrstr(self.GetPropertyByNameI(p),v) def SetPropertyValueArrint(self,p,v): "NB: We must implement this in Python because SWIG has problems combining" " conversion of list to wxArrayXXX and overloaded arguments." if not isinstance(p,basestring): self._SetPropertyValueArrint(p,v) else: self._SetPropertyValueArrint(self.GetPropertyByNameI(p),v) def SetPropertyValue(self,p,v): "Set property value from Python object.\n\nCaches setters on value type id basis for performance purposes." cls = self.__class__ if not isinstance(v,basestring): _vt2setter = cls._vt2setter vtid = self.GetPVTI(p) try: setter = _vt2setter[vtid] except KeyError: vtn = self.GetPVTN(p) if vtn == 'long': setter = cls.SetPropertyValueLong elif vtn == 'string': setter = cls.SetPropertyValueString elif vtn == 'double': setter = cls.SetPropertyValueDouble elif vtn == 'bool': setter = cls.SetPropertyValueBool elif vtn == 'arrstring': setter = cls.SetPropertyValueArrstr elif vtn == 'wxArrayInt': setter = cls.SetPropertyValueArrint elif vtn == 'PyObject': setter = cls.SetPropertyValuePyObject elif vtn == 'datetime': setter = cls.SetPropertyValueDatetime elif vtn == 'wxPoint': setter = cls.SetPropertyValuePoint elif vtn == 'wxSize': setter = cls.SetPropertyValueSize elif vtn == 'wxLongLong': setter = cls.SetPropertyValueLongLong elif vtn == 'wxULongLong': setter = cls.SetPropertyValueULongLong elif vtn.startswith('wx'): setter = cls.SetPropertyValueWxObjectPtr elif not vtn: if p: raise ValueError("no property with name '%s'"%p) else: raise ValueError("NULL property") else: raise AssertionError("Unregistered property grid value type '%s'"%vtn) _vt2setter[vtid] = setter else: setter = cls.SetPropertyValueString return setter(self,p,v) def DoDefaultValueTypeMappings(self): "Map pg value type ids to getter methods." global _vt2getter try: vt2getter = _vt2getter return except NameError: vt2getter = {} _vt2getter = vt2getter def _GetValues(self,parent,fc,dict_,getter): p = fc while p: pfc = self.GetFirstChild(p) if pfc: self._GetValues(p,pfc,dict_,getter) else: dict_[p.GetName()] = getter(p) p = self.GetNextSibling(p) def GetPropertyValues(self,dict_=None,as_strings=False): "Returns values in the grid." "" "dict_: if not given, then a new one is created. dict_ can be" " object as well, in which case it's __dict__ is used." "as_strings: if True, then string representations of values" " are fetched instead of native types. Useful for config and such." "" "Return value: dictionary with values. It is always a dictionary," "so if dict_ was object with __dict__ attribute, then that attribute" "is returned." if dict_ is None: dict_ = {} elif hasattr(dict_,'__dict__'): dict_ = dict_.__dict__ if not as_strings: getter = self.GetPropertyValue else: getter = self.GetPropertyValueAsString root = self.GetRoot() self._GetValues(root,self.GetFirstChild(root),dict_,getter) return dict_ GetValues = GetPropertyValues def SetPropertyValues(self,dict_): "Sets property values from dict_, which can be either\ndictionary or an object with __dict__ attribute." "" "autofill: If true, keys with not relevant properties" " are auto-created. For more info, see AutoFill." "" "Notes:" " * Keys starting with underscore are ignored." autofill = False if dict_ is None: dict_ = {} elif hasattr(dict_,'__dict__'): dict_ = dict_.__dict__ def set_sub_obj(k0,dict_): for k,v in dict_.iteritems(): if k[0] != '_': try: self.SetPropertyValue(k,v) except: try: if autofill: self._AutoFillOne(k0,k,v) continue except: if isinstance(v,dict): set_sub_obj(k,v) elif hasattr(v,'__dict__'): set_sub_obj(k,v.__dict__) cur_page = False is_manager = isinstance(self,PropertyGridManager) try: set_sub_obj(self.GetRoot(),dict_) except: import traceback traceback.print_exc() self.Refresh() SetValues = SetPropertyValues def _AutoFillMany(self,cat,dict_): for k,v in dict_.iteritems(): self._AutoFillOne(cat,k,v) def _AutoFillOne(self,cat,k,v): global _type2property factory = _type2property.get(v.__class__,None) if factory: self.AppendIn( cat, factory(k,k,v) ) elif hasattr(v,'__dict__'): cat2 = self.AppendIn( cat, PropertyCategory(k) ) self._AutoFillMany(cat2,v.__dict__) elif isinstance(v,dict): cat2 = self.AppendIn( cat, PropertyCategory(k) ) self._AutoFillMany(cat2,v) elif not k.startswith('_'): raise AssertionError("member '%s' is of unregisted type/class '%s'"%(k,v.__class__)) def AutoFill(self,obj,parent=None): "Clears properties and re-fills to match members and\nvalues of given object or dictionary obj." self.edited_objects[parent] = obj cur_page = False is_manager = isinstance(self,PropertyGridManager) if not parent: if is_manager: page = self.GetTargetPage() self.ClearPage(page) parent = self.GetPageRoot(page) else: self.Clear() parent = self.GetRoot() else: p = self.GetFirstChild(parent) while p: self.Delete(p) p = self.GetNextSibling(p) if not is_manager or page == self.GetSelectedPage(): self.Freeze() cur_page = True try: self._AutoFillMany(parent,obj.__dict__) except: import traceback traceback.print_exc() if cur_page: self.Thaw() def RegisterEditor(self, editor, editorName=None): "Transform class into instance, if necessary." if not isinstance(editor, PGEditor): editor = editor() if not editorName: editorName = editor.__class__.__name__ try: self._editor_instances.append(editor) except: self._editor_instances = [editor] RegisterEditor(editor, editorName) } #endif /** Sets property as read-only. It's value cannot be changed by the user, but the editor may still be created for copying purposes. */ void SetPropertyReadOnly( wxPGId id, bool readOnly = true ) { wxPG_PROP_ID_CALL_PROLOG() if ( readOnly ) p->SetFlag(wxPG_PROP_READONLY); else p->ClearFlag(wxPG_PROP_READONLY); } /** Sets property as read-only. It's value cannot be changed by the user, but the editor may still be created for copying purposes. */ void SetPropertyReadOnly( wxPGPropNameStr name, bool readOnly = true ) { wxPG_PROP_NAME_CALL_PROLOG() if ( readOnly ) p->SetFlag(wxPG_PROP_READONLY); else p->ClearFlag(wxPG_PROP_READONLY); } // GetPropertyByNameI With nice assertion error message. wxPGId GetPropertyByNameA( wxPGPropNameStr name ) const; #ifndef SWIG static wxPGEditor* GetEditorByName( const wxString& editorName ); protected: // Deriving classes must set this (it must be only or current page). wxPropertyGridState* m_pState; // Default call's m_pState's BaseGetPropertyByName virtual wxPGId DoGetPropertyByName( wxPGPropNameStr name ) const; virtual void RefreshProperty( wxPGProperty* p ) = 0; // Intermediate version needed due to wxVariant copying inefficiency static void DoSetPropertyAttribute( wxPGId id, int attrid, wxVariant& value, long argFlags ); // Empty string object to return from member functions returning const wxString&. wxString m_emptyString; #endif // #ifndef SWIG }; // ----------------------------------------------------------------------- // wxPropertyGrid::DoSelectProperty flags #define wxPG_SEL_FOCUS 0x01 // Focuses to created editor #define wxPG_SEL_FORCE 0x02 // Forces deletion and recreation of editor #define wxPG_SEL_NONVISIBLE 0x04 // For example, doesn't cause EnsureVisible #define wxPG_SEL_NOVALIDATE 0x08 // Do not validate editor's value before selecting #define wxPG_SEL_DELETING 0x10 // Property being deselected is about to be deleted #define wxPG_SEL_SETUNSPEC 0x20 // Property's values was set to unspecified by the user // ----------------------------------------------------------------------- #ifndef SWIG // Internal flags #define wxPG_FL_INITIALIZED 0x0001 #define wxPG_FL_ACTIVATION_BY_CLICK 0x0002 // Set when creating editor controls if it was clicked on. #define wxPG_FL_DONT_CENTER_SPLITTER 0x0004 #define wxPG_FL_FOCUSED 0x0008 #define wxPG_FL_MOUSE_CAPTURED 0x0010 #define wxPG_FL_MOUSE_INSIDE 0x0020 #define wxPG_FL_VALUE_MODIFIED 0x0040 #define wxPG_FL_PRIMARY_FILLS_ENTIRE 0x0080 // don't clear background of m_wndPrimary #define wxPG_FL_CUR_USES_CUSTOM_IMAGE 0x0100 // currently active editor uses custom image #define wxPG_FL_HIDE_STATE 0x0200 // set when hideable properties should be hidden #define wxPG_FL_SCROLLED 0x0400 #define wxPG_FL_ADDING_HIDEABLES 0x0800 // set when all added/inserted properties get hideable flag #define wxPG_FL_NOSTATUSBARHELP 0x1000 // Disables showing help strings on statusbar. #define wxPG_FL_CREATEDSTATE 0x2000 // Marks that we created the state, so we have to destroy it too. #define wxPG_FL_SCROLLBAR_DETECTED 0x4000 // Set if scrollbar's existence was detected in last onresize. #define wxPG_FL_DESC_REFRESH_REQUIRED 0x8000 // Set if wxPGMan requires redrawing of description text box. #define wxPG_FL_SELECTED_IS_PAINT_FLEXIBLE 0x00010000 // Set if selected has flexible imagesize #define wxPG_FL_IN_MANAGER 0x00020000 // Set if contained in wxPropertyGridManager #define wxPG_FL_GOOD_SIZE_SET 0x00040000 // Set after wxPropertyGrid is shown in its initial good size #define wxPG_FL_IGNORE_NEXT_NAVKEY 0x00080000 // Next navigation key event will get ignored #define wxPG_FL_IN_SELECT_PROPERTY 0x00100000 // Set when in SelectProperty. #define wxPG_FL_STRING_IN_STATUSBAR 0x00200000 // Set when help string is shown in status bar #define wxPG_FL_SPLITTER_PRE_SET 0x00400000 // Splitter position has been custom-set by the user #define wxPG_FL_VALIDATION_FAILED 0x00800000 // Validation failed. Clear on modify event. #define wxPG_FL_SELECTED_IS_FULL_PAINT 0x01000000 // Set if selected is fully painted (ie. both image and text) #define wxPG_MAN_FL_PAGE_INSERTED 0x02000000 // Set after page has been inserted to manager #define wxPG_FL_ABNORMAL_EDITOR 0x04000000 // Active editor control is abnormally large #endif // #ifndef SWIG // ----------------------------------------------------------------------- #define wxPG_USE_STATE m_pState /** \class wxPropertyGrid \ingroup classes \brief wxPropertyGrid is a specialized two-column grid for editing properties such as strings, numbers, flagsets, fonts, and colours. wxPropertySheet used to do the very same thing, but it hasn't been updated for a while and it is currently deprecated. wxPropertyGrid is modeled after .NET propertygrid (hence the name), and thus features are similar. However, inorder to keep the widget lightweight, it does not (and will not) have toolbar for mode and page selection, nor the help text box. wxAdvancedPropertyGrid (or something similarly named) is planned to have these features in some distant future.

Derived from

wxPropertyContainerMethods\n wxScrolledWindow\n wxPanel\n wxWindow\n wxEvtHandler\n wxObject\n

Include files

Window styles

@link wndflags Additional Window Styles@endlink

Event handling

To process input from a propertygrid control, use these event handler macros to direct input to member functions that take a wxPropertyGridEvent argument.
EVT_PG_SELECTED (id, func)Property is selected.
EVT_PG_CHANGED (id, func)Property value is modified.
EVT_PG_HIGHLIGHTED (id, func)Mouse moves over property. Event's property is NULL if hovered on area that is not a property.
EVT_PG_RIGHT_CLICK (id, func)Mouse right-clicked on a property.
EVT_PG_DOUBLE_CLICK (id, func)Mouse double-clicked on a property.
EVT_PG_ITEM_COLLAPSED (id, func)User collapses a property or category.
EVT_PG_ITEM_EXPANDED (id, func)User expands a property or category.
EVT_BUTTON (id, func)Button in a property editor was clicked. Only occurs if the property doesn't handle button clicks itself.
EVT_TEXT (id, func)wxTextCtrl based editor was updated (but property value was not yet modified)
\sa @link wxPropertyGridEvent wxPropertyGridEvent@endlink \remarks - Following functions do not automatically update the screen: Append. You probably need to explicitly call Refresh() if you called one of these functions outside parent window constructor. - Use Freeze() and Thaw() respectively to disable and enable drawing. This will also delay sorting etc. miscellaneous calculations to the last possible moment. - Most methods have two versions - one which accepts property id (faster) and another that accepts property name (which is a bit slower since it does a hashmap lookup). For code examples, see the main page. */ // BM_GRID class WXDLLIMPEXP_PG wxPropertyGrid : public wxScrolledWindow, public wxPropertyContainerMethods { #ifndef SWIG friend class wxPropertyGridState; friend class wxPropertyContainerMethods; friend class wxPropertyGridManager; DECLARE_CLASS(wxPropertyGrid) #endif public: /** Two step constructor. Call Create when this constructor is called to build up the wxPropertyGrid */ #ifdef SWIG %pythonAppend wxPropertyGrid { self._setOORInfo(self) self.DoDefaultTypeMappings() self.edited_objects = {} self.DoDefaultValueTypeMappings() if not hasattr(self.__class__,'_vt2setter'): self.__class__._vt2setter = {} } %pythonAppend wxPropertyGrid() "" wxPropertyGrid( wxWindow *parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxPG_DEFAULT_STYLE, const wxChar* name = wxPyPropertyGridNameStr ); %RenameCtor(PrePropertyGrid, wxPropertyGrid()); #else wxPropertyGrid(); /** The default constructor. The styles to be used are styles valid for the wxWindow and wxScrolledWindow. \sa @link wndflags Additional Window Styles@endlink */ wxPropertyGrid( wxWindow *parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxPG_DEFAULT_STYLE, const wxChar* name = wxPropertyGridNameStr ); /** Destructor */ virtual ~wxPropertyGrid(); #endif /** Appends property to the list. wxPropertyGrid assumes ownership of the object. Becomes child of most recently added category. \remarks - wxPropertyGrid takes the ownership of the property pointer. - If appending a category with name identical to a category already in the wxPropertyGrid, then newly created category is deleted, and most recently added category (under which properties are appended) is set to the one with same name. This allows easier adding of items to same categories in multiple passes. - Does not automatically redraw the control, so you may need to call Refresh when calling this function after control has been shown for the first time. */ wxPGId Append( wxPGProperty* property ); inline wxPGId AppendCategory( const wxString& label, const wxString& name = wxPG_LABEL ) { return Append( new wxPropertyCategoryClass(label,name) ); } #ifndef SWIG #if wxPG_INCLUDE_BASICPROPS inline wxPGId Append( const wxString& label, const wxString& name = wxPG_LABEL, const wxString& value = wxEmptyString ) { return Append( wxStringProperty(label,name,value) ); } inline wxPGId Append( const wxString& label, const wxString& name = wxPG_LABEL, int value = 0 ) { return Append( wxIntProperty(label,name,value) ); } inline wxPGId Append( const wxString& label, const wxString& name = wxPG_LABEL, double value = 0.0 ) { return Append( wxFloatProperty(label,name,value) ); } inline wxPGId Append( const wxString& label, const wxString& name = wxPG_LABEL, bool value = false ) { return Append( wxBoolProperty(label,name,value) ); } #endif #endif inline wxPGId AppendIn( wxPGId id, wxPGProperty* property ) { return Insert(id,-1,property); } inline wxPGId AppendIn( wxPGPropNameStr name, wxPGProperty* property ) { return Insert(GetPropertyByNameI(name),-1,property); } inline wxPGId AppendIn( wxPGId id, const wxString& label, const wxString& propname, wxVariant& value ) { wxPG_PROP_ID_CALL_PROLOG_RETVAL(wxNullProperty) return m_pState->AppendIn( (wxPGPropertyWithChildren*)p, label, propname, value ); } inline wxPGId AppendIn( wxPGPropNameStr name, const wxString& label, const wxString& propname, wxVariant& value ) { wxPG_PROP_NAME_CALL_PROLOG_RETVAL(wxNullProperty) return m_pState->AppendIn( (wxPGPropertyWithChildren*)p, label, propname, value ); } /** This static function enables or disables automatic use of wxGetTranslation for following strings: wxEnumProperty list labels, wxFlagsProperty sub-property labels. Default is false. */ static void AutoGetTranslation( bool enable ); /** Returns true if all property grid data changes have been committed. Usually only returns false if value in active editor has been invalidated by a wxValidator. */ inline bool CanClose() { return DoEditorValidate(); } /** Returns true if all property grid data changes have been committed. Usually only returns false if value in active editor has been invalidated by a wxValidator. */ inline bool EditorValidate() { return DoEditorValidate(); } /** Centers the splitter. If argument is true, automatic splitter centering is enabled (only applicapple if style wxPG_SPLITTER_AUTO_CENTER was defined). */ void CenterSplitter( bool enable_auto_centering = false ); /** Two step creation. Whenever the control is created without any parameters, use Create to actually create it. Don't access the control's public methods before this is called \sa @link wndflags Additional Window Styles@endlink */ bool Create( wxWindow *parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxPG_DEFAULT_STYLE, const wxChar* name = wxPropertyGridNameStr ); /** Deletes all properties. Does not free memory allocated for arrays etc. This should *not* be called in wxPropertyGridManager. */ void Clear(); /** Resets modified status of a property and all sub-properties. */ inline void ClearModifiedStatus( wxPGId id ) { m_pState->ClearModifiedStatus(wxPGIdToPtr(id)); } /** Resets modified status of all properties. */ inline void ClearModifiedStatus() { m_pState->ClearModifiedStatus(m_pState->m_properties); m_pState->m_anyModified = false; } /** Resets value of a property to its default. */ bool ClearPropertyValue( wxPGId id ); /** Resets value of a property to its default. */ inline bool ClearPropertyValue( wxPGPropNameStr name ) { wxPG_PROP_NAME_CALL_PROLOG_RETVAL(false) return ClearPropertyValue( wxPGIdGen(p) ); } /** Deselect current selection, if any. Returns true if success (ie. validator did not intercept). */ bool ClearSelection(); /** Synonymous to Clear. */ inline void ClearTargetPage() { Clear(); } /** Collapses given category or property with children. Returns true if actually collapses. */ inline bool Collapse( wxPGId id ) { return _Collapse(wxPGIdToPtr(id)); } /** Collapses given category or property with children. Returns true if actually collapses. */ inline bool Collapse( wxPGPropNameStr name ) { wxPG_PROP_NAME_CALL_PROLOG_RETVAL(false) return _Collapse(p); } /** Collapses all items that can be collapsed. \retval Return false if failed (may fail if editor value cannot be validated). */ inline bool CollapseAll() { return m_pState->ExpandAll(0); } /** Shows(arg = false) or hides(arg = true) all hideable properties. */ bool Compact( bool compact ); /** Disables property. */ inline bool Disable( wxPGId id ) { return EnableProperty(id,false); } /** Disables property. */ inline bool Disable( wxPGPropNameStr name ) { return EnableProperty(name,false); } /** Disables property. */ inline bool DisableProperty( wxPGId id ) { return EnableProperty(id,false); } /** Disables property. */ inline bool DisableProperty( wxPGPropNameStr name ) { return EnableProperty(name,false); } /** Enables or disables (shows/hides) categories according to parameter enable. */ bool EnableCategories( bool enable ); /** Enables or disables property, depending on whether enable is true or false. */ bool EnableProperty( wxPGId id, bool enable = true ); /** Enables or disables property, depending on whether enable is true or false. */ inline bool EnableProperty( wxPGPropNameStr name, bool enable = true ) { wxPG_PROP_NAME_CALL_PROLOG_RETVAL(false) return EnableProperty( wxPGIdGen(p), enable ); } /** Scrolls and/or expands items to ensure that the given item is visible. Returns true if something was actually done. */ bool EnsureVisible( wxPGId id ); /** Scrolls and/or expands items to ensure that the given item is visible. Returns true if something was actually done. */ inline bool EnsureVisible( wxPGPropNameStr name ) { wxPG_PROP_NAME_CALL_PROLOG_RETVAL(false) return EnsureVisible( wxPGIdGen(p) ); } /** Expands given category or property with children. Returns true if actually expands. */ inline bool Expand( wxPGId id ) { return _Expand(wxPGIdToPtr(id)); } /** Expands given category or property with children. Returns true if actually expands. */ inline bool Expand( wxPGPropNameStr name ) { wxPG_PROP_NAME_CALL_PROLOG_RETVAL(false) return _Expand(p); } /** Expands all items that can be expanded. */ inline void ExpandAll() { m_pState->ExpandAll(1); } #ifndef SWIG /** Returns a wxVariant list containing wxVariant versions of all property values. Order is not guaranteed, but generally it should match the visible order in the grid. \param flags Use wxPG_KEEP_STRUCTURE to retain category structure; each sub category will be its own wxList of wxVariant. \remarks */ wxVariant GetPropertyValues( const wxString& listname = wxEmptyString, wxPGId baseparent = wxPGIdGen((wxPGProperty*)NULL), long flags = 0 ) const { return m_pState->GetPropertyValues(listname,baseparent,flags); } #endif inline wxFont& GetCaptionFont() { return m_captionFont; } /** Returns current category caption background colour. */ inline wxColour GetCaptionBackgroundColour() const { return m_colCapBack; } /** Returns current category caption text colour. */ inline wxColour GetCaptionForegroundColour() const { return m_colCapFore; } /** Returns current cell background colour. */ inline wxColour GetCellBackgroundColour() const { return m_colPropBack; } /** Returns current cell text colour when disabled. */ inline wxColour GetCellDisabledTextColour() const { return m_colDisPropFore; } /** Returns current cell text colour. */ inline wxColour GetCellTextColour() const { return m_colPropFore; } /** Returns number of children of the root property. */ inline size_t GetChildrenCount() { return GetChildrenCount( wxPGIdGen(m_pState->m_properties) ); } /** Returns number of children for the property. NB: Cannot be in container methods class due to name hiding. */ inline size_t GetChildrenCount( wxPGId id ) const { wxPG_PROP_ID_CALL_PROLOG_RETVAL(0) return p->GetChildCount(); } /** Returns number of children for the property. */ inline size_t GetChildrenCount( wxPGPropNameStr name ) { wxPG_PROP_NAME_CALL_PROLOG_RETVAL(0) return p->GetChildCount(); } /** Returns id of first item, whether it is a category or property. */ inline wxPGId GetFirst() const { return m_pState->GetFirst(); } /** Returns id of first visible item, whether it is a category or property. Note that visible item means category, property, or sub-property which user can see when control is scrolled properly. It does not only mean items that are actually painted on the screen. */ inline wxPGId GetFirstVisible() const { wxPGProperty* p = NULL; if ( m_pState->m_properties->GetCount() ) { p = m_pState->m_properties->Item(0); if ( (m_iFlags & wxPG_FL_HIDE_STATE) && p->m_flags & wxPG_PROP_HIDEABLE ) p = GetNeighbourItem ( p, true, 1 ); } return wxPGIdGen(p); } /** Returns height of highest characters of used font. */ int GetFontHeight() const { return m_fontHeight; } /** Returns pointer to itself. Dummy function that enables same kind of code to use wxPropertyGrid and wxPropertyGridManager. */ wxPropertyGrid* GetGrid() { return this; } /** Returns id of first category (from target page). */ inline wxPGId GetFirstCategory() const { return m_pState->GetFirstCategory(); } /** Returns id of first property that is not a category. */ inline wxPGId GetFirstProperty() { return m_pState->GetFirstProperty(); } /** Returns size of the custom paint image in front of property. If no argument is given, returns preferred size. */ wxSize GetImageSize( wxPGId id = wxPGIdGen((wxPGProperty*)NULL) ) const; /** Returns property (or category) at given y coordinate (relative to control's top left). */ wxPGId GetItemAtY( int y ) { return wxPGIdGen(DoGetItemAtY(y)); } /** Returns id of last item. Ignores categories and sub-properties. */ inline wxPGId GetLastProperty() { if ( !m_pState->m_properties->GetCount() ) return wxPGIdGen((wxPGProperty*)NULL); wxPGProperty* p = GetLastItem(false, false); if ( p->GetParentingType() > 0 ) return GetPrevProperty ( wxPGIdGen(p) ); return wxPGIdGen(p); } /** Returns id of last child of given property. \remarks Returns even sub-properties. */ inline wxPGId GetLastChild( wxPGId id ) { wxPG_PROP_ID_CALL_PROLOG_RETVAL(wxNullProperty) wxPGPropertyWithChildren* pwc = (wxPGPropertyWithChildren*) p; if ( !pwc->GetParentingType() || !pwc->GetCount() ) return wxNullProperty; return wxPGIdGen(pwc->Last()); } inline wxPGId GetLastChild( wxPGPropNameStr name ) { wxPG_PROP_NAME_CALL_PROLOG_RETVAL(wxNullProperty) return GetLastChild( wxPGIdGen(p) ); } /** Returns id of last visible item. Does not ignore categories sub-properties. */ inline wxPGId GetLastVisible() { return wxPGIdGen( GetLastItem (true, true) ); } /** Returns colour of lines between cells. */ inline wxColour GetLineColour() const { return m_colLine; } /** Returns background colour of margin. */ inline wxColour GetMarginColour() const { return m_colMargin; } /** Returns id of next property. This does not iterate to sub-properties or categories, unlike GetNextVisible. */ inline wxPGId GetNextProperty( wxPGId id ) { return m_pState->GetNextProperty(id); } /** Returns id of next category after a given property (which does not have to be category). */ inline wxPGId GetNextCategory( wxPGId id ) const { return m_pState->GetNextCategory(id); } /** Returns id of next visible item. Note that visible item means category, property, or sub-property which user can see when control is scrolled properly. It does not only mean items that are actually painted on the screen. */ inline wxPGId GetNextVisible( wxPGId property ) const { return wxPGIdGen ( GetNeighbourItem( wxPGIdToPtr(property), true, 1 ) ); } /** Returns id of previous property. Unlike GetPrevVisible, this skips categories and sub-properties. */ inline wxPGId GetPrevProperty( wxPGId id ) { return m_pState->GetPrevProperty(id); } /** Returns id of previous item under the same parent. */ inline wxPGId GetPrevSibling( wxPGId id ) { wxPG_PROP_ID_CALL_PROLOG_RETVAL(wxNullProperty) return wxPropertyGridState::GetPrevSibling(id); } inline wxPGId GetPrevSibling( wxPGPropNameStr name ) { wxPG_PROP_NAME_CALL_PROLOG_RETVAL(wxNullProperty) return wxPropertyGridState::GetPrevSibling(wxPGIdGen(p)); } /** Returns id of previous visible property. */ inline wxPGId GetPrevVisible( wxPGId id ) { wxPG_PROP_ID_CALL_PROLOG_RETVAL(wxNullProperty) return wxPGIdGen( GetNeighbourItem( wxPGIdToPtr(id), true, -1 ) ); } /** Returns id of property's nearest parent category. If no category found, returns invalid wxPGId. */ inline wxPGId GetPropertyCategory( wxPGId id ) const { return wxPGIdGen( _GetPropertyCategory ( wxPGIdToPtr(id) ) ); } inline wxPGId GetPropertyCategory( wxPGPropNameStr name ) const { wxPG_PROP_NAME_CALL_PROLOG_RETVAL(wxNullProperty) return _GetPropertyCategory(p); } /** Returns cell background colour of a property. */ wxColour GetPropertyBackgroundColour( wxPGId id ) const; inline wxColour GetPropertyBackgroundColour( wxPGPropNameStr name ) const { wxPG_PROP_NAME_CALL_PROLOG_RETVAL(wxColour()) return GetPropertyBackgroundColour(wxPGIdGen(p)); } /** Returns cell background colour of a property. */ inline wxColour GetPropertyColour( wxPGId id ) const { return GetPropertyBackgroundColour( id ); } inline wxColour GetPropertyColour( wxPGPropNameStr name ) const { return GetPropertyBackgroundColour( name ); } /** Returns cell background colour of a property. */ wxColour GetPropertyTextColour( wxPGId id ) const; inline wxColour GetPropertyTextColour( wxPGPropNameStr name ) const { wxPG_PROP_NAME_CALL_PROLOG_RETVAL(wxColour()) return GetPropertyTextColour(wxPGIdGen(p)); } /** Returns id of property with given label (case-sensitive). If there is no property with such label, returned property id is invalid ( i.e. it will return false with IsOk method). If there are multiple properties with identical name, most recent added is returned. */ inline wxPGId GetPropertyByLabel( const wxString& name ) const { return m_pState->GetPropertyByLabel(name); } /** Returns "root property". It does not have name, etc. and it is not visible. It is only useful for accessing its children. */ wxPGId GetRoot() const { return wxPGIdGen(m_pState->m_properties); } /** Returns height of a single grid row (in pixels). */ int GetRowHeight() const { return m_lineHeight; } inline wxPGId GetSelectedProperty () const { return GetSelection(); } /** Returns currently selected property. */ inline wxPGId GetSelection() const { return wxPGIdGen(m_selected); } /** Returns current selection background colour. */ inline wxColour GetSelectionBackgroundColour() const { return m_colSelBack; } /** Returns current selection text colour. */ inline wxColour GetSelectionForegroundColour() const { return m_colSelFore; } /** Returns current splitter x position. */ inline int GetSplitterPosition() const { return m_splitterx; } /** Returns a binary copy of the current property state. NOTE: Too much work to implement, and uses would be few indeed. */ //wxPropertyGridState* GetCopyOfState() const; /** Returns current vertical spacing. */ inline int GetVerticalSpacing() const { return (int)m_vspacing; } /** Returns true if a property is selected. */ inline bool HasSelection() const { return ((m_selected!=(wxPGProperty*)NULL)?true:false); } /** Hides all low priority properties. */ inline void HideLowPriority() { Compact ( true ); } /** Inserts property to the list. \param priorthis New property is inserted just prior to this. Available only in the first variant. There are two versions of this function to allow this parameter to be either an id or name to a property. \param parent New property is inserted under this category. Available only in the second variant. There are two versions of this function to allow this parameter to be either an id or name to a property. \param index Index under category. Available only in the second variant. If index is < 0, property is appended in category. \param newproperty Pointer to the inserted property. wxPropertyGrid will take ownership of this object. \return Returns id for the property, \remarks - wxPropertyGrid takes the ownership of the property pointer. While Append may be faster way to add items, make note that when both data storages (categoric and non-categoric) are active, Insert becomes even more slow. This is especially true if current mode is non-categoric. Example of use: \code // append category wxPGId my_cat_id = propertygrid->Append( new wxPropertyCategoryClass (wxT("My Category")) ); ... // insert into category - using second variant wxPGId my_item_id_1 = propertygrid->Insert( my_cat_id, 0, new wxStringProperty(wxT("My String 1")) ); // insert before to first item - using first variant wxPGId my_item_id_2 = propertygrid->Insert ( my_item_id, new wxStringProperty(wxT("My String 2")) ); \endcode */ inline wxPGId Insert( wxPGId priorthis, wxPGProperty* newproperty ) { wxPGId res = _Insert( wxPGIdToPtr( priorthis ), newproperty ); DrawItems( newproperty, (wxPGProperty*) NULL ); return res; } /** @link wxPropertyGrid::Insert Insert @endlink */ inline wxPGId Insert( wxPGPropNameStr name, wxPGProperty* newproperty ) { wxPG_PROP_NAME_CALL_PROLOG_RETVAL(wxNullProperty) wxPGId res = _Insert( (wxPGPropertyWithChildren*)p, newproperty ); DrawItems( newproperty, (wxPGProperty*) NULL ); return res; } /** @link wxPropertyGrid::Insert Insert @endlink */ inline wxPGId Insert( wxPGId id, int index, wxPGProperty* newproperty ) { wxPGId res = _Insert( (wxPGPropertyWithChildren*)wxPGIdToPtr (id), index, newproperty ); DrawItems( newproperty, (wxPGProperty*) NULL ); return res; } /** @link wxPropertyGrid::Insert Insert @endlink */ inline wxPGId Insert( wxPGPropNameStr name, int index, wxPGProperty* newproperty ) { wxPG_PROP_NAME_CALL_PROLOG_RETVAL(wxNullProperty) wxPGId res = _Insert( (wxPGPropertyWithChildren*)p, index, newproperty ); DrawItems( newproperty, (wxPGProperty*) NULL ); return res; } inline wxPGId InsertCategory( wxPGId id, int index, const wxString& label, const wxString& name = wxPG_LABEL ) { return Insert( id, index, new wxPropertyCategoryClass(label,name) ); } #if wxPG_INCLUDE_BASICPROPS /** @link wxPropertyGrid::Insert Insert @endlink */ inline wxPGId Insert( wxPGId id, int index, const wxString& label, const wxString& name, const wxString& value = wxEmptyString ) { return Insert( id, index, wxStringProperty(label,name,value) ); } /** @link wxPropertyGrid::Insert Insert @endlink */ inline wxPGId Insert( wxPGId id, int index, const wxString& label, const wxString& name, int value ) { return Insert( id, index, wxIntProperty(label,name,value) ); } /** @link wxPropertyGrid::Insert Insert @endlink */ inline wxPGId Insert( wxPGId id, int index, const wxString& label, const wxString& name, double value ) { return Insert( id, index, wxFloatProperty(label,name,value) ); } /** @link wxPropertyGrid::Insert Insert @endlink */ inline wxPGId Insert( wxPGId id, int index, const wxString& label, const wxString& name, bool value ) { return Insert( id, index, wxBoolProperty(label,name,value) ); } #endif /** Returns true if any property has been modified by the user. */ inline bool IsAnyModified() const { return (m_pState->m_anyModified>0); } /** Returns true if updating is frozen (ie. Freeze() called but not yet Thaw() ). */ inline bool IsFrozen() const { return (m_frozen>0)?true:false; } /** Returns true if given property is selected. */ inline bool IsPropertySelected( wxPGId id ) const { wxPG_PROP_ID_CALL_PROLOG_RETVAL(false) return ( m_selected == p ) ? true : false; } /** Returns true if given property is selected. */ inline bool IsPropertySelected( wxPGPropNameStr name ) { wxPG_PROP_NAME_CALL_PROLOG_RETVAL(false) return ( m_selected == p ) ? true : false; } /** Disables (limit = true) or enables (limit = false) wxTextCtrl editor of a property, if it is not the sole mean to edit the value. */ void LimitPropertyEditing( wxPGId id, bool limit = true ); /** Disables (limit = true) or enables (limit = false) wxTextCtrl editor of a property, if it is not the sole mean to edit the value. */ inline void LimitPropertyEditing( wxPGPropNameStr name, bool limit = true ) { wxPG_PROP_NAME_CALL_PROLOG() LimitPropertyEditing(wxPGIdGen(p),limit); } /** Moves splitter as left as possible, while still allowing all labels to be shown in full. \param subProps If false, will still allow sub-properties (ie. properties which parent is not root or category) to be cropped. */ void SetSplitterLeft( bool subProps = false ); /** Registers a new value type. Takes ownership of the object. \retval Pointer to the value type that should be used. If on with the same name already existed, then the first one will be used, and its pointer is returned instead. */ static wxPGValueType* RegisterValueType( wxPGValueType* valueclass, bool noDefCheck = false, const wxString& className = wxEmptyString ); #ifndef SWIG /** Registers a new editor class. \retval Pointer to the editor class instance that should be used. */ static wxPGEditor* RegisterEditorClass( wxPGEditor* editor, const wxString& name, bool noDefCheck = false ); #endif /** Resets all colours to the original system values. */ void ResetColours(); /** Changes keyboard shortcut to push the editor button. \remarks You can set default with keycode 0. Good value for the platform is guessed, but don't expect it to be very accurate. */ void SetButtonShortcut( int keycode, bool ctrlDown = false, bool altDown = false ); /** Sets text colour of a category caption (but not it's children). */ void SetCaptionTextColour( wxPGId id, const wxColour& col ); inline void SetCaptionTextColour( wxPGPropNameStr name, const wxColour& col ) { wxPG_PROP_NAME_CALL_PROLOG() SetCaptionTextColour( wxPGIdGen(p), col ); } /** Sets the current category - Append will add non-categories under this one. */ inline void SetCurrentCategory( wxPGId id ) { wxPG_PROP_ID_CALL_PROLOG() wxPropertyCategoryClass* pc = (wxPropertyCategoryClass*)p; #ifdef __WXDEBUG__ if ( pc ) wxASSERT( pc->GetParentingType() > 0 ); #endif m_pState->m_currentCategory = pc; } /** Sets the current category - Append will add non-categories under this one. */ inline void SetCurrentCategory( wxPGPropNameStr name = wxEmptyString ) { wxPG_PROP_NAME_CALL_PROLOG() SetCurrentCategory(wxPGIdGen(p)); } /** Sets property attribute for all applicapple properties. Be sure to use this method after all properties have been added to the grid. */ void SetPropertyAttributeAll( int attrid, wxVariant value ); /** Sets background colour of property and all its children, recursively. Colours of captions are not affected. Background brush cache is optimized for often set colours to be set last. \remarks * Children which already have custom background colour are not affected. */ void SetPropertyBackgroundColour( wxPGId id, const wxColour& col ); inline void SetPropertyBackgroundColour( wxPGPropNameStr name, const wxColour& col ) { wxPG_PROP_NAME_CALL_PROLOG() SetPropertyBackgroundColour( wxPGIdGen(p), col ); } /** Sets background colour of property and all its children. Colours of captions are not affected. Background brush cache is optimized for often set colours to be set last. NOTE: This function is deprecated. Use SetPropertyBackgroundColour. */ inline void SetPropertyColour( wxPGId id, const wxColour& col ) { SetPropertyBackgroundColour( id, col ); } inline void SetPropertyColour( wxPGPropNameStr name, const wxColour& col ) { SetPropertyBackgroundColour( name, col ); } /** Sets text colour of property and all its children. \remarks * Children which already have custom text colour are not affected. */ void SetPropertyTextColour( wxPGId id, const wxColour& col ); inline void SetPropertyTextColour( wxPGPropNameStr name, const wxColour& col ) { wxPG_PROP_NAME_CALL_PROLOG() SetPropertyTextColour( wxPGIdGen(p), col ); } /** Sets background and text colour of property and all its children to the default. */ void SetPropertyColourToDefault( wxPGId id ); inline void SetPropertyColourToDefault( wxPGPropNameStr name ) { wxPG_PROP_NAME_CALL_PROLOG() SetPropertyColourToDefault( wxPGIdGen(p) ); } /** Sets category caption background colour. */ void SetCaptionBackgroundColour(const wxColour& col); /** Sets category caption text colour. */ void SetCaptionForegroundColour(const wxColour& col); /** Sets default cell background colour - applies to property cells. Note that appearance of editor widgets may not be affected. */ void SetCellBackgroundColour(const wxColour& col); /** Sets cell text colour for disabled properties. */ void SetCellDisabledTextColour(const wxColour& col); /** Sets default cell text colour - applies to property name and value text. Note that appearance of editor widgets may not be affected. */ void SetCellTextColour(const wxColour& col); /** Sets colour of lines between cells. */ void SetLineColour(const wxColour& col); /** Sets background colour of margin. */ void SetMarginColour(const wxColour& col); /** Sets selection background colour - applies to selected property name background. */ void SetSelectionBackground(const wxColour& col); /** Sets selection foreground colour - applies to selected property name text. */ void SetSelectionForeground(const wxColour& col); /** Sets x coordinate of the splitter. */ inline void SetSplitterPosition( int newxpos, bool refresh = true ) { DoSetSplitterPosition(newxpos,refresh); m_iFlags |= wxPG_FL_SPLITTER_PRE_SET; } /** Selects a property. Editor widget is automatically created, but not focused unless focus is true. This will generate wxEVT_PG_SELECT event. \param id Id to property to select. \retval True if selection finished succesfully. Usually only fails if current value in editor is not valid. \sa wxPropertyGrid::Unselect */ inline bool SelectProperty( wxPGId id, bool focus = false ) { return DoSelectProperty(wxPGIdToPtr(id),focus?wxPG_SEL_FOCUS:0); } inline bool SelectProperty( wxPGPropNameStr name, bool focus = false ) { wxPG_PROP_NAME_CALL_PROLOG_RETVAL(false) return DoSelectProperty(p,focus?wxPG_SEL_FOCUS:0); } /** Mostly useful for page switching. */ #ifndef SWIG void SwitchState( wxPropertyGridState* pNewState ); #endif /** Sets label of a property. \remarks This is the only way to set property's name. There is not wxPGProperty::SetLabel() method. */ inline void SetPropertyLabel( wxPGId id, const wxString& newproplabel ) { wxPG_PROP_ID_CALL_PROLOG() _SetPropertyLabel( p, newproplabel ); } /** Sets label of a property. \remarks This is the only way to set property's label. There is no wxPGProperty::SetLabel() method. */ inline void SetPropertyLabel( wxPGPropNameStr name, const wxString& newproplabel ) { wxPG_PROP_NAME_CALL_PROLOG() _SetPropertyLabel( p, newproplabel ); } /** Sets name of a property. \param id Id of a property. \param newname New name. \remarks This is the only way to set property's name. There is not wxPGProperty::SetName() method. */ inline void SetPropertyName( wxPGId id, const wxString& newname ) { DoSetPropertyName( wxPGIdToPtr(id), newname ); } /** Sets name of a property. \param name Label of a property. \param newname New name. \remarks This is the only way to set property's name. There is not wxPGProperty::SetName() method. */ inline void SetPropertyName( wxPGPropNameStr name, const wxString& newname ) { wxPG_PROP_NAME_CALL_PROLOG() DoSetPropertyName( p, newname ); } /** Sets value (long integer) of a property. */ inline void SetPropertyValueLong( wxPGId id, long value ) { SetPropertyValue( id, wxPG_VALUETYPE(long), wxPGVariantFromLong(value) ); } #ifndef __WXPYTHON__ /** Sets value (integer) of a property. */ inline void SetPropertyValue( wxPGId id, int value ) { SetPropertyValue( id, wxPG_VALUETYPE(long), wxPGVariantFromLong((long)value) ); } #endif /** Sets value (floating point) of a property. */ inline void SetPropertyValueDouble( wxPGId id, double value ) { SetPropertyValue( id, wxPG_VALUETYPE(double), wxPGVariantFromDouble(value) ); } /** Sets value (bool) of a property. */ inline void SetPropertyValueBool( wxPGId id, bool value ) { SetPropertyValue( id, wxPG_VALUETYPE(bool), wxPGVariantFromLong(value?(long)1:(long)0) ); } /** Sets value (wxString) of a property. \remarks This method uses wxPGProperty::SetValueFromString, which all properties should implement. This means that there should not be a type error, and instead the string is converted to property's actual value type. */ void SetPropertyValueString( wxPGId id, const wxString& value ); #ifndef __WXPYTHON__ inline void SetPropertyValue( wxPGId id, const wxChar* value ) { SetPropertyValue(id,wxString(value)); } #endif /** Sets value (wxArrayString) of a property. */ inline void SetPropertyValueArrstr2( wxPGId id, const wxArrayString& value ) { SetPropertyValue( id, wxPG_VALUETYPE(wxArrayString), wxPGVariantFromArrayString(value) ); } /** Sets value (wxObject*) of a property. */ void SetPropertyValueWxObjectPtr( wxPGId id, wxObject* value ); #ifndef __WXPYTHON__ /** Sets value (void*) of a property. */ inline void SetPropertyValue( wxPGId id, void* value ) { SetPropertyValue( id, wxPG_VALUETYPE(void), value ); } inline void SetPropertyValue ( wxPGId id, wxObject& value ) { SetPropertyValue(id,&value); } /** Sets value (wxVariant&) of a property. */ void SetPropertyValue( wxPGId id, wxVariant& value ); #endif /** Sets value (wxPoint&) of a property. */ inline void SetPropertyValuePoint( wxPGId id, const wxPoint& value ) { SetPropertyValue( id, wxT("wxPoint"), wxPGVariantCreator(value) ); } /** Sets value (wxSize&) of a property. */ inline void SetPropertyValueSize( wxPGId id, const wxSize& value ) { SetPropertyValue( id, wxT("wxSize"), wxPGVariantCreator(value) ); } /** Sets value (wxLongLong&) of a property. */ inline void SetPropertyValueLongLong( wxPGId id, const wxLongLong& value ) { SetPropertyValue( id, wxT("wxLongLong"), wxPGVariantCreator(value) ); } /** Sets value (wxULongLong&) of a property. */ inline void SetPropertyValueULongLong( wxPGId id, const wxULongLong& value ) { SetPropertyValue( id, wxT("wxULongLong"), wxPGVariantCreator(value) ); } /** Sets value (wxArrayInt&) of a property. */ inline void SetPropertyValueArrint2( wxPGId id, const wxArrayInt& value ) { SetPropertyValue( id, wxT("wxArrayInt"), wxPGVariantCreator(value) ); } /** Sets value (wxDateTime&) of a property. */ #if wxUSE_DATETIME inline void SetPropertyValueDatetime( wxPGId id, const wxDateTime& value ) { SetPropertyValue( id, wxT("datetime"), value ); } #endif #ifdef __WXPYTHON__ inline void SetPropertyValuePyObject( wxPGId id, PyObject* value ) { SetPropertyValue( id, wxT("PyObject"), wxPGVariantCreator(value) ); } #endif /** Sets value (long integer) of a property. */ inline void SetPropertyValueLong( wxPGPropNameStr name, long value ) { wxPG_PROP_NAME_CALL_PROLOG() SetPropertyValue( wxPGIdGen(p), wxPG_VALUETYPE(long), wxPGVariantFromLong(value) ); } #ifndef __WXPYTHON__ /** Sets value (integer) of a property. */ inline void SetPropertyValue( wxPGPropNameStr name, int value ) { wxPG_PROP_NAME_CALL_PROLOG() SetPropertyValue( wxPGIdGen(p), wxPG_VALUETYPE(long), wxPGVariantFromLong(value) ); } #endif /** Sets value (floating point) of a property. */ inline void SetPropertyValueDouble( wxPGPropNameStr name, double value ) { wxPG_PROP_NAME_CALL_PROLOG() SetPropertyValue( wxPGIdGen(p), wxPG_VALUETYPE(double), wxPGVariantFromDouble(value) ); } /** Sets value (bool) of a property. */ inline void SetPropertyValueBool( wxPGPropNameStr name, bool value ) { wxPG_PROP_NAME_CALL_PROLOG() SetPropertyValue( wxPGIdGen(p), wxPG_VALUETYPE(bool), wxPGVariantFromLong(value?(long)1:(long)0) ); } /** Sets value (wxString) of a property. For properties which value type is not string, calls wxPGProperty::SetValueFromString to translate the value. */ inline void SetPropertyValueString( wxPGPropNameStr name, const wxString& value ) { wxPG_PROP_NAME_CALL_PROLOG() SetPropertyValueString( wxPGIdGen(p), value ); } #ifndef __WXPYTHON__ /** Sets value (wxString) of a property. For properties which value type is not string, calls wxPGProperty::SetValueFromString to translate the value. */ inline void SetPropertyValue( wxPGPropNameStr name, const wxChar* value ) { wxPG_PROP_NAME_CALL_PROLOG() SetPropertyValue( wxPGIdGen(p), wxString(value) ); } /** Sets value (void*) of a property. */ inline void SetPropertyValue( wxPGPropNameStr name, void* value ) { wxPG_PROP_NAME_CALL_PROLOG() SetPropertyValue( wxPGIdGen(p), wxPG_VALUETYPE(void), value ); } #endif /** Sets value (wxObject*) of a property. */ inline void SetPropertyValueWxObjectPtr( wxPGPropNameStr name, wxObject* value ) { wxPG_PROP_NAME_CALL_PROLOG() SetPropertyValueWxObjectPtr( wxPGIdGen(p), value ); } #ifndef __WXPYTHON__ inline void SetPropertyValue( wxPGPropNameStr name, wxObject& value ) { SetPropertyValue(name,&value); } /** Sets value (wxVariant&) of a property. */ void SetPropertyValue( wxPGPropNameStr name, wxVariant& value ) { wxPG_PROP_NAME_CALL_PROLOG() SetPropertyValue( wxPGIdGen(p), value ); } /** Sets value (wxArrayString) of a property. */ inline void SetPropertyValueArrstr2( wxPGPropNameStr name, const wxArrayString& value ) { wxPG_PROP_NAME_CALL_PROLOG() SetPropertyValue( wxPGIdGen(p), wxPG_VALUETYPE(wxArrayString), wxPGVariantFromArrayString(value) ); } /** Sets value (wxArrayInt&) of a property. */ inline void SetPropertyValueArrint2( wxPGPropNameStr name, const wxArrayInt& value ) { wxPG_PROP_NAME_CALL_PROLOG() SetPropertyValueArrint2( wxPGIdGen(p), value ); } #endif /** Sets value (wxDateTime&) of a property. */ #if wxUSE_DATETIME inline void SetPropertyValueDatetime( wxPGPropNameStr name, const wxDateTime& value ) { wxPG_PROP_NAME_CALL_PROLOG() SetPropertyValueDatetime( wxPGIdGen(p), value ); } #endif /** Sets value (wxPoint&) of a property. */ inline void SetPropertyValuePoint( wxPGPropNameStr name, const wxPoint& value ) { wxPG_PROP_NAME_CALL_PROLOG() SetPropertyValuePoint( wxPGIdGen(p), value ); } /** Sets value (wxSize&) of a property. */ inline void SetPropertyValueSize( wxPGPropNameStr name, const wxSize& value ) { wxPG_PROP_NAME_CALL_PROLOG() SetPropertyValueSize( wxPGIdGen(p), value ); } /** Sets value (wxLongLong&) of a property. */ inline void SetPropertyValueLongLong( wxPGPropNameStr name, const wxLongLong& value ) { wxPG_PROP_NAME_CALL_PROLOG() SetPropertyValueLongLong( wxPGIdGen(p), value ); } /** Sets value (wxULongLong&) of a property. */ inline void SetPropertyValueULongLong( wxPGPropNameStr name, const wxULongLong& value ) { wxPG_PROP_NAME_CALL_PROLOG() SetPropertyValueULongLong( wxPGIdGen(p), value ); } #ifdef __WXPYTHON__ inline void SetPropertyValuePyObject( wxPGPropNameStr name, PyObject* value ) { wxPG_PROP_NAME_CALL_PROLOG() SetPropertyValuePyObject( wxPGIdGen(p), value ); } #endif /** Sets property's value to unspecified. If it has children (it may be category), then the same thing is done to them. */ void SetPropertyUnspecified( wxPGId id ); inline void SetPropertyUnspecified ( wxPGPropNameStr name ) { wxPG_PROP_NAME_CALL_PROLOG() SetPropertyUnspecified( wxPGIdGen(p) ); } #ifndef SWIG /** Sets various property values from a list of wxVariants. If property with name is missing from the grid, new property is created under given default category (or root if omitted). */ void SetPropertyValues( const wxVariantList& list, wxPGId default_category ) { m_pState->SetPropertyValues(list,default_category); } inline void SetPropertyValues( const wxVariant& list, wxPGId default_category ) { SetPropertyValues(list.GetList(),default_category); } inline void SetPropertyValues( const wxVariantList& list, const wxString& default_category = wxEmptyString ) { SetPropertyValues(list,GetPropertyByNameI(default_category)); } inline void SetPropertyValues( const wxVariant& list, const wxString& default_category = wxEmptyString ) { SetPropertyValues(list.GetList(),GetPropertyByNameI(default_category)); } #endif /** Sets vertical spacing. Can be 1, 2, or 3 - a value relative to font height. Value of 2 should be default on most platforms. \remarks On wxMSW, wxComboBox, when used as property editor widget, will spill out with anything less than 3. */ inline void SetVerticalSpacing( int vspacing ) { m_vspacing = (unsigned char)vspacing; CalculateFontAndBitmapStuff( vspacing ); if ( !m_pState->m_itemsAdded ) Refresh(); } /** Shows all low priority properties. */ inline void ShowLowPriority() { Compact ( false ); } /** Shows an brief error message that is related to a property. */ inline void ShowPropertyError( wxPGId id, const wxString& msg ) { wxPG_PROP_ID_CALL_PROLOG() p->ShowError(msg); } inline void ShowPropertyError( wxPGPropNameStr name, const wxString& msg ) { ShowPropertyError (GetPropertyByNameI(name), msg); } /** Sorts all items at all levels (except sub-properties). */ void Sort(); /** Sorts children of a category. */ void Sort( wxPGId id ); /** Sorts children of a category. */ inline void Sort( wxPGPropNameStr name ) { Sort( GetPropertyByNameI(name) ); } /** Overridden function. \sa @link wndflags Additional Window Styles@endlink */ virtual void SetWindowStyleFlag( long style ); /** All properties added/inserted will have given priority by default. \param priority can be wxPG_HIGH (default) or wxPG_LOW. */ inline void SetDefaultPriority( int priority ) { if ( priority == wxPG_LOW ) m_iFlags |= wxPG_FL_ADDING_HIDEABLES; else m_iFlags &= ~(wxPG_FL_ADDING_HIDEABLES); } /** Same as SetDefaultPriority(wxPG_HIGH). */ inline void ResetDefaultPriority() { SetDefaultPriority(wxPG_HIGH); } /** Property editor widget helper methods. */ //@{ /** Call when editor widget's contents is modified. For example, this is called when changes text in wxTextCtrl (used in wxStringProperty and wxIntProperty). \remarks This should only be called by properties. \sa @link wxPGProperty::OnEvent @endlink */ inline void EditorsValueWasModified() { m_iFlags |= wxPG_FL_VALUE_MODIFIED; } /** Reverse of EditorsValueWasModified(). */ inline void EditorsValueWasNotModified() { m_iFlags &= ~(wxPG_FL_VALUE_MODIFIED); } /** Returns true if editor's value was marked modified. */ inline bool IsEditorsValueModified() const { return ( m_iFlags & wxPG_FL_VALUE_MODIFIED ) ? true : false; } /** Shortcut for creating dialog-caller button. Used, for example, by wxFontProperty. \remarks This should only be called by properties. */ wxWindow* GenerateEditorButton( const wxPoint& pos, const wxSize& sz ); /** Fixes position of wxTextCtrl-like control (wxSpinCtrl usually fits as one). Call after control has been created (but before shown). */ void FixPosForTextCtrl( wxWindow* ctrl ); /** Shortcut for creating text editor widget. \param pos Same as pos given for CreateEditor. \param sz Same as sz given for CreateEditor. \param value Initial text for wxTextCtrl. \param secondary If right-side control, such as button, also created, then create it first and pass it as this parameter. \param extraStyle Extra style flags to pass for wxTextCtrl. \remarks Note that this should generally be called only by new classes derived from wxPGProperty. */ wxWindow* GenerateEditorTextCtrl( const wxPoint& pos, const wxSize& sz, const wxString& value, wxWindow* secondary, int extraStyle = 0, int maxLen = 0 ); /* Generates both textctrl and button. */ wxWindow* GenerateEditorTextCtrlAndButton( const wxPoint& pos, const wxSize& sz, wxWindow** psecondary, int limited_editing, wxPGProperty* property ); /** Generates position for a widget editor dialog box. \param p Property for which dialog is positioned. \param sz Known or over-approximated size of the dialog. \retval Position for dialog. */ wxPoint GetGoodEditorDialogPosition( wxPGProperty* p, const wxSize& sz ); // Converts escape sequences in src_str to newlines, // tabs, etc. and copies result to dst_str. static wxString& ExpandEscapeSequences( wxString& dst_str, wxString& src_str ); // Converts newlines, tabs, etc. in src_str to escape // sequences, and copies result to dst_str. static wxString& CreateEscapeSequences( wxString& dst_str, wxString& src_str ); /** Returns rectangle that fully contains properties between and including p1 and p2. */ wxRect GetPropertyRect( const wxPGProperty* p1, const wxPGProperty* p2 ) const; /** Returns pointer to current active primary editor control (NULL if none). If editor uses clipper window, pointer is returned to the actual editor, not the clipper. */ wxWindow* GetEditorControl() const; inline wxWindow* GetPrimaryEditor() const { return m_wndPrimary; } /** Returns pointer to current active secondary editor control (NULL if none). */ inline wxWindow* GetEditorControlSecondary() const { return m_wndSecondary; } inline int IsNextEventIgnored() const { return m_ignoredEvents; } inline void IgnoreNextEvent() { m_ignoredEvents++; } inline void IgnoredEventPasses() { wxASSERT( m_ignoredEvents > 0 ); m_ignoredEvents--; } #ifdef __WXPYTHON__ // Dummy method to put wxRect type info into the wrapper wxRect DummywxRectTypeInit() const { return wxRect(1,2,3,4); } #endif #ifndef SWIG /** Generates contents for string dst based on the convetents of wxArrayString src. Format will be str1 str2 and so on. Set flags to 1 inorder to convert backslashes to double-back- slashes and ""'s to "\". */ static void ArrayStringToString( wxString& dst, const wxArrayString& src, wxChar preDelim, wxChar postDelim, int flags ); /** Pass this function to Connect calls in propertyclass::CreateEditor. */ void OnCustomEditorEvent( wxCommandEvent &event ); /** Puts items into sl. Automatic wxGetTranslation is used if enabled. */ void SLAlloc ( unsigned int itemcount, const wxChar** items ); /** Returns sl. */ inline wxArrayString& SLGet() { return m_sl; } //@} inline long GetInternalFlags() const { return m_iFlags; } inline void ClearInternalFlag( long flag ) { m_iFlags &= ~(flag); } inline unsigned int GetBottomY() const { return m_bottomy; } inline void SetBottomY( unsigned int y ) { m_bottomy = y; } inline void IncFrozen() { m_frozen++; } inline void DecFrozen() { m_frozen--; } /** Call after a property modified internally. selFlags are the same as with DoSelectProperty. NB: Avoid using this method, if possible. */ void PropertyWasModified( wxPGProperty* p, int selFlags = 0 ); void OnComboItemPaint( wxPGCustomComboControl* pCb,int item,wxDC& dc, wxRect& rect,int flags ); // Used by simple check box for keyboard navigation void SendNavigationKeyEvent( int dir ); #if 0 /* Creates choices for labels and values, or returns existing choices which point to the same memory. */ static wxPGChoices* CreateChoicesArray(const wxChar** labels, const long* values, int itemcount); /* Creates choices for labels and values, or returns existing choices which point to the same memory (*only* if acceptLabelsAsId=true). */ static wxPGChoices* CreateChoicesArray(const wxArrayString& labels, const wxArrayInt& values = wxPG_EMPTY_ARRAYINT, bool acceptLabelsAsId = false); /* Creates choices for labels and values in wxPGChoices, or returns existing choices which is identical. */ static wxPGChoices* CreateChoicesArray(wxPGChoices& choices); #ifdef __WXDEBUG__ // Displays what dynamic arrays are allocated static void DumpAllocatedChoiceSets(); #endif #endif // #if 0 /** Standardized double-to-string conversion. */ static void DoubleToString( wxString& target, double value, int precision, bool removeZeroes, wxString* precTemplate ); protected: /** wxPropertyGridState used by the grid is created here. If grid is used in wxPropertyGridManager, there is no point overriding this - instead, set custom wxPropertyGridPage classes. */ virtual wxPropertyGridState* CreateState() const; #ifndef DOXYGEN public: // Control font changer helper. void SetCurControlBoldFont(); // // Public methods for semi-public use // (not protected for optimization) // bool DoSelectProperty( wxPGProperty* p, unsigned int flags = 0 ); // Usually called internally after items added/deleted. void CalculateYs( wxPGPropertyWithChildren* startparent, int startindex ); // Overridden functions. virtual bool Destroy(); virtual wxSize DoGetBestSize() const; virtual void Refresh( bool eraseBackground = true, const wxRect *rect = (const wxRect *) NULL ); virtual bool SetFont( const wxFont& font ); #if wxPG_SUPPORT_TOOLTIPS void SetToolTip( const wxString& tipString ); #endif virtual void Freeze(); virtual void SetExtraStyle( long exStyle ); virtual void Thaw(); protected: /** 1 if calling property event handler. */ unsigned char m_processingEvent; #ifndef wxPG_ICON_WIDTH wxBitmap *m_expandbmp, *m_collbmp; #endif wxCursor *m_cursorSizeWE; /** wxWindow pointers to editor control(s). */ wxWindow *m_wndPrimary; wxWindow *m_wndSecondary; #if wxPG_DOUBLE_BUFFER wxBitmap *m_doubleBuffer; #endif wxArrayPtrVoid *m_windowsToDelete; /** Local time ms when control was created. */ wxLongLong m_timeCreated; /** Indicates bottom of drawn and clickable area on the control. Updated by CalculateYs. */ unsigned int m_bottomy; /** Extra Y spacing between the items. */ int m_spacingy; /** Control client area width; updated on resize. */ int m_width; /** Control client area height; updated on resize. */ int m_height; /** Non-client width (auto-centering helper). */ int m_fWidth; /** List of currently visible properties. */ wxPGArrayProperty m_arrVisible; /** Previously recorded scroll start position. */ int m_prevVY; /** Necessary so we know when to re-calculate visibles on resize. */ int m_calcVisHeight; /** The gutter spacing in front and back of the image. This determines the amount of spacing in front of each item */ int m_gutterWidth; /** Includes separator line. */ int m_lineHeight; /** Gutter*2 + image width. */ int m_marginWidth; int m_buttonSpacingY; // y spacing for expand/collapse button. /** Extra margin for expanded sub-group items. */ int m_subgroup_extramargin; /** The image width of the [+] icon. This is also calculated in the gutter */ int m_iconWidth; #ifndef wxPG_ICON_WIDTH /** The image height of the [+] icon. This is calculated as minimal size and to align */ int m_iconHeight; #endif /** Current cursor id. */ int m_curcursor; /** This captionFont is made equal to the font of the wxScrolledWindow. As extra the bold face is set on it when this is wanted by the user (see flags) */ wxFont m_captionFont; #if !wxPG_HEAVY_GFX int m_splitterprevdrawnx; /** Pen used to draw splitter column when it is being dragged. */ wxPen m_splitterpen; #endif int m_fontHeight; // Height of the font. int m_pushButKeyCode; // Base keycode for triggering push button. // // Temporary values // /** m_splitterx when drag began. */ int m_startingSplitterX; /** Bits are used to indicate which colours are customized. */ unsigned short m_coloursCustomized; /** 0 = not dragging, 1 = drag just started, 2 = drag in progress */ unsigned char m_dragStatus; /** x - m_splitterx. */ signed char m_dragOffset; /** 0 = margin, 1 = label, 2 = value. */ unsigned char m_mouseSide; /** True when editor control is focused. */ unsigned char m_editorFocused; /** 1 if m_latsCaption is also the bottommost caption. */ //unsigned char m_lastCaptionBottomnest; /** Set to 1 when graphics frozen. */ unsigned char m_frozen; unsigned char m_vspacing; unsigned char m_pushButKeyCodeNeedsAlt; // Does triggering push button need Alt down? unsigned char m_pushButKeyCodeNeedsCtrl; // Does triggering push button need Ctrl down? unsigned char m_keyComboConsumed; // Used to track when Alt/Ctrl+Key was consumed. unsigned char m_ignoredEvents; // Number of EVT_TEXT-style events to ignore. /** Internal flags - see wxPG_FL_XXX constants. */ wxUint32 m_iFlags; /** When drawing next time, clear this many item slots at the end. */ int m_clearThisMany; /** Pointer to selected property. Note that this is duplicated in m_state for better transiency between pages so that the selected item can be retained. */ wxPGProperty* m_selected; wxPGProperty* m_propHover; // pointer to property that has mouse on itself wxWindow* m_eventObject; // EventObject for wxPropertyGridEvents wxWindow* m_curFocused; // What (global) window is currently focused // (needed to resolve event handling mess). wxEvtHandler* m_tlwHandler; // wxPGTLWHandler wxWindow* m_tlp; // Top level parent int m_splitterx; // x position for the vertical line dividing name and value float m_fSplitterX; // accurate splitter position int m_ctrlXAdjust; // x relative to splitter (needed for resize). wxColour m_colLine; // lines between cells wxColour m_colPropFore; // property labels and values are written in this colour wxColour m_colDisPropFore; // or with this colour when disabled wxColour m_colPropBack; // background for m_colPropFore wxColour m_colCapFore; // text color for captions wxColour m_colCapBack; // background color for captions wxColour m_colSelFore; // foreground for selected property wxColour m_colSelBack; // background for selected property (actually use background color when control out-of-focus) wxColour m_colMargin; // background colour for margin // NB: These *cannot* be moved to globals. wxArrayPtrVoid m_arrBgBrushes; // Array of background colour brushes. wxArrayPtrVoid m_arrFgCols; // Array of foreground colours. wxArrayString m_sl; // string control helper protected: // Sets some members to defaults (called constructors). void Init1(); // Initializes some members (called by Create and complex constructor). void Init2(); void OnPaint(wxPaintEvent &event ); // main event receivers void OnMouseMove( wxMouseEvent &event ); void OnMouseClick( wxMouseEvent &event ); void OnMouseRightClick( wxMouseEvent &event ); void OnMouseDoubleClick( wxMouseEvent &event ); void OnMouseUp( wxMouseEvent &event ); void OnKey( wxKeyEvent &event ); void OnKeyUp( wxKeyEvent &event ); void OnNavigationKey( wxNavigationKeyEvent& event ); void OnResize( wxSizeEvent &event ); // event handlers bool HandleMouseMove( int x, unsigned int y, wxMouseEvent &event ); bool HandleMouseClick( int x, unsigned int y, wxMouseEvent &event ); bool HandleMouseRightClick( int x, unsigned int y, wxMouseEvent &event ); bool HandleMouseDoubleClick( int x, unsigned int y, wxMouseEvent &event ); bool HandleMouseUp( int x, unsigned int y, wxMouseEvent &event ); void HandleKeyEvent( wxKeyEvent &event ); bool HandleChildKey( wxKeyEvent& event, bool canDestroy ); // Handle TAB and ESCAPE in control void OnMouseEntry( wxMouseEvent &event ); void OnIdle( wxIdleEvent &event ); void OnFocusEvent( wxFocusEvent &event ); void OnChildFocusEvent( wxChildFocusEvent& event ); bool OnMouseCommon( wxMouseEvent &event, int* px, int *py ); bool OnMouseChildCommon( wxMouseEvent &event, int* px, int *py ); // sub-control event handlers void OnMouseClickChild( wxMouseEvent &event ); void OnMouseRightClickChild( wxMouseEvent &event ); void OnMouseMoveChild( wxMouseEvent &event ); void OnMouseUpChild( wxMouseEvent &event ); void OnChildKeyDown( wxKeyEvent &event ); void OnChildKeyUp( wxKeyEvent &event ); //void OnFocusChild( wxFocusEvent &event ); void OnCaptureChange( wxMouseCaptureChangedEvent &event ); void OnScrollEvent( wxScrollWinEvent &event ); void OnSysColourChanged( wxSysColourChangedEvent &event ); protected: /** Adjust the centering of the bitmap icons (collapse / expand) when the caption font changes. They need to be centered in the middle of the font, so a bit of deltaY adjustment is needed. On entry, m_captionFont must be set to window font. It will be modified properly. */ void CalculateFontAndBitmapStuff( int vspacing ); inline wxRect GetEditorWidgetRect( wxPGProperty* p ); void CorrectEditorWidgetSizeX( int newSplitterx, int newWidth ); #ifdef __WXDEBUG__ void _log_items(); void OnScreenNote( const wxChar* format, ... ); #endif void DoDrawItems( wxDC& dc, const wxPGProperty* first_item, const wxPGProperty* last_item, const wxRect* clip_rect ); void DoDrawItems2( wxDC& dc, const wxPGProperty* first_item, const wxPGProperty* last_item, const wxRect* clip_rect ) const; virtual void RefreshProperty( wxPGProperty* p ); /** Draws items from topitemy to bottomitemy */ void DrawItems( wxDC& dc, unsigned int topitemy, unsigned int bottomitemy, const wxRect* clip_rect = (const wxRect*) NULL ); void DrawItems( const wxPGProperty* p1, const wxPGProperty* p2 ); // In addition to calling DoDrawItems directly, this is the // only alternative for using wxClientDC - others just call // RefreshRect. void DrawItem( wxDC& dc, wxPGProperty* p ); inline void DrawItem( wxPGProperty* p ) { DrawItems(p,p); } virtual void DrawItemAndChildren( wxPGProperty* p ); /** Draws item, children, and consequtive parents as long as category is not met. */ void DrawItemAndValueRelated( wxPGProperty* p ); /** Returns property reference for given property id. */ inline wxPGProperty& GetPropertyById( wxPGId id ) { return *wxPGIdToPtr(id); } static wxPropertyCategoryClass* _GetPropertyCategory( wxPGProperty* p ); void ImprovedClientToScreen( int* px, int* py ); wxPGId _Insert( wxPGProperty* priorthis, wxPGProperty* newproperty ); inline wxPGId _Insert( wxPGPropertyWithChildren* parent, int index, wxPGProperty* newproperty ) { return m_pState->DoInsert(parent,index,newproperty); } // Called by focus event handlers. newFocused is the window that becomes focused. void HandleFocusChange( wxWindow* newFocused ); /** Reloads all non-customized colours from system settings. */ void RegainColours(); bool DoEditorValidate(); wxPGProperty* DoGetItemAtY( int y ); inline wxPGProperty* DoGetItemAtY_Full( int y ) { wxASSERT( y >= 0 ); if ( (unsigned int)y >= m_bottomy ) return NULL; return m_pState->m_properties->GetItemAtY ( y, m_lineHeight ); } void DoPropertyChanged( wxPGProperty* p, unsigned int selFlags = 0 ); void DoSetSplitterPosition( int newxpos, bool refresh = true ); void FreeEditors(); wxPGProperty* GetLastItem( bool need_visible, bool allow_subprops = true ); void CalculateVisibles( int vy, bool full_recalc ); bool _Expand( wxPGProperty* p, bool sendEvent = false ); bool _Collapse( wxPGProperty* p, bool sendEvent = false ); /** Forces updating the value of property from the editor control. Returns true if DoPropertyChanged was actually called. */ bool CommitChangesFromEditor( wxUint32 flags = 0 ); // Returns nearest paint visible property (such that will be painted unless // window is scrolled or resized). If given property is paint visible, then // it itself will be returned. wxPGProperty* GetNearestPaintVisible( wxPGProperty* p ); /*#ifdef __WXMSW__ virtual WXDWORD MSWGetStyle(long flags, WXDWORD *exstyle) const; #endif*/ static void RegisterDefaultEditors(); static void RegisterDefaultValues(); // Sets m_bgColIndex to this property and all its children. void SetBackgroundColourIndex( wxPGProperty* p, int index, int flags ); // Sets m_fgColIndex to this property and all its children. void SetTextColourIndex( wxPGProperty* p, int index, int flags ); int CacheColour( const wxColour& colour ); void _SetPropertyLabel( wxPGProperty* p, const wxString& newproplabel ); void DoSetPropertyName( wxPGProperty* p, const wxString& newname ); void SetPropertyValue( wxPGId id, const wxPGValueType* typeclass, const wxPGVariant& value ); void SetPropertyValue( wxPGId id, const wxChar* typestring, const wxPGVariant& value ); // Setups event handling for child control void SetupEventHandling( wxWindow* wnd, int id ); void CustomSetCursor( int type, bool override = false ); void RecalculateVirtualSize(); void PGAdjustScrollbars( int y ); inline bool UsesAutoUnspecified() const { return ( GetExtraStyle() & wxPG_EX_AUTO_UNSPECIFIED_VALUES ) ? true : false; } /** When splitter is dragged to a new position, this is drawn. */ void DrawSplitterDragColumn( wxDC& dc, int x ); /** If given index is -1, scans for item to either up (dir=0) or down (dir!=0) */ //int GetNearestValidItem ( int index, int dir ); wxPGProperty* GetNeighbourItem( wxPGProperty* item, bool need_visible, int dir ) const; void PrepareAfterItemsAdded(); void SendEvent( int eventType, wxPGProperty* p, unsigned int selFlags = 0 ); bool SetPropertyPriority( wxPGProperty* p, int priority ); private: bool ButtonTriggerKeyTest( wxKeyEvent &event ); #endif // DOXYGEN_SHOULD_SKIP_THIS private: DECLARE_EVENT_TABLE() #endif // #ifndef SWIG }; #undef wxPG_USE_STATE // ----------------------------------------------------------------------- // // Bunch of inlines that need to resolved after all classes have been defined. // #ifndef SWIG inline bool wxPropertyGridState::IsDisplayed() const { return ( this == m_pPropGrid->GetState() ); } #endif inline void wxPGProperty::SetEditor( const wxString& editorName ) { EnsureDataExt(); m_dataExt->m_customEditor = wxPropertyContainerMethods::GetEditorByName(editorName); } inline bool wxPGProperty::Hide( bool hide ) { return GetGrid()->HideProperty(wxPGIdGen(this),hide); } inline bool wxPGProperty::SetMaxLength( int maxLen ) { return GetGrid()->SetPropertyMaxLength(wxPGIdGen(this),maxLen); } #if !wxPG_ID_IS_PTR inline const wxString& wxPGId::GetName() const { return m_ptr->GetName(); } #endif // ----------------------------------------------------------------------- /** \class wxPropertyGridEvent \ingroup classes \brief A propertygrid event holds information about events associated with wxPropertyGrid objects.

Derived from

wxNotifyEvent\n wxCommandEvent\n wxEvent\n wxObject\n

Include files

*/ class WXDLLIMPEXP_PG wxPropertyGridEvent : public wxCommandEvent { public: /** Constructor. */ wxPropertyGridEvent(wxEventType commandType=0, int id=0); #ifndef SWIG /** Copy constructor. */ wxPropertyGridEvent(const wxPropertyGridEvent& event); #endif /** Destructor. */ ~wxPropertyGridEvent(); /** Copyer. */ virtual wxEvent* Clone() const; /** Enables property. */ inline void EnableProperty( bool enable = true ) { m_pg->EnableProperty(wxPGIdGen(m_property),enable); } /** Disables property. */ inline void DisableProperty() { m_pg->EnableProperty(wxPGIdGen(m_property),false); } inline wxPGId GetMainParent() const { wxASSERT(m_property); return wxPGIdGen(m_property->GetMainParent()); } /** Returns id of associated property. */ wxPGId GetProperty() const { return wxPGIdGen(m_property); } #ifndef SWIG /** Returns pointer to associated property. */ wxPGProperty* GetPropertyPtr() const { return m_property; } #endif /** Returns label of associated property. */ const wxString& GetPropertyLabel() const { wxASSERT( m_property ); return m_property->GetLabel(); } /** Returns name of associated property. */ const wxString& GetPropertyName() const { wxASSERT( m_property ); return m_property->GetName(); } #if wxPG_USE_CLIENT_DATA /** Returns client data of relevant property. */ wxPGProperty::ClientDataType GetPropertyClientData() const { wxASSERT( m_property ); return m_property->GetClientData(); } #endif #ifndef SWIG /** Returns value of relevant property. */ wxVariant GetPropertyValue() const { wxASSERT( m_property ); return m_property->GetValueAsVariant(); } inline wxString GetPropertyValueAsString() const { return m_pg->GetPropertyValueAsString( wxPGIdGen(m_property) ); } inline long GetPropertyValueAsLong() const { return m_pg->GetPropertyValueAsLong( wxPGIdGen(m_property) ); } inline int GetPropertyValueAsInt() const { return (int)GetPropertyValueAsLong(); } inline long GetPropertyValueAsBool() const { return m_pg->GetPropertyValueAsBool( wxPGIdGen(m_property) ); } inline double GetPropertyValueAsDouble() const { return m_pg->GetPropertyValueAsDouble( wxPGIdGen(m_property) ); } inline const wxObject* GetPropertyValueAsWxObjectPtr() const { return m_pg->GetPropertyValueAsWxObjectPtr( wxPGIdGen(m_property) ); } inline void* GetPropertyValueAsVoidPtr() const { return m_pg->GetPropertyValueAsVoidPtr( wxPGIdGen(m_property) ); } #if !wxPG_PGVARIANT_IS_VARIANT inline const wxArrayString& GetPropertyValueAsArrayString() const { return m_pg->GetPropertyValueAsArrayString( wxPGIdGen(m_property) ); } inline const wxPoint& GetPropertyValueAsPoint() const { return m_pg->GetPropertyValueAsPoint( wxPGIdGen(m_property) ); } inline const wxSize& GetPropertyValueAsSize() const { return m_pg->GetPropertyValueAsSize( wxPGIdGen(m_property) ); } inline const wxArrayInt& GetPropertyValueAsArrayInt() const { return m_pg->GetPropertyValueAsArrayInt( wxPGIdGen(m_property) ); } #else inline wxArrayString GetPropertyValueAsArrayString() const { return m_pg->GetPropertyValueAsArrayString( wxPGIdGen(m_property) ); } inline wxPoint GetPropertyValueAsPoint() const { return m_pg->GetPropertyValueAsPoint( wxPGIdGen(m_property) ); } inline wxSize GetPropertyValueAsSize() const { return m_pg->GetPropertyValueAsSize( wxPGIdGen(m_property) ); } inline wxArrayInt GetPropertyValueAsArrayInt() const { return m_pg->GetPropertyValueAsArrayInt( wxPGIdGen(m_property) ); } #endif /** Returns value type of relevant property. */ const wxPGValueType* GetPropertyValueType() const { return m_property->GetValueTypePtr(); } #else %pythoncode { def GetPropertyValue(self): return self.GetProperty().GetValue() } #endif /** Returns true if event has associated property. */ inline bool HasProperty() const { return ( m_property != (wxPGProperty*) NULL ); } inline bool IsPropertyEnabled() const { return m_pg->IsPropertyEnabled(wxPGIdGen(m_property)); } #ifndef SWIG // IsPending() == true, if sent using AddPendingEvent inline void SetPending( bool pending ) { m_pending = pending; } inline bool IsPending() const { return m_pending; } #if !wxPG_ID_IS_PTR /** Changes the associated property. */ void SetProperty( wxPGId id ) { m_property = wxPGIdToPtr(id); } #endif /** Changes the associated property. */ void SetProperty( wxPGProperty* p ) { m_property = p; } void SetPropertyGrid( wxPropertyGrid* pg ) { m_pg = pg; } private: DECLARE_DYNAMIC_CLASS(wxPropertyGridEvent) wxPGProperty* m_property; wxPropertyGrid* m_pg; bool m_pending; #endif }; #define wxPG_BASE_EVT_PRE_ID 1775 #ifndef SWIG BEGIN_DECLARE_EVENT_TYPES() DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_PG, wxEVT_PG_SELECTED, wxPG_BASE_EVT_PRE_ID) DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_PG, wxEVT_PG_CHANGED, wxPG_BASE_EVT_PRE_ID+1) DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_PG, wxEVT_PG_HIGHLIGHTED, wxPG_BASE_EVT_PRE_ID+2) DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_PG, wxEVT_PG_RIGHT_CLICK, wxPG_BASE_EVT_PRE_ID+3) DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_PG, wxEVT_PG_PAGE_CHANGED, wxPG_BASE_EVT_PRE_ID+4) DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_PG, wxEVT_PG_ITEM_COLLAPSED, wxPG_BASE_EVT_PRE_ID+5) DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_PG, wxEVT_PG_ITEM_EXPANDED, wxPG_BASE_EVT_PRE_ID+6) DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_PG, wxEVT_PG_DOUBLE_CLICK, wxPG_BASE_EVT_PRE_ID+7) END_DECLARE_EVENT_TYPES() #else enum { wxEVT_PG_SELECTED = wxPG_BASE_EVT_PRE_ID, wxEVT_PG_CHANGED, wxEVT_PG_HIGHLIGHTED, wxEVT_PG_RIGHT_CLICK, wxEVT_PG_PAGE_CHANGED, wxEVT_PG_ITEM_COLLAPSED, wxEVT_PG_ITEM_EXPANDED, wxEVT_PG_DOUBLE_CLICK }; #endif #define wxPG_BASE_EVT_TYPE wxEVT_PG_SELECTED #define wxPG_MAX_EVT_TYPE (wxPG_BASE_EVT_TYPE+30) #ifndef SWIG typedef void (wxEvtHandler::*wxPropertyGridEventFunction)(wxPropertyGridEvent&); #define EVT_PG_SELECTED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_PG_SELECTED, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxPropertyGridEventFunction, & fn ), (wxObject *) NULL ), #define EVT_PG_CHANGED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_PG_CHANGED, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxPropertyGridEventFunction, & fn ), (wxObject *) NULL ), #define EVT_PG_HIGHLIGHTED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_PG_HIGHLIGHTED, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxPropertyGridEventFunction, & fn ), (wxObject *) NULL ), #define EVT_PG_RIGHT_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_PG_RIGHT_CLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxPropertyGridEventFunction, & fn ), (wxObject *) NULL ), #define EVT_PG_DOUBLE_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_PG_DOUBLE_CLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxPropertyGridEventFunction, & fn ), (wxObject *) NULL ), #define EVT_PG_PAGE_CHANGED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_PG_PAGE_CHANGED, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxPropertyGridEventFunction, & fn ), (wxObject *) NULL ), #define EVT_PG_ITEM_COLLAPSED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_PG_ITEM_COLLAPSED, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxPropertyGridEventFunction, & fn ), (wxObject *) NULL ), #define EVT_PG_ITEM_EXPANDED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_PG_ITEM_EXPANDED, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxPropertyGridEventFunction, & fn ), (wxObject *) NULL ), #define wxPropertyGridEventHandler(A) ((wxObjectEventFunction)(wxEventFunction)(wxPropertyGridEventFunction)&A) #endif // ----------------------------------------------------------------------- /** \class wxPropertyGridPopulator \ingroup classes \brief Allows populating wxPropertyGrid from arbitrary text source. */ class WXDLLIMPEXP_PG wxPropertyGridPopulator { public: /** Constructor. \param pg Property grid to populate. \param popRoot Base parent property. Default is root. */ inline wxPropertyGridPopulator(wxPropertyGrid* pg = (wxPropertyGrid*) NULL, wxPGId popRoot = wxNullProperty) { Init(pg, popRoot); } /** Destructor. */ ~wxPropertyGridPopulator(); /** Adds a new set of choices with given id, labels and optional values. \remarks choicesId can be any id unique in source (so it does not conflict with sets of choices created before population process). */ void AddChoices(wxPGChoicesId choicesId, const wxArrayString& choiceLabels, const wxArrayInt& choiceValues = wxPG_EMPTY_ARRAYINT); /** Appends a property under current parent. \param classname Class name of a property. Understands both wxXXXProperty and XXX style names. Thus, for example, wxStringProperty could be created with class names "wxStringProperty", and "String". Short class name of wxPropertyCategory is "Category". \param label Label for property. Use as in constructor functions. \param name Name for property. Use as in constructor functions. \param value Value for property is interpreted from this string. \param attributes Attributes of a property (both pseudo-attributes like "Disabled" and "Modified" in addition to real ones like "Precision") are read from this string. Is intended for string like one generated by GetPropertyAttributes. \param choicesId If non-zero: Id for set of choices unique in source. Pass either id previously given to AddChoices or a new one. If new is given, then choiceLabels and choiceValues are loaded as the contents for the newly created set of choices. \param choiceLabels List of choice labels. \param choiceValues List of choice values. */ wxPGId AppendByClass(const wxString& classname, const wxString& label, const wxString& name = wxPG_LABEL, const wxString& value = wxEmptyString, const wxString& attributes = wxEmptyString, wxPGChoicesId choicesId = (wxPGChoicesId)0, const wxArrayString& choiceLabels = wxPG_EMPTY_ARRAYSTRING, const wxArrayInt& choiceValues = wxPG_EMPTY_ARRAYINT); /** Appends a property under current parent. Works just as AppendByClass, except accepts value type name instead of class name (value type name of a property can be queried using wxPropertyGrid::GetPropertyValueType(property)->GetType()). \remarks Cannot generate property category. */ wxPGId AppendByType(const wxString& valuetype, const wxString& label, const wxString& name = wxPG_LABEL, const wxString& value = wxEmptyString, const wxString& attributes = wxEmptyString, wxPGChoicesId choicesId = (wxPGChoicesId)0, const wxArrayString& choiceLabels = wxPG_EMPTY_ARRAYSTRING, const wxArrayInt& choiceValues = wxPG_EMPTY_ARRAYINT); /** Returns id of parent property for which children can currently be added. */ inline wxPGId GetCurrentParent() const { return m_curParent; } /** Returns true if set of choices with given id has already been added. */ bool HasChoices( wxPGChoicesId id ) const; /** Sets the property grid to be populated. */ inline void SetGrid( wxPropertyGrid* pg ) { m_propGrid = pg; } /** If possible, sets the property last added as current parent. */ bool BeginChildren(); /** Terminates current parent - sets its parent as the new current parent. */ inline void EndChildren() { wxASSERT( wxPGIdIsOk(m_curParent) ); m_curParent = wxPGIdGen(wxPGIdToPtr(m_curParent)->GetParent()); m_lastProperty = wxPGIdGen((wxPGProperty*)NULL); } protected: wxPGId DoAppend(wxPGProperty* p, const wxString& value, const wxString& attributes, wxPGChoicesId choicesId, const wxArrayString& choiceLabels, const wxArrayInt& choiceValues); void Init( wxPropertyGrid* pg, wxPGId popRoot ); /** Used property grid. */ wxPropertyGrid* m_propGrid; /** Population root. */ wxPGId m_popRoot; /** Parent of currently added properties. */ wxPGId m_curParent; /** Id of property last added. */ wxPGId m_lastProperty; /** Hashmap for source-choices-id to wxPGChoicesData mapping. */ wxPGHashMapP2P m_dictIdChoices; }; // ----------------------------------------------------------------------- // // Undefine macros that are not needed outside propertygrid sources // #ifndef __wxPG_SOURCE_FILE__ #undef wxPG_FL_DESC_REFRESH_REQUIRED #undef wxPG_FL_SCROLLBAR_DETECTED #undef wxPG_FL_CREATEDSTATE #undef wxPG_FL_NOSTATUSBARHELP #undef wxPG_FL_SCROLLED #undef wxPG_FL_HIDE_STATE #undef wxPG_FL_FOCUS_INSIDE_CHILD #undef wxPG_FL_FOCUS_INSIDE #undef wxPG_FL_MOUSE_INSIDE_CHILD #undef wxPG_FL_CUR_USES_CUSTOM_IMAGE #undef wxPG_FL_PRIMARY_FILLS_ENTIRE #undef wxPG_FL_VALUE_MODIFIED #undef wxPG_FL_MOUSE_INSIDE #undef wxPG_FL_FOCUSED #undef wxPG_FL_MOUSE_CAPTURED #undef wxPG_FL_INITIALIZED #undef wxPG_FL_ACTIVATION_BY_CLICK #undef wxPG_FL_DONT_CENTER_SPLITTER #undef wxPG_SUPPORT_TOOLTIPS #undef wxPG_DOUBLE_BUFFER #undef wxPG_HEAVY_GFX #undef wxPG_ICON_WIDTH #undef wxPG_USE_RENDERER_NATIVE // Following are needed by the manager headers // #undef wxPGIdGen // #undef wxPGPropNameStr // #undef wxPGIdToPtr #endif // Doxygen special #ifdef DOXYGEN #include "manager.h" #endif // ----------------------------------------------------------------------- #endif // __WX_PROPGRID_PROPGRID_H__ wxformbuilder-3.1.59/src/controls/include/wx/propgrid/propdev.h0000644000175000017500000016441711143440026025155 0ustar rrmulderrrmulder///////////////////////////////////////////////////////////////////////////// // Name: propdev.h // Purpose: wxPropertyGrid Internal/Property Developer Header // Author: Jaakko Salli // Modified by: // Created: Nov-23-2004 // RCS-ID: $Id: // Copyright: (c) Jaakko Salli // Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_PROPGRID_PROPDEV_H_ #define _WX_PROPGRID_PROPDEV_H_ // ----------------------------------------------------------------------- #ifdef _WX_PROPGRID_ADVPROPS_H_ #error "propdev.h must be included *before* advprops.h" #endif class WXDLLIMPEXP_PG wxArrayEditorDialog; // ----------------------------------------------------------------------- // These are intuitive substitutes for base property classes. typedef wxPGProperty wxBasePropertyClass; typedef wxPGPropertyWithChildren wxBaseParentPropertyClass; // ----------------------------------------------------------------------- #ifndef SWIG // This is required for sharing common global variables. // TODO: Automatic locking mechanism? class WXDLLIMPEXP_PG wxPGGlobalVarsClass { public: wxPGGlobalVarsClass(); ~wxPGGlobalVarsClass(); wxString m_pDefaultImageWildcard; // Used by advprops, but here to make things easier. int m_pDefaultImageFilterIndex; // Used by advprops, but here to make things easier. //wxArrayPtrVoid m_arrEditorClasses; // List of editor class instances. wxPGHashMapS2P m_mapEditorClasses; // Map of editor class instances (keys are name string). #if wxUSE_VALIDATORS wxArrayPtrVoid m_arrValidators; // These wxValidators need to be freed #endif wxPGHashMapS2P m_dictValueType; // Valuename -> Value type object instance. #if wxPG_VALUETYPE_IS_STRING wxPGHashMapS2P m_dictValueTypeByClass; // VTClassname -> Value type object instance. #endif wxPGHashMapS2P m_dictPropertyClassInfo; // PropertyName -> ClassInfo wxPGChoices* m_fontFamilyChoices; int m_numBoolChoices; // 2 or 3 wxString m_boolChoices[3]; // default is ["False", "True"]. Extra space is for "Unspecified". bool m_autoGetTranslation; // If true then some things are automatically translated int m_offline; // > 0 if errors cannot or should not be shown in statusbar etc. /*#if wxUSE_THREADS wxCriticalSection m_critSect; // To allow different property grids to be addressed from different threads #endif*/ }; extern WXDLLIMPEXP_PG wxPGGlobalVarsClass* wxPGGlobalVars; #endif /* #define wxPGUnRefChoices(PCHOICESDATA) \ PCHOICESDATA->UnRef() */ // TODO: This locks on Linux, fix it! /*#if wxUSE_THREADS #define WX_PG_GLOBALS_LOCKER() \ wxCriticalSectionLocker _globalVarsLocker_(wxPGGlobalVars->m_critSect); #else*/ #define WX_PG_GLOBALS_LOCKER() //#endif // ----------------------------------------------------------------------- // wxPGEditor class. // Needed for wxPython bindings class wxPGWindowPair { public: wxPGWindowPair() { m_primary = m_secondary = NULL; } wxWindow* m_primary; wxWindow* m_secondary; #ifndef SWIG wxPGWindowPair( wxWindow* a ) { m_primary = a; m_secondary = NULL; }; wxPGWindowPair( wxWindow* a, wxWindow* b ) { m_primary = a; m_secondary = b; }; #endif }; /** \class wxPGEditor \ingroup classes \brief Base for property editor classes. \remarks - Event handling: wxPGEditor::CreateControls should Connect all necessary events to the wxPropertyGrid::OnCustomEditorEvent. For Example: \code // Relays wxEVT_COMMAND_TEXT_UPDATED events of primary editor // control to the OnEvent. // NOTE: This event in particular is actually automatically conveyed, but // it is just used as an example. propgrid->Connect( wxPG_SUBID1, wxEVT_COMMAND_TEXT_UPDATED, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) &wxPropertyGrid::OnCustomEditorEvent ); \endcode OnCustomEditorEvent will then forward events, first to wxPGEditor::OnEvent and then to wxPGProperty::OnEvent. - You need to call macro wxPGRegisterEditorClass(EditorName) before using a custom editor class. - See propgrid.cpp for how builtin editors works (starting from wxPGTextCtrlEditor). */ class WXDLLIMPEXP_PG wxPGEditor { public: /** Constructor. */ wxPGEditor() { #if defined(__WXPYTHON__) m_scriptObject = NULL; #endif } /** Destructor. */ virtual ~wxPGEditor(); /** Returns pointer to the name of the editor. For example, wxPG_EDITOR(TextCtrl) has name "TextCtrl". This method is autogenerated for custom editors. */ virtual wxPG_CONST_WXCHAR_PTR GetName() const = 0; /** Instantiates editor controls. \remarks - Primary control shall use id wxPG_SUBID1, and secondary (button) control shall use wxPG_SUBID2. \param propgrid wxPropertyGrid to which the property belongs (use as parent for control). \param propert Property for which this method is called. \param pos Position, inside wxPropertyGrid, to create control(s) to. \param size Initial size for control(s). \param psecondary If method generates a secondary (button) control, pointer to it must be stored here. */ #ifndef __WXPYTHON__ virtual wxWindow* CreateControls( wxPropertyGrid* propgrid, wxPGProperty* property, const wxPoint& pos, const wxSize& sz, wxWindow** psecondary ) const = 0; #define wxPG_DECLARE_CREATECONTROLS \ virtual wxWindow* CreateControls( wxPropertyGrid* propgrid, wxPGProperty* property, \ const wxPoint& pos, const wxSize& sz, wxWindow** psecondary ) const; #else virtual wxPGWindowPair CreateControls( wxPropertyGrid* propgrid, wxPGProperty* property, const wxPoint& pos, const wxSize& sz ) const = 0; #define wxPG_DECLARE_CREATECONTROLS \ virtual wxPGWindowPair CreateControls( wxPropertyGrid* propgrid, wxPGProperty* property, \ const wxPoint& pos, const wxSize& sz ) const; #endif /** Loads value from property to the control. */ virtual void UpdateControl( wxPGProperty* property, wxWindow* ctrl ) const = 0; /** Used to draw the value when control is hidden. Default is to draw a string. Note that some margin above and below has been taken into account, to make drawing text easier without giving loads parameters. If Pen is changed, it must be returned to *wxTRANSPARENT_PEN. */ virtual void DrawValue( wxDC& dc, wxPGProperty* property, const wxRect& rect ) const; /** Handles events. Returns true if value in control was modified (see wxPGProperty::OnEvent for more information). */ virtual bool OnEvent( wxPropertyGrid* propgrid, wxPGProperty* property, wxWindow* wnd_primary, wxEvent& event ) const = 0; /** Copies value from ctrl to property's internal storage. Returns true if value was different. */ virtual bool CopyValueFromControl( wxPGProperty* property, wxWindow* ctrl ) const = 0; /** Sets value in control to unspecified. */ virtual void SetValueToUnspecified( wxWindow* ctrl ) const = 0; /** Sets control's value specifically from string. */ virtual void SetControlStringValue( wxWindow* ctrl, const wxString& txt ) const; /** Sets control's value specifically from int (applies to choice etc.). */ virtual void SetControlIntValue( wxWindow* ctrl, int value ) const; /** Inserts item to existing control. Index -1 means appending. Default implementation does nothing. Returns index of item added. */ virtual int InsertItem( wxWindow* ctrl, const wxString& label, int index ) const; /** Deletes item from existing control. Default implementation does nothing. */ virtual void DeleteItem( wxWindow* ctrl, int index ) const; /** Extra processing when control gains focus. For example, wxTextCtrl based controls should select all text. */ virtual void OnFocus( wxPGProperty* property, wxWindow* wnd ) const; /** Returns true if control itself can contain the custom image. Default is to return false. */ virtual bool CanContainCustomImage() const; #if defined(__WXPYTHON__) && !defined(SWIG) // This is the python object that contains and owns the C++ representation. PyObject* m_scriptObject; #endif protected: }; //#ifndef SWIG #if 1 #define WX_PG_DECLARE_EDITOR_CLASS() \ public: \ virtual wxPG_CONST_WXCHAR_PTR GetName() const; \ private: #define WX_PG_IMPLEMENT_EDITOR_CLASS(EDITOR,CLASSNAME,BASECLASS) \ wxPG_CONST_WXCHAR_PTR CLASSNAME::GetName() const \ { \ return wxT(#EDITOR); \ } \ wxPGEditor* wxPGEditor_##EDITOR = (wxPGEditor*) NULL; \ wxPGEditor* wxPGConstruct##EDITOR##EditorClass() \ { \ wxASSERT( !wxPGEditor_##EDITOR ); \ return new CLASSNAME(); \ } #define WX_PG_IMPLEMENT_EDITOR_CLASS_STD_METHODS() \ wxPG_DECLARE_CREATECONTROLS \ virtual void UpdateControl( wxPGProperty* property, wxWindow* ctrl ) const; \ virtual bool OnEvent( wxPropertyGrid* propgrid, wxPGProperty* property, \ wxWindow* primary, wxEvent& event ) const; \ virtual bool CopyValueFromControl( wxPGProperty* property, wxWindow* ctrl ) const; \ virtual void SetValueToUnspecified( wxWindow* ctrl ) const; // // Following are the built-in editor classes. // class WXDLLIMPEXP_PG wxPGTextCtrlEditor : public wxPGEditor { WX_PG_DECLARE_EDITOR_CLASS() public: wxPGTextCtrlEditor() {} virtual ~wxPGTextCtrlEditor(); WX_PG_IMPLEMENT_EDITOR_CLASS_STD_METHODS() virtual void DrawValue( wxDC& dc, wxPGProperty* property, const wxRect& rect ) const; virtual void SetControlStringValue( wxWindow* ctrl, const wxString& txt ) const; virtual void OnFocus( wxPGProperty* property, wxWindow* wnd ) const; // Provided so that, for example, ComboBox editor can use the same code // (multiple inheritance would get way too messy). static bool OnTextCtrlEvent( wxPropertyGrid* propgrid, wxPGProperty* property, wxWindow* ctrl, wxEvent& event ); static bool CopyTextCtrlValueFromControl( wxPGProperty* property, wxWindow* ctrl ); }; class WXDLLIMPEXP_PG wxPGChoiceEditor : public wxPGEditor { WX_PG_DECLARE_EDITOR_CLASS() public: wxPGChoiceEditor() {} virtual ~wxPGChoiceEditor(); WX_PG_IMPLEMENT_EDITOR_CLASS_STD_METHODS() virtual void SetControlIntValue( wxWindow* ctrl, int value ) const; virtual void SetControlStringValue( wxWindow* ctrl, const wxString& txt ) const; virtual int InsertItem( wxWindow* ctrl, const wxString& label, int index ) const; virtual void DeleteItem( wxWindow* ctrl, int index ) const; virtual bool CanContainCustomImage() const; // CreateControls calls this with CB_READONLY in extraStyle wxWindow* CreateControlsBase( wxPropertyGrid* propgrid, wxPGProperty* property, const wxPoint& pos, const wxSize& sz, long extraStyle ) const; }; class WXDLLIMPEXP_PG wxPGComboBoxEditor : public wxPGChoiceEditor { WX_PG_DECLARE_EDITOR_CLASS() public: wxPGComboBoxEditor() {} virtual ~wxPGComboBoxEditor(); wxPG_DECLARE_CREATECONTROLS // Macro is used for conviency due to different signature with wxPython virtual void UpdateControl( wxPGProperty* property, wxWindow* ctrl ) const; virtual bool OnEvent( wxPropertyGrid* propgrid, wxPGProperty* property, wxWindow* ctrl, wxEvent& event ) const; virtual bool CopyValueFromControl( wxPGProperty* property, wxWindow* ctrl ) const; virtual void OnFocus( wxPGProperty* property, wxWindow* wnd ) const; }; class WXDLLIMPEXP_PG wxPGChoiceAndButtonEditor : public wxPGChoiceEditor { WX_PG_DECLARE_EDITOR_CLASS() public: wxPGChoiceAndButtonEditor() {} virtual ~wxPGChoiceAndButtonEditor(); wxPG_DECLARE_CREATECONTROLS // Macro is used for conviency due to different signature with wxPython }; class WXDLLIMPEXP_PG wxPGTextCtrlAndButtonEditor : public wxPGTextCtrlEditor { WX_PG_DECLARE_EDITOR_CLASS() public: wxPGTextCtrlAndButtonEditor() {} virtual ~wxPGTextCtrlAndButtonEditor(); wxPG_DECLARE_CREATECONTROLS }; #if wxPG_INCLUDE_CHECKBOX // // Use custom check box code instead of native control // for cleaner (ie. more integrated) look. // class WXDLLIMPEXP_PG wxPGCheckBoxEditor : public wxPGEditor { WX_PG_DECLARE_EDITOR_CLASS() public: wxPGCheckBoxEditor() {} virtual ~wxPGCheckBoxEditor(); WX_PG_IMPLEMENT_EDITOR_CLASS_STD_METHODS() virtual void DrawValue( wxDC& dc, wxPGProperty* property, const wxRect& rect ) const; virtual void SetControlIntValue( wxWindow* ctrl, int value ) const; }; #endif #endif // SWIG // ----------------------------------------------------------------------- // Value type registeration macros #define wxPGRegisterValueType(TYPENAME) \ if ( wxPGValueType_##TYPENAME == (wxPGValueType*) NULL ) \ { \ wxPGValueType_##TYPENAME = wxPropertyGrid::RegisterValueType( wxPGNewVT##TYPENAME(), false, wxT(#TYPENAME) ); \ } // Use this in RegisterDefaultValues. #define wxPGRegisterDefaultValueType(TYPENAME) \ if ( wxPGValueType_##TYPENAME == (wxPGValueType*) NULL ) \ { \ wxPGValueType_##TYPENAME = wxPropertyGrid::RegisterValueType( new wxPGValueType##TYPENAME##Class, true, wxT(#TYPENAME) ); \ } #define wxPG_INIT_REQUIRED_TYPE(T) \ wxPGRegisterValueType(T) // Use this with 'simple' value types (derived) #define wxPG_INIT_REQUIRED_TYPE2(T) \ if ( wxPGValueType_##T == (wxPGValueType*) NULL ) \ { \ wxPGValueType_##T = wxPropertyGrid::RegisterValueType( new wxPGValueType##T##Class, false, wxT(#T) ); \ } // ----------------------------------------------------------------------- // Editor class registeration macros #define wxPGRegisterEditorClass(EDITOR) \ if ( wxPGEditor_##EDITOR == (wxPGEditor*) NULL ) \ { \ wxPGEditor_##EDITOR = wxPropertyGrid::RegisterEditorClass( wxPGConstruct##EDITOR##EditorClass(), wxT(#EDITOR) ); \ } // Use this in RegisterDefaultEditors. #define wxPGRegisterDefaultEditorClass(EDITOR) \ if ( wxPGEditor_##EDITOR == (wxPGEditor*) NULL ) \ { \ wxPGEditor_##EDITOR = wxPropertyGrid::RegisterEditorClass( wxPGConstruct##EDITOR##EditorClass(), wxT(#EDITOR), true ); \ } #define wxPG_INIT_REQUIRED_EDITOR(T) \ wxPGRegisterEditorClass(T) // ----------------------------------------------------------------------- #define WX_PG_IMPLEMENT_SUBTYPE(VALUETYPE,CVALUETYPE,DEFPROPERTY,TYPESTRING,GETTER,DEFVAL) \ const wxPGValueType *wxPGValueType_##VALUETYPE = (wxPGValueType*) NULL; \ class wxPGValueType##VALUETYPE##Class : public wxPGValueType \ { \ public: \ virtual wxPG_CONST_WXCHAR_PTR GetTypeName() const { return TYPESTRING; } \ virtual wxPGVariant GetDefaultValue() const { return wxPGVariantCreator(m_default); } \ virtual wxVariant GenerateVariant( wxPGVariant value, const wxString& name ) const \ { return wxVariant( value.GETTER(), name ); } \ virtual wxPGProperty* GenerateProperty( const wxString& label, const wxString& name ) const \ { \ return wxPG_CONSTFUNC(DEFPROPERTY)(label,name); \ } \ virtual void SetValueFromVariant( wxPGProperty* property, wxVariant& value ) const \ { \ wxPG_CHECK_RET_DBG( wxStrcmp(GetTypeName(),value.GetType().c_str()) == 0, \ wxT("SetValueFromVariant: wxVariant type mismatch.") ); \ property->DoSetValue(value.GETTER()); \ } \ wxPGValueType##VALUETYPE##Class(); \ virtual ~wxPGValueType##VALUETYPE##Class(); \ protected: \ CVALUETYPE m_default; \ }; \ wxPGValueType##VALUETYPE##Class::wxPGValueType##VALUETYPE##Class() { m_default = DEFVAL; } \ wxPGValueType##VALUETYPE##Class::~wxPGValueType##VALUETYPE##Class() { } #define WX_PG_IMPLEMENT_VALUE_TYPE(VALUETYPE,DEFPROPERTY,TYPESTRING,GETTER,DEFVAL) \ WX_PG_IMPLEMENT_SUBTYPE(VALUETYPE,VALUETYPE,DEFPROPERTY,TYPESTRING,GETTER,DEFVAL) // // Implements wxVariantData for the type. // #define WX_PG_IMPLEMENT_VALUE_TYPE_VDC(VDCLASS,VALUETYPE) \ WX_PG_IMPLEMENT_DYNAMIC_CLASS_VARIANTDATA(VDCLASS,wxVariantData) \ VDCLASS::VDCLASS() { } \ VDCLASS::VDCLASS(const VALUETYPE& value) \ { \ m_value = value; \ } \ void VDCLASS::Copy(wxVariantData& data) \ { \ wxPG_CHECK_RET_DBG( data.GetType() == GetType(), wxT(#VDCLASS) wxT("::Copy: Can't copy to this type of data") ); \ VDCLASS& otherData = (VDCLASS&) data; \ otherData.m_value = m_value; \ } \ wxString VDCLASS::GetType() const \ { \ return wxString(wxT(#VALUETYPE)); \ } \ bool VDCLASS::Eq(wxVariantData& data) const \ { \ wxPG_CHECK_MSG_DBG( data.GetType() == GetType(), false, wxT(#VDCLASS) wxT("::Eq: argument mismatch") ); \ VDCLASS& otherData = (VDCLASS&) data; \ return otherData.m_value == m_value; \ } \ void* VDCLASS::GetValuePtr() { return (void*)&m_value; } #define WX_PG_GENVARIANT_WXOBJ_BASE(VALUETYPE) \ virtual wxVariant GenerateVariant( wxPGVariant value, const wxString& name ) const \ { return wxVariant( new wxVariantData_##VALUETYPE( (*(VALUETYPE*)wxPGVariantGetWxObjectPtr(value)) ), name ); } #define WX_PG_GENVARIANT_VOIDP_SIMPLE() \ virtual wxVariant GenerateVariant( wxPGVariant value, const wxString& name ) const \ { \ void* ptr = (void*)wxPGVariantToVoidPtr(value); \ wxASSERT( ptr ); \ if ( !ptr ) return wxVariant(); \ return wxVariant( ptr, name ); \ } #define WX_PG_GENVARIANT_VOIDP_CVD(VDCLASS, VALUETYPE) \ virtual wxVariant GenerateVariant( wxPGVariant value, const wxString& name ) const \ { \ void* ptr = (void*)wxPGVariantToVoidPtr(value); \ wxASSERT( ptr ); \ if ( !ptr ) return wxVariant(); \ return wxVariant( new VDCLASS(*((VALUETYPE*)ptr)), name ); \ } // TODO: When ready, remove GetValueClassInfo #define WX_PG_IMPLEMENT_VALUE_TYPE_WXOBJ_BASE(VALUETYPE,DEFPROPERTY,DEFVAL) \ class WX_PG_DECLARE_VALUE_TYPE_VDC(VALUETYPE) \ virtual wxClassInfo* GetValueClassInfo(); \ }; \ WX_PG_IMPLEMENT_VALUE_TYPE_VDC(wxVariantData_##VALUETYPE,VALUETYPE) \ wxClassInfo* wxVariantData_##VALUETYPE::GetValueClassInfo() \ { \ return m_value.GetClassInfo(); \ } \ const wxPGValueType *wxPGValueType_##VALUETYPE = (wxPGValueType*) NULL; \ class wxPGValueType##VALUETYPE##Class : public wxPGValueType \ { \ public: \ virtual wxPG_CONST_WXCHAR_PTR GetTypeName() const { return CLASSINFO(VALUETYPE)->GetClassName(); } \ WX_PG_GENVARIANT_WXOBJ_BASE(VALUETYPE) \ virtual wxPGProperty* GenerateProperty( const wxString& label, const wxString& name ) const \ { \ return wxPG_CONSTFUNC(DEFPROPERTY)(label,name); \ } \ virtual void SetValueFromVariant( wxPGProperty* property, wxVariant& value ) const \ { \ const VALUETYPE* real_value; \ wxPG_CHECK_RET_DBG( wxStrcmp(GetTypeName(),value.GetType().c_str()) == 0, \ wxT("GetPtrFromVariant: wxVariant type mismatch.") ); \ wxVariantData_##VALUETYPE* vd = wxDynamicCastVariantData(value.GetData(), wxVariantData_##VALUETYPE); \ if ( vd ) \ real_value = &vd->GetValue(); \ else \ real_value = ((const VALUETYPE*)value.GetWxObjectPtr()); \ property->DoSetValue( (wxObject*) real_value ); \ } // This should not be used by built-in types (advprops.cpp types should use it though) #define WX_PG_IMPLEMENT_VALUE_TYPE_CREATOR(VALUETYPE) \ wxPGValueType* wxPGNewVT##VALUETYPE() { return new wxPGValueType##VALUETYPE##Class; } #define WX_PG_IMPLEMENT_VALUE_TYPE_WXOBJ(VALUETYPE,DEFPROPERTY,DEFVAL) \ WX_PG_IMPLEMENT_VALUE_TYPE_WXOBJ_BASE(VALUETYPE,DEFPROPERTY,DEFVAL) \ virtual wxPGVariant GetDefaultValue() const { return wxPGVariantCreator(DEFVAL); } \ }; \ WX_PG_IMPLEMENT_VALUE_TYPE_CREATOR(VALUETYPE) #define WX_PG_IMPLEMENT_VALUE_TYPE_WXOBJ_OWNDEFAULT(VALUETYPE,DEFPROPERTY,DEFVAL) \ WX_PG_IMPLEMENT_VALUE_TYPE_WXOBJ_BASE(VALUETYPE,DEFPROPERTY,DEFVAL) \ wxPGValueType##VALUETYPE##Class() { m_default = DEFVAL; } \ virtual ~wxPGValueType##VALUETYPE##Class() { } \ virtual wxPGVariant GetDefaultValue() const { return wxPGVariantCreator((wxObject*)&m_default); } \ protected: \ VALUETYPE m_default; \ }; \ WX_PG_IMPLEMENT_VALUE_TYPE_CREATOR(VALUETYPE) #define WX_PG_IMPLEMENT_VALUE_TYPE_VOIDP_BASE(VALUETYPE,DEFPROPERTY,DEFVAL,VDCLASS) \ const wxPGValueType *wxPGValueType_##VALUETYPE = (wxPGValueType*)NULL; \ class wxPGValueType##VALUETYPE##Class : public wxPGValueType \ { \ protected: \ VALUETYPE m_default; \ public: \ virtual wxPG_CONST_WXCHAR_PTR GetTypeName() const { return wxT(#VALUETYPE); } \ virtual wxPG_CONST_WXCHAR_PTR GetCustomTypeName() const { return wxT(#VALUETYPE); } \ virtual wxPGVariant GetDefaultValue() const { return wxPGVariantCreator((void*)&m_default); } \ virtual wxPGProperty* GenerateProperty( const wxString& label, const wxString& name ) const \ { \ return wxPG_CONSTFUNC(DEFPROPERTY)(label,name); \ } \ virtual void SetValueFromVariant( wxPGProperty* property, wxVariant& value ) const \ { \ wxPG_CHECK_RET_DBG( wxStrcmp(GetTypeName(),value.GetType().c_str()) == 0, \ wxT("SetValueFromVariant: wxVariant type mismatch.") ); \ VDCLASS* vd = (VDCLASS*)value.GetData(); \ wxPG_CHECK_RET_DBG( wxDynamicCastVariantData(vd, VDCLASS), \ wxT("SetValueFromVariant: wxVariantData mismatch.")); \ property->DoSetValue((void*)&vd->GetValue() ); \ } \ wxPGValueType##VALUETYPE##Class() { m_default = DEFVAL; } \ virtual ~wxPGValueType##VALUETYPE##Class() { } #define WX_PG_IMPLEMENT_VALUE_TYPE_VOIDP_SIMPLE(VALUETYPE,DEFPROPERTY,DEFVAL) \ WX_PG_IMPLEMENT_VALUE_TYPE_VOIDP_BASE(VALUETYPE,DEFPROPERTY,DEFVAL,wxVariantData_##VALUETYPE) \ WX_PG_GENVARIANT_VOIDP_SIMPLE() \ }; \ WX_PG_IMPLEMENT_VALUE_TYPE_CREATOR(VALUETYPE) // If you use this macro in application code, you need to pair it with // WX_PG_DECLARE_VALUE_TYPE with this instead of _VOIDP version. #define WX_PG_IMPLEMENT_VALUE_TYPE_VOIDP_CVD(VALUETYPE,DEFPROPERTY,DEFVAL,VDCLASS) \ WX_PG_IMPLEMENT_VALUE_TYPE_VOIDP_BASE(VALUETYPE,DEFPROPERTY,DEFVAL,VDCLASS) \ WX_PG_GENVARIANT_VOIDP_CVD(VDCLASS, VALUETYPE) \ }; \ WX_PG_IMPLEMENT_VALUE_TYPE_CREATOR(VALUETYPE) #define WX_PG_IMPLEMENT_VALUE_TYPE_VOIDP2(VALUETYPE,DEFPROPERTY,DEFVAL,VDCLASS) \ WX_PG_IMPLEMENT_VALUE_TYPE_VDC(VDCLASS,VALUETYPE) \ WX_PG_IMPLEMENT_VALUE_TYPE_VOIDP_CVD(VALUETYPE,DEFPROPERTY,DEFVAL,VDCLASS) #define WX_PG_IMPLEMENT_VALUE_TYPE_VOIDP(VALUETYPE,DEFPROPERTY,DEFVAL) \ WX_PG_IMPLEMENT_VALUE_TYPE_VOIDP2(VALUETYPE,DEFPROPERTY,DEFVAL,wxVariantData_##VALUETYPE) // // Use this to create a new type with a different default value. // NOTE: With this type you need to use wxPG_INIT_REQUIRED_TYPE2 // instead of wxPG_INIT_REQUIRED_TYPE. #define WX_PG_IMPLEMENT_DERIVED_TYPE(VALUETYPE,PARENTVT,DEFVAL) \ const wxPGValueType *wxPGValueType_##VALUETYPE = (wxPGValueType*) NULL; \ class wxPGValueType##VALUETYPE##Class : public wxPGValueType \ { \ protected: \ const wxPGValueType* m_parentClass; \ PARENTVT m_default; \ public: \ virtual wxPG_CONST_WXCHAR_PTR GetTypeName() const { return m_parentClass->GetTypeName(); } \ virtual wxPG_CONST_WXCHAR_PTR GetCustomTypeName() const { return wxT(#VALUETYPE); } \ virtual wxPGVariant GetDefaultValue() const { return wxPGVariantCreator(m_default); } \ virtual wxVariant GenerateVariant ( wxPGVariant value, const wxString& name ) const \ { return m_parentClass->GenerateVariant(value,name); } \ virtual wxPGProperty* GenerateProperty ( const wxString& label, const wxString& name ) const \ { return m_parentClass->GenerateProperty(label,name); } \ virtual void SetValueFromVariant ( wxPGProperty* property, wxVariant& value ) const \ { m_parentClass->SetValueFromVariant(property,value); } \ wxPGValueType##VALUETYPE##Class(); \ virtual ~wxPGValueType##VALUETYPE##Class(); \ }; \ wxPGValueType##VALUETYPE##Class::wxPGValueType##VALUETYPE##Class() \ { \ m_default = DEFVAL; \ m_parentClass = wxPGValueType_##PARENTVT; \ wxASSERT( m_parentClass != (wxPGValueType*) NULL); \ } \ wxPGValueType##VALUETYPE##Class::~wxPGValueType##VALUETYPE##Class() { } // ----------------------------------------------------------------------- // // Additional property class declaration helper macros // #define WX_PG_DECLARE_DERIVED_PROPERTY_CLASS() \ public: \ WX_PG_DECLARE_GETCLASSNAME \ WX_PG_DECLARE_GETCLASSINFO \ private: // ----------------------------------------------------------------------- // // Property class implementation helper macros. // #define WX_PG_DECLARE_PARENTAL_TYPE_METHODS() \ virtual void DoSetValue ( wxPGVariant value ); \ virtual wxPGVariant DoGetValue () const; #define WX_PG_DECLARE_BASIC_TYPE_METHODS() \ virtual void DoSetValue ( wxPGVariant value ); \ virtual wxPGVariant DoGetValue () const; \ virtual wxString GetValueAsString ( int argFlags = 0 ) const; \ virtual bool SetValueFromString ( const wxString& text, int flags = 0 ); // class WXDLLIMPEXP_PG #define wxPG_BEGIN_PROPERTY_CLASS_BODY2(CLASSNAME,UPCLASS,T,INTERNAL_T,T_AS_ARG,DECL) \ DECL CLASSNAME : public UPCLASS \ { \ WX_PG_DECLARE_PROPERTY_CLASS_NOPARENS \ protected: \ INTERNAL_T m_value; \ public: \ CLASSNAME( const wxString& label, const wxString& name, T_AS_ARG value ); \ virtual ~CLASSNAME(); #define wxPG_BEGIN_PROPERTY_CLASS_BODY(NAME,UPCLASS,T,T_AS_ARG) \ wxPG_BEGIN_PROPERTY_CLASS_BODY2(wxPG_PROPCLASS(NAME),UPCLASS,T,T,T_AS_ARG,class) #define wxPG_BEGIN_PROPERTY_CLASS_BODY_WITH_DECL(NAME,UPCLASS,T,T_AS_ARG,DECL) \ wxPG_BEGIN_PROPERTY_CLASS_BODY2(wxPG_PROPCLASS(NAME),UPCLASS,T,T,T_AS_ARG,class DECL) #define wxPG_END_PROPERTY_CLASS_BODY() \ }; #define WX_PG_DECLARE_CHOICE_METHODS() \ virtual bool SetValueFromInt( long value, int flags = 0 ); \ virtual int GetChoiceInfo( wxPGChoiceInfo* choiceinfo ); #define WX_PG_DECLARE_EVENT_METHODS() \ virtual bool OnEvent( wxPropertyGrid* propgrid, wxWindow* primary, wxEvent& event ); #define WX_PG_DECLARE_PARENTAL_METHODS() \ virtual void ChildChanged( wxPGProperty* p ); \ virtual void RefreshChildren(); #define WX_PG_DECLARE_CUSTOM_PAINT_METHODS() \ virtual wxSize GetImageSize() const; \ virtual void OnCustomPaint( wxDC& dc, const wxRect& rect, wxPGPaintData& paintdata ); #define WX_PG_DECLARE_ATTRIBUTE_METHODS() \ virtual void SetAttribute( int id, wxVariant& value ); #if wxUSE_VALIDATORS #define WX_PG_DECLARE_VALIDATOR_METHODS() \ virtual wxValidator* DoGetValidator() const; #else #define WX_PG_DECLARE_VALIDATOR_METHODS() #endif #if wxPG_INCLUDE_WXOBJECT #define wxPG_GETCLASSNAME_IMPLEMENTATION(PROPNAME) #else #define wxPG_GETCLASSNAME_IMPLEMENTATION(PROPNAME) \ static const wxChar* PROPNAME##_ClassName = wxT(#PROPNAME); \ wxPG_CONST_WXCHAR_PTR PROPNAME##Class::GetClassName() const { return PROPNAME##_ClassName; } #endif // Implements sans constructor function. Also, first arg is class name, not property name. #define WX_PG_IMPLEMENT_PROPERTY_CLASS_PLAIN(PROPNAME,T,EDITOR) \ wxPG_GETCLASSNAME_IMPLEMENTATION(PROPNAME) \ wxPG_VALUETYPE_MSGVAL PROPNAME##Class::GetValueType() const \ { \ return wxPG_VALUETYPE(T); \ } \ const wxPGEditor* PROPNAME##Class::DoGetEditorClass() const \ { \ return wxPGEditor_##EDITOR; \ } #define WX_PG_IMPLEMENT_CLASSINFO(NAME,UPCLASS) \ static wxPGProperty* NAME##Class2(const wxString& label, const wxString& name) \ { \ return wxPG_CONSTFUNC(NAME)(label,name); \ } \ wxPGPropertyClassInfo NAME##ClassInfo = {wxT(#NAME),&UPCLASS##Info,&NAME##Class2}; \ const wxPGPropertyClassInfo* NAME##Class::GetClassInfo() const \ { \ return &NAME##ClassInfo; \ } // second constfunc and classinfo is for creating properties w/o value from text // (should be changed to simpler scheme in 1.2) #define WX_PG_IMPLEMENT_CONSTFUNC(NAME,T_AS_ARG) \ wxPGProperty* wxPG_CONSTFUNC(NAME)( const wxString& label, const wxString& name, T_AS_ARG value ) \ { \ return new wxPG_PROPCLASS(NAME)(label,name,value); \ } // Adds constructor function as well. #define WX_PG_IMPLEMENT_PROPERTY_CLASS2(NAME,CLASSNAME,UPCLASS,T,T_AS_ARG,EDITOR) \ WX_PG_IMPLEMENT_CONSTFUNC(NAME,T_AS_ARG) \ WX_PG_IMPLEMENT_CLASSINFO(NAME,UPCLASS) \ WX_PG_IMPLEMENT_PROPERTY_CLASS_PLAIN(NAME,T,EDITOR) // A regular property #define WX_PG_IMPLEMENT_PROPERTY_CLASS(NAME,UPNAME,T,T_AS_ARG,EDITOR) \ WX_PG_IMPLEMENT_PROPERTY_CLASS2(NAME,wxPG_PROPCLASS(NAME),wxPG_PROPCLASS(UPNAME),T,T_AS_ARG,EDITOR) // Derived property class is one that inherits from an existing working property // class, but assumes same value and editor type. #define WX_PG_IMPLEMENT_DERIVED_PROPERTY_CLASS(NAME,UPNAME,T_AS_ARG) \ WX_PG_IMPLEMENT_CONSTFUNC(NAME,T_AS_ARG) \ WX_PG_IMPLEMENT_CLASSINFO(NAME,UPNAME##Class) \ wxPG_GETCLASSNAME_IMPLEMENTATION(NAME) // ----------------------------------------------------------------------- #define wxPG_NO_ESCAPE wxPG_PROP_NO_ESCAPE // No escape sequences #define wxPG_ESCAPE 0 // Escape sequences #define WX_PG_IMPLEMENT_STRING_PROPERTY_WITH_VALIDATOR(NAME,FLAGS) \ class NAME##Class : public wxLongStringPropertyClass \ { \ WX_PG_DECLARE_DERIVED_PROPERTY_CLASS() \ public: \ NAME##Class( const wxString& name, const wxString& label, const wxString& value ); \ virtual ~NAME##Class(); \ virtual bool OnButtonClick( wxPropertyGrid* propgrid, wxString& value ); \ WX_PG_DECLARE_VALIDATOR_METHODS() \ }; \ WX_PG_IMPLEMENT_DERIVED_PROPERTY_CLASS(NAME,wxLongStringProperty,const wxString&) \ NAME##Class::NAME##Class( const wxString& name, const wxString& label, const wxString& value ) \ : wxLongStringPropertyClass(name,label,value) \ { \ m_flags |= FLAGS; \ } \ NAME##Class::~NAME##Class() { } #if wxUSE_VALIDATORS #define WX_PG_IMPLEMENT_STRING_PROPERTY(NAME,FLAGS) \ WX_PG_IMPLEMENT_STRING_PROPERTY_WITH_VALIDATOR(NAME,FLAGS) \ wxValidator* wxPG_PROPCLASS(NAME)::DoGetValidator () const \ { return (wxValidator*) NULL; } #else #define WX_PG_IMPLEMENT_STRING_PROPERTY WX_PG_IMPLEMENT_STRING_PROPERTY_WITH_VALIDATOR #endif // ----------------------------------------------------------------------- // This will create interface for wxFlagsProperty derived class // named CLASSNAME. #define WX_PG_IMPLEMENT_CUSTOM_FLAGS_PROPERTY2(NAME,CLASSNAME,LABELS,VALUES,DEFVAL) \ class CLASSNAME : public wxFlagsPropertyClass \ { \ WX_PG_DECLARE_PROPERTY_CLASS() \ public: \ CLASSNAME( const wxString& label, const wxString& name, long value ); \ virtual ~CLASSNAME(); \ }; \ WX_PG_IMPLEMENT_DERIVED_TYPE(long_##NAME,long,DEFVAL) \ WX_PG_IMPLEMENT_PROPERTY_CLASS(NAME,wxFlagsProperty,long_##NAME,long,TextCtrl) \ CLASSNAME::CLASSNAME( const wxString& label, const wxString& name, long value ) \ : wxFlagsPropertyClass(label,name,LABELS,VALUES,value!=-1?value:DEFVAL) \ { \ wxPG_INIT_REQUIRED_TYPE2(long_##NAME) \ m_flags |= wxPG_PROP_STATIC_CHOICES; \ } \ CLASSNAME::~CLASSNAME() { } #define WX_PG_IMPLEMENT_CUSTOM_FLAGS_PROPERTY(NAME,LABELS,VALUES,DEFVAL) \ WX_PG_IMPLEMENT_CUSTOM_FLAGS_PROPERTY2(NAME,wxPG_PROPCLASS(NAME),LABELS,VALUES,DEFVAL) // ----------------------------------------------------------------------- // This will create interface for Enum property derived class // named CLASSNAME. #define WX_PG_IMPLEMENT_CUSTOM_ENUM_PROPERTY2(NAME,CLASSNAME,LABELS,VALUES,DEFVAL) \ class CLASSNAME : public wxEnumPropertyClass \ { \ WX_PG_DECLARE_PROPERTY_CLASS() \ public: \ CLASSNAME ( const wxString& label, const wxString& name, int value ); \ virtual ~CLASSNAME(); \ }; \ WX_PG_IMPLEMENT_DERIVED_TYPE(long_##NAME,long,DEFVAL) \ WX_PG_IMPLEMENT_PROPERTY_CLASS(NAME,wxEnumProperty,long_##NAME,int,Choice) \ CLASSNAME::CLASSNAME ( const wxString& label, const wxString& name, int value ) \ : wxEnumPropertyClass(label,name,LABELS,VALUES,value!=-1?value:DEFVAL) \ { \ wxPG_INIT_REQUIRED_TYPE2(long_##NAME) \ m_flags |= wxPG_PROP_STATIC_CHOICES; \ } \ CLASSNAME::~CLASSNAME() { } #define WX_PG_IMPLEMENT_CUSTOM_ENUM_PROPERTY(NAME,LABELS,VALUES,DEFVAL) \ WX_PG_IMPLEMENT_CUSTOM_ENUM_PROPERTY2(NAME,wxPG_PROPCLASS(NAME),LABELS,VALUES,DEFVAL) // ----------------------------------------------------------------------- // Implementation for user wxColour editor property #define WX_PG_IMPLEMENT_CUSTOM_COLOUR_PROPERTY2(NAME,CLASSNAME,LABELS,VALUES,COLOURS) \ class CLASSNAME : public wxPG_PROPCLASS(wxSystemColourProperty) \ { \ WX_PG_DECLARE_DERIVED_PROPERTY_CLASS() \ public: \ CLASSNAME( const wxString& label, const wxString& name, \ const wxColourPropertyValue& value ); \ virtual ~CLASSNAME (); \ virtual long GetColour ( int index ); \ }; \ static wxPGChoices gs_##NAME##_choicesCache; \ WX_PG_IMPLEMENT_DERIVED_PROPERTY_CLASS(NAME,wxSystemColourProperty,const wxColourPropertyValue&) \ CLASSNAME::CLASSNAME( const wxString& label, const wxString& name, \ const wxColourPropertyValue& value ) \ : wxPG_PROPCLASS(wxSystemColourProperty)(label,name,LABELS,VALUES,&gs_##NAME##_choicesCache,value ) \ { \ wxPG_INIT_REQUIRED_TYPE(wxColourPropertyValue) \ m_flags |= wxPG_PROP_TRANSLATE_CUSTOM; \ DoSetValue ( &m_value ); \ } \ CLASSNAME::~CLASSNAME () { } \ long CLASSNAME::GetColour ( int index ) \ { \ const wxArrayInt& values = GetValues(); \ if ( !values.GetCount() ) \ { \ wxASSERT( index < (int)m_choices.GetCount() ); \ return COLOURS[index]; \ } \ return COLOURS[values[index]]; \ } #define WX_PG_IMPLEMENT_CUSTOM_COLOUR_PROPERTY(NAME,LABELS,VALUES,COLOURS) \ WX_PG_IMPLEMENT_CUSTOM_COLOUR_PROPERTY2(NAME,wxPG_PROPCLASS(NAME),LABELS,VALUES,COLOURS) // ----------------------------------------------------------------------- #define WX_PG_IMPLEMENT_CUSTOM_COLOUR_PROPERTY_USES_WXCOLOUR2(NAME,CLASSNAME,LABELS,VALUES,COLOURS,EDITOR) \ class CLASSNAME : public wxPG_PROPCLASS(wxSystemColourProperty) \ { \ WX_PG_DECLARE_PROPERTY_CLASS() \ public: \ CLASSNAME( const wxString& label, const wxString& name, \ const wxColour& value ); \ virtual ~CLASSNAME (); \ virtual void DoSetValue ( wxPGVariant value ); \ virtual wxPGVariant DoGetValue() const; \ virtual wxString GetValueAsString ( int argFlags ) const; \ virtual long GetColour ( int index ); \ }; \ static wxPGChoices gs_##NAME##_choicesCache; \ WX_PG_IMPLEMENT_PROPERTY_CLASS(NAME,wxSystemColourProperty,wxColour,const wxColour&,EDITOR) \ CLASSNAME::CLASSNAME( const wxString& label, const wxString& name, const wxColour& value ) \ : wxPG_PROPCLASS(wxSystemColourProperty)(label,name,LABELS,VALUES,&gs_##NAME##_choicesCache,value ) \ { \ wxPG_INIT_REQUIRED_TYPE(wxColour) \ m_flags |= wxPG_PROP_TRANSLATE_CUSTOM; \ DoSetValue(&m_value.m_colour); \ } \ CLASSNAME::~CLASSNAME () { } \ void CLASSNAME::DoSetValue( wxPGVariant value ) \ { \ wxColour* pval = wxPGVariantToWxObjectPtr(value, wxColour); \ wxCHECK_RET(pval, wxT("NULL wxColour pointer")); \ m_value.m_type = wxPG_COLOUR_CUSTOM; \ if ( m_flags & wxPG_PROP_TRANSLATE_CUSTOM ) \ { \ int found_ind = ColToInd(*pval); \ if ( found_ind != wxNOT_FOUND ) m_value.m_type = found_ind; \ } \ m_value.m_colour = *pval; \ if ( m_value.m_type < wxPG_COLOUR_WEB_BASE ) \ wxPG_PROPCLASS(wxEnumProperty)::DoSetValue ( (long)m_value.m_type ); \ else \ m_index = GetItemCount()-1; \ } \ wxPGVariant CLASSNAME::DoGetValue() const \ { \ return wxPGVariantCreator(m_value.m_colour); \ } \ wxString CLASSNAME::GetValueAsString( int argFlags ) const \ { \ const wxPGEditor* editor = GetEditorClass(); \ if ( editor != wxPG_EDITOR(Choice) && \ editor != wxPG_EDITOR(ChoiceAndButton) ) \ argFlags |= wxPG_PROPERTY_SPECIFIC; \ return wxSystemColourPropertyClass::GetValueAsString(argFlags); \ } \ long CLASSNAME::GetColour( int index ) \ { \ const wxArrayInt& values = GetValues(); \ if ( !values.GetCount() ) \ { \ wxASSERT( index < (int)GetItemCount() ); \ return COLOURS[index]; \ } \ return COLOURS[values[index]]; \ } #define WX_PG_IMPLEMENT_CUSTOM_COLOUR_PROPERTY_USES_WXCOLOUR(NAME,LABELS,VALUES,COLOURS) \ WX_PG_IMPLEMENT_CUSTOM_COLOUR_PROPERTY_USES_WXCOLOUR2(NAME,wxPG_PROPCLASS(NAME),LABELS,VALUES,COLOURS,Choice) // ----------------------------------------------------------------------- // // These macros helps creating DoGetValidator #define WX_PG_DOGETVALIDATOR_ENTRY() \ WX_PG_GLOBALS_LOCKER() \ static wxValidator* s_ptr = (wxValidator*) NULL; \ if ( s_ptr ) return s_ptr; // Common function exit #define WX_PG_DOGETVALIDATOR_EXIT(VALIDATOR) \ s_ptr = VALIDATOR; \ wxPGGlobalVars->m_arrValidators.Add( (void*) VALIDATOR ); \ return VALIDATOR; // ----------------------------------------------------------------------- // // Ids for sub-controls // NB: It should not matter what these are. #define wxPG_SUBID1 11485 #define wxPG_SUBID2 11486 #define wxPG_SUBID_TEMP1 11487 // ----------------------------------------------------------------------- /** \class wxPGPaintData \ingroup classes \brief Contains information relayed to property's OnCustomPaint. */ struct wxPGPaintData { /** wxPropertyGrid. */ const wxPropertyGrid* m_parent; /** Normally -1, otherwise index to drop-down list item that has to be drawn. */ int m_choiceItem; /** Set to drawn width in OnCustomPaint (optional). */ int m_drawnWidth; /** In a measure item call, set this to the height of item at m_choiceItem index. */ int m_drawnHeight; }; // ----------------------------------------------------------------------- #ifndef SWIG /** \class wxPGInDialogValidator \ingroup classes \brief Creates and manages a temporary wxTextCtrl for validation purposes. Uses wxPropertyGrid's current editor, if available. */ class WXDLLIMPEXP_PG wxPGInDialogValidator { public: wxPGInDialogValidator() { m_textCtrl = NULL; } ~wxPGInDialogValidator() { if ( m_textCtrl ) m_textCtrl->Destroy(); } bool DoValidate( wxPropertyGrid* propGrid, wxValidator* validator, const wxString& value ); private: wxTextCtrl* m_textCtrl; }; #endif #ifndef DOXYGEN // ----------------------------------------------------------------------- // Some property class definitions (these should be useful to inherit from). // ----------------------------------------------------------------------- //#ifndef SWIG #if 1 #define wxPG_PROP_PASSWORD wxPG_PROP_CLASS_SPECIFIC_2 class WXDLLIMPEXP_PG wxStringPropertyClass : public wxPGProperty { WX_PG_DECLARE_PROPERTY_CLASS_NOPARENS public: wxStringPropertyClass( const wxString& label, const wxString& name, const wxString& value ); virtual ~wxStringPropertyClass(); WX_PG_DECLARE_BASIC_TYPE_METHODS() WX_PG_DECLARE_ATTRIBUTE_METHODS() protected: wxString m_value; }; // ----------------------------------------------------------------------- // This provides base for wxEnumPropertyClass and any custom // "dynamic" enum property classes. class WXDLLIMPEXP_PG wxBaseEnumPropertyClass : public wxPGProperty { public: wxBaseEnumPropertyClass( const wxString& label, const wxString& name ); virtual void DoSetValue( wxPGVariant value ); virtual wxPGVariant DoGetValue() const; virtual wxString GetValueAsString( int argFlags ) const; virtual bool SetValueFromString( const wxString& text, int argFlags ); virtual bool SetValueFromInt( long value, int argFlags ); // // Additional virtuals // This must be overridden to have non-index based value virtual int GetIndexForValue( int value ) const; // This returns string and value for index // Returns NULL if beyond last item // pvalue is never NULL - always set it. virtual const wxString* GetEntry( size_t index, int* pvalue ) const = 0; protected: int m_index; }; // ----------------------------------------------------------------------- // If set, then selection of choices is static and should not be // changed (i.e. returns NULL in GetPropertyChoices). #define wxPG_PROP_STATIC_CHOICES wxPG_PROP_CLASS_SPECIFIC_1 class WXDLLIMPEXP_PG wxEnumPropertyClass : public wxBaseEnumPropertyClass { WX_PG_DECLARE_PROPERTY_CLASS() public: #ifndef SWIG wxEnumPropertyClass( const wxString& label, const wxString& name, const wxChar** labels, const long* values = NULL, int value = 0 ); wxEnumPropertyClass( const wxString& label, const wxString& name, wxPGChoices& choices, int value = 0 ); // Special constructor for caching choices (used by derived class) wxEnumPropertyClass( const wxString& label, const wxString& name, const wxChar** labels, const long* values, wxPGChoices* choicesCache, int value = 0 ); #endif wxEnumPropertyClass( const wxString& label, const wxString& name, const wxArrayString& labels, const wxArrayInt& values = wxArrayInt(), int value = 0 ); virtual ~wxEnumPropertyClass(); virtual int GetChoiceInfo( wxPGChoiceInfo* choiceinfo ); virtual int GetIndexForValue( int value ) const; virtual const wxString* GetEntry( size_t index, int* pvalue ) const; inline size_t GetItemCount() const { return m_choices.GetCount(); } inline const wxArrayInt& GetValues() const { return m_choices.GetValues(); } protected: wxPGChoices m_choices; }; // ----------------------------------------------------------------------- class WXDLLIMPEXP_PG wxFlagsPropertyClass : public wxPGPropertyWithChildren { WX_PG_DECLARE_PROPERTY_CLASS() public: #ifndef SWIG wxFlagsPropertyClass( const wxString& label, const wxString& name, const wxChar** labels, const long* values = NULL, long value = 0 ); wxFlagsPropertyClass( const wxString& label, const wxString& name, wxPGChoices& choices, long value = 0 ); #endif wxFlagsPropertyClass( const wxString& label, const wxString& name, const wxArrayString& labels, const wxArrayInt& values, int value = 0 ); virtual ~wxFlagsPropertyClass (); virtual void DoSetValue( wxPGVariant value ); virtual wxPGVariant DoGetValue() const; virtual wxString GetValueAsString( int argFlags ) const; virtual bool SetValueFromString( const wxString& text, int flags ); virtual void ChildChanged( wxPGProperty* p ); virtual void RefreshChildren(); // this is necessary for conveying m_choices virtual int GetChoiceInfo( wxPGChoiceInfo* choiceinfo ); // helpers inline size_t GetItemCount() const { return m_choices.GetCount(); } inline const wxArrayInt& GetValues() const { return m_choices.GetValues(); } inline const wxString& GetLabel( size_t ind ) const { return m_choices.GetLabel(ind); } protected: wxPGChoices m_choices; // Used to detect if choices have been changed wxPGChoicesData* m_oldChoicesData; long m_value; // Converts string id to a relevant bit. long IdToBit( const wxString& id ) const; // Creates children and sets value. void Init(); }; // ----------------------------------------------------------------------- #include // Indicates first bit useable by derived properties. #define wxPG_PROP_SHOW_FULL_FILENAME wxPG_PROP_CLASS_SPECIFIC_1 class WXDLLIMPEXP_PG wxFilePropertyClass : public wxPGProperty { WX_PG_DECLARE_PROPERTY_CLASS() public: wxFilePropertyClass( const wxString& label, const wxString& name = wxPG_LABEL, const wxString& value = wxEmptyString ); virtual ~wxFilePropertyClass (); virtual void DoSetValue( wxPGVariant value ); virtual wxPGVariant DoGetValue() const; virtual wxString GetValueAsString( int argFlags ) const; virtual bool SetValueFromString( const wxString& text, int flags ); virtual bool OnEvent( wxPropertyGrid* propgrid, wxWindow* wnd_primary, wxEvent& event ); virtual void SetAttribute( int id, wxVariant& value ); int GetFilterIndex(){ return m_indFilter; } #if wxUSE_VALIDATORS static wxValidator* GetClassValidator(); virtual wxValidator* DoGetValidator() const; #endif protected: wxString m_wildcard; wxString m_fnstr; // needed for return value wxString m_basePath; // If set, then show path relative to it wxString m_initialPath; // If set, start the file dialog here wxString m_dlgTitle; // If set, used as title for file dialog wxFileName m_filename; // used as primary storage int m_indFilter; // index to the selected filter }; // ----------------------------------------------------------------------- #define wxPG_PROP_NO_ESCAPE wxPG_PROP_CLASS_SPECIFIC_1 // // In wxTextCtrl, strings a space delimited C-like strings. For example: // "String 1" "String 2" "String 3" // // To have " in a string, use \". // To have \ in a string, use \\. // class WXDLLIMPEXP_PG wxLongStringPropertyClass : public wxBasePropertyClass { WX_PG_DECLARE_PROPERTY_CLASS() public: wxLongStringPropertyClass( const wxString& label, const wxString& name = wxPG_LABEL, const wxString& value = wxEmptyString ); virtual ~wxLongStringPropertyClass(); virtual void DoSetValue( wxPGVariant value ); virtual wxPGVariant DoGetValue() const; virtual wxString GetValueAsString( int argFlags = 0 ) const; virtual bool SetValueFromString( const wxString& text, int flags ); WX_PG_DECLARE_EVENT_METHODS() // Shows string editor dialog. Value to be edited should be read from value, and // if dialog is not cancelled, it should be stored back and true should be returned // if that was the case. virtual bool OnButtonClick( wxPropertyGrid* propgrid, wxString& value ); protected: wxString m_value; }; // ----------------------------------------------------------------------- // wxBoolProperty specific flags #define wxPG_PROP_USE_CHECKBOX wxPG_PROP_CLASS_SPECIFIC_1 // DCC = Double Click Cycles #define wxPG_PROP_USE_DCC wxPG_PROP_CLASS_SPECIFIC_2 // ----------------------------------------------------------------------- class WXDLLIMPEXP_PG wxArrayStringPropertyClass : public wxPGProperty { WX_PG_DECLARE_PROPERTY_CLASS() public: wxArrayStringPropertyClass( const wxString& label, const wxString& name, const wxArrayString& value ); virtual ~wxArrayStringPropertyClass(); WX_PG_DECLARE_BASIC_TYPE_METHODS() WX_PG_DECLARE_EVENT_METHODS() virtual void GenerateValueAsString(); // Shows string editor dialog. Value to be edited should be read from value, and // if dialog is not cancelled, it should be stored back and true should be returned // if that was the case. virtual bool OnCustomStringEdit( wxWindow* parent, wxString& value ); // Helper. virtual bool OnButtonClick( wxPropertyGrid* propgrid, wxWindow* primary, const wxChar* cbt ); // Creates wxArrayEditorDialog for string editing. Called in OnButtonClick. virtual wxArrayEditorDialog* CreateEditorDialog(); protected: wxArrayString m_value; wxString m_display; // Cache for displayed text. }; #define WX_PG_IMPLEMENT_ARRAYSTRING_PROPERTY_WITH_VALIDATOR(PROPNAME,DELIMCHAR,CUSTBUTTXT) \ class wxPG_PROPCLASS(PROPNAME) : public wxPG_PROPCLASS(wxArrayStringProperty) \ { \ WX_PG_DECLARE_PROPERTY_CLASS() \ public: \ wxPG_PROPCLASS(PROPNAME)( const wxString& label, const wxString& name, const wxArrayString& value ); \ ~wxPG_PROPCLASS(PROPNAME)(); \ virtual void GenerateValueAsString(); \ virtual bool SetValueFromString( const wxString& text, int ); \ virtual bool OnEvent( wxPropertyGrid* propgrid, wxWindow* primary, wxEvent& event ); \ virtual bool OnCustomStringEdit( wxWindow* parent, wxString& value ); \ WX_PG_DECLARE_VALIDATOR_METHODS() \ }; \ WX_PG_IMPLEMENT_PROPERTY_CLASS(PROPNAME,wxArrayStringProperty,wxArrayString,const wxArrayString&,TextCtrlAndButton) \ wxPG_PROPCLASS(PROPNAME)::wxPG_PROPCLASS(PROPNAME) ( const wxString& label, const wxString& name, const wxArrayString& value ) \ : wxPG_PROPCLASS(wxArrayStringProperty)(label,name,value) \ { \ wxPG_PROPCLASS(PROPNAME)::GenerateValueAsString(); \ } \ wxPG_PROPCLASS(PROPNAME)::~wxPG_PROPCLASS(PROPNAME)() { } \ void wxPG_PROPCLASS(PROPNAME)::GenerateValueAsString() \ { \ wxChar delimChar = DELIMCHAR; \ if ( delimChar == wxT('"') ) \ wxPG_PROPCLASS(wxArrayStringProperty)::GenerateValueAsString(); \ else \ wxPropertyGrid::ArrayStringToString(m_display,m_value,0,DELIMCHAR,0); \ } \ bool wxPG_PROPCLASS(PROPNAME)::SetValueFromString( const wxString& text, int ) \ { \ wxChar delimChar = DELIMCHAR; \ if ( delimChar == wxT('"') ) \ return wxPG_PROPCLASS(wxArrayStringProperty)::SetValueFromString(text,0); \ \ m_value.Empty(); \ WX_PG_TOKENIZER1_BEGIN(text,DELIMCHAR) \ m_value.Add( token ); \ WX_PG_TOKENIZER1_END() \ GenerateValueAsString(); \ return true; \ } \ bool wxPG_PROPCLASS(PROPNAME)::OnEvent( wxPropertyGrid* propgrid, wxWindow* primary, wxEvent& event ) \ { \ if ( event.GetEventType() == wxEVT_COMMAND_BUTTON_CLICKED ) \ return OnButtonClick(propgrid,primary,(const wxChar*) CUSTBUTTXT); \ return false; \ } #if wxUSE_VALIDATORS #define WX_PG_IMPLEMENT_ARRAYSTRING_PROPERTY(PROPNAME,DELIMCHAR,CUSTBUTTXT) \ WX_PG_IMPLEMENT_ARRAYSTRING_PROPERTY_WITH_VALIDATOR(PROPNAME,DELIMCHAR,CUSTBUTTXT) \ wxValidator* wxPG_PROPCLASS(PROPNAME)::DoGetValidator () const \ { return (wxValidator*) NULL; } #else #define WX_PG_IMPLEMENT_ARRAYSTRING_PROPERTY_WITH_VALIDATOR WX_PG_IMPLEMENT_ARRAYSTRING_PROPERTY #endif // ----------------------------------------------------------------------- // wxPGEditorDialog // TODO: To be enabled for 1.3. // ----------------------------------------------------------------------- #if 0 class wxPGEditorDialog : public wxDialog { public: wxPGEditorDialog() : wxDialog() { m_modified = false; } /** Called instead non-virtual Create. Must call wxDialog::Create internally. Note that wxPropertyGrid is always dialog's parent. \params custBtText: Allow setting single custom button action. Text is button title. Event must be intercepted in property's OnEvent() member function. Not all dialogs are expected to support this. */ virtual bool VCreate( wxPropertyGrid* pg, wxPGProperty* p, const wxString& caption, const wxString& message, wxVariant value, const wxChar* custBtText = NULL ) = 0; virtual wxVariant GetValue() const = 0; // Returns true if value was actually modified inline bool IsModified() const { return m_modified; } protected: bool m_modified; private: }; #endif // ----------------------------------------------------------------------- // wxArrayEditorDialog // ----------------------------------------------------------------------- #include #include #include #define wxAEDIALOG_STYLE \ (wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxOK | wxCANCEL | wxCENTRE) class WXDLLIMPEXP_PG wxArrayEditorDialog : public wxDialog { public: wxArrayEditorDialog(); void Init(); wxArrayEditorDialog( wxWindow *parent, const wxString& message, const wxString& caption, long style = wxAEDIALOG_STYLE, const wxPoint& pos = wxDefaultPosition, const wxSize& sz = wxDefaultSize ); bool Create( wxWindow *parent, const wxString& message, const wxString& caption, long style = wxAEDIALOG_STYLE, const wxPoint& pos = wxDefaultPosition, const wxSize& sz = wxDefaultSize ); /** Set value modified by dialog. */ virtual void SetDialogValue( const wxVariant& WXUNUSED(value) ) { wxFAIL_MSG(wxT("re-implement this member function in derived class")); } /** Return value modified by dialog. */ virtual wxVariant GetDialogValue() const { wxFAIL_MSG(wxT("re-implement this member function in derived class")); return wxVariant(); } /** Override to return wxValidator to be used with the wxTextCtrl in dialog. Note that the validator is used in the standard wx way, ie. it immediately prevents user from entering invalid input. \remarks Dialog frees the validator. */ virtual wxValidator* GetTextCtrlValidator() const { return (wxValidator*) NULL; } // Returns true if array was actually modified bool IsModified() const { return m_modified; } //const wxArrayString& GetStrings() const { return m_array; } // implementation from now on void OnUpdateClick(wxCommandEvent& event); void OnAddClick(wxCommandEvent& event); void OnDeleteClick(wxCommandEvent& event); void OnListBoxClick(wxCommandEvent& event); void OnUpClick(wxCommandEvent& event); void OnDownClick(wxCommandEvent& event); //void OnCustomEditClick(wxCommandEvent& event); void OnIdle(wxIdleEvent& event); protected: wxTextCtrl* m_edValue; wxListBox* m_lbStrings; wxButton* m_butAdd; // Button pointers wxButton* m_butCustom; // required for disabling/enabling changing. wxButton* m_butUpdate; wxButton* m_butRemove; wxButton* m_butUp; wxButton* m_butDown; //wxArrayString m_array; const wxChar* m_custBtText; //wxArrayStringPropertyClass* m_pCallingClass; bool m_modified; unsigned char m_curFocus; // These must be overridden - must return true on success. virtual wxString ArrayGet( size_t index ) = 0; virtual size_t ArrayGetCount() = 0; virtual bool ArrayInsert( const wxString& str, int index ) = 0; virtual bool ArraySet( size_t index, const wxString& str ) = 0; virtual void ArrayRemoveAt( int index ) = 0; virtual void ArraySwap( size_t first, size_t second ) = 0; private: #ifndef SWIG DECLARE_DYNAMIC_CLASS_NO_COPY(wxArrayEditorDialog) DECLARE_EVENT_TABLE() #endif }; // ----------------------------------------------------------------------- /** This is a simple property which holds sub-properties. Has default editing textctrl based editing capability. In essence, it is a category that has look and feel of a property, and which children can be edited via the textctrl. */ class WXDLLIMPEXP_PG wxParentPropertyClass : public wxPGPropertyWithChildren { WX_PG_DECLARE_PROPERTY_CLASS() public: wxParentPropertyClass( const wxString& label, const wxString& name = wxPG_LABEL ); virtual ~wxParentPropertyClass(); virtual void DoSetValue( wxPGVariant value ); virtual wxPGVariant DoGetValue() const; virtual void ChildChanged( wxPGProperty* p ); virtual wxString GetValueAsString( int argFlags = 0 ) const; protected: wxString m_string; }; // ----------------------------------------------------------------------- #endif // #ifndef SWIG /** \class wxCustomPropertyClass \ingroup classes \brief This is a rather inefficient but very versatile property class. Base class offers the following: - Add any properties as children (i.e. like wxParentProperty) - Editor control can be set at run-time. - By default has string value type. - Has capacity to have choices. - Can have custom-paint bitmap. Also note: - Has m_parentingType of -2 (technical detail). */ class WXDLLIMPEXP_PG wxCustomPropertyClass : public wxPGPropertyWithChildren { #ifndef SWIG WX_PG_DECLARE_PROPERTY_CLASS() #endif public: wxCustomPropertyClass( const wxString& label, const wxString& name = wxPG_LABEL ); virtual ~wxCustomPropertyClass(); virtual void DoSetValue( wxPGVariant value ); virtual wxPGVariant DoGetValue() const; virtual bool SetValueFromString( const wxString& text, int flags ); virtual wxString GetValueAsString( int argFlags ) const; #ifdef wxPG_COMPATIBILITY_1_0_0 virtual bool OnEvent ( wxPropertyGrid* propgrid, wxWindow* primary, wxEvent& event ); #endif WX_PG_DECLARE_CUSTOM_PAINT_METHODS() virtual bool SetValueFromInt ( long value, int arg_flags ); virtual int GetChoiceInfo ( wxPGChoiceInfo* choiceinfo ); virtual void SetAttribute ( int id, wxVariant& value ); protected: //wxPGChoicesData* m_choices; wxPGChoices m_choices; #ifdef wxPG_COMPATIBILITY_1_0_0 wxPropertyGridCallback m_callback; #endif wxPGPaintCallback m_paintCallback; wxString m_value; }; // ----------------------------------------------------------------------- #ifndef SWIG // // Tokenizer macros. // NOTE: I have made two versions - worse ones (performance and consistency // wise) use wxStringTokenizer and better ones (may have unfound bugs) // use custom code. // #include // TOKENIZER1 can be done with wxStringTokenizer #define WX_PG_TOKENIZER1_BEGIN(WXSTRING,DELIMITER) \ wxStringTokenizer tkz(WXSTRING,DELIMITER,wxTOKEN_RET_EMPTY); \ while ( tkz.HasMoreTokens() ) \ { \ wxString token = tkz.GetNextToken(); \ token.Trim(true); \ token.Trim(false); #define WX_PG_TOKENIZER1_END() \ } // // 2nd version: tokens are surrounded by DELIMITERs (for example, C-style strings). // TOKENIZER2 must use custom code (a class) for full compliancy // with " surrounded strings with \" inside. // // class implementation is in propgrid.cpp // class WXDLLIMPEXP_PG wxPGStringTokenizer { public: wxPGStringTokenizer( const wxString& str, wxChar delimeter ); ~wxPGStringTokenizer(); bool HasMoreTokens(); // not const so we can do some stuff in it wxString GetNextToken(); protected: #ifndef SWIG const wxString* m_str; wxString::const_iterator m_curPos; wxString m_readyToken; wxUniChar m_delimeter; #endif }; #define WX_PG_TOKENIZER2_BEGIN(WXSTRING,DELIMITER) \ wxPGStringTokenizer tkz(WXSTRING,DELIMITER); \ while ( tkz.HasMoreTokens() ) \ { \ wxString token = tkz.GetNextToken(); #define WX_PG_TOKENIZER2_END() \ } #endif // ----------------------------------------------------------------------- #endif // !DOXYGEN #endif // _WX_PROPGRID_PROPDEV_H_ wxformbuilder-3.1.59/src/controls/include/wx/wxFlatNotebook/wxFNBDropTarget.h0000644000175000017500000001032711143440026027564 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // Name: wxFNBDropTarget.h // Purpose: helper class to implement drag and drop of tabs in the wxFNB // Author: T-Rex // Modified by: Eran Ifrah // Created: 30/12/2005 // Modified: 01/01/2006 // Licence: wxWindows license /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_FNB_DROP_TARGET_H #define _WX_FNB_DROP_TARGET_H #include #include /** \brief Contains the information about dragged page (page index and container). */ class wxFNBDragInfo { wxWindow * m_Container; int m_PageIndex; public: /** Constructor \param container - pointer to wxPageContainer object which contains dragged page \param pageindex - index of dragged page */ wxFNBDragInfo(wxWindow * container, int pageindex) : m_Container(container), m_PageIndex(pageindex){} /** * \brief default constructor */ wxFNBDragInfo() : m_Container(0), m_PageIndex(0){} /** Returns wxPageContainer object which contains dragged page */ wxWindow * GetContainer() {return m_Container;} /** Returns the index of dragged page */ int GetPageIndex() {return m_PageIndex;} }; class wxFNBDragInfoDataObject : public wxDataObjectSimple { public: wxFNBDragInfoDataObject(const wxDataFormat& format):wxDataObjectSimple(format) {} wxFNBDragInfo DragInfo; wxFNBDragInfo *GetData() { return &DragInfo; } // get the size of our data virtual size_t GetDataSize() const { return sizeof(wxFNBDragInfo); } // copy our data to the buffer virtual bool GetDataHere(void *buf) const { memcpy(buf, &DragInfo, sizeof(wxFNBDragInfo)); return true; } // copy data from buffer to our data virtual bool SetData(size_t WXUNUSED(len), const void *buf) { // don't check the len. Under Win98 the value of 'len' == 0 memcpy(&DragInfo, buf, sizeof(wxFNBDragInfo)); return true; } }; /** \brief Used for processing drag-n-drop opeartions */ template class wxFNBDropTarget : public wxDropTarget { private: typedef wxDragResult (T::*pt2Func)(wxCoord, wxCoord, int, wxWindow *); T* m_pParent; pt2Func m_pt2CallbackFunc; wxFNBDragInfoDataObject * m_DataObject; public: /** \brief Constructor \param pParent - Object that will handle drag-n-drop operation \param pt2CallbackFunc - Pointer to callback method which should be called after dragging the notebook page */ wxFNBDropTarget(T* pParent, pt2Func pt2CallbackFunc) : m_pParent(pParent) , m_pt2CallbackFunc(pt2CallbackFunc) , m_DataObject(NULL) { m_DataObject = new wxFNBDragInfoDataObject(wxDataFormat(wxT("wxFNB"))); SetDataObject(m_DataObject); } /** \brief Virtual Destructor */ virtual ~wxFNBDropTarget(void) {} /** \brief Used for processing drop operation \param x - X-coordinate \param y - Y-coordinate \param def - Result of drag-n-drop operation */ virtual wxDragResult OnData(wxCoord x, wxCoord y, wxDragResult WXUNUSED(def)) { GetData(); wxFNBDragInfo * draginfo = (wxFNBDragInfo *)m_DataObject->GetData(); if(!draginfo) { return wxDragNone; } return (m_pParent->*m_pt2CallbackFunc)(x, y, draginfo->GetPageIndex(), (T *)draginfo->GetContainer()); } }; /** * \ingroup wxFlatNotebook * This class represents a source for a drag and drop operation * We override wxDropSource class to provide user with a feedback * * \version 1.0 * first version * * \date 10-11-2006 * * \author Eran */ class wxFNBDropSource : public wxDropSource { wxWindow* m_win; public: /** * Parameterized constructor * \param win * \param iconCopy * \param iconMove * \param iconNone */ wxFNBDropSource(wxWindow* win = NULL) : wxDropSource(win) , m_win( win ) { } /** * Destructor */ virtual ~wxFNBDropSource() { } /** * give some custom UI feedback during the drag and drop operation in this function. It is called on each mouse move, so your implementation must not be too slow * \param effect The effect to implement. One of wxDragCopy, wxDragMove, wxDragLink and wxDragNone * \return */ virtual bool GiveFeedback(wxDragResult effect); }; #endif wxformbuilder-3.1.59/src/controls/include/wx/wxFlatNotebook/renderer.h0000644000175000017500000002046111143440026026412 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // Name: renerder.h // Author: Eran Ifrah // Created: 30/12/2005 // Modified: 01/01/2006 // Copyright: Eran Ifrah (c) // Licence: wxWindows license /////////////////////////////////////////////////////////////////////////////// #ifndef RENDERE_H #define RENDERE_H #include #include #include #include #include #include #include #include class WXDLLIMPEXP_FNB wxFNBRenderer { protected: // A bitmap that holds the background of the // x button which is drawn on a tab wxBitmap m_tabXBgBmp, m_xBgBmp, m_leftBgBmp, m_rightBgBmp; wxBitmap m_arrowDown, m_arrowUp; public: wxFNBRenderer(); virtual ~wxFNBRenderer(); /** * Generic function that draws the tabs and updates values in the page container * MAC requires that the event will be skipped, so we must pass it * \param pageContainer window that contains the tabs drawing * \param dc device context */ virtual void DrawTabs(wxWindow* pageContainer, wxDC &dc, wxEvent &event); /** * Draw a small 'x' button on top of the tab * \param pageContainer parent window on which to draw * \param dc device context to use * \param rect button rectangle * \param tabIdx tab index * \param btnStatus button status, can be one of * - wxFNB_BTN_PRESSED * - wxFNB_BTN_HOVER * - wxFNB_BTN_NONE * \param tabXBgBmp [output] background bitmap of the area of the button (just before it is painted) */ virtual void DrawTabX(wxWindow* pageContainer, wxDC& dc, const wxRect& rect, const int& tabIdx, const int btnStatus); /** * Draw tab * \param pageContainer parent window on which to draw * \param dc device context to use * \param posx tab x coordinate * \param tabIdx tab index * \param tabWidth tab width * \param tabHeight tab height * \param btnStatus btnStatus the little 'x' button (on top of the active tab) status, can be one of * - wxFNB_BTN_PRESSED * - wxFNB_BTN_HOVER * - wxFNB_BTN_NONE */ virtual void DrawTab(wxWindow* pageContainer, wxDC &dc, const int &posx, const int &tabIdx, const int &tabWidth, const int &tabHeight, const int btnStatus) = 0; /** * Calculate tab width , based on its index (for image, x button on tab) * \param pageContainer pageContainer parent window on which to draw * \param tabIdx tab index * \param tabHeight the tab height (used for tan() function calculations) * \return tab bouding rectangle size */ virtual int CalcTabWidth (wxWindow* pageContainer, int tabIdx, int tabHeight); /** * Calculate tab height * \param pageContainer pageContainer parent window on which to draw * \return tab bouding rectangle size */ virtual int CalcTabHeight(wxWindow* pageContainer); /** * Get a bitmap from device context, with rect size * \param dc device context * \param rect bitmap rectangle * \param bmp [output] bitmap */ virtual void GetBitmap(wxDC& dc, const wxRect &rect, wxBitmap &bmp); /** * Draw a bottom line for the tabs area * \param pageContainer the owner of this tabs * \param dc device context to use * \param selTabX1 the selection tab X1 coord * \param selTabX2 the selection tab X2 coord */ void DrawTabsLine(wxWindow *pageContainer, wxDC& dc, wxCoord selTabX1 = -1, wxCoord selTabX2 = -1); /** * Brighten a given colour with amount * \param color starting colour * \param percent percent, 0 - no change, 100 - white * \return brighten colour */ static wxColor LightColour(const wxColour& color, int percent); /** * Paint rectangle with gradient colouring * \param dc device context * \param rect rectangle * \param startColor gradient colour 1 * \param endColor gradient colour 2 * \param vertical use vertical gradient or horizontal */ static void PaintStraightGradientBox(wxDC& dc, const wxRect& rect, const wxColour& startColor, const wxColour& endColor, bool vertical = true); // Navigation buttons position int GetLeftButtonPos(wxWindow *pageContainer); int GetRightButtonPos(wxWindow *pageContainer); int GetXPos(wxWindow *pageContainer); int GetButtonsAreaLength(wxWindow *pageContainer); int GetDropArrowButtonPos(wxWindow *pageContainer); /// Draw right arrow button to the right area of the tabs virtual void DrawRightArrow(wxWindow *pageContainer, wxDC &dc); /// Draw left arrow button to the right area of the tabs virtual void DrawLeftArrow (wxWindow *pageContainer, wxDC &dc); /// Draw 'x' button to the right area of the tabs virtual void DrawX (wxWindow *pageContainer, wxDC &dc); /** * Draw tab drag hint, the default implementation is to do nothing ... * u can override this function to provide a nice feedback to user * \param pageContainer a pointer to the owner wxPageContainer * \param tabIdx index of the tab that will be replaced with the dragged tab */ virtual void DrawDragHint(wxWindow *pageContainer, int tabIdx); /** * Draw drop down arrow on the right corner * \param pageContainer window tabs container * \param dc device context */ void DrawDropDownArrow(wxWindow* pageContainer, wxDC& dc); /** * Return an array of tabs info that can fit to screen starting from 'from' * \param pageContainer * \param [output] vTabInfo * \param from */ virtual void NumberTabsCanFit(wxWindow *pageContainer, std::vector &vTabInfo, int from = -1); protected: /** * Generate random colour * \return random colour */ wxColour RandomColor(); }; typedef wxFNBSmartPtr wxFNBRendererPtr; class wxFNBRendererDefault : public wxFNBRenderer { public: wxFNBRendererDefault(){} virtual ~wxFNBRendererDefault(){} virtual void DrawTab(wxWindow* pageContainer, wxDC &dc, const int &posx, const int &tabIdx, const int &tabWidth, const int &tabHeight, const int btnStatus); }; class wxFNBRendererFirefox2 : public wxFNBRenderer { public: wxFNBRendererFirefox2(){} virtual ~wxFNBRendererFirefox2(){} virtual void DrawTab(wxWindow* pageContainer, wxDC &dc, const int &posx, const int &tabIdx, const int &tabWidth, const int &tabHeight, const int btnStatus); }; class wxFNBRendererVC71 : public wxFNBRenderer { public: wxFNBRendererVC71(){} virtual ~wxFNBRendererVC71(){} virtual void DrawTab(wxWindow* pageContainer, wxDC &dc, const int &posx, const int &tabIdx, const int &tabWidth, const int &tabHeight, const int btnStatus); }; class wxFNBRendererFancy : public wxFNBRenderer { public: wxFNBRendererFancy(){} virtual ~wxFNBRendererFancy(){} virtual void DrawTab(wxWindow* pageContainer, wxDC &dc, const int &posx, const int &tabIdx, const int &tabWidth, const int &tabHeight, const int btnStatus); }; class wxFNBRendererVC8 : public wxFNBRenderer { int m_factor; bool m_first; public: wxFNBRendererVC8() : m_factor(1), m_first(true) {} virtual ~wxFNBRendererVC8(){} virtual void DrawTab(wxWindow* pageContainer, wxDC &dc, const int &posx, const int &tabIdx, const int &tabWidth, const int &tabHeight, const int btnStatus); virtual void DrawTabs(wxWindow *pageContainer, wxDC &dc, wxEvent &event); void NumberTabsCanFit(wxWindow *pageContainer, std::vector &vTabInfo, int from = -1); private: void FillVC8GradientColor(wxWindow* pageContainer, wxDC &dc, const wxPoint tabPoints[], const bool bSelectedTab, const int tabIdx); int GetEndX(const wxPoint tabPoints[], const int &y, long style); int GetStartX(const wxPoint tabPoints[], const int &y, long style); }; //----------------------------------- // Renderer manager class //----------------------------------- class wxFNBRendererMgr { friend class wxFNBSingleton; std::map m_renderers; public: /** * Return the renderer according to the style flag, the returned pointer should not be * deleted by caller, it is owned by this class * \param style window style flag * \return wxFNBRenderer */ wxFNBRendererPtr GetRenderer(long style); private: wxFNBRendererMgr(); virtual ~wxFNBRendererMgr(); }; /// Patch (DLL) ---- Ti-R ---- Enable to get a real singleton share over dlls // --- old --- //typedef wxFNBSingleton wxFNBRendererMgrST; class WXDLLIMPEXP_FNB wxFNBRendererMgrST:public wxFNBSingleton {}; #endif // RENDERE_H wxformbuilder-3.1.59/src/controls/include/wx/wxFlatNotebook/wxFlatNotebookSDK.h0000644000175000017500000000127711143440026030120 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // Name: wxFlatNotebookSDK.h // Purpose: a class which contains marcos required by wxFlatNotebook // Author: Eran Ifrah // Created: 30/12/2005 // Modified: 01/01/2006 // Copyright: Eran Ifrah (c) // Licence: wxWindows license /////////////////////////////////////////////////////////////////////////////// #ifdef WXMAKINGDLL_FNB # define WXDLLIMPEXP_FNB WXEXPORT #elif defined(WXUSINGDLL_FNB) # define WXDLLIMPEXP_FNB WXIMPORT #else /* not making nor using FNB as DLL */ # define WXDLLIMPEXP_FNB #endif // WXMAKINGDLL_FNB wxformbuilder-3.1.59/src/controls/include/wx/wxFlatNotebook/fnb_resources.h0000644000175000017500000000303311143440026027437 0ustar rrmulderrrmulder///////////////////////////////////////////////////////////////////////////// // Name: fnb_resources.h // Purpose: resources used by wxFlatNotebook // Author: Armel Asselin // Created: 2008/02/12 // RCS-ID: $Id: $ // Copyright: (c) 2008 Eran Ifrah // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef FNB_RESOURCES_H #define FNB_RESOURCES_H extern size_t tab_selection_png_size; extern unsigned char tab_selection_png[]; // Control left arrow images extern const char *left_arrow_disabled_xpm[]; extern const char *left_arrow_hilite_xpm[]; extern const char *left_arrow_xpm[]; extern const char *left_arrow_pressed_xpm[]; // Control right arrow extern const char *right_arrow_hilite_xpm[]; extern const char *right_arrow_pressed_xpm[]; extern const char *right_arrow_xpm[]; extern const char *right_arrow_disabled_xpm[]; // Cotrol down arrow extern const char *down_arrow_hilite_xpm[]; extern const char *down_arrow_pressed_xpm[]; extern const char *down_arrow_xpm[]; // X button extern const char *x_button_hilite_xpm[]; extern const char *tab_x_button_pressed_xpm[]; extern const char *x_button_pressed_xpm[]; extern const char *x_button_xpm[]; // Popup dialog xpm extern unsigned char signpost_alpha[]; extern const char *signpost_xpm[]; // Drag hint arrows extern const char *arrow_down_blue_xpm[]; extern const char *arrow_up_blue_xpm[]; extern unsigned char arrow_down_blue_alpha[]; extern unsigned char arrow_up_blue_alpha[]; #endif // FNB_RESOURCES_H wxformbuilder-3.1.59/src/controls/include/wx/wxFlatNotebook/xh_fnb.h0000644000175000017500000000177111143440026026053 0ustar rrmulderrrmulder///////////////////////////////////////////////////////////////////////////// // Name: xh_fnb.h // Purpose: XRC resource for wxFlatNotebook // Author: Armel Asselin // Created: 2006/10/30 // RCS-ID: $Id: $ // Copyright: (c) 2006 Armel Asselin // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_XH_FLATNOTBK_H_ #define _WX_XH_FLATNOTBK_H_ #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma interface "xh_notbk.h" #endif #include "wx/xrc/xmlres.h" #if wxUSE_NOTEBOOK #include "wx/wxFlatNotebook/wxFlatNotebook.h" class WXDLLIMPEXP_FNB wxFlatNotebook; class WXDLLIMPEXP_FNB wxFlatNotebookXmlHandler : public wxXmlResourceHandler { DECLARE_DYNAMIC_CLASS(wxFlatNotebookXmlHandler) public: wxFlatNotebookXmlHandler(); virtual wxObject *DoCreateResource(); virtual bool CanHandle(wxXmlNode *node); private: bool m_isInside; wxFlatNotebook *m_notebook; }; #endif #endif // _WX_XH_NOTBK_H_ wxformbuilder-3.1.59/src/controls/include/wx/wxFlatNotebook/wxFlatNotebook.h0000644000175000017500000007121411143440026027554 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // Name: wxFlatNotebook.cpp // Purpose: generic implementation of flat style notebook class. // Author: Eran Ifrah // Modified by: Priyank Bolia // Created: 30/12/2005 // Modified: 01/01/2006 // Copyright: Eran Ifrah (c) // Licence: wxWindows license /////////////////////////////////////////////////////////////////////////////// #ifndef WXFLATNOTEBOOK_H #define WXFLATNOTEBOOK_H #include #include #include #include #ifdef __WXMSW__ #ifdef _DEBUG //#include #define DEBUG_NEW new(_NORMAL_BLOCK ,__FILE__, __LINE__) #else #define DEBUG_NEW new #endif #endif // __WXMSW__ #include #include #include #include class wxPageContainer; #ifndef M_PI #define M_PI 3.14159265358979 #endif #ifndef wxFNB_HEIGHT_SPACER #define wxFNB_HEIGHT_SPACER 10 #endif // forward declerations class wxFNBRenderer; class wxFNBRendererDefault; class wxFNBRendererVC71; class wxFNBRendererVC8; class wxTabNavigatorWindow; class wxMenu; // Since some compiler complains about std::min, we define our own macro #define FNB_MIN(a, b) ((a > b) ? b : a) WX_DECLARE_USER_EXPORTED_OBJARRAY(wxBitmap, wxFlatNotebookImageList, WXDLLIMPEXP_FNB); WX_DECLARE_USER_EXPORTED_OBJARRAY(wxWindow*, wxWindowPtrArray, WXDLLIMPEXP_FNB); /// wxFlatNotebook styles #define wxFNB_DEFAULT_STYLE wxFNB_MOUSE_MIDDLE_CLOSES_TABS #define wxFNB_VC71 0x00000001 #define wxFNB_FANCY_TABS 0x00000002 #define wxFNB_TABS_BORDER_SIMPLE 0x00000004 #define wxFNB_NO_X_BUTTON 0x00000008 #define wxFNB_NO_NAV_BUTTONS 0x00000010 #define wxFNB_MOUSE_MIDDLE_CLOSES_TABS 0x00000020 #define wxFNB_BOTTOM 0x00000040 #define wxFNB_NODRAG 0x00000080 #define wxFNB_VC8 0x00000100 #define wxFNB_X_ON_TAB 0x00000200 #define wxFNB_BACKGROUND_GRADIENT 0x00000400 #define wxFNB_COLORFUL_TABS 0x00000800 #define wxFNB_DCLICK_CLOSES_TABS 0x00001000 #define wxFNB_SMART_TABS 0x00002000 #define wxFNB_DROPDOWN_TABS_LIST 0x00004000 #define wxFNB_ALLOW_FOREIGN_DND 0x00008000 #define wxFNB_FF2 0x00010000 // Firefox 2 tabs style #define wxFNB_CUSTOM_DLG 0x00020000 // Popup customize dialog using right click /// Patch ---- Ti-R ---- Enable to have the same line color as the selected tab #define wxFNB_BOTTOM_LINE_COLOR_CHANGE 0x00100000 #define wxFNB_INVERSE_COLOR_LINE_VC8 0x00200000 #define wxFNB_PREVIEW_SELECT_TAB 0x00400000 /// General macros #define VERTICAL_BORDER_PADDING 4 #define BUTTON_SPACE 16 #define VC8_SHAPE_LEN 16 #define MASK_COLOR wxColor(0, 128, 128) enum wxCustomizeDlgOptions { wxFNB_CUSTOM_TAB_LOOK = 0x00000001, ///< Allow customizing the tab appearance wxFNB_CUSTOM_ORIENTATION = 0x00000002, ///< Allow customizing the tab orientation (upper | bottom) wxFNB_CUSTOM_FOREIGN_DRAG = 0x00000004, ///< Allow accept foreign tabs wxFNB_CUSTOM_LOCAL_DRAG = 0x00000008, ///< Allow local drag and drop wxFNB_CUSTOM_CLOSE_BUTTON = 0x00000010, ///< Allow customizing close button wxFNB_CUSTOM_ALL = wxFNB_CUSTOM_TAB_LOOK | wxFNB_CUSTOM_ORIENTATION | wxFNB_CUSTOM_FOREIGN_DRAG | wxFNB_CUSTOM_LOCAL_DRAG | wxFNB_CUSTOM_CLOSE_BUTTON }; /** * \brief Nice cross-platform flat notebook with X-button, navigation arrows and much more */ class WXDLLIMPEXP_FNB wxFlatNotebook : public wxPanel { public: ///Default constructor wxFlatNotebook() { Init(); } /// Parametrized constructor /** \param parent - parent window \param id - window ID \param pos - window position \param size - window size \param style - window style \param name - window class name */ wxFlatNotebook(wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxT("Flat Notebook")); /** * See wxFlatNotebook constructor */ bool Create(wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxT("Flat Notebook")); /// Destructor virtual ~wxFlatNotebook(void); /** * Cleans up all the optimization structures held globally * */ static void CleanUp (); /** * Advance the current selection *\param bForward - if set to true then selection should be advanced forward otherwise - backward */ void AdvanceSelection(bool bForward); /// Apends new notebook page /** \param windows - window to be appended \param caption - tab caption \param selected - determines if new page should be selected automatically \param imgindex - page image index */ bool AddPage(wxWindow* windows, const wxString& caption, const bool selected = false, const int imgindex = -1); /// Inserts new notebook page /** \param index - page index \param page - window to be appended \param text - tab caption \param select - determines if new page should be selected automatically \param imgindex - page image index */ bool InsertPage(size_t index, wxWindow* page, const wxString& text, bool select = false, const int imgindex = -1); /// Changes the selection from currently visible/selected page to the page given by index. /** \param page - index of page to be selected */ void SetSelection(size_t page); /// Removes the window from the notebook, and destroys the window associated with that notebook page. /** * \param page - index of page to be deleted * \param notify - by default wxFlatNotebook fires two events: * - wxEVT_COMMAND_FLATNOTEBOOK_PAGE_CLOSED * - wxEVT_COMMAND_FLATNOTEBOOK_PAGE_CLOSING * to disable this functionality set notify to false */ void DeletePage(size_t page, bool notify = true); /// Deletes all notebook pages and destroys all windows associated with pages bool DeleteAllPages(); /// Returns the total number of pages in the notebook. int GetPageCount() const; /// Returns the window object associated with selected notebook page. wxWindow * GetCurrentPage() const; /// Returns the window object associated with a notebook page. /** \param page - page index */ wxWindow * GetPage(size_t page) const; /// Returns the page index of the window object. /** \param win - window object */ int GetPageIndex(wxWindow* win) const; /// Returns the currently visible/selected notebook page 0 based index. int GetSelection() const; /** * Return the previous selection, useful when implementing smart tabulation * \return previous selection, or wxNOT_FOUND */ int GetPreviousSelection() const; const wxArrayInt &GetBrowseHistory() const; /// Returns tab header inclination angle of specified page /** \param page_index - page index \param result - pointer to the variable that receives the result */ bool GetPageShapeAngle(int page_index, unsigned int * result); /// Sets tab header inclination angle of specified page /** \param page_index - page index \param angle - new value of tab header inclination angle */ void SetPageShapeAngle(int page_index, unsigned int angle); /// Sets tab header inclination angle for all pages /** \param angle - new value of tab header inclination angle */ void SetAllPagesShapeAngle(unsigned int angle); /// Returns the best size for a page wxSize GetPageBestSize(); /// Sets the caption/text of the notebook page /** \param page - page index \param text - new value of tab caption */ bool SetPageText(size_t page, const wxString& text); /** * Removes the window from the notebook, and destroys the window associated with that notebook page. * \param page - index of page to be deleted * \param notify - by default wxFlatNotebook fires two events: * - wxEVT_COMMAND_FLATNOTEBOOK_PAGE_CLOSED * - wxEVT_COMMAND_FLATNOTEBOOK_PAGE_CLOSING * to disable this functionality set notify to false */ bool RemovePage(size_t page, bool notify = true); /// Sets the amount of space around each page's icon and label, in pixels. /** NB: The vertical padding cannot be changed in for wxFlatNotebook. \param padding - new amount of space around each page's icon and label */ void SetPadding(const wxSize& padding); /// Alters the notebook style /** \param style - new value of notebook style */ virtual void SetWindowStyleFlag(long style); /// Sets a right click menu to the notebook /** \param menu - right click menu object */ void SetRightClickMenu(wxMenu* menu); /// Returns the page text /** \param page - page index */ wxString GetPageText(size_t page); /// Sets an image index of specified page /** \param page - page index \param imgindex - new image index */ void SetPageImageIndex(size_t page, int imgindex); /// Returns an image index of specified page /** \param page - page index */ int GetPageImageIndex(size_t page); /// Sets gradient colors (only applicable when using the wxFNB_FANCY_TABS) /** \param from - first gradient colour \param to - second gradient colour \param border - page border colour */ void SetGradientColors(const wxColour& from, const wxColour& to, const wxColour& border); /// Sets first gradient colour /** \param from - new value of first gradient colour */ void SetGradientColorFrom(const wxColour& from); /// Sets second gradient colour /** \param to - new value of second gradient colour */ void SetGradientColorTo(const wxColour& to); /// Sets the colour of page border /** \param border - new value of the colour of page border */ void SetGradientColorBorder(const wxColour& border); /// Patch ---- Ti-R ---- Enable to show next tab selected if user click /// Sets the colour of selected page /** \param select - new select value colour */ void SetPreviewSelectColor(const wxColour& select); /// Patch ---- Ti-R ---- Set the disable color of the text /// Sets the colour of disable tab text /** \param disable - new disable colour */ void SetDisableTextColour(const wxColour& disable); /// Sets an image list associated with notebook pages /** \param imglist - image list object. Image list assigned with this method will not be deleted by wxFlatNotebook's destructor, you must delete it yourself. */ void SetImageList(wxFlatNotebookImageList * imglist); /// Returns an image list object associated with wxFlatNotebook wxFlatNotebookImageList * GetImageList(); /** * \brief Drop event handler, to be passed as function pointer to CTextDropTarget class. * \param x X coordinate where the drop take place * \param y Y coordinate where the drop take place * \param nTabPage page index * \param wnd_oldContainer pointer to wxPageContainer object that contained dragged page * \return Drag operation identifier */ wxDragResult OnDropTarget(wxCoord x, wxCoord y, int nTabPage, wxWindow * wnd_oldContainer); /// Enable / Disable page /** \param page - page to enable/diable \param enabled - set to true to enable the tab, false otherwise */ void Enable(size_t page, bool enabled); /// Return Returns true if if the page is enabled /** \param page - page index */ bool GetEnabled(size_t page); /// Patch (Font) ---- Ti-R ---- Enable to show next tab selected if user click /// Set the tab text font bool SetFont(const wxFont& font); /// Get the tab text font wxFont& GetFont(); /// Set the active tab text /** \param textColour - the active tab text colour */ void SetActiveTabTextColour(const wxColour& textColour); /// Gets first gradient colour const wxColour& GetGradientColorFrom(); /// Gets second gradient colour const wxColour& GetGradientColorTo(); /// Gets the tab border colour const wxColour& SetGradientColorBorder(); /// Get the active tab text const wxColour& GetActiveTabTextColour(); /// Get the non-active tab text color const wxColour& GetNonActiveTabTextColour(); /// Set the non-active tab text color void SetNonActiveTabTextColour(const wxColour& color); /// Return the tab area panel wxPanel* GetTabArea() { return (wxPanel*)m_pages; } /// Get the tab area background colour const wxColour& GetTabAreaColour(); /// Set the tab area background colour void SetTabAreaColour(const wxColour& color); /// Get the active tab color const wxColour& GetActiveTabColour(); /// Set the active tab color void SetActiveTabColour(const wxColour& color); /** * Return the padding used between the text and icons, text and borders, etc. * \return padding in pixels */ int GetPadding() { return m_nPadding; } /** * Set the customization options available for this notebook, can be one of the wxFNB_CUSTOM_* values * this values is by default set to wxFNB_CUSTOM_ALL */ void SetCustomizeOptions(long options); /** * Get the customization options available for this notebook */ long GetCustomizeOptions() const; // Setters / Getters void SetForceSelection(bool force) { m_bForceSelection = force; } bool GetForceSelection() { return m_bForceSelection; } wxWindowPtrArray& GetWindows() { return m_windows; } wxPageContainer *GetPages() { return m_pages; } wxBoxSizer* GetMainSizer() { return m_mainSizer; } protected: /// Initialization function, called internally virtual void Init(); wxPageContainer *m_pages; private: /// Internal flag to force selection of page, /// even if this page is disabled. /// used incase such that the book itself need to update its selection. /// e.g. after DeletePage() bool m_bForceSelection; wxBoxSizer* m_mainSizer; /// vector of all the windows associated with the notebook pages. wxWindowPtrArray m_windows; wxFNBDropTarget *m_pDropTarget; int m_nFrom; int m_nPadding; wxTabNavigatorWindow *m_popupWin; bool m_sendPageChangeEvent; ///< Ugly but needed to allow SetSelection to send / dont send event DECLARE_DYNAMIC_CLASS(wxFlatNotebook) DECLARE_EVENT_TABLE() void OnNavigationKey(wxNavigationKeyEvent& event); }; /** * \brief Contains parameters of notebook page */ class WXDLLIMPEXP_FNB wxPageInfo { private: // Members /// Page caption wxString m_strCaption; /// Page position wxPoint m_pos; /// Page size wxSize m_size; /// Page region wxRegion m_region; /// Angle for painting tab unsigned int m_TabAngle; /// Page image index int m_ImageIndex; /// Page enable/disabled flag bool m_bEnabled; /// Tab 'x' button rectangle wxRect m_xRect; /// Tab color wxColor m_color; public: /// Default constructor wxPageInfo(): m_strCaption(wxEmptyString), m_TabAngle(0), m_ImageIndex(-1), m_bEnabled(true){}; /// Parametrized constructor /** \param caption - page caption \param imgindex - image index */ wxPageInfo(const wxString& caption, int imgindex) : m_strCaption(caption), m_pos(-1, -1), m_size(-1, -1), m_TabAngle(0), m_ImageIndex(imgindex), m_bEnabled(true){} /// Destructor ~wxPageInfo(){}; /// Sets page caption /** \param value - new page caption */ void SetCaption(wxString value) {m_strCaption = value;} ///Returns page caption wxString GetCaption() {return m_strCaption;} /// Sets page position /** \param value - new page position */ void SetPosition(wxPoint value) {m_pos = value;} ///Returns page position const wxPoint & GetPosition() {return m_pos;} /// Sets page size /** \param value - new page size */ void SetSize(wxSize value) {m_size = value;} ///Returns page size const wxSize & GetSize() {return m_size;} /// Sets the tab header inclination angle /** \param value - new tab header inclination angle */ void SetTabAngle(unsigned int value) {m_TabAngle = FNB_MIN((unsigned int)(45), (unsigned int)(value));} /// Returns an inclination of tab header borders unsigned int GetTabAngle() {return m_TabAngle;} /// Sets page image index /** \param value - new image index */ void SetImageIndex(int value) {m_ImageIndex = value;} /// Returns an image index int GetImageIndex() {return m_ImageIndex;} /// Return true if the page is enabled bool GetEnabled() { return m_bEnabled; } /// Set the page enable/disable flag /** \param enabled - new page enable status */ void Enable(bool enabled) { m_bEnabled = enabled; } /// Set the page region /** \param n - number of points \param points - array of points that construct the region */ void SetRegion(const size_t n, const wxPoint points[]) { m_region = wxRegion(n, points); } /// Get the page region wxRegion& GetRegion() { return m_region ; } /// Set the 'x' button rectangle area /** \param xrect - the 'x' button rectangle */ void SetXRect(const wxRect& xrect) { m_xRect = xrect; } /// Get the 'x' button rectangle wxRect& GetXRect() { return m_xRect; } /** * * \return The tab color */ wxColor GetColor() { return m_color; } /** * * \param color Tab face color */ void SetColor(wxColor& color) { m_color = color; } }; WX_DECLARE_USER_EXPORTED_OBJARRAY(wxPageInfo, wxPageInfoArray, WXDLLIMPEXP_FNB); /// Button status enum { wxFNB_BTN_PRESSED, wxFNB_BTN_HOVER, wxFNB_BTN_NONE }; /// Hit Test results enum { wxFNB_TAB, ///< On a tab wxFNB_X, ///< On the X button wxFNB_TAB_X, ///< On the 'X' button (tab's X button) wxFNB_LEFT_ARROW, ///< On the rotate left arrow button wxFNB_RIGHT_ARROW, ///< On the rotate right arrow button wxFNB_DROP_DOWN_ARROW, ///< On the drop down arrow button wxFNB_NOWHERE ///< Anywhere else }; /** * \brief Notebook page */ class WXDLLIMPEXP_FNB wxPageContainer : public wxPanel { protected: friend class wxFlatNotebook; friend class wxFNBRenderer; friend class wxFNBRendererDefault; friend class wxFNBRendererVC71; friend class wxFNBRendererVC8; friend class wxFNBRendererFirefox2; wxFlatNotebookImageList * m_ImageList; public: /// Parametrized constructor /** \param parent - parent window \param id - window ID \param pos - window position \param size - window size \param style - window style */ wxPageContainer(wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0); /// Destructor virtual ~wxPageContainer(void); /// Sets an image list associated with notebook pages /** \param imglist - image list object. Image list assigned with this method will not be deleted by wxFlatNotebook's destructor, you must delete it yourself. */ virtual void SetImageList(wxFlatNotebookImageList * imglist) {m_ImageList = imglist;} /// Returns an image list object associated with wxFlatNotebook virtual wxFlatNotebookImageList * GetImageList() {return m_ImageList;} /// Apends new notebook page /** \param caption - tab caption \param selected - determines if new page should be selected automatically \param imgindex - page image index */ virtual bool AddPage(const wxString& caption, const bool selected = false, const int imgindex = -1); /// Inserts new notebook page /** \param index - page index \param page - window to be appended \param text - tab caption \param select - determines if new page should be selected automatically \param imgindex - page image index */ virtual bool InsertPage(size_t index, wxWindow* page, const wxString& text, bool select = false, const int imgindex = -1); /// Changes the selection from currently visible/selected page to the page given by index. /** \param page - index of page to be selected */ virtual void SetSelection(size_t page); /// Returns the current selection page index virtual int GetSelection() { return m_iActivePage; } /// Advances the selection /** \param bForward - if set to true then selection should be advanced forward otherwise - backward */ virtual void AdvanceSelection(bool bForward); /// Return the number of pages virtual size_t GetPageCount() { return m_pagesInfoVec.size(); } /// Returns the page caption /** \param page - page index */ virtual wxString GetPageText(size_t page) { return m_pagesInfoVec[page].GetCaption(); } /// Set the caption of the page /** \param page - page index \param text - new page caption */ virtual bool SetPageText(size_t page, const wxString& text) { m_pagesInfoVec[page].SetCaption(text); return true; } /// Sets an image index of specified page /** \param page - page index \param imgindex - new image index */ virtual void SetPageImageIndex(size_t page, int imgindex); /// Returns an image index of specified page /** \param page - page index */ virtual int GetPageImageIndex(size_t page); /// Enable / Disable page /** \param page - page to enable/diable \param enabled - set to true to enable the tab, false otherwise */ virtual void Enable(size_t page, bool enabled); /// Return Returns true if if the page is enabled /** \param page - page index */ virtual bool GetEnabled(size_t page); /// Style helper methods bool HasFlag(int flag); /** * Return a vector containing the tabs informations (used by the redereres) * \return tabs info vector */ wxPageInfoArray& GetPageInfoVector() { return m_pagesInfoVec; } /** * Return the first graident colour ("from") * \return gradient colour 1 */ const wxColour& GetGradientColourFrom() const { return m_colorFrom; } /** * Return the second graident colour ("to") * \return gradient colour 2 */ const wxColour& GetGradientColourTo() const { return m_colorTo; } /** * Return tab's border colour * \return border colour */ const wxColour& GetBorderColour() const { return m_colorBorder; } /** * Return non active tab's text colour * \return non active tab's text colour */ const wxColour& GetNonoActiveTextColor() const { return m_nonActiveTextColor; } /** * Return the active tab colour * \return tab colour */ const wxColour& GetActiveTabColour() const { return m_activeTabColor; } /** * Get the previous selected tab, wxNOT_FOUND if none * \return index of previous selected tab */ int GetPreviousSelection() const;// { return m_iPreviousActivePage; } /** * Draw a tab preview */ void DrawDragHint(); /** * Set the customization options available for this notebook, can be one of the wxFNB_CUSTOM_* values * this values is by default set to wxFNB_CUSTOM_ALL */ void SetCustomizeOptions(long options); /** * Get the customization options available for this notebook */ long GetCustomizeOptions() const; DECLARE_EVENT_TABLE() // Event handlers virtual void OnPaint(wxPaintEvent& event); virtual void OnSize(wxSizeEvent& WXUNUSED(event)); virtual void OnMouseMove(wxMouseEvent& event); virtual void OnLeftDown(wxMouseEvent& event); virtual void OnLeftUp(wxMouseEvent& event); virtual void OnRightDown(wxMouseEvent& event); virtual void OnMiddleDown(wxMouseEvent& event); virtual void OnEraseBackground(wxEraseEvent& WXUNUSED(event)) { } virtual void OnMouseLeave(wxMouseEvent& event); virtual void OnMouseEnterWindow(wxMouseEvent& event); virtual void OnLeftDClick(wxMouseEvent &event); virtual void OnTabMenuSelection(wxCommandEvent &event); virtual void OnShowCustomizeDialog(wxCommandEvent &event); protected: void RotateLeft(); void RotateRight(); /** * Popup a menu that contains all the tabs to be selected by user */ void PopupTabsMenu(); void ClearFlag(int flag); /// return true if tabIdx has image bool TabHasImage(int tabIdx); /// Check whether the style is set to default virtual bool IsDefaultTabs(); /// Return the color of the single line border virtual wxColor GetSingleLineBorderColor(); /// Return true if page is visible virtual bool IsTabVisible(size_t page); /// Return if pt is anywhere on a tab, button or anywhere else virtual int HitTest(const wxPoint& pt, wxPageInfo& pageInfo, int &tabIdx); /// Display tool tip when mouse is hovering a tab virtual void ShowTabTooltip(int tabIdx); /// A wrapper from calling the DoDeletePage() virtual void DeletePage(size_t page); /// Remove all pages from the container (it also deletes them) virtual void DeleteAllPages(); /// Perform the actual deletion of a tab from the container /// The window is also deleted using this function virtual void DoDeletePage(size_t page); /// Preform the actual page selection virtual void DoSetSelection(size_t page); /// Return the index of the last visible index virtual int GetLastVisibleTab(); /// Return the number of tabs that can be scrolled left /// starting from the first visible tab (i.e. m_nFrom) virtual int GetNumTabsCanScrollLeft(); /// Return the number of visible tabs virtual int GetNumOfVisibleTabs(); /** * \brief Drop event handler, to be passed as function pointer to CTextDropTarget class. * \param x X coordinate where the drop take place * \param y Y coordinate where the drop take place * \param nTabPage page index * \param wnd_oldContainer pointer to wxPageContainer object that contained dragged page * \return Drag operation identifier */ virtual wxDragResult OnDropTarget(wxCoord x, wxCoord y, int nTabPage, wxWindow * wnd_oldContainer); /** * \brief Moves the tab page from one location to another * \param nMove The index of the tab page to be moved. * \param nMoveTo The index for the tab page, where it has to be moved */ virtual void MoveTabPage(int nMove, int nMoveTo); /// Check whether page can fit to the current /// screen or a scrolling is required /** \param page - page index */ virtual bool CanFitToScreen(size_t page); void PushPageHistory(int page); //remove page from the history by its value //after the page removal, all items in the history //are updated if needed void PopPageHistory(int page); protected: wxPageInfoArray m_pagesInfoVec; int m_iActivePage; int m_nFrom; /// Drop target for enabling drag'n'drop of tabs wxFNBDropTarget *m_pDropTarget; private: /// Pointer to the parent window wxWindow *m_pParent; /// The right click menu wxMenu* m_pRightClickMenu; /// Gradient colors wxColour m_colorFrom, m_disableTextColor, m_colorTo, m_colorPreview, m_colorBorder, m_activeTextColor, m_nonActiveTextColor, m_tabAreaColor, m_activeTabColor; /// Patch (m_font) ---- Ti-R ---- Add custom font /// Custom font wxFont m_font; /// X,>,< buttons status, can be one of /// - Pressed /// - Hover /// - None int m_nXButtonStatus, m_nLeftButtonStatus, m_nRightButtonStatus, m_nTabXButtonStatus; /// holds the button id in case a left click is done on one of them int m_nLeftClickZone; //int m_iPreviousActivePage; wxArrayInt m_history; int m_nArrowDownButtonStatus; /// Customize menu wxMenu *m_customMenu; long m_customizeOptions; /// Patch (m_nTabStatus) ---- Ti-R ---- Enable to show next tab selected if user click int m_nTabStatus; int m_nTabPreviewId; }; /** * \brief Holds information about events associated with wxFlatNotebook objects */ class WXDLLIMPEXP_FNB wxFlatNotebookEvent : public wxNotifyEvent { DECLARE_DYNAMIC_CLASS(wxFlatNotebookEvent) size_t sel, oldsel; public: /// Constructor /** \param commandType - event type \param winid - window ID \param nSel - current selection \param nOldSel - old selection */ wxFlatNotebookEvent(wxEventType commandType = wxEVT_NULL, int winid = 0, int nSel = -1, int nOldSel = -1) : wxNotifyEvent(commandType, winid), sel(nSel), oldsel(nOldSel) {} /// Sets the value of current selection /** \param s - index of currently selected page */ void SetSelection(int s) { sel = s; } /// Sets the value of previous selection /** \param s - index of previously selected page */ void SetOldSelection(int s) { oldsel = s; } /// Returns the index of currently selected page int GetSelection() { return (int)sel; } /// Returns the index of previously selected page int GetOldSelection() { return (int)oldsel; } }; BEGIN_DECLARE_EVENT_TYPES() DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_FNB, wxEVT_COMMAND_FLATNOTEBOOK_PAGE_CHANGED, 50000) DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_FNB, wxEVT_COMMAND_FLATNOTEBOOK_PAGE_CHANGING, 50001) DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_FNB, wxEVT_COMMAND_FLATNOTEBOOK_PAGE_CLOSING, 50002) DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_FNB, wxEVT_COMMAND_FLATNOTEBOOK_CONTEXT_MENU, 50003) DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_FNB, wxEVT_COMMAND_FLATNOTEBOOK_PAGE_CLOSED, 50004) END_DECLARE_EVENT_TYPES() typedef void (wxEvtHandler::*wxFlatNotebookEventFunction)(wxFlatNotebookEvent&); #define wxFlatNotebookEventHandler(func) \ (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxFlatNotebookEventFunction, &func) #define EVT_FLATNOTEBOOK_PAGE_CHANGED(winid, fn) \ wx__DECLARE_EVT1(wxEVT_COMMAND_FLATNOTEBOOK_PAGE_CHANGED, winid, wxFlatNotebookEventHandler(fn)) #define EVT_FLATNOTEBOOK_PAGE_CHANGING(winid, fn) \ wx__DECLARE_EVT1(wxEVT_COMMAND_FLATNOTEBOOK_PAGE_CHANGING, winid, wxFlatNotebookEventHandler(fn)) #define EVT_FLATNOTEBOOK_PAGE_CLOSING(winid, fn) \ wx__DECLARE_EVT1(wxEVT_COMMAND_FLATNOTEBOOK_PAGE_CLOSING, winid, wxFlatNotebookEventHandler(fn)) #define EVT_FLATNOTEBOOK_CONTEXT_MENU(winid, fn) \ wx__DECLARE_EVT1(wxEVT_COMMAND_FLATNOTEBOOK_CONTEXT_MENU, winid, wxFlatNotebookEventHandler(fn)) #define EVT_FLATNOTEBOOK_PAGE_CLOSED(winid, fn) \ wx__DECLARE_EVT1(wxEVT_COMMAND_FLATNOTEBOOK_PAGE_CLOSED, winid, wxFlatNotebookEventHandler(fn)) #endif // WXFLATNOTEBOOK_H wxformbuilder-3.1.59/src/controls/include/wx/wxFlatNotebook/fnb_singleton.h0000644000175000017500000000272311143440026027434 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // Name: fnb_singleton.h // Purpose: A template class that implements the wxFNBSingleton pattern. // Author: Eran Ifrah // Created: 30/12/2005 // Modified: 01/01/2006 // Copyright: Eran Ifrah (c) // Licence: wxWindows license /////////////////////////////////////////////////////////////////////////////// #ifndef FNB_SINGLETON_H #define FNB_SINGLETON_H /** * A template class that implements the wxFNBSingleton pattern. * * \date 08-23-2006 * \author eran */ template class wxFNBSingleton { static T* ms_instance; public: /** * Static method to access the only pointer of this instance. * \return a pointer to the only instance of this */ static T* Get(); /** * Release resources. */ static void Free(); protected: /** * Default constructor. */ wxFNBSingleton(); /** * Destructor. */ virtual ~wxFNBSingleton(); }; template T* wxFNBSingleton::ms_instance = 0; template wxFNBSingleton::wxFNBSingleton() { } template wxFNBSingleton::~wxFNBSingleton() { } template T* wxFNBSingleton::Get() { if(!ms_instance) ms_instance = new T(); return ms_instance; } template void wxFNBSingleton::Free() { if( ms_instance ) { delete ms_instance; ms_instance = 0; } } #endif // FNB_SINGLETON_H wxformbuilder-3.1.59/src/controls/include/wx/wxFlatNotebook/fnb_smart_ptr.h0000644000175000017500000001001311143440026027434 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // Name: fnb_smart_ptr.h // Purpose: A smart pointer class that provides a reference counting and auto delete memory. // Author: Eran Ifrah // Created: 30/12/2005 // Modified: 01/01/2006 // Copyright: Eran Ifrah (c) // Licence: wxWindows license /////////////////////////////////////////////////////////////////////////////// #ifndef FNB_SMART_PTR_H #define FNB_SMART_PTR_H /** * A smart pointer class that provides a reference counting and auto delete memory. * * This class is similar to std::auto_ptr, with 2 exceptions: * - This class uses reference counting * - We dont provide a release() function (because of the reference counting) * It is recommended to use this class instead of using raw pointer wherever possible. * * \note smart pointer to NULL is valid. * * \ingroup CodeLite * \version 1.0 * first version * \date 09-17-2006 * \author Eran */ template class wxFNBSmartPtr { typedef T* type_ptr; /** * The reference counting class * * \ingroup CodeLite * \version 1.0 * first version * * \date 09-17-2006 * \author Eran */ class SmartPtrRef { type_ptr m_data; int m_refCount; public: /** * Construct a reference counting class for row pointer data * \param data pointer */ SmartPtrRef(type_ptr data) : m_data( data ) , m_refCount( 1 ) { } /** * Destructor */ virtual ~SmartPtrRef() { delete m_data; } /** * \return Pointer to the row data */ type_ptr GetData() { return m_data; } /** * Increase reference counting by 1 */ void IncRef() { m_refCount ++ ; } /** * Decrease reference counting by 1 */ void DecRef() { m_refCount -- ; } /** * Return the current reference counting * \return current reference counting */ int GetRefCount() { return m_refCount; } }; SmartPtrRef *m_ref; public: /** * Construct smart pointer from ptr * \param ptr pointer */ wxFNBSmartPtr(type_ptr ptr) { // create a fresh copy CreateFresh( ptr ); } /** * Default constructor */ wxFNBSmartPtr() : m_ref(NULL) { } /** * Copy constructor * \param rhs right hand side */ wxFNBSmartPtr(const wxFNBSmartPtr& rhs) : m_ref(NULL) { *this = rhs; } /** * Assignment operator * \param rhs right hand side * \return reference to this */ wxFNBSmartPtr& operator=(const wxFNBSmartPtr& rhs) { // increase the reference count if( m_ref == rhs.m_ref ) return *this; // Delete previous reference DeleteRefCount(); if( !rhs.m_ref ) return *this; m_ref = rhs.m_ref; m_ref->IncRef(); return *this; } /** * Destructor */ virtual ~wxFNBSmartPtr() { DeleteRefCount(); } /** * Replace the current pointer with ptr * if the current ptr is not NULL, it will be freed (reference counting free) before assingning the new ptr * \param ptr new pointer */ void Reset(type_ptr ptr) { DeleteRefCount(); CreateFresh( ptr ); } /** * Return pointer the row data pointer * \return pointer to the row data pointer */ type_ptr Get() { return m_ref->GetData(); } /** * Overload the '->' operator * \return pointer to the row data pointer */ type_ptr operator->() const { return m_ref->GetData(); } /** * Dereference operator * \return dereference the row data */ T& operator*() const { return *(m_ref->GetData()); } /** * Test for NULL operator * \return true if the internal row data or the reference counting class are NULL false otherwise */ bool operator!() const { if( !m_ref ) return true; return m_ref->GetData() == NULL; } private: void DeleteRefCount() { // decrease the ref count (or delete pointer if it is 1) if( m_ref ) { if( m_ref->GetRefCount() == 1 ) { delete m_ref; m_ref = NULL; } else m_ref->DecRef(); } }; void CreateFresh(type_ptr ptr) { m_ref = new SmartPtrRef( ptr ); } }; #endif // FNB_SMART_PTR_H wxformbuilder-3.1.59/src/controls/include/wx/wxFlatNotebook/fnb_customize_dlg.h0000644000175000017500000000351111143440026030276 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // Name: fnb_customize_dlg.h // Purpose: declaration of the customize dialog used by wxFlatNotebook // Author: Eran Ifrah // Created: 30/12/2005 // Modified: 01/01/2006 // Copyright: Eran Ifrah (c) // Licence: wxWindows license /////////////////////////////////////////////////////////////////////////////// #ifndef __fnb_customize_dlg__ #define __fnb_customize_dlg__ #include #include #include #include "wx/dialog.h" #include "wx/panel.h" class wxCheckBox; class wxRadioBox; /////////////////////////////////////////////////////////////////////////////// /// Class wxFNBCustomizeDialog /////////////////////////////////////////////////////////////////////////////// class WXDLLIMPEXP_FNB wxFNBCustomizeDialog : public wxDialog { protected: wxStaticLine* m_staticline2; wxButton* m_close; long m_options; // Option's page members wxRadioBox* m_styles; wxRadioBox* m_tabVPosition; wxRadioBox* m_navigationStyle; wxCheckBox* m_tabBorder; wxCheckBox* m_hideCloseButton; wxCheckBox* m_mouseMiddleCloseTab; wxCheckBox* m_xButtonOnTab; wxCheckBox* m_dlbClickCloseTab; wxCheckBox* m_smartTabbing; wxCheckBox* m_allowDragAndDrop; wxCheckBox* m_foreignDnD; wxCheckBox* m_gradient; wxCheckBox* m_colorfulTab; public: wxFNBCustomizeDialog( wxWindow* parent, long options, int id = wxID_ANY, wxString title = wxT("Customize"), wxPoint pos = wxDefaultPosition, wxSize size = wxDefaultSize, int style = wxDEFAULT_DIALOG_STYLE ); protected: void OnClose(wxCommandEvent &event); void OnStyle(wxCommandEvent &event); private: wxPanel *CreateOptionsPage(); void ConnectEvents(); }; #endif //__fnb_customize_dlg__ wxformbuilder-3.1.59/src/controls/include/wx/wxFlatNotebook/popup_dlg.h0000644000175000017500000000301111143440026026565 0ustar rrmulderrrmulder/////////////////////////////////////////////////////////////////////////////// // Name: popup_dlg.h // Purpose: declaration of the navigation dialog // Author: Eran Ifrah // Created: 30/12/2005 // Modified: 01/01/2006 // Copyright: Eran Ifrah (c) // Licence: wxWindows license /////////////////////////////////////////////////////////////////////////////// #ifndef FNB_POPUPDLG_H #define FNB_POPUPDLG_H #include #include #include class wxListBox; class wxFlatNotebook; class wxPanel; class wxTabNavigatorWindow : public wxDialog { protected: wxListBox *m_listBox; long m_selectedItem; std::map m_indexMap; wxPanel *m_panel; static wxBitmap m_bmp; protected: void CloseDialog(); public: /** * Parameterized constructor * \param parent dialog parent window */ wxTabNavigatorWindow(wxWindow* parent); /** * Default constructor */ wxTabNavigatorWindow(); /** * Destructor */ virtual ~wxTabNavigatorWindow(); /** * Create the dialog, usually part of the two steps construction of a * dialog * \param parent dialog parent window */ void Create(wxWindow* parent); /// Event handling void OnKeyUp(wxKeyEvent &event); void OnNavigationKey(wxNavigationKeyEvent &event); void OnItemSelected(wxCommandEvent &event); void OnPanelPaint(wxPaintEvent &event); void OnPanelEraseBg(wxEraseEvent &event); void PopulateListControl(wxFlatNotebook *book); }; #endif // FNB_POPUPDLG_H wxformbuilder-3.1.59/src/controls/include/wx/wxScintilla/wxscintilla.h0000644000175000017500000040212611143440026026502 0ustar rrmulderrrmulder//////////////////////////////////////////////////////////////////////////// // Name: wxscintilla.h // Purpose: A wxWidgets implementation of Scintilla. This class is the // one meant to be used directly by wx applications. It does not // derive directly from the Scintilla classes, and in fact there // is no mention of Scintilla classes at all in this header. // This class delegates all method calls and events to the // Scintilla objects and so forth. This allows the use of // Scintilla without polluting the namespace with all the // classes and itentifiers from Scintilla. // // Author: Robin Dunn // // Created: 13-Jan-2000 // RCS-ID: $Id: wxscintilla.h,v 1.38 2006/09/22 19:42:14 wyo Exp $ // Copyright: (c) 2004 wxCode // Licence: wxWindows ///////////////////////////////////////////////////////////////////////////// #ifndef __WXSCINTILLA_H__ #define __WXSCINTILLA_H__ #define wxSCINTILLA_VERSION _T("1.71.1") #include #include #ifdef WXMAKINGDLL_SCI #define WXDLLIMPEXP_SCI WXEXPORT #elif defined(WXUSINGDLL) #define WXDLLIMPEXP_SCI WXIMPORT #else // not making nor using DLL #define WXDLLIMPEXP_SCI #endif // SWIG can't handle "#if" type of conditionals, only "#ifdef" #ifdef SWIG #define SCI_USE_DND 1 #else #if wxUSE_DRAG_AND_DROP #define SCI_USE_DND 1 #endif #endif //---------------------------------------------------------------------- // Should a wxPopupWindow be used for the call tips and autocomplete windows? #ifndef wxSCI_USE_POPUP #define wxSCI_USE_POPUP 1 #endif //---------------------------------------------------------------------- // BEGIN generated section. The following code is automatically generated // by gen_iface.py. Do not edit this file. Edit wxscintilla.h.in instead // and regenerate #define wxSCI_INVALID_POSITION -1 // Define start of Scintilla messages to be greater than all Windows edit (EM_*) messages // as many EM_ messages can be used although that use is deprecated. #define wxSCI_START 2000 #define wxSCI_OPTIONAL_START 3000 #define wxSCI_LEXER_START 4000 #define wxSCI_WS_INVISIBLE 0 #define wxSCI_WS_VISIBLEALWAYS 1 #define wxSCI_WS_VISIBLEAFTERINDENT 2 #define wxSCI_EOL_CRLF 0 #define wxSCI_EOL_CR 1 #define wxSCI_EOL_LF 2 // The SC_CP_UTF8 value can be used to enter Unicode mode. // This is the same value as CP_UTF8 in Windows #define wxSCI_CP_UTF8 65001 // The SC_CP_DBCS value can be used to indicate a DBCS mode for GTK+. #define wxSCI_CP_DBCS 1 #define wxSCI_MARKER_MAX 31 #define wxSCI_MARK_CIRCLE 0 #define wxSCI_MARK_ROUNDRECT 1 #define wxSCI_MARK_ARROW 2 #define wxSCI_MARK_SMALLRECT 3 #define wxSCI_MARK_SHORTARROW 4 #define wxSCI_MARK_EMPTY 5 #define wxSCI_MARK_ARROWDOWN 6 #define wxSCI_MARK_MINUS 7 #define wxSCI_MARK_PLUS 8 // Shapes used for outlining column. #define wxSCI_MARK_VLINE 9 #define wxSCI_MARK_LCORNER 10 #define wxSCI_MARK_TCORNER 11 #define wxSCI_MARK_BOXPLUS 12 #define wxSCI_MARK_BOXPLUSCONNECTED 13 #define wxSCI_MARK_BOXMINUS 14 #define wxSCI_MARK_BOXMINUSCONNECTED 15 #define wxSCI_MARK_LCORNERCURVE 16 #define wxSCI_MARK_TCORNERCURVE 17 #define wxSCI_MARK_CIRCLEPLUS 18 #define wxSCI_MARK_CIRCLEPLUSCONNECTED 19 #define wxSCI_MARK_CIRCLEMINUS 20 #define wxSCI_MARK_CIRCLEMINUSCONNECTED 21 // Invisible mark that only sets the line background color. #define wxSCI_MARK_BACKGROUND 22 #define wxSCI_MARK_DOTDOTDOT 23 #define wxSCI_MARK_ARROWS 24 #define wxSCI_MARK_PIXMAP 25 #define wxSCI_MARK_FULLRECT 26 #define wxSCI_MARK_CHARACTER 10000 // Markers used for outlining column. #define wxSCI_MARKNUM_FOLDEREND 25 #define wxSCI_MARKNUM_FOLDEROPENMID 26 #define wxSCI_MARKNUM_FOLDERMIDTAIL 27 #define wxSCI_MARKNUM_FOLDERTAIL 28 #define wxSCI_MARKNUM_FOLDERSUB 29 #define wxSCI_MARKNUM_FOLDER 30 #define wxSCI_MARKNUM_FOLDEROPEN 31 #define wxSCI_MASK_FOLDERS 0xFE000000 #define wxSCI_MARGIN_SYMBOL 0 #define wxSCI_MARGIN_NUMBER 1 #define wxSCI_MARGIN_BACK 2 #define wxSCI_MARGIN_FORE 3 // Styles in range 32..38 are predefined for parts of the UI and are not used as normal styles. // Styles 39 is for future use. #define wxSCI_STYLE_DEFAULT 32 #define wxSCI_STYLE_LINENUMBER 33 #define wxSCI_STYLE_BRACELIGHT 34 #define wxSCI_STYLE_BRACEBAD 35 #define wxSCI_STYLE_CONTROLCHAR 36 #define wxSCI_STYLE_INDENTGUIDE 37 #define wxSCI_STYLE_CALLTIP 38 #define wxSCI_STYLE_LASTPREDEFINED 39 #define wxSCI_STYLE_MAX 127 // Character set identifiers are used in StyleSetCharacterSet. // The values are the same as the Windows *_CHARSET values. #define wxSCI_CHARSET_ANSI 0 #define wxSCI_CHARSET_DEFAULT 1 #define wxSCI_CHARSET_BALTIC 186 #define wxSCI_CHARSET_CHINESEBIG5 136 #define wxSCI_CHARSET_EASTEUROPE 238 #define wxSCI_CHARSET_GB2312 134 #define wxSCI_CHARSET_GREEK 161 #define wxSCI_CHARSET_HANGUL 129 #define wxSCI_CHARSET_MAC 77 #define wxSCI_CHARSET_OEM 255 #define wxSCI_CHARSET_RUSSIAN 204 #define wxSCI_CHARSET_CYRILLIC 1251 #define wxSCI_CHARSET_SHIFTJIS 128 #define wxSCI_CHARSET_SYMBOL 2 #define wxSCI_CHARSET_TURKISH 162 #define wxSCI_CHARSET_JOHAB 130 #define wxSCI_CHARSET_HEBREW 177 #define wxSCI_CHARSET_ARABIC 178 #define wxSCI_CHARSET_VIETNAMESE 163 #define wxSCI_CHARSET_THAI 222 #define wxSCI_CHARSET_8859_15 1000 #define wxSCI_CASE_MIXED 0 #define wxSCI_CASE_UPPER 1 #define wxSCI_CASE_LOWER 2 #define wxSCI_INDIC_MAX 7 #define wxSCI_INDIC_PLAIN 0 #define wxSCI_INDIC_SQUIGGLE 1 #define wxSCI_INDIC_TT 2 #define wxSCI_INDIC_DIAGONAL 3 #define wxSCI_INDIC_STRIKE 4 #define wxSCI_INDIC_HIDDEN 5 #define wxSCI_INDIC_BOX 6 #define wxSCI_INDIC_ROUNDBOX 7 #define wxSCI_INDIC0_MASK 0x20 #define wxSCI_INDIC1_MASK 0x40 #define wxSCI_INDIC2_MASK 0x80 #define wxSCI_INDICS_MASK 0xE0 // PrintColourMode - use same colours as screen. #define wxSCI_PRINT_NORMAL 0 // PrintColourMode - invert the light value of each style for printing. #define wxSCI_PRINT_INVERTLIGHT 1 // PrintColourMode - force black text on white background for printing. #define wxSCI_PRINT_BLACKONWHITE 2 // PrintColourMode - text stays coloured, but all background is forced to be white for printing. #define wxSCI_PRINT_COLOURONWHITE 3 // PrintColourMode - only the default-background is forced to be white for printing. #define wxSCI_PRINT_COLOURONWHITEDEFAULTBG 4 #define wxSCI_FIND_WHOLEWORD 2 #define wxSCI_FIND_MATCHCASE 4 #define wxSCI_FIND_WORDSTART 0x00100000 #define wxSCI_FIND_REGEXP 0x00200000 #define wxSCI_FIND_POSIX 0x00400000 #define wxSCI_FOLDLEVELBASE 0x400 #define wxSCI_FOLDLEVELWHITEFLAG 0x1000 #define wxSCI_FOLDLEVELHEADERFLAG 0x2000 #define wxSCI_FOLDLEVELBOXHEADERFLAG 0x4000 #define wxSCI_FOLDLEVELBOXFOOTERFLAG 0x8000 #define wxSCI_FOLDLEVELCONTRACTED 0x10000 #define wxSCI_FOLDLEVELUNINDENT 0x20000 #define wxSCI_FOLDLEVELNUMBERMASK 0x0FFF #define wxSCI_FOLDFLAG_LINEBEFORE_EXPANDED 0x0002 #define wxSCI_FOLDFLAG_LINEBEFORE_CONTRACTED 0x0004 #define wxSCI_FOLDFLAG_LINEAFTER_EXPANDED 0x0008 #define wxSCI_FOLDFLAG_LINEAFTER_CONTRACTED 0x0010 #define wxSCI_FOLDFLAG_LEVELNUMBERS 0x0040 #define wxSCI_FOLDFLAG_BOX 0x0001 #define wxSCI_TIME_FOREVER 10000000 #define wxSCI_WRAP_NONE 0 #define wxSCI_WRAP_WORD 1 #define wxSCI_WRAP_CHAR 2 #define wxSCI_WRAPVISUALFLAG_NONE 0x0000 #define wxSCI_WRAPVISUALFLAG_END 0x0001 #define wxSCI_WRAPVISUALFLAG_START 0x0002 #define wxSCI_WRAPVISUALFLAGLOC_DEFAULT 0x0000 #define wxSCI_WRAPVISUALFLAGLOC_END_BY_TEXT 0x0001 #define wxSCI_WRAPVISUALFLAGLOC_START_BY_TEXT 0x0002 #define wxSCI_CACHE_NONE 0 #define wxSCI_CACHE_CARET 1 #define wxSCI_CACHE_PAGE 2 #define wxSCI_CACHE_DOCUMENT 3 #define wxSCI_EDGE_NONE 0 #define wxSCI_EDGE_LINE 1 #define wxSCI_EDGE_BACKGROUND 2 #define wxSCI_CURSORNORMAL -1 #define wxSCI_CURSORWAIT 4 // Constants for use with SetVisiblePolicy, similar to SetCaretPolicy. #define wxSCI_VISIBLE_SLOP 0x01 #define wxSCI_VISIBLE_STRICT 0x04 // Caret policy, used by SetXCaretPolicy and SetYCaretPolicy. // If CARET_SLOP is set, we can define a slop value: caretSlop. // This value defines an unwanted zone (UZ) where the caret is... unwanted. // This zone is defined as a number of pixels near the vertical margins, // and as a number of lines near the horizontal margins. // By keeping the caret away from the edges, it is seen within its context, // so it is likely that the identifier that the caret is on can be completely seen, // and that the current line is seen with some of the lines following it which are // often dependent on that line. #define wxSCI_CARET_SLOP 0x01 // If CARET_STRICT is set, the policy is enforced... strictly. // The caret is centred on the display if slop is not set, // and cannot go in the UZ if slop is set. #define wxSCI_CARET_STRICT 0x04 // If CARET_JUMPS is set, the display is moved more energetically // so the caret can move in the same direction longer before the policy is applied again. #define wxSCI_CARET_JUMPS 0x10 // If CARET_EVEN is not set, instead of having symmetrical UZs, // the left and bottom UZs are extended up to right and top UZs respectively. // This way, we favour the displaying of useful information: the begining of lines, // where most code reside, and the lines after the caret, eg. the body of a function. #define wxSCI_CARET_EVEN 0x08 // Selection modes #define wxSCI_SEL_STREAM 0 #define wxSCI_SEL_RECTANGLE 1 #define wxSCI_SEL_LINES 2 // Maximum value of keywordSet parameter of SetKeyWords. #define wxSCI_KEYWORDSET_MAX 8 // Notifications // Type of modification and the action which caused the modification. // These are defined as a bit mask to make it easy to specify which notifications are wanted. // One bit is set from each of SC_MOD_* and SC_PERFORMED_*. #define wxSCI_MOD_INSERTTEXT 0x1 #define wxSCI_MOD_DELETETEXT 0x2 #define wxSCI_MOD_CHANGESTYLE 0x4 #define wxSCI_MOD_CHANGEFOLD 0x8 #define wxSCI_PERFORMED_USER 0x10 #define wxSCI_PERFORMED_UNDO 0x20 #define wxSCI_PERFORMED_REDO 0x40 #define wxSCI_MULTISTEPUNDOREDO 0x80 #define wxSCI_LASTSTEPINUNDOREDO 0x100 #define wxSCI_MOD_CHANGEMARKER 0x200 #define wxSCI_MOD_BEFOREINSERT 0x400 #define wxSCI_MOD_BEFOREDELETE 0x800 #define wxSCI_MULTILINEUNDOREDO 0x1000 #define wxSCI_MODEVENTMASKALL 0x1FFF // Symbolic key codes and modifier flags. // ASCII and other printable characters below 256. // Extended keys above 300. #define wxSCI_KEY_DOWN 300 #define wxSCI_KEY_UP 301 #define wxSCI_KEY_LEFT 302 #define wxSCI_KEY_RIGHT 303 #define wxSCI_KEY_HOME 304 #define wxSCI_KEY_END 305 #define wxSCI_KEY_PRIOR 306 #define wxSCI_KEY_NEXT 307 #define wxSCI_KEY_DELETE 308 #define wxSCI_KEY_INSERT 309 #define wxSCI_KEY_ESCAPE 7 #define wxSCI_KEY_BACK 8 #define wxSCI_KEY_TAB 9 #define wxSCI_KEY_RETURN 13 #define wxSCI_KEY_ADD 310 #define wxSCI_KEY_SUBTRACT 311 #define wxSCI_KEY_DIVIDE 312 #define wxSCI_SCMOD_NULL 0 #define wxSCI_SCMOD_SHIFT 1 #define wxSCI_SCMOD_CTRL 2 #define wxSCI_SCMOD_ALT 4 // Caret line alpha background #define wxSCI_ALPHA_TRANSPARENT 0 #define wxSCI_ALPHA_OPAQUE 255 #define wxSCI_ALPHA_NOALPHA 256 // For SciLexer.h #define wxSCI_LEX_CONTAINER 0 #define wxSCI_LEX_NULL 1 #define wxSCI_LEX_PYTHON 2 #define wxSCI_LEX_CPP 3 #define wxSCI_LEX_HTML 4 #define wxSCI_LEX_XML 5 #define wxSCI_LEX_PERL 6 #define wxSCI_LEX_SQL 7 #define wxSCI_LEX_VB 8 #define wxSCI_LEX_PROPERTIES 9 #define wxSCI_LEX_ERRORLIST 10 #define wxSCI_LEX_MAKEFILE 11 #define wxSCI_LEX_BATCH 12 #define wxSCI_LEX_XCODE 13 #define wxSCI_LEX_LATEX 14 #define wxSCI_LEX_LUA 15 #define wxSCI_LEX_DIFF 16 #define wxSCI_LEX_CONF 17 #define wxSCI_LEX_PASCAL 18 #define wxSCI_LEX_AVE 19 #define wxSCI_LEX_ADA 20 #define wxSCI_LEX_LISP 21 #define wxSCI_LEX_RUBY 22 #define wxSCI_LEX_EIFFEL 23 #define wxSCI_LEX_EIFFELKW 24 #define wxSCI_LEX_TCL 25 #define wxSCI_LEX_NNCRONTAB 26 #define wxSCI_LEX_BULLANT 27 #define wxSCI_LEX_VBSCRIPT 28 #define wxSCI_LEX_BAAN 31 #define wxSCI_LEX_MATLAB 32 #define wxSCI_LEX_SCRIPTOL 33 #define wxSCI_LEX_ASM 34 #define wxSCI_LEX_CPPNOCASE 35 #define wxSCI_LEX_FORTRAN 36 #define wxSCI_LEX_F77 37 #define wxSCI_LEX_CSS 38 #define wxSCI_LEX_POV 39 #define wxSCI_LEX_LOUT 40 #define wxSCI_LEX_ESCRIPT 41 #define wxSCI_LEX_PS 42 #define wxSCI_LEX_NSIS 43 #define wxSCI_LEX_MMIXAL 44 #define wxSCI_LEX_CLW 45 #define wxSCI_LEX_CLWNOCASE 46 #define wxSCI_LEX_LOT 47 #define wxSCI_LEX_YAML 48 #define wxSCI_LEX_TEX 49 #define wxSCI_LEX_METAPOST 50 #define wxSCI_LEX_POWERBASIC 51 #define wxSCI_LEX_FORTH 52 #define wxSCI_LEX_ERLANG 53 #define wxSCI_LEX_OCTAVE 54 #define wxSCI_LEX_MSSQL 55 #define wxSCI_LEX_VERILOG 56 #define wxSCI_LEX_KIX 57 #define wxSCI_LEX_GUI4CLI 58 #define wxSCI_LEX_SPECMAN 59 #define wxSCI_LEX_AU3 60 #define wxSCI_LEX_APDL 61 #define wxSCI_LEX_BASH 62 #define wxSCI_LEX_ASN1 63 #define wxSCI_LEX_VHDL 64 #define wxSCI_LEX_CAML 65 #define wxSCI_LEX_BLITZBASIC 66 #define wxSCI_LEX_PUREBASIC 67 #define wxSCI_LEX_HASKELL 68 #define wxSCI_LEX_PHPSCRIPT 69 #define wxSCI_LEX_TADS3 70 #define wxSCI_LEX_REBOL 71 #define wxSCI_LEX_SMALLTALK 72 #define wxSCI_LEX_FLAGSHIP 73 #define wxSCI_LEX_CSOUND 74 #define wxSCI_LEX_FREEBASIC 75 #define wxSCI_LEX_INNOSETUP 76 #define wxSCI_LEX_OPAL 77 #define wxSCI_LEX_SPICE 78 // When a lexer specifies its language as SCLEX_AUTOMATIC it receives a // value assigned in sequence from SCLEX_AUTOMATIC+1. #define wxSCI_LEX_AUTOMATIC 1000 // Lexical states for SCLEX_PYTHON #define wxSCI_P_DEFAULT 0 #define wxSCI_P_COMMENTLINE 1 #define wxSCI_P_NUMBER 2 #define wxSCI_P_STRING 3 #define wxSCI_P_CHARACTER 4 #define wxSCI_P_WORD 5 #define wxSCI_P_TRIPLE 6 #define wxSCI_P_TRIPLEDOUBLE 7 #define wxSCI_P_CLASSNAME 8 #define wxSCI_P_DEFNAME 9 #define wxSCI_P_OPERATOR 10 #define wxSCI_P_IDENTIFIER 11 #define wxSCI_P_COMMENTBLOCK 12 #define wxSCI_P_STRINGEOL 13 #define wxSCI_P_WORD2 14 #define wxSCI_P_DECORATOR 15 // Lexical states for SCLEX_CPP #define wxSCI_C_DEFAULT 0 #define wxSCI_C_COMMENT 1 #define wxSCI_C_COMMENTLINE 2 #define wxSCI_C_COMMENTDOC 3 #define wxSCI_C_NUMBER 4 #define wxSCI_C_WORD 5 #define wxSCI_C_STRING 6 #define wxSCI_C_CHARACTER 7 #define wxSCI_C_UUID 8 #define wxSCI_C_PREPROCESSOR 9 #define wxSCI_C_OPERATOR 10 #define wxSCI_C_IDENTIFIER 11 #define wxSCI_C_STRINGEOL 12 #define wxSCI_C_VERBATIM 13 #define wxSCI_C_REGEX 14 #define wxSCI_C_COMMENTLINEDOC 15 #define wxSCI_C_WORD2 16 #define wxSCI_C_COMMENTDOCKEYWORD 17 #define wxSCI_C_COMMENTDOCKEYWORDERROR 18 #define wxSCI_C_GLOBALCLASS 19 // Lexical states for SCLEX_TCL #define wxSCI_TCL_DEFAULT 0 #define wxSCI_TCL_COMMENT 1 #define wxSCI_TCL_COMMENTLINE 2 #define wxSCI_TCL_NUMBER 3 #define wxSCI_TCL_WORD_IN_QUOTE 4 #define wxSCI_TCL_IN_QUOTE 5 #define wxSCI_TCL_OPERATOR 6 #define wxSCI_TCL_IDENTIFIER 7 #define wxSCI_TCL_SUBSTITUTION 8 #define wxSCI_TCL_SUB_BRACE 9 #define wxSCI_TCL_MODIFIER 10 #define wxSCI_TCL_EXPAND 11 #define wxSCI_TCL_WORD 12 #define wxSCI_TCL_WORD2 13 #define wxSCI_TCL_WORD3 14 #define wxSCI_TCL_WORD4 15 #define wxSCI_TCL_WORD5 16 #define wxSCI_TCL_WORD6 17 #define wxSCI_TCL_WORD7 18 #define wxSCI_TCL_WORD8 19 #define wxSCI_TCL_COMMENT_BOX 20 #define wxSCI_TCL_BLOCK_COMMENT 21 // Lexical states for SCLEX_HTML, SCLEX_XML #define wxSCI_H_DEFAULT 0 #define wxSCI_H_TAG 1 #define wxSCI_H_TAGUNKNOWN 2 #define wxSCI_H_ATTRIBUTE 3 #define wxSCI_H_ATTRIBUTEUNKNOWN 4 #define wxSCI_H_NUMBER 5 #define wxSCI_H_DOUBLESTRING 6 #define wxSCI_H_SINGLESTRING 7 #define wxSCI_H_OTHER 8 #define wxSCI_H_COMMENT 9 #define wxSCI_H_ENTITY 10 // XML and ASP #define wxSCI_H_TAGEND 11 #define wxSCI_H_XMLSTART 12 #define wxSCI_H_XMLEND 13 #define wxSCI_H_SCRIPT 14 #define wxSCI_H_ASP 15 #define wxSCI_H_ASPAT 16 #define wxSCI_H_CDATA 17 #define wxSCI_H_QUESTION 18 // More HTML #define wxSCI_H_VALUE 19 // X-Code #define wxSCI_H_XCCOMMENT 20 // SGML #define wxSCI_H_SGML_DEFAULT 21 #define wxSCI_H_SGML_COMMAND 22 #define wxSCI_H_SGML_1ST_PARAM 23 #define wxSCI_H_SGML_DOUBLESTRING 24 #define wxSCI_H_SGML_SIMPLESTRING 25 #define wxSCI_H_SGML_ERROR 26 #define wxSCI_H_SGML_SPECIAL 27 #define wxSCI_H_SGML_ENTITY 28 #define wxSCI_H_SGML_COMMENT 29 #define wxSCI_H_SGML_1ST_PARAM_COMMENT 30 #define wxSCI_H_SGML_BLOCK_DEFAULT 31 // Embedded Javascript #define wxSCI_HJ_START 40 #define wxSCI_HJ_DEFAULT 41 #define wxSCI_HJ_COMMENT 42 #define wxSCI_HJ_COMMENTLINE 43 #define wxSCI_HJ_COMMENTDOC 44 #define wxSCI_HJ_NUMBER 45 #define wxSCI_HJ_WORD 46 #define wxSCI_HJ_KEYWORD 47 #define wxSCI_HJ_DOUBLESTRING 48 #define wxSCI_HJ_SINGLESTRING 49 #define wxSCI_HJ_SYMBOLS 50 #define wxSCI_HJ_STRINGEOL 51 #define wxSCI_HJ_REGEX 52 // ASP Javascript #define wxSCI_HJA_START 55 #define wxSCI_HJA_DEFAULT 56 #define wxSCI_HJA_COMMENT 57 #define wxSCI_HJA_COMMENTLINE 58 #define wxSCI_HJA_COMMENTDOC 59 #define wxSCI_HJA_NUMBER 60 #define wxSCI_HJA_WORD 61 #define wxSCI_HJA_KEYWORD 62 #define wxSCI_HJA_DOUBLESTRING 63 #define wxSCI_HJA_SINGLESTRING 64 #define wxSCI_HJA_SYMBOLS 65 #define wxSCI_HJA_STRINGEOL 66 #define wxSCI_HJA_REGEX 67 // Embedded VBScript #define wxSCI_HB_START 70 #define wxSCI_HB_DEFAULT 71 #define wxSCI_HB_COMMENTLINE 72 #define wxSCI_HB_NUMBER 73 #define wxSCI_HB_WORD 74 #define wxSCI_HB_STRING 75 #define wxSCI_HB_IDENTIFIER 76 #define wxSCI_HB_STRINGEOL 77 // ASP VBScript #define wxSCI_HBA_START 80 #define wxSCI_HBA_DEFAULT 81 #define wxSCI_HBA_COMMENTLINE 82 #define wxSCI_HBA_NUMBER 83 #define wxSCI_HBA_WORD 84 #define wxSCI_HBA_STRING 85 #define wxSCI_HBA_IDENTIFIER 86 #define wxSCI_HBA_STRINGEOL 87 // Embedded Python #define wxSCI_HP_START 90 #define wxSCI_HP_DEFAULT 91 #define wxSCI_HP_COMMENTLINE 92 #define wxSCI_HP_NUMBER 93 #define wxSCI_HP_STRING 94 #define wxSCI_HP_CHARACTER 95 #define wxSCI_HP_WORD 96 #define wxSCI_HP_TRIPLE 97 #define wxSCI_HP_TRIPLEDOUBLE 98 #define wxSCI_HP_CLASSNAME 99 #define wxSCI_HP_DEFNAME 100 #define wxSCI_HP_OPERATOR 101 #define wxSCI_HP_IDENTIFIER 102 // PHP #define wxSCI_HPHP_COMPLEX_VARIABLE 104 // ASP Python #define wxSCI_HPA_START 105 #define wxSCI_HPA_DEFAULT 106 #define wxSCI_HPA_COMMENTLINE 107 #define wxSCI_HPA_NUMBER 108 #define wxSCI_HPA_STRING 109 #define wxSCI_HPA_CHARACTER 110 #define wxSCI_HPA_WORD 111 #define wxSCI_HPA_TRIPLE 112 #define wxSCI_HPA_TRIPLEDOUBLE 113 #define wxSCI_HPA_CLASSNAME 114 #define wxSCI_HPA_DEFNAME 115 #define wxSCI_HPA_OPERATOR 116 #define wxSCI_HPA_IDENTIFIER 117 // PHP #define wxSCI_HPHP_DEFAULT 118 #define wxSCI_HPHP_HSTRING 119 #define wxSCI_HPHP_SIMPLESTRING 120 #define wxSCI_HPHP_WORD 121 #define wxSCI_HPHP_NUMBER 122 #define wxSCI_HPHP_VARIABLE 123 #define wxSCI_HPHP_COMMENT 124 #define wxSCI_HPHP_COMMENTLINE 125 #define wxSCI_HPHP_HSTRING_VARIABLE 126 #define wxSCI_HPHP_OPERATOR 127 // Lexical states for SCLEX_PERL #define wxSCI_PL_DEFAULT 0 #define wxSCI_PL_ERROR 1 #define wxSCI_PL_COMMENTLINE 2 #define wxSCI_PL_POD 3 #define wxSCI_PL_NUMBER 4 #define wxSCI_PL_WORD 5 #define wxSCI_PL_STRING 6 #define wxSCI_PL_CHARACTER 7 #define wxSCI_PL_PUNCTUATION 8 #define wxSCI_PL_PREPROCESSOR 9 #define wxSCI_PL_OPERATOR 10 #define wxSCI_PL_IDENTIFIER 11 #define wxSCI_PL_SCALAR 12 #define wxSCI_PL_ARRAY 13 #define wxSCI_PL_HASH 14 #define wxSCI_PL_SYMBOLTABLE 15 #define wxSCI_PL_VARIABLE_INDEXER 16 #define wxSCI_PL_REGEX 17 #define wxSCI_PL_REGSUBST 18 #define wxSCI_PL_LONGQUOTE 19 #define wxSCI_PL_BACKTICKS 20 #define wxSCI_PL_DATASECTION 21 #define wxSCI_PL_HERE_DELIM 22 #define wxSCI_PL_HERE_Q 23 #define wxSCI_PL_HERE_QQ 24 #define wxSCI_PL_HERE_QX 25 #define wxSCI_PL_STRING_Q 26 #define wxSCI_PL_STRING_QQ 27 #define wxSCI_PL_STRING_QX 28 #define wxSCI_PL_STRING_QR 29 #define wxSCI_PL_STRING_QW 30 #define wxSCI_PL_POD_VERB 31 // Lexical states for SCLEX_RUBY #define wxSCI_RB_DEFAULT 0 #define wxSCI_RB_ERROR 1 #define wxSCI_RB_COMMENTLINE 2 #define wxSCI_RB_POD 3 #define wxSCI_RB_NUMBER 4 #define wxSCI_RB_WORD 5 #define wxSCI_RB_STRING 6 #define wxSCI_RB_CHARACTER 7 #define wxSCI_RB_CLASSNAME 8 #define wxSCI_RB_DEFNAME 9 #define wxSCI_RB_OPERATOR 10 #define wxSCI_RB_IDENTIFIER 11 #define wxSCI_RB_REGEX 12 #define wxSCI_RB_GLOBAL 13 #define wxSCI_RB_SYMBOL 14 #define wxSCI_RB_MODULE_NAME 15 #define wxSCI_RB_INSTANCE_VAR 16 #define wxSCI_RB_CLASS_VAR 17 #define wxSCI_RB_BACKTICKS 18 #define wxSCI_RB_DATASECTION 19 #define wxSCI_RB_HERE_DELIM 20 #define wxSCI_RB_HERE_Q 21 #define wxSCI_RB_HERE_QQ 22 #define wxSCI_RB_HERE_QX 23 #define wxSCI_RB_STRING_Q 24 #define wxSCI_RB_STRING_QQ 25 #define wxSCI_RB_STRING_QX 26 #define wxSCI_RB_STRING_QR 27 #define wxSCI_RB_STRING_QW 28 #define wxSCI_RB_WORD_DEMOTED 29 #define wxSCI_RB_STDIN 30 #define wxSCI_RB_STDOUT 31 #define wxSCI_RB_STDERR 40 #define wxSCI_RB_UPPER_BOUND 41 // Lexical states for SCLEX_VB, SCLEX_VBSCRIPT, SCLEX_POWERBASIC #define wxSCI_B_DEFAULT 0 #define wxSCI_B_COMMENT 1 #define wxSCI_B_NUMBER 2 #define wxSCI_B_KEYWORD 3 #define wxSCI_B_STRING 4 #define wxSCI_B_PREPROCESSOR 5 #define wxSCI_B_OPERATOR 6 #define wxSCI_B_IDENTIFIER 7 #define wxSCI_B_DATE 8 #define wxSCI_B_STRINGEOL 9 #define wxSCI_B_KEYWORD2 10 #define wxSCI_B_KEYWORD3 11 #define wxSCI_B_KEYWORD4 12 #define wxSCI_B_CONSTANT 13 #define wxSCI_B_ASM 14 #define wxSCI_B_LABEL 15 #define wxSCI_B_ERROR 16 #define wxSCI_B_HEXNUMBER 17 #define wxSCI_B_BINNUMBER 18 // Lexical states for SCLEX_PROPERTIES #define wxSCI_PROPS_DEFAULT 0 #define wxSCI_PROPS_COMMENT 1 #define wxSCI_PROPS_SECTION 2 #define wxSCI_PROPS_ASSIGNMENT 3 #define wxSCI_PROPS_DEFVAL 4 #define wxSCI_PROPS_KEY 5 // Lexical states for SCLEX_LATEX #define wxSCI_L_DEFAULT 0 #define wxSCI_L_COMMAND 1 #define wxSCI_L_TAG 2 #define wxSCI_L_MATH 3 #define wxSCI_L_COMMENT 4 // Lexical states for SCLEX_LUA #define wxSCI_LUA_DEFAULT 0 #define wxSCI_LUA_COMMENT 1 #define wxSCI_LUA_COMMENTLINE 2 #define wxSCI_LUA_COMMENTDOC 3 #define wxSCI_LUA_NUMBER 4 #define wxSCI_LUA_WORD 5 #define wxSCI_LUA_STRING 6 #define wxSCI_LUA_CHARACTER 7 #define wxSCI_LUA_LITERALSTRING 8 #define wxSCI_LUA_PREPROCESSOR 9 #define wxSCI_LUA_OPERATOR 10 #define wxSCI_LUA_IDENTIFIER 11 #define wxSCI_LUA_STRINGEOL 12 #define wxSCI_LUA_WORD2 13 #define wxSCI_LUA_WORD3 14 #define wxSCI_LUA_WORD4 15 #define wxSCI_LUA_WORD5 16 #define wxSCI_LUA_WORD6 17 #define wxSCI_LUA_WORD7 18 #define wxSCI_LUA_WORD8 19 // Lexical states for SCLEX_ERRORLIST #define wxSCI_ERR_DEFAULT 0 #define wxSCI_ERR_PYTHON 1 #define wxSCI_ERR_GCC 2 #define wxSCI_ERR_MS 3 #define wxSCI_ERR_CMD 4 #define wxSCI_ERR_BORLAND 5 #define wxSCI_ERR_PERL 6 #define wxSCI_ERR_NET 7 #define wxSCI_ERR_LUA 8 #define wxSCI_ERR_CTAG 9 #define wxSCI_ERR_DIFF_CHANGED 10 #define wxSCI_ERR_DIFF_ADDITION 11 #define wxSCI_ERR_DIFF_DELETION 12 #define wxSCI_ERR_DIFF_MESSAGE 13 #define wxSCI_ERR_PHP 14 #define wxSCI_ERR_ELF 15 #define wxSCI_ERR_IFC 16 #define wxSCI_ERR_IFORT 17 #define wxSCI_ERR_ABSF 18 #define wxSCI_ERR_TIDY 19 #define wxSCI_ERR_JAVA_STACK 20 // Lexical states for SCLEX_BATCH #define wxSCI_BAT_DEFAULT 0 #define wxSCI_BAT_COMMENT 1 #define wxSCI_BAT_WORD 2 #define wxSCI_BAT_LABEL 3 #define wxSCI_BAT_HIDE 4 #define wxSCI_BAT_COMMAND 5 #define wxSCI_BAT_IDENTIFIER 6 #define wxSCI_BAT_OPERATOR 7 // Lexical states for SCLEX_MAKEFILE #define wxSCI_MAKE_DEFAULT 0 #define wxSCI_MAKE_COMMENT 1 #define wxSCI_MAKE_PREPROCESSOR 2 #define wxSCI_MAKE_IDENTIFIER 3 #define wxSCI_MAKE_OPERATOR 4 #define wxSCI_MAKE_TARGET 5 #define wxSCI_MAKE_IDEOL 9 // Lexical states for SCLEX_DIFF #define wxSCI_DIFF_DEFAULT 0 #define wxSCI_DIFF_COMMENT 1 #define wxSCI_DIFF_COMMAND 2 #define wxSCI_DIFF_HEADER 3 #define wxSCI_DIFF_POSITION 4 #define wxSCI_DIFF_DELETED 5 #define wxSCI_DIFF_ADDED 6 // Lexical states for SCLEX_CONF (Apache Configuration Files Lexer) #define wxSCI_CONF_DEFAULT 0 #define wxSCI_CONF_COMMENT 1 #define wxSCI_CONF_NUMBER 2 #define wxSCI_CONF_IDENTIFIER 3 #define wxSCI_CONF_EXTENSION 4 #define wxSCI_CONF_PARAMETER 5 #define wxSCI_CONF_STRING 6 #define wxSCI_CONF_OPERATOR 7 #define wxSCI_CONF_IP 8 #define wxSCI_CONF_DIRECTIVE 9 // Lexical states for SCLEX_AVE, Avenue #define wxSCI_AVE_DEFAULT 0 #define wxSCI_AVE_COMMENT 1 #define wxSCI_AVE_NUMBER 2 #define wxSCI_AVE_WORD 3 #define wxSCI_AVE_STRING 6 #define wxSCI_AVE_ENUM 7 #define wxSCI_AVE_STRINGEOL 8 #define wxSCI_AVE_IDENTIFIER 9 #define wxSCI_AVE_OPERATOR 10 #define wxSCI_AVE_WORD1 11 #define wxSCI_AVE_WORD2 12 #define wxSCI_AVE_WORD3 13 #define wxSCI_AVE_WORD4 14 #define wxSCI_AVE_WORD5 15 #define wxSCI_AVE_WORD6 16 // Lexical states for SCLEX_ADA #define wxSCI_ADA_DEFAULT 0 #define wxSCI_ADA_WORD 1 #define wxSCI_ADA_IDENTIFIER 2 #define wxSCI_ADA_NUMBER 3 #define wxSCI_ADA_DELIMITER 4 #define wxSCI_ADA_CHARACTER 5 #define wxSCI_ADA_CHARACTEREOL 6 #define wxSCI_ADA_STRING 7 #define wxSCI_ADA_STRINGEOL 8 #define wxSCI_ADA_LABEL 9 #define wxSCI_ADA_COMMENTLINE 10 #define wxSCI_ADA_ILLEGAL 11 // Lexical states for SCLEX_BAAN #define wxSCI_BAAN_DEFAULT 0 #define wxSCI_BAAN_COMMENT 1 #define wxSCI_BAAN_COMMENTDOC 2 #define wxSCI_BAAN_NUMBER 3 #define wxSCI_BAAN_WORD 4 #define wxSCI_BAAN_STRING 5 #define wxSCI_BAAN_PREPROCESSOR 6 #define wxSCI_BAAN_OPERATOR 7 #define wxSCI_BAAN_IDENTIFIER 8 #define wxSCI_BAAN_STRINGEOL 9 #define wxSCI_BAAN_WORD2 10 // Lexical states for SCLEX_LISP #define wxSCI_LISP_DEFAULT 0 #define wxSCI_LISP_COMMENT 1 #define wxSCI_LISP_NUMBER 2 #define wxSCI_LISP_KEYWORD 3 #define wxSCI_LISP_KEYWORD_KW 4 #define wxSCI_LISP_SYMBOL 5 #define wxSCI_LISP_STRING 6 #define wxSCI_LISP_STRINGEOL 8 #define wxSCI_LISP_IDENTIFIER 9 #define wxSCI_LISP_OPERATOR 10 #define wxSCI_LISP_SPECIAL 11 #define wxSCI_LISP_MULTI_COMMENT 12 // Lexical states for SCLEX_EIFFEL and SCLEX_EIFFELKW #define wxSCI_EIFFEL_DEFAULT 0 #define wxSCI_EIFFEL_COMMENTLINE 1 #define wxSCI_EIFFEL_NUMBER 2 #define wxSCI_EIFFEL_WORD 3 #define wxSCI_EIFFEL_STRING 4 #define wxSCI_EIFFEL_CHARACTER 5 #define wxSCI_EIFFEL_OPERATOR 6 #define wxSCI_EIFFEL_IDENTIFIER 7 #define wxSCI_EIFFEL_STRINGEOL 8 // Lexical states for SCLEX_NNCRONTAB (nnCron crontab Lexer) #define wxSCI_NNCRONTAB_DEFAULT 0 #define wxSCI_NNCRONTAB_COMMENT 1 #define wxSCI_NNCRONTAB_TASK 2 #define wxSCI_NNCRONTAB_SECTION 3 #define wxSCI_NNCRONTAB_KEYWORD 4 #define wxSCI_NNCRONTAB_MODIFIER 5 #define wxSCI_NNCRONTAB_ASTERISK 6 #define wxSCI_NNCRONTAB_NUMBER 7 #define wxSCI_NNCRONTAB_STRING 8 #define wxSCI_NNCRONTAB_ENVIRONMENT 9 #define wxSCI_NNCRONTAB_IDENTIFIER 10 // Lexical states for SCLEX_FORTH (Forth Lexer) #define wxSCI_FORTH_DEFAULT 0 #define wxSCI_FORTH_COMMENT 1 #define wxSCI_FORTH_COMMENT_ML 2 #define wxSCI_FORTH_IDENTIFIER 3 #define wxSCI_FORTH_CONTROL 4 #define wxSCI_FORTH_KEYWORD 5 #define wxSCI_FORTH_DEFWORD 6 #define wxSCI_FORTH_PREWORD1 7 #define wxSCI_FORTH_PREWORD2 8 #define wxSCI_FORTH_NUMBER 9 #define wxSCI_FORTH_STRING 10 #define wxSCI_FORTH_LOCALE 11 // Lexical states for SCLEX_MATLAB #define wxSCI_MATLAB_DEFAULT 0 #define wxSCI_MATLAB_COMMENT 1 #define wxSCI_MATLAB_COMMAND 2 #define wxSCI_MATLAB_NUMBER 3 #define wxSCI_MATLAB_KEYWORD 4 // single quoted string #define wxSCI_MATLAB_STRING 5 #define wxSCI_MATLAB_OPERATOR 6 #define wxSCI_MATLAB_IDENTIFIER 7 #define wxSCI_MATLAB_DOUBLEQUOTESTRING 8 // Lexical states for SCLEX_SCRIPTOL #define wxSCI_SCRIPTOL_DEFAULT 0 #define wxSCI_SCRIPTOL_WHITE 1 #define wxSCI_SCRIPTOL_COMMENTLINE 2 #define wxSCI_SCRIPTOL_PERSISTENT 3 #define wxSCI_SCRIPTOL_CSTYLE 4 #define wxSCI_SCRIPTOL_COMMENTBLOCK 5 #define wxSCI_SCRIPTOL_NUMBER 6 #define wxSCI_SCRIPTOL_STRING 7 #define wxSCI_SCRIPTOL_CHARACTER 8 #define wxSCI_SCRIPTOL_STRINGEOL 9 #define wxSCI_SCRIPTOL_KEYWORD 10 #define wxSCI_SCRIPTOL_OPERATOR 11 #define wxSCI_SCRIPTOL_IDENTIFIER 12 #define wxSCI_SCRIPTOL_TRIPLE 13 #define wxSCI_SCRIPTOL_CLASSNAME 14 #define wxSCI_SCRIPTOL_PREPROCESSOR 15 // Lexical states for SCLEX_ASM #define wxSCI_ASM_DEFAULT 0 #define wxSCI_ASM_COMMENT 1 #define wxSCI_ASM_NUMBER 2 #define wxSCI_ASM_STRING 3 #define wxSCI_ASM_OPERATOR 4 #define wxSCI_ASM_IDENTIFIER 5 #define wxSCI_ASM_CPUINSTRUCTION 6 #define wxSCI_ASM_MATHINSTRUCTION 7 #define wxSCI_ASM_REGISTER 8 #define wxSCI_ASM_DIRECTIVE 9 #define wxSCI_ASM_DIRECTIVEOPERAND 10 #define wxSCI_ASM_COMMENTBLOCK 11 #define wxSCI_ASM_CHARACTER 12 #define wxSCI_ASM_STRINGEOL 13 #define wxSCI_ASM_EXTINSTRUCTION 14 // Lexical states for SCLEX_FORTRAN #define wxSCI_F_DEFAULT 0 #define wxSCI_F_COMMENT 1 #define wxSCI_F_NUMBER 2 #define wxSCI_F_STRING1 3 #define wxSCI_F_STRING2 4 #define wxSCI_F_STRINGEOL 5 #define wxSCI_F_OPERATOR 6 #define wxSCI_F_IDENTIFIER 7 #define wxSCI_F_WORD 8 #define wxSCI_F_WORD2 9 #define wxSCI_F_WORD3 10 #define wxSCI_F_PREPROCESSOR 11 #define wxSCI_F_OPERATOR2 12 #define wxSCI_F_LABEL 13 #define wxSCI_F_CONTINUATION 14 // Lexical states for SCLEX_CSS #define wxSCI_CSS_DEFAULT 0 #define wxSCI_CSS_TAG 1 #define wxSCI_CSS_CLASS 2 #define wxSCI_CSS_PSEUDOCLASS 3 #define wxSCI_CSS_UNKNOWN_PSEUDOCLASS 4 #define wxSCI_CSS_OPERATOR 5 #define wxSCI_CSS_IDENTIFIER 6 #define wxSCI_CSS_UNKNOWN_IDENTIFIER 7 #define wxSCI_CSS_VALUE 8 #define wxSCI_CSS_COMMENT 9 #define wxSCI_CSS_ID 10 #define wxSCI_CSS_IMPORTANT 11 #define wxSCI_CSS_DIRECTIVE 12 #define wxSCI_CSS_DOUBLESTRING 13 #define wxSCI_CSS_SINGLESTRING 14 #define wxSCI_CSS_IDENTIFIER2 15 #define wxSCI_CSS_ATTRIBUTE 16 // Lexical states for SCLEX_POV #define wxSCI_POV_DEFAULT 0 #define wxSCI_POV_COMMENT 1 #define wxSCI_POV_COMMENTLINE 2 #define wxSCI_POV_NUMBER 3 #define wxSCI_POV_OPERATOR 4 #define wxSCI_POV_IDENTIFIER 5 #define wxSCI_POV_STRING 6 #define wxSCI_POV_STRINGEOL 7 #define wxSCI_POV_DIRECTIVE 8 #define wxSCI_POV_BADDIRECTIVE 9 #define wxSCI_POV_WORD2 10 #define wxSCI_POV_WORD3 11 #define wxSCI_POV_WORD4 12 #define wxSCI_POV_WORD5 13 #define wxSCI_POV_WORD6 14 #define wxSCI_POV_WORD7 15 #define wxSCI_POV_WORD8 16 // Lexical states for SCLEX_LOUT #define wxSCI_LOUT_DEFAULT 0 #define wxSCI_LOUT_COMMENT 1 #define wxSCI_LOUT_NUMBER 2 #define wxSCI_LOUT_WORD 3 #define wxSCI_LOUT_WORD2 4 #define wxSCI_LOUT_WORD3 5 #define wxSCI_LOUT_WORD4 6 #define wxSCI_LOUT_STRING 7 #define wxSCI_LOUT_OPERATOR 8 #define wxSCI_LOUT_IDENTIFIER 9 #define wxSCI_LOUT_STRINGEOL 10 // Lexical states for SCLEX_ESCRIPT #define wxSCI_ESCRIPT_DEFAULT 0 #define wxSCI_ESCRIPT_COMMENT 1 #define wxSCI_ESCRIPT_COMMENTLINE 2 #define wxSCI_ESCRIPT_COMMENTDOC 3 #define wxSCI_ESCRIPT_NUMBER 4 #define wxSCI_ESCRIPT_WORD 5 #define wxSCI_ESCRIPT_STRING 6 #define wxSCI_ESCRIPT_OPERATOR 7 #define wxSCI_ESCRIPT_IDENTIFIER 8 #define wxSCI_ESCRIPT_BRACE 9 #define wxSCI_ESCRIPT_WORD2 10 #define wxSCI_ESCRIPT_WORD3 11 // Lexical states for SCLEX_PS #define wxSCI_PS_DEFAULT 0 #define wxSCI_PS_COMMENT 1 #define wxSCI_PS_DSC_COMMENT 2 #define wxSCI_PS_DSC_VALUE 3 #define wxSCI_PS_NUMBER 4 #define wxSCI_PS_NAME 5 #define wxSCI_PS_KEYWORD 6 #define wxSCI_PS_LITERAL 7 #define wxSCI_PS_IMMEVAL 8 #define wxSCI_PS_PAREN_ARRAY 9 #define wxSCI_PS_PAREN_DICT 10 #define wxSCI_PS_PAREN_PROC 11 #define wxSCI_PS_TEXT 12 #define wxSCI_PS_HEXSTRING 13 #define wxSCI_PS_BASE85STRING 14 #define wxSCI_PS_BADSTRINGCHAR 15 // Lexical states for SCLEX_NSIS #define wxSCI_NSIS_DEFAULT 0 #define wxSCI_NSIS_COMMENT 1 #define wxSCI_NSIS_STRINGDQ 2 #define wxSCI_NSIS_STRINGLQ 3 #define wxSCI_NSIS_STRINGRQ 4 #define wxSCI_NSIS_FUNCTION 5 #define wxSCI_NSIS_VARIABLE 6 #define wxSCI_NSIS_LABEL 7 #define wxSCI_NSIS_USERDEFINED 8 #define wxSCI_NSIS_SECTIONDEF 9 #define wxSCI_NSIS_SUBSECTIONDEF 10 #define wxSCI_NSIS_IFDEFINEDEF 11 #define wxSCI_NSIS_MACRODEF 12 #define wxSCI_NSIS_STRINGVAR 13 #define wxSCI_NSIS_NUMBER 14 #define wxSCI_NSIS_SECTIONGROUP 15 #define wxSCI_NSIS_PAGEEX 16 #define wxSCI_NSIS_FUNCTIONDEF 17 #define wxSCI_NSIS_COMMENTBOX 18 // Lexical states for SCLEX_MMIXAL #define wxSCI_MMIXAL_LEADWS 0 #define wxSCI_MMIXAL_COMMENT 1 #define wxSCI_MMIXAL_LABEL 2 #define wxSCI_MMIXAL_OPCODE 3 #define wxSCI_MMIXAL_OPCODE_PRE 4 #define wxSCI_MMIXAL_OPCODE_VALID 5 #define wxSCI_MMIXAL_OPCODE_UNKNOWN 6 #define wxSCI_MMIXAL_OPCODE_POST 7 #define wxSCI_MMIXAL_OPERANDS 8 #define wxSCI_MMIXAL_NUMBER 9 #define wxSCI_MMIXAL_REF 10 #define wxSCI_MMIXAL_CHAR 11 #define wxSCI_MMIXAL_STRING 12 #define wxSCI_MMIXAL_REGISTER 13 #define wxSCI_MMIXAL_HEX 14 #define wxSCI_MMIXAL_OPERATOR 15 #define wxSCI_MMIXAL_SYMBOL 16 #define wxSCI_MMIXAL_INCLUDE 17 // Lexical states for SCLEX_CLW #define wxSCI_CLW_DEFAULT 0 #define wxSCI_CLW_LABEL 1 #define wxSCI_CLW_COMMENT 2 #define wxSCI_CLW_STRING 3 #define wxSCI_CLW_USER_IDENTIFIER 4 #define wxSCI_CLW_INTEGER_CONSTANT 5 #define wxSCI_CLW_REAL_CONSTANT 6 #define wxSCI_CLW_PICTURE_STRING 7 #define wxSCI_CLW_KEYWORD 8 #define wxSCI_CLW_COMPILER_DIRECTIVE 9 #define wxSCI_CLW_RUNTIME_EXPRESSIONS 10 #define wxSCI_CLW_BUILTIN_PROCEDURES_FUNCTION 11 #define wxSCI_CLW_STRUCTURE_DATA_TYPE 12 #define wxSCI_CLW_ATTRIBUTE 13 #define wxSCI_CLW_STANDARD_EQUATE 14 #define wxSCI_CLW_ERROR 15 #define wxSCI_CLW_DEPRECATED 16 // Lexical states for SCLEX_LOT #define wxSCI_LOT_DEFAULT 0 #define wxSCI_LOT_HEADER 1 #define wxSCI_LOT_BREAK 2 #define wxSCI_LOT_SET 3 #define wxSCI_LOT_PASS 4 #define wxSCI_LOT_FAIL 5 #define wxSCI_LOT_ABORT 6 // Lexical states for SCLEX_YAML #define wxSCI_YAML_DEFAULT 0 #define wxSCI_YAML_COMMENT 1 #define wxSCI_YAML_IDENTIFIER 2 #define wxSCI_YAML_KEYWORD 3 #define wxSCI_YAML_NUMBER 4 #define wxSCI_YAML_REFERENCE 5 #define wxSCI_YAML_DOCUMENT 6 #define wxSCI_YAML_TEXT 7 #define wxSCI_YAML_ERROR 8 // Lexical states for SCLEX_TEX #define wxSCI_TEX_DEFAULT 0 #define wxSCI_TEX_SPECIAL 1 #define wxSCI_TEX_GROUP 2 #define wxSCI_TEX_SYMBOL 3 #define wxSCI_TEX_COMMAND 4 #define wxSCI_TEX_TEXT 5 #define wxSCI_METAPOST_DEFAULT 0 #define wxSCI_METAPOST_SPECIAL 1 #define wxSCI_METAPOST_GROUP 2 #define wxSCI_METAPOST_SYMBOL 3 #define wxSCI_METAPOST_COMMAND 4 #define wxSCI_METAPOST_TEXT 5 #define wxSCI_METAPOST_EXTRA 6 // Lexical states for SCLEX_ERLANG #define wxSCI_ERLANG_DEFAULT 0 #define wxSCI_ERLANG_COMMENT 1 #define wxSCI_ERLANG_VARIABLE 2 #define wxSCI_ERLANG_NUMBER 3 #define wxSCI_ERLANG_KEYWORD 4 #define wxSCI_ERLANG_STRING 5 #define wxSCI_ERLANG_OPERATOR 6 #define wxSCI_ERLANG_ATOM 7 #define wxSCI_ERLANG_FUNCTION_NAME 8 #define wxSCI_ERLANG_CHARACTER 9 #define wxSCI_ERLANG_MACRO 10 #define wxSCI_ERLANG_RECORD 11 #define wxSCI_ERLANG_SEPARATOR 12 #define wxSCI_ERLANG_NODE_NAME 13 #define wxSCI_ERLANG_UNKNOWN 31 // Lexical states for SCLEX_OCTAVE are identical to MatLab // Lexical states for SCLEX_MSSQL #define wxSCI_MSSQL_DEFAULT 0 #define wxSCI_MSSQL_COMMENT 1 #define wxSCI_MSSQL_LINE_COMMENT 2 #define wxSCI_MSSQL_NUMBER 3 #define wxSCI_MSSQL_STRING 4 #define wxSCI_MSSQL_OPERATOR 5 #define wxSCI_MSSQL_IDENTIFIER 6 #define wxSCI_MSSQL_VARIABLE 7 #define wxSCI_MSSQL_COLUMN_NAME 8 #define wxSCI_MSSQL_STATEMENT 9 #define wxSCI_MSSQL_DATATYPE 10 #define wxSCI_MSSQL_SYSTABLE 11 #define wxSCI_MSSQL_GLOBAL_VARIABLE 12 #define wxSCI_MSSQL_FUNCTION 13 #define wxSCI_MSSQL_STORED_PROCEDURE 14 #define wxSCI_MSSQL_DEFAULT_PREF_DATATYPE 15 #define wxSCI_MSSQL_COLUMN_NAME_2 16 // Lexical states for SCLEX_VERILOG #define wxSCI_V_DEFAULT 0 #define wxSCI_V_COMMENT 1 #define wxSCI_V_COMMENTLINE 2 #define wxSCI_V_COMMENTLINEBANG 3 #define wxSCI_V_NUMBER 4 #define wxSCI_V_WORD 5 #define wxSCI_V_STRING 6 #define wxSCI_V_WORD2 7 #define wxSCI_V_WORD3 8 #define wxSCI_V_PREPROCESSOR 9 #define wxSCI_V_OPERATOR 10 #define wxSCI_V_IDENTIFIER 11 #define wxSCI_V_STRINGEOL 12 #define wxSCI_V_USER 19 // Lexical states for SCLEX_KIX #define wxSCI_KIX_DEFAULT 0 #define wxSCI_KIX_COMMENT 1 #define wxSCI_KIX_STRING1 2 #define wxSCI_KIX_STRING2 3 #define wxSCI_KIX_NUMBER 4 #define wxSCI_KIX_VAR 5 #define wxSCI_KIX_MACRO 6 #define wxSCI_KIX_KEYWORD 7 #define wxSCI_KIX_FUNCTIONS 8 #define wxSCI_KIX_OPERATOR 9 #define wxSCI_KIX_IDENTIFIER 31 // Lexical states for SCLEX_GUI4CLI #define wxSCI_GC_DEFAULT 0 #define wxSCI_GC_COMMENTLINE 1 #define wxSCI_GC_COMMENTBLOCK 2 #define wxSCI_GC_GLOBAL 3 #define wxSCI_GC_EVENT 4 #define wxSCI_GC_ATTRIBUTE 5 #define wxSCI_GC_CONTROL 6 #define wxSCI_GC_COMMAND 7 #define wxSCI_GC_STRING 8 #define wxSCI_GC_OPERATOR 9 // Lexical states for SCLEX_SPECMAN #define wxSCI_SN_DEFAULT 0 #define wxSCI_SN_CODE 1 #define wxSCI_SN_COMMENTLINE 2 #define wxSCI_SN_COMMENTLINEBANG 3 #define wxSCI_SN_NUMBER 4 #define wxSCI_SN_WORD 5 #define wxSCI_SN_STRING 6 #define wxSCI_SN_WORD2 7 #define wxSCI_SN_WORD3 8 #define wxSCI_SN_PREPROCESSOR 9 #define wxSCI_SN_OPERATOR 10 #define wxSCI_SN_IDENTIFIER 11 #define wxSCI_SN_STRINGEOL 12 #define wxSCI_SN_REGEXTAG 13 #define wxSCI_SN_SIGNAL 14 #define wxSCI_SN_USER 19 // Lexical states for SCLEX_AU3 #define wxSCI_AU3_DEFAULT 0 #define wxSCI_AU3_COMMENT 1 #define wxSCI_AU3_COMMENTBLOCK 2 #define wxSCI_AU3_NUMBER 3 #define wxSCI_AU3_FUNCTION 4 #define wxSCI_AU3_KEYWORD 5 #define wxSCI_AU3_MACRO 6 #define wxSCI_AU3_STRING 7 #define wxSCI_AU3_OPERATOR 8 #define wxSCI_AU3_VARIABLE 9 #define wxSCI_AU3_SENT 10 #define wxSCI_AU3_PREPROCESSOR 11 #define wxSCI_AU3_SPECIAL 12 #define wxSCI_AU3_EXPAND 13 #define wxSCI_AU3_COMOBJ 14 #define wxSCI_AU3_UDF 15 // Lexical states for SCLEX_APDL #define wxSCI_APDL_DEFAULT 0 #define wxSCI_APDL_COMMENT 1 #define wxSCI_APDL_COMMENTBLOCK 2 #define wxSCI_APDL_NUMBER 3 #define wxSCI_APDL_STRING 4 #define wxSCI_APDL_OPERATOR 5 #define wxSCI_APDL_WORD 6 #define wxSCI_APDL_PROCESSOR 7 #define wxSCI_APDL_COMMAND 8 #define wxSCI_APDL_SLASHCOMMAND 9 #define wxSCI_APDL_STARCOMMAND 10 #define wxSCI_APDL_ARGUMENT 11 #define wxSCI_APDL_FUNCTION 12 // Lexical states for SCLEX_BASH #define wxSCI_SH_DEFAULT 0 #define wxSCI_SH_ERROR 1 #define wxSCI_SH_COMMENTLINE 2 #define wxSCI_SH_NUMBER 3 #define wxSCI_SH_WORD 4 #define wxSCI_SH_STRING 5 #define wxSCI_SH_CHARACTER 6 #define wxSCI_SH_OPERATOR 7 #define wxSCI_SH_IDENTIFIER 8 #define wxSCI_SH_SCALAR 9 #define wxSCI_SH_PARAM 10 #define wxSCI_SH_BACKTICKS 11 #define wxSCI_SH_HERE_DELIM 12 #define wxSCI_SH_HERE_Q 13 // Lexical states for SCLEX_ASN1 #define wxSCI_ASN1_DEFAULT 0 #define wxSCI_ASN1_COMMENT 1 #define wxSCI_ASN1_IDENTIFIER 2 #define wxSCI_ASN1_STRING 3 #define wxSCI_ASN1_OID 4 #define wxSCI_ASN1_SCALAR 5 #define wxSCI_ASN1_KEYWORD 6 #define wxSCI_ASN1_ATTRIBUTE 7 #define wxSCI_ASN1_DESCRIPTOR 8 #define wxSCI_ASN1_TYPE 9 #define wxSCI_ASN1_OPERATOR 10 // Lexical states for SCLEX_VHDL #define wxSCI_VHDL_DEFAULT 0 #define wxSCI_VHDL_COMMENT 1 #define wxSCI_VHDL_COMMENTLINEBANG 2 #define wxSCI_VHDL_NUMBER 3 #define wxSCI_VHDL_STRING 4 #define wxSCI_VHDL_OPERATOR 5 #define wxSCI_VHDL_IDENTIFIER 6 #define wxSCI_VHDL_STRINGEOL 7 #define wxSCI_VHDL_KEYWORD 8 #define wxSCI_VHDL_STDOPERATOR 9 #define wxSCI_VHDL_ATTRIBUTE 10 #define wxSCI_VHDL_STDFUNCTION 11 #define wxSCI_VHDL_STDPACKAGE 12 #define wxSCI_VHDL_STDTYPE 13 #define wxSCI_VHDL_USERWORD 14 // Lexical states for SCLEX_CAML #define wxSCI_CAML_DEFAULT 0 #define wxSCI_CAML_IDENTIFIER 1 #define wxSCI_CAML_TAGNAME 2 #define wxSCI_CAML_KEYWORD 3 #define wxSCI_CAML_KEYWORD2 4 #define wxSCI_CAML_KEYWORD3 5 #define wxSCI_CAML_LINENUM 6 #define wxSCI_CAML_OPERATOR 7 #define wxSCI_CAML_NUMBER 8 #define wxSCI_CAML_CHAR 9 #define wxSCI_CAML_STRING 11 #define wxSCI_CAML_COMMENT 12 #define wxSCI_CAML_COMMENT1 13 #define wxSCI_CAML_COMMENT2 14 #define wxSCI_CAML_COMMENT3 15 // Lexical states for SCLEX_HA #define wxSCI_HA_DEFAULT 0 #define wxSCI_HA_IDENTIFIER 1 #define wxSCI_HA_KEYWORD 2 #define wxSCI_HA_NUMBER 3 #define wxSCI_HA_STRING 4 #define wxSCI_HA_CHARACTER 5 #define wxSCI_HA_CLASS 6 #define wxSCI_HA_MODULE 7 #define wxSCI_HA_CAPITAL 8 #define wxSCI_HA_DATA 9 #define wxSCI_HA_IMPORT 10 #define wxSCI_HA_OPERATOR 11 #define wxSCI_HA_INSTANCE 12 #define wxSCI_HA_COMMENTLINE 13 #define wxSCI_HA_COMMENTBLOCK 14 #define wxSCI_HA_COMMENTBLOCK2 15 #define wxSCI_HA_COMMENTBLOCK3 16 // Lexical states for SCLEX_T3 #define wxSCI_T3_DEFAULT 0 #define wxSCI_T3_X_DEFAULT 1 #define wxSCI_T3_PREPROCESSOR 2 #define wxSCI_T3_BLOCK_COMMENT 3 #define wxSCI_T3_LINE_COMMENT 4 #define wxSCI_T3_OPERATOR 5 #define wxSCI_T3_KEYWORD 6 #define wxSCI_T3_NUMBER 7 #define wxSCI_T3_IDENTIFIER 8 #define wxSCI_T3_S_STRING 9 #define wxSCI_T3_D_STRING 10 #define wxSCI_T3_X_STRING 11 #define wxSCI_T3_LIB_DIRECTIVE 12 #define wxSCI_T3_MSG_PARAM 13 #define wxSCI_T3_HTML_TAG 14 #define wxSCI_T3_HTML_DEFAULT 15 #define wxSCI_T3_HTML_STRING 16 #define wxSCI_T3_USER1 17 #define wxSCI_T3_USER2 18 #define wxSCI_T3_USER3 19 // Lexical states for SCLEX_REBOL #define wxSCI_REBOL_DEFAULT 0 #define wxSCI_REBOL_COMMENTLINE 1 #define wxSCI_REBOL_COMMENTBLOCK 2 #define wxSCI_REBOL_PREFACE 3 #define wxSCI_REBOL_OPERATOR 4 #define wxSCI_REBOL_CHARACTER 5 #define wxSCI_REBOL_QUOTEDSTRING 6 #define wxSCI_REBOL_BRACEDSTRING 7 #define wxSCI_REBOL_NUMBER 8 #define wxSCI_REBOL_PAIR 9 #define wxSCI_REBOL_TUPLE 10 #define wxSCI_REBOL_BINARY 11 #define wxSCI_REBOL_MONEY 12 #define wxSCI_REBOL_ISSUE 13 #define wxSCI_REBOL_TAG 14 #define wxSCI_REBOL_FILE 15 #define wxSCI_REBOL_EMAIL 16 #define wxSCI_REBOL_URL 17 #define wxSCI_REBOL_DATE 18 #define wxSCI_REBOL_TIME 19 #define wxSCI_REBOL_IDENTIFIER 20 #define wxSCI_REBOL_WORD 21 #define wxSCI_REBOL_WORD2 22 #define wxSCI_REBOL_WORD3 23 #define wxSCI_REBOL_WORD4 24 #define wxSCI_REBOL_WORD5 25 #define wxSCI_REBOL_WORD6 26 #define wxSCI_REBOL_WORD7 27 #define wxSCI_REBOL_WORD8 28 // Lexical states for SCLEX_SQL #define wxSCI_SQL_DEFAULT 0 #define wxSCI_SQL_COMMENT 1 #define wxSCI_SQL_COMMENTLINE 2 #define wxSCI_SQL_COMMENTDOC 3 #define wxSCI_SQL_NUMBER 4 #define wxSCI_SQL_WORD 5 #define wxSCI_SQL_STRING 6 #define wxSCI_SQL_CHARACTER 7 #define wxSCI_SQL_SQLPLUS 8 #define wxSCI_SQL_SQLPLUS_PROMPT 9 #define wxSCI_SQL_OPERATOR 10 #define wxSCI_SQL_IDENTIFIER 11 #define wxSCI_SQL_SQLPLUS_COMMENT 13 #define wxSCI_SQL_COMMENTLINEDOC 15 #define wxSCI_SQL_WORD2 16 #define wxSCI_SQL_COMMENTDOCKEYWORD 17 #define wxSCI_SQL_COMMENTDOCKEYWORDERROR 18 #define wxSCI_SQL_USER1 19 #define wxSCI_SQL_USER2 20 #define wxSCI_SQL_USER3 21 #define wxSCI_SQL_USER4 22 #define wxSCI_SQL_QUOTEDIDENTIFIER 23 // Lexical states for SCLEX_ST #define wxSCI_ST_DEFAULT 0 #define wxSCI_ST_STRING 1 #define wxSCI_ST_NUMBER 2 #define wxSCI_ST_COMMENT 3 #define wxSCI_ST_SYMBOL 4 #define wxSCI_ST_BINARY 5 #define wxSCI_ST_BOOL 6 #define wxSCI_ST_SELF 7 #define wxSCI_ST_SUPER 8 #define wxSCI_ST_NIL 9 #define wxSCI_ST_GLOBAL 10 #define wxSCI_ST_RETURN 11 #define wxSCI_ST_SPECIAL 12 #define wxSCI_ST_KWSEND 13 #define wxSCI_ST_ASSIGN 14 #define wxSCI_ST_CHARACTER 15 #define wxSCI_ST_SPEC_SEL 16 // Lexical states for SCLEX_FS #define wxSCI_FS_DEFAULT 0 #define wxSCI_FS_COMMENT 1 #define wxSCI_FS_COMMENTLINE 2 #define wxSCI_FS_COMMENTDOC 3 #define wxSCI_FS_COMMENTLINEDOC 4 #define wxSCI_FS_COMMENTDOCKEYWORD 5 #define wxSCI_FS_COMMENTDOCKEYWORDERROR 6 #define wxSCI_FS_KEYWORD 7 #define wxSCI_FS_KEYWORD2 8 #define wxSCI_FS_KEYWORD3 9 #define wxSCI_FS_KEYWORD4 10 #define wxSCI_FS_NUMBER 11 #define wxSCI_FS_STRING 12 #define wxSCI_FS_PREPROCESSOR 13 #define wxSCI_FS_OPERATOR 14 #define wxSCI_FS_IDENTIFIER 15 #define wxSCI_FS_DATE 16 #define wxSCI_FS_STRINGEOL 17 #define wxSCI_FS_CONSTANT 18 #define wxSCI_FS_ASM 19 #define wxSCI_FS_LABEL 20 #define wxSCI_FS_ERROR 21 #define wxSCI_FS_HEXNUMBER 22 #define wxSCI_FS_BINNUMBER 23 // Lexical states for SCLEX_CSOUND #define wxSCI_CSOUND_DEFAULT 0 #define wxSCI_CSOUND_COMMENT 1 #define wxSCI_CSOUND_NUMBER 2 #define wxSCI_CSOUND_OPERATOR 3 #define wxSCI_CSOUND_INSTR 4 #define wxSCI_CSOUND_IDENTIFIER 5 #define wxSCI_CSOUND_OPCODE 6 #define wxSCI_CSOUND_HEADERSTMT 7 #define wxSCI_CSOUND_USERKEYWORD 8 #define wxSCI_CSOUND_COMMENTBLOCK 9 #define wxSCI_CSOUND_PARAM 10 #define wxSCI_CSOUND_ARATE_VAR 11 #define wxSCI_CSOUND_KRATE_VAR 12 #define wxSCI_CSOUND_IRATE_VAR 13 #define wxSCI_CSOUND_GLOBAL_VAR 14 #define wxSCI_CSOUND_STRINGEOL 15 // Lexical states for SCLEX_INNOSETUP #define wxSCI_INNO_DEFAULT 0 #define wxSCI_INNO_COMMENT 1 #define wxSCI_INNO_KEYWORD 2 #define wxSCI_INNO_PARAMETER 3 #define wxSCI_INNO_SECTION 4 #define wxSCI_INNO_PREPROC 5 #define wxSCI_INNO_PREPROC_INLINE 6 #define wxSCI_INNO_COMMENT_PASCAL 7 #define wxSCI_INNO_KEYWORD_PASCAL 8 #define wxSCI_INNO_KEYWORD_USER 9 #define wxSCI_INNO_STRING_DOUBLE 10 #define wxSCI_INNO_STRING_SINGLE 11 #define wxSCI_INNO_IDENTIFIER 12 // Lexical states for SCLEX_OPAL #define wxSCI_OPAL_SPACE 0 #define wxSCI_OPAL_COMMENT_BLOCK 1 #define wxSCI_OPAL_COMMENT_LINE 2 #define wxSCI_OPAL_INTEGER 3 #define wxSCI_OPAL_KEYWORD 4 #define wxSCI_OPAL_SORT 5 #define wxSCI_OPAL_STRING 6 #define wxSCI_OPAL_PAR 7 #define wxSCI_OPAL_BOOL_CONST 8 #define wxSCI_OPAL_DEFAULT 32 // Lexical states for SCLEX_SPICE #define wxSCI_SPICE_DEFAULT 0 #define wxSCI_SPICE_IDENTIFIER 1 #define wxSCI_SPICE_KEYWORD 2 #define wxSCI_SPICE_KEYWORD2 3 #define wxSCI_SPICE_KEYWORD3 4 #define wxSCI_SPICE_NUMBER 5 #define wxSCI_SPICE_DELIMITER 6 #define wxSCI_SPICE_VALUE 7 #define wxSCI_SPICE_COMMENTLINE 8 //----------------------------------------- // Commands that can be bound to keystrokes // Redoes the next action on the undo history. #define wxSCI_CMD_REDO 2011 // Select all the text in the document. #define wxSCI_CMD_SELECTALL 2013 // Undo one action in the undo history. #define wxSCI_CMD_UNDO 2176 // Cut the selection to the clipboard. #define wxSCI_CMD_CUT 2177 // Copy the selection to the clipboard. #define wxSCI_CMD_COPY 2178 // Paste the contents of the clipboard into the document replacing the selection. #define wxSCI_CMD_PASTE 2179 // Clear the selection. #define wxSCI_CMD_CLEAR 2180 // Move caret down one line. #define wxSCI_CMD_LINEDOWN 2300 // Move caret down one line extending selection to new caret position. #define wxSCI_CMD_LINEDOWNEXTEND 2301 // Move caret up one line. #define wxSCI_CMD_LINEUP 2302 // Move caret up one line extending selection to new caret position. #define wxSCI_CMD_LINEUPEXTEND 2303 // Move caret left one character. #define wxSCI_CMD_CHARLEFT 2304 // Move caret left one character extending selection to new caret position. #define wxSCI_CMD_CHARLEFTEXTEND 2305 // Move caret right one character. #define wxSCI_CMD_CHARRIGHT 2306 // Move caret right one character extending selection to new caret position. #define wxSCI_CMD_CHARRIGHTEXTEND 2307 // Move caret left one word. #define wxSCI_CMD_WORDLEFT 2308 // Move caret left one word extending selection to new caret position. #define wxSCI_CMD_WORDLEFTEXTEND 2309 // Move caret right one word. #define wxSCI_CMD_WORDRIGHT 2310 // Move caret right one word extending selection to new caret position. #define wxSCI_CMD_WORDRIGHTEXTEND 2311 // Move caret to first position on line. #define wxSCI_CMD_HOME 2312 // Move caret to first position on line extending selection to new caret position. #define wxSCI_CMD_HOMEEXTEND 2313 // Move caret to last position on line. #define wxSCI_CMD_LINEEND 2314 // Move caret to last position on line extending selection to new caret position. #define wxSCI_CMD_LINEENDEXTEND 2315 // Move caret to first position in document. #define wxSCI_CMD_DOCUMENTSTART 2316 // Move caret to first position in document extending selection to new caret position. #define wxSCI_CMD_DOCUMENTSTARTEXTEND 2317 // Move caret to last position in document. #define wxSCI_CMD_DOCUMENTEND 2318 // Move caret to last position in document extending selection to new caret position. #define wxSCI_CMD_DOCUMENTENDEXTEND 2319 // Move caret one page up. #define wxSCI_CMD_PAGEUP 2320 // Move caret one page up extending selection to new caret position. #define wxSCI_CMD_PAGEUPEXTEND 2321 // Move caret one page down. #define wxSCI_CMD_PAGEDOWN 2322 // Move caret one page down extending selection to new caret position. #define wxSCI_CMD_PAGEDOWNEXTEND 2323 // Switch from insert to overtype mode or the reverse. #define wxSCI_CMD_EDITTOGGLEOVERTYPE 2324 // Cancel any modes such as call tip or auto-completion list display. #define wxSCI_CMD_CANCEL 2325 // Delete the selection or if no selection, the character before the caret. #define wxSCI_CMD_DELETEBACK 2326 // If selection is empty or all on one line replace the selection with a tab character. // If more than one line selected, indent the lines. #define wxSCI_CMD_TAB 2327 // Dedent the selected lines. #define wxSCI_CMD_BACKTAB 2328 // Insert a new line, may use a CRLF, CR or LF depending on EOL mode. #define wxSCI_CMD_NEWLINE 2329 // Insert a Form Feed character. #define wxSCI_CMD_FORMFEED 2330 // Move caret to before first visible character on line. // If already there move to first character on line. #define wxSCI_CMD_VCHOME 2331 // Like VCHome but extending selection to new caret position. #define wxSCI_CMD_VCHOMEEXTEND 2332 // Magnify the displayed text by increasing the sizes by 1 point. #define wxSCI_CMD_ZOOMIN 2333 // Make the displayed text smaller by decreasing the sizes by 1 point. #define wxSCI_CMD_ZOOMOUT 2334 // Delete the word to the left of the caret. #define wxSCI_CMD_DELWORDLEFT 2335 // Delete the word to the right of the caret. #define wxSCI_CMD_DELWORDRIGHT 2336 // Cut the line containing the caret. #define wxSCI_CMD_LINECUT 2337 // Delete the line containing the caret. #define wxSCI_CMD_LINEDELETE 2338 // Switch the current line with the previous. #define wxSCI_CMD_LINETRANSPOSE 2339 // Duplicate the current line. #define wxSCI_CMD_LINEDUPLICATE 2404 // Transform the selection to lower case. #define wxSCI_CMD_LOWERCASE 2340 // Transform the selection to upper case. #define wxSCI_CMD_UPPERCASE 2341 // Scroll the document down, keeping the caret visible. #define wxSCI_CMD_LINESCROLLDOWN 2342 // Scroll the document up, keeping the caret visible. #define wxSCI_CMD_LINESCROLLUP 2343 // Delete the selection or if no selection, the character before the caret. // Will not delete the character before at the start of a line. #define wxSCI_CMD_DELETEBACKNOTLINE 2344 // Move caret to first position on display line. #define wxSCI_CMD_HOMEDISPLAY 2345 // Move caret to first position on display line extending selection to // new caret position. #define wxSCI_CMD_HOMEDISPLAYEXTEND 2346 // Move caret to last position on display line. #define wxSCI_CMD_LINEENDDISPLAY 2347 // Move caret to last position on display line extending selection to new // caret position. #define wxSCI_CMD_LINEENDDISPLAYEXTEND 2348 // These are like their namesakes Home(Extend)?, LineEnd(Extend)?, VCHome(Extend)? // except they behave differently when word-wrap is enabled: // They go first to the start / end of the display line, like (Home|LineEnd)Display // The difference is that, the cursor is already at the point, it goes on to the start // or end of the document line, as appropriate for (Home|LineEnd|VCHome)(Extend)?. #define wxSCI_CMD_HOMEWRAP 2349 #define wxSCI_CMD_HOMEWRAPEXTEND 2450 #define wxSCI_CMD_LINEENDWRAP 2451 #define wxSCI_CMD_LINEENDWRAPEXTEND 2452 #define wxSCI_CMD_VCHOMEWRAP 2453 #define wxSCI_CMD_VCHOMEWRAPEXTEND 2454 // Copy the line containing the caret. #define wxSCI_CMD_LINECOPY 2455 // Move to the previous change in capitalisation. #define wxSCI_CMD_WORDPARTLEFT 2390 // Move to the previous change in capitalisation extending selection // to new caret position. #define wxSCI_CMD_WORDPARTLEFTEXTEND 2391 // Move to the change next in capitalisation. #define wxSCI_CMD_WORDPARTRIGHT 2392 // Move to the next change in capitalisation extending selection // to new caret position. #define wxSCI_CMD_WORDPARTRIGHTEXTEND 2393 // Delete back from the current position to the start of the line. #define wxSCI_CMD_DELLINELEFT 2395 // Delete forwards from the current position to the end of the line. #define wxSCI_CMD_DELLINERIGHT 2396 // Move caret between paragraphs (delimited by empty lines). #define wxSCI_CMD_PARADOWN 2413 #define wxSCI_CMD_PARADOWNEXTEND 2414 #define wxSCI_CMD_PARAUP 2415 #define wxSCI_CMD_PARAUPEXTEND 2416 // Move caret down one line, extending rectangular selection to new caret position. #define wxSCI_CMD_LINEDOWNRECTEXTEND 2426 // Move caret up one line, extending rectangular selection to new caret position. #define wxSCI_CMD_LINEUPRECTEXTEND 2427 // Move caret left one character, extending rectangular selection to new caret position. #define wxSCI_CMD_CHARLEFTRECTEXTEND 2428 // Move caret right one character, extending rectangular selection to new caret position. #define wxSCI_CMD_CHARRIGHTRECTEXTEND 2429 // Move caret to first position on line, extending rectangular selection to new caret position. #define wxSCI_CMD_HOMERECTEXTEND 2430 // Move caret to before first visible character on line. // If already there move to first character on line. // In either case, extend rectangular selection to new caret position. #define wxSCI_CMD_VCHOMERECTEXTEND 2431 // Move caret to last position on line, extending rectangular selection to new caret position. #define wxSCI_CMD_LINEENDRECTEXTEND 2432 // Move caret one page up, extending rectangular selection to new caret position. #define wxSCI_CMD_PAGEUPRECTEXTEND 2433 // Move caret one page down, extending rectangular selection to new caret position. #define wxSCI_CMD_PAGEDOWNRECTEXTEND 2434 // Move caret to top of page, or one page up if already at top of page. #define wxSCI_CMD_STUTTEREDPAGEUP 2435 // Move caret to top of page, or one page up if already at top of page, extending selection to new caret position. #define wxSCI_CMD_STUTTEREDPAGEUPEXTEND 2436 // Move caret to bottom of page, or one page down if already at bottom of page. #define wxSCI_CMD_STUTTEREDPAGEDOWN 2437 // Move caret to bottom of page, or one page down if already at bottom of page, extending selection to new caret position. #define wxSCI_CMD_STUTTEREDPAGEDOWNEXTEND 2438 // Move caret left one word, position cursor at end of word. #define wxSCI_CMD_WORDLEFTEND 2439 // Move caret left one word, position cursor at end of word, extending selection to new caret position. #define wxSCI_CMD_WORDLEFTENDEXTEND 2440 // Move caret right one word, position cursor at end of word. #define wxSCI_CMD_WORDRIGHTEND 2441 // Move caret right one word, position cursor at end of word, extending selection to new caret position. #define wxSCI_CMD_WORDRIGHTENDEXTEND 2442 // END of generated section //---------------------------------------------------------------------- class ScintillaWX; // forward declare class WordList; #ifdef SCI_NAMESPACE // begin [CHANGED] #ifndef SCI_SCOPE #define SCI_SCOPE( x ) Scintilla::x #endif namespace Scintilla{ #else #ifndef SCI_SCOPE #define SCI_SCOPE( x ) x #endif #endif struct SCNotification; #ifdef SCI_NAMESPACE } #endif // end [CHANGED] #ifndef SWIG extern WXDLLIMPEXP_SCI const wxChar* wxSCINameStr; class WXDLLIMPEXP_SCI wxScintilla; class WXDLLIMPEXP_SCI wxScintillaEvent; #endif //---------------------------------------------------------------------- class WXDLLIMPEXP_SCI wxScintilla : public wxControl { public: #ifdef SWIGPYTHON %pythonAppend wxScintilla "self._setOORInfo(self)" %pythonAppend wxScintilla() "" wxScintilla (wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxSCINameStr); %name(PreScintilla) wxScintilla(); #elif defined (SWIGRUBY) wxScintilla (wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxSCINameStr); ~wxScintilla(); #else wxScintilla (wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxSCINameStr); wxScintilla() { m_swx = NULL; } ~wxScintilla(); #endif bool Create (wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxSCINameStr); //---------------------------------------------------------------------- // BEGIN generated section. The following code is automatically generated // by gen_iface.py. Do not edit this file. Edit wxscintilla.h.in instead // and regenerate // Add text to the document. void AddText (const wxString& text); void AddText (const int length, const wxString& text); // Add array of cells to document. void AddStyledText (const wxMemoryBuffer& data); // Insert string at a position. void InsertText (int pos, const wxString& text); // Delete all text in the document. void ClearAll(); // Set all style bytes to 0, remove all folding information. void ClearDocumentStyle(); // The number of characters in the document. int GetLength(); // Returns the character byte at the position. int GetCharAt (int pos); // Returns the position of the caret. int GetCurrentPos(); // Returns the position of the opposite end of the selection to the caret. int GetAnchor(); // Returns the style byte at the position. int GetStyleAt (int pos); // Redoes the next action on the undo history. void Redo(); // Choose between collecting actions into the undo // history and discarding them. void SetUndoCollection (bool collectUndo); // Select all the text in the document. void SelectAll(); // Remember the current position in the undo history as the position // at which the document was saved. void SetSavePoint(); // Retrieve a buffer of cells. wxMemoryBuffer GetStyledText (int startPos, int endPos); // Are there any redoable actions in the undo history? bool CanRedo(); // Retrieve the line number at which a particular marker is located. int MarkerLineFromHandle (int handle); // Delete a marker. void MarkerDeleteHandle (int handle); // Is undo history being collected? bool GetUndoCollection(); // Are white space characters currently visible? // Returns one of SCWS_* constants. int GetViewWhiteSpace(); // Make white space characters invisible, always visible or visible outside indentation. void SetViewWhiteSpace (int viewWS); // Find the position from a point within the window. int PositionFromPoint (wxPoint pt); // Find the position from a point within the window but return // INVALID_POSITION if not close to text. int PositionFromPointClose (int x, int y); // Set caret to start of a line and ensure it is visible. void GotoLine (int line); // Set caret to a position and ensure it is visible. void GotoPos (int pos); // Set the selection anchor to a position. The anchor is the opposite // end of the selection from the caret. void SetAnchor (int posAnchor); // Retrieve the text of the line containing the caret. // Returns the index of the caret on the line. #ifdef SWIG wxString GetCurLine (int* OUTPUT); #else wxString GetCurLine (int* linePos = NULL); #endif // Retrieve the position of the last correctly styled character. int GetEndStyled(); // Convert all line endings in the document to one mode. void ConvertEOLs (int eolMode); // Retrieve the current end of line mode - one of CRLF, CR, or LF. int GetEOLMode(); // Set the current end of line mode. void SetEOLMode (int eolMode); // Set the current styling position to pos and the styling mask to mask. // The styling mask can be used to protect some bits in each styling byte from modification. void StartStyling (int pos, int mask); // Change style from current styling position for length characters to a style // and move the current styling position to after this newly styled segment. void SetStyling (int length, int style); // Is drawing done first into a buffer or direct to the screen? bool GetBufferedDraw(); // If drawing is buffered then each line of text is drawn into a bitmap buffer // before drawing it to the screen to avoid flicker. void SetBufferedDraw (bool buffered); // Change the visible size of a tab to be a multiple of the width of a space character. void SetTabWidth (int tabWidth); // Retrieve the visible size of a tab. int GetTabWidth(); // Set the code page used to interpret the bytes of the document as characters. void SetCodePage (int codePage); // Set the symbol used for a particular marker number, void MarkerDefine (int markerNumber, int markerSymbol); // Set the foreground colour used for a particular marker number. void MarkerSetForeground (int markerNumber, const wxColour& fore); // Set the background colour used for a particular marker number. void MarkerSetBackground (int markerNumber, const wxColour& back); // Add a marker to a line, returning an ID which can be used to find or delete the marker. int MarkerAdd (int line, int markerNumber); // Delete a marker from a line. void MarkerDelete (int line, int markerNumber); // Delete a marker with a particular number from all lines. void MarkerDeleteAll (int markerNumber); // Get a bit mask of all the markers set on a line. int MarkerGet (int line); // Find the next line after lineStart that includes a marker in mask. int MarkerNext (int lineStart, int markerMask); // Find the previous line before lineStart that includes a marker in mask. int MarkerPrevious (int lineStart, int markerMask); // Define a marker from a bitmap void MarkerDefineBitmap (int markerNumber, const wxBitmap& bmp); // Add a set of markers to a line. void MarkerAddSet (int line, int markerSet); // Set the alpha used for a marker that is drawn in the text area, not the margin. void MarkerSetAlpha (int markerNumber, int alpha); // Set a margin to be either numeric or symbolic. void SetMarginType (int margin, int marginType); // Retrieve the type of a margin. int GetMarginType (int margin); // Set the width of a margin to a width expressed in pixels. void SetMarginWidth (int margin, int pixels); // Retrieve the width of a margin in pixels. int GetMarginWidth (int margin); // Set a mask that determines which markers are displayed in a margin. void SetMarginMask (int margin, int mask); // Retrieve the marker mask of a margin. int GetMarginMask (int margin); // Make a margin sensitive or insensitive to mouse clicks. void SetMarginSensitive (int margin, bool sensitive); // Retrieve the mouse click sensitivity of a margin. bool GetMarginSensitive (int margin); // Clear all the styles and make equivalent to the global default style. void StyleClearAll(); // Set the foreground colour of a style. void StyleSetForeground (int style, const wxColour& fore); // Set the background colour of a style. void StyleSetBackground (int style, const wxColour& back); // Set a style to be bold or not. void StyleSetBold (int style, bool bold); // Set a style to be italic or not. void StyleSetItalic (int style, bool italic); // Set the size of characters of a style. void StyleSetSize (int style, int sizePoints); // Set the font of a style. void StyleSetFaceName (int style, const wxString& fontName); // Set a style to have its end of line filled or not. void StyleSetEOLFilled (int style, bool filled); // Reset the default style to its state at startup void StyleResetDefault(); // Set a style to be underlined or not. void StyleSetUnderline (int style, bool underline); // Set a style to be mixed case, or to force upper or lower case. void StyleSetCase (int style, int caseMode); // Set a style to be a hotspot or not. void StyleSetHotSpot (int style, bool hotspot); // Get the alpha of the selection. int GetSelAlpha (); // Set the alpha of the selection. void SetSelAlpha (int alpha); // Set the foreground colour of the selection and whether to use this setting. void SetSelForeground (bool useSetting, const wxColour& fore); // Set the background colour of the selection and whether to use this setting. void SetSelBackground (bool useSetting, const wxColour& back); // Set the foreground colour of the caret. void SetCaretForeground (const wxColour& fore); // When key+modifier combination km is pressed perform msg. void CmdKeyAssign (int key, int modifiers, int cmd); // When key+modifier combination km is pressed do nothing. void CmdKeyClear (int key, int modifiers); // Drop all key mappings. void CmdKeyClearAll(); // Set the styles for a segment of the document. void SetStyleBytes (int length, char* styleBytes); // Set a style to be visible or not. void StyleSetVisible (int style, bool visible); // Get the time in milliseconds that the caret is on and off. int GetCaretPeriod(); // Get the time in milliseconds that the caret is on and off. 0 = steady on. void SetCaretPeriod (int milliseconds); // Set the set of characters making up words for when moving or selecting by word. // First sets deaults like SetCharsDefault. void SetWordChars (const wxString& characters); // Start a sequence of actions that is undone and redone as a unit. // May be nested. void BeginUndoAction(); // End a sequence of actions that is undone and redone as a unit. void EndUndoAction(); // Set an indicator to plain, squiggle or TT. void IndicatorSetStyle (int indic, int style); // Retrieve the style of an indicator. int IndicatorGetStyle (int indic); // Set the foreground colour of an indicator. void IndicatorSetForeground (int indic, const wxColour& fore); // Retrieve the foreground colour of an indicator. wxColour IndicatorGetForeground (int indic); // Set the foreground colour of all whitespace and whether to use this setting. void SetWhitespaceForeground (bool useSetting, const wxColour& fore); // Set the background colour of all whitespace and whether to use this setting. void SetWhitespaceBackground (bool useSetting, const wxColour& back); // Divide each styling byte into lexical class bits (default: 5) and indicator // bits (default: 3). If a lexer requires more than 32 lexical states, then this // is used to expand the possible states. void SetStyleBits (int bits); // Retrieve number of bits in style bytes used to hold the lexical state. int GetStyleBits(); // Used to hold extra styling information for each line. void SetLineState (int line, int state); // Retrieve the extra styling information for a line. int GetLineState (int line); // Retrieve the last line number that has line state. int GetMaxLineState(); // Is the background of the line containing the caret in a different colour? bool GetCaretLineVisible(); // Display the background of the line containing the caret in a different colour. void SetCaretLineVisible (bool show); // Get the colour of the background of the line containing the caret. wxColour GetCaretLineBackground(); // Set the colour of the background of the line containing the caret. void SetCaretLineBackground (const wxColour& back); // Set a style to be changeable or not (read only). // Experimental feature, currently buggy. void StyleSetChangeable (int style, bool changeable); // Display a auto-completion list. // The lenEntered parameter indicates how many characters before // the caret should be used to provide context. void AutoCompShow (int lenEntered, const wxString& itemList); // Remove the auto-completion list from the screen. void AutoCompCancel(); // Is there an auto-completion list visible? bool AutoCompActive(); // Retrieve the position of the caret when the auto-completion list was displayed. int AutoCompPosStart(); // User has selected an item so remove the list and insert the selection. void AutoCompComplete(); // Define a set of character that when typed cancel the auto-completion list. void AutoCompStops (const wxString& characterSet); // Change the separator character in the string setting up an auto-completion list. // Default is space but can be changed if items contain space. void AutoCompSetSeparator (int separatorCharacter); // Retrieve the auto-completion list separator character. int AutoCompGetSeparator(); // Select the item in the auto-completion list that starts with a string. void AutoCompSelect (const wxString& text); // Should the auto-completion list be cancelled if the user backspaces to a // position before where the box was created. void AutoCompSetCancelAtStart (bool cancel); // Retrieve whether auto-completion cancelled by backspacing before start. bool AutoCompGetCancelAtStart(); // Define a set of characters that when typed will cause the autocompletion to // choose the selected item. void AutoCompSetFillUps (const wxString& characterSet); // Should a single item auto-completion list automatically choose the item. void AutoCompSetChooseSingle (bool chooseSingle); // Retrieve whether a single item auto-completion list automatically choose the item. bool AutoCompGetChooseSingle(); // Set whether case is significant when performing auto-completion searches. void AutoCompSetIgnoreCase (bool ignoreCase); // Retrieve state of ignore case flag. bool AutoCompGetIgnoreCase(); // Display a list of strings and send notification when user chooses one. void UserListShow (int listType, const wxString& itemList); // Set whether or not autocompletion is hidden automatically when nothing matches. void AutoCompSetAutoHide (bool autoHide); // Retrieve whether or not autocompletion is hidden automatically when nothing matches. bool AutoCompGetAutoHide(); // Set whether or not autocompletion deletes any word characters // after the inserted text upon completion. void AutoCompSetDropRestOfWord (bool dropRestOfWord); // Retrieve whether or not autocompletion deletes any word characters // after the inserted text upon completion. bool AutoCompGetDropRestOfWord(); // Register an image for use in autocompletion lists. void RegisterImage (int type, const wxBitmap& bmp); // Clear all the registered images. void ClearRegisteredImages(); // Retrieve the auto-completion list type-separator character. int AutoCompGetTypeSeparator(); // Change the type-separator character in the string setting up an auto-completion list. // Default is '?' but can be changed if items contain '?'. void AutoCompSetTypeSeparator (int separatorCharacter); // Set the maximum width, in characters, of auto-completion and user lists. // Set to 0 to autosize to fit longest item, which is the default. void AutoCompSetMaxWidth (int characterCount); // Get the maximum width, in characters, of auto-completion and user lists. int AutoCompGetMaxWidth(); // Set the maximum height, in rows, of auto-completion and user lists. // The default is 5 rows. void AutoCompSetMaxHeight (int rowCount); // Set the maximum height, in rows, of auto-completion and user lists. int AutoCompGetMaxHeight(); // Set the number of spaces used for one level of indentation. void SetIndent (int indentSize); // Retrieve indentation size. int GetIndent(); // Indentation will only use space characters if useTabs is false, otherwise // it will use a combination of tabs and spaces. void SetUseTabs (bool useTabs); // Retrieve whether tabs will be used in indentation. bool GetUseTabs(); // Change the indentation of a line to a number of columns. void SetLineIndentation (int line, int indentSize); // Retrieve the number of columns that a line is indented. int GetLineIndentation (int line); // Retrieve the position before the first non indentation character on a line. int GetLineIndentPosition (int line); // Retrieve the column number of a position, taking tab width into account. int GetColumn (int pos); // Returns the position of a column (max. end of line position if beyond) // on a line taking the width of tabs into account. int FindColumn (int line, int column); // Can the caret preferred x position only be changed by explicit movement commands? bool GetCaretSticky (); // Stop the caret preferred x position changing when the user types. void SetCaretSticky (bool useCaretStickyBehaviour); // Switch between sticky and non-sticky: meant to be bound to a key. void ToggleCaretSticky (); // Enable/Disable convert-on-paste for line endings. void SetPasteConvertEndings (bool convert); // Get convert-on-paste setting. bool GetPasteConvertEndings (); // Duplicate the selection. If selection empty duplicate the line containing the caret. void SelectionDuplicate (); // Get the background alpha of the caret line. int GetCaretLineBackgroundAlpha (); // Set background alpha of the caret line. void SetCaretLineBackgroundAlpha (int alpha); // Show or hide the horizontal scroll bar. void SetUseHorizontalScrollBar (bool show); // Is the horizontal scroll bar visible? bool GetUseHorizontalScrollBar(); // Show or hide indentation guides. void SetIndentationGuides (bool show); // Are the indentation guides visible? bool GetIndentationGuides(); // Set the highlighted indentation guide column. // 0 = no highlighted guide. void SetHighlightGuide (int column); // Get the highlighted indentation guide column. int GetHighlightGuide(); // Get the position after the last visible characters on a line. int GetLineEndPosition (int line); // Get the code page used to interpret the bytes of the document as characters. int GetCodePage(); // Get the foreground colour of the caret. wxColour GetCaretForeground(); // In read-only mode? bool GetReadOnly(); // Sets the position of the caret. void SetCurrentPos (int pos); // Sets the position that starts the selection - this becomes the anchor. void SetSelectionStart (int pos); // Returns the position at the start of the selection. int GetSelectionStart(); // Sets the position that ends the selection - this becomes the currentPosition. void SetSelectionEnd (int pos); // Returns the position at the end of the selection. int GetSelectionEnd(); // Sets the print magnification added to the point size of each style for printing. void SetPrintMagnification (int magnification); // Returns the print magnification. int GetPrintMagnification(); // Modify colours when printing for clearer printed text. void SetPrintColourMode (int mode); // Returns the print colour mode. int GetPrintColourMode(); // Find some text in the document. int FindText (int minPos, int maxPos, const wxString& text, int flags=0, int* lengthFound = NULL); // On Windows, will draw the document into a display context such as a printer. int FormatRange (bool doDraw, int startPos, int endPos, wxDC* draw, wxDC* target, wxRect renderRect, wxRect pageRect); // Retrieve the display line at the top of the display. int GetFirstVisibleLine(); // Retrieve the contents of a line. wxString GetLine (int line); // Returns the number of lines in the document. There is always at least one. int GetLineCount(); // Sets the size in pixels of the left margin. void SetMarginLeft (int pixels); // Returns the size in pixels of the left margin. int GetMarginLeft(); // Sets the size in pixels of the right margin. void SetMarginRight (int pixels); // Returns the size in pixels of the right margin. int GetMarginRight(); // Is the document different from when it was last saved? bool GetModify(); // Select a range of text. void SetSelection (int startPos, int endPos); // Retrieve the selected text. wxString GetSelectedText(); // Retrieve a range of text. wxString GetTextRange (int startPos, int endPos); // Draw the selection in normal style or with selection highlighted. void HideSelection (bool hide); // Retrieve the line containing a position. int LineFromPosition (int pos); // Retrieve the position at the start of a line. int PositionFromLine (int line); // Scroll horizontally and vertically. void LineScroll (int columns, int lines); // Ensure the caret is visible. void EnsureCaretVisible(); // Replace the selected text with the argument text. void ReplaceSelection (const wxString& text); // Set to read only or read write. void SetReadOnly (bool readOnly); // Will a paste succeed? bool CanPaste(); // Are there any undoable actions in the undo history? bool CanUndo(); // Delete the undo history. void EmptyUndoBuffer(); // Undo one action in the undo history. void Undo(); // Cut the selection to the clipboard. void Cut(); // Copy the selection to the clipboard. void Copy(); // Paste the contents of the clipboard into the document replacing the selection. void Paste(); // Clear the selection. void Clear(); // Replace the contents of the document with the argument text. void SetText (const wxString& text); // Retrieve all the text in the document. wxString GetText(); // Retrieve the number of characters in the document. int GetTextLength(); // Set to overtype (true) or insert mode. void SetOvertype (bool overtype); // Returns true if overtype mode is active otherwise false is returned. bool GetOvertype(); // Set the width of the insert mode caret. void SetCaretWidth (int pixels); // Returns the width of the insert mode caret. int GetCaretWidth(); // Sets the position that starts the target which is used for updating the // document without affecting the scroll position. void SetTargetStart (int pos); // Get the position that starts the target. int GetTargetStart(); // Sets the position that ends the target which is used for updating the // document without affecting the scroll position. void SetTargetEnd (int pos); // Get the position that ends the target. int GetTargetEnd(); // Replace the target text with the argument text. // Text is counted so it can contain NULs. // Returns the length of the replacement text. int ReplaceTarget (const wxString& text); // Replace the target text with the argument text after \d processing. // Text is counted so it can contain NULs. // Looks for \d where d is between 1 and 9 and replaces these with the strings // matched in the last search operation which were surrounded by \( and \). // Returns the length of the replacement text including any change // caused by processing the \d patterns. int ReplaceTargetRE (const wxString& text); // Search for a counted string in the target and set the target to the found // range. Text is counted so it can contain NULs. // Returns length of range or -1 for failure in which case target is not moved. int SearchInTarget (const wxString& text); // Set the search flags used by SearchInTarget. void SetSearchFlags (int flags); // Get the search flags used by SearchInTarget. int GetSearchFlags(); // Show a call tip containing a definition near position pos. void CallTipShow (int pos, const wxString& definition); // Remove the call tip from the screen. void CallTipCancel(); // Is there an active call tip? bool CallTipActive(); // Retrieve the position where the caret was before displaying the call tip. int CallTipPosAtStart(); // Highlight a segment of the definition. void CallTipSetHighlight (int startPos, int endPos); // Set the background colour for the call tip. void CallTipSetBackground (const wxColour& back); // Set the foreground colour for the call tip. void CallTipSetForeground (const wxColour& fore); // Set the foreground colour for the highlighted part of the call tip. void CallTipSetForegroundHighlight (const wxColour& fore); // Enable use of STYLE_CALLTIP and set call tip tab size in pixels. void CallTipUseStyle (int tabSize); // Find the display line of a document line taking hidden lines into account. int VisibleFromDocLine (int line); // Find the document line of a display line taking hidden lines into account. int DocLineFromVisible (int lineDisplay); // The number of display lines needed to wrap a document line int WrapCount (int line); // Set the fold level of a line. // This encodes an integer level along with flags indicating whether the // line is a header and whether it is effectively white space. void SetFoldLevel (int line, int level); // Retrieve the fold level of a line. int GetFoldLevel (int line); // Find the last child line of a header line. int GetLastChild (int line, int level); // Find the parent line of a child line. int GetFoldParent (int line); // Make a range of lines visible. void ShowLines (int lineStart, int lineEnd); // Make a range of lines invisible. void HideLines (int lineStart, int lineEnd); // Is a line visible? bool GetLineVisible (int line); // Show the children of a header line. void SetFoldExpanded (int line, bool expanded); // Is a header line expanded? bool GetFoldExpanded (int line); // Switch a header line between expanded and contracted. void ToggleFold (int line); // Ensure a particular line is visible by expanding any header line hiding it. void EnsureVisible (int line); // Set some style options for folding. void SetFoldFlags (int flags); // Ensure a particular line is visible by expanding any header line hiding it. // Use the currently set visibility policy to determine which range to display. void EnsureVisibleEnforcePolicy (int line); // Sets whether a tab pressed when caret is within indentation indents. void SetTabIndents (bool tabIndents); // Does a tab pressed when caret is within indentation indent? bool GetTabIndents(); // Sets whether a backspace pressed when caret is within indentation unindents. void SetBackSpaceUnIndents (bool bsUnIndents); // Does a backspace pressed when caret is within indentation unindent? bool GetBackSpaceUnIndents(); // Sets the time the mouse must sit still to generate a mouse dwell event. void SetMouseDwellTime (int periodMilliseconds); // Retrieve the time the mouse must sit still to generate a mouse dwell event. int GetMouseDwellTime(); // Get position of start of word. int WordStartPosition (int pos, bool onlyWordCharacters); // Get position of end of word. int WordEndPosition (int pos, bool onlyWordCharacters); // Sets whether text is word wrapped. void SetWrapMode (int mode); // Retrieve whether text is word wrapped. int GetWrapMode(); // Set the display mode of visual flags for wrapped lines. void SetWrapVisualFlags (int wrapVisualFlags); // Retrive the display mode of visual flags for wrapped lines. int GetWrapVisualFlags(); // Set the location of visual flags for wrapped lines. void SetWrapVisualFlagsLocation (int wrapVisualFlagsLocation); // Retrive the location of visual flags for wrapped lines. int GetWrapVisualFlagsLocation(); // Set the start indent for wrapped lines. void SetWrapStartIndent (int indent); // Retrive the start indent for wrapped lines. int GetWrapStartIndent(); // Sets the degree of caching of layout information. void SetLayoutCache (int mode); // Retrieve the degree of caching of layout information. int GetLayoutCache(); // Sets the document width assumed for scrolling. void SetScrollWidth (int pixels); // Retrieve the document width assumed for scrolling. int GetScrollWidth(); // Measure the pixel width of some text in a particular style. // NUL terminated text argument. // Does not handle tab or control characters. int TextWidth (int style, const wxString& text); // Sets the scroll range so that maximum scroll position has // the last line at the bottom of the view (default). // Setting this to false allows scrolling one page below the last line. void SetEndAtLastLine (bool endAtLastLine); // Retrieve whether the maximum scroll position has the last // line at the bottom of the view. bool GetEndAtLastLine(); // Retrieve the height of a particular line of text in pixels. int TextHeight (int line); // Show or hide the vertical scroll bar. void SetUseVerticalScrollBar (bool show); // Is the vertical scroll bar visible? bool GetUseVerticalScrollBar(); // Append a string to the end of the document without changing the selection. void AppendText (const wxString& text); void AppendText (int length, const wxString& text); // Is drawing done in two phases with backgrounds drawn before foregrounds? bool GetTwoPhaseDraw(); // In twoPhaseDraw mode, drawing is performed in two phases, first the background // and then the foreground. This avoids chopping off characters that overlap the next run. void SetTwoPhaseDraw (bool twoPhase); // Make the target range start and end be the same as the selection range start and end. void TargetFromSelection(); // Join the lines in the target. void LinesJoin(); // Split the lines in the target into lines that are less wide than pixelWidth // where possible. void LinesSplit (int pixels); // Set the colours used as a chequerboard pattern in the fold margin void SetFoldMarginColour (bool useSetting, const wxColour& back); void SetFoldMarginHiColour (bool useSetting, const wxColour& fore); // Move caret down one line. void LineDown(); // Move caret down one line extending selection to new caret position. void LineDownExtend(); // Move caret up one line. void LineUp(); // Move caret up one line extending selection to new caret position. void LineUpExtend(); // Move caret left one character. void CharLeft(); // Move caret left one character extending selection to new caret position. void CharLeftExtend(); // Move caret right one character. void CharRight(); // Move caret right one character extending selection to new caret position. void CharRightExtend(); // Move caret left one word. void WordLeft(); // Move caret left one word extending selection to new caret position. void WordLeftExtend(); // Move caret right one word. void WordRight(); // Move caret right one word extending selection to new caret position. void WordRightExtend(); // Move caret to first position on line. void Home(); // Move caret to first position on line extending selection to new caret position. void HomeExtend(); // Move caret to last position on line. void LineEnd(); // Move caret to last position on line extending selection to new caret position. void LineEndExtend(); // Move caret to first position in document. void DocumentStart(); // Move caret to first position in document extending selection to new caret position. void DocumentStartExtend(); // Move caret to last position in document. void DocumentEnd(); // Move caret to last position in document extending selection to new caret position. void DocumentEndExtend(); // Move caret one page up. void PageUp(); // Move caret one page up extending selection to new caret position. void PageUpExtend(); // Move caret one page down. void PageDown(); // Move caret one page down extending selection to new caret position. void PageDownExtend(); // Switch from insert to overtype mode or the reverse. void EditToggleOvertype(); // Cancel any modes such as call tip or auto-completion list display. void Cancel(); // Delete the selection or if no selection, the character before the caret. void DeleteBack(); // If selection is empty or all on one line replace the selection with a tab character. // If more than one line selected, indent the lines. void Tab(); // Dedent the selected lines. void BackTab(); // Insert a new line, may use a CRLF, CR or LF depending on EOL mode. void NewLine(); // Insert a Form Feed character. void FormFeed(); // Move caret to before first visible character on line. // If already there move to first character on line. void VCHome(); // Like VCHome but extending selection to new caret position. void VCHomeExtend(); // Magnify the displayed text by increasing the sizes by 1 point. void ZoomIn(); // Make the displayed text smaller by decreasing the sizes by 1 point. void ZoomOut(); // Delete the word to the left of the caret. void DelWordLeft(); // Delete the word to the right of the caret. void DelWordRight(); // Cut the line containing the caret. void LineCut(); // Delete the line containing the caret. void LineDelete(); // Switch the current line with the previous. void LineTranspose(); // Duplicate the current line. void LineDuplicate(); // Transform the selection to lower case. void LowerCase(); // Transform the selection to upper case. void UpperCase(); // Scroll the document down, keeping the caret visible. void LineScrollDown(); // Scroll the document up, keeping the caret visible. void LineScrollUp(); // Delete the selection or if no selection, the character before the caret. // Will not delete the character before at the start of a line. void DeleteBackNotLine(); // Move caret to first position on display line. void HomeDisplay(); // Move caret to first position on display line extending selection to // new caret position. void HomeDisplayExtend(); // Move caret to last position on display line. void LineEndDisplay(); // Move caret to last position on display line extending selection to new // caret position. void LineEndDisplayExtend(); // These are like their namesakes Home(Extend)?, LineEnd(Extend)?, VCHome(Extend)? // except they behave differently when word-wrap is enabled: // They go first to the start / end of the display line, like (Home|LineEnd)Display // The difference is that, the cursor is already at the point, it goes on to the start // or end of the document line, as appropriate for (Home|LineEnd|VCHome)(Extend)?. void HomeWrap(); void HomeWrapExtend(); void LineEndWrap(); void LineEndWrapExtend(); void VCHomeWrap(); void VCHomeWrapExtend(); // Copy the line containing the caret. void LineCopy(); // Move the caret inside current view if it's not there already. void MoveCaretInsideView(); // How many characters are on a line, not including end of line characters? int LineLength (int line); // Highlight the characters at two positions. void BraceHighlight (int pos1, int pos2); // Highlight the character at a position indicating there is no matching brace. void BraceBadLight (int pos); // Find the position of a matching brace or INVALID_POSITION if no match. int BraceMatch (int pos); // Are the end of line characters visible? bool GetViewEOL(); // Make the end of line characters visible or invisible. void SetViewEOL (bool visible); // Retrieve a pointer to the document object. void* GetDocPointer(); // Change the document object used. void SetDocPointer (void* docPointer); // Set which document modification events are sent to the container. void SetModEventMask (int mask); // Retrieve the column number which text should be kept within. int GetEdgeColumn(); // Set the column number of the edge. // If text goes past the edge then it is highlighted. void SetEdgeColumn (int column); // Retrieve the edge highlight mode. int GetEdgeMode(); // The edge may be displayed by a line (EDGE_LINE) or by highlighting text that // goes beyond it (EDGE_BACKGROUND) or not displayed at all (EDGE_NONE). void SetEdgeMode (int mode); // Retrieve the colour used in edge indication. wxColour GetEdgeColour(); // Change the colour used in edge indication. void SetEdgeColour (const wxColour& colour); // Sets the current caret position to be the search anchor. void SearchAnchor(); // Find some text starting at the search anchor. // Does not ensure the selection is visible. int SearchNext (int flags, const wxString& text); // Find some text starting at the search anchor and moving backwards. // Does not ensure the selection is visible. int SearchPrev (int flags, const wxString& text); // Retrieves the number of lines completely visible. int LinesOnScreen(); // Set whether a pop up menu is displayed automatically when the user presses // the wrong mouse button. void UsePopUp (bool allowPopUp); // Is the selection rectangular? The alternative is the more common stream selection. bool SelectionIsRectangle(); // Set the zoom level. This number of points is added to the size of all fonts. // It may be positive to magnify or negative to reduce. void SetZoom (int zoom); // Retrieve the zoom level. int GetZoom(); // Create a new document object. // Starts with reference count of 1 and not selected into editor. void* CreateDocument(); // Extend life of document. void AddRefDocument (void* docPointer); // Release a reference to the document, deleting document if it fades to black. void ReleaseDocument (void* docPointer); // Get which document modification events are sent to the container. int GetModEventMask(); // Change internal focus flag. void SetSCIFocus (bool focus); // Get internal focus flag. bool GetSCIFocus(); // Change error status - 0 = OK. void SetStatus (int status); // Get error status. int GetStatus(); // Set whether the mouse is captured when its button is pressed. void SetMouseDownCaptures (bool captures); // Get whether mouse gets captured. bool GetMouseDownCaptures(); // Sets the cursor to one of the SC_CURSOR* values. void SetCursorType (int cursorType); // Get cursor type. int GetCursorType(); // Change the way control characters are displayed: // If symbol is < 32, keep the drawn way, else, use the given character. void SetControlCharSymbol (int symbol); // Get the way control characters are displayed. int GetControlCharSymbol(); // Move to the previous change in capitalisation. void WordPartLeft(); // Move to the previous change in capitalisation extending selection // to new caret position. void WordPartLeftExtend(); // Move to the change next in capitalisation. void WordPartRight(); // Move to the next change in capitalisation extending selection // to new caret position. void WordPartRightExtend(); // Set the way the display area is determined when a particular line // is to be moved to by Find, FindNext, GotoLine, etc. void SetVisiblePolicy (int visiblePolicy, int visibleSlop); // Delete back from the current position to the start of the line. void DelLineLeft(); // Delete forwards from the current position to the end of the line. void DelLineRight(); // Get and Set the xOffset (ie, horizonal scroll position). void SetXOffset (int newOffset); int GetXOffset(); // Set the last x chosen value to be the caret x position. void ChooseCaretX(); // Set the way the caret is kept visible when going sideway. // The exclusion zone is given in pixels. void SetXCaretPolicy (int caretPolicy, int caretSlop); // Set the way the line the caret is on is kept visible. // The exclusion zone is given in lines. void SetYCaretPolicy (int caretPolicy, int caretSlop); // Set printing to line wrapped (SC_WRAP_WORD) or not line wrapped (SC_WRAP_NONE). void SetPrintWrapMode (int mode); // Is printing line wrapped? int GetPrintWrapMode(); // Set a fore colour for active hotspots. void SetHotspotActiveForeground (bool useSetting, const wxColour& fore); // Set a back colour for active hotspots. void SetHotspotActiveBackground (bool useSetting, const wxColour& back); // Enable / Disable underlining active hotspots. void SetHotspotActiveUnderline (bool underline); // Limit hotspots to single line so hotspots on two lines don't merge. void SetHotspotSingleLine (bool singleLine); // Move caret between paragraphs (delimited by empty lines). void ParaDown(); void ParaDownExtend(); void ParaUp(); void ParaUpExtend(); // Given a valid document position, return the previous position taking code // page into account. Returns 0 if passed 0. int PositionBefore (int pos); // Given a valid document position, return the next position taking code // page into account. Maximum value returned is the last position in the document. int PositionAfter (int pos); // Copy a range of text to the clipboard. Positions are clipped into the document. void CopyRange (int startPos, int endPos); // Copy argument text to the clipboard. void CopyText (int length, const wxString& text); // Set the selection mode to stream (SC_SEL_STREAM=1) or rectangular (SC_SEL_RECTANGLE=2) or // by lines (SC_SEL_LINES=3). void SetSelectionMode (int mode); // Get the mode of the current selection. int GetSelectionMode(); // Retrieve the position of the start of the selection at the given line (INVALID_POSITION if no selection on this line). int GetLineSelStartPosition (int line); // Retrieve the position of the end of the selection at the given line (INVALID_POSITION if no selection on this line). int GetLineSelEndPosition (int line); // Move caret down one line, extending rectangular selection to new caret position. void LineDownRectExtend(); // Move caret up one line, extending rectangular selection to new caret position. void LineUpRectExtend(); // Move caret left one character, extending rectangular selection to new caret position. void CharLeftRectExtend(); // Move caret right one character, extending rectangular selection to new caret position. void CharRightRectExtend(); // Move caret to first position on line, extending rectangular selection to new caret position. void HomeRectExtend(); // Move caret to before first visible character on line. // If already there move to first character on line. // In either case, extend rectangular selection to new caret position. void VCHomeRectExtend(); // Move caret to last position on line, extending rectangular selection to new caret position. void LineEndRectExtend(); // Move caret one page up, extending rectangular selection to new caret position. void PageUpRectExtend(); // Move caret one page down, extending rectangular selection to new caret position. void PageDownRectExtend(); // Move caret to top of page, or one page up if already at top of page. void StutteredPageUp(); // Move caret to top of page, or one page up if already at top of page, extending selection to new caret position. void StutteredPageUpExtend(); // Move caret to bottom of page, or one page down if already at bottom of page. void StutteredPageDown(); // Move caret to bottom of page, or one page down if already at bottom of page, extending selection to new caret position. void StutteredPageDownExtend(); // Move caret left one word, position cursor at end of word. void WordLeftEnd(); // Move caret left one word, position cursor at end of word, extending selection to new caret position. void WordLeftEndExtend(); // Move caret right one word, position cursor at end of word. void WordRightEnd(); // Move caret right one word, position cursor at end of word, extending selection to new caret position. void WordRightEndExtend(); // Set the set of characters making up whitespace for when moving or selecting by word. // Should be called after SetWordChars. void SetWhitespaceChars (const wxString& characters); // Reset the set of characters for whitespace and word characters to the defaults. void SetCharsDefault(); // Get currently selected item position in the auto-completion list int AutoCompGetCurrent(); // Enlarge the document to a particular size of text bytes. void Allocate (int bytes); // Start notifying the container of all key presses and commands. void StartRecord(); // Stop notifying the container of all key presses and commands. void StopRecord(); // Set the lexing language of the document. void SetLexer (int lexer); // Retrieve the lexing language of the document. int GetLexer(); // Colourise a segment of the document using the current lexing language. void Colourise (int startPos, int endPos); // Set up a value that may be used by a lexer for some optional feature. void SetProperty (const wxString& key, const wxString& value); // Retrieve a value that may be used by a lexer for some optional feature. wxString GetProperty (const wxString& key); wxString GetPropertyExpanded (const wxString& key); int GetPropertyInt (const wxString& key); // Retrieve the number of bits the current lexer needs for styling. int GetStyleBitsNeeded (); // Set up the key words used by the lexer. void SetKeyWords (int keywordSet, const wxString& keyWords); // Set the lexing language of the document based on string name. void SetLexerLanguage (const wxString& language); // END of generated section //---------------------------------------------------------------------- // Others... // Returns the line number of the line with the caret. int GetCurrentLine(); // Extract style settings from a spec-string which is composed of one or // more of the following comma separated elements: // // bold turns on bold // italic turns on italics // fore:[name or #RRGGBB] sets the foreground colour // back:[name or #RRGGBB] sets the background colour // face:[facename] sets the font face name to use // size:[num] sets the font size in points // eol turns on eol filling // underline turns on underlining // void StyleSetSpec (int styleNum, const wxString& spec); // Set style size, face, bold, italic, and underline attributes from // a wxFont's attributes. void StyleSetFont (int styleNum, const wxFont& font); // Set all font style attributes at once. void StyleSetFontAttr (int styleNum, int size,const wxString& faceName, bool bold, bool italic, bool underline, wxFontEncoding encoding = wxFONTENCODING_DEFAULT); // Set the character set of the font in a style. void StyleSetCharacterSet (int style, int characterSet); // Set the font encoding to be used by a style. void StyleSetFontEncoding (int style, wxFontEncoding encoding); // Perform one of the operations defined by the wxSCI_CMD_* constants. void CmdKeyExecute (int cmd); // Set the left and right margin in the edit area, measured in pixels. void SetMargins (int left, int right); // Retrieve the start and end positions of the current selection. #ifdef SWIG void GetSelection (int* OUTPUT, int* OUTPUT); #else void GetSelection (int* startPos, int* endPos); #endif // Retrieve the point in the window where a position is displayed. wxPoint PointFromPosition (int pos); // Scroll enough to make the given line visible void ScrollToLine (int line); // Scroll enough to make the given column visible void ScrollToColumn (int column); // Send a message to Scintilla long SendMsg (int msg, long wp=0, long lp=0); // Set the vertical scrollbar to use instead of the ont that's built-in. void SetVScrollBar (wxScrollBar* bar); // Set the horizontal scrollbar to use instead of the ont that's built-in. void SetHScrollBar (wxScrollBar* bar); // Can be used to prevent the EVT_CHAR handler from adding the char bool GetLastKeydownProcessed() { return m_lastKeyDownConsumed; } void SetLastKeydownProcessed (bool val) { m_lastKeyDownConsumed = val; } // Write the contents of the editor to filename bool SaveFile (const wxString& filename); // Load the contents of filename into the editor bool LoadFile (const wxString& filename); #ifdef SCI_USE_DND // Allow for simulating a DnD DragOver wxDragResult DoDragOver (wxCoord x, wxCoord y, wxDragResult def); // Allow for simulating a DnD DropText bool DoDropText (long x, long y, const wxString& data); // Allow for simulating a DnD DragEnter wxDragResult DoDragEnter (wxCoord x, wxCoord y, wxDragResult def); // Allow for simulating a DnD DragEnter void DoDragLeave (); #endif // Specify whether anti-aliased fonts should be used. Will have no effect // on some platforms, but on some (wxMac for example) can greatly improve // performance. void SetUseAntiAliasing (bool useAA); // Returns the current UseAntiAliasing setting. bool GetUseAntiAliasing(); #if wxCHECK_VERSION(2, 5, 0) // The following methods are nearly equivallent to their similarly named // cousins above. The difference is that these methods bypass wxString // and always use a char* even if used in a unicode build of wxWidgets. // In that case the character data will be utf-8 encoded since that is // what is used internally by Scintilla in unicode builds. // Add text to the document at current position. void AddTextRaw (const char* text); // Insert string at a position. void InsertTextRaw (int pos, const char* text); // Retrieve the text of the line containing the caret. // Returns the index of the caret on the line. #ifdef SWIG wxCharBuffer GetCurLineRaw (int* OUTPUT); #else wxCharBuffer GetCurLineRaw (int* linePos = NULL); #endif // Retrieve the contents of a line. wxCharBuffer GetLineRaw (int line); // Retrieve the selected text. wxCharBuffer GetSelectedTextRaw(); // Retrieve a range of text. wxCharBuffer GetTextRangeRaw (int startPos, int endPos); // Replace the contents of the document with the argument text. void SetTextRaw (const char* text); // Retrieve all the text in the document. wxCharBuffer GetTextRaw(); // Append a string to the end of the document without changing the selection. void AppendTextRaw (const char* text); #ifdef SWIG %pythoncode "_stc_utf8_methods.py" #endif #endif //---------------------------------------------------------------------- #ifndef SWIG protected: // Event handlers void OnPaint (wxPaintEvent& evt); void OnScrollWin (wxScrollWinEvent& evt); void OnScroll (wxScrollEvent& evt); void OnSize (wxSizeEvent& evt); void OnMouseLeftDown (wxMouseEvent& evt); void OnMouseMove (wxMouseEvent& evt); void OnMouseLeftUp (wxMouseEvent& evt); void OnMouseRightUp (wxMouseEvent& evt); void OnMouseMiddleUp (wxMouseEvent& evt); void OnContextMenu (wxContextMenuEvent& evt); void OnMouseWheel (wxMouseEvent& evt); void OnChar (wxKeyEvent& evt); void OnKeyDown (wxKeyEvent& evt); void OnLoseFocus (wxFocusEvent& evt); void OnGainFocus (wxFocusEvent& evt); void OnSysColourChanged (wxSysColourChangedEvent& evt); void OnEraseBackground (wxEraseEvent& evt); void OnMenu (wxCommandEvent& evt); void OnListBox (wxCommandEvent& evt); void OnIdle (wxIdleEvent& evt); virtual wxSize DoGetBestSize() const; // Turn notifications from Scintilla into events void NotifyChange(); void NotifyParent (SCI_SCOPE(SCNotification*) scn); // [CHAGED] ScintillaWX* m_swx; wxStopWatch m_stopWatch; wxScrollBar* m_vScrollBar; wxScrollBar* m_hScrollBar; bool m_lastKeyDownConsumed; friend class ScintillaWX; friend class Platform; private: DECLARE_EVENT_TABLE() DECLARE_DYNAMIC_CLASS(wxScintilla) #endif }; //---------------------------------------------------------------------- class WXDLLIMPEXP_SCI wxScintillaEvent : public wxCommandEvent { public: wxScintillaEvent (wxEventType commandType=0, int id=0); #ifndef SWIG wxScintillaEvent (const wxScintillaEvent& event); #endif ~wxScintillaEvent() {} void SetPosition (int pos) { m_position = pos; } void SetKey (int k) { m_key = k; } void SetModifiers (int m) { m_modifiers = m; } void SetModificationType (int t) { m_modificationType = t; } void SetText (const wxString& t) { m_text = t; } void SetLength (int len) { m_length = len; } void SetLinesAdded (int num) { m_linesAdded = num; } void SetLine (int val) { m_line = val; } void SetFoldLevelNow (int val) { m_foldLevelNow = val; } void SetFoldLevelPrev (int val) { m_foldLevelPrev = val; } void SetMargin (int val) { m_margin = val; } void SetMessage (int val) { m_message = val; } void SetWParam (int val) { m_wParam = val; } void SetLParam (int val) { m_lParam = val; } void SetListType (int val) { m_listType = val; } void SetX (int val) { m_x = val; } void SetY (int val) { m_y = val; } void SetDragText (const wxString& val) { m_dragText = val; } void SetDragAllowMove (bool val) { m_dragAllowMove = val; } #ifdef SCI_USE_DND void SetDragResult (wxDragResult val) { m_dragResult = val; } #endif int GetPosition() const { return m_position; } int GetKey() const { return m_key; } int GetModifiers() const { return m_modifiers; } int GetModificationType() const { return m_modificationType; } wxString GetText() const { return m_text; } int GetLength() const { return m_length; } int GetLinesAdded() const { return m_linesAdded; } int GetLine() const { return m_line; } int GetFoldLevelNow() const { return m_foldLevelNow; } int GetFoldLevelPrev() const { return m_foldLevelPrev; } int GetMargin() const { return m_margin; } int GetMessage() const { return m_message; } int GetWParam() const { return m_wParam; } int GetLParam() const { return m_lParam; } int GetListType() const { return m_listType; } int GetX() const { return m_x; } int GetY() const { return m_y; } wxString GetDragText() { return m_dragText; } bool GetDragAllowMove() { return m_dragAllowMove; } #ifdef SCI_USE_DND wxDragResult GetDragResult() { return m_dragResult; } #endif bool GetShift() const; bool GetControl() const; bool GetAlt() const; virtual wxEvent* Clone() const { return new wxScintillaEvent (*this); } #ifndef SWIG private: DECLARE_DYNAMIC_CLASS(wxScintillaEvent) int m_position; int m_key; int m_modifiers; int m_modificationType; // wxEVT_SCI_MODIFIED wxString m_text; int m_length; int m_linesAdded; int m_line; int m_foldLevelNow; int m_foldLevelPrev; int m_margin; // wxEVT_SCI_MARGINCLICK int m_message; // wxEVT_SCI_MACRORECORD int m_wParam; int m_lParam; int m_listType; int m_x; int m_y; wxString m_dragText; // wxEVT_SCI_START_DRAG, wxEVT_SCI_DO_DROP bool m_dragAllowMove; // wxEVT_SCI_START_DRAG #if wxUSE_DRAG_AND_DROP wxDragResult m_dragResult; // wxEVT_SCI_DRAG_OVER,wxEVT_SCI_DO_DROP #endif #endif }; #ifndef SWIG BEGIN_DECLARE_EVENT_TYPES() #if !wxCHECK_VERSION(2, 5, 0) DECLARE_EXPORTED_LOCAL_EVENT_TYPE (WXDLLIMPEXP_SCI, wxEVT_SCI_CHANGE, 1650) DECLARE_EXPORTED_LOCAL_EVENT_TYPE (WXDLLIMPEXP_SCI, wxEVT_SCI_STYLENEEDED, 1651) DECLARE_EXPORTED_LOCAL_EVENT_TYPE (WXDLLIMPEXP_SCI, wxEVT_SCI_CHARADDED, 1652) DECLARE_EXPORTED_LOCAL_EVENT_TYPE (WXDLLIMPEXP_SCI, wxEVT_SCI_SAVEPOINTREACHED, 1653) DECLARE_EXPORTED_LOCAL_EVENT_TYPE (WXDLLIMPEXP_SCI, wxEVT_SCI_SAVEPOINTLEFT, 1654) DECLARE_EXPORTED_LOCAL_EVENT_TYPE (WXDLLIMPEXP_SCI, wxEVT_SCI_ROMODIFYATTEMPT, 1655) DECLARE_EXPORTED_LOCAL_EVENT_TYPE (WXDLLIMPEXP_SCI, wxEVT_SCI_KEY, 1656) DECLARE_EXPORTED_LOCAL_EVENT_TYPE (WXDLLIMPEXP_SCI, wxEVT_SCI_DOUBLECLICK, 1657) DECLARE_EXPORTED_LOCAL_EVENT_TYPE (WXDLLIMPEXP_SCI, wxEVT_SCI_UPDATEUI, 1658) DECLARE_EXPORTED_LOCAL_EVENT_TYPE (WXDLLIMPEXP_SCI, wxEVT_SCI_MODIFIED, 1659) DECLARE_EXPORTED_LOCAL_EVENT_TYPE (WXDLLIMPEXP_SCI, wxEVT_SCI_MACRORECORD, 1660) DECLARE_EXPORTED_LOCAL_EVENT_TYPE (WXDLLIMPEXP_SCI, wxEVT_SCI_MARGINCLICK, 1661) DECLARE_EXPORTED_LOCAL_EVENT_TYPE (WXDLLIMPEXP_SCI, wxEVT_SCI_NEEDSHOWN, 1662) DECLARE_EXPORTED_LOCAL_EVENT_TYPE (WXDLLIMPEXP_SCI, wxEVT_SCI_POSCHANGED, 1663) DECLARE_EXPORTED_LOCAL_EVENT_TYPE (WXDLLIMPEXP_SCI, wxEVT_SCI_PAINTED, 1664) DECLARE_EXPORTED_LOCAL_EVENT_TYPE (WXDLLIMPEXP_SCI, wxEVT_SCI_USERLISTSELECTION, 1665) DECLARE_EXPORTED_LOCAL_EVENT_TYPE (WXDLLIMPEXP_SCI, wxEVT_SCI_URIDROPPED, 1666) DECLARE_EXPORTED_LOCAL_EVENT_TYPE (WXDLLIMPEXP_SCI, wxEVT_SCI_DWELLSTART, 1667) DECLARE_EXPORTED_LOCAL_EVENT_TYPE (WXDLLIMPEXP_SCI, wxEVT_SCI_DWELLEND, 1668) DECLARE_EXPORTED_LOCAL_EVENT_TYPE (WXDLLIMPEXP_SCI, wxEVT_SCI_START_DRAG, 1669) DECLARE_EXPORTED_LOCAL_EVENT_TYPE (WXDLLIMPEXP_SCI, wxEVT_SCI_DRAG_OVER, 1670) DECLARE_EXPORTED_LOCAL_EVENT_TYPE (WXDLLIMPEXP_SCI, wxEVT_SCI_DO_DROP, 1671) DECLARE_EXPORTED_LOCAL_EVENT_TYPE (WXDLLIMPEXP_SCI, wxEVT_SCI_ZOOM, 1672) DECLARE_EXPORTED_LOCAL_EVENT_TYPE (WXDLLIMPEXP_SCI, wxEVT_SCI_HOTSPOT_CLICK, 1673) DECLARE_EXPORTED_LOCAL_EVENT_TYPE (WXDLLIMPEXP_SCI, wxEVT_SCI_HOTSPOT_DCLICK, 1674) DECLARE_EXPORTED_LOCAL_EVENT_TYPE (WXDLLIMPEXP_SCI, wxEVT_SCI_CALLTIP_CLICK, 1675) DECLARE_EXPORTED_LOCAL_EVENT_TYPE (WXDLLIMPEXP_SCI, wxEVT_SCI_AUTOCOMP_SELECTION, 1676) #else DECLARE_EXPORTED_EVENT_TYPE (WXDLLIMPEXP_SCI, wxEVT_SCI_CHANGE, 1650) DECLARE_EXPORTED_EVENT_TYPE (WXDLLIMPEXP_SCI, wxEVT_SCI_STYLENEEDED, 1651) DECLARE_EXPORTED_EVENT_TYPE (WXDLLIMPEXP_SCI, wxEVT_SCI_CHARADDED, 1652) DECLARE_EXPORTED_EVENT_TYPE (WXDLLIMPEXP_SCI, wxEVT_SCI_SAVEPOINTREACHED, 1653) DECLARE_EXPORTED_EVENT_TYPE (WXDLLIMPEXP_SCI, wxEVT_SCI_SAVEPOINTLEFT, 1654) DECLARE_EXPORTED_EVENT_TYPE (WXDLLIMPEXP_SCI, wxEVT_SCI_ROMODIFYATTEMPT, 1655) DECLARE_EXPORTED_EVENT_TYPE (WXDLLIMPEXP_SCI, wxEVT_SCI_KEY, 1656) DECLARE_EXPORTED_EVENT_TYPE (WXDLLIMPEXP_SCI, wxEVT_SCI_DOUBLECLICK, 1657) DECLARE_EXPORTED_EVENT_TYPE (WXDLLIMPEXP_SCI, wxEVT_SCI_UPDATEUI, 1658) DECLARE_EXPORTED_EVENT_TYPE (WXDLLIMPEXP_SCI, wxEVT_SCI_MODIFIED, 1659) DECLARE_EXPORTED_EVENT_TYPE (WXDLLIMPEXP_SCI, wxEVT_SCI_MACRORECORD, 1660) DECLARE_EXPORTED_EVENT_TYPE (WXDLLIMPEXP_SCI, wxEVT_SCI_MARGINCLICK, 1661) DECLARE_EXPORTED_EVENT_TYPE (WXDLLIMPEXP_SCI, wxEVT_SCI_NEEDSHOWN, 1662) DECLARE_EXPORTED_EVENT_TYPE (WXDLLIMPEXP_SCI, wxEVT_SCI_PAINTED, 1664) DECLARE_EXPORTED_EVENT_TYPE (WXDLLIMPEXP_SCI, wxEVT_SCI_USERLISTSELECTION, 1665) DECLARE_EXPORTED_EVENT_TYPE (WXDLLIMPEXP_SCI, wxEVT_SCI_URIDROPPED, 1666) DECLARE_EXPORTED_EVENT_TYPE (WXDLLIMPEXP_SCI, wxEVT_SCI_DWELLSTART, 1667) DECLARE_EXPORTED_EVENT_TYPE (WXDLLIMPEXP_SCI, wxEVT_SCI_DWELLEND, 1668) DECLARE_EXPORTED_EVENT_TYPE (WXDLLIMPEXP_SCI, wxEVT_SCI_START_DRAG, 1669) DECLARE_EXPORTED_EVENT_TYPE (WXDLLIMPEXP_SCI, wxEVT_SCI_DRAG_OVER, 1670) DECLARE_EXPORTED_EVENT_TYPE (WXDLLIMPEXP_SCI, wxEVT_SCI_DO_DROP, 1671) DECLARE_EXPORTED_EVENT_TYPE (WXDLLIMPEXP_SCI, wxEVT_SCI_ZOOM, 1672) DECLARE_EXPORTED_EVENT_TYPE (WXDLLIMPEXP_SCI, wxEVT_SCI_HOTSPOT_CLICK, 1673) DECLARE_EXPORTED_EVENT_TYPE (WXDLLIMPEXP_SCI, wxEVT_SCI_HOTSPOT_DCLICK, 1674) DECLARE_EXPORTED_EVENT_TYPE (WXDLLIMPEXP_SCI, wxEVT_SCI_CALLTIP_CLICK, 1675) DECLARE_EXPORTED_EVENT_TYPE (WXDLLIMPEXP_SCI, wxEVT_SCI_AUTOCOMP_SELECTION, 1676) #endif END_DECLARE_EVENT_TYPES() #else enum { wxEVT_SCI_CHANGE, wxEVT_SCI_STYLENEEDED, wxEVT_SCI_CHARADDED, wxEVT_SCI_SAVEPOINTREACHED, wxEVT_SCI_SAVEPOINTLEFT, wxEVT_SCI_ROMODIFYATTEMPT, wxEVT_SCI_KEY, wxEVT_SCI_DOUBLECLICK, wxEVT_SCI_UPDATEUI, wxEVT_SCI_MODIFIED, wxEVT_SCI_MACRORECORD, wxEVT_SCI_MARGINCLICK, wxEVT_SCI_NEEDSHOWN, wxEVT_SCI_PAINTED, wxEVT_SCI_USERLISTSELECTION, wxEVT_SCI_URIDROPPED, wxEVT_SCI_DWELLSTART, wxEVT_SCI_DWELLEND, wxEVT_SCI_START_DRAG, wxEVT_SCI_DRAG_OVER, wxEVT_SCI_DO_DROP, wxEVT_SCI_ZOOM, wxEVT_SCI_HOTSPOT_CLICK, wxEVT_SCI_HOTSPOT_DCLICK, wxEVT_SCI_CALLTIP_CLICK, wxEVT_SCI_AUTOCOMP_SELECTION }; #endif #ifndef SWIG typedef void (wxEvtHandler::*wxScintillaEventFunction)(wxScintillaEvent&); #if !wxCHECK_VERSION(2, 5, 0) // fix wxScintilla missing handler #ifndef wxScintillaEventHandler #define wxScintillaEventHandler(func) (wxObjectEventFunction)(wxEventFunction) (wxScintillaEventFunction) &func #endif #define EVT_SCI_CHANGE(id, fn) DECLARE_EVENT_TABLE_ENTRY (wxEVT_SCI_CHANGE, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxScintillaEventFunction) & fn, (wxObject *) NULL), #define EVT_SCI_STYLENEEDED(id, fn) DECLARE_EVENT_TABLE_ENTRY (wxEVT_SCI_STYLENEEDED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxScintillaEventFunction) & fn, (wxObject *) NULL), #define EVT_SCI_CHARADDED(id, fn) DECLARE_EVENT_TABLE_ENTRY (wxEVT_SCI_CHARADDED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxScintillaEventFunction) & fn, (wxObject *) NULL), #define EVT_SCI_SAVEPOINTREACHED(id, fn) DECLARE_EVENT_TABLE_ENTRY (wxEVT_SCI_SAVEPOINTREACHED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxScintillaEventFunction) & fn, (wxObject *) NULL), #define EVT_SCI_SAVEPOINTLEFT(id, fn) DECLARE_EVENT_TABLE_ENTRY (wxEVT_SCI_SAVEPOINTLEFT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxScintillaEventFunction) & fn, (wxObject *) NULL), #define EVT_SCI_ROMODIFYATTEMPT(id, fn) DECLARE_EVENT_TABLE_ENTRY (wxEVT_SCI_ROMODIFYATTEMPT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxScintillaEventFunction) & fn, (wxObject *) NULL), #define EVT_SCI_KEY(id, fn) DECLARE_EVENT_TABLE_ENTRY (wxEVT_SCI_KEY, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxScintillaEventFunction) & fn, (wxObject *) NULL), #define EVT_SCI_DOUBLECLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY (wxEVT_SCI_DOUBLECLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxScintillaEventFunction) & fn, (wxObject *) NULL), #define EVT_SCI_UPDATEUI(id, fn) DECLARE_EVENT_TABLE_ENTRY (wxEVT_SCI_UPDATEUI, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxScintillaEventFunction) & fn, (wxObject *) NULL), #define EVT_SCI_MODIFIED(id, fn) DECLARE_EVENT_TABLE_ENTRY (wxEVT_SCI_MODIFIED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxScintillaEventFunction) & fn, (wxObject *) NULL), #define EVT_SCI_MACRORECORD(id, fn) DECLARE_EVENT_TABLE_ENTRY (wxEVT_SCI_MACRORECORD, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxScintillaEventFunction) & fn, (wxObject *) NULL), #define EVT_SCI_MARGINCLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY (wxEVT_SCI_MARGINCLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxScintillaEventFunction) & fn, (wxObject *) NULL), #define EVT_SCI_NEEDSHOWN(id, fn) DECLARE_EVENT_TABLE_ENTRY (wxEVT_SCI_NEEDSHOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxScintillaEventFunction) & fn, (wxObject *) NULL), #define EVT_SCI_POSCHANGED(id, fn) DECLARE_EVENT_TABLE_ENTRY (wxEVT_SCI_POSCHANGED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxScintillaEventFunction) & fn, (wxObject *) NULL), #define EVT_SCI_PAINTED(id, fn) DECLARE_EVENT_TABLE_ENTRY (wxEVT_SCI_PAINTED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxScintillaEventFunction) & fn, (wxObject *) NULL), #define EVT_SCI_USERLISTSELECTION(id, fn) DECLARE_EVENT_TABLE_ENTRY (wxEVT_SCI_USERLISTSELECTION, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxScintillaEventFunction) & fn, (wxObject *) NULL), #define EVT_SCI_URIDROPPED(id, fn) DECLARE_EVENT_TABLE_ENTRY (wxEVT_SCI_URIDROPPED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxScintillaEventFunction) & fn, (wxObject *) NULL), #define EVT_SCI_DWELLSTART(id, fn) DECLARE_EVENT_TABLE_ENTRY (wxEVT_SCI_DWELLSTART, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxScintillaEventFunction) & fn, (wxObject *) NULL), #define EVT_SCI_DWELLEND(id, fn) DECLARE_EVENT_TABLE_ENTRY (wxEVT_SCI_DWELLEND, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxScintillaEventFunction) & fn, (wxObject *) NULL), #define EVT_SCI_START_DRAG(id, fn) DECLARE_EVENT_TABLE_ENTRY (wxEVT_SCI_START_DRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxScintillaEventFunction) & fn, (wxObject *) NULL), #define EVT_SCI_DRAG_OVER(id, fn) DECLARE_EVENT_TABLE_ENTRY (wxEVT_SCI_DRAG_OVER, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxScintillaEventFunction) & fn, (wxObject *) NULL), #define EVT_SCI_DO_DROP(id, fn) DECLARE_EVENT_TABLE_ENTRY (wxEVT_SCI_DO_DROP, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxScintillaEventFunction) & fn, (wxObject *) NULL), #define EVT_SCI_ZOOM(id, fn) DECLARE_EVENT_TABLE_ENTRY (wxEVT_SCI_ZOOM, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxScintillaEventFunction) & fn, (wxObject *) NULL), #define EVT_SCI_HOTSPOT_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY (wxEVT_SCI_HOTSPOT_CLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxScintillaEventFunction) & fn, (wxObject *) NULL), #define EVT_SCI_HOTSPOT_DCLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY (wxEVT_SCI_HOTSPOT_DCLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxScintillaEventFunction) & fn, (wxObject *) NULL), #define EVT_SCI_CALLTIP_CLICK(id, fn)) DECLARE_EVENT_TABLE_ENTRY (wxEVT_SCI_CALLTIP_CLICK id, -1, (wxObjectEventFunction) (wxEventFunction) (wxScintillaEventFunction) & fn, (wxObject *) NULL), #define EVT_SCI_AUTOCOMP_SELECTION(id, fn)) DECLARE_EVENT_TABLE_ENTRY (wxEVT_SCI_AUTOCOMP_SELECTION id, -1, (wxObjectEventFunction) (wxEventFunction) (wxScintillaEventFunction) & fn, (wxObject *) NULL), #else // fix wxScintilla missing handler #ifndef wxScintillaEventHandler #define wxScintillaEventHandler(func) (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxScintillaEventFunction, &func) #endif #define EVT_SCI_CHANGE(id, fn) DECLARE_EVENT_TABLE_ENTRY (wxEVT_SCI_CHANGE, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxScintillaEventFunction, & fn ), (wxObject *) NULL), #define EVT_SCI_STYLENEEDED(id, fn) DECLARE_EVENT_TABLE_ENTRY (wxEVT_SCI_STYLENEEDED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxScintillaEventFunction, & fn ), (wxObject *) NULL), #define EVT_SCI_CHARADDED(id, fn) DECLARE_EVENT_TABLE_ENTRY (wxEVT_SCI_CHARADDED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxScintillaEventFunction, & fn ), (wxObject *) NULL), #define EVT_SCI_SAVEPOINTREACHED(id, fn) DECLARE_EVENT_TABLE_ENTRY (wxEVT_SCI_SAVEPOINTREACHED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxScintillaEventFunction, & fn ), (wxObject *) NULL), #define EVT_SCI_SAVEPOINTLEFT(id, fn) DECLARE_EVENT_TABLE_ENTRY (wxEVT_SCI_SAVEPOINTLEFT, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxScintillaEventFunction, & fn ), (wxObject *) NULL), #define EVT_SCI_ROMODIFYATTEMPT(id, fn) DECLARE_EVENT_TABLE_ENTRY (wxEVT_SCI_ROMODIFYATTEMPT, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxScintillaEventFunction, & fn ), (wxObject *) NULL), #define EVT_SCI_KEY(id, fn) DECLARE_EVENT_TABLE_ENTRY (wxEVT_SCI_KEY, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxScintillaEventFunction, & fn ), (wxObject *) NULL), #define EVT_SCI_DOUBLECLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY (wxEVT_SCI_DOUBLECLICK, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxScintillaEventFunction, & fn ), (wxObject *) NULL), #define EVT_SCI_UPDATEUI(id, fn) DECLARE_EVENT_TABLE_ENTRY (wxEVT_SCI_UPDATEUI, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxScintillaEventFunction, & fn ), (wxObject *) NULL), #define EVT_SCI_MODIFIED(id, fn) DECLARE_EVENT_TABLE_ENTRY (wxEVT_SCI_MODIFIED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxScintillaEventFunction, & fn ), (wxObject *) NULL), #define EVT_SCI_MACRORECORD(id, fn) DECLARE_EVENT_TABLE_ENTRY (wxEVT_SCI_MACRORECORD, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxScintillaEventFunction, & fn ), (wxObject *) NULL), #define EVT_SCI_MARGINCLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY (wxEVT_SCI_MARGINCLICK, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxScintillaEventFunction, & fn ), (wxObject *) NULL), #define EVT_SCI_NEEDSHOWN(id, fn) DECLARE_EVENT_TABLE_ENTRY (wxEVT_SCI_NEEDSHOWN, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxScintillaEventFunction, & fn ), (wxObject *) NULL), #define EVT_SCI_PAINTED(id, fn) DECLARE_EVENT_TABLE_ENTRY (wxEVT_SCI_PAINTED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxScintillaEventFunction, & fn ), (wxObject *) NULL), #define EVT_SCI_USERLISTSELECTION(id, fn) DECLARE_EVENT_TABLE_ENTRY (wxEVT_SCI_USERLISTSELECTION, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxScintillaEventFunction, & fn ), (wxObject *) NULL), #define EVT_SCI_URIDROPPED(id, fn) DECLARE_EVENT_TABLE_ENTRY (wxEVT_SCI_URIDROPPED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxScintillaEventFunction, & fn ), (wxObject *) NULL), #define EVT_SCI_DWELLSTART(id, fn) DECLARE_EVENT_TABLE_ENTRY (wxEVT_SCI_DWELLSTART, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxScintillaEventFunction, & fn ), (wxObject *) NULL), #define EVT_SCI_DWELLEND(id, fn) DECLARE_EVENT_TABLE_ENTRY (wxEVT_SCI_DWELLEND, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxScintillaEventFunction, & fn ), (wxObject *) NULL), #define EVT_SCI_START_DRAG(id, fn) DECLARE_EVENT_TABLE_ENTRY (wxEVT_SCI_START_DRAG, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxScintillaEventFunction, & fn ), (wxObject *) NULL), #define EVT_SCI_DRAG_OVER(id, fn) DECLARE_EVENT_TABLE_ENTRY (wxEVT_SCI_DRAG_OVER, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxScintillaEventFunction, & fn ), (wxObject *) NULL), #define EVT_SCI_DO_DROP(id, fn) DECLARE_EVENT_TABLE_ENTRY (wxEVT_SCI_DO_DROP, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxScintillaEventFunction, & fn ), (wxObject *) NULL), #define EVT_SCI_ZOOM(id, fn) DECLARE_EVENT_TABLE_ENTRY (wxEVT_SCI_ZOOM, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxScintillaEventFunction, & fn ), (wxObject *) NULL), #define EVT_SCI_HOTSPOT_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY (wxEVT_SCI_HOTSPOT_CLICK, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxScintillaEventFunction, & fn ), (wxObject *) NULL), #define EVT_SCI_HOTSPOT_DCLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY (wxEVT_SCI_HOTSPOT_DCLICK, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxScintillaEventFunction, & fn ), (wxObject *) NULL), #define EVT_SCI_CALLTIP_CLICK(id, fn)) DECLARE_EVENT_TABLE_ENTRY (wxEVT_SCI_CALLTIP_CLICK id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxScintillaEventFunction, & fn ), (wxObject *) NULL), #define EVT_SCI_AUTOCOMP_SELECTION(id, fn)) DECLARE_EVENT_TABLE_ENTRY (wxEVT_SCI_AUTOCOMP_SELECTION id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxScintillaEventFunction, & fn ), (wxObject *) NULL), #endif #endif //---------------------------------------------------------------------- // Utility functions used within wxScintilla #ifndef SWIG inline wxString sci2wx (const char* str) { #if wxUSE_UNICODE return wxString (str, wxConvUTF8); #else return wxString (str); #endif } #if wxUSE_UNICODE wxString sci2wx (const char* str, size_t len); #else inline wxString sci2wx (const char* str, size_t len) { return wxString (str, len); } #endif #if wxUSE_UNICODE inline const wxWX2MBbuf wx2sci (const wxString& str) { return str.mb_str (wxConvUTF8); } #else inline const wxWX2MBbuf wx2sci (const wxString& str) { return str.mbc_str(); } #endif #endif //---------------------------------------------------------------------- #endif // __WXSCINTILLA_H__ wxformbuilder-3.1.59/src/controls/src/wxScintilla/scintilla/src/LexErlang.cxx0000644000175000017500000004044511143440026027656 0ustar rrmulderrrmulder// Scintilla source code edit control /** @file LexErlang.cxx ** Lexer for Erlang. ** Written by Peter-Henry Mander, based on Matlab lexer by Jos Fonseca **/ // Copyright 1998-2001 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include #include #include "Platform.h" #include "PropSet.h" #include "Accessor.h" #include "StyleContext.h" #include "KeyWords.h" #include "Scintilla.h" #include "SciLexer.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif /* TODO: o _Param should be a new lexical type */ static int is_radix(int radix, int ch) { int digit; if ( 16 < radix || 2 > radix ) { return 0; } if ( isdigit(ch) ) { digit = ch - '0'; } else if ( isxdigit(ch) ) { digit = toupper(ch) - 'A' + 10; } else { return 0; } if ( digit < radix ) { return 1; } else { return 0; } } typedef enum { STATE_NULL, ATOM_UNQUOTED, ATOM_QUOTED, ATOM_FUN_NAME, NODE_NAME_UNQUOTED, NODE_NAME_QUOTED, MACRO_START, MACRO_UNQUOTED, MACRO_QUOTED, RECORD_START, RECORD_UNQUOTED, RECORD_QUOTED, NUMERAL_START, NUMERAL_SIGNED, NUMERAL_RADIX_LITERAL, NUMERAL_SPECULATIVE_MANTISSA, NUMERAL_FLOAT_MANTISSA, NUMERAL_FLOAT_EXPONENT, NUMERAL_FLOAT_SIGNED_EXPONENT, PARSE_ERROR } atom_parse_state_t; static void ColouriseErlangDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler) { WordList &keywords = *keywordlists[0]; styler.StartAt(startPos); StyleContext sc(startPos, length, initStyle, styler); atom_parse_state_t parse_state = STATE_NULL; int radix_digits = 0; int exponent_digits = 0; for (; sc.More(); sc.Forward()) { if ( STATE_NULL != parse_state ) { switch (parse_state) { case STATE_NULL: sc.SetState(SCE_ERLANG_DEFAULT); break; case ATOM_UNQUOTED: if ( '@' == sc.ch ){ parse_state = NODE_NAME_UNQUOTED; } else if ( !isalnum(sc.ch) && sc.ch != '_' ) { char s[100]; sc.GetCurrent(s, sizeof(s)); if (keywords.InList(s)) { sc.ChangeState(SCE_ERLANG_KEYWORD); sc.SetState(SCE_ERLANG_DEFAULT); parse_state = STATE_NULL; } else { if ( '/' == sc.ch ) { parse_state = ATOM_FUN_NAME; } else { sc.ChangeState(SCE_ERLANG_ATOM); sc.SetState(SCE_ERLANG_DEFAULT); parse_state = STATE_NULL; } } } break; case ATOM_QUOTED: if ( '@' == sc.ch ){ parse_state = NODE_NAME_QUOTED; } else if ( '\'' == sc.ch && '\\' != sc.chPrev ) { sc.ChangeState(SCE_ERLANG_ATOM); sc.ForwardSetState(SCE_ERLANG_DEFAULT); parse_state = STATE_NULL; } break; case ATOM_FUN_NAME: if ( !isdigit(sc.ch) ) { sc.ChangeState(SCE_ERLANG_FUNCTION_NAME); sc.SetState(SCE_ERLANG_DEFAULT); parse_state = STATE_NULL; } break; case NODE_NAME_QUOTED: if ( '@' == sc.ch ) { sc.SetState(SCE_ERLANG_DEFAULT); parse_state = STATE_NULL; } else if ( '\'' == sc.ch && '\\' != sc.chPrev ) { sc.ChangeState(SCE_ERLANG_NODE_NAME); sc.ForwardSetState(SCE_ERLANG_DEFAULT); parse_state = STATE_NULL; } break; case NODE_NAME_UNQUOTED: if ( '@' == sc.ch ) { sc.SetState(SCE_ERLANG_DEFAULT); parse_state = STATE_NULL; } else if ( !isalnum(sc.ch) && sc.ch != '_' ) { sc.ChangeState(SCE_ERLANG_NODE_NAME); sc.SetState(SCE_ERLANG_DEFAULT); parse_state = STATE_NULL; } break; case RECORD_START: if ( '\'' == sc.ch ) { parse_state = RECORD_QUOTED; } else if (isalpha(sc.ch) && islower(sc.ch)) { parse_state = RECORD_UNQUOTED; } else { // error sc.SetState(SCE_ERLANG_DEFAULT); parse_state = STATE_NULL; } break; case RECORD_QUOTED: if ( '\'' == sc.ch && '\\' != sc.chPrev ) { sc.ChangeState(SCE_ERLANG_RECORD); sc.ForwardSetState(SCE_ERLANG_DEFAULT); parse_state = STATE_NULL; } break; case RECORD_UNQUOTED: if ( !isalpha(sc.ch) && '_' != sc.ch ) { sc.ChangeState(SCE_ERLANG_RECORD); sc.SetState(SCE_ERLANG_DEFAULT); parse_state = STATE_NULL; } break; case MACRO_START: if ( '\'' == sc.ch ) { parse_state = MACRO_QUOTED; } else if (isalpha(sc.ch)) { parse_state = MACRO_UNQUOTED; } else { // error sc.SetState(SCE_ERLANG_DEFAULT); parse_state = STATE_NULL; } break; case MACRO_UNQUOTED: if ( !isalpha(sc.ch) && '_' != sc.ch ) { sc.ChangeState(SCE_ERLANG_MACRO); sc.SetState(SCE_ERLANG_DEFAULT); parse_state = STATE_NULL; } break; case MACRO_QUOTED: if ( '\'' == sc.ch && '\\' != sc.chPrev ) { sc.ChangeState(SCE_ERLANG_MACRO); sc.ForwardSetState(SCE_ERLANG_DEFAULT); parse_state = STATE_NULL; } break; case NUMERAL_START: if ( isdigit(sc.ch) ) { radix_digits *= 10; radix_digits += sc.ch - '0'; // Assuming ASCII here! } else if ( '#' == sc.ch ) { if ( 2 > radix_digits || 16 < radix_digits) { sc.SetState(SCE_ERLANG_DEFAULT); parse_state = STATE_NULL; } else { parse_state = NUMERAL_RADIX_LITERAL; } } else if ( '.' == sc.ch && isdigit(sc.chNext)) { radix_digits = 0; parse_state = NUMERAL_FLOAT_MANTISSA; } else if ( 'e' == sc.ch || 'E' == sc.ch ) { exponent_digits = 0; parse_state = NUMERAL_FLOAT_EXPONENT; } else { radix_digits = 0; sc.ChangeState(SCE_ERLANG_NUMBER); sc.SetState(SCE_ERLANG_DEFAULT); parse_state = STATE_NULL; } break; case NUMERAL_RADIX_LITERAL: if ( !is_radix(radix_digits,sc.ch) ) { radix_digits = 0; if ( !isalnum(sc.ch) ) { sc.ChangeState(SCE_ERLANG_NUMBER); } sc.SetState(SCE_ERLANG_DEFAULT); parse_state = STATE_NULL; } break; case NUMERAL_FLOAT_MANTISSA: if ( 'e' == sc.ch || 'E' == sc.ch ) { exponent_digits = 0; parse_state = NUMERAL_FLOAT_EXPONENT; } else if ( !isdigit(sc.ch) ) { sc.ChangeState(SCE_ERLANG_NUMBER); sc.SetState(SCE_ERLANG_DEFAULT); parse_state = STATE_NULL; } break; case NUMERAL_FLOAT_EXPONENT: if ( '-' == sc.ch || '+' == sc.ch ) { parse_state = NUMERAL_FLOAT_SIGNED_EXPONENT; } else if ( !isdigit(sc.ch) ) { if ( 0 < exponent_digits ) { sc.ChangeState(SCE_ERLANG_NUMBER); } sc.SetState(SCE_ERLANG_DEFAULT); parse_state = STATE_NULL; } else { ++exponent_digits; } break; case NUMERAL_FLOAT_SIGNED_EXPONENT: if ( !isdigit(sc.ch) ) { if ( 0 < exponent_digits ) { sc.ChangeState(SCE_ERLANG_NUMBER); } sc.SetState(SCE_ERLANG_DEFAULT); parse_state = STATE_NULL; } else { ++exponent_digits; } break; case NUMERAL_SIGNED: if ( !isdigit(sc.ch) ) { sc.ChangeState(SCE_ERLANG_NUMBER); sc.SetState(SCE_ERLANG_DEFAULT); parse_state = STATE_NULL; } else if ( '.' == sc.ch ) { parse_state = NUMERAL_FLOAT_MANTISSA; } break; case NUMERAL_SPECULATIVE_MANTISSA: if ( !isdigit(sc.ch) ) { sc.ChangeState(SCE_ERLANG_OPERATOR); sc.SetState(SCE_ERLANG_DEFAULT); parse_state = STATE_NULL; } else { parse_state = NUMERAL_FLOAT_MANTISSA; } break; case PARSE_ERROR: sc.SetState(SCE_ERLANG_DEFAULT); parse_state = STATE_NULL; break; } } else if (sc.state == SCE_ERLANG_OPERATOR) { if (sc.chPrev == '.') { if (sc.ch == '*' || sc.ch == '/' || sc.ch == '\\' || sc.ch == '^') { sc.ForwardSetState(SCE_ERLANG_DEFAULT); } else if (sc.ch == '\'') { sc.ForwardSetState(SCE_ERLANG_DEFAULT); } else { sc.SetState(SCE_ERLANG_DEFAULT); } } else { sc.SetState(SCE_ERLANG_DEFAULT); } } else if (sc.state == SCE_ERLANG_VARIABLE) { if (!isalnum(sc.ch) && sc.ch != '_') { sc.SetState(SCE_ERLANG_DEFAULT); } } else if (sc.state == SCE_ERLANG_STRING) { if (sc.ch == '\"' && sc.chPrev != '\\') { sc.ForwardSetState(SCE_ERLANG_DEFAULT); } } else if (sc.state == SCE_ERLANG_COMMENT ) { if (sc.atLineEnd) { sc.SetState(SCE_ERLANG_DEFAULT); } } else if (sc.state == SCE_ERLANG_CHARACTER ) { if ( sc.chPrev == '\\' ) { sc.ForwardSetState(SCE_ERLANG_DEFAULT); } else if ( sc.ch != '\\' ) { sc.ForwardSetState(SCE_ERLANG_DEFAULT); } } if (sc.state == SCE_ERLANG_DEFAULT) { if (sc.ch == '%') { sc.SetState(SCE_ERLANG_COMMENT); } else if (sc.ch == '\"') { sc.SetState(SCE_ERLANG_STRING); } else if (sc.ch == '#') { parse_state = RECORD_START; sc.SetState(SCE_ERLANG_UNKNOWN); } else if (sc.ch == '?') { parse_state = MACRO_START; sc.SetState(SCE_ERLANG_UNKNOWN); } else if (sc.ch == '$') { sc.SetState(SCE_ERLANG_CHARACTER); } else if (sc.ch == '\'') { parse_state = ATOM_QUOTED; sc.SetState(SCE_ERLANG_UNKNOWN); } else if ( isdigit(sc.ch) ) { parse_state = NUMERAL_START; radix_digits = sc.ch - '0'; sc.SetState(SCE_ERLANG_UNKNOWN); } else if ( '.' == sc.ch ) { parse_state = NUMERAL_SPECULATIVE_MANTISSA; sc.SetState(SCE_ERLANG_UNKNOWN); } else if (isalpha(sc.ch) && isupper(sc.ch)) { sc.SetState(SCE_ERLANG_VARIABLE); } else if (isalpha(sc.ch)) { parse_state = ATOM_UNQUOTED; sc.SetState(SCE_ERLANG_UNKNOWN); } else if (isoperator(static_cast(sc.ch)) || sc.ch == '\\') { sc.SetState(SCE_ERLANG_OPERATOR); } } } sc.Complete(); } static int ClassifyFoldPointErlang( Accessor &styler, int styleNext, int keyword_start ) { int lev = 0; if ( styler.Match(keyword_start,"case") || ( styler.Match(keyword_start,"fun") && SCE_ERLANG_FUNCTION_NAME != styleNext) || styler.Match(keyword_start,"if") || styler.Match(keyword_start,"query") || styler.Match(keyword_start,"receive") ) { ++lev; } else if ( styler.Match(keyword_start,"end") ) { --lev; } return lev; } static void FoldErlangDoc( unsigned int startPos, int length, int initStyle, WordList** /*keywordlists*/, Accessor &styler ) { unsigned int endPos = startPos + length; //~ int visibleChars = 0; int lineCurrent = styler.GetLine(startPos); int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK; int levelCurrent = levelPrev; char chNext = styler.SafeGetCharAt(startPos); int styleNext = styler.StyleAt(startPos); int style = initStyle; int keyword_start = 0; bool fold_keywords = true; bool fold_comments = true; bool fold_braces = true; bool fold_function_clauses = false; bool fold_clauses = false; //int clause_level = 0; for (unsigned int i = startPos; i < endPos; i++) { char ch = chNext; chNext = styler.SafeGetCharAt(i + 1); int stylePrev = style; style = styleNext; styleNext = styler.StyleAt(i + 1); bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n'); if ( (stylePrev != SCE_ERLANG_KEYWORD) && (style == SCE_ERLANG_KEYWORD) ) { keyword_start = i; } if ( fold_keywords ) { if ( (stylePrev == SCE_ERLANG_KEYWORD) && (style != SCE_ERLANG_KEYWORD) && (style != SCE_ERLANG_ATOM) ) { levelCurrent += ClassifyFoldPointErlang(styler,styleNext,keyword_start); } } if ( fold_comments ) { if (style == SCE_ERLANG_COMMENT) { if ((ch == '%') && (chNext == '{')) { levelCurrent++; } else if ((ch == '%') && (chNext == '}')) { levelCurrent--; } } } if ( fold_function_clauses ) { if ( (SC_FOLDLEVELBASE == levelCurrent) /*&& (style == SCE_ERLANG_OPERATOR)*/ ) { if ( (ch == '-') && (chNext == '>')) { //~ fprintf(stderr,"levelCurrent=%d\n", levelCurrent); //++clause_level; //~ if ( 0 < clause_level ) ++levelCurrent; } } //~ if ( (stylePrev != SCE_ERLANG_RECORD) //~ && (style != SCE_ERLANG_NUMBER) //~ && (style != SCE_ERLANG_STRING) //~ && (style != SCE_ERLANG_COMMENT) //~ ) { if ( (SC_FOLDLEVELBASE+1 == levelCurrent) && (ch == '.') ) { //--clause_level; //~ if ( 0 == clause_level ) --levelCurrent; } //~ } } if ( fold_clauses ) { if ( (0 < levelCurrent) && (style == SCE_ERLANG_OPERATOR) ) { if ((ch == '-') && (chNext == '>')) { levelCurrent++; } if ( (ch == ';') ) { levelCurrent--; } } if ( (stylePrev != SCE_ERLANG_RECORD) && (style != SCE_ERLANG_NUMBER) && (style != SCE_ERLANG_STRING) && (style != SCE_ERLANG_COMMENT) ) { if ( (ch == '.') ) { levelCurrent--; } } if ( (stylePrev == SCE_ERLANG_KEYWORD) && (style != SCE_ERLANG_KEYWORD) && (style != SCE_ERLANG_ATOM) && ( styler.Match(keyword_start,"end") // 'end' counted twice if fold_keywords too || styler.Match(keyword_start,"after") ) ) { levelCurrent--; } } if ( fold_braces ) { if (style == SCE_ERLANG_OPERATOR) { if ( (ch == '{') || (ch == '(') || (ch == '[') ) { levelCurrent++; } else if ( (ch == '}') || (ch == ')') || (ch == ']') ) { levelCurrent--; } } } if (atEOL) { int lev = levelPrev; //~ if (visibleChars == 0 && foldCompact) //~ lev |= SC_FOLDLEVELWHITEFLAG; //~ if ((levelCurrent > levelPrev) && (visibleChars > 0)) if ((levelCurrent > levelPrev)) { lev |= SC_FOLDLEVELHEADERFLAG; } if (lev != styler.LevelAt(lineCurrent)) { styler.SetLevel(lineCurrent, lev); } lineCurrent++; levelPrev = levelCurrent; //~ visibleChars = 0; } //~ if (!isspacechar(ch)) //~ visibleChars++; } // Fill in the real level of the next line, keeping the current flags as they will be filled in later int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK; styler.SetLevel(lineCurrent, levelPrev | flagsNext); } static const char * const erlangWordListDesc[] = { "Keywords", 0 }; LexerModule lmErlang( SCLEX_ERLANG, ColouriseErlangDoc, "erlang", FoldErlangDoc, erlangWordListDesc); wxformbuilder-3.1.59/src/controls/src/wxScintilla/scintilla/src/LexTCL.cxx0000644000175000017500000003120211143440026027057 0ustar rrmulderrrmulder// Scintilla source code edit control /** @file LexTCL.cxx ** Lexer for TCL language. **/ // Copyright 1998-2001 by Andre Arpin // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include #include #include "Platform.h" #include "PropSet.h" #include "Accessor.h" #include "StyleContext.h" #include "KeyWords.h" #include "Scintilla.h" #include "SciLexer.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif // Extended to accept accented characters static inline bool IsAWordChar(int ch) { return ch >= 0x80 || (isalnum(ch) || ch == '_' || ch ==':' || ch=='.'); // : name space separator } static inline bool IsAWordStart(int ch) { return ch >= 0x80 || (ch ==':' || isalpha(ch) || ch == '_'); } static inline bool IsANumberChar(int ch) { // Not exactly following number definition (several dots are seen as OK, etc.) // but probably enough in most cases. return (ch < 0x80) && (IsADigit(ch, 0x10) || toupper(ch) == 'E' || ch == '.' || ch == '-' || ch == '+'); } static void ColouriseTCLDoc(unsigned int startPos, int length, int , WordList *keywordlists[], Accessor &styler) { #define isComment(s) (s==SCE_TCL_COMMENT || s==SCE_TCL_COMMENTLINE || s==SCE_TCL_COMMENT_BOX || s==SCE_TCL_BLOCK_COMMENT) bool foldComment = styler.GetPropertyInt("fold.comment") != 0; bool commentLevel = false; bool subBrace = false; // substitution begin with a brace ${.....} enum tLineState {LS_DEFAULT, LS_OPEN_COMMENT, LS_OPEN_DOUBLE_QUOTE, LS_COMMENT_BOX, LS_MASK_STATE = 0xf, LS_COMMAND_EXPECTED = 16, LS_BRACE_ONLY = 32 } lineState = LS_DEFAULT; bool prevSlash = false; int currentLevel = 0; bool expected = 0; bool subParen = 0; int currentLine = styler.GetLine(startPos); if (currentLine > 0) currentLine--; length += startPos - styler.LineStart(currentLine); // make sure lines overlap startPos = styler.LineStart(currentLine); WordList &keywords = *keywordlists[0]; WordList &keywords2 = *keywordlists[1]; WordList &keywords3 = *keywordlists[2]; WordList &keywords4 = *keywordlists[3]; WordList &keywords5 = *keywordlists[4]; WordList &keywords6 = *keywordlists[5]; WordList &keywords7 = *keywordlists[6]; WordList &keywords8 = *keywordlists[7]; WordList &keywords9 = *keywordlists[8]; if (currentLine > 0) { int ls = styler.GetLineState(currentLine - 1); lineState = tLineState(ls & LS_MASK_STATE); expected = LS_COMMAND_EXPECTED == tLineState(ls & LS_COMMAND_EXPECTED); subBrace = LS_BRACE_ONLY == tLineState(ls & LS_BRACE_ONLY); currentLevel = styler.LevelAt(currentLine - 1) >> 17; commentLevel = (styler.LevelAt(currentLine - 1) >> 16) & 1; } else styler.SetLevel(0, SC_FOLDLEVELBASE | SC_FOLDLEVELHEADERFLAG); bool visibleChars = false; int previousLevel = currentLevel; StyleContext sc(startPos, length, SCE_TCL_DEFAULT, styler); for (; ; sc.Forward()) { next: if (sc.ch=='\r' && sc.chNext == '\n') // only ignore \r on PC process on the mac continue; bool atEnd = !sc.More(); // make sure we coloured the last word if (lineState != LS_DEFAULT) { sc.SetState(SCE_TCL_DEFAULT); if (lineState == LS_OPEN_COMMENT) sc.SetState(SCE_TCL_COMMENTLINE); else if (lineState == LS_OPEN_DOUBLE_QUOTE) sc.SetState(SCE_TCL_IN_QUOTE); else if (lineState == LS_COMMENT_BOX && (sc.ch == '#' || (sc.ch == ' ' && sc.chNext=='#'))) sc.SetState(SCE_TCL_COMMENT_BOX); lineState = LS_DEFAULT; } if (subBrace) { // ${ overrides every thing even \ except } if (sc.ch == '}') { subBrace = false; sc.SetState(SCE_TCL_OPERATOR); sc.ForwardSetState(SCE_TCL_DEFAULT); goto next; } else sc.SetState(SCE_TCL_SUB_BRACE); if (!sc.atLineEnd) continue; } else if (sc.state == SCE_TCL_DEFAULT || sc.state ==SCE_TCL_OPERATOR) { expected &= isspacechar(static_cast(sc.ch)) || IsAWordStart(sc.ch) || sc.ch =='#'; } else if (sc.state == SCE_TCL_SUBSTITUTION) { switch(sc.ch) { case '(': subParen=true; sc.SetState(SCE_TCL_OPERATOR); sc.ForwardSetState(SCE_TCL_SUBSTITUTION); continue; case ')': sc.SetState(SCE_TCL_OPERATOR); subParen=false; continue; case '$': continue; case ',': sc.SetState(SCE_TCL_OPERATOR); if (subParen) sc.ForwardSetState(SCE_TCL_SUBSTITUTION); continue; default : // maybe spaces should be allowed ??? if (!IsAWordChar(sc.ch)) { // probably the code is wrong sc.SetState(SCE_TCL_DEFAULT); subParen = 0; } break; } } else if (isComment(sc.state)) { } else if (!IsAWordChar(sc.ch)) { if ((sc.state == SCE_TCL_IDENTIFIER && expected) || sc.state == SCE_TCL_MODIFIER) { char w[100]; char *s=w; sc.GetCurrent(w, sizeof(w)); if (w[strlen(w)-1]=='\r') w[strlen(w)-1]=0; while(*s == ':') // ignore leading : like in ::set a 10 ++s; bool quote = sc.state == SCE_TCL_IN_QUOTE; if (commentLevel || expected) { if (keywords.InList(s)) { sc.ChangeState(quote ? SCE_TCL_WORD_IN_QUOTE : SCE_TCL_WORD); } else if (keywords2.InList(s)) { sc.ChangeState(quote ? SCE_TCL_WORD_IN_QUOTE : SCE_TCL_WORD2); } else if (keywords3.InList(s)) { sc.ChangeState(quote ? SCE_TCL_WORD_IN_QUOTE : SCE_TCL_WORD3); } else if (keywords4.InList(s)) { sc.ChangeState(quote ? SCE_TCL_WORD_IN_QUOTE : SCE_TCL_WORD4); } else if (sc.GetRelative(-static_cast(strlen(s))-1) == '{' && keywords5.InList(s) && sc.ch == '}') { // {keyword} exactly no spaces sc.ChangeState(SCE_TCL_EXPAND); } if (keywords6.InList(s)) { sc.ChangeState(SCE_TCL_WORD5); } else if (keywords7.InList(s)) { sc.ChangeState(SCE_TCL_WORD6); } else if (keywords8.InList(s)) { sc.ChangeState(SCE_TCL_WORD7); } else if (keywords9.InList(s)) { sc.ChangeState(SCE_TCL_WORD8); } } expected = false; sc.SetState(quote ? SCE_TCL_IN_QUOTE : SCE_TCL_DEFAULT); } else if (sc.state == SCE_TCL_MODIFIER || sc.state == SCE_TCL_IDENTIFIER) { sc.SetState(SCE_TCL_DEFAULT); } } if (atEnd) break; if (sc.atLineEnd) { lineState = LS_DEFAULT; currentLine = styler.GetLine(sc.currentPos); if (foldComment && sc.state!=SCE_TCL_COMMENT && isComment(sc.state)) { if (currentLevel == 0) { ++currentLevel; commentLevel = true; } } else { if (visibleChars && commentLevel) { --currentLevel; --previousLevel; commentLevel = false; } } int flag = 0; if (!visibleChars) flag = SC_FOLDLEVELWHITEFLAG; if (currentLevel > previousLevel) flag = SC_FOLDLEVELHEADERFLAG; styler.SetLevel(currentLine, flag + previousLevel + SC_FOLDLEVELBASE + (currentLevel << 17) + (commentLevel << 16)); // Update the line state, so it can be seen by next line if (sc.state == SCE_TCL_IN_QUOTE) lineState = LS_OPEN_DOUBLE_QUOTE; else { if (prevSlash) { if (isComment(sc.state)) lineState = LS_OPEN_COMMENT; } else if (sc.state == SCE_TCL_COMMENT_BOX) lineState = LS_COMMENT_BOX; } styler.SetLineState(currentLine, (subBrace ? LS_BRACE_ONLY : 0) | (expected ? LS_COMMAND_EXPECTED : 0) | lineState); if (lineState == LS_COMMENT_BOX) sc.ForwardSetState(SCE_TCL_COMMENT_BOX); else if (lineState == LS_OPEN_DOUBLE_QUOTE) sc.ForwardSetState(SCE_TCL_IN_QUOTE); else sc.ForwardSetState(SCE_TCL_DEFAULT); prevSlash = false; previousLevel = currentLevel; goto next; } if (prevSlash) { prevSlash = false; if (sc.ch == '#' && IsANumberChar(sc.chNext)) sc.ForwardSetState(SCE_TCL_NUMBER); continue; } prevSlash = sc.ch == '\\'; if (isComment(sc.state)) continue; if (sc.atLineStart) { visibleChars = false; if (sc.state!=SCE_TCL_IN_QUOTE && !isComment(sc.state)) { sc.SetState(SCE_TCL_DEFAULT); expected = IsAWordStart(sc.ch)|| isspacechar(static_cast(sc.ch)); } } switch (sc.state) { case SCE_TCL_NUMBER: if (!IsANumberChar(sc.ch)) sc.SetState(SCE_TCL_DEFAULT); break; case SCE_TCL_IN_QUOTE: if (sc.ch == '"') { sc.ForwardSetState(SCE_TCL_DEFAULT); visibleChars = true; // necessary if a " is the first and only character on a line goto next; } else if (sc.ch == '[' || sc.ch == ']' || sc.ch == '$') { sc.SetState(SCE_TCL_OPERATOR); expected = sc.ch == '['; sc.ForwardSetState(SCE_TCL_IN_QUOTE); goto next; } continue; case SCE_TCL_OPERATOR: sc.SetState(SCE_TCL_DEFAULT); break; } if (sc.ch == '#') { if (visibleChars) { if (sc.state != SCE_TCL_IN_QUOTE && expected) sc.SetState(SCE_TCL_COMMENT); } else { sc.SetState(SCE_TCL_COMMENTLINE); if (sc.chNext == '~') sc.SetState(SCE_TCL_BLOCK_COMMENT); if (sc.atLineStart && (sc.chNext == '#' || sc.chNext == '-')) sc.SetState(SCE_TCL_COMMENT_BOX); } } if (!isspacechar(static_cast(sc.ch))) { visibleChars = true; } if (sc.ch == '\\') { prevSlash = true; continue; } // Determine if a new state should be entered. if (sc.state == SCE_TCL_DEFAULT) { if (IsAWordStart(sc.ch)) { sc.SetState(SCE_TCL_IDENTIFIER); } else if (IsADigit(sc.ch) && !IsAWordChar(sc.chPrev)) { sc.SetState(SCE_TCL_NUMBER); } else { switch (sc.ch) { case '\"': sc.SetState(SCE_TCL_IN_QUOTE); break; case '{': sc.SetState(SCE_TCL_OPERATOR); expected = true; ++currentLevel; break; case '}': sc.SetState(SCE_TCL_OPERATOR); --currentLevel; break; case '[': expected = true; case ']': case '(': case ')': sc.SetState(SCE_TCL_OPERATOR); break; case ';': expected = true; break; case '$': subParen = 0; if (sc.chNext != '{') { sc.SetState(SCE_TCL_SUBSTITUTION); } else { sc.SetState(SCE_TCL_OPERATOR); // $ sc.Forward(); // { sc.ForwardSetState(SCE_TCL_SUB_BRACE); subBrace = true; } break; case '#': if ((isspacechar(static_cast(sc.chPrev))|| isoperator(static_cast(sc.chPrev))) && IsADigit(sc.chNext,0x10)) sc.SetState(SCE_TCL_NUMBER); break; case '-': sc.SetState(IsADigit(sc.chNext)? SCE_TCL_NUMBER: SCE_TCL_MODIFIER); break; default: if (isoperator(static_cast(sc.ch))) { sc.SetState(SCE_TCL_OPERATOR); } } } } } sc.Complete(); } static const char * const tclWordListDesc[] = { "TCL Keywords", "TK Keywords", "iTCL Keywords", "tkCommands", "expand" "user1", "user2", "user3", "user4", 0 }; // this code supports folding in the colourizer LexerModule lmTCL(SCLEX_TCL, ColouriseTCLDoc, "tcl", 0, tclWordListDesc); wxformbuilder-3.1.59/src/controls/src/wxScintilla/scintilla/src/LexMatlab.cxx0000644000175000017500000001620211143440026027640 0ustar rrmulderrrmulder// Scintilla source code edit control /** @file LexMatlab.cxx ** Lexer for Matlab. ** Written by Jos Fonseca ** ** Changes by Christoph Dalitz 2003/12/04: ** - added support for Octave ** - Strings can now be included both in single or double quotes **/ // Copyright 1998-2001 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include #include #include "Platform.h" #include "PropSet.h" #include "Accessor.h" #include "StyleContext.h" #include "KeyWords.h" #include "Scintilla.h" #include "SciLexer.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif static bool IsMatlabCommentChar(int c) { return (c == '%') ; } static bool IsOctaveCommentChar(int c) { return (c == '%' || c == '#') ; } static bool IsMatlabComment(Accessor &styler, int pos, int len) { return len > 0 && IsMatlabCommentChar(styler[pos]) ; } static bool IsOctaveComment(Accessor &styler, int pos, int len) { return len > 0 && IsOctaveCommentChar(styler[pos]) ; } static inline bool IsAWordChar(const int ch) { return (ch < 0x80) && (isalnum(ch) || ch == '_'); } static inline bool IsAWordStart(const int ch) { return (ch < 0x80) && (isalnum(ch) || ch == '_'); } static void ColouriseMatlabOctaveDoc( unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler, bool (*IsCommentChar)(int)) { WordList &keywords = *keywordlists[0]; styler.StartAt(startPos); bool transpose = false; StyleContext sc(startPos, length, initStyle, styler); for (; sc.More(); sc.Forward()) { if (sc.state == SCE_MATLAB_OPERATOR) { if (sc.chPrev == '.') { if (sc.ch == '*' || sc.ch == '/' || sc.ch == '\\' || sc.ch == '^') { sc.ForwardSetState(SCE_MATLAB_DEFAULT); transpose = false; } else if (sc.ch == '\'') { sc.ForwardSetState(SCE_MATLAB_DEFAULT); transpose = true; } else { sc.SetState(SCE_MATLAB_DEFAULT); } } else { sc.SetState(SCE_MATLAB_DEFAULT); } } else if (sc.state == SCE_MATLAB_KEYWORD) { if (!isalnum(sc.ch) && sc.ch != '_') { char s[100]; sc.GetCurrentLowered(s, sizeof(s)); if (keywords.InList(s)) { sc.SetState(SCE_MATLAB_DEFAULT); transpose = false; } else { sc.ChangeState(SCE_MATLAB_IDENTIFIER); sc.SetState(SCE_MATLAB_DEFAULT); transpose = true; } } } else if (sc.state == SCE_MATLAB_NUMBER) { if (!isdigit(sc.ch) && sc.ch != '.' && !(sc.ch == 'e' || sc.ch == 'E') && !((sc.ch == '+' || sc.ch == '-') && (sc.chPrev == 'e' || sc.chPrev == 'E'))) { sc.SetState(SCE_MATLAB_DEFAULT); transpose = true; } } else if (sc.state == SCE_MATLAB_STRING) { if (sc.ch == '\\') { if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') { sc.Forward(); } } else if (sc.ch == '\'') { sc.ForwardSetState(SCE_MATLAB_DEFAULT); } } else if (sc.state == SCE_MATLAB_DOUBLEQUOTESTRING) { if (sc.ch == '\\') { if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') { sc.Forward(); } } else if (sc.ch == '\"') { sc.ForwardSetState(SCE_MATLAB_DEFAULT); } } else if (sc.state == SCE_MATLAB_COMMENT || sc.state == SCE_MATLAB_COMMAND) { if (sc.atLineEnd) { sc.SetState(SCE_MATLAB_DEFAULT); transpose = false; } } if (sc.state == SCE_MATLAB_DEFAULT) { if (IsCommentChar(sc.ch)) { sc.SetState(SCE_MATLAB_COMMENT); } else if (sc.ch == '!') { sc.SetState(SCE_MATLAB_COMMAND); } else if (sc.ch == '\'') { if (transpose) { sc.SetState(SCE_MATLAB_OPERATOR); } else { sc.SetState(SCE_MATLAB_STRING); } } else if (sc.ch == '"') { sc.SetState(SCE_MATLAB_DOUBLEQUOTESTRING); } else if (isdigit(sc.ch) || (sc.ch == '.' && isdigit(sc.chNext))) { sc.SetState(SCE_MATLAB_NUMBER); } else if (isalpha(sc.ch)) { sc.SetState(SCE_MATLAB_KEYWORD); } else if (isoperator(static_cast(sc.ch)) || sc.ch == '@' || sc.ch == '\\') { if (sc.ch == ')' || sc.ch == ']') { transpose = true; } else { transpose = false; } sc.SetState(SCE_MATLAB_OPERATOR); } else { transpose = false; } } } sc.Complete(); } static void ColouriseMatlabDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler) { ColouriseMatlabOctaveDoc(startPos, length, initStyle, keywordlists, styler, IsMatlabCommentChar); } static void ColouriseOctaveDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler) { ColouriseMatlabOctaveDoc(startPos, length, initStyle, keywordlists, styler, IsOctaveCommentChar); } static void FoldMatlabOctaveDoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler, bool (*IsComment)(Accessor&, int, int)) { int endPos = startPos + length; // Backtrack to previous line in case need to fix its fold status int lineCurrent = styler.GetLine(startPos); if (startPos > 0) { if (lineCurrent > 0) { lineCurrent--; startPos = styler.LineStart(lineCurrent); } } int spaceFlags = 0; int indentCurrent = styler.IndentAmount(lineCurrent, &spaceFlags, IsComment); char chNext = styler[startPos]; for (int i = startPos; i < endPos; i++) { char ch = chNext; chNext = styler.SafeGetCharAt(i + 1); if ((ch == '\r' && chNext != '\n') || (ch == '\n') || (i == endPos)) { int lev = indentCurrent; int indentNext = styler.IndentAmount(lineCurrent + 1, &spaceFlags, IsComment); if (!(indentCurrent & SC_FOLDLEVELWHITEFLAG)) { // Only non whitespace lines can be headers if ((indentCurrent & SC_FOLDLEVELNUMBERMASK) < (indentNext & SC_FOLDLEVELNUMBERMASK)) { lev |= SC_FOLDLEVELHEADERFLAG; } else if (indentNext & SC_FOLDLEVELWHITEFLAG) { // Line after is blank so check the next - maybe should continue further? int spaceFlags2 = 0; int indentNext2 = styler.IndentAmount(lineCurrent + 2, &spaceFlags2, IsComment); if ((indentCurrent & SC_FOLDLEVELNUMBERMASK) < (indentNext2 & SC_FOLDLEVELNUMBERMASK)) { lev |= SC_FOLDLEVELHEADERFLAG; } } } indentCurrent = indentNext; styler.SetLevel(lineCurrent, lev); lineCurrent++; } } } static void FoldMatlabDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler) { FoldMatlabOctaveDoc(startPos, length, initStyle, keywordlists, styler, IsMatlabComment); } static void FoldOctaveDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler) { FoldMatlabOctaveDoc(startPos, length, initStyle, keywordlists, styler, IsOctaveComment); } static const char * const matlabWordListDesc[] = { "Keywords", 0 }; static const char * const octaveWordListDesc[] = { "Keywords", 0 }; LexerModule lmMatlab(SCLEX_MATLAB, ColouriseMatlabDoc, "matlab", FoldMatlabDoc, matlabWordListDesc); LexerModule lmOctave(SCLEX_OCTAVE, ColouriseOctaveDoc, "octave", FoldOctaveDoc, octaveWordListDesc); wxformbuilder-3.1.59/src/controls/src/wxScintilla/scintilla/src/StyleContext.cxx0000644000175000017500000000227211143440026030436 0ustar rrmulderrrmulder// Scintilla source code edit control /** @file StyleContext.cxx ** Lexer infrastructure. **/ // Copyright 1998-2004 by Neil Hodgson // This file is in the public domain. #include #include #include #include #include "Platform.h" #include "PropSet.h" #include "Accessor.h" #include "StyleContext.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif static void getRange(unsigned int start, unsigned int end, Accessor &styler, char *s, unsigned int len) { unsigned int i = 0; while ((i < end - start + 1) && (i < len-1)) { s[i] = styler[start + i]; i++; } s[i] = '\0'; } void StyleContext::GetCurrent(char *s, unsigned int len) { getRange(styler.GetStartSegment(), currentPos - 1, styler, s, len); } static void getRangeLowered(unsigned int start, unsigned int end, Accessor &styler, char *s, unsigned int len) { unsigned int i = 0; while ((i < end - start + 1) && (i < len-1)) { s[i] = static_cast(tolower(styler[start + i])); i++; } s[i] = '\0'; } void StyleContext::GetCurrentLowered(char *s, unsigned int len) { getRangeLowered(styler.GetStartSegment(), currentPos - 1, styler, s, len); } wxformbuilder-3.1.59/src/controls/src/wxScintilla/scintilla/src/LexPascal.cxx0000644000175000017500000002466211143440026027654 0ustar rrmulderrrmulder// Scintilla source code edit control /** @file LexPascal.cxx ** Lexer for Pascal. ** Written by Laurent le Tynevez ** Updated by Simon Steele September 2002 ** Updated by Mathias Rauen May 2003 (Delphi adjustments) **/ #include #include #include #include #include #include "Platform.h" #include "PropSet.h" #include "Accessor.h" #include "KeyWords.h" #include "Scintilla.h" #include "SciLexer.h" #include "StyleContext.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif static void getRange(unsigned int start, unsigned int end, Accessor &styler, char *s, unsigned int len) { unsigned int i = 0; while ((i < end - start + 1) && (i < len-1)) { s[i] = static_cast(tolower(styler[start + i])); i++; } s[i] = '\0'; } static bool IsStreamCommentStyle(int style) { return style == SCE_C_COMMENT || style == SCE_C_COMMENTDOC || style == SCE_C_COMMENTDOCKEYWORD || style == SCE_C_COMMENTDOCKEYWORDERROR; } static void ColourTo(Accessor &styler, unsigned int end, unsigned int attr, bool bInAsm) { if ((bInAsm) && (attr == SCE_C_OPERATOR || attr == SCE_C_NUMBER || attr == SCE_C_DEFAULT || attr == SCE_C_WORD || attr == SCE_C_IDENTIFIER)) { styler.ColourTo(end, SCE_C_REGEX); } else styler.ColourTo(end, attr); } // returns 1 if the item starts a class definition, and -1 if the word is "end", and 2 if the word is "asm" static int classifyWordPascal(unsigned int start, unsigned int end, /*WordList &keywords*/WordList *keywordlists[], Accessor &styler, bool bInClass, bool bInAsm) { int ret = 0; WordList& keywords = *keywordlists[0]; WordList& classwords = *keywordlists[1]; char s[100]; getRange(start, end, styler, s, sizeof(s)); char chAttr = SCE_C_IDENTIFIER; if (isdigit(s[0]) || (s[0] == '.') ||(s[0] == '$')) { chAttr = SCE_C_NUMBER; } else { if (s[0] == '#') { chAttr = SCE_C_CHARACTER; } else { if (keywords.InList(s)) { chAttr = SCE_C_WORD; if(strcmp(s, "class") == 0) { ret = 1; } else if (strcmp(s, "asm") == 0) { ret = 2; } else if (strcmp(s, "end") == 0) { ret = -1; } } else if (bInClass) { if (classwords.InList(s)) { chAttr = SCE_C_WORD; } } } } ColourTo(styler, end, chAttr, (bInAsm && ret != -1)); return ret; } static int classifyFoldPointPascal(const char* s) { int lev = 0; if (!(isdigit(s[0]) || (s[0] == '.'))) { if (strcmp(s, "begin") == 0 || strcmp(s, "object") == 0 || strcmp(s, "case") == 0 || strcmp(s, "class") == 0 || strcmp(s, "record") == 0 || strcmp(s, "try") == 0) { lev=1; } else if (strcmp(s, "end") == 0) { lev=-1; } } return lev; } static void ColourisePascalDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler) { styler.StartAt(startPos); int state = initStyle; if (state == SCE_C_CHARACTER) // Does not leak onto next line state = SCE_C_DEFAULT; char chPrev = ' '; char chNext = styler[startPos]; unsigned int lengthDoc = startPos + length; bool bInClassDefinition; int currentLine = styler.GetLine(startPos); if (currentLine > 0) { styler.SetLineState(currentLine, styler.GetLineState(currentLine-1)); bInClassDefinition = (styler.GetLineState(currentLine) == 1); } else { styler.SetLineState(currentLine, 0); bInClassDefinition = false; } bool bInAsm = (state == SCE_C_REGEX); if (bInAsm) state = SCE_C_DEFAULT; styler.StartSegment(startPos); for (unsigned int i = startPos; i < lengthDoc; i++) { char ch = chNext; chNext = styler.SafeGetCharAt(i + 1); if ((ch == '\r' && chNext != '\n') || (ch == '\n')) { // Trigger on CR only (Mac style) or either on LF from CR+LF (Dos/Win) or on LF alone (Unix) // Avoid triggering two times on Dos/Win // End of line if (state == SCE_C_CHARACTER) { ColourTo(styler, i, state, bInAsm); state = SCE_C_DEFAULT; } currentLine++; styler.SetLineState(currentLine, (bInClassDefinition ? 1 : 0)); } if (styler.IsLeadByte(ch)) { chNext = styler.SafeGetCharAt(i + 2); chPrev = ' '; i += 1; continue; } if (state == SCE_C_DEFAULT) { if (iswordstart(ch) || ch == '#' || ch == '$' || (ch == '@' && bInAsm)) { ColourTo(styler, i-1, state, bInAsm); state = SCE_C_IDENTIFIER; } else if (ch == '{' && chNext != '$' && chNext != '&') { ColourTo(styler, i-1, state, bInAsm); state = SCE_C_COMMENT; } else if (ch == '(' && chNext == '*' && styler.SafeGetCharAt(i + 2) != '$' && styler.SafeGetCharAt(i + 2) != '&') { ColourTo(styler, i-1, state, bInAsm); state = SCE_C_COMMENTDOC; } else if (ch == '/' && chNext == '/') { ColourTo(styler, i-1, state, bInAsm); state = SCE_C_COMMENTLINE; } else if (ch == '\'') { ColourTo(styler, i-1, state, bInAsm); state = SCE_C_CHARACTER; } else if (ch == '{' && (chNext == '$' || chNext=='&')) { ColourTo(styler, i-1, state, bInAsm); state = SCE_C_PREPROCESSOR; } else if (isoperator(ch)) { ColourTo(styler, i-1, state, bInAsm); ColourTo(styler, i, SCE_C_OPERATOR, bInAsm); } } else if (state == SCE_C_IDENTIFIER) { bool bDoublePoint = ((ch == '.') && (chPrev == '.')); if ((!iswordchar(ch) && ch != '$' && ch != '#' && (ch != '@' || !bInAsm)) || bDoublePoint) { if (bDoublePoint) i--; int lStateChange = classifyWordPascal(styler.GetStartSegment(), i - 1, keywordlists, styler, bInClassDefinition, bInAsm); if(lStateChange == 1) { styler.SetLineState(currentLine, 1); bInClassDefinition = true; } else if(lStateChange == 2) { bInAsm = true; } else if(lStateChange == -1) { styler.SetLineState(currentLine, 0); bInClassDefinition = false; bInAsm = false; } if (bDoublePoint) { i++; ColourTo(styler, i-1, SCE_C_DEFAULT, bInAsm); } state = SCE_C_DEFAULT; chNext = styler.SafeGetCharAt(i + 1); if (ch == '{' && chNext != '$' && chNext != '&') { state = SCE_C_COMMENT; } else if (ch == '(' && chNext == '*' && styler.SafeGetCharAt(i + 2) != '$' && styler.SafeGetCharAt(i + 2) != '&') { ColourTo(styler, i-1, state, bInAsm); state = SCE_C_COMMENTDOC; } else if (ch == '/' && chNext == '/') { state = SCE_C_COMMENTLINE; } else if (ch == '\'') { state = SCE_C_CHARACTER; } else if (isoperator(ch)) { ColourTo(styler, i, SCE_C_OPERATOR, bInAsm); } } } else { if (state == SCE_C_PREPROCESSOR) { if (ch=='}'){ ColourTo(styler, i, state, bInAsm); state = SCE_C_DEFAULT; } else { if ((ch == '\r' || ch == '\n') && !(chPrev == '\\' || chPrev == '\r')) { ColourTo(styler, i-1, state, bInAsm); state = SCE_C_DEFAULT; } } } else if (state == SCE_C_COMMENT) { if (ch == '}' ) { ColourTo(styler, i, state, bInAsm); state = SCE_C_DEFAULT; } } else if (state == SCE_C_COMMENTDOC) { if (ch == ')' && chPrev == '*') { if (((i > styler.GetStartSegment() + 2) || ( (initStyle == SCE_C_COMMENTDOC) && (styler.GetStartSegment() == static_cast(startPos))))) { ColourTo(styler, i, state, bInAsm); state = SCE_C_DEFAULT; } } } else if (state == SCE_C_COMMENTLINE) { if (ch == '\r' || ch == '\n') { ColourTo(styler, i-1, state, bInAsm); state = SCE_C_DEFAULT; } } else if (state == SCE_C_CHARACTER) { if (ch == '\'') { ColourTo(styler, i, state, bInAsm); state = SCE_C_DEFAULT; } } } chPrev = ch; } ColourTo(styler, lengthDoc - 1, state, bInAsm); } static void FoldPascalDoc(unsigned int startPos, int length, int initStyle, WordList *[], Accessor &styler) { bool foldComment = styler.GetPropertyInt("fold.comment") != 0; bool foldPreprocessor = styler.GetPropertyInt("fold.preprocessor") != 0; bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0; unsigned int endPos = startPos + length; int visibleChars = 0; int lineCurrent = styler.GetLine(startPos); int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK; int levelCurrent = levelPrev; char chNext = styler[startPos]; int styleNext = styler.StyleAt(startPos); int style = initStyle; int lastStart = 0; for (unsigned int i = startPos; i < endPos; i++) { char ch = chNext; chNext = styler.SafeGetCharAt(i + 1); int stylePrev = style; style = styleNext; styleNext = styler.StyleAt(i + 1); bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n'); if (stylePrev != SCE_C_WORD && style == SCE_C_WORD) { // Store last word start point. lastStart = i; } if (stylePrev == SCE_C_WORD) { if(iswordchar(ch) && !iswordchar(chNext)) { char s[100]; getRange(lastStart, i, styler, s, sizeof(s)); levelCurrent += classifyFoldPointPascal(s); } } if (foldComment && (style == SCE_C_COMMENTLINE)) { if ((ch == '/') && (chNext == '/')) { char chNext2 = styler.SafeGetCharAt(i + 2); if (chNext2 == '{') { levelCurrent++; } else if (chNext2 == '}') { levelCurrent--; } } } if (foldPreprocessor && (style == SCE_C_PREPROCESSOR)) { if (ch == '{' && chNext == '$') { unsigned int j=i+2; // skip {$ while ((j levelPrev) && (visibleChars > 0)) lev |= SC_FOLDLEVELHEADERFLAG; if (lev != styler.LevelAt(lineCurrent)) { styler.SetLevel(lineCurrent, lev); } lineCurrent++; levelPrev = levelCurrent; visibleChars = 0; } if (!isspacechar(ch)) visibleChars++; } // Fill in the real level of the next line, keeping the current flags as they will be filled in later int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK; styler.SetLevel(lineCurrent, levelPrev | flagsNext); } static const char * const pascalWordListDesc[] = { "Keywords", "Classwords", 0 }; LexerModule lmPascal(SCLEX_PASCAL, ColourisePascalDoc, "pascal", FoldPascalDoc, pascalWordListDesc); wxformbuilder-3.1.59/src/controls/src/wxScintilla/scintilla/src/LexPB.cxx0000644000175000017500000003027411143440026026746 0ustar rrmulderrrmulder// Scintilla source code edit control // @file LexPB.cxx // Lexer for PowerBasic by Roland Walter, roland@rowalt.de (for PowerBasic see www.powerbasic.com) // // Changes: // 17.10.2003: Toggling of subs/functions now until next sub/function - this gives better results // 29.10.2003: 1. Bug: Toggling didn't work for subs/functions added in editor // 2. Own colors for PB constants and Inline Assembler SCE_B_CONSTANT and SCE_B_ASM // 3. Several smaller syntax coloring improvements and speed optimizations // 12.07.2004: 1. Toggling for macros added // 2. Further folding speed optimitations (for people dealing with very large listings) // // Necessary changes for the PB lexer in Scintilla project: // - In SciLexer.h and Scintilla.iface: // // #define SCLEX_POWERBASIC 51 //ID for PowerBasic lexer // (...) // #define SCE_B_DEFAULT 0 //in both VB and PB lexer // #define SCE_B_COMMENT 1 //in both VB and PB lexer // #define SCE_B_NUMBER 2 //in both VB and PB lexer // #define SCE_B_KEYWORD 3 //in both VB and PB lexer // #define SCE_B_STRING 4 //in both VB and PB lexer // #define SCE_B_PREPROCESSOR 5 //VB lexer only, not in PB lexer // #define SCE_B_OPERATOR 6 //in both VB and PB lexer // #define SCE_B_IDENTIFIER 7 //in both VB and PB lexer // #define SCE_B_DATE 8 //VB lexer only, not in PB lexer // #define SCE_B_CONSTANT 13 //PB lexer only, not in VB lexer // #define SCE_B_ASM 14 //PB lexer only, not in VB lexer // - Statement added to KeyWords.cxx: 'LINK_LEXER(lmPB);' // - Statement added to scintilla_vc6.mak: '$(DIR_O)\LexPB.obj: ...\src\LexPB.cxx $(LEX_HEADERS)' // // Copyright for Scintilla: 1998-2001 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include #include #include "Platform.h" #include "PropSet.h" #include "Accessor.h" #include "StyleContext.h" #include "KeyWords.h" #include "Scintilla.h" #include "SciLexer.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif static inline bool IsTypeCharacter(const int ch) { return ch == '%' || ch == '&' || ch == '@' || ch == '!' || ch == '#' || ch == '$' || ch == '?'; } static inline bool IsAWordChar(const int ch) { return (ch < 0x80) && (isalnum(ch) || ch == '.' || ch == '_'); } static inline bool IsAWordStart(const int ch) { return (ch < 0x80) && (isalnum(ch) || ch == '_'); } bool MatchUpperCase(Accessor &styler, int pos, const char *s) //Same as styler.Match() but uppercase comparison (a-z,A-Z and space only) { char ch; for (int i=0; *s; i++) { ch=styler.SafeGetCharAt(pos+i); if (ch > 0x60) ch -= '\x20'; if (*s != ch) return false; s++; } return true; } static void ColourisePBDoc(unsigned int startPos, int length, int initStyle,WordList *keywordlists[],Accessor &styler) { WordList &keywords = *keywordlists[0]; styler.StartAt(startPos); StyleContext sc(startPos, length, initStyle, styler); for (; sc.More(); sc.Forward()) { switch (sc.state) { case SCE_B_OPERATOR: { sc.SetState(SCE_B_DEFAULT); break; } case SCE_B_KEYWORD: { if (!IsAWordChar(sc.ch)) { if (!IsTypeCharacter(sc.ch)) { char s[100]; sc.GetCurrentLowered(s, sizeof(s)); if (keywords.InList(s)) { if (strcmp(s, "rem") == 0) { sc.ChangeState(SCE_B_COMMENT); if (sc.atLineEnd) {sc.SetState(SCE_B_DEFAULT);} } else if (strcmp(s, "asm") == 0) { sc.ChangeState(SCE_B_ASM); if (sc.atLineEnd) {sc.SetState(SCE_B_DEFAULT);} } else { sc.SetState(SCE_B_DEFAULT); } } else { sc.ChangeState(SCE_B_IDENTIFIER); sc.SetState(SCE_B_DEFAULT); } } } break; } case SCE_B_NUMBER: { if (!IsAWordChar(sc.ch)) {sc.SetState(SCE_B_DEFAULT);} break; } case SCE_B_STRING: { if (sc.ch == '\"'){sc.ForwardSetState(SCE_B_DEFAULT);} break; } case SCE_B_CONSTANT: { if (!IsAWordChar(sc.ch)) {sc.SetState(SCE_B_DEFAULT);} break; } case SCE_B_COMMENT: { if (sc.atLineEnd) {sc.SetState(SCE_B_DEFAULT);} break; } case SCE_B_ASM: { if (sc.atLineEnd) {sc.SetState(SCE_B_DEFAULT);} break; } } //switch (sc.state) // Determine if a new state should be entered: if (sc.state == SCE_B_DEFAULT) { if (sc.ch == '\'') {sc.SetState(SCE_B_COMMENT);} else if (sc.ch == '\"') {sc.SetState(SCE_B_STRING);} else if (sc.ch == '&' && tolower(sc.chNext) == 'h') {sc.SetState(SCE_B_NUMBER);} else if (sc.ch == '&' && tolower(sc.chNext) == 'b') {sc.SetState(SCE_B_NUMBER);} else if (sc.ch == '&' && tolower(sc.chNext) == 'o') {sc.SetState(SCE_B_NUMBER);} else if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) {sc.SetState(SCE_B_NUMBER);} else if (IsAWordStart(sc.ch)) {sc.SetState(SCE_B_KEYWORD);} else if (sc.ch == '%') {sc.SetState(SCE_B_CONSTANT);} else if (sc.ch == '$') {sc.SetState(SCE_B_CONSTANT);} else if (sc.ch == '#') {sc.SetState(SCE_B_KEYWORD);} else if (sc.ch == '!') {sc.SetState(SCE_B_ASM);} else if (isoperator(static_cast(sc.ch)) || (sc.ch == '\\')) {sc.SetState(SCE_B_OPERATOR);} } } //for (; sc.More(); sc.Forward()) sc.Complete(); } //The folding routine for PowerBasic toggles SUBs and FUNCTIONs only. This was exactly what I wanted, //nothing more. I had worked with this kind of toggling for several years when I used the great good old //GFA Basic which is dead now. After testing the feature of toggling FOR-NEXT loops, WHILE-WEND loops //and so on too I found this is more disturbing then helping (for me). So if You think in another way //you can (or must) write Your own toggling routine ;-) static void FoldPBDoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler) { // No folding enabled, no reason to continue... if( styler.GetPropertyInt("fold") == 0 ) return; unsigned int endPos = startPos + length; int lineCurrent = styler.GetLine(startPos); int levelCurrent = SC_FOLDLEVELBASE; if (lineCurrent > 0) levelCurrent = styler.LevelAt(lineCurrent-1) >> 16; int levelNext = levelCurrent; char chNext = styler[startPos]; bool fNewLine=true; bool fMightBeMultiLineMacro=false; bool fBeginOfCommentFound=false; for (unsigned int i = startPos; i < endPos; i++) { char ch = chNext; chNext = styler.SafeGetCharAt(i + 1); if (fNewLine) //Begin of a new line (The Sub/Function/Macro keywords may occur at begin of line only) { fNewLine=false; fBeginOfCommentFound=false; switch (ch) { case ' ': //Most lines start with space - so check this first, the code is the same as for 'default:' case '\t': //Handle tab too { int levelUse = levelCurrent; int lev = levelUse | levelNext << 16; styler.SetLevel(lineCurrent, lev); break; } case 'F': case 'f': { switch (chNext) { case 'U': case 'u': { if( MatchUpperCase(styler,i,"FUNCTION") ) { styler.SetLevel(lineCurrent, (SC_FOLDLEVELBASE << 16) | SC_FOLDLEVELHEADERFLAG); levelNext=SC_FOLDLEVELBASE+1; } break; } } break; } case 'S': case 's': { switch (chNext) { case 'U': case 'u': { if( MatchUpperCase(styler,i,"SUB") ) { styler.SetLevel(lineCurrent, (SC_FOLDLEVELBASE << 16) | SC_FOLDLEVELHEADERFLAG); levelNext=SC_FOLDLEVELBASE+1; } break; } case 'T': case 't': { if( MatchUpperCase(styler,i,"STATIC FUNCTION") ) { styler.SetLevel(lineCurrent, (SC_FOLDLEVELBASE << 16) | SC_FOLDLEVELHEADERFLAG); levelNext=SC_FOLDLEVELBASE+1; } else if( MatchUpperCase(styler,i,"STATIC SUB") ) { styler.SetLevel(lineCurrent, (SC_FOLDLEVELBASE << 16) | SC_FOLDLEVELHEADERFLAG); levelNext=SC_FOLDLEVELBASE+1; } break; } } break; } case 'C': case 'c': { switch (chNext) { case 'A': case 'a': { if( MatchUpperCase(styler,i,"CALLBACK FUNCTION") ) { styler.SetLevel(lineCurrent, (SC_FOLDLEVELBASE << 16) | SC_FOLDLEVELHEADERFLAG); levelNext=SC_FOLDLEVELBASE+1; } break; } } break; } case 'M': case 'm': { switch (chNext) { case 'A': case 'a': { if( MatchUpperCase(styler,i,"MACRO") ) { fMightBeMultiLineMacro=true; //Set folder level at end of line, we have to check for single line macro } break; } } break; } default: { int levelUse = levelCurrent; int lev = levelUse | levelNext << 16; styler.SetLevel(lineCurrent, lev); break; } } //switch (ch) } //if( fNewLine ) switch (ch) { case '=': //To test single line macros { if (fBeginOfCommentFound==false) fMightBeMultiLineMacro=false; //The found macro is a single line macro only; break; } case '\'': //A comment starts { fBeginOfCommentFound=true; break; } case '\n': { if (fMightBeMultiLineMacro) //The current line is the begin of a multi line macro { fMightBeMultiLineMacro=false; styler.SetLevel(lineCurrent, (SC_FOLDLEVELBASE << 16) | SC_FOLDLEVELHEADERFLAG); levelNext=SC_FOLDLEVELBASE+1; } lineCurrent++; levelCurrent = levelNext; fNewLine=true; break; } case '\r': { if (chNext != '\n') { lineCurrent++; levelCurrent = levelNext; fNewLine=true; } break; } } //switch (ch) } //for (unsigned int i = startPos; i < endPos; i++) } static const char * const pbWordListDesc[] = { "Keywords", 0 }; LexerModule lmPB(SCLEX_POWERBASIC, ColourisePBDoc, "powerbasic", FoldPBDoc, pbWordListDesc); wxformbuilder-3.1.59/src/controls/src/wxScintilla/scintilla/src/LexPerl.cxx0000644000175000017500000012353111143440026027346 0ustar rrmulderrrmulder// Scintilla source code edit control /** @file LexPerl.cxx ** Lexer for subset of Perl. **/ // Copyright 1998-2005 by Neil Hodgson // Lexical analysis fixes by Kein-Hong Man // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include #include #include "Platform.h" #include "PropSet.h" #include "Accessor.h" #include "KeyWords.h" #include "Scintilla.h" #include "SciLexer.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif #define PERLNUM_BINARY 1 // order is significant: 1-4 cannot have a dot #define PERLNUM_HEX 2 #define PERLNUM_OCTAL 3 #define PERLNUM_FLOAT 4 // actually exponent part #define PERLNUM_DECIMAL 5 // 1-5 are numbers; 6-7 are strings #define PERLNUM_VECTOR 6 #define PERLNUM_V_VECTOR 7 #define PERLNUM_BAD 8 #define BACK_NONE 0 // lookback state for bareword disambiguation: #define BACK_OPERATOR 1 // whitespace/comments are insignificant #define BACK_KEYWORD 2 // operators/keywords are needed for disambiguation #define HERE_DELIM_MAX 256 static inline bool isEOLChar(char ch) { return (ch == '\r') || (ch == '\n'); } static bool isSingleCharOp(char ch) { char strCharSet[2]; strCharSet[0] = ch; strCharSet[1] = '\0'; return (NULL != strstr("rwxoRWXOezsfdlpSbctugkTBMAC", strCharSet)); } static inline bool isPerlOperator(char ch) { if (ch == '^' || ch == '&' || ch == '\\' || ch == '(' || ch == ')' || ch == '-' || ch == '+' || ch == '=' || ch == '|' || ch == '{' || ch == '}' || ch == '[' || ch == ']' || ch == ':' || ch == ';' || ch == '>' || ch == ',' || ch == '?' || ch == '!' || ch == '.' || ch == '~') return true; // these chars are already tested before this call // ch == '%' || ch == '*' || ch == '<' || ch == '/' || return false; } static bool isPerlKeyword(unsigned int start, unsigned int end, WordList &keywords, Accessor &styler) { char s[100]; unsigned int i, len = end - start; if (len > 30) { len = 30; } for (i = 0; i < len; i++, start++) s[i] = styler[start]; s[i] = '\0'; return keywords.InList(s); } // Note: as lexer uses chars, UTF-8 bytes are considered as <0 values // Note: iswordchar() was used in only one place in LexPerl, it is // unnecessary as '.' is processed as the concatenation operator, so // only isWordStart() is used in LexPerl static inline bool isWordStart(char ch) { return !isascii(ch) || isalnum(ch) || ch == '_'; } static inline bool isEndVar(char ch) { return isascii(ch) && !isalnum(ch) && ch != '#' && ch != '$' && ch != '_' && ch != '\''; } static inline bool isNonQuote(char ch) { return !isascii(ch) || isalnum(ch) || ch == '_'; } static inline char actualNumStyle(int numberStyle) { if (numberStyle == PERLNUM_VECTOR || numberStyle == PERLNUM_V_VECTOR) { return SCE_PL_STRING; } else if (numberStyle == PERLNUM_BAD) { return SCE_PL_ERROR; } return SCE_PL_NUMBER; } static bool isMatch(Accessor &styler, int lengthDoc, int pos, const char *val) { if ((pos + static_cast(strlen(val))) >= lengthDoc) { return false; } while (*val) { if (*val != styler[pos++]) { return false; } val++; } return true; } static char opposite(char ch) { if (ch == '(') return ')'; if (ch == '[') return ']'; if (ch == '{') return '}'; if (ch == '<') return '>'; return ch; } static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler) { // Lexer for perl often has to backtrack to start of current style to determine // which characters are being used as quotes, how deeply nested is the // start position and what the termination string is for here documents WordList &keywords = *keywordlists[0]; class HereDocCls { public: int State; // 0: '<<' encountered // 1: collect the delimiter // 2: here doc text (lines after the delimiter) char Quote; // the char after '<<' bool Quoted; // true if Quote in ('\'','"','`') int DelimiterLength; // strlen(Delimiter) char *Delimiter; // the Delimiter, 256: sizeof PL_tokenbuf HereDocCls() { State = 0; Quote = 0; Quoted = false; DelimiterLength = 0; Delimiter = new char[HERE_DELIM_MAX]; Delimiter[0] = '\0'; } ~HereDocCls() { delete []Delimiter; } }; HereDocCls HereDoc; // TODO: FIFO for stacked here-docs class QuoteCls { public: int Rep; int Count; char Up; char Down; QuoteCls() { this->New(1); } void New(int r) { Rep = r; Count = 0; Up = '\0'; Down = '\0'; } void Open(char u) { Count++; Up = u; Down = opposite(Up); } }; QuoteCls Quote; int state = initStyle; char numState = PERLNUM_DECIMAL; int dotCount = 0; unsigned int lengthDoc = startPos + length; //int sookedpos = 0; // these have no apparent use, see POD state //char sooked[100]; //sooked[sookedpos] = '\0'; // If in a long distance lexical state, seek to the beginning to find quote characters // Perl strings can be multi-line with embedded newlines, so backtrack. // Perl numbers have additional state during lexing, so backtrack too. if (state == SCE_PL_HERE_Q || state == SCE_PL_HERE_QQ || state == SCE_PL_HERE_QX) { while ((startPos > 1) && (styler.StyleAt(startPos) != SCE_PL_HERE_DELIM)) { startPos--; } startPos = styler.LineStart(styler.GetLine(startPos)); state = styler.StyleAt(startPos - 1); } if ( state == SCE_PL_STRING_Q || state == SCE_PL_STRING_QQ || state == SCE_PL_STRING_QX || state == SCE_PL_STRING_QR || state == SCE_PL_STRING_QW || state == SCE_PL_REGEX || state == SCE_PL_REGSUBST || state == SCE_PL_STRING || state == SCE_PL_BACKTICKS || state == SCE_PL_CHARACTER || state == SCE_PL_NUMBER || state == SCE_PL_IDENTIFIER || state == SCE_PL_ERROR ) { while ((startPos > 1) && (styler.StyleAt(startPos - 1) == state)) { startPos--; } state = SCE_PL_DEFAULT; } // lookback at start of lexing to set proper state for backflag // after this, they are updated when elements are lexed int backflag = BACK_NONE; unsigned int backPos = startPos; if (backPos > 0) { backPos--; int sty = SCE_PL_DEFAULT; while ((backPos > 0) && (sty = styler.StyleAt(backPos), sty == SCE_PL_DEFAULT || sty == SCE_PL_COMMENTLINE)) backPos--; if (sty == SCE_PL_OPERATOR) backflag = BACK_OPERATOR; else if (sty == SCE_PL_WORD) backflag = BACK_KEYWORD; } styler.StartAt(startPos); char chPrev = styler.SafeGetCharAt(startPos - 1); if (startPos == 0) chPrev = '\n'; char chNext = styler[startPos]; styler.StartSegment(startPos); for (unsigned int i = startPos; i < lengthDoc; i++) { char ch = chNext; // if the current character is not consumed due to the completion of an // earlier style, lexing can be restarted via a simple goto restartLexer: chNext = styler.SafeGetCharAt(i + 1); char chNext2 = styler.SafeGetCharAt(i + 2); if (styler.IsLeadByte(ch)) { chNext = styler.SafeGetCharAt(i + 2); chPrev = ' '; i += 1; continue; } if ((chPrev == '\r' && ch == '\n')) { // skip on DOS/Windows styler.ColourTo(i, state); chPrev = ch; continue; } if (HereDoc.State == 1 && isEOLChar(ch)) { // Begin of here-doc (the line after the here-doc delimiter): // Lexically, the here-doc starts from the next line after the >>, but the // first line of here-doc seem to follow the style of the last EOL sequence HereDoc.State = 2; if (HereDoc.Quoted) { if (state == SCE_PL_HERE_DELIM) { // Missing quote at end of string! We are stricter than perl. // Colour here-doc anyway while marking this bit as an error. state = SCE_PL_ERROR; } styler.ColourTo(i - 1, state); switch (HereDoc.Quote) { case '\'': state = SCE_PL_HERE_Q ; break; case '"': state = SCE_PL_HERE_QQ; break; case '`': state = SCE_PL_HERE_QX; break; } } else { styler.ColourTo(i - 1, state); switch (HereDoc.Quote) { case '\\': state = SCE_PL_HERE_Q ; break; default : state = SCE_PL_HERE_QQ; } } } if (state == SCE_PL_DEFAULT) { if ((isascii(ch) && isdigit(ch)) || (isascii(chNext) && isdigit(chNext) && (ch == '.' || ch == 'v'))) { state = SCE_PL_NUMBER; backflag = BACK_NONE; numState = PERLNUM_DECIMAL; dotCount = 0; if (ch == '0') { // hex,bin,octal if (chNext == 'x') { numState = PERLNUM_HEX; } else if (chNext == 'b') { numState = PERLNUM_BINARY; } else if (isascii(chNext) && isdigit(chNext)) { numState = PERLNUM_OCTAL; } if (numState != PERLNUM_DECIMAL) { i++; ch = chNext; chNext = chNext2; } } else if (ch == 'v') { // vector numState = PERLNUM_V_VECTOR; } } else if (isWordStart(ch)) { // if immediately prefixed by '::', always a bareword state = SCE_PL_WORD; if (chPrev == ':' && styler.SafeGetCharAt(i - 2) == ':') { state = SCE_PL_IDENTIFIER; } unsigned int kw = i + 1; // first check for possible quote-like delimiter if (ch == 's' && !isNonQuote(chNext)) { state = SCE_PL_REGSUBST; Quote.New(2); } else if (ch == 'm' && !isNonQuote(chNext)) { state = SCE_PL_REGEX; Quote.New(1); } else if (ch == 'q' && !isNonQuote(chNext)) { state = SCE_PL_STRING_Q; Quote.New(1); } else if (ch == 'y' && !isNonQuote(chNext)) { state = SCE_PL_REGSUBST; Quote.New(2); } else if (ch == 't' && chNext == 'r' && !isNonQuote(chNext2)) { state = SCE_PL_REGSUBST; Quote.New(2); kw++; } else if (ch == 'q' && (chNext == 'q' || chNext == 'r' || chNext == 'w' || chNext == 'x') && !isNonQuote(chNext2)) { if (chNext == 'q') state = SCE_PL_STRING_QQ; else if (chNext == 'x') state = SCE_PL_STRING_QX; else if (chNext == 'r') state = SCE_PL_STRING_QR; else if (chNext == 'w') state = SCE_PL_STRING_QW; Quote.New(1); kw++; } else if (ch == 'x' && (chNext == '=' || // repetition !isWordStart(chNext) || (isdigit(chPrev) && isdigit(chNext)))) { state = SCE_PL_OPERATOR; } // if potentially a keyword, scan forward and grab word, then check // if it's really one; if yes, disambiguation test is performed // otherwise it is always a bareword and we skip a lot of scanning // note: keywords assumed to be limited to [_a-zA-Z] only if (state == SCE_PL_WORD) { while (isWordStart(styler.SafeGetCharAt(kw))) kw++; if (!isPerlKeyword(styler.GetStartSegment(), kw, keywords, styler)) { state = SCE_PL_IDENTIFIER; } } // if already SCE_PL_IDENTIFIER, then no ambiguity, skip this // for quote-like delimiters/keywords, attempt to disambiguate // to select for bareword, change state -> SCE_PL_IDENTIFIER if (state != SCE_PL_IDENTIFIER && i > 0) { unsigned int j = i; bool moreback = false; // true if passed newline/comments bool brace = false; // true if opening brace found char ch2; // first look backwards past whitespace/comments for EOLs // if BACK_NONE, neither operator nor keyword, so skip test if (backflag != BACK_NONE) { while (--j > backPos) { if (isEOLChar(styler.SafeGetCharAt(j))) moreback = true; } ch2 = styler.SafeGetCharAt(j); if (ch2 == '{' && !moreback) { // {bareword: possible variable spec brace = true; } else if ((ch2 == '&' && styler.SafeGetCharAt(j - 1) != '&') // &bareword: subroutine call || (ch2 == '>' && styler.SafeGetCharAt(j - 1) == '-') // ->bareword: part of variable spec || (ch2 == 'b' && styler.Match(j - 2, "su"))) { // sub bareword: subroutine declaration // (implied BACK_KEYWORD, no keywords end in 'sub'!) state = SCE_PL_IDENTIFIER; } // if status still ambiguous, look forward after word past // tabs/spaces only; if ch2 isn't one of '[{(,' it can never // match anything, so skip the whole thing j = kw; if (state != SCE_PL_IDENTIFIER && (ch2 == '{' || ch2 == '(' || ch2 == '['|| ch2 == ',') && kw < lengthDoc) { while (ch2 = styler.SafeGetCharAt(j), (ch2 == ' ' || ch2 == '\t') && j < lengthDoc) { j++; } if ((ch2 == '}' && brace) // {bareword}: variable spec || (ch2 == '=' && styler.SafeGetCharAt(j + 1) == '>')) { // [{(, bareword=>: hash literal state = SCE_PL_IDENTIFIER; } } } } backflag = BACK_NONE; // an identifier or bareword if (state == SCE_PL_IDENTIFIER) { if ((!isWordStart(chNext) && chNext != '\'') || (chNext == '.' && chNext2 == '.')) { // We need that if length of word == 1! // This test is copied from the SCE_PL_WORD handler. styler.ColourTo(i, SCE_PL_IDENTIFIER); state = SCE_PL_DEFAULT; } // a keyword } else if (state == SCE_PL_WORD) { i = kw - 1; if (ch == '_' && chNext == '_' && (isMatch(styler, lengthDoc, styler.GetStartSegment(), "__DATA__") || isMatch(styler, lengthDoc, styler.GetStartSegment(), "__END__"))) { styler.ColourTo(i, SCE_PL_DATASECTION); state = SCE_PL_DATASECTION; } else { styler.ColourTo(i, SCE_PL_WORD); state = SCE_PL_DEFAULT; backflag = BACK_KEYWORD; backPos = i; } ch = styler.SafeGetCharAt(i); chNext = styler.SafeGetCharAt(i + 1); // a repetition operator 'x' } else if (state == SCE_PL_OPERATOR) { styler.ColourTo(i, SCE_PL_OPERATOR); state = SCE_PL_DEFAULT; // quote-like delimiter, skip one char if double-char delimiter } else { i = kw - 1; chNext = styler.SafeGetCharAt(i + 1); } } else if (ch == '#') { state = SCE_PL_COMMENTLINE; } else if (ch == '\"') { state = SCE_PL_STRING; Quote.New(1); Quote.Open(ch); backflag = BACK_NONE; } else if (ch == '\'') { if (chPrev == '&') { // Archaic call styler.ColourTo(i, state); } else { state = SCE_PL_CHARACTER; Quote.New(1); Quote.Open(ch); } backflag = BACK_NONE; } else if (ch == '`') { state = SCE_PL_BACKTICKS; Quote.New(1); Quote.Open(ch); backflag = BACK_NONE; } else if (ch == '$') { if ((chNext == '{') || isspacechar(chNext)) { styler.ColourTo(i, SCE_PL_SCALAR); } else { state = SCE_PL_SCALAR; if ((chNext == '`' && chNext2 == '`') || (chNext == ':' && chNext2 == ':')) { i += 2; ch = styler.SafeGetCharAt(i); chNext = styler.SafeGetCharAt(i + 1); } else { i++; ch = chNext; chNext = chNext2; } } backflag = BACK_NONE; } else if (ch == '@') { if (!isascii(chNext) || isalpha(chNext) || chNext == '#' || chNext == '$' || chNext == '_' || chNext == '+' || chNext == '-') { state = SCE_PL_ARRAY; } else if (chNext == ':' && chNext2 == ':') { state = SCE_PL_ARRAY; i += 2; ch = styler.SafeGetCharAt(i); chNext = styler.SafeGetCharAt(i + 1); } else if (chNext != '{' && chNext != '[') { styler.ColourTo(i, SCE_PL_ARRAY); } else { styler.ColourTo(i, SCE_PL_ARRAY); } backflag = BACK_NONE; } else if (ch == '%') { if (!isascii(chNext) || isalpha(chNext) || chNext == '#' || chNext == '$' || chNext == '_' || chNext == '!' || chNext == '^') { state = SCE_PL_HASH; i++; ch = chNext; chNext = chNext2; } else if (chNext == ':' && chNext2 == ':') { state = SCE_PL_HASH; i += 2; ch = styler.SafeGetCharAt(i); chNext = styler.SafeGetCharAt(i + 1); } else if (chNext == '{') { styler.ColourTo(i, SCE_PL_HASH); } else { styler.ColourTo(i, SCE_PL_OPERATOR); } backflag = BACK_NONE; } else if (ch == '*') { char strch[2]; strch[0] = chNext; strch[1] = '\0'; if (chNext == ':' && chNext2 == ':') { state = SCE_PL_SYMBOLTABLE; i += 2; ch = styler.SafeGetCharAt(i); chNext = styler.SafeGetCharAt(i + 1); } else if (!isascii(chNext) || isalpha(chNext) || chNext == '_' || NULL != strstr("^/|,\\\";#%^:?<>)[]", strch)) { state = SCE_PL_SYMBOLTABLE; i++; ch = chNext; chNext = chNext2; } else if (chNext == '{') { styler.ColourTo(i, SCE_PL_SYMBOLTABLE); } else { if (chNext == '*') { // exponentiation i++; ch = chNext; chNext = chNext2; } styler.ColourTo(i, SCE_PL_OPERATOR); } backflag = BACK_NONE; } else if (ch == '/' || (ch == '<' && chNext == '<')) { // Explicit backward peeking to set a consistent preferRE for // any slash found, so no longer need to track preferRE state. // Find first previous significant lexed element and interpret. // Test for HERE doc start '<<' shares this code, helps to // determine if it should be an operator. bool preferRE = false; bool isHereDoc = (ch == '<'); bool hereDocSpace = false; // these are for corner case: bool hereDocScalar = false; // SCALAR [whitespace] '<<' unsigned int bk = (i > 0)? i - 1: 0; char bkch; styler.Flush(); if (styler.StyleAt(bk) == SCE_PL_DEFAULT) hereDocSpace = true; while ((bk > 0) && (styler.StyleAt(bk) == SCE_PL_DEFAULT || styler.StyleAt(bk) == SCE_PL_COMMENTLINE)) { bk--; } if (bk == 0) { // position 0 won't really be checked; rarely happens // hard to fix due to an unsigned index i preferRE = true; } else { int bkstyle = styler.StyleAt(bk); bkch = styler.SafeGetCharAt(bk); switch(bkstyle) { case SCE_PL_OPERATOR: preferRE = true; if (bkch == ')' || bkch == ']') { preferRE = false; } else if (bkch == '}') { // backtrack further, count balanced brace pairs // if a brace pair found, see if it's a variable int braceCount = 1; while (--bk > 0) { bkstyle = styler.StyleAt(bk); if (bkstyle == SCE_PL_OPERATOR) { bkch = styler.SafeGetCharAt(bk); if (bkch == ';') { // early out break; } else if (bkch == '}') { braceCount++; } else if (bkch == '{') { if (--braceCount == 0) break; } } } if (bk == 0) { // at beginning, true } else if (braceCount == 0) { // balanced { found, bk>0, skip more whitespace if (styler.StyleAt(--bk) == SCE_PL_DEFAULT) { while (bk > 0) { bkstyle = styler.StyleAt(--bk); if (bkstyle != SCE_PL_DEFAULT) break; } } bkstyle = styler.StyleAt(bk); if (bkstyle == SCE_PL_SCALAR || bkstyle == SCE_PL_ARRAY || bkstyle == SCE_PL_HASH || bkstyle == SCE_PL_SYMBOLTABLE || bkstyle == SCE_PL_OPERATOR) { preferRE = false; } } } break; case SCE_PL_IDENTIFIER: preferRE = true; if (bkch == '>') { // inputsymbol preferRE = false; break; } // backtrack to find "->" or "::" before identifier while (bk > 0 && styler.StyleAt(bk) == SCE_PL_IDENTIFIER) { bk--; } while (bk > 0) { bkstyle = styler.StyleAt(bk); if (bkstyle == SCE_PL_DEFAULT || bkstyle == SCE_PL_COMMENTLINE) { } else if (bkstyle == SCE_PL_OPERATOR) { // gcc 3.2.3 bloats if more compact form used bkch = styler.SafeGetCharAt(bk); if (bkch == '>') { // "->" if (styler.SafeGetCharAt(bk - 1) == '-') { preferRE = false; break; } } else if (bkch == ':') { // "::" if (styler.SafeGetCharAt(bk - 1) == ':') { preferRE = false; break; } } } else {// bare identifier, usually a function call but Perl // optimizes them as pseudo-constants, then the next // '/' will be a divide; favour divide over regex // if there is a whitespace after the '/' if (isspacechar(chNext)) { preferRE = false; } break; } bk--; } break; case SCE_PL_SCALAR: // for $var<< case hereDocScalar = true; break; // other styles uses the default, preferRE=false case SCE_PL_WORD: case SCE_PL_POD: case SCE_PL_POD_VERB: case SCE_PL_HERE_Q: case SCE_PL_HERE_QQ: case SCE_PL_HERE_QX: preferRE = true; break; } } if (isHereDoc) { // handle HERE doc // if SCALAR whitespace '<<', *always* a HERE doc if (preferRE || (hereDocSpace && hereDocScalar)) { state = SCE_PL_HERE_DELIM; HereDoc.State = 0; } else { // << operator i++; ch = chNext; chNext = chNext2; styler.ColourTo(i, SCE_PL_OPERATOR); } } else { // handle regexp if (preferRE) { state = SCE_PL_REGEX; Quote.New(1); Quote.Open(ch); } else { // / operator styler.ColourTo(i, SCE_PL_OPERATOR); } } backflag = BACK_NONE; } else if (ch == '<') { // looks forward for matching > on same line unsigned int fw = i + 1; while (fw < lengthDoc) { char fwch = styler.SafeGetCharAt(fw); if (fwch == ' ') { if (styler.SafeGetCharAt(fw-1) != '\\' || styler.SafeGetCharAt(fw-2) != '\\') break; } else if (isEOLChar(fwch) || isspacechar(fwch)) { break; } else if (fwch == '>') { if ((fw - i) == 2 && // '<=>' case styler.SafeGetCharAt(fw-1) == '=') { styler.ColourTo(fw, SCE_PL_OPERATOR); } else { styler.ColourTo(fw, SCE_PL_IDENTIFIER); } i = fw; ch = fwch; chNext = styler.SafeGetCharAt(i+1); } fw++; } styler.ColourTo(i, SCE_PL_OPERATOR); backflag = BACK_NONE; } else if (ch == '=' // POD && isalpha(chNext) && (isEOLChar(chPrev))) { state = SCE_PL_POD; backflag = BACK_NONE; //sookedpos = 0; //sooked[sookedpos] = '\0'; } else if (ch == '-' // file test operators && isSingleCharOp(chNext) && !isalnum((chNext2 = styler.SafeGetCharAt(i+2)))) { styler.ColourTo(i + 1, SCE_PL_WORD); state = SCE_PL_DEFAULT; i++; ch = chNext; chNext = chNext2; backflag = BACK_NONE; } else if (isPerlOperator(ch)) { if (ch == '.' && chNext == '.') { // .. and ... i++; if (chNext2 == '.') { i++; } state = SCE_PL_DEFAULT; ch = styler.SafeGetCharAt(i); chNext = styler.SafeGetCharAt(i + 1); } styler.ColourTo(i, SCE_PL_OPERATOR); backflag = BACK_OPERATOR; backPos = i; } else { // keep colouring defaults to make restart easier styler.ColourTo(i, SCE_PL_DEFAULT); } } else if (state == SCE_PL_NUMBER) { if (ch == '.') { if (chNext == '.') { // double dot is always an operator goto numAtEnd; } else if (numState <= PERLNUM_FLOAT) { // non-decimal number or float exponent, consume next dot styler.ColourTo(i - 1, SCE_PL_NUMBER); styler.ColourTo(i, SCE_PL_OPERATOR); state = SCE_PL_DEFAULT; } else { // decimal or vectors allows dots dotCount++; if (numState == PERLNUM_DECIMAL) { if (dotCount > 1) { if (isdigit(chNext)) { // really a vector numState = PERLNUM_VECTOR; } else // number then dot goto numAtEnd; } } else { // vectors if (!isdigit(chNext)) // vector then dot goto numAtEnd; } } } else if (ch == '_' && numState == PERLNUM_DECIMAL) { if (!isdigit(chNext)) { goto numAtEnd; } } else if (!isascii(ch) || isalnum(ch)) { if (numState == PERLNUM_VECTOR || numState == PERLNUM_V_VECTOR) { if (!isascii(ch) || isalpha(ch)) { if (dotCount == 0) { // change to word state = SCE_PL_IDENTIFIER; } else { // vector then word goto numAtEnd; } } } else if (numState == PERLNUM_DECIMAL) { if (ch == 'E' || ch == 'e') { // exponent numState = PERLNUM_FLOAT; if (chNext == '+' || chNext == '-') { i++; ch = chNext; chNext = chNext2; } } else if (!isascii(ch) || !isdigit(ch)) { // number then word goto numAtEnd; } } else if (numState == PERLNUM_FLOAT) { if (!isdigit(ch)) { // float then word goto numAtEnd; } } else if (numState == PERLNUM_OCTAL) { if (!isdigit(ch)) goto numAtEnd; else if (ch > '7') numState = PERLNUM_BAD; } else if (numState == PERLNUM_BINARY) { if (!isdigit(ch)) goto numAtEnd; else if (ch > '1') numState = PERLNUM_BAD; } else if (numState == PERLNUM_HEX) { int ch2 = toupper(ch); if (!isdigit(ch) && !(ch2 >= 'A' && ch2 <= 'F')) goto numAtEnd; } else {//(numState == PERLNUM_BAD) { if (!isdigit(ch)) goto numAtEnd; } } else { // complete current number or vector numAtEnd: styler.ColourTo(i - 1, actualNumStyle(numState)); state = SCE_PL_DEFAULT; goto restartLexer; } } else if (state == SCE_PL_IDENTIFIER) { if (!isWordStart(chNext) && chNext != '\'') { styler.ColourTo(i, SCE_PL_IDENTIFIER); state = SCE_PL_DEFAULT; ch = ' '; } } else { if (state == SCE_PL_COMMENTLINE) { if (isEOLChar(ch)) { styler.ColourTo(i - 1, state); state = SCE_PL_DEFAULT; goto restartLexer; } else if (isEOLChar(chNext)) { styler.ColourTo(i, state); state = SCE_PL_DEFAULT; } } else if (state == SCE_PL_HERE_DELIM) { // // From perldata.pod: // ------------------ // A line-oriented form of quoting is based on the shell ``here-doc'' // syntax. // Following a << you specify a string to terminate the quoted material, // and all lines following the current line down to the terminating // string are the value of the item. // The terminating string may be either an identifier (a word), // or some quoted text. // If quoted, the type of quotes you use determines the treatment of // the text, just as in regular quoting. // An unquoted identifier works like double quotes. // There must be no space between the << and the identifier. // (If you put a space it will be treated as a null identifier, // which is valid, and matches the first empty line.) // (This is deprecated, -w warns of this syntax) // The terminating string must appear by itself (unquoted and with no // surrounding whitespace) on the terminating line. // // From Bash info: // --------------- // Specifier format is: <<[-]WORD // Optional '-' is for removal of leading tabs from here-doc. // Whitespace acceptable after <<[-] operator. // if (HereDoc.State == 0) { // '<<' encountered bool gotspace = false; unsigned int oldi = i; if (chNext == ' ' || chNext == '\t') { // skip whitespace; legal for quoted delimiters gotspace = true; do { i++; chNext = styler.SafeGetCharAt(i + 1); } while ((i + 1 < lengthDoc) && (chNext == ' ' || chNext == '\t')); chNext2 = styler.SafeGetCharAt(i + 2); } HereDoc.State = 1; HereDoc.Quote = chNext; HereDoc.Quoted = false; HereDoc.DelimiterLength = 0; HereDoc.Delimiter[HereDoc.DelimiterLength] = '\0'; if (chNext == '\'' || chNext == '"' || chNext == '`') { // a quoted here-doc delimiter i++; ch = chNext; chNext = chNext2; HereDoc.Quoted = true; } else if (isspacechar(chNext) || isdigit(chNext) || chNext == '\\' || chNext == '=' || chNext == '$' || chNext == '@' || ((isalpha(chNext) || chNext == '_') && gotspace)) { // left shift << or <<= operator cases // restore position if operator i = oldi; styler.ColourTo(i, SCE_PL_OPERATOR); state = SCE_PL_DEFAULT; HereDoc.State = 0; goto restartLexer; } else { // an unquoted here-doc delimiter, no special handling // (cannot be prefixed by spaces/tabs), or // symbols terminates; deprecated zero-length delimiter } } else if (HereDoc.State == 1) { // collect the delimiter backflag = BACK_NONE; if (HereDoc.Quoted) { // a quoted here-doc delimiter if (ch == HereDoc.Quote) { // closing quote => end of delimiter styler.ColourTo(i, state); state = SCE_PL_DEFAULT; } else { if (ch == '\\' && chNext == HereDoc.Quote) { // escaped quote i++; ch = chNext; chNext = chNext2; } HereDoc.Delimiter[HereDoc.DelimiterLength++] = ch; HereDoc.Delimiter[HereDoc.DelimiterLength] = '\0'; } } else { // an unquoted here-doc delimiter if (isalnum(ch) || ch == '_') { HereDoc.Delimiter[HereDoc.DelimiterLength++] = ch; HereDoc.Delimiter[HereDoc.DelimiterLength] = '\0'; } else { styler.ColourTo(i - 1, state); state = SCE_PL_DEFAULT; goto restartLexer; } } if (HereDoc.DelimiterLength >= HERE_DELIM_MAX - 1) { styler.ColourTo(i - 1, state); state = SCE_PL_ERROR; goto restartLexer; } } } else if (HereDoc.State == 2) { // state == SCE_PL_HERE_Q || state == SCE_PL_HERE_QQ || state == SCE_PL_HERE_QX if (isEOLChar(chPrev) && isMatch(styler, lengthDoc, i, HereDoc.Delimiter)) { i += HereDoc.DelimiterLength; chPrev = styler.SafeGetCharAt(i - 1); ch = styler.SafeGetCharAt(i); if (isEOLChar(ch)) { styler.ColourTo(i - 1, state); state = SCE_PL_DEFAULT; backflag = BACK_NONE; HereDoc.State = 0; goto restartLexer; } chNext = styler.SafeGetCharAt(i + 1); } } else if (state == SCE_PL_POD || state == SCE_PL_POD_VERB) { if (isEOLChar(chPrev)) { if (ch == ' ' || ch == '\t') { styler.ColourTo(i - 1, state); state = SCE_PL_POD_VERB; } else { styler.ColourTo(i - 1, state); state = SCE_PL_POD; if (ch == '=') { if (isMatch(styler, lengthDoc, i, "=cut")) { styler.ColourTo(i - 1 + 4, state); i += 4; state = SCE_PL_DEFAULT; ch = styler.SafeGetCharAt(i); //chNext = styler.SafeGetCharAt(i + 1); goto restartLexer; } } } } } else if (state == SCE_PL_SCALAR // variable names || state == SCE_PL_ARRAY || state == SCE_PL_HASH || state == SCE_PL_SYMBOLTABLE) { if (ch == ':' && chNext == ':') { // skip :: i++; ch = chNext; chNext = chNext2; } else if (isEndVar(ch)) { if (i == (styler.GetStartSegment() + 1)) { // Special variable: $(, $_ etc. styler.ColourTo(i, state); state = SCE_PL_DEFAULT; } else { styler.ColourTo(i - 1, state); state = SCE_PL_DEFAULT; goto restartLexer; } } } else if (state == SCE_PL_REGEX || state == SCE_PL_STRING_QR ) { if (!Quote.Up && !isspacechar(ch)) { Quote.Open(ch); } else if (ch == '\\' && Quote.Up != '\\') { // SG: Is it save to skip *every* escaped char? i++; ch = chNext; chNext = styler.SafeGetCharAt(i + 1); } else { if (ch == Quote.Down /*&& chPrev != '\\'*/) { Quote.Count--; if (Quote.Count == 0) { Quote.Rep--; if (Quote.Up == Quote.Down) { Quote.Count++; } } if (!isalpha(chNext)) { if (Quote.Rep <= 0) { styler.ColourTo(i, state); state = SCE_PL_DEFAULT; ch = ' '; } } } else if (ch == Quote.Up /*&& chPrev != '\\'*/) { Quote.Count++; } else if (!isascii(chNext) || !isalpha(chNext)) { if (Quote.Rep <= 0) { styler.ColourTo(i, state); state = SCE_PL_DEFAULT; ch = ' '; } } } } else if (state == SCE_PL_REGSUBST) { if (!Quote.Up && !isspacechar(ch)) { Quote.Open(ch); } else if (ch == '\\' && Quote.Up != '\\') { // SG: Is it save to skip *every* escaped char? i++; ch = chNext; chNext = styler.SafeGetCharAt(i + 1); } else { if (Quote.Count == 0 && Quote.Rep == 1) { /* We matched something like s(...) or tr{...} * and are looking for the next matcher characters, * which could be either bracketed ({...}) or non-bracketed * (/.../). * * Number-signs are problematic. If they occur after * the close of the first part, treat them like * a Quote.Up char, even if they actually start comments. * * If we find an alnum, we end the regsubst, and punt. * * Eric Promislow ericp@activestate.com Aug 9,2000 */ if (isspacechar(ch)) { // Keep going } else if (!isascii(ch) || isalnum(ch)) { styler.ColourTo(i, state); state = SCE_PL_DEFAULT; ch = ' '; } else { Quote.Open(ch); } } else if (ch == Quote.Down /*&& chPrev != '\\'*/) { Quote.Count--; if (Quote.Count == 0) { Quote.Rep--; } if (!isascii(chNext) || !isalpha(chNext)) { if (Quote.Rep <= 0) { styler.ColourTo(i, state); state = SCE_PL_DEFAULT; ch = ' '; } } if (Quote.Up == Quote.Down) { Quote.Count++; } } else if (ch == Quote.Up /*&& chPrev != '\\'*/) { Quote.Count++; } else if (!isascii(chNext) || !isalpha(chNext)) { if (Quote.Rep <= 0) { styler.ColourTo(i, state); state = SCE_PL_DEFAULT; ch = ' '; } } } } else if (state == SCE_PL_STRING_Q || state == SCE_PL_STRING_QQ || state == SCE_PL_STRING_QX || state == SCE_PL_STRING_QW || state == SCE_PL_STRING || state == SCE_PL_CHARACTER || state == SCE_PL_BACKTICKS ) { if (!Quote.Down && !isspacechar(ch)) { Quote.Open(ch); } else if (ch == '\\' && Quote.Up != '\\') { i++; ch = chNext; chNext = styler.SafeGetCharAt(i + 1); } else if (ch == Quote.Down) { Quote.Count--; if (Quote.Count == 0) { Quote.Rep--; if (Quote.Rep <= 0) { styler.ColourTo(i, state); state = SCE_PL_DEFAULT; ch = ' '; } if (Quote.Up == Quote.Down) { Quote.Count++; } } } else if (ch == Quote.Up) { Quote.Count++; } } } if (state == SCE_PL_ERROR) { break; } chPrev = ch; } styler.ColourTo(lengthDoc - 1, state); } static bool IsCommentLine(int line, Accessor &styler) { int pos = styler.LineStart(line); int eol_pos = styler.LineStart(line + 1) - 1; for (int i = pos; i < eol_pos; i++) { char ch = styler[i]; int style = styler.StyleAt(i); if (ch == '#' && style == SCE_PL_COMMENTLINE) return true; else if (ch != ' ' && ch != '\t') return false; } return false; } static void FoldPerlDoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler) { bool foldComment = styler.GetPropertyInt("fold.comment") != 0; bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0; // Custom folding of POD and packages bool foldPOD = styler.GetPropertyInt("fold.perl.pod", 1) != 0; bool foldPackage = styler.GetPropertyInt("fold.perl.package", 1) != 0; unsigned int endPos = startPos + length; int visibleChars = 0; int lineCurrent = styler.GetLine(startPos); int levelPrev = SC_FOLDLEVELBASE; if (lineCurrent > 0) levelPrev = styler.LevelAt(lineCurrent - 1) >> 16; int levelCurrent = levelPrev; char chNext = styler[startPos]; char chPrev = styler.SafeGetCharAt(startPos - 1); int styleNext = styler.StyleAt(startPos); // Used at end of line to determine if the line was a package definition bool isPackageLine = false; bool isPodHeading = false; for (unsigned int i = startPos; i < endPos; i++) { char ch = chNext; chNext = styler.SafeGetCharAt(i + 1); int style = styleNext; styleNext = styler.StyleAt(i + 1); bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n'); bool atLineStart = isEOLChar(chPrev) || i == 0; // Comment folding if (foldComment && atEOL && IsCommentLine(lineCurrent, styler)) { if (!IsCommentLine(lineCurrent - 1, styler) && IsCommentLine(lineCurrent + 1, styler)) levelCurrent++; else if (IsCommentLine(lineCurrent - 1, styler) && !IsCommentLine(lineCurrent+1, styler)) levelCurrent--; } if (style == SCE_C_OPERATOR) { if (ch == '{') { levelCurrent++; } else if (ch == '}') { levelCurrent--; } } // Custom POD folding if (foldPOD && atLineStart) { int stylePrevCh = (i) ? styler.StyleAt(i - 1):SCE_PL_DEFAULT; if (style == SCE_PL_POD) { if (stylePrevCh != SCE_PL_POD && stylePrevCh != SCE_PL_POD_VERB) levelCurrent++; else if (styler.Match(i, "=cut")) levelCurrent--; else if (styler.Match(i, "=head")) isPodHeading = true; } else if (style == SCE_PL_DATASECTION) { if (ch == '=' && isalpha(chNext) && levelCurrent == SC_FOLDLEVELBASE) levelCurrent++; else if (styler.Match(i, "=cut") && levelCurrent > SC_FOLDLEVELBASE) levelCurrent--; else if (styler.Match(i, "=head")) isPodHeading = true; // if package used or unclosed brace, level > SC_FOLDLEVELBASE! // reset needed as level test is vs. SC_FOLDLEVELBASE else if (styler.Match(i, "__END__")) levelCurrent = SC_FOLDLEVELBASE; } } // Custom package folding if (foldPackage && atLineStart) { if (style == SCE_PL_WORD && styler.Match(i, "package")) { isPackageLine = true; } } if (atEOL) { int lev = levelPrev; if (isPodHeading) { lev = levelPrev - 1; lev |= SC_FOLDLEVELHEADERFLAG; isPodHeading = false; } // Check if line was a package declaration // because packages need "special" treatment if (isPackageLine) { lev = SC_FOLDLEVELBASE | SC_FOLDLEVELHEADERFLAG; levelCurrent = SC_FOLDLEVELBASE + 1; isPackageLine = false; } lev |= levelCurrent << 16; if (visibleChars == 0 && foldCompact) lev |= SC_FOLDLEVELWHITEFLAG; if ((levelCurrent > levelPrev) && (visibleChars > 0)) lev |= SC_FOLDLEVELHEADERFLAG; if (lev != styler.LevelAt(lineCurrent)) { styler.SetLevel(lineCurrent, lev); } lineCurrent++; levelPrev = levelCurrent; visibleChars = 0; } if (!isspacechar(ch)) visibleChars++; chPrev = ch; } // Fill in the real level of the next line, keeping the current flags as they will be filled in later int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK; styler.SetLevel(lineCurrent, levelPrev | flagsNext); } static const char * const perlWordListDesc[] = { "Keywords", 0 }; LexerModule lmPerl(SCLEX_PERL, ColourisePerlDoc, "perl", FoldPerlDoc, perlWordListDesc); wxformbuilder-3.1.59/src/controls/src/wxScintilla/scintilla/src/LexHTML.cxx0000644000175000017500000017413011143440026027211 0ustar rrmulderrrmulder// Scintilla source code edit control /** @file LexHTML.cxx ** Lexer for HTML. **/ // Copyright 1998-2005 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include #include #include "Platform.h" #include "PropSet.h" #include "Accessor.h" #include "StyleContext.h" #include "KeyWords.h" #include "Scintilla.h" #include "SciLexer.h" #include "CharacterSet.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif #define SCE_HA_JS (SCE_HJA_START - SCE_HJ_START) #define SCE_HA_VBS (SCE_HBA_START - SCE_HB_START) #define SCE_HA_PYTHON (SCE_HPA_START - SCE_HP_START) enum script_type { eScriptNone = 0, eScriptJS, eScriptVBS, eScriptPython, eScriptPHP, eScriptXML, eScriptSGML, eScriptSGMLblock }; enum script_mode { eHtml = 0, eNonHtmlScript, eNonHtmlPreProc, eNonHtmlScriptPreProc }; static inline bool IsAWordChar(const int ch) { return (ch < 0x80) && (isalnum(ch) || ch == '.' || ch == '_'); } static inline bool IsAWordStart(const int ch) { return (ch < 0x80) && (isalnum(ch) || ch == '_'); } static inline int MakeLowerCase(int ch) { if (ch < 'A' || ch > 'Z') return ch; else return ch - 'A' + 'a'; } static void GetTextSegment(Accessor &styler, unsigned int start, unsigned int end, char *s, size_t len) { size_t i = 0; for (; (i < end - start + 1) && (i < len-1); i++) { s[i] = static_cast(MakeLowerCase(styler[start + i])); } s[i] = '\0'; } static script_type segIsScriptingIndicator(Accessor &styler, unsigned int start, unsigned int end, script_type prevValue) { char s[100]; GetTextSegment(styler, start, end, s, sizeof(s)); //Platform::DebugPrintf("Scripting indicator [%s]\n", s); if (strstr(s, "src")) // External script return eScriptNone; if (strstr(s, "vbs")) return eScriptVBS; if (strstr(s, "pyth")) return eScriptPython; if (strstr(s, "javas")) return eScriptJS; if (strstr(s, "jscr")) return eScriptJS; if (strstr(s, "php")) return eScriptPHP; if (strstr(s, "xml")) return eScriptXML; return prevValue; } static int PrintScriptingIndicatorOffset(Accessor &styler, unsigned int start, unsigned int end) { int iResult = 0; char s[100]; GetTextSegment(styler, start, end, s, sizeof(s)); if (0 == strncmp(s, "php", 3)) { iResult = 3; } return iResult; } static script_type ScriptOfState(int state) { if ((state >= SCE_HP_START) && (state <= SCE_HP_IDENTIFIER)) { return eScriptPython; } else if ((state >= SCE_HB_START) && (state <= SCE_HB_STRINGEOL)) { return eScriptVBS; } else if ((state >= SCE_HJ_START) && (state <= SCE_HJ_REGEX)) { return eScriptJS; } else if ((state >= SCE_HPHP_DEFAULT) && (state <= SCE_HPHP_COMMENTLINE)) { return eScriptPHP; } else if ((state >= SCE_H_SGML_DEFAULT) && (state < SCE_H_SGML_BLOCK_DEFAULT)) { return eScriptSGML; } else if (state == SCE_H_SGML_BLOCK_DEFAULT) { return eScriptSGMLblock; } else { return eScriptNone; } } static int statePrintForState(int state, script_mode inScriptType) { int StateToPrint = state; if (state >= SCE_HJ_START) { if ((state >= SCE_HP_START) && (state <= SCE_HP_IDENTIFIER)) { StateToPrint = state + ((inScriptType == eNonHtmlScript) ? 0 : SCE_HA_PYTHON); } else if ((state >= SCE_HB_START) && (state <= SCE_HB_STRINGEOL)) { StateToPrint = state + ((inScriptType == eNonHtmlScript) ? 0 : SCE_HA_VBS); } else if ((state >= SCE_HJ_START) && (state <= SCE_HJ_REGEX)) { StateToPrint = state + ((inScriptType == eNonHtmlScript) ? 0 : SCE_HA_JS); } } return StateToPrint; } static int stateForPrintState(int StateToPrint) { int state; if ((StateToPrint >= SCE_HPA_START) && (StateToPrint <= SCE_HPA_IDENTIFIER)) { state = StateToPrint - SCE_HA_PYTHON; } else if ((StateToPrint >= SCE_HBA_START) && (StateToPrint <= SCE_HBA_STRINGEOL)) { state = StateToPrint - SCE_HA_VBS; } else if ((StateToPrint >= SCE_HJA_START) && (StateToPrint <= SCE_HJA_REGEX)) { state = StateToPrint - SCE_HA_JS; } else { state = StateToPrint; } return state; } static inline bool IsNumber(unsigned int start, Accessor &styler) { return IsADigit(styler[start]) || (styler[start] == '.') || (styler[start] == '-') || (styler[start] == '#'); } static inline bool isStringState(int state) { bool bResult; switch (state) { case SCE_HJ_DOUBLESTRING: case SCE_HJ_SINGLESTRING: case SCE_HJA_DOUBLESTRING: case SCE_HJA_SINGLESTRING: case SCE_HB_STRING: case SCE_HBA_STRING: case SCE_HP_STRING: case SCE_HP_CHARACTER: case SCE_HP_TRIPLE: case SCE_HP_TRIPLEDOUBLE: case SCE_HPA_STRING: case SCE_HPA_CHARACTER: case SCE_HPA_TRIPLE: case SCE_HPA_TRIPLEDOUBLE: case SCE_HPHP_HSTRING: case SCE_HPHP_SIMPLESTRING: case SCE_HPHP_HSTRING_VARIABLE: case SCE_HPHP_COMPLEX_VARIABLE: bResult = true; break; default : bResult = false; break; } return bResult; } static inline bool stateAllowsTermination(int state) { bool allowTermination = !isStringState(state); if (allowTermination) { switch (state) { case SCE_HB_COMMENTLINE: case SCE_HPHP_COMMENT: case SCE_HP_COMMENTLINE: case SCE_HPA_COMMENTLINE: allowTermination = false; } } return allowTermination; } // not really well done, since it's only comments that should lex the %> and <% static inline bool isCommentASPState(int state) { bool bResult; switch (state) { case SCE_HJ_COMMENT: case SCE_HJ_COMMENTLINE: case SCE_HJ_COMMENTDOC: case SCE_HB_COMMENTLINE: case SCE_HP_COMMENTLINE: case SCE_HPHP_COMMENT: case SCE_HPHP_COMMENTLINE: bResult = true; break; default : bResult = false; break; } return bResult; } static void classifyAttribHTML(unsigned int start, unsigned int end, WordList &keywords, Accessor &styler) { bool wordIsNumber = IsNumber(start, styler); char chAttr = SCE_H_ATTRIBUTEUNKNOWN; if (wordIsNumber) { chAttr = SCE_H_NUMBER; } else { char s[100]; GetTextSegment(styler, start, end, s, sizeof(s)); if (keywords.InList(s)) chAttr = SCE_H_ATTRIBUTE; } if ((chAttr == SCE_H_ATTRIBUTEUNKNOWN) && !keywords) // No keywords -> all are known chAttr = SCE_H_ATTRIBUTE; styler.ColourTo(end, chAttr); } static int classifyTagHTML(unsigned int start, unsigned int end, WordList &keywords, Accessor &styler, bool &tagDontFold, bool caseSensitive, bool isXml) { char s[30 + 2]; // Copy after the '<' unsigned int i = 0; for (unsigned int cPos = start; cPos <= end && i < 30; cPos++) { char ch = styler[cPos]; if ((ch != '<') && (ch != '/')) { s[i++] = caseSensitive ? ch : static_cast(MakeLowerCase(ch)); } } //The following is only a quick hack, to see if this whole thing would work //we first need the tagname with a trailing space... s[i] = ' '; s[i+1] = '\0'; // if the current language is XML, I can fold any tag // if the current language is HTML, I don't want to fold certain tags (input, meta, etc.) //...to find it in the list of no-container-tags tagDontFold = (!isXml) && (NULL != strstr("meta link img area br hr input ",s)); //now we can remove the trailing space s[i] = '\0'; bool isScript = false; char chAttr = SCE_H_TAGUNKNOWN; if (s[0] == '!') { chAttr = SCE_H_SGML_DEFAULT; } else if (s[0] == '/') { // Closing tag if (keywords.InList(s + 1)) chAttr = SCE_H_TAG; } else { if (keywords.InList(s)) { chAttr = SCE_H_TAG; isScript = 0 == strcmp(s, "script"); } } if ((chAttr == SCE_H_TAGUNKNOWN) && !keywords) { // No keywords -> all are known chAttr = SCE_H_TAG; isScript = 0 == strcmp(s, "script"); } styler.ColourTo(end, chAttr); return isScript ? SCE_H_SCRIPT : chAttr; } static void classifyWordHTJS(unsigned int start, unsigned int end, WordList &keywords, Accessor &styler, script_mode inScriptType) { char chAttr = SCE_HJ_WORD; bool wordIsNumber = IsADigit(styler[start]) || (styler[start] == '.'); if (wordIsNumber) chAttr = SCE_HJ_NUMBER; else { char s[30 + 1]; unsigned int i = 0; for (; i < end - start + 1 && i < 30; i++) { s[i] = styler[start + i]; } s[i] = '\0'; if (keywords.InList(s)) chAttr = SCE_HJ_KEYWORD; } styler.ColourTo(end, statePrintForState(chAttr, inScriptType)); } static int classifyWordHTVB(unsigned int start, unsigned int end, WordList &keywords, Accessor &styler, script_mode inScriptType) { char chAttr = SCE_HB_IDENTIFIER; bool wordIsNumber = IsADigit(styler[start]) || (styler[start] == '.'); if (wordIsNumber) chAttr = SCE_HB_NUMBER; else { char s[100]; GetTextSegment(styler, start, end, s, sizeof(s)); if (keywords.InList(s)) { chAttr = SCE_HB_WORD; if (strcmp(s, "rem") == 0) chAttr = SCE_HB_COMMENTLINE; } } styler.ColourTo(end, statePrintForState(chAttr, inScriptType)); if (chAttr == SCE_HB_COMMENTLINE) return SCE_HB_COMMENTLINE; else return SCE_HB_DEFAULT; } static void classifyWordHTPy(unsigned int start, unsigned int end, WordList &keywords, Accessor &styler, char *prevWord, script_mode inScriptType) { bool wordIsNumber = IsADigit(styler[start]); char s[30 + 1]; unsigned int i = 0; for (; i < end - start + 1 && i < 30; i++) { s[i] = styler[start + i]; } s[i] = '\0'; char chAttr = SCE_HP_IDENTIFIER; if (0 == strcmp(prevWord, "class")) chAttr = SCE_HP_CLASSNAME; else if (0 == strcmp(prevWord, "def")) chAttr = SCE_HP_DEFNAME; else if (wordIsNumber) chAttr = SCE_HP_NUMBER; else if (keywords.InList(s)) chAttr = SCE_HP_WORD; styler.ColourTo(end, statePrintForState(chAttr, inScriptType)); strcpy(prevWord, s); } // Update the word colour to default or keyword // Called when in a PHP word static void classifyWordHTPHP(unsigned int start, unsigned int end, WordList &keywords, Accessor &styler) { char chAttr = SCE_HPHP_DEFAULT; bool wordIsNumber = IsADigit(styler[start]) || (styler[start] == '.' && start+1 <= end && IsADigit(styler[start+1])); if (wordIsNumber) chAttr = SCE_HPHP_NUMBER; else { char s[100]; GetTextSegment(styler, start, end, s, sizeof(s)); if (keywords.InList(s)) chAttr = SCE_HPHP_WORD; } styler.ColourTo(end, chAttr); } static bool isWordHSGML(unsigned int start, unsigned int end, WordList &keywords, Accessor &styler) { char s[30 + 1]; unsigned int i = 0; for (; i < end - start + 1 && i < 30; i++) { s[i] = styler[start + i]; } s[i] = '\0'; return keywords.InList(s); } static bool isWordCdata(unsigned int start, unsigned int end, Accessor &styler) { char s[30 + 1]; unsigned int i = 0; for (; i < end - start + 1 && i < 30; i++) { s[i] = styler[start + i]; } s[i] = '\0'; return (0 == strcmp(s, "[CDATA[")); } // Return the first state to reach when entering a scripting language static int StateForScript(script_type scriptLanguage) { int Result; switch (scriptLanguage) { case eScriptVBS: Result = SCE_HB_START; break; case eScriptPython: Result = SCE_HP_START; break; case eScriptPHP: Result = SCE_HPHP_DEFAULT; break; case eScriptXML: Result = SCE_H_TAGUNKNOWN; break; case eScriptSGML: Result = SCE_H_SGML_DEFAULT; break; default : Result = SCE_HJ_START; break; } return Result; } static inline bool ishtmlwordchar(char ch) { return !isascii(ch) || (isalnum(ch) || ch == '.' || ch == '-' || ch == '_' || ch == ':' || ch == '!' || ch == '#'); } static inline bool issgmlwordchar(char ch) { return !isascii(ch) || (isalnum(ch) || ch == '.' || ch == '_' || ch == ':' || ch == '!' || ch == '#' || ch == '['); } static inline bool IsPhpWordStart(const unsigned char ch) { return (isascii(ch) && (isalpha(ch) || (ch == '_'))) || (ch >= 0x7f); } static inline bool IsPhpWordChar(char ch) { return IsADigit(ch) || IsPhpWordStart(ch); } static bool InTagState(int state) { return state == SCE_H_TAG || state == SCE_H_TAGUNKNOWN || state == SCE_H_SCRIPT || state == SCE_H_ATTRIBUTE || state == SCE_H_ATTRIBUTEUNKNOWN || state == SCE_H_NUMBER || state == SCE_H_OTHER || state == SCE_H_DOUBLESTRING || state == SCE_H_SINGLESTRING; } static bool IsCommentState(const int state) { return state == SCE_H_COMMENT || state == SCE_H_SGML_COMMENT; } static bool IsScriptCommentState(const int state) { return state == SCE_HJ_COMMENT || state == SCE_HJ_COMMENTLINE || state == SCE_HJA_COMMENT || state == SCE_HJA_COMMENTLINE || state == SCE_HB_COMMENTLINE || state == SCE_HBA_COMMENTLINE; } static bool isLineEnd(char ch) { return ch == '\r' || ch == '\n'; } static bool isOKBeforeRE(char ch) { return (ch == '(') || (ch == '=') || (ch == ','); } static bool isPHPStringState(int state) { return (state == SCE_HPHP_HSTRING) || (state == SCE_HPHP_SIMPLESTRING) || (state == SCE_HPHP_HSTRING_VARIABLE) || (state == SCE_HPHP_COMPLEX_VARIABLE); } static int FindPhpStringDelimiter(char *phpStringDelimiter, const int phpStringDelimiterSize, int i, const int lengthDoc, Accessor &styler) { int j; while (i < lengthDoc && (styler[i] == ' ' || styler[i] == '\t')) i++; phpStringDelimiter[0] = '\n'; for (j = i; j < lengthDoc && styler[j] != '\n' && styler[j] != '\r'; j++) { if (j - i < phpStringDelimiterSize - 2) phpStringDelimiter[j-i+1] = styler[j]; else i++; } phpStringDelimiter[j-i+1] = '\0'; return j; } static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler, bool isXml) { WordList &keywords = *keywordlists[0]; WordList &keywords2 = *keywordlists[1]; WordList &keywords3 = *keywordlists[2]; WordList &keywords4 = *keywordlists[3]; WordList &keywords5 = *keywordlists[4]; WordList &keywords6 = *keywordlists[5]; // SGML (DTD) keywords // Lexer for HTML requires more lexical states (7 bits worth) than most lexers styler.StartAt(startPos, STYLE_MAX); char prevWord[200]; prevWord[0] = '\0'; char phpStringDelimiter[200]; // PHP is not limited in length, we are phpStringDelimiter[0] = '\0'; int StateToPrint = initStyle; int state = stateForPrintState(StateToPrint); // If inside a tag, it may be a script tag, so reread from the start to ensure any language tags are seen if (InTagState(state)) { while ((startPos > 0) && (InTagState(styler.StyleAt(startPos - 1)))) { startPos--; length++; } state = SCE_H_DEFAULT; } // String can be heredoc, must find a delimiter first while (startPos > 0 && isPHPStringState(state) && state != SCE_HPHP_SIMPLESTRING) { startPos--; length++; state = styler.StyleAt(startPos); } styler.StartAt(startPos, STYLE_MAX); int lineCurrent = styler.GetLine(startPos); int lineState; if (lineCurrent > 0) { lineState = styler.GetLineState(lineCurrent); } else { // Default client and ASP scripting language is JavaScript lineState = eScriptJS << 8; lineState |= styler.GetPropertyInt("asp.default.language", eScriptJS) << 4; } script_mode inScriptType = script_mode((lineState >> 0) & 0x03); // 2 bits of scripting mode bool tagOpened = (lineState >> 2) & 0x01; // 1 bit to know if we are in an opened tag bool tagClosing = (lineState >> 3) & 0x01; // 1 bit to know if we are in a closing tag bool tagDontFold = false; //some HTML tags should not be folded script_type aspScript = script_type((lineState >> 4) & 0x0F); // 4 bits of script name script_type clientScript = script_type((lineState >> 8) & 0x0F); // 4 bits of script name int beforePreProc = (lineState >> 12) & 0xFF; // 8 bits of state script_type scriptLanguage = ScriptOfState(state); const bool foldHTML = styler.GetPropertyInt("fold.html", 0) != 0; const bool fold = foldHTML && styler.GetPropertyInt("fold", 0); const bool foldHTMLPreprocessor = foldHTML && styler.GetPropertyInt("fold.html.preprocessor", 1); const bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0; const bool caseSensitive = styler.GetPropertyInt("html.tags.case.sensitive", 0) != 0; const CharacterSet setHTMLWord(CharacterSet::setAlphaNum, ".-_:!#", 0x80, true); const CharacterSet setTagContinue(CharacterSet::setAlphaNum, ".-_:!#[", 0x80, true); const CharacterSet setAttributeContinue(CharacterSet::setAlphaNum, ".-_:!#/", 0x80, true); int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK; int levelCurrent = levelPrev; int visibleChars = 0; char chPrev = ' '; char ch = ' '; char chPrevNonWhite = ' '; // look back to set chPrevNonWhite properly for better regex colouring if (scriptLanguage == eScriptJS && startPos > 0) { int back = startPos; int style = 0; while (--back) { style = styler.StyleAt(back); if (style < SCE_HJ_DEFAULT || style > SCE_HJ_COMMENTDOC) // includes SCE_HJ_COMMENT & SCE_HJ_COMMENTLINE break; } if (style == SCE_HJ_SYMBOLS) { chPrevNonWhite = styler.SafeGetCharAt(back); } } styler.StartSegment(startPos); const int lengthDoc = startPos + length; for (int i = startPos; i < lengthDoc; i++) { const char chPrev2 = chPrev; chPrev = ch; if (!isspacechar(ch) && state != SCE_HJ_COMMENT && state != SCE_HJ_COMMENTLINE && state != SCE_HJ_COMMENTDOC) chPrevNonWhite = ch; ch = styler[i]; char chNext = styler.SafeGetCharAt(i + 1); const char chNext2 = styler.SafeGetCharAt(i + 2); // Handle DBCS codepages if (styler.IsLeadByte(ch)) { chPrev = ' '; i += 1; continue; } if ((!isspacechar(ch) || !foldCompact) && fold) visibleChars++; // decide what is the current state to print (depending of the script tag) StateToPrint = statePrintForState(state, inScriptType); // handle script folding if (fold) { switch (scriptLanguage) { case eScriptJS: case eScriptPHP: //not currently supported case eScriptVBS: if ((state != SCE_HPHP_COMMENT) && (state != SCE_HPHP_COMMENTLINE) && (state != SCE_HJ_COMMENT) && (state != SCE_HJ_COMMENTLINE) && (state != SCE_HJ_COMMENTDOC) && (!isStringState(state))) { //Platform::DebugPrintf("state=%d, StateToPrint=%d, initStyle=%d\n", state, StateToPrint, initStyle); //if ((state == SCE_HPHP_OPERATOR) || (state == SCE_HPHP_DEFAULT) || (state == SCE_HJ_SYMBOLS) || (state == SCE_HJ_START) || (state == SCE_HJ_DEFAULT)) { if ((ch == '{') || (ch == '}')) { levelCurrent += (ch == '{') ? 1 : -1; } } break; case eScriptPython: if (state != SCE_HP_COMMENTLINE) { if ((ch == ':') && ((chNext == '\n') || (chNext == '\r' && chNext2 == '\n'))) { levelCurrent++; } else if ((ch == '\n') && !((chNext == '\r') && (chNext2 == '\n')) && (chNext != '\n')) { // check if the number of tabs is lower than the level int Findlevel = (levelCurrent & ~SC_FOLDLEVELBASE) * 8; for (int j = 0; Findlevel > 0; j++) { char chTmp = styler.SafeGetCharAt(i + j + 1); if (chTmp == '\t') { Findlevel -= 8; } else if (chTmp == ' ') { Findlevel--; } else { break; } } if (Findlevel > 0) { levelCurrent -= Findlevel / 8; if (Findlevel % 8) levelCurrent--; } } } break; default: break; } } if ((ch == '\r' && chNext != '\n') || (ch == '\n')) { // Trigger on CR only (Mac style) or either on LF from CR+LF (Dos/Win) or on LF alone (Unix) // Avoid triggering two times on Dos/Win // New line -> record any line state onto /next/ line if (fold) { int lev = levelPrev; if (visibleChars == 0) lev |= SC_FOLDLEVELWHITEFLAG; if ((levelCurrent > levelPrev) && (visibleChars > 0)) lev |= SC_FOLDLEVELHEADERFLAG; styler.SetLevel(lineCurrent, lev); visibleChars = 0; levelPrev = levelCurrent; } lineCurrent++; styler.SetLineState(lineCurrent, ((inScriptType & 0x03) << 0) | ((tagOpened & 0x01) << 2) | ((tagClosing & 0x01) << 3) | ((aspScript & 0x0F) << 4) | ((clientScript & 0x0F) << 8) | ((beforePreProc & 0xFF) << 12)); } // generic end of script processing else if ((inScriptType == eNonHtmlScript) && (ch == '<') && (chNext == '/')) { // Check if it's the end of the script tag (or any other HTML tag) switch (state) { // in these cases, you can embed HTML tags (to confirm !!!!!!!!!!!!!!!!!!!!!!) case SCE_H_DOUBLESTRING: case SCE_H_SINGLESTRING: case SCE_HJ_COMMENT: case SCE_HJ_COMMENTDOC: //case SCE_HJ_COMMENTLINE: // removed as this is a common thing done to hide // the end of script marker from some JS interpreters. case SCE_HJ_DOUBLESTRING: case SCE_HJ_SINGLESTRING: case SCE_HJ_REGEX: case SCE_HB_STRING: case SCE_HP_STRING: case SCE_HP_TRIPLE: case SCE_HP_TRIPLEDOUBLE: break; default : // check if the closing tag is a script tag if (state == SCE_HJ_COMMENTLINE || isXml) { char tag[7]; // room for the