From: Julian Smart Date: Thu, 12 Jun 2003 20:43:55 +0000 (+0000) Subject: Added first cut wxWindows Configuration Tool X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/d7463f75f9c170c29b4965d27dccf535ac32cfde Added first cut wxWindows Configuration Tool git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21083 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/utils/configtool/Makefile.in b/utils/configtool/Makefile.in new file mode 100644 index 0000000000..6d36395442 --- /dev/null +++ b/utils/configtool/Makefile.in @@ -0,0 +1,7 @@ + +all: + cd src; $(MAKE) + +clean: + cd src; $(MAKE) clean + diff --git a/utils/configtool/configs/wxwin250.wxs b/utils/configtool/configs/wxwin250.wxs new file mode 100644 index 0000000000..6a2d9fb41f --- /dev/null +++ b/utils/configtool/configs/wxwin250.wxs @@ -0,0 +1,4372 @@ + + + + 1 + 0 + Configuration + <B>This is the top-level configuration item.</B> + 1 + + + + + + + + + + + 1 + 0 + Platform + <B>Choose a platform</B> + 1 + + + + + + + + + + + 1 + 0 + Windows + <B>The WIN32 port.</B><P> + +This port is for Windows 9x, ME, NT, 2K, XP. + + 1 + + + + + MGL,X11,Mac Carbon,GTK+ 1.x,Motif,OS/2,Mac Cocoa,GTK+ 2.x,Wine + + --with-msw + + + + + 1 + 0 + X11 + <B>The Xlib/Unix port.</B><P> + +This port is based on the wxUniversal widgets. + + 1 + + + + + MGL,Mac Carbon,Windows,GTK+ 1.x,Motif,OS/2,Mac Cocoa,GTK+ 2.x,Wine + + --with-x11 + + + + + 1 + 0 + Mac Carbon + <B>The Mac Carbon and Classic port.</B><P> + +A port for Mac OS 9 and Mac OS 10.x. + + 1 + + + + + MGL,X11,Windows,GTK+ 1.x,Motif,OS/2,Mac Cocoa,GTK+ 2.x,Wine + + --with-mac + + + + + 1 + 0 + Mac Cocoa + <B>Cocoa port</B><P> + +This port uses the Cocoa API on Mac OS X. + 1 + + + + + GTK+ 2.x,GTK+ 1.x,Mac Carbon,MGL,Motif,Windows,OS/2,Wine,X11 + + --with-cocoa + + + + + 1 + 0 + GTK+ 1.x + <B>The GTK+ port.</B><P> + +This port is based on the GTK+ 1.x and 2.x widget set. + + 1 + + + + + MGL,X11,Mac Carbon,Windows,Motif,OS/2,Mac Cocoa,GTK+ 2.x,Wine + + --with-gtk + + + + + 1 + 1 + GTK+ 2.x + <B>wxGTK with GTK+ 2</B><P> + +This port uses GTK+ 2. + 1 + + + + + Mac Cocoa,GTK+ 1.x,Mac Carbon,MGL,Motif,Windows,OS/2,Wine,X11 + + --with-gtk2 + + + + + 1 + 0 + Motif + <B>The Motif/Lesstif port.</B><P> + +This port uses Motif 1.x/2.x or Lesstif. + + 1 + + + + + MGL,X11,Mac Carbon,Windows,GTK+ 1.x,OS/2,Mac Cocoa,GTK+ 2.x,Wine + + --with-motif + + + + + 1 + 0 + OS/2 + <B>OS/2 Presentation Manager</B><P> + +This port uses OS/2 Presentation Manager. + 1 + + + + + GTK+ 1.x,Mac Carbon,MGL,Motif,Windows,X11,Mac Cocoa,GTK+ 2.x,Wine + + --with-pm + + + + + 1 + 0 + Wine + <B>Wine port</B><P> + +The wxMSW port built for Wine (Windows emulation library). + 1 + + + + + Mac Cocoa,GTK+ 1.x,GTK+ 2.x,Mac Carbon,MGL,Motif,Windows,OS/2,X11 + + --with-wine + + + + + 1 + 0 + MGL + <B>The MGL Linux and DOS port.</B><P> + +This port is based on the wxUniversal widgets. + 1 + + + + + X11,Mac Carbon,Windows,GTK+ 1.x,Motif,OS/2,Mac Cocoa,Wine,GTK+ 2.x + + --with-mgl + + + + + + 1 + 0 + Build options + <B>Build options</B><P> + +Major build options. + 1 + + + + + + + + + + + 1 + 1 + wxUSE_GUI + <B>Use GUI</B><P> + +If on, builds a GUI version of the library as opposed to wxBase. Currently, this needs to be enabled. + 1 + + + + + + + --enable-gui + + + + + 0 + 0 + __WXMSW__ + This is enabled if the relevant platform settings are enabled. + 1 + Windows,Wine + + Windows,Wine + + + + + + + + + 0 + 1 + __WXGTK__ + This is enabled if the relevant platform settings are enabled. + + 1 + GTK+ 1.x,GTK+ 2.x + + GTK+ 1.x,GTK+ 2.x + + + + + + + + + 0 + 1 + __WXGTK20__ + This is enabled if the relevant platform settings are enabled. + + 1 + GTK+ 2.x + + GTK+ 2.x + + + + + + + + + 0 + 0 + __WXX11__ + This is enabled if the relevant platform settings are enabled. + + 1 + X11 + + X11 + + + + + + + + + 0 + 0 + __WXMOTIF__ + This is enabled if the relevant platform settings are enabled. + + 1 + Motif + + Motif + + + + + + + + + 0 + 0 + __WXMAC__ + This is enabled if the relevant platform settings are enabled. + + 1 + Mac Carbon + + Mac Carbon + + + + + + + + + 0 + 0 + __WXCOCOA__ + This is enabled if the relevant platform settings are enabled. + + 1 + Mac Cocoa + + Mac Cocoa + + + + + + + + + 0 + 0 + __WXPM__ + This is enabled if the relevant platform settings are enabled. + + 1 + OS/2 + + OS/2 + + + + + + + + + 0 + 0 + __WXMGL__ + This is enabled if the relevant platform settings are enabled. + + 1 + MGL + + MGL + + + + + + + + + 0 + 0 + __WXUNIVERSAL__ + This is enabled if the relevant platform settings are enabled. + + 1 + X11,MGL + + X11,MGL + + + + + + + + + 1 + 0 + wxUSE_UNIVERSAL + <B>Universal</B><P> + +Specifies if wxUniversal should be used instead of native widgets.<P> + +If the selected port in <B>Platform</B> is a wxUniversal port, this setting is enabled and is not user-editable. Otherwise, it can be enabled or disabled. However this doesn't necessarily mean that the configuration is supported for any given platform. + 0 + + + __WXUNIVERSAL__ + + + + + + + + + + 1 + 0 + C++ options + <B>C++ options</B><P> + +A variety of options, mostly specific to Unix compilers. + 1 + + + + + + + + + + + 1 + 0 + wxUSE_DMALLOC + <B>Dmalloc</B><P> + +Use the dmalloc library.<P> + +See: http://dmalloc.com. + 1 + + + + + + + --with-dmalloc + + + + + 1 + 0 + wxUSE_SHARED + <B>Shared library</B><P> + +Use a shared library. + 1 + + + + + + + --with-shared + + + + + 1 + 0 + wxUSE_SONAME + <B>Soname</B><P> + +Set the DT_SONAME field in ELF shared libraries + 1 + + + + + + + --with-soname + + + + + 1 + 0 + wxUSE_OPTIMISE + <B>Optimise</B><P> + +Create optimised code. + 1 + + + + + + + --enable-optimise + + + + + 1 + 0 + wxUSE_DEBUG + <B>Use debugging information</B><P> + +Same as wxUSE_DEBUG_FLAG (set __WXDEBUG__ flag) and wxUSE_DEBUG_INFO (create code with debugging information). + 1 + + + + + + + --with-debug + + + + + 1 + 0 + wxUSE_DEBUG_GDB + <B>GDB debugging information</B><P> + +Create code with extra GDB debugging information. + 1 + + + + + + + --with-debug_gdb + + + + + 1 + 0 + wxUSE_PROFILE + <B>Profiling information</B><P> + +Create code with profiling information. + 1 + + + + + + + --with-profile + + + + + 1 + 0 + wxUSE_NO_RTTI + <B>No RTTI</B><P> + +Create code without RTTI (Run-time type) information. + 1 + + + + + + + --with-no_rtti + + + + + 1 + 0 + wxUSE_NO_EXCEPTIONS + <B>No exception handling</B><P> + +Create code without C++ exceptions handling. + 1 + + + + + + + --with-no_exceptions + + + + + 1 + 0 + wxUSE_PERMISSIVE + + 1 + + + + + + + --with-permissive + + + + + 1 + 0 + wxUSE_NO_DEPS + <B>No dependency information</B><P> + +Create code without dependency information. + 1 + + + + + + + --with-no_deps + + + + + 1 + 0 + wxUSE_RPATH + <B>Rpath</B><P> + +Output the rpath flag from wx-config.<P> + +If you enable this setting, please enter the path into the <b>value</b> property. + 1 + + + + + + + --enable-rpath + + + + + + 1 + 0 + wxUSE_WXPRINTFV + <B>Use wxWindows implementation of wxPrintfv</B><P> + +Check to use the wxWindows implementation. + 1 + + + + + + + --enable-wxprintfv + + + + + + 1 + 0 + Compatibility + <B>Various options for backward compatibility</B> + 1 + + + + + + + + + + + 1 + 0 + WXWIN_COMPATIBILITY + <B>This setting determines the compatibility with 1.68 API</B><P> + +Level 0: no backward compatibility, all new features<BR> +Level 1: some extra methods are defined for compatibility.<P> + +Default is 0. Recommended setting: 0 (in fact the compatibility code is now very minimal so there is little advantage to setting it to 1. + + 1 + + + + + + + + + + + + 1 + 0 + WXWIN_COMPATIBILITY_2 + <B>This setting determines the compatibility with 2.0 API</B><P> + +Set it to 1 to enable it. Default is 0.<P> + +Recommended setting: 0 (please update your code instead!) + + 1 + + + + + + + --enable-compat20 + + + + + 1 + 0 + WXWIN_COMPATIBILITY_2_2 + <B>This setting determines the compatibility with 2.2 API</B><P> + +Set it to 1 to enable it but please consider updating your code instead.<P> + +The default is 0. Recommended setting: 0 (please update your code) + + 1 + + + + + + + --enable-compat22 + + + + + 1 + 0 + WXWIN_COMPATIBILITY_2_4 + <B>This setting determines the compatibility with 2.4 API</B><P> + +Set it to 0 to flag all cases of using deprecated functions.<P> + +Default is 1 but please try building your code with 0 as the default will +change to 0 in the next version and the deprecated functions will disappear in the version after it completely.<P> + +Recommended setting: 0 (please update your code) + + 1 + + + + + + + --enable-compat24 + + + + + 0 + 1 + wxFONT_SIZE_COMPATIBILITY + <B>Define as 1 for font size to be backward compatible to 1.63 and earlier.</B><P> + +1.64 and later define point sizes to be compatible with Windows.<P> + +Default is 0. + + 1 + + + + + + __WXMSW__ + + wxFont + + + + 0 + 1 + wxDIALOG_UNIT_COMPATIBILITY + <B>Set to 0 for accurate dialog units, else 1 to be as per 2.1.16 and before.</B><P> + +If migrating between versions, your dialogs may seem to shrink.<P> + +Default is 1. Recommended setting: 0 (the new calculations are more correct!) + + 1 + + + + + + __WXMSW__ + + wxDialog + + + + + 1 + 0 + Debugging + <B>Debugging settings</B><P> + +See also <B>C++ options</B>.<P> + +Generic comment about debugging settings: they are very useful if you don't use any other memory leak detection tools such as Purify/BoundsChecker, but are probably redundant otherwise.<P> + +Also, Visual C++ CRT has the same features as wxWindows memory debugging subsystem built in since version 5.0 and you +may prefer to use it instead of built in memory debugging code because it is faster and more fool-proof.<P> + +Using VC++ CRT memory debugging is enabled by default in debug mode (__WXDEBUG__) if wxUSE_GLOBAL_MEMORY_OPERATORS is *not* enabled (i.e. is 0) +and if __NO_VC_CRTDBG__ is not defined. + + 1 + + + + + + + + + + + 1 + 1 + wxUSE_DEBUG_CONTEXT + <B>If 1, enables wxDebugContext, for writing error messages to file, etc.</B><P> + +If __WXDEBUG__ is not defined, will still use the normal memory operators.<P> + +Default is 0. Recommended setting: 0<P> + + 1 + + + + + + + --enable-debug_cntxt + wxDebugContext + + + + 1 + 1 + wxUSE_MEMORY_TRACING + <B>If 1, enables debugging versions of wxObject::new and wxObject::delete *IF* __WXDEBUG__ is also defined.</B><P> + +WARNING: this code may not work with all architectures, especially if alignment is an issue. This switch is currently ignored for mingw / cygwin.<P> + +Default is 0. Recommended setting: 1 if you are not using a memory debugging tool, else 0<P> + + 1 + + + + + + + --enable-mem_tracing + Debugging overview + + + + 1 + 1 + wxUSE_GLOBAL_MEMORY_OPERATORS + <B>In debug mode, cause new and delete to be redefined globally.</B><P> + +If this causes problems (e.g. link errors which is a common problem +especially if you use another library which also redefines the global new and delete), set this to 0.<P> + +This switch is currently ignored for MinGW/Cygwin. The configure script sets this to 1 if wxUSE_MEMORY_TRACING is 1.<P> + +Default: 0. Recommended setting: 0 + + 1 + + + + + + + + Debugging Overview + + + + 1 + 1 + wxUSE_DEBUG_NEW_ALWAYS + <B>In debug mode, causes new to be defined to be WXDEBUG_NEW</B> (see object.h).<P> + +If this causes problems (e.g. link errors), set this to 0. You may need to set this to 0 if using templates (at least for VC++). This switch is currently ignored for MinGW/Cygwin/CodeWarrior.<P> + +Default: 0. Recommended setting: 0 + + 1 + + + + + + + + Debugging overview + + + + 0 + 1 + wxUSE_ON_FATAL_EXCEPTION + <B>Fatal exceptions handling</B><P> + +wxHandleFatalExceptions() may be used to catch the program faults at run time and, instead of terminating the program with a usual GPF message box, call the user-defined wxApp::OnFatalException() function. If you set wxUSE_ON_FATAL_EXCEPTION to 0, wxHandleFatalExceptions() will not work.<P> + +This setting is for Win32 only and can only be enabled if your compiler supports Win32 structured exception handling (currently only VC++ does).<P> + +Default: 1. Recommended setting: 1 if your compiler supports it. + + 1 + + + + + + __WXMSW__ + --enable-catch_segvs + + + + + + 1 + 0 + Unicode + <B>Unicode settings</B> + 1 + + + + + + + + + + + 1 + 0 + wxUSE_UNICODE + <B>Unicode mode</B><P> + +Set wxUSE_UNICODE to 1 to compile wxWindows in Unicode mode: wxChar will be defined as wchar_t, wxString will use Unicode internally. If you set this to 1, you must use the wxT() macro for all literal strings in the program.<P> + +Unicode is currently only fully supported under Windows NT/2000/XP (Windows 9x doesn't support it and the programs compiled in Unicode mode will not run under 9x -- but see wxUSE_UNICODE_MSLU below).<P> + +Default: 0. Recommended setting: 0 (unless you only plan to use Windows NT/2000/XP) + + 1 + + + + + + + --enable-unicode + Unicode support in wxWindows + + + + 0 + 0 + wxUSE_UNICODE_MSLU + <B>Unicode MSLU support</B><P> + +Set wxUSE_UNICODE_MSLU to 1 if you want to compile wxWindows in Unicode mode and be able to run compiled apps under Windows 9x as well as NT/2000/XP. +This setting enables use of unicows.dll from MSLU, the MS Layer for Unicode, see:<P> + +http://www.microsoft.com/globaldev/handson/dev/mslu_announce.mspx<P> + +Note that you will have to modify the makefiles to include unicows.lib import library as the first library (if you use MSVC, you can run the makefile with:<P> + +nmake MSLU=1 UNICODE=1<P> + +If your compiler doesn't have unicows.lib, you can get a version of it at:<P> + +http://libunicows.sourceforge.net<P> + +Default: 0. Recommended setting: 0 (1 if you want to deploy Unicode apps on 9x systems) + 1 + wxUSE_UNICODE + + + + + __WXMSW__ + --enable-mslu + Unicode support in wxWindows + + + + 1 + 1 + wxUSE_WCHAR_T + <B>Wide character support</B><P> + +Setting wxUSE_WCHAR_T to 1 gives you some degree of Unicode support without compiling the program in Unicode mode. More precisely, it will be possible to construct wxString from a wide (Unicode) string and convert any wxString to Unicode.<P> + +If using configure, this setting is automatically detected and set.<P> + +Default: 1. Recommended setting: 1 + + 1 + + + + + + + + + Internationalization + + + + 1 + 1 + Logging + <B>wxLog facilities</B><P> + + + 1 + + + + + + + + + + + 1 + 1 + wxUSE_LOG + <B>wxLog</B><P> + +Support for message/error logging. This includes wxLogXXX() functions and wxLog and derived classes. Don't set this to 0 unless you really know what you are doing.<P> + +Default: 1. Recommended setting: 1 (always) + + 1 + + + + + + + --enable-log + wxLog + + + + 1 + 1 + wxUSE_LOGWINDOW + <B>wxLogWindow</B><P> + + 1 + wxUSE_TEXTCTRL + + + + + + --enable-logwin + wxLog + + + + 1 + 1 + wxUSE_LOGGUI + <B>wxLogGui</B><P> + 1 + + + + + + + --enable-loggui + wxLog + + + + 1 + 1 + wxUSE_LOG_DIALOG + <B>wxLogDialog</B><P> + 1 + wxUSE_LISTCTRL + + + + + + --enable-logdialog + wxLog + + + + + 1 + 0 + Files and streams + + 1 + + + + + + + + + + + 1 + 1 + wxUSE_STREAMS + <B>Stream support</B><P> + +If enabled (1), compiles wxWindows streams classes. + +Default: 1. Recommended setting: 1 + + + 1 + + + + + + + --enable-streams + wxStreams overview + + + 1 + 1 + wxUSE_ZIPSTREAM + <B>wxZipInputStream, wxZipOutputStream</B><P> + +Default: 1 + 1 + + + + + + + --enable-zipstream + + + + + + 1 + 0 + wxUSE_STD_IOSTREAM + <B>Standard C++ streams</B><P> + +Use standard C++ streams if 1. If 0, use wxWin streams implementation.<P> + +Default: 0 + + 0 + + + + + + + --enable-std_iostreams + + + + + 1 + 1 + wxUSE_FILE + <B>wxFile support</B><P> + +Set wxUSE_FILE to 1 to compile wxFile classes. wxFile uses low level POSIX functions for file access, wxFFile uses ANSI C stdio.h functions.<P> + +Default: 1. Recommended setting: 1. wxFile is highly recommended as it is required by i18n code, wxFileConfig and others. + + 1 + + + + + + + --enable-file + wxFile + + + + 1 + 1 + wxUSE_FFILE + <B>wxFFile support</B><P> + +Set wxUSE_FFILE to 1 to compile wxFFile classes. wxFFile uses ANSI C stdio.h functions.<P> + +Default: 1. Recommended setting: 1. + 1 + + + + + + + --enable-ffile + wxFFile + + + + 1 + 1 + wxUSE_FSVOLUME + <B>wxFSVolume</B><P> + +Use wxFSVolume class to provide access to the configured/active mount points.<P> + +Default: 1. Recommended setting: 1 (but may be safely disabled if you don't use it) + + 1 + + + + + + + + wxFSVolume + + + + 1 + 1 + wxUSE_TEXTBUFFER + <B>wxTextBuffer</B><P> + +This class is required by wxTextFile. + 1 + + + + + + + --enable-textbuf + wxTextFile + + + + 1 + 1 + wxUSE_TEXTFILE + <B>wxTextFile</B><P> + +Requires wxFile and wxTextBuffer, required by wxFileConfig. + 1 + wxUSE_TEXTBUFFER,wxUSE_FILE + + + + + + --enable-textfile + wxTextFile + + + + 1 + 1 + wxUSE_CONFIG + <B>wxConfig</B><P> + +Setting wxUSE_CONFIG to 1 enables the use of wxConfig and related classes which allow the application to store its settings in the persistent storage. Setting this to 1 will also enable on-demand creation of the global config object in wxApp.<P> + +Default: 1. + 1 + + + + + + + --enable-config + wxConfig classes overview + + + + 1 + 1 + wxUSE_CONFIG_NATIVE + <B>Native Config</B><P> + + If wxUSE_CONFIG is 1, you may choose to use either the native config classes under Windows (using .INI files under Win16 and the registry under Win32) or the portable text file format used by the config classes under Unix.<P> + +Default: 1 to use native classes. Note that you may still use +wxFileConfig even if you set this to 1 - just the config object created by default for the applications needs will be a wxRegConfig or wxIniConfig and not wxFileConfig.<P> + +Default: 1. Recommended setting: 1 + + 1 + + + + + + + + wxConfig classes overview + + + + 1 + 1 + wxUSE_MIMETYPE + <B>wxMimeTypesManager</B><P> + +Default: 1 + 1 + wxUSE_TEXTFILE + + + + + + --enable-mimetype + wxMimeTypesManager + + + + 1 + 1 + wxUSE_FILESYSTEM + <B>Virtual file systems</B><P> + +Enable virtual file systems (required by wxHTML) + 1 + + + + + + + --enable-filesystem + wxFileSystem + + + 1 + 1 + wxUSE_FS_ZIP + <B>Virtual Zip filesystem</B><P> + +Allows the application to extract files from zip files.<P> + +Default: 1 + + 1 + + + + + + + --enable-fs_zip + + + + + 1 + 1 + wxUSE_FS_INET + <B>Virtual Internet file system</B><P> + +Default: 1 + 1 + wxUSE_STREAMS + + + + + + --enable-fs_inet + + + + + + 1 + 1 + wxUSE_RESOURCES + <B>wxGetResource/wxWriteResource</B><P> + +Deprecated resource functions.<P> + +On wxMSW, these functions use .ini files. On wxGTK+, they are implemented using wxFileConfig. On wxMotif, they use XrmDatabase. On all other platforms, they are not implemented.<P> + +You might want to use them on wxMotif to access X11 resource files easily, but otherwise it is best to use wxConfig instead.<P> + +Default: 1 + 1 + + + + + + + --enable-xresources + + + + + 1 + 1 + wxUSE_IOSTREAMH + <B>iostream setting</B><P> + +VC++ 4.2 and above allows &#60;iostream&#62; and &#60;iostream.h&#62; but you can't mix them. Set to 1 for &#60;iostream.h&#62;, 0 for &#60;iostream&#62;. Note that VC++ 7.1 and later doesn't support wxUSE_IOSTREAMH == 1 and so <iostream> will be used anyhow.<P> + +Default is 1.<P> + +Recommended setting: whatever your compiler likes more + + 1 + + + + + + + + + + + + 1 + 1 + wxUSE_LARGEFILE + <B>Large file support</B><P> + +Clear to disable large file support (-D_LARGE_FILES). + 1 + + + + + + + --enable-largefile + + + + + + 1 + 0 + Data + <B>Data classes</B> + 1 + + + + + + + + + + + 1 + 1 + wxUSE_LONGLONG + <B>wxLongLong support</B><P> + +Set wxUSE_LONGLONG to 1 to compile the wxLongLong class. This is a 64 bit integer which is implemented in terms of native 64 bit integers if any or uses emulation otherwise.<P> + +This class is required by wxDateTime and so you should enable it if you want to use wxDateTime. For most modern platforms, it will use the native 64 bit integers in which case (almost) all of its functions are inline and it almost does not take any space, so there should be no reason to switch it off.<P> + +Default: 1. Recommended setting: 1 + + 1 + + + + + + + --enable-longlong + wxLongLong + + + + 1 + 1 + wxUSE_APPLE_IEEE + <B>IEEE floating point code</B><P> + +If enabled, the code written by Apple will be used to write, in a portable way, floating point data on disk. See extended.c for the licence which is different from the wxWindows one.<P> + +Default: 1. Recommended setting: 1 unless you don't like the licence terms (unlikely) + + 1 + + + + + + + --enable-apple_ieee + + + + + 1 + 1 + wxUSE_REGEX + <B>wxRegEx</B><P> + +Support for regular expression matching via wxRegEx class: enable this to use POSIX regular expressions in your code. You need to compile theh regex library from src/regex to use it under Windows.<P> + +Default: 1 Recommended setting: 1 if your compiler supports it. + 1 + + + + + + + --with-regex + wxRegEx + + 0 + + + 1 + 1 + wxUSE_GEOMETRY + Miscellaneous geometry code + 1 + + + + + + + --enable-geometry + + + + + + 1 + 0 + Time + + 1 + + + + + + + + + + + 1 + 1 + wxUSE_DATETIME + <B>wxDateTime</B><P> + +Set wxUSE_DATETIME to 1 to compile the wxDateTime and related classes which manipulate dates, times and time intervals. wxDateTime replaces the old wxTime and wxDate classes which are still provided for backwards compatibility (and implemented in terms of wxDateTime).<P> + +Note that this class is relatively new and is still officially in alpha +stage because some features are not yet (fully) implemented. It is already quite useful though and should only be disabled if you are aiming at absolutely minimal version of the library.<P> + +Requires: wxUSE_LONGLONG. Default: 1 + + 1 + wxUSE_LONGLONG + + + + + + --enable-datetime + wxDateTime + + + + 1 + 1 + wxUSE_TIMER + <B>wxTimer</B><P> + +Default: 1. + 1 + + + + + + + --enable-timer + wxTimer + + + + 1 + 1 + wxUSE_STOPWATCH + <B>wxStopWatch</B><P> + +Default: 1. Needed by wxSocket. + 1 + wxUSE_LONGLONG + + + + + + --enable-stopwatch + wxStopWatch + + + + + 1 + 0 + Network + + 1 + + + + + + + + + + + 1 + 1 + wxUSE_DIALUP_MANAGER + <B>wxDialUpManager</B><P> + + If wxUSE_DIALUP_MANAGER is 1, compiles in wxDialUpManager class which allows connection to/disconnection from the network and notificaton whenever the dial-up network connection is established or terminated. Requires wxUSE_DYNAMIC_LOADER. + +Default: 1. Recommended setting: 1 + + 1 + + + + + + + --enable-dialupman + wxDialupManager + + + + 1 + 1 + wxUSE_SOCKETS + <B>wxSocket</B><P> + +wxSocket and friends.<P> + +Default: 1 + 1 + wxUSE_STOPWATCH + + + + + + --enable-sockets + wxSocketBase + + + + 1 + 1 + wxUSE_PROTOCOL + <B>wxProtocol</B><P> + +wxProtocol and related classes: if you want to use any of wxFTP, wxHTTP or wxURL you need to set this to 1.<P> + +Default: 1 + + + 1 + wxUSE_STREAMS + + + + + + --enable-protocol + wxProtocol + + + 1 + 1 + wxUSE_PROTOCOL_FILE + <B>wxFileProto</B><P> + + + 1 + + + + + + + --enable-protocol-file + wxProtocol + + + + 1 + 1 + wxUSE_PROTOCOL_FTP + <B>wxFTP</B> + 1 + + + + + + + --enable-protocol-ftp + wxFTP + + + + 1 + 1 + wxUSE_PROTOCOL_HTTP + <B>wxHTTP</B><P> + 1 + + + + + + + --enable-protocol-http + wxHTTP + + + + 1 + 1 + wxUSE_URL + <B>wxURL</B> + 1 + + + + + + + --enable-url + wxURL + + + + + 1 + 1 + wxUSE_IPC + <B>wxIPC</B><P> + +The wxServer, wxClient and wxConnection classes are a high-level IPC implementation, using DDE on MS Windows and sockets on other platforms.<P> + +Default: 1. Recommended value: 1. + 1 + + + + + + + --enable-ipc + Interprocess communication overview + + + + + 1 + 0 + Windows + + 1 + + + + + + + + + + + 1 + 1 + wxUSE_STATUSBAR + <B>wxStatusBar</B><P> + +On MS Windows, depending on the value of wxUSE_NATIVE_STATUSBAR, either wxStatusBar95 or a generic wxStatusBar will be used. + 1 + + + + + + + --enable-statusbar + wxStatusBar + + + 1 + 1 + wxUSE_NATIVE_STATUSBAR + Two status bar implementations are available under Win32: the generic one or the wrapper around native control. For native look and feel, the native version should be used.<P> + +Default: 1. Recommended setting: 1 (there is no advantage in using the generic one) + + 1 + + + + + + + + wxStatusBar + + + + + 1 + 1 + wxUSE_TOOLBAR + <B>wxToolBar</B><P> + +If wxUSE_TOOLBAR is 0, don't compile any toolbar +classes at all. Otherwise, use the native toolbar class unless +wxUSE_TOOLBAR_NATIVE is 0. Additionally, the generic toolbar class which supports some features which might not be supported by the native wxToolBar class may be compiled in if wxUSE_TOOLBAR_SIMPLE is 1.<P> + +Default: 1. Recommended setting: 1 + 1 + + + + + + + --enable-toolbar + wxToolBar + + + 1 + 1 + wxUSE_TOOLBAR_NATIVE + Use the native toolbar implementation wherever possible. + 1 + + + + + + + --enable-tbarnative + wxToolBar + + + + 1 + 0 + wxUSE_TOOLBAR_SIMPLE + Compile wxToolBarSimple, a simple generic toolbar implementation, in addition to any others that are enabled.<P> + +This must be enabled if wxUSE_TOOLBAR_NATIVE is disabled. + 1 + + + + wxUSE_TOOLBAR_NATIVE + + + --enable-tbarsmpl + wxToolBar + + + + + 1 + 1 + wxUSE_GRID + <B>wxGrid</B><P> + +wxGrid class. + 1 + + + + + + + --enable-grid + wxGrid + + + + 1 + 1 + wxUSE_SASH + <B>wxSashWindow</B><P> + 1 + + + + + + + --enable-sash + wxSashWindow + + + + 1 + 1 + wxUSE_SPLITTER + <B>wxSplitterWindow</B><P> + 1 + + + + + + + --enable-splitter + wxSplitterWindow + + + + 1 + 0 + wxUSE_GLCANVAS + <B>wxGLCanvas</B><P> + 1 + + + + + + + --with-opengl + wxGLCanvas + + + + 1 + 1 + wxUSE_POPUPWINDOW + <B>wxPopupWindow</B><P> + +Enables the popup window class. + + 1 + + + + + + + --enable-popupwin + wxPopupWindow + + + + 1 + 1 + wxUSE_TIPWINDOW + <B>wxTipWindow</B><P> + +Enables the generic tip window class.<P> + +This is used to implement tooltips on some ports. + 1 + + + + + + + --enable-tipwindow + wxTipWindow + + + + 1 + 1 + wxUSE_MINIFRAME + <B>Miniframe</B><P> + +Use the wxMiniFrame class. Not implemented on all platforms. + 1 + + + + + + + --enable-miniframe + wxMiniFrame + + + + 1 + 1 + wxUSE_CONTROLS + <B>Controls</B><P> + + You must set wxUSE_CONTROLS to 1 if you are using any controls at all (without it, the wxControl class is not compiled). + + 1 + + + + + + + --enable-controls + + + + 1 + 1 + wxUSE_BUTTON + <B>wxButton</B><P> + 1 + + + + + + + --enable-button + wxButton + + + + 1 + 1 + wxUSE_BMPBUTTON + <B>wxBitmapButton</B><P> + 1 + + + + + + + --enable-bmpbutton + wxBitmapButton + + + + 1 + 1 + wxUSE_CALENDARCTRL + <B>wxCalCtrl</B><P> + +A calendar control. + 1 + wxUSE_SPINBTN,wxUSE_COMBOBOX + + + + + + --enable-calendar + wxCalCtrl + + + + 1 + 1 + wxUSE_CHECKBOX + <B>wxCheckBox</B><P> + 1 + + + + + + + --enable-checkbox + wxCheckBox + + + + 1 + 1 + wxUSE_CHECKLISTBOX + <B>wxCheckListBox</B><P> + 1 + wxUSE_LISTBOX + + + + + + --enable-checklst + wxCheckListBox + + + + 1 + 1 + wxUSE_CHOICE + <B>wxChoice</B><P> + + 1 + + + + + + + --enable-choice + wxChoice + + + + 1 + 1 + wxUSE_COMBOBOX + <B>wxComboBox</B><P> + 1 + + + + + + + --enable-combobox + wxComboBox + + + + 1 + 1 + wxUSE_GAUGE + <B>wxGauge</B><P> + 1 + + + + + + + --enable-gauge + wxGauge + + + + 1 + 1 + wxUSE_LISTBOX + <B>wxListBox</B><P> + 1 + + + + + + + --enable-listbox + wxListBox + + + + 1 + 1 + wxUSE_LISTCTRL + <B>wxListCtrl</B><P> + 1 + wxUSE_IMAGLIST + + + + + + --enable-listctrl + wxListCtrl + + + + 1 + 1 + wxUSE_NOTEBOOK + <B>wxNotebook</B><P> + +wxNotebook is a control with several "tabs" located on one of its sides. It may be used ot logically organise the data presented to the user instead of putting everything in one huge dialog.<P> + +Default: 1. + + 1 + wxUSE_IMAGLIST + + + + + + --enable-notebook + wxNotebook + + + + 1 + 1 + wxUSE_RADIOBOX + <B>wxRadioBox</B><P> + 1 + wxUSE_RADIOBTN,wxUSE_STATBOX + + + + + + --enable-radiobox + wxRadioBox + + + + 1 + 1 + wxUSE_RADIOBTN + <B>wxRadioButton</B><P> + 1 + + + + + + + --enable-radiobtn + wxRadioButton + + + + 1 + 1 + wxUSE_SCROLLBAR + <B>wxScrollBar</B><P> + 1 + + + + + + + --enable-scrollbar + wxScrollBar + + + + 1 + 1 + wxUSE_SLIDER + <B>wxSlider</B><P> + 1 + + + + + + + --enable-slider + wxSlider + + + + 1 + 1 + wxUSE_SPINBTN + <B>wxSpinButton</B><P> + 1 + + + + + + + --enable-spinbtn + wxSpinButton + + + + 1 + 1 + wxUSE_SPINCTRL + <B>wxSpinCtrl</B><P> + 1 + + + + + + + --enable-spinctrl + wxSpinCtrl + + + + 1 + 1 + wxUSE_STATBOX + <B>wxStaticBox</B><P> + 1 + + + + + + + --enable-statbox + wxStaticBox + + + + 1 + 1 + wxUSE_STATLINE + <B>wxStaticLine</B><P> + 1 + + + + + + + --enable-statline + wxStaticBitmap + + + + 1 + 1 + wxUSE_STATTEXT + <B>wxStaticText</B><P> + 1 + + + + + + + --enable-stattext + wxStaticText + + + + 1 + 1 + wxUSE_STATBMP + <B>wxStaticBitmap</B><P> + 1 + + + + + + + --enable-staticbmp + wxStaticBitmap + + + + 1 + 1 + wxUSE_TEXTCTRL + <B>wxTextCtrl</B><P> + 1 + + + + + + + --enable-textctrl + wxTextCtrl + + + + 1 + 1 + wxUSE_TOGGLEBTN + <B>wxToggleButton</B><P> + 1 + + + + + + + --enable-togglebtn + wxToggleButton + + + + 1 + 1 + wxUSE_TREECTRL + <B>wxTreeCtrl</B><P> + 1 + wxUSE_IMAGLIST + + + + + + --enable-treectrl + wxTreeCtrl + + + + + + 1 + 0 + Imaging + <B>Imaging</B><P> + +Features relating to images + 1 + + + + + + + + + + + 1 + 1 + wxUSE_IMAGLIST + <B>wxImageList</B><P> + +This class is needed by wxNotebook, wxTreeCtrl and wxListCtrl. + + 1 + + + + + + + --enable-imaglist + wxImageList + + + + 0 + 1 + wxUSE_METAFILE + <B>wxMetaFile</B><P> + +This option is relevant on MS Windows only.<P> + +Windows supports the graphics format known as metafile which is, though not portable, is widely used under Windows and so is supported by wxWin (under Windows only, of course). Win16 (Win3.1) used the so-called "Window MetaFiles" or WMFs which were replaced with "Enhanced MetaFiles" or EMFs in + Win32 (Win9x, NT, 2000). Both of these are supported in wxWin and, by default, WMFs will be used under Win16 and EMFs under Win32. This may be changed by setting wxUSE_WIN_METAFILES_ALWAYS to 1 and/or setting +wxUSE_ENH_METAFILE to 0. You may also set wxUSE_METAFILE to 0 to not compile in any metafile related classes at all.<P> + +Default: 1 for wxUSE_ENH_METAFILE and 0 for wxUSE_WIN_METAFILES_ALWAYS.<P> + +Recommended setting: default or 0 for everything for portable programs. + + 1 + + + + + + __WXMSW__ + --enable-metafile + wxMetaFile + + + 0 + 1 + wxUSE_ENH_METAFILE + <B>wxEnhMetaFile</B><P> + +Enhanced metafile (recommended). + 1 + + + + + + __WXMSW__ + + wxMetaFile + + + + 0 + 1 + wxUSE_WIN_METAFILES_ALWAYS + This option is obsolete. Set to 0. + 1 + + + + + + __WXMSW__ + + wxMetaFile + + + + + 1 + 1 + wxUSE_DRAGIMAGE + <B>wxDragImage</B><P> + +This class is useful for implementing drag operations.<P> + +Default: 1. Recommended value: 1. + 1 + + + + + + + --enable-dragimage + wxDragImage + + + + 1 + 1 + wxUSE_IMAGE + <B>wxImage</B><P> + +wxImage supports many different image formats which can be configured at compile-time. BMP and XPM are always supported, others are optional and can be safely disabled if you don't plan to use images in such format sometimes saving substantial amount of code in the final library.<P> + +Some formats require an extra library which is included in wxWin sources which is mentioned if it is the case.<P> + +Default: 1 + 1 + + + + + + + --enable-image + wxImage + + + 1 + 1 + wxUSE_LIBPNG + <B>PNG support</B><P> + +Set to 1 for PNG format support (requires libpng). Also requires wxUSE_ZLIB. + + 1 + + + + + + + --with-libpng + wxImage + + 0 + + + 1 + 1 + wxUSE_LIBJPEG + <B>JPEG support</B><P> + +Set to 1 for JPEG format support (requires libjpeg). + + 1 + + + + + + + --with-libjpeg + wxImage + + 0 + + + 1 + 1 + wxUSE_LIBTIFF + <B>TIFF support</B><P> + +Set to 1 for TIFF format support (requires libtiff). + + 1 + + + + + + + --with-libtiff + wxImage + + 0 + + + 1 + 1 + wxUSE_GIF + <B>GIF support</B><P> + +Set to 1 for read-only GIF format support. + + 1 + + + + + + + --enable-gif + wxImage + + + + 1 + 1 + wxUSE_PNM + <B>PNM support</B><P> + +Set to 1 for PNM format support. + + 1 + + + + + + + --enable-pnm + wxImage + + + + 1 + 1 + wxUSE_PCX + <B>PCX support</B><P> + +Set to 1 for PCX format support. + + 1 + + + + + + + --enable-pcx + wxImage + + + + 1 + 1 + wxUSE_IFF + <B>IFF support</B><P> + + Set to 1 for IFF (Amiga) format support. + + 1 + + + + + + + --enable-iff + wxImage + + + + 1 + 1 + wxUSE_XPM + <B>XPM support</B><P> + +Set to 1 for XPM format support. + + 1 + + + + + + + --enable-xpm + wxImage + + + + 0 + 1 + wxUSE_ICO_CUR + <B>MS Windows icons and cursors support</B><P> + +Set to 1 for MS Icons and Cursors format support. + 1 + + + + + + __WXMSW__ + --enable-icocur + wxImage + + + + + 1 + 1 + wxUSE_PALETTE + <B>wxPalette</B><P> + +Set to 1 to enable the wxPalette class. + + 1 + + + + + + + --enable-palette + wxPalette + + + + + 1 + 0 + Common dialogs + <B>Common dialogs</B><P> + +Controls options relating to common dialogs, such +wxColourDialog and wxDirDialog. + 1 + + + + + + + + Common dialogs overview + + + 1 + 0 + wxUSE_GENERIC_DIALOGS_IN_MSW + <B>Generic dialog support in Windows</B><P> + +Define 1 to use generic dialogs in Windows, even though they duplicate native common dialog (e.g. wxColourDialog). This is mainly useful for testing.<P> + +Default: 0. Recommended setting: 0 + + 1 + + + + + + + + Common dialogs overview + + + + 1 + 1 + wxUSE_COMMON_DIALOGS + <B>Common dialogs</B><P> + +On rare occasions (e.g. using DJGPP) may want to omit common dialogs (e.g. file selector, printer dialog). Switching this off also switches off the printing architecture and interactive wxPrinterDC. +This relates to the native common dialogs and not to generic dialogs such as wxBusyInfo. +<P> + +Default: 1. Recommended setting: 1 (unless it really doesn't work) + + 1 + + + + + + + --enable-commondlg + Common dialogs overview + + + + 1 + 1 + wxUSE_BUSYINFO + <B>wxBusyInfo</B><P> + +wxBusyInfo displays window with a message when the app is busy. Works in the same way as wxBusyCursor. + + 1 + + + + + + + --enable-busyinfo + wxBusyInfo + + + + 1 + 1 + wxUSE_CHOICEDLG + <B>Single and multiple choice dialogs</B><P> + + Default: 1. Recommended setting: 1 (used in the library itself) + + 1 + + + + + + + --enable-choicedlg + Dialog functions + + + + 1 + 1 + wxUSE_COLOURDLG + <B>wxColourDialog</B><P> + +Use the colour picker dialog.<P> + +Default: 1. Recommended setting: 1 + + 1 + + + + + + + --enable-coldlg + wxColourDialog + + + + 1 + 1 + wxUSE_DIRDLG + <B>wxDirDlg</B><P> + +A class for getting a directory name from the user.<P> + +Default: 1. Recommended setting: 1. + + 1 + + + + + + + --enable-dirdlg + wxDirDialog + + + + 1 + 1 + wxUSE_FILEDLG + <B>wxFileDialog</B><P> + +Open and save file dialogs.<P> + +Default: 1. Recommended setting: 1 (used in many places in the library itself) + + 1 + + + + + + + --enable-filedlg + wxFileDialog + + + + 1 + 1 + wxUSE_FINDREPLDLG + <B>wxFindReplaceDialog</B><P> + + Default: 1. Recommended setting: 1 (but may be safely set to 0) + + 1 + + + + + + + --enable-finddlg + wxFindReplaceDialog + + + + 1 + 1 + wxUSE_FONTDLG + <B>wxFontDialog</B><P> + +Font picker dialog.<P> + +Default: 1. Recommended setting: 1 (used in the library itself) + + 1 + + + + + + + --enable-fontdlg + wxFontDialog + + + + 1 + 1 + wxUSE_MSGDLG + <B>wxMessageDialog and wxMessageBox</B><P> + +Default: 1. Recommended setting: 1 (used in the library itself) + + 1 + + + + + + + + wxMessageDialog + + + + 1 + 1 + wxUSE_PROGRESSDLG + <B>wxProgressDialog</B><P> + +Progress dialog class for lengthy operations + + 1 + + + + + + + --enable-msgdlg + wxProgressDialog + + + + 1 + 1 + wxUSE_STARTUP_TIPS + <B>wxShowTip</B><P> + +Support for startup tips. + + + 1 + + + + + + + --enable-tipdlg + Dialog functions + + + + 1 + 1 + wxUSE_TEXTDLG + <B>wxTextEntryDialog</B><P> + +Text entry dialog and wxGetTextFromUser function. + + 1 + + + + + + + --enable-textdlg + wxTextEntryDialog + + + + 1 + 1 + wxUSE_NUMBERDLG + <B>wxGetNumberFromUser</B><P> + +Number entry dialog. This option is not currently used. + 1 + + + + + + + --enable-numberdlg + Dialog functions + + + + 1 + 1 + wxUSE_SPLASH + <B>wxSplashScreen</B><P> + +A splash window. + 1 + + + + + + + --enable-splash + wxSplashScreen + + + + 1 + 1 + wxUSE_WIZARDDLG + <B>wxWizard</B><P> + +The wizard dialog. + 1 + + + + + + + --enable-wizarddlg + wxWizard + + + + + 1 + 0 + Large components + <B>Frameworks</B><P> + +This category consists of large components, such as the printing and document/view frameworks. + 1 + + + + + + + + + + + 1 + 1 + wxUSE_DOC_VIEW_ARCHITECTURE + <B>Document/view architecture</B><P> + 1 + wxUSE_MENUS,wxUSE_FILEDLG + + + + + + --enable-docview + Document/view overview + + + + 1 + 1 + wxUSE_MDI_ARCHITECTURE + <B>Multiple Document Interface</B><P> + 1 + + + + + + + --enable-mdi + wxMDIParentFrame + + + + 1 + 1 + wxUSE_PRINTING_ARCHITECTURE + <B>Print/preview architecture code</B><P> + +Your application can still print without this, but it is highly recommended that you use the framework provided. + + 1 + wxUSE_COMBOBOX + + + + + + --enable-printarch + Printing overview + + + + 1 + 1 + wxUSE_HTML + <B>wxHTML</B><P> + +The wxHTML subsystem consists of wxHtmlWindow, wxHtmlHelpController, wxHtmlEasyPrinting and other components. + 1 + wxUSE_FILESYSTEM + + + + + + --enable-html + wxHTML Overview + + + + + 1 + 0 + Miscellaneous + <B>Miscellaneous features</B><P> + 1 + + + + + + + + + + + 1 + 1 + wxUSE_CMDLINE_PARSER + <B>Support for command line parsing using wxCmdLineParser class</B><P> + +Default: 1 Recommended setting: 1 (can be set to 0 if you don't use the command line) + + 1 + + + + + + + --enable-cmdline + wxCmdLineParser + + + + 1 + 1 + wxUSE_THREADS + <B>Support for multithreaded applications</B><P> + +If 1, compile in thread classes (thread.h) and +make the library a bit more thread safe. Although thread +support is quite stable by now, you may still consider recompiling the library without it if you have no use for it - this will result in a +somewhat smaller and faster operation.<P> + +Default: 1. Recommended setting: 0 unless you do plan to develop MT applications + + 1 + + + + + + + --enable-threads + wxThread + + + + 1 + 1 + wxUSE_INTL + <B>Internationlisation support</B><P> + +_() macro, wxLocale class. Requires wxTextFile. + + 1 + + + + + + + --enable-intl + Internationalization + + + + 1 + 1 + wxUSE_DYNLIB_CLASS + <B>wxDynamicLibrary</B><P> + +Compiles in classes for run-time DLL loading and function calling.<P> + +Default: 1. Required by wxUSE_DIALUP_MANAGER. + + 1 + + + + + + + --enable-dynlib + wxDynamicLibrary + + + + 1 + 1 + wxUSE_DYNAMIC_LOADER + <B>Dynamic loader</B><P> + +Experimental, don't use for now + 1 + + + + + + + --enable-dynamicloader + wxDynamicLibrary + + + + 1 + 1 + wxUSE_FONTMAP + <B>wxFontMapper</B><P> + +Default: 1 + 1 + + + + + + + --enable-fontmap + wxFontMapper + + + + 1 + 1 + wxUSE_SYSTEM_OPTIONS + <B>wxSystemOptions</B><P> + +A class for setting miscellaneous options that do not fit in with the wxWindows API. For example, drawing optimizations can be tweaked using this class. + 1 + + + + + + + --enable-sysoptions + wxSystemOptions + + + + 1 + 1 + wxUSE_WAVE + <B>wxWave</B><P> + +Simple .wav class for short sounds. + 1 + + + + + + + --enable-wave + wxWave + + + + 1 + 1 + wxUSE_ACCEL + wxAcceleratorTable/wxAcceleratorTableEntry classes and support for them in wxMenu(Bar) + 1 + + + + + + + --enable-accel + wxAcceleratorTable + + + + 1 + 1 + wxUSE_CARET + A class implementing a "cursor" in a text control (called caret +under Windows). + 1 + + + + + + + --enable-caret + wxCaret + + + + 1 + 1 + wxUSE_DISPLAY + <B>wxDisplay</B><P> + +The wxDisplay class allows enumeration of all displays on a system and working with them.<P> + +Default: 0 because it isn't yet implemented on all platforms.<P> + +Recommended setting: 1 if you need it, can be safely set to 0 otherwise + + 1 + + + + + + + --enable-display + wxDisplay + + + + 1 + 1 + wxUSE_MENUS + <B>wxMenu</B><P> + +wxMenu, wxMenuBar. Should not be disabled. + 1 + + + + + + + --enable-menus + wxMenu + + + + 1 + 1 + wxUSE_VALIDATORS + <B>wxValidator and derived classes</B><P> + 1 + + + + + + + --enable-validators + wxValidator + + + + 1 + 0 + wxUSE_ACCESSIBILITY + <B>Accessibility</B><P> + +Use the wxAccessible class for enhanced and customisable accessibility. Currently available on MS Windows only.<P> + +Requires wxUSE_OLE.<P> + +Default: 0. Recommended setting: 0 + + 1 + + + + + + + --enable-accessibility + wxAccessible + + + + 1 + 1 + wxUSE_SNGLINST_CHECKER + <B>wxSingleInstanceChecker</B><P> + +wxSingleInstanceChecker class allows the application to verify at startup if another program instance is running. Currently only available under MS Windows.<P> + +Default: 1. Recommended value: 1 + + 1 + + + + + + + --enable-snglinst + wxSingleInstanceChecker + + + + 1 + 1 + wxUSE_CONSTRAINTS + <B>Layout constraints</B><P> + +The old constraint-based layout system is deprecated in favour of sizers, and may be safely disabled since they are not used within wxWindows any more.<P> + +Default: 1 + 1 + + + + + + + --enable-constraints + Constraints overview + + + + 1 + 1 + wxUSE_SPLINES + <B>Splines</B><P> + +Enables spline drawing code in wxDC.<P> + +Default: 1 + 1 + + + + + + + --enable-splines + wxDC + + + + 1 + 1 + wxUSE_DYNAMIC_CLASSES + <B>Dynamic classes</B><P> + +If 1, enables provision of run-time type information. +NOW MANDATORY: don't change. + + 1 + + + + + + + + Run time class information overview + + + + 1 + 1 + wxUSE_ZLIB + <B>Zlib, wxZlibInputStream, wxZlibOutputStream</B><P> + +Default: 1 + 1 + + + + + + + --with-zlib + + + 0 + + + + 1 + 0 + Data transfer + <B>Data transfer</B><P> + +Data transfer encompasses clipboard and drag-and-drop operations. + 1 + + + + + + + + wxDataObject overview + + + 1 + 1 + wxUSE_CLIPBOARD + <B>wxClipboard</B><P> + +Clipboard copy/paste.<P> + +Default: 1. Recommended value: 1 + 1 + wxUSE_DATAOBJ + + + + + + --enable-clipboard + wxClipboard + + + + 1 + 1 + wxUSE_DATAOBJ + <B>wxDataObject</B><P> + +Use wxDataObject and related classes. Needed for clipboard and OLE drag and drop.<P> + +Default: 1. Recommended value: 1 + + 1 + wxUSE_OLE + + + + + + --enable-dataobj + wxDataObject + + + + 1 + 1 + wxUSE_DRAG_AND_DROP + <B>Drag and drop</B><P> + + Use wxDropTarget and wxDropSource classes for drag and drop (this is different from "built in" drag and drop in wxTreeCtrl which is always available). Requires wxUSE_DATAOBJ.<P> + + Default: 1. Recommended setting: 1 + + 1 + wxUSE_OLE,wxUSE_DATAOBJ + + + + + + --enable-dnd + Drag and drop overview + + + + + 1 + 0 + Help + + 1 + + + + + + + + + + + 1 + 1 + wxUSE_HELP + <B>Online help</B><P> + +Enables all online help (but not context-sensitive help).<P> + +Default: 1. + 1 + + + + + + + --enable-help + wxHelpController + + + 0 + 1 + wxUSE_MS_HTML_HELP + <B>MS HTML Help</B><P> + +Enables the wxCHMHelpController class.<P> + +Default: 1. + 1 + wxUSE_DYNAMIC_LOADER + + + + + __WXMSW__ + --enable-mshtmlhelp + wxHelpController + + + + 1 + 1 + wxUSE_WXHTML_HELP + <B>wxHTML Help</B><P> + +Enables the built-in HTML help controller.<P> + +Default: 1 + 1 + wxUSE_HTML,wxUSE_COMBOBOX,wxUSE_NOTEBOOK,wxUSE_FILEDLG + + + + + + --enable-htmlhelp + wxHtmlHelpController + + + + + 1 + 1 + wxUSE_TOOLTIPS + <B>wxToolTip</B> + 1 + + + + + + + --enable-tooltips + wxToolTip + + + + + 1 + 0 + Input devices + <B>Input devices</B><P> + +Settings for various input devices. + 1 + + + + + + + + + + + 0 + 1 + wxUSE_MOUSEWHEEL + <B>Mousewheel support</B><P> + +Enables mousewheel support. So far this is only supported in MS Windows.<P> + +Default: 1 + 1 + + + + + + __WXMSW__ + + wxMouseEvent + + + + 1 + 1 + wxUSE_JOYSTICK + <B>wxJoystick</B><P> + +Under wxGTK, this requires wxUSE_THREADS to be enabled.<P> + +Default: 1 + 1 + wxUSE_THREADS + + + + + + --enable-joystick + wxJoystick + + + + + 1 + 0 + Printing + <B>Printing settings</B><P> + +See also: <font color="#0000FF">Large components</font> for wxUSE_PRINTING_ARCHITECTURE. + 1 + + + + + + + + + + + 1 + 1 + wxUSE_POSTSCRIPT + <B>PostScript</B><P> + +Enables PostScript printing support. + 1 + + + + + + + --enable-postscript + wxPostScriptDC + + + 1 + 0 + wxUSE_AFM_FOR_POSTSCRIPT + <B>AFM support</B><P> + +Set to 1 to use font metric files in GetTextExtent. + + 0 + + + + + + + + wxPostScriptDC + + + + 1 + 0 + wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW + <B>PostScript under MS Windows</B><P> + +Enables PostScript on MS Windows. + 1 + + + + + + + + wxPostScriptDC + + + + + + 1 + 0 + Database + + 1 + + + + + + + + + + + 1 + 0 + wxUSE_ODBC + <B>ODBC support</B><P> + +Enables wxDb and related classes for +accessing ODBC on all supported platforms.<P> + +Default: 0 + 1 + + wxUSE_UNICODE + + + + + --with-odbc + Database classes overview + + + 0 + 0 + wxODBC_FWD_ONLY_CURSORS + <B>wxDb cursor scrolling</B><P> + +For backward compatibility reasons, this parameter now only controls the default scrolling method used by cursors. This default behavior can be overriden by setting the second param of wxDb::wxDbGetConnection() or wxDb() constructor to indicate whether the connection (and any wxDbTables that use the connection) should support forward only scrolling of cursors, +or both forward and backward support for backward scrolling cursors is dependent on the data source as well as the ODBC driver being used.<P> + +Default: 1 + + 1 + + + + + + + + Database classes overview + + + + 0 + 0 + wxODBC_BACKWARD_COMPATABILITY + <B>ODBC classes backward compatibility</B><P> + +Set to 1 to use the deprecated classes, enum types, function, +member variables. With a setting of 1, full backward compatability with the 2.0.x release is possible. It is STRONGLY recommended that this be set to 0, as future development will be done only on the non-deprecated functions/classes/member variables/etc.<P> + +Default: 0 + + 1 + + + + + + + + Database classes overview + + + + + + 1 + 0 + Platform-specific + + 1 + + + + + + + + + + + 1 + 0 + wxMSW + + 1 + + + + + + + + + + + 0 + 1 + wxUSE_OWNER_DRAWN + <B>Owner-drawn controls</B><P> + +Set this to 1 to enable support for the owner-drawn menu and listboxes. This is required by wxUSE_CHECKLISTBOX.<P> + +Default: 1. Recommended setting: 1, set to 0 for a small library size reduction. + + 1 + + + + + + __WXMSW__ + + + + + + 0 + 1 + wxUSE_RICHEDIT + <B>Rich edit control support</B><P> + +Set this to 1 to use RICHEDIT controls for wxTextCtrl with style wxTE_RICH which allows to put more than ~32Kb of text in it even under Win9x (NT doesn't have such limitation).<P> + +Default: 1 for compilers which support it Recommended setting: 1, only set it to 0 if your compiler doesn't have or can't compile richedit.h. + + 1 + + + + + + __WXMSW__ + + + + + + 0 + 1 + wxUSE_RICHEDIT2 + <B>Rich edit control version 2</B><P> + +Enable rich edit version 2.0.<P> + +Default: 1 + 1 + + + + + + __WXMSW__ + + + + + + 0 + 0 + wxUSE_MFC + <B>MFC interoperation</B><P> + +Set this to 1 if you want to use wxWindows and MFC in the same program. This will override some other settings. + +Default: 0. Recommended setting: 0 unless you really have to use MFC + + 0 + + + + + + __WXMSW__ + + + + + + 0 + 1 + wxUSE_OLE + <B>OLE support</B><P> + +Set this to 1 for generic OLE support: this is required for drag-and-drop, clipboard, OLE Automation. Only set it to 0 if your compiler is very old and can't compile/doesn't have the OLE headers.<P> + +Default: 1. Recommended setting: 1 + + 1 + + + + + + __WXMSW__ + --enable-ole + + + + + 0 + 1 + wxUSE_UXTHEME + <B>MS Windows XP UX Theme Engine support</B><P> + +Set to 1 to compile MS Windows XP theme engine support. + + 1 + + + + + + __WXMSW__ + + + + + + 0 + 1 + wxUSE_UXTHEME_AUTO + <B>MS Windows XP UX Theme Engine auto-adaptation</B><P> + +Set to 1 to auto-adapt to MS Windows XP themes where possible +(notably, wxNotebook pages). + + 1 + wxUSE_UXTHEME + + + + + __WXMSW__ + + + + + + 0 + 1 + wxUSE_DC_CACHEING + Caches device contexts to improve performance.<P> + +This is a Windows-only option.<P> + +Default: 1 + 1 + + + + + + __WXMSW__ + + + + + + 0 + 0 + wxUSE_DIB_FOR_BITMAP + Set this to 1 to enable the use of DIB's for wxBitmap to support +bitmaps > 16MB on Win95/98/Me. Set to 0 to use DDB's only.<P> + +Default: 0 + + 0 + + + + + + __WXMSW__ + + + + + + + 1 + 0 + wxGTK + + 1 + + + + + + + + + + + 1 + 1 + wxUSE_GTKTEST + <B>GTK+ test</B><P> + +Try to compile and run a test GTK program. + 1 + + + + + + __WXGTK__ + --enable-gtktest + + + + + 1 + 0 + wxUSE_GTKPREFIX + <B>GTK+ prefix</B><P> + +Prefix where GTK+ is installed (optional). Type the prefix into the <b>value</b> field. + 0 + + + + + + __WXGTK__ + --with-gtk-prefix + + + + + + 1 + 0 + wxUSE_GTKEXECPREFIX + <B>GTK+ exec prefix</B><P> + +Exec prefix where GTK+ is installed (optional). Type the prefix into the <b>value</b> field. + 0 + + + + + + __WXGTK__ + --with-gtk-exec-prefix + + + + + + 1 + 0 + wxUSE_LIBICONV_PREFIX + <B>libiconv prefix</B><P> + +Search for libiconv in DIR/include and DIR/lib. Type the prefix into the <b>value</b> field. + 0 + + + + + + + --with-libiconv-prefix + + + + + + 1 + 1 + wxUSE_X + <B>Use X</B><P> + +Use the X window system. + 1 + + + + + + __WXGTK__ + --with-x + + + + + + + diff --git a/utils/configtool/docs/gpl.txt b/utils/configtool/docs/gpl.txt new file mode 100644 index 0000000000..b8cf3a1ab2 --- /dev/null +++ b/utils/configtool/docs/gpl.txt @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 675 Mass Ave, Cambridge, MA 02139, 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 + + Appendix: 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) 19yy + + 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., 675 Mass Ave, Cambridge, MA 02139, 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) 19yy 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. diff --git a/utils/configtool/docs/lgpl.txt b/utils/configtool/docs/lgpl.txt new file mode 100644 index 0000000000..d43cdf091b --- /dev/null +++ b/utils/configtool/docs/lgpl.txt @@ -0,0 +1,517 @@ + + GNU LIBRARY GENERAL PUBLIC LICENSE + ================================== + Version 2, June 1991 + + Copyright (C) 1991 Free Software Foundation, Inc. + 675 Mass Ave, Cambridge, MA 02139, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the library GPL. It is + numbered 2 because it goes with version 2 of the ordinary GPL.] + + Preamble + +The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General +Public Licenses are intended to guarantee your freedom to share +and change free software--to make sure the software is free for +all its users. + +This license, the Library General Public License, applies to +some specially designated Free Software Foundation software, and +to any other libraries whose authors decide to use it. You can +use it for your libraries, 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 library, or if you +modify it. + +For example, if you distribute copies of the library, whether +gratis or for a fee, you must give the recipients all the rights +that we gave you. You must make sure that they, too, receive or +can get the source code. If you link a program with the +library, you must provide complete object files to the +recipients so that they can relink them with the library, after +making changes to the library and recompiling it. And you must +show them these terms so they know their rights. + +Our method of protecting your rights has two steps: (1) +copyright the library, and (2) offer you this license which +gives you legal permission to copy, distribute and/or modify the +library. + +Also, for each distributor's protection, we want to make certain +that everyone understands that there is no warranty for this +free library. If the library is modified by someone else and +passed on, we want its recipients to know that what they have is +not the original version, 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 companies +distributing free software will individually obtain patent +licenses, thus in effect transforming the program into +proprietary software. To prevent this, we have made it clear +that any patent must be licensed for everyone's free use or not +licensed at all. + +Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License, which was designed for +utility programs. This license, the GNU Library General Public +License, applies to certain designated libraries. This license +is quite different from the ordinary one; be sure to read it in +full, and don't assume that anything in it is the same as in the +ordinary license. + +The reason we have a separate public license for some libraries +is that they blur the distinction we usually make between +modifying or adding to a program and simply using it. Linking a +program with a library, without changing the library, is in some +sense simply using the library, and is analogous to running a +utility program or application program. However, in a textual +and legal sense, the linked executable is a combined work, a +derivative of the original library, and the ordinary General +Public License treats it as such. + +Because of this blurred distinction, using the ordinary General +Public License for libraries did not effectively promote +software sharing, because most developers did not use the +libraries. We concluded that weaker conditions might promote +sharing better. + +However, unrestricted linking of non-free programs would deprive +the users of those programs of all benefit from the free status +of the libraries themselves. This Library General Public +License is intended to permit developers of non-free programs to +use free libraries, while preserving your freedom as a user of +such programs to change the free libraries that are incorporated +in them. (We have not seen how to achieve this as regards +changes in header files, but we have achieved it as regards +changes in the actual functions of the Library.) The hope is +that this will lead to faster development of free libraries. + +The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference +between a "work based on the library" and a "work that uses the +library". The former contains code derived from the library, +while the latter only works together with the library. + +Note that it is possible for a library to be covered by the +ordinary General Public License rather than by this special one. + + GNU LIBRARY GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + +0. This License Agreement applies to any software library which +contains a notice placed by the copyright holder or other +authorized party saying it may be distributed under the terms of +this Library General Public License (also called "this +License"). Each licensee is addressed as "you". + +A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application +programs (which use some of those functions and data) to form +executables. + +The "Library", below, refers to any such software library or +work which has been distributed under these terms. A "work +based on the Library" means either the Library or any derivative +work under copyright law: that is to say, a work containing the +Library or a portion of it, either verbatim or with +modifications and/or translated straightforwardly into another +language. (Hereinafter, translation is included without +limitation in the term "modification".) + +"Source code" for a work means the preferred form of the work +for making modifications to it. For a library, 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 library. + +Activities other than copying, distribution and modification are +not covered by this License; they are outside its scope. The +act of running a program using the Library is not restricted, +and output from such a program is covered only if its contents +constitute a work based on the Library (independent of the use +of the Library in a tool for writing it). Whether that is true +depends on what the Library does and what the program that uses +the Library does. + +1. You may copy and distribute verbatim copies of the Library's +complete 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 distribute a copy of this License +along with the Library. + +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 Library or any +portion of it, thus forming a work based on the Library, 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) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the +Library, 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 Library, 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 Library. + +In addition, mere aggregation of another work not based on the +Library with the Library (or with a work based on the Library) +on a volume of a storage or distribution medium does not bring +the other work under the scope of this License. + +3. You may opt to apply the terms of the ordinary GNU General +Public License instead of this License to a given copy of the +Library. To do this, you must alter all the notices that refer +to this License, so that they refer to the ordinary GNU General +Public License, version 2, instead of to this License. (If a +newer version than version 2 of the ordinary GNU General Public +License has appeared, then you can specify that version instead +if you wish.) Do not make any other change in these notices. + +Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to +all subsequent copies and derivative works made from that copy. + +This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + +4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable +form under the terms of Sections 1 and 2 above provided that you +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. + +If distribution of 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 satisfies the +requirement to distribute the source code, even though third +parties are not compelled to copy the source along with the +object code. + +5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being +compiled or linked with it, is called a "work that uses the +Library". Such a work, in isolation, is not a derivative work +of the Library, and therefore falls outside the scope of this +License. + +However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library +(because it contains portions of the Library), rather than a +"work that uses the library". The executable is therefore +covered by this License. Section 6 states terms for distribution +of such executables. + +When a "work that uses the Library" uses material from a header +file that is part of the Library, the object code for the work +may be a derivative work of the Library even though the source +code is not. Whether this is true is especially significant if +the work can be linked without the Library, or if the work is +itself a library. The threshold for this to be true is not +precisely defined by law. + +If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small +inline functions (ten lines or less in length), then the use of +the object file is unrestricted, regardless of whether it is +legally a derivative work. (Executables containing this object +code plus portions of the Library will still fall under Section +6.) + +Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of +Section 6. Any executables containing that work also fall under +Section 6, whether or not they are linked directly with the +Library itself. + +6. As an exception to the Sections above, you may also compile +or link a "work that uses the Library" with the Library to +produce a work containing portions of the Library, and +distribute that work under terms of your choice, provided that +the terms permit modification of the work for the customer's own +use and reverse engineering for debugging such modifications. + +You must give prominent notice with each copy of the work that +the Library is used in it and that the Library and its use are +covered by this License. You must supply a copy of this +License. If the work during execution displays copyright +notices, you must include the copyright notice for the Library +among them, as well as a reference directing the user to the +copy of this License. Also, you must do one of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + c) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + d) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + +For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. 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. + +It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you +cannot use both them and the Library together in an executable +that you distribute. + +7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other +library facilities not covered by this License, and distribute +such a combined library, provided that the separate distribution +of the work based on the Library and of the other library +facilities is otherwise permitted, and provided that you do +these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + +8. You may not copy, modify, sublicense, link with, or +distribute the Library except as expressly provided under this +License. Any attempt otherwise to copy, modify, sublicense, +link with, or distribute the Library 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. + +9. 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 Library or its derivative works. These +actions are prohibited by law if you do not accept this +License. Therefore, by modifying or distributing the Library +(or any work based on the Library), you indicate your acceptance +of this License to do so, and all its terms and conditions for +copying, distributing or modifying the Library or works based on +it. + +10. Each time you redistribute the Library (or any work based on +the Library), the recipient automatically receives a license +from the original licensor to copy, distribute, link with or +modify the Library 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. + +11. 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 Library at all. For example, if a patent license +would not permit royalty-free redistribution of the Library 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 Library. + +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. + +12. If the distribution and/or use of the Library is restricted +in certain countries either by patents or by copyrighted +interfaces, the original copyright holder who places the Library +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. + +13. The Free Software Foundation may publish revised and/or new +versions of the Library 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 +Library 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 +Library does not specify a license version number, you may +choose any version ever published by the Free Software +Foundation. + +14. If you wish to incorporate parts of the Library into other +free programs whose distribution conditions are incompatible +with these, 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 + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "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 +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. 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 LIBRARY 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 +LIBRARY (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 LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + Appendix: How to Apply These Terms to Your New Libraries + +If you develop a new library, and you want it to be of the +greatest possible use to the public, we recommend making it free +software that everyone can redistribute and change. You can do +so by permitting redistribution under these terms (or, +alternatively, under the terms of the ordinary General Public +License). + +To apply these terms, attach the following notices to the +library. 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 library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, 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 License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + diff --git a/utils/configtool/docs/licence.txt b/utils/configtool/docs/licence.txt new file mode 100644 index 0000000000..c91deed0bc --- /dev/null +++ b/utils/configtool/docs/licence.txt @@ -0,0 +1,53 @@ + wxWindows Library Licence, Version 3 + ==================================== + + Copyright (c) 1998 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 of the Licence, or (at your option) any later version of + the Licence as published by the copyright holders of version 3 of the + Licence document. + + 2. The exception is that you may use, copy, link, modify and distribute + under the user's 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. + + diff --git a/utils/configtool/docs/licendoc.txt b/utils/configtool/docs/licendoc.txt new file mode 100644 index 0000000000..5bfa143812 --- /dev/null +++ b/utils/configtool/docs/licendoc.txt @@ -0,0 +1,60 @@ + wxWindows Free Documentation Licence, Version 3 + =============================================== + + Copyright (c) 1998 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 FREE DOCUMENTATION LICENCE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 1. Permission is granted to make and distribute verbatim copies of this + manual or piece of documentation provided any copyright notice and this + permission notice are preserved on all copies. + + 2. Permission is granted to process this file or document through a + document processing system and, at your option and the option of any third + party, print the results, provided a printed document carries a copying + permission notice identical to this one. + + 3. Permission is granted to copy and distribute modified versions of this + manual or piece of documentation under the conditions for verbatim + copying, provided also that any sections describing licensing conditions + for this manual, such as, in particular, the GNU General Public Licence, + the GNU Library General Public Licence, and any wxWindows Licence are + included exactly as in the original, and provided that the entire + resulting derived work is distributed under the terms of a permission + notice identical to this one. + + 4. Permission is granted to copy and distribute translations of this + manual or piece of documentation into another language, under the above + conditions for modified versions, except that sections related to + licensing, including this paragraph, may also be included in translations + approved by the copyright holders of the respective licence documents in + addition to the original English. + + WARRANTY DISCLAIMER + + 5. BECAUSE THIS MANUAL OR PIECE OF DOCUMENTATION IS LICENSED FREE OF CHARGE, + THERE IS NO WARRANTY FOR IT, TO THE EXTENT PERMITTED BY APPLICABLE LAW. + EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER + PARTIES PROVIDE THIS MANUAL OR PIECE OF DOCUMENTATION "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 MANUAL OR PIECE OF DOCUMENTATION IS WITH YOU. SHOULD THE MANUAL OR + PIECE OF DOCUMENTATION PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL + NECESSARY SERVICING, REPAIR OR CORRECTION. + + 6. 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 MANUAL OR PIECE OF DOCUMENTATION 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 + MANUAL OR PIECE OF DOCUMENTATION (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 A PROGRAM BASED ON THE MANUAL OR PIECE OF + DOCUMENTATION TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR + OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + diff --git a/utils/configtool/docs/manual/Makefile b/utils/configtool/docs/manual/Makefile new file mode 100644 index 0000000000..c3f50f7462 --- /dev/null +++ b/utils/configtool/docs/manual/Makefile @@ -0,0 +1,46 @@ +# +# File: Makefile +# Author: Julian Smart +# Created: 1999 +# +# Makefile : Builds wxWindows configuration tool manual +# + +DOCDIR=.. +LOCALDOCDIR=. + +DOCSOURCES=configtool.tex + +all: configtool.chm configtool.htb + +hlp: configtool.hlp +htb: configtool.htb +html: configtool.html +htmlhelp: configtool.chm +pdfrtf: configtool_rtf.rtf + +configtool.hlp: configtool.rtf configtool.hpj + rm -f configtool.ph + -hcw /E /C configtool.hpj + +configtool.chm : configtool.html configtool.hhp + -hhc configtool.hhp +# -mkdir ..\htmlhelp + +configtool_rtf.rtf: $(DOCSOURCES) tex2rtf.ini + -tex2rtf configtool.tex configtool_rtf.rtf -twice -rtf + +configtool.rtf: $(DOCSOURCES) tex2rtf.ini + -tex2rtf configtool.tex configtool.rtf -twice -winhelp + +configtool.html: $(DOCSOURCES) tex2rtf.ini + -tex2rtf configtool.tex configtool.html -twice -html + -rm -f *.con + -rm -f *.ref + -rm -f *.con + -rm -f *.ref +# -tweakmanual + +configtool.htb: configtool_contents.html + -zip32 configtool.htb configtool*.html *.hhp *.hhk *.hhc *.gif + diff --git a/utils/configtool/docs/manual/back.bmp b/utils/configtool/docs/manual/back.bmp new file mode 100644 index 0000000000..f72ccd5370 Binary files /dev/null and b/utils/configtool/docs/manual/back.bmp differ diff --git a/utils/configtool/docs/manual/back.gif b/utils/configtool/docs/manual/back.gif new file mode 100644 index 0000000000..88a3740f91 Binary files /dev/null and b/utils/configtool/docs/manual/back.gif differ diff --git a/utils/configtool/docs/manual/bullet.bmp b/utils/configtool/docs/manual/bullet.bmp new file mode 100644 index 0000000000..13c73fc745 Binary files /dev/null and b/utils/configtool/docs/manual/bullet.bmp differ diff --git a/utils/configtool/docs/manual/bullet.gif b/utils/configtool/docs/manual/bullet.gif new file mode 100644 index 0000000000..c12be61f5f Binary files /dev/null and b/utils/configtool/docs/manual/bullet.gif differ diff --git a/utils/configtool/docs/manual/configtool.tex b/utils/configtool/docs/manual/configtool.tex new file mode 100644 index 0000000000..0dbc4b4b73 --- /dev/null +++ b/utils/configtool/docs/manual/configtool.tex @@ -0,0 +1,765 @@ +\documentstyle[a4,makeidx,verbatim,texhelp,fancyhea,mysober,mytitle]{report}% +\twocolwidtha{4cm}% +\definecolour{black}{0}{0}{0}% +\definecolour{cyan}{0}{255}{255}% +\definecolour{green}{0}{255}{0}% +\definecolour{magenta}{255}{0}{255}% +\definecolour{red}{255}{0}{0}% +\definecolour{blue}{0}{0}{200}% +\definecolour{yellow}{255}{255}{0}% +\definecolour{white}{255}{255}{255}% +%\input{psbox.tex} +\newcommand{\commandref}[2]{\helpref{{\tt $\backslash$#1}}{#2}}% +\newcommand{\commandrefn}[2]{\helprefn{{\tt $\backslash$#1}}{#2}\index{#1}}% +\newcommand{\commandpageref}[2]{\latexignore{\helprefn{{\tt $\backslash$#1}}{#2}}\latexonly{{\tt $\backslash$#1} {\it page \pageref{#2}}}\index{#1}}% +\newcommand{\indexit}[1]{#1\index{#1}}% +\newcommand{\inioption}[1]{{\tt #1}\index{#1}}% +\parskip=10pt% +\parindent=0pt% +\title{\cttitle}% +\author{(c) Julian Smart, 2003}% +\makeindex% +\begin{document}% +%\maketitle% +\begin{center} +\image{}{logo.gif} + +{\large {\bf Version \ctversion}} + +(c) Julian Smart +\end{center} + +\pagestyle{fancyplain}% +\bibliographystyle{plain}% +\pagenumbering{arabic}% +\setheader{{\it CONTENTS}}{}{}{}{}{{\it CONTENTS}}% +\setfooter{\thepage}{}{}{}{}{\thepage}% +\tableofcontents% + + +\chapter{Welcome to \ctshortname}% +\setheader{{\it Welcome}}{}{}{}{}{{\it Welcome}}% +\setfooter{\thepage}{}{}{}{}{\thepage}% + +Welcome to \ctname, the easy way to configure wxWindows. +Instead of tweaking a setup.h file, or typing a long configure +command, you can now check and uncheck options in a convenient +GUI tool, read the relevant reference document for each +option, and save the setup.h file or configure command file. + +\begin{itemize}\itemsep=0pt +\item For release information, please see \helpref{Release Notes}{releasenotes}. +\item For a tour of the main windows in \ctshortname, please see the \helpref{User Interface}{documentui} section. +%\item For a quick tutorial, go straight to \helpref{Getting Started}{gettingstarted}. +\item For tips and troubleshooting, see the \helpref{How To}{howto} section. +\end{itemize} + +\chapter{Contacts}% +\setheader{{\it Contacts}}{}{}{}{}{{\it Contacts}}% +\setfooter{\thepage}{}{}{}{}{\thepage}% + +The \ctname home page is at: + +{\tt \cturl} + +For help with \ctshortname or to report bugs, +please go to the wxWindows web site. + +\section{Credits} + +\begin{center} +{\bf (c) 2003 Julian Smart, Anthemion Software}\hrule + +{\it Designed by} + +{\bf Julian Smart} + +{\it Programmed by} + +{\bf Julian Smart} + +{\it Additional programming by} + +{\bf The wxWindows development team} + +\end{center} + +\chapter{Installation}% +\setheader{{\it Installation}}{}{}{}{}{{\it Installation}}% +\setfooter{\thepage}{}{}{}{}{\thepage}% + +{\bf On Windows:} + +Please run the installation program. This will create a program +folder called \ctname (or other name if you have chosen a different name). This +folder can be accessed via the Start menu under Programs. The +folder contains shortcuts to the program, help file, and Uninstall program. + +You can uninstall \ctshortname either by double-clicking the Uninstall \ctshortname icon +in the \ctname group, or by invoking the Windows Control Panel, +double-clicking on Add/Remove Programs, and then choosing the \ctshortname item. + +{\bf On Linux:} + +Unarchive wxconfigtool-x.xx.tar.gz to a suitable location +in your filesystem. A directory of the form wxconfigtool-x.xx +(where x.xx is the version number) will be created. + +Add the location to your PATH and run the application with +'wxconfigtool'. You may wish to set the environment variable +WXCONFIGTOOLDIR so that wxWindows Configuration Tool can find its data files. + +For example: + +\begin{verbatim} + % cd ~ + % tar xvfz wxconfigtool-1.01.tar.gz + % export WXCONFIGTOOLDIR=`pwd`/wxconfigtool-1.01 + % export PATH=$PATH:$WXCONFIGTOOLDIR + % wxconfigtool +\end{verbatim} + +If you don't want to change your PATH, you could place a +script in a location already on your PATH, such as +/usr/local/bin. For example: + +\begin{verbatim} + #!/bin/sh + # Invokes wxWindows Configuration Tool + export WXCONFIGTOOLDIR=/home/mydir/wxconfigtool-1.01 + $WXCONFIGTOOLDIR/wxconfigtool $* +\end{verbatim} + +{\bf On Mac:} + +Download and unarchive the HQX file, and drag the wxWindows Configuration Tool folder to an appropriate location +on your hard disk. Then double-click on the 'wxconfigtool' executable. + +\chapter{Release notes}\label{releasenotes}% +\setheader{{\it CHAPTER \thechapter}}{}{}{}{}{{\it CHAPTER \thechapter}}% +\setfooter{\thepage}{}{}{}{}{\thepage}% + +For licencing information, please see +the licence files in the installation directory: + +\begin{itemize}\itemsep=0pt +\item licendoc.txt +\item gpl.txt +\item lgpl.txt +\item preamble.txt +\end{itemize} + +\section{What's New?}\label{whatsnew} + +{\bf Version 1.0, June 11th 2003} + +\begin{itemize}\itemsep=10pt +\item Initial version. +\end{itemize} + +\section{Known issues}\label{knownissues} + +The following problems are known to exist: + +\begin{itemize}\itemsep=10pt +\item No issues as yet. +\end{itemize} + +\section{To Do}\label{todo} + +There are many things that could be done to make +this tool more useful, including the following. + +\begin{itemize}\itemsep=10pt +\item Allow full platform-specific dependency specification +as mentioned in \helpref{How to specify platform-specific dependencies}{platformdependencies}. +\item Allow \ctshortname to invoke configure and make, with an output +window showing build status. +\item Distinguish between template files and settings file; allow +application of template files to settings files, and vice versa. +\item Implement support for string, integer, float settings. +\item Write a configuration browser. +\item Add description, date and author information to the settings file. +\item Command-line mode with ability to change settings from +the command-line. Just like configure :-) +\item Decide on standard location for settings files. +\item Integrate with new (and old?) build systems. +\item Allow customization of font and colour. +\item Show all calculated dependencies for each config item. +\item Add a search facility. +\end{itemize} + +\section{Differences between Windows, Linux and Mac versions}\label{platformdifferences} + +Although every effort has been made to make wxWindows Configuration Tool work +the same way on different environments, some small differences +are inevitable. + +\begin{itemize}\itemsep=10pt +\item Screenshots illustrate the Windows version; the Linux +and Mac windows and dialogs will be slightly different, but with equivalent +functionality. +\item Dialogs under Windows often have a '?' button on the title +bar, for context-sensitive help. Under Linux, this button is +on the dialog itself, usually near the OK or Close button. +On the Mac, context-sensitive help is not yet supported. +\item Under Linux, online help invoked from the {\bf Help} button +in modal dialogs is itself modal. That is, you have to quit +the help window to return to the dialog. On Windows, you can +switch back to the dialog without quitting the help viewer. +\item On Windows and Linux, context menus are invoked with +right-click. On Mac, use control-click. +\end{itemize} + +\chapter{\ctshortname user interface}\label{documentui}% +\setheader{{\it CHAPTER \thechapter}}{}{}{}{}{{\it CHAPTER \thechapter}}% +\setfooter{\thepage}{}{}{}{}{\thepage}% + +This section describes the main elements of the \ctname user interface. + +The \ctshortname main window looks like this: + +\begin{center} +\image{}{screen01.png} +\end{center} + +\section{Menubar} + +%\image{}{menubar.gif} + +The \helpref{menubar}{menubarcommands} allows you to perform many functions +such as loading and saving files, creating new configuration items, +undo/redo, invoking help, and so on. Try to remember the keyboard shortcuts that are +displayed next to the menu item labels - they can save you a lot of time +and make your \ctshortname experience more natural and enjoyable. + +\section{Main toolbar} + +%\image{}{toolbar.gif} + +The main toolbar gives quick access to commonly-used commands. +If you hold your mouse pointer over the toolbar buttons, a tooltip pops up with a short description +of the button's function. + +You can choose to hide the toolbar altogether +using the {\bf View | Show Toolbar} menu command. + +You can find out more about in the \helpref{toolbar commands}{toolbarcommands} topic. + +\section{Configuration window} + +%\image{}{configwindow.gif} + +The biggest area of \ctshortname is taken up by the configuration window. + +On the left is a hierarchy of settings that can be customized. +You can check and uncheck most settings, but you will find that +many settings are disabled because they depend on other settings +being enabled (or disabled). + +As an end user, you will probably only want to enable or disable +options, but it's possible you may wish to update the structure +of the settings file itself. In which case you can use the +{\bf Edit} menu to add, remove, or rename items; and you can +add custom properties to an item, but this is usually only +useful for a developer of the tool to do. + +Undo/Redo can be applied to most editing commands, but (currently) not +enabling and disabling operations. + +There are three tabs in the main window: {\bf Properties}, {\bf Setup.h}, +and {\bf Configure}. The Properties tab contains the properties +for the selected option. Setup.h shows the setup file, +and there are buttons to allow you to copy the file to the clipboard +and regenerate the file. Similarly, the Configure tab shows +the script that will invoke configure. + +The property editor allows you to show detailed information +about the option. A description for each property is shown +when you click on the property. You can also edit property values, +either by clicking and typing, or by double-clicking or clicking +on the {\bf Edit...} button. If a special editor is defined for +the property type, it will be shown. + +You can invoke help for the selected option, by clicking +on the question mark toolbar button or the {\bf Help | Configuration Item Help} menu +item. If there is a help topic defined for the option, the +wxWindows reference manual will be opened at that topic. + +\begin{comment} +\chapter{Getting started: a step-by-step guide}\label{gettingstarted}% +\setheader{{\it CHAPTER \thechapter}}{}{}{}{}{{\it CHAPTER \thechapter}}% +\setfooter{\thepage}{}{}{}{}{\thepage}% + +This section will quickly get you up and running with \ctshortname. Click +on \helpref{Step 1}{step1} to start. If you are +using a Mac, please interpret 'left-click' to mean 'click', and +'right-click' to mean 'control-click'. + +\section{Step 1: creating a new configuration}\label{step1} + +When you run \ctshortname for the first time, you are presented with an +empty configuration window. + +Go to \helpref{Step 2}{step2} to learn how to do the next thing. + +\section{Step 2: doing something else}\label{step2} + +Go to \helpref{Step 3}{step3} to learn how to do a third thing. + +\section{Step 3: a third thing}\label{step3} + +Go to \helpref{Step 4}{step4} to learn about saving your document and reloading it. + +\section{Step 4: saving and loading documents}\label{step4} + +You may wish to save a document, so you can come back to it later. Click on {\bf File | Save} or +the \image{}{save.png} toolbar button. The first time you save the file, you will be prompted +for a filename: you can accept the default one provided, or choose another. + +To reload the document, click on {\bf File | Open...} or the \image{}{open.gif} toolbar button. +If you are working on another document, you will be prompted to save it first. + +Go to \helpref{Step 5: generating configurations}{step5} + +\section{Step 5: generating configurations}\label{step5} + +Todo. + +Go to \helpref{Step 6: where next?}{step6} + +\section{Step 6: where next?}\label{step6} + +Congratulations! You have learnt how to create, edit, save, and load configuration +files. + +To get to know \ctshortname more thoroughly, here are some further things you +can do. + +\begin{itemize} +\item Read the \helpref{How To}{howto} section. +\item Use the help facilities: most dialogs have a {\bf Help} button for a general description, and they +also have a {\bf "?"} button for getting information on individual controls on a dialog. +\item Explore the menubar and the menus that appear when you right-click over +the window background and individual cards. +\end{itemize} + +\end{comment} + +\chapter{Using menubar commands}\label{menubarcommands}% +\setheader{{\it CHAPTER \thechapter}}{}{}{}{}{{\it CHAPTER \thechapter}}% +\setfooter{\thepage}{}{}{}{}{\thepage}% + +%\image{}{menubar.gif} + +This section describes the menubar commands. Commands +that are not available in the current context are disabled (shown in grey). + +\section{File menu} + +The File menu shows commands that are mostly related to working +with files. + +\begin{twocollist}\itemsep=0pt +\twocolitem{{\bf New...} (Ctrl+N)}{Creates a new \ctshortname document.} +\twocolitem{{\bf Open...} (Ctrl+O)}{Opens an existing document.} +\twocolitem{{\bf Close} (Ctrl+W)}{Closes the current document.} +\twocolitem{\hrule}{\htmlonly{\hrule}} +\twocolitem{{\bf Save} (Ctrl+S)}{Saves the current document.} +\twocolitem{{\bf Save As...}}{Saves the current document under a new name.} +\twocolitem{\hrule}{\htmlonly{\hrule}} +\twocolitem{{\bf Save Setup.h...} (Ctrl+H)}{Saves the generated setup.h file in the specified location.} +\twocolitem{{\bf Save Configure Script...} (Ctrl+G)}{Saves the generated script containing a configure command in the specified location.} +\twocolitem{\hrule}{\htmlonly{\hrule}} +\twocolitem{{\bf Exit} (Alt+F4)}{Exits the program.} +\end{twocollist} + +\section{Edit menu} + +The Edit menu shows commands that are related to editing +document elements. + +\twocolwidtha{5cm} +\begin{twocollist}\itemsep=0pt +\twocolitem{{\bf Undo} (Ctrl+Z)}{Undoes the last undoable action.} +\twocolitem{{\bf Redo} (Ctrl+Y)}{Redoes the last redoable action.} +\twocolitem{\hrule}{\htmlonly{\hrule}} +\twocolitem{{\bf Cut} (Ctrl+T)}{Cuts the selected option and places it on the clipboard.} +\twocolitem{{\bf Copy} (Ctrl+C)}{Copies the selected option.} +\twocolitem{{\bf Paste} (Ctrl+V)}{Pastes an option from the clipboard to the position. Whether the +option is pasted as a child or sibling of the selection is determined by whether +the selection is a folder or not. If you want finer control, right-click on the +item in the tree control and select one of the paste commands.} +\twocolitem{\hrule}{\htmlonly{\hrule}} +\twocolitem{{\bf Add Option}}{Shows a menu for adding one of several option types.} +\twocolitem{\hrule}{\htmlonly{\hrule}} +\twocolitem{{\bf Custom Property}}{Shows a menu for adding, editing or deleting a custom option property.} +\twocolitem{\hrule}{\htmlonly{\hrule}} +\twocolitem{{\bf Delete Option}}{Deletes the selected option.} +\twocolitem{{\bf Rename Option}}{Shows a dialog for renaming the selected option.} +\end{twocollist} + +\section{View menu} + +The View menu gives you commands related to showing or hiding windows +and various other preferences. + +\twocolwidtha{5cm} +\begin{twocollist}\itemsep=0pt +\twocolitem{{\bf Show Toolbar}}{Shows or hides the toolbar, beneath the menubar.} +\twocolitem{\hrule}{\htmlonly{\hrule}} +\twocolitem{{\bf Settings...} (Ctrl+T)}{Shows the \helpref{Settings Dialog}{settingsdialog}, which +relate to application-wide settings.} +\end{twocollist} + +\section{Help menu} + +The Help menu gives you commands related to getting help. + +\twocolwidtha{5cm} +\begin{twocollist}\itemsep=0pt +\twocolitem{{\bf Contents}}{Invokes the on-line help, showing the contents page.} +\twocolitem{{\bf wxWindows Help Contents}}{Invokes the on-line wxWindows reference manual, showing the contents page.} +\twocolitem{\hrule}{\htmlonly{\hrule}} +\twocolitem{{\bf Configuration Option Help} (F1)}{Invokes the on-line wxWindows reference manual at the topic for the selected option (if a topic +is defined).} +\twocolitem{{\bf What's This?}}{Click to get help on a window or configuration option.} +\twocolitem{\hrule}{\htmlonly{\hrule}} +\twocolitem{{\bf About...}}{Displays a dialog giving a brief description of the program.} +\end{twocollist} + +\chapter{Using context menu commands}\label{contextmenucommands}% +\setheader{{\it CHAPTER \thechapter}}{}{}{}{}{{\it CHAPTER \thechapter}}% +\setfooter{\thepage}{}{}{}{}{\thepage}% + +This section describes the context menu commands available when you right-click. +On the Mac, this is achieved with control-click. + +\section{Configuration tree context menu} + +This menu is shown when you right-click over the configuration tree window background. +On the Mac, this is achieved with control-click. + +\twocolwidtha{5cm} +\begin{twocollist}\itemsep=0pt +\twocolitem{{\bf Paste before this option}}{Pastes the clipboard option before the clicked-on option.} +\twocolitem{{\bf Paste after this option}}{Pastes the clipboard option after the clicked-on option.} +\twocolitem{{\bf Paste as child of this option}}{Pastes the clipboard option as a child of the clicked-on option, +if it is a group option.} +\twocolitem{\hrule}{\htmlonly{\hrule}} +\twocolitem{{\bf C&opy}}{Copies the clicked-on option to the internal clipboard.} +\twocolitem{{\bf Cu&t}}{Copies the clicked-on option to the internal clipboard, and +deletes the option from the tree.} +\end{twocollist} + +\chapter{Using toolbar commands}\label{toolbarcommands}% +\setheader{{\it CHAPTER \thechapter}}{}{}{}{}{{\it CHAPTER \thechapter}}% +\setfooter{\thepage}{}{}{}{}{\thepage}% + +This section describes the toolbar commands. + +%\image{}{toolbar.gif} + +The toolbar provides quick access to commonly-used +commands. + +\twocolwidtha{5cm} +\begin{twocollist}\itemsep=0pt +\twocolitem{\image{}{new.png}{\bf New Document}}{Creates a new document.} +\twocolitem{\image{}{open.png}{\bf Open Document}}{Opens an existing document, closing the currently open document.} +\twocolitem{\image{}{save.png}{\bf Save Document}}{Saves the current document.} +\twocolitem{\hrule}{\htmlonly{\hrule}} +\twocolitem{\image{}{undo.png}{\bf Undo}}{Undoes the last command.} +\twocolitem{\image{}{redo.png}{\bf Redo}}{Redoes the last command.} +\twocolitem{\hrule}{\htmlonly{\hrule}} +\twocolitem{\image{}{copy.png}{\bf Copy}}{Copies the selected option to an internal clipboard.} +\twocolitem{\image{}{cut.png}{\bf Cut}}{Cuts the selected option and copies it to the internal clipboard..} +\twocolitem{\image{}{paste.png}{\bf Paste}}{Pastes the option from the clipboard to the configuration tree.} +\twocolitem{\hrule}{\htmlonly{\hrule}} +\twocolitem{\image{}{help.png}{\bf Help}}{Shows the wxWindows manual topic for the +\twocolitem{\image{}{helpcs.png}{\bf Context Help}}{Shows a context-sensitive help +cursor; click on a window to show brief help about that window.} +selected configuration item.} +\end{twocollist} + +\chapter{Using dialogs}\label{dialogs}% +\setheader{{\it CHAPTER \thechapter}}{}{}{}{}{{\it CHAPTER \thechapter}}% +\setfooter{\thepage}{}{}{}{}{\thepage}% + +Most dialogs have a {\bf "?"} button on their caption to provide context-sensitive help. +Click on this and then on a control +in a dialog to get quick help on that control. You can also click on the {\bf Help} button +for more detailed help on the dialog. + +\section{Settings dialog}\label{settingsdialog} + +This dialog has a number of tabs to allow you to +edit different categories of settings that are applicable +to the application as a whole. + +\subsection{General settings dialog}\label{generalapplicationsettingsdialog} + +The General Settings Dialog allows you to set a variety of \ctshortname options. + +\twocolwidtha{5cm} +\begin{twocollist}\itemsep=0pt +\twocolitem{{\bf Load last document on startup}}{If checked, the last viewed document will +be reloaded when \ctshortname starts up.} +% If the application terminated abnormally, this +%option will be switched off the next time \ctshortname runs in case there was a problem with +%the document file.} +%\twocolitem{{\bf Auto-save document}}{If checked, \ctshortname will regularly +%save the document to a temporary file. If \ctshortname or the operating system +%should terminate abnormally, the next time \ctshortname is run it will +%check for an auto-save file and ask if you wish to open that file.} +%\twocolitem{{\bf Show welcome dialog on startup}}{If checked, the \helpref{Welcome Dialog}{welcomedialog} will +%be shown on startup.} +\twocolitem{{\bf Show tooltips}}{If checked, tooltips will be shown in most dialogs, when you hover +the mouse pointer over a control.} +\end{twocollist} + +\subsection{Location settings dialog}\label{locationsettingsdialog} + +The Location Settings Dialog allows you to choose various locations. + +\twocolwidtha{5cm} +\begin{twocollist}\itemsep=0pt +\twocolitem{{\bf wxWindows hierarchy}}{This determines where \ctshortname will look +when prompting for filenames.} +\twocolitem{{\bf Use WXWIN environment variable}}{Check this to use +the value of the WXWIN variable instead of the path entered in the text field.} +\end{twocollist} + +\chapter{Using keyboard shortcuts}\label{keyboardshortcuts}% +\setheader{{\it CHAPTER \thechapter}}{}{}{}{}{{\it CHAPTER \thechapter}}% +\setfooter{\thepage}{}{}{}{}{\thepage}% + +You can make your \ctshortname experience even smoother by +using handy keyboard shortcuts. Note that some shortcuts are +dependent on context: that is, which control has the focus. + +\twocolwidtha{3cm} +\begin{twocollist}\itemsep=0pt +\twocolitem{{\bf Ctrl + C}}{Copies the selected option to the clipboard.} +\twocolitem{{\bf Ctrl + H}}{Saves the setup.h file.} +\twocolitem{{\bf Ctrl + G}}{Saves the configure script file.} +\twocolitem{{\bf Ctrl + N}}{Creates a new \ctshortname file.} +\twocolitem{{\bf Ctrl + O}}{Opens a \ctshortname file.} +\twocolitem{{\bf Ctrl + S}}{Saves the current \ctshortname document.} +\twocolitem{{\bf Ctrl + T}}{Shows the \helpref{Settings Dialog}{settingsdialog}.} +\twocolitem{{\bf Ctrl + V}}{Pastes the option on the clipboard (if any) to the configuration tree.} +\twocolitem{{\bf Ctrl + W}}{Closes the current \ctshortname document.} +\twocolitem{{\bf Ctrl + X}}{Cuts the selected option and copies it to the clipboard.} +\twocolitem{{\bf Ctrl + Y}}{Redoes the previously undone edit.} +\twocolitem{{\bf Ctrl + Z}}{Undoes the previous edit.} +\twocolitem{{\bf F1}}{Shows the online help for the selected item.} +\twocolitem{{\bf Alt + F4}}{Closes \ctshortname.} +\end{twocollist} + +\chapter{Reference}\label{reference}% +\setheader{{\it CHAPTER \thechapter}}{}{}{}{}{{\it CHAPTER \thechapter}}% +\setfooter{\thepage}{}{}{}{}{\thepage}% + +\section{The dependency evaluation algorithm} + +\ctshortname pre-calculates a list of all dependencies +for each option -- this is a kind of reverse-pointer version +of all the dependencies associated with each item. So +if option {\bf a} has a {\bf requires} option specifying +{\bf b}, then {\bf b} will end up with a dependency list +containing {\bf a} and any other options that refer to it. + +When the user enables or disables an option ({\bf b}), +the list of dependencies for that option is visited, +and for each mentioned option ({\bf a}), all its dependency information +is evaluated. This may result in the option {\bf a} being +(de)selected and perhaps deactivated (made insensitive). + +The results of this change are propagated to dependents of +{\bf a}, recursively, so several options may flip state +as the result of checking the original option. + +The parent-child relationship of a check or radio +group and its children is considered to be a virtual +'requires' dependency. Mutual exclusivity is also +taken into account if the option is a radio option +or group. For each radio option, all other mutually +exclusive options need to be listed. See the +{\bf Platform} group for an example of this. + +\section{How \ctshortname generates the configure commands} + +If the {\bf configure} property isn't empty, +\ctshortname will output the string as a parameter +to configure. + +The configure command is taken to be the command to +use if the option is checked. If the option is +unchecked, the 'enable' or 'with' is replaced with +'disable' or 'without'. + +TODO: should we distinguish between the case +where a setting is not passed to configure (using +the default), versus the case where it's specified but disabled? +It's probably a good idea to make all the options +explicit, but on the other hand it makes for a very long +command line. + +\ctshortname checks for the presence of a +{\bf builtin} custom boolean property and appends 'builtin' or +'sys' to the configure command depending on where +the {\bf builtin} setting is checked or unchecked. +We also allow for passing strings, e.g. for --with-rpath=DIR, +by using the {\bf value} custom string property. + +\section{How \ctshortname generates the setup.h file} + +The {\bf Platforms} group is ignored. In all other +cases, if the setting is prefixed by wxUSE_... +and it's a boolean setting, \ctshortname will +output 1 or 0 depending on the setting state. + +A few settings that don't have the wxUSE_... +convention are also checked for and processed. + + +\chapter{How To...}\label{howto}% +\setheader{{\it CHAPTER \thechapter}}{}{}{}{}{{\it CHAPTER \thechapter}}% +\setfooter{\thepage}{}{}{}{}{\thepage}% + +A variety of topics to help you get the best from \ctshortname. + +\section{How to specify dependencies}\label{dependencies} + +To ensure consistency throughout the configuration, +\ctshortname allows specification of dependencies, essentially +a list of option names that should be considered in evaluating +whether an option should be enabled or disabled. In addition, +if the option is constrained to always be disabled +or enabled in the current context, then it is greyed out +(deactivated) to prevent the user from changing the state. + +There are four kinds of dependencies: requires, precludes, +enabled-if, and enabled-if-not. Each one represents a +relationship between the current option (a) and one +or more named options (b). For the sake of argument +we will consider only one other option, but multiple +options are taken to mean (b1 or b2 or b3 or ...) +Below the allowed combined states of a and b are +listed for each kind of dependency. + +1. a {\bf requires} b + +For example, wxUSE_DRAG_AND_DROP requires wxUSE_OLE. + +\begin{verbatim} + a b + + 1 1 + 0 1 + 0 0 +\end{verbatim} + +2. a {\bf precludes} b + +For example, wxUSE_ODBC precludes wxUSE_UNICODE. + +\begin{verbatim} + a b + + 1 0 + 0 0 + 0 1 +\end{verbatim} + + +3. a {\bf enabled-if} b + +For example, __WXUNIVERSAL__ enabled-if X11 or MGL + +\begin{verbatim} + a b + + 1 1 + 1 0 + 0 0 +\end{verbatim} + +4. a {\bf enabled-if-not} b + +For example, wxUSE_TOOLBAR_SIMPLE enabled-if-not wxUSE_TOOLBAR_NATIVE. + +\begin{verbatim} + a b + + 1 0 + 0 1 + 1 1 +\end{verbatim} + +\section{How to specify platform-specific dependencies}\label{platformdependencies} + +You can associate one or more options as part of the +option's {\bf context}. In the case of wxUSE_OLE, +the context contains __WXMSW__, because it's a Windows-specific +option. This is used when calculating dependencies, as +follows. If either option involved in a dependency +relationship is not part of the current context, that +is, none of the options in its {\bf context} property is currently +enabled, then it is ignored in the dependency calculation. + +This allows the dependency 'wxUSE_DRAG_AND_DROP requires wxUSE_OLE' +to only be evaluated when __WXMSW__ is enabled. + +It doesn't quite cover all bases, however, because +it cannot express that the {\it dependency} itself +is platform specific. You might have a platform-specific +dependency that exists between two options that are +perfectly valid for any platform. For example, we +can't capture the notion that wxUSE_LISTBOX +should be required if wxUSE_COMBOBOX is set, +but only for __WXUNIVERSAL__. We could do it +by complicating the dependency syntax, for example: + +wxUSE_COMBOBOX requires wxUSE_LISTBOX:__WXUNIVERSAL__ + +This means that the dependency should only be +evaluated if __WXUNIVERSAL__ is enabled. +This has not been implemented yet. + +\section{How to specify custom properties}\label{customproperties} + +You can add custom properties to any option, but +currently only {\bf option} and {\bf value} are +recognised by \ctshortname. + +\ctshortname checks for the presence of a +{\bf builtin} boolean custom property and appends 'builtin' or +'sys' to the configure command depending on where +the {\bf builtin} setting is checked or unchecked. +We also allow for passing strings, e.g. for --with-rpath=DIR, +by using the {\bf value} string custom property. + +\begin{comment} + +\begin{helpglossary} + +\gloss{thing}\label{thing} + +A glossary entry. + +\end{helpglossary} +\end{comment} + +\rtfonly{% +\addcontentsline{toc}{chapter}{Index} +\printindex% +\setheader{{\it INDEX}}{}{}{}{}{{\it INDEX}}% +\setfooter{\thepage}{}{}{}{}{\thepage}% +} +\winhelponly{ +\chapter{Popups}\label{popups} + +} % WinHelp only + +\end{document} diff --git a/utils/configtool/docs/manual/contents.bmp b/utils/configtool/docs/manual/contents.bmp new file mode 100644 index 0000000000..7b75027dc2 Binary files /dev/null and b/utils/configtool/docs/manual/contents.bmp differ diff --git a/utils/configtool/docs/manual/contents.gif b/utils/configtool/docs/manual/contents.gif new file mode 100644 index 0000000000..723174f81d Binary files /dev/null and b/utils/configtool/docs/manual/contents.gif differ diff --git a/utils/configtool/docs/manual/copy.bmp b/utils/configtool/docs/manual/copy.bmp new file mode 100644 index 0000000000..0a2cacc5fa Binary files /dev/null and b/utils/configtool/docs/manual/copy.bmp differ diff --git a/utils/configtool/docs/manual/copy.png b/utils/configtool/docs/manual/copy.png new file mode 100644 index 0000000000..c3bf61d10f Binary files /dev/null and b/utils/configtool/docs/manual/copy.png differ diff --git a/utils/configtool/docs/manual/cshelp.bmp b/utils/configtool/docs/manual/cshelp.bmp new file mode 100644 index 0000000000..94c35d95d7 Binary files /dev/null and b/utils/configtool/docs/manual/cshelp.bmp differ diff --git a/utils/configtool/docs/manual/cut.bmp b/utils/configtool/docs/manual/cut.bmp new file mode 100644 index 0000000000..7af2101762 Binary files /dev/null and b/utils/configtool/docs/manual/cut.bmp differ diff --git a/utils/configtool/docs/manual/cut.png b/utils/configtool/docs/manual/cut.png new file mode 100644 index 0000000000..0bf1f6ec6d Binary files /dev/null and b/utils/configtool/docs/manual/cut.png differ diff --git a/utils/configtool/docs/manual/down.bmp b/utils/configtool/docs/manual/down.bmp new file mode 100644 index 0000000000..298aa2d9fd Binary files /dev/null and b/utils/configtool/docs/manual/down.bmp differ diff --git a/utils/configtool/docs/manual/down.gif b/utils/configtool/docs/manual/down.gif new file mode 100644 index 0000000000..3da774dbf0 Binary files /dev/null and b/utils/configtool/docs/manual/down.gif differ diff --git a/utils/configtool/docs/manual/forward.bmp b/utils/configtool/docs/manual/forward.bmp new file mode 100644 index 0000000000..c8fead5cf7 Binary files /dev/null and b/utils/configtool/docs/manual/forward.bmp differ diff --git a/utils/configtool/docs/manual/forward.gif b/utils/configtool/docs/manual/forward.gif new file mode 100644 index 0000000000..d8862174ed Binary files /dev/null and b/utils/configtool/docs/manual/forward.gif differ diff --git a/utils/configtool/docs/manual/help.bmp b/utils/configtool/docs/manual/help.bmp new file mode 100644 index 0000000000..94c35d95d7 Binary files /dev/null and b/utils/configtool/docs/manual/help.bmp differ diff --git a/utils/configtool/docs/manual/help.png b/utils/configtool/docs/manual/help.png new file mode 100644 index 0000000000..85b62cb76c Binary files /dev/null and b/utils/configtool/docs/manual/help.png differ diff --git a/utils/configtool/docs/manual/helpcs.png b/utils/configtool/docs/manual/helpcs.png new file mode 100644 index 0000000000..a322568b90 Binary files /dev/null and b/utils/configtool/docs/manual/helpcs.png differ diff --git a/utils/configtool/docs/manual/logo.gif b/utils/configtool/docs/manual/logo.gif new file mode 100644 index 0000000000..8712d35070 Binary files /dev/null and b/utils/configtool/docs/manual/logo.gif differ diff --git a/utils/configtool/docs/manual/new.bmp b/utils/configtool/docs/manual/new.bmp new file mode 100644 index 0000000000..ad864d5cc8 Binary files /dev/null and b/utils/configtool/docs/manual/new.bmp differ diff --git a/utils/configtool/docs/manual/new.png b/utils/configtool/docs/manual/new.png new file mode 100644 index 0000000000..056fd111ed Binary files /dev/null and b/utils/configtool/docs/manual/new.png differ diff --git a/utils/configtool/docs/manual/open.bmp b/utils/configtool/docs/manual/open.bmp new file mode 100644 index 0000000000..5ff4a10b92 Binary files /dev/null and b/utils/configtool/docs/manual/open.bmp differ diff --git a/utils/configtool/docs/manual/open.png b/utils/configtool/docs/manual/open.png new file mode 100644 index 0000000000..3e9e2243bd Binary files /dev/null and b/utils/configtool/docs/manual/open.png differ diff --git a/utils/configtool/docs/manual/paste.bmp b/utils/configtool/docs/manual/paste.bmp new file mode 100644 index 0000000000..d04e9186dd Binary files /dev/null and b/utils/configtool/docs/manual/paste.bmp differ diff --git a/utils/configtool/docs/manual/paste.png b/utils/configtool/docs/manual/paste.png new file mode 100644 index 0000000000..e07e764eea Binary files /dev/null and b/utils/configtool/docs/manual/paste.png differ diff --git a/utils/configtool/docs/manual/redo.bmp b/utils/configtool/docs/manual/redo.bmp new file mode 100644 index 0000000000..e613af20a7 Binary files /dev/null and b/utils/configtool/docs/manual/redo.bmp differ diff --git a/utils/configtool/docs/manual/redo.png b/utils/configtool/docs/manual/redo.png new file mode 100644 index 0000000000..2df21cf0d1 Binary files /dev/null and b/utils/configtool/docs/manual/redo.png differ diff --git a/utils/configtool/docs/manual/save.bmp b/utils/configtool/docs/manual/save.bmp new file mode 100644 index 0000000000..aa6efa12b0 Binary files /dev/null and b/utils/configtool/docs/manual/save.bmp differ diff --git a/utils/configtool/docs/manual/save.png b/utils/configtool/docs/manual/save.png new file mode 100644 index 0000000000..7ff8f3d84b Binary files /dev/null and b/utils/configtool/docs/manual/save.png differ diff --git a/utils/configtool/docs/manual/saveas.bmp b/utils/configtool/docs/manual/saveas.bmp new file mode 100644 index 0000000000..1a16f26887 Binary files /dev/null and b/utils/configtool/docs/manual/saveas.bmp differ diff --git a/utils/configtool/docs/manual/screen01.png b/utils/configtool/docs/manual/screen01.png new file mode 100644 index 0000000000..22a55cba76 Binary files /dev/null and b/utils/configtool/docs/manual/screen01.png differ diff --git a/utils/configtool/docs/manual/tex2rtf.ini b/utils/configtool/docs/manual/tex2rtf.ini new file mode 100644 index 0000000000..b78245dbab --- /dev/null +++ b/utils/configtool/docs/manual/tex2rtf.ini @@ -0,0 +1,41 @@ +runTwice = yes +titleFontSize = 12 +authorFontSize = 10 +chapterFontSize = 12 +sectionFontSize = 12 +subsectionFontSize = 12 +headerRule = yes +footerRule = yes +useHeadingStyles = yes +contentsDepth = 2 +listItemIndent=40 +winHelpContents = yes +winHelpVersion = 4 ; 3 for Windows 3.x, 4 for Windows 95 +generateHPJ = yes +htmlBrowseButtons = bitmap +winHelpTitle = "wxWindows Configuration Tool" +truncateFilenames = no +htmlIndex = yes +htmlFrameContents = no +;; +;; These two are for generating MS HTML Help project, contents and index files. +;; +htmlWorkshopFiles = true +htmlIndex = true + +; Finally, a way to specify face names +htmlFaceName = "Arial, Lucida, Helvetica" + +;; For customizing help: make macros empty to disable text for specific +;; versions + +\ctfullversiononly [1] {#1} +%\ctfullversiononly [1] {} +\ctgiftversiononly [1] {} +%\ctgiftversiononly [1] {#1} +\ctcustomversiononly [1] {#1} +\ctversion [0] {1.0} +\ctname [0] {wxWindows Configuration Tool} +\ctshortname [0] {Configuration Tool} +\cttitle [0] {\ctname \ctversion} +\cturl [0] {http://www.wxwindows.org} \ No newline at end of file diff --git a/utils/configtool/docs/manual/undo.bmp b/utils/configtool/docs/manual/undo.bmp new file mode 100644 index 0000000000..0280c50e6c Binary files /dev/null and b/utils/configtool/docs/manual/undo.bmp differ diff --git a/utils/configtool/docs/manual/undo.png b/utils/configtool/docs/manual/undo.png new file mode 100644 index 0000000000..f465f14db0 Binary files /dev/null and b/utils/configtool/docs/manual/undo.png differ diff --git a/utils/configtool/docs/manual/up.bmp b/utils/configtool/docs/manual/up.bmp new file mode 100644 index 0000000000..be15c4c3c7 Binary files /dev/null and b/utils/configtool/docs/manual/up.bmp differ diff --git a/utils/configtool/docs/manual/up.gif b/utils/configtool/docs/manual/up.gif new file mode 100644 index 0000000000..870c89e80a Binary files /dev/null and b/utils/configtool/docs/manual/up.gif differ diff --git a/utils/configtool/docs/preamble.txt b/utils/configtool/docs/preamble.txt new file mode 100644 index 0000000000..f2f16439b5 --- /dev/null +++ b/utils/configtool/docs/preamble.txt @@ -0,0 +1,49 @@ +Preamble +======== + +The licensing of the wxWindows library is intended to protect the wxWindows +library, its developers, and its users, so that the considerable investment +it represents is not abused. + +Under the terms of the wxWindows Licence, you as a user are not +obliged to distribute wxWindows source code with your products, if you +distribute these products in binary form. However, you are prevented from +restricting use of the library in source code form, or denying others the +rights to use or distribute wxWindows library source code in the way +intended. + +The wxWindows Licence establishes the copyright for the code and related +material, and it gives you legal permission to copy, distribute and/or +modify the library. It also asserts that no warranty is given by the authors +for this or derived code. + +The core distribution of the wxWindows library contains files +under two different licences: + +- Most files are distributed under the GNU Library General Public + Licence, version 2, with the special exception that you may create and + distribute object code versions built from the source code or modified + versions of it (even if these modified versions include code under a + different licence), and distribute such binaries under your own + terms. + +- Most core wxWindows manuals are made available under the "wxWindows + Free Documentation Licence", which allows you to distribute modified + versions of the manuals, such as versions documenting any modifications + made by you in your version of the library. However, you may not restrict + any third party from reincorporating your changes into the original + manuals. + +Other relevant files: + +- licence.txt: a statement that the wxWindows library is + covered by the GNU Library General Public Licence, with an + exception notice for binary distribution. + +- licendoc.txt: the wxWindows Documentation Licence. + +- lgpl.txt: the text of the GNU Library General Public Licence. + +- gpl.txt: the text of the GNU General Public Licence, which is + referenced by the LGPL. + diff --git a/utils/configtool/docs/readme-after.txt b/utils/configtool/docs/readme-after.txt new file mode 100644 index 0000000000..46eafb838e --- /dev/null +++ b/utils/configtool/docs/readme-after.txt @@ -0,0 +1,13 @@ + +Congratulations! You have installed wxWindows Configuration Tool. +Please see the wxWindows web site for support: + +http://www.wxwindows.org + +Thank you for using wxWindows Configuration Tool, and we hope +you enjoy it! + +Julian Smart, wxWindows Team, June 2003 + + + diff --git a/utils/configtool/docs/readme.txt b/utils/configtool/docs/readme.txt new file mode 100644 index 0000000000..a343eda27a --- /dev/null +++ b/utils/configtool/docs/readme.txt @@ -0,0 +1,69 @@ +Welcome to wxWindows Configuration Tool! +============================================= + +wxWindows Configuration Tool is a tool for +helping to configure wxWindows. + +For further information, please see the manual, and the +following site: + +http://www.wxwindows.org + +------------------------------------------------------ +Installing wxWindows Configuration Tool on Windows +------------------------------------------------------ + +Run wxconfigtool-x.yz-setup.exe and follow the instructions +to install wxWindows Configuration Tool. + +You should find a shortcut on your desktop, and you can +also find it in a group similar to this: + +Start -> Program Files -> wxWindows Configuration Tool x.y + +------------------------------------------------------ +Installing wxWindows Configuration Tool on Unix +------------------------------------------------------ + +Unarchive wxconfigtool-x.yz.tar.gz to a suitable location +in your filesystem. A directory of the form wxconfigtool-x.yz +(where x.yz is the version number) will be created. + +Add the location to your PATH and run the application with +'wxconfigtool'. You may wish to set the environment variable +WXCONFIGTOOLDIR so that wxWindows Configuration Tool can find its data files. + +For example: + + % cd ~ + % tar xvfz wxconfigtool-1.01.tar.gz + % export WXCONFIGTOOLDIR=`pwd`/wxconfigtool-1.01 + % export PATH=$PATH:$WXCONFIGTOOLDIR + % wxconfigtool + +If you don't want to change your PATH, you could place a +script in a location already on your PATH, such as +/usr/local/bin. For example: + + #!/bin/sh + # Invokes wxWindows Configuration Tool + export WXCONFIGTOOLDIR=/home/mydir/wxconfigtool-1.01 + $WXCONFIGTOOLDIR/wxconfigtool $* + +If you wish to associate the wxWindows Configuration Tool file extension +(pjd) with wxWindows Configuration Tool, you will need to edit your +~/.mailcap file (or create one if it doesn't exist) +and add an entry similar to this: + + application/wxconfigtool; wxconfigtool %s + +and add this ~/.mime.types: + + type=application/wxconfigtool \ + desc="wxWindows Configuration Tool Document" \ + exts="pjd" + + +------------------------------------------------------ +(c) Julian Smart, June 2003 + diff --git a/utils/configtool/docs/todo.txt b/utils/configtool/docs/todo.txt new file mode 100644 index 0000000000..8e5127f043 --- /dev/null +++ b/utils/configtool/docs/todo.txt @@ -0,0 +1,50 @@ +TODO +==== + +Note: some tasks can be done by others +once in CVS. + +Essential +========= + +- make decent example from setup.h + +- allow for string, integer settings + +- Settings dialog + +- generate setup.h, configure commands + +- distinguish between configurations settings + and configuration template files + +- configuration browser + +- ability to invoke make after configuration + +- how about running samples, giving size + information (possibly writing to file) + +- command-line mode: could write configure command + to standard output, with optional make invocation + +- decide on a standard location for .wxs files in + wxWin hierarchy, so tool can find files automatically. + +- makefiles for other systems + +- setup and tarball generation + +- documentation + +Nice-to-have +============ + +- incorporate makefile/project generator + for independent apps + +- possibly evolve it into a central command + centre for wxWindows: invoke other apps such + as poEdit, , help, + wizards, etc. Upgrade your wxWin version + via the web. \ No newline at end of file diff --git a/utils/configtool/scripts/buildapp b/utils/configtool/scripts/buildapp new file mode 100644 index 0000000000..8a4b7d9c23 --- /dev/null +++ b/utils/configtool/scripts/buildapp @@ -0,0 +1,37 @@ +#!/bin/sh +# Build application and make a tarball. + +cd ~/wxconfigtool-build + +echo Building wxWindows... +makeapp release wx + +rm -f wxconfigtool-build-release/wxconfigtool + +if [ "$1" = "clean" ]; then + rm -f wxconfigtool-build-release/* +fi + +echo Building Application... +makeapp release all + +if [ ! -f wxconfigtool-build-release/wxconfigtool ]; then + echo *** Sorry, wxconfigtool was not built correctly. + exit +fi + +echo Making tarball... +makeapp release release + +# appver will have been written by the 'release' target. +APPVER=`/tmp/appver` + +cd /tmp/wxconfigtool-deliver +APPARCHIVE=wxconfigtool-$APPVER-i386.tar.gz + +# echo Copying tarball $APPARCHIVE to ftp site... +# You can use a script to copy this to an ftp site, +# using for example, the 'curl' utility. +# curl ftp://www.mysite.com/$APPARCHIVE --user "myname:mypassword" --upload-file $APPARCHIVE + +echo Done building and archiving wxconfigtool. diff --git a/utils/configtool/scripts/innobott.txt b/utils/configtool/scripts/innobott.txt new file mode 100644 index 0000000000..7ea092777d --- /dev/null +++ b/utils/configtool/scripts/innobott.txt @@ -0,0 +1,37 @@ +; For debug beta only +; Source: c:\winnt\system32\msvcrtd.dll; DestDir: {sys}\; DestName: msvcrtd.dll; CopyMode: onlyifdoesntexist; Flags: uninsneveruninstall + +[Tasks] + Name: desktopicon; Description: "Create a &desktop icon"; GroupDescription: "Additional icons:" + +[Icons] + Name: {group}\%APPTITLE% %VERSION%; Filename: {app}\%APPNAME%.exe; WorkingDir: {app}; IconFilename: {app}\%APPNAME%.exe; IconIndex: 0 + Name: {group}\%APPTITLE% Help; Filename: {app}\%HELPFILE%; WorkingDir: {app}; IconIndex: 0; Flags: useapppaths + Name: {group}\wxWindows Reference; Filename: {app}\wx.chm; WorkingDir: {app}; IconIndex: 0; Flags: useapppaths + Name: {group}\%APPTITLE% ReadMe; Filename: {app}\readme.txt; WorkingDir: {app}; IconIndex: 0; Flags: useapppaths + Name: {group}\%APPTITLE% Licence; Filename: {app}\license.txt; WorkingDir: {app}; IconIndex: 0; Flags: useapppaths + Name: {userdesktop}\%APPTITLE% %VERSION%; Filename: {app}\%APPNAME%.exe; WorkingDir: {app}; IconFilename: {app}\%APPNAME%.exe; IconIndex: 0; Tasks: desktopicon + +[Registry] + +; Uncomment the following lines if you'd like to register a data file extension. +; You may need to replace some of the %APPTITLE% occurrences below with a hard-wired +; name if your title contains spaces. + + Root: HKCR; SubKey: .%APPEXTENSION%; ValueType: STRING; ValueData: wxConfigToolFile; Flags: uninsdeletevalue + Root: HKCR; SubKey: wxConfigToolFile; ValueType: STRING; ValueData: "%APPTITLE% Document File"; Flags: uninsdeletevalue + Root: HKCR; SubKey: wxConfigToolFile\Shell; ValueType: NONE; Flags: uninsdeletevalue + Root: HKCR; SubKey: wxConfigToolFile\Shell\Open; ValueType: NONE; Flags: uninsdeletevalue + Root: HKCR; SubKey: wxConfigToolFile\Shell\Open\Command; ValueType: STRING; ValueData: "{app}\%APPNAME%.exe ""%1"""; Flags: uninsdeletevalue + Root: HKCR; SubKey: wxConfigToolFile\DefaultIcon; ValueType: STRING; ValueData: {app}\%APPNAME%.exe,0; Flags: uninsdeletevalue + +[UninstallDelete] + +[InstallDelete] + +[Run] + Filename: "{app}\%APPNAME%.exe"; Description: "Launch %APPTITLE%"; Flags: postinstall nowait skipifsilent + +[UninstallRun] + + diff --git a/utils/configtool/scripts/innotop.txt b/utils/configtool/scripts/innotop.txt new file mode 100644 index 0000000000..f49bca72cc --- /dev/null +++ b/utils/configtool/scripts/innotop.txt @@ -0,0 +1,45 @@ +; Inno Setup Script +; Created with ScriptMaker Version 1.3.22 +; 14 February 2001 at 10:38 + +[Setup] + MinVersion=4.0,4.0 + AppName=%APPTITLE% %VERSION% + AppId=%APPTITLE% + CreateUninstallRegKey=1 + UsePreviousAppDir=1 + UsePreviousGroup=1 + AppVersion=%VERSION% + AppVerName=%APPTITLE% %VERSION% + AppCopyright=Copyright © %COPYRIGHTHOLDER% + BackColor=$800000 + BackColor2=$C71F1F + BackColorDirection=toptobottom + WindowShowCaption=1 + WindowStartMaximized=1 + WindowVisible=1 + WindowResizable=1 + UninstallLogMode=Append + DirExistsWarning=auto + UninstallFilesDir={app} + DisableDirPage=0 + DisableStartupPrompt=1 + CreateAppDir=1 + DisableProgramGroupPage=0 + AlwaysCreateUninstallIcon=1 + Uninstallable=1 + UninstallIconName=Uninstall %APPTITLE% %VERSION% + UninstallDisplayName=%APPTITLE% %VERSION% + DefaultDirName={pf}\%APPTITLE% + DefaultGroupName=%APPTITLE% %VERSION% + MessagesFile=compiler:default.isl + DiskSpanning=0 + DiskSize=1457664 + DiskClusterSize=512 + ReserveBytes=0 + UseSetupLdr=1 + LicenseFile=%LICENSEFILE% + InfoAfterFile=%READMEAFTERFILE% + SourceDir=%SOURCEDIR% + OutputDir=%OUTPUTDIR% + diff --git a/utils/configtool/scripts/makeapp b/utils/configtool/scripts/makeapp new file mode 100644 index 0000000000..76c63189e0 --- /dev/null +++ b/utils/configtool/scripts/makeapp @@ -0,0 +1,26 @@ +#!/bin/sh +# Build application + +# The first argument is debug or release +LEVEL=$1 + +# Then you can supply one or more makefile targets +TARGET="$2 $3 $4 $5 $6 $6 $7 $8 $9" + +if [ "$1" = "" ] || [ "$2" = "" ]; then + echo Usage: makeapp debug/release full/wx/genericapp/cleanall + exit +fi + +export APPDIR=$WXWIN/utils/configtool +export WXDIR=$WXWIN +export WXBUILDDIR=wxwin-build-$LEVEL + +# If there's no wxwin-build-... directory yet, the makefile +# must include a dummy makeprog.env +export USEDUMMYMAKEPROG="0" +if [ ! -f $WXBUILDDIR/src/makeprog.env ]; then + USEDUMMYMAKEPROG="1" +fi + +make -f ${APPDIR}/src/Makefile WXDIR=$WXDIR USEDUMMYMAKEPROG=$USEDUMMYMAKEPROG APPDIR=$APPDIR WXBUILDDIR=$WXBUILDDIR LEVEL=$LEVEL $TARGET diff --git a/utils/configtool/scripts/makeinno.sh b/utils/configtool/scripts/makeinno.sh new file mode 100644 index 0000000000..1d788be0f6 --- /dev/null +++ b/utils/configtool/scripts/makeinno.sh @@ -0,0 +1,132 @@ +#! /bin/sh +# Make an Inno Setup distribution list, where files and dirs are represented by +# sections like this: +# [Dirs] +# Name: {app}\backgrounds +# +# [Files] +# Source: C:\program\setup\about.htm; DestDir: {app}\; DestName: about.htm +# +# +# Usage: makeinno.sh sourcedir inno-topfile inno-bottomfile destfile +# For example: makeinno.sh c:/project/allfiles c:/project/innotop.txt c:/project/innobott.txt c:/project/project.iss +# + +PROGNAME=$0 +SOURCEDIR=$1 +TOPFILE=$2 +BOTTOMFILE=$3 +INNOFILE=$4 +TEMPDIR=/tmp + +dochecks() +{ + if [ "$SOURCEDIR" = "" ] || [ "$TOPFILE" = "" ] || [ "$BOTTOMFILE" = "" ] || [ "$INNOFILE" = "" ] ; then + usage + fi + + if [ ! -d $SOURCEDIR ]; then + echo "Sorry, the source directory $SOURCEDIR does not exist." + usage + fi + + if [ ! -f $TOPFILE ]; then + echo "Sorry, the Inno Setup header $TOPFILE does not exist." + usage + fi + + if [ ! -f $BOTTOMFILE ]; then + echo "Sorry, the Inno Setup header $BOTTOMFILE does not exist." + usage + fi + + if [ ! -d $TEMPDIR ]; then + mkdir $TEMPDIR + fi +} + +doreplace() +{ + thefile=$1 + theexpr=$2 + + if [ -f $thefile ]; then + sed -e "$theexpr" < $thefile > $thefile.tmp + mv $thefile.tmp $thefile + else + echo "*** $thefile not found." + fi +} + +generateinno() +{ + # SRCDIR=`cygpath -u $SRCDIR` + # DESTDIR=`cygpath -u $DESTDIR` + # TEMPDIR=`cygpath -u $TEMP` + + + # Generate a list of all files in the distribution. + # We pass the output through sed in order to remove the preceding "./" + cd $SOURCEDIR + find . -print | sed -e "s/\.\\///g" > $TEMPDIR/files1.tmp + + echo "[Dirs]" > $TEMPDIR/files2.tmp + + for line in `cat $TEMPDIR/files1.tmp` ; do + + # If a directory, add to file + if [ -d $line ] ; then + # The relative path + # TODO: make into DOS filename form + #line2=`cygpath -w $line` + line2=$line + + echo " Name: {app}\\"$line2 >> $TEMPDIR/files2.tmp + fi + done + + echo "" >> $TEMPDIR/files2.tmp + echo "[Files]" >> $TEMPDIR/files2.tmp + + for line in `cat $TEMPDIR/files1.tmp` ; do + + # If not a directory, add to file + if [ ! -d $line ] ; then + # The relative path + # TODO: make into DOS filename form + #line2=`cygpath -w $line` + line2=$line + + # The absolute path + # TODO: make into DOS filename form + #line1=`cygpath -w $SOURCEDIR`"\\"$line2 + line1=$SOURCEDIR"\\"$line2 + #pathonly=`find $line -printf "%h"` + pathonly=`dirname $line` + + echo " Source: "$line1"; DestDir: {app}\\"$pathonly >> $TEMPDIR/files2.tmp + fi + done + + echo "" >> $TEMPDIR/files2.tmp + + doreplace $TEMPDIR/files2.tmp "s/\//\\\/g" + + # Concatenate the 3 sections + cat $TOPFILE $TEMPDIR/files2.tmp $BOTTOMFILE > $INNOFILE + + rm -f $TEMPDIR/files1.tmp +} + +usage() +{ + echo Usage: $PROGNAME sourcedir inno-topfile inno-bottomfile destfile + echo For example: $PROGNAME c:/project/allfiles c:/project/innotop.txt c:/project/innobott.txt c:/project/project.iss + echo Remember to use paths of the form c:/thing rather than /c/thing. + exit 1 +} + +dochecks +generateinno + + diff --git a/utils/configtool/scripts/makesetup.sh b/utils/configtool/scripts/makesetup.sh new file mode 100644 index 0000000000..0b16cc70aa --- /dev/null +++ b/utils/configtool/scripts/makesetup.sh @@ -0,0 +1,267 @@ +#!/bin/sh + +# Make a distribution of an application. + +# If your zip accepts Cygwin-style paths, then +# use cygpath, else substitute echo +CYGPATHPROG=cygpath +#CYGPATHPROG=echo + +PROGNAME=$0 +SCRIPTDIR=`pwd` + +. $SCRIPTDIR/setup.var + +# Set this to the required version +VERSION= + +doreplace() +{ + thefile=$1 + theexpr=$2 + + if [ -f $thefile ]; then + sed -e "$theexpr" < $thefile > $thefile.tmp + mv $thefile.tmp $thefile + else + echo "*** $thefile not found." + fi +} + +unix2dosname() +{ + echo $1 | sed -e "s/\//\\\\\\\/g" > /tmp/filename.tmp + RETVALUE=`cat /tmp/filename.tmp` + rm -f /tmp/filename.tmp +} + +unix2dosname2() +{ + echo $1 | sed -e "s/\//\\\\/g" > /tmp/filename.tmp + RETVALUE=`cat /tmp/filename.tmp` + rm -f /tmp/filename.tmp +} + +findversion() +{ + echo "#include " > /tmp/appver.c + echo "#include \"$VERSIONSYMBOLFILE\"" >> /tmp/appver.c + echo "int main() { printf(\"%.2f\", $VERSIONSYMBOL); }" >> /tmp/appver.c + gcc /tmp/appver.c -I$APPDIR -o /tmp/appver + VERSION=`/tmp/appver` + rm -f /tmp/appver /tmp/appver.c +} + +makesetup() +{ + if [ -d $SETUPIMAGEDIR ]; then + echo Removing existing $SETUPIMAGEDIR + rm -f -r $SETUPIMAGEDIR + fi + + echo Making the $SETUPIMAGEDIR for preparing the setup + mkdir -p $SETUPIMAGEDIR + + if [ -f $READMEFILE ]; then + echo Copying readme.txt + cp $READMEFILE $SETUPIMAGEDIR + else + echo "*** Warning - $READMEFILE not found" + fi + + if [ -f $LICENSEFILE ]; then + echo Copying licence.txt + cp $LICENSEFILE $SETUPIMAGEDIR + else + echo "*** Warning - $LICENSEFILE not found" + fi + + cp $APPDIR/docs/gpl.txt $SETUPIMAGEDIR + cp $APPDIR/docs/lgpl.txt $SETUPIMAGEDIR + cp $APPDIR/docs/licendoc.txt $SETUPIMAGEDIR + + echo Copying sample configuration settings file... + cp $APPDIR/configs/wxwin250.wxs $SETUPIMAGEDIR + + if [ "$RESOURCESFILE" != "" ] && [ "$RESOURCESDIR" != "" ]; then + if [ -d $RESOURCESDIR ]; then + cd $RESOURCESDIR + echo Compiling resource file $RESOURCESFILE + zip $SETUPIMAGEDIR/$RESOURCESFILE * + else + echo "*** Warning - $RESOURCESDIR directory not found" + fi + fi + + if [ "$MAKEMANUAL" != "0" ]; then + if [ -d $MANUALDIR ]; then + cd $MANUALDIR + make + + for EACHFILE in $MANUALFILES ; do + if [ -f $EACHFILE ]; then + echo Copying $EACHFILE + cp $EACHFILE $SETUPIMAGEDIR + else + echo "*** Warning - $EACHFILE not found" + fi + done + else + echo "*** Warning - $MANUALDIR not found" + fi + fi + + if [ -f $WXMANUALCHM ]; then + echo Copying wxWindows manual $WXMANUALCHM + cp $WXMANUALCHM $SETUPIMAGEDIR + else + echo "*** Warning - $WXMANUALCHM not found" + fi + + if [ -f $APPBINARY ]; then + echo Copying binary $APPBINARY + cp $APPBINARY $SETUPIMAGEDIR + else + echo "*** Error - $APPBINARY not found" + exit 1 + fi + + if [ "$UPX" != "0" ]; then + echo Compressing binary + upx $SETUPIMAGEDIR/`basename $APPBINARY` + fi + + # Time to regenerate the Inno Install script + if [ "$INNO" != "0" ]; then + echo Generating $SETUPSCRIPTNAME + rm -f $SETUPSCRIPTNAME + + sh $SCRIPTDIR/makeinno.sh $SETUPIMAGEDIR $INNOTOP $INNOBOTTOM $SETUPSCRIPTNAME + + if [ ! -f $SETUPSCRIPTNAME ]; then + echo "*** Error - something went wrong with the script file generation." + exit 1 + fi + + # Now replace %VERSION% with the real application version, and other + # variables + echo Replacing variables in the setup script + doreplace $SETUPSCRIPTNAME "s/%VERSION%/$VERSION/g" + doreplace $SETUPSCRIPTNAME "s/%COPYRIGHTHOLDER%/$AUTHOR/g" + doreplace $SETUPSCRIPTNAME "s/%VENDOR%/$VENDOR/g" + + unix2dosname $READMEFILE + doreplace $SETUPSCRIPTNAME "s;%READMEFILE%;$RETVALUE;g" + + unix2dosname $READMEAFTERFILE + doreplace $SETUPSCRIPTNAME "s;%READMEAFTERFILE%;$RETVALUE;g" + + unix2dosname $LICENSEFILE + doreplace $SETUPSCRIPTNAME "s;%LICENSEFILE%;$RETVALUE;g" + + doreplace $SETUPSCRIPTNAME "s/%APPNAME%/$APPNAME/g" + doreplace $SETUPSCRIPTNAME "s/%APPTITLE%/$APPTITLE/g" + + unix2dosname $SETUPIMAGEDIR + doreplace $SETUPSCRIPTNAME "s;%SOURCEDIR%;$RETVALUE;g" + + unix2dosname $DESTDIR + doreplace $SETUPSCRIPTNAME "s;%OUTPUTDIR%;$RETVALUE;g" + + doreplace $SETUPSCRIPTNAME "s/%APPEXTENSION%/$APPEXTENSION/g" + + # FIXME: how do we get the first name in the list? + if [ "$MANUALFILES" != "" ]; then + HELPFILE=`basename $MANUALFILES` + unix2dosname $HELPFILE + doreplace $SETUPSCRIPTNAME "s;%HELPFILE%;$RETVALUE;g" + fi + fi + + rm -f $DESTDIR/setup*.* + + # Inno Setup complains if this step is not done + unix2dos --unix2dos $SETUPSCRIPTNAME + + # Now invoke INNO compiler on the new ISS file + # First, make a DOS filename or Inno Setup will get confused. + + unix2dosname2 $SETUPSCRIPTNAME + DOSFILENAME=$RETVALUE + + # Note: the double slash is Mingw32/MSYS convention for + # denoting a switch, that must not be converted into + # a path (otherwise /c = c:/) + + cd `dirname $SETUPSCRIPTNAME` + BASESCRIPTNAME=`basename $SETUPSCRIPTNAME` + echo Invoking Inno Setup compiler on $BASESCRIPTNAME + + "$SETUPCOMPILER" //cc $BASESCRIPTNAME + + if [ ! -f $DESTDIR/setup.exe ]; then + echo "*** Error - the setup.exe was not generated." + exit + fi + + cd $DESTDIR + mv setup.exe $APPNAME-$VERSION-setup.exe + + echo If you saw no warnings or errors, $APPTITLE was successfully spun. + echo +} + +# We can't use e.g. this: +# ls `cat $SRC/distrib/msw/makefile.rsp` zip -@ -u $DEST/wxWindows-$VERSION-gen.zip +# because there's not enough space on the command line, plus we need to ignore the +# blank lines. +# So if we need to (not in this script so far) we do something like this instead: +# expandlines $SRC/setup/files.rsp temp.txt +# zip -@ `$CYGPATHPROG -w $DEST/archive.zip` < temp.txt + +expandlines() +{ + toexpand=$1 + outputfile=$2 + + rm -f $outputfile + touch $outputfile + for line in `cat $toexpand` ; do + if [ $line != "" ]; then + ls $line >> $outputfile + fi + done +} + +usage() +{ + echo "Usage: $PROGNAME [ options ]" 1>&2 + echo Options: + echo " --help Display this help message" + echo " --upx Compress executable with UPX" + echo " --no-upx Do not compress executable with UPX" + echo " --inno Build the setup.exe" + echo " --no-inno Do not build the setup.exe" + echo. + echo Note that options only override settings in $SCRIPTDIR/setup.var. + exit 1 +} + +# Process command line options. + +for i in "$@"; do + case "$i" in + --inno) INNO=1 ;; + --no-inno) INNO=0 ;; + --upx) UPX=1 ;; + --no-upx) UPX=0 ;; + *) + usage + exit + ;; + esac +done + +findversion +makesetup + diff --git a/utils/configtool/scripts/maketarball.sh b/utils/configtool/scripts/maketarball.sh new file mode 100644 index 0000000000..8f63c845b2 --- /dev/null +++ b/utils/configtool/scripts/maketarball.sh @@ -0,0 +1,135 @@ +#!/bin/sh + +# Make a distribution of ConfigTool for Linux +# Usage: maketarball.sh wxconfigtool-dir bin-dir deliver-dir version [ options ] +# For example: maketarball.sh ~/wxconfigtool /tmp/build-wxconfigtool /tmp/wxconfigtool-deliver 1.40 + +APPDIR=$1 +SRC=$APPDIR/src +BINARYSRC=$2 +DEST=$3 +BUILD=0 +UPX=0 +PROGNAME=$0 + +# Set this to the required version +VERSION=$4 + +dotar() +{ + rm -f -r $DEST/wxconfigtool* + rm -f $DEST/wxconfigtool-*.* + + mkdir -p $DEST/wxconfigtool-$VERSION + mkdir -p $DEST/wxconfigtool-$VERSION/resources + mkdir -p $DEST/wxconfigtool-$VERSION/Sample + cd $DEST/wxconfigtool-$VERSION + + # Copy readme files + cp $APPDIR/docs/readme.txt readme.txt + cp $APPDIR/docs/license.txt . + + # Copy the application binary + cp $BINARYSRC/wxconfigtool . + + # Copy the wxHTML Help manual file + cp $APPDIR/manual/configtool.htb . + + # Copy the sample + cp -r $APPDIR/sample Sample + cp $APPDIR/resources/* resources + + echo Removing junk from the samples folder... + rm -f -r Sample/CVS + + # Copy the resources file + rm -f configtool.bin + zip configtool.bin -j resources/* + + rm -f -r resources + + # Remove any debug info from wxconfigtool + strip wxconfigtool + + # Maybe compress the binary + if [ "$UPX" != "0" ]; then + upx wxconfigtool + fi + + cd .. + + # Make .tar.gz and .tar.bz2 archives + tar cvf $DEST/wxconfigtool-$VERSION-i386.tar wxconfigtool-$VERSION/* + gzip -c $DEST/wxconfigtool-$VERSION-i386.tar > $DEST/wxconfigtool-$VERSION-i386.tar.gz + bzip2 -c $DEST/wxconfigtool-$VERSION-i386.tar > $DEST/wxconfigtool-$VERSION-i386.tar.bz2 +} + +dobuild() +{ + makeapp release full +} + +usage() +{ + echo Usage: $PROGNAME "cvs-dir bin-dir deliver-dir version-number [ options ]" + echo Options: + echo " --help Display this help message" + echo " --upx Compress executable with UPX" + echo " --build Invoke 'maketarball.sh release full' first" + echo For example: maketarball.sh ~/wxconfigtool /tmp/build-app /tmp/wxconfigtool-deliver 1.20 + exit 1 +} + +# Process command line options. +shift 4 +for i in "$@"; do + case "$i" in + --build) BUILD=1 ;; + --upx) UPX=1 ;; + *) + usage + exit + ;; + esac +done + +if [ ! -d "$DEST" ]; then + mkdir -p $DEST +fi + +if [ ! -d "$SRC" ]; then + echo Source directory $SRC not found. + usage + exit 1 +fi + +if [ ! -d "$BINARYSRC" ]; then + echo Location of wxconfigtool binary $BINARYSRC not found. + usage + exit 1 +fi + +if [ "$VERSION" = "" ]; then + echo Pass the version number as the fourth argument. + usage + exit 1 +fi + +echo Creating Version $VERSION distribution in $DEST, using source directory $SRC and wxconfigtool binary in $BINARYSRC. +#echo Press return to continue. +#read dummy + +# Remove all existing files +if [ ! -d "$DEST/wxconfigtool" ]; then + rm -f -r $DEST/wxconfigtool +fi + +# Skip INNO setup if INNO is 0. +if [ "$BUILD" = "1" ]; then + dobuild +fi + +dotar + +echo ConfigTool archived. + diff --git a/utils/configtool/scripts/setup.var b/utils/configtool/scripts/setup.var new file mode 100644 index 0000000000..b1ce34d36d --- /dev/null +++ b/utils/configtool/scripts/setup.var @@ -0,0 +1,144 @@ +### List of variables for the purposes of generating an application's +### setup.exe + +#------------------------------------------------------------------------- +# The application name +#------------------------------------------------------------------------- + +APPNAME=wxconfigtool + +#------------------------------------------------------------------------- +# The application title +#------------------------------------------------------------------------- + +APPTITLE="wxWindows Configuration Tool" + +#------------------------------------------------------------------------- +# The application author (copyright holder) +#------------------------------------------------------------------------- + +AUTHOR="Julian Smart" + +#------------------------------------------------------------------------- +# The application vendor (organisation) +#------------------------------------------------------------------------- + +VENDOR="Anthemion Software" + +#------------------------------------------------------------------------- +# The application data file extension +#------------------------------------------------------------------------- + +APPEXTENSION=wxs + +#------------------------------------------------------------------------- +# The symbol to use when querying for the version number +#------------------------------------------------------------------------- + +VERSIONSYMBOL=ctVERSION_NUMBER + +#------------------------------------------------------------------------- +# The top-level directory of the application source tree +#------------------------------------------------------------------------- + +APPDIR=c:/wx2dev/wxWindows/utils/configtool + +#------------------------------------------------------------------------- +# The destination directory of the setup +#------------------------------------------------------------------------- + +DESTDIR=$APPDIR/deliver + +#------------------------------------------------------------------------- +# The temporary image directory to use when preparing the setup +#------------------------------------------------------------------------- + +SETUPIMAGEDIR=$APPDIR/deliver/image + +#------------------------------------------------------------------------- +# The name of the file with $VERSIONSYMBOL in it +#------------------------------------------------------------------------- + +VERSIONSYMBOLFILE=$APPDIR/src/symbols.h + +#------------------------------------------------------------------------- +# The locations of the project's Inno Setup header and footer files +#------------------------------------------------------------------------- + +INNOTOP=$APPDIR/scripts/innotop.txt +INNOBOTTOM=$APPDIR/scripts/innobott.txt + +#------------------------------------------------------------------------- +# The location of the generated setup script +#------------------------------------------------------------------------- + +SETUPSCRIPTNAME=$DESTDIR/$APPNAME.iss + +#------------------------------------------------------------------------- +# The locations of the readme and license files +#------------------------------------------------------------------------- + +READMEFILE=$APPDIR/docs/readme.txt +READMEAFTERFILE=$APPDIR/docs/readme-after.txt +LICENSEFILE=$APPDIR/docs/licence.txt + +#------------------------------------------------------------------------- +# The binary to include in the setup +#------------------------------------------------------------------------- + +APPBINARY=$APPDIR/src/ReleaseStable/$APPNAME.exe + +#------------------------------------------------------------------------- +# The location of the setup compiler +#------------------------------------------------------------------------- + +SETUPCOMPILER="c:/Program Files/Inno Setup 2/compil32.exe" + +#------------------------------------------------------------------------- +# Whether we will compress the binary (0 or 1). +# Use --upx or --no-upx to override this default value. +#------------------------------------------------------------------------- + +UPX=0 + +#------------------------------------------------------------------------- +# Whether we will make a manual (0 or 1) +# Use --make-manual or --no-make-manual to override this default value. +#------------------------------------------------------------------------- + +MAKEMANUAL=1 + +#------------------------------------------------------------------------- +# The manual filename(s) +#------------------------------------------------------------------------- + +MANUALFILES="$APPDIR/docs/manual/configtool.chm $APPDIR/docs/manual/configtool.htb" +WXMANUALCHM="$APPDIR/../../docs/htmlhelp/wx.chm" +WXMANUALHTB="$APPDIR/../../docs/htb/wx.htb" + +#------------------------------------------------------------------------- +# The directory containing the manual source. We assume +# that there is a Makefile in this directory for making the +# manual. +#------------------------------------------------------------------------- + +MANUALDIR=$APPDIR/docs/manual + +#------------------------------------------------------------------------- +# The resources file to compile, if any (e.g. myapp.bin). +# This is just a zip containing files to be used by the +# application, usually stored in src/resources. +# +# If this is left empty, no resources will be compiled. +#------------------------------------------------------------------------- + +#RESOURCESFILE=${APPNAME}.bin + +#------------------------------------------------------------------------- +# The directory containing the resources. +# +# If this is left empty, no resources will be compiled. +#------------------------------------------------------------------------- + +RESOURCESDIR=$APPDIR/src/resources + diff --git a/utils/configtool/src/Makefile b/utils/configtool/src/Makefile new file mode 100644 index 0000000000..d8103b5e4c --- /dev/null +++ b/utils/configtool/src/Makefile @@ -0,0 +1,219 @@ +# +# File: Makefile for wxconfigtool +# Author: Julian Smart +# Created: 2002.05.12 +# Updated: +# Copyright: (c) Julian Smart +# +# To make absolutely everything: +# +# % mkdir /tmp/wxconfigtool-build +# % cd /tmp/wxconfigtool-build +# % make -f $(APPDIR)/src/Makefile WXDIR=$(WXDIR) WXBUILDDIR=$(WXBUILDDIR) APPDIR=$(APPDIR) LEVEL=debug full +# +# To make just ConfigTool: +# +# % make ... LEVEL=debug wxconfigtool +# +# To make wxWindows library: +# +# % make ... LEVEL=debug wx +# +# The result will be subdirectories under your /tmp/wxconfigtool-build (or other specified +# directory) containing: +# +# wxconfigtool-build-debug/ +# wxwin-build-debug/ +# +# To make a release version, specify LEVEL=release instead of LEVEL=debug. +# + +# Current (build) directory +CURRDIR = $(shell pwd) +BUILDDIR=$(CURRDIR) + +top_srcdir = $(WXDIR) +top_builddir = $(WXBUILDDIR) +program_dir = + +# If we don't specify a location for wxWindows to be +# built, use a default. +ifeq "$(top_builddir)" "" +topbuilddir = $(CURRDIR)/wxwin-build-$(LEVEL) +WXBUILDDIR=$(top_builddir) +endif + +# ConfigTool build directory +APPBUILDDIR=$(BUILDDIR)/wxconfigtool-build-$(LEVEL) + +# StartingBlocks source hierarchy +# You have to specify this when invoking make. +APPDIR=You_should_override_the_APPDIR_variable + +# ConfigTool source directory +APPSRCDIR=$(APPDIR)/src + +# ConfigTool include directory +APPINCDIR=$(APPDIR)/src + +# Extra includes +APPEXTRADEFS= \ + -I$(WXDIR)/contrib/include \ + -I$(APPSRCDIR) \ + +# -I$(UTILSDIR) \ + +WXVERSION=2.4 + +# Use the small C++ support library +APPEXTRALIBS=-lsupc++ ${top_builddir}/lib/libwx_$(WXTOOLKIT)$(WXDEBUGSUFFIX)_xrc-$(WXVERSION).a + +PLATFORM_OS=$(shell echo $(OS)) + +ifeq "$(PLATFORM_OS)" "Windows_NT" +ARCHITECTURE="i686" +WXTOOLKIT=msw +else +ARCHITECTURE=$(shell arch) +ifeq "$(ARCHITECTURE)" "i686" +WXTOOLKIT=gtk +else +WXTOOLKIT=mac +endif +endif + +#printit: +# @echo $(PLATFORM_OS) + +ifeq "$(LEVEL)" "debug" +WXDEBUGSUFFIX=d +else +WXDEBUGSUFFIX= +endif + + +# Where to find the wx-config file +WXCONFIG=$(WXBUILDDIR)/wx-config $(WXCONFIGFLAGS) + +ifeq "$(LEVEL)" "debug" +WXDEBUGFLAGS=--enable-debug --enable-debug_gdb --enable-debug_cntxt +endif + +PROGRAM=$(APPBUILDDIR)/wxconfigtool + +OBJECTS = \ + $(APPBUILDDIR)/appsettings.o \ + $(APPBUILDDIR)/configitem.o \ + $(APPBUILDDIR)/configitemselector.o \ + $(APPBUILDDIR)/configtooldoc.o \ + $(APPBUILDDIR)/configtoolview.o \ + $(APPBUILDDIR)/configtree.o \ + $(APPBUILDDIR)/custompropertydialog.o \ + $(APPBUILDDIR)/htmlparser.o \ + $(APPBUILDDIR)/mainframe.o \ + $(APPBUILDDIR)/propeditor.o \ + $(APPBUILDDIR)/property.o \ + $(APPBUILDDIR)/settingsdialog.o \ + $(APPBUILDDIR)/utils.o \ + $(APPBUILDDIR)/wxconfigtool.o + +DEPFILES=$(PROGRAM).d + +ifeq "$(USEDUMMYMAKEPROG)" "1" +include $(APPSRCDIR)/makeprog.env +else +include $(top_builddir)/src/makeprog.env +endif + +CC=gcc +CXX=gcc + +mkbuilddir: + mkdir -p $(APPBUILDDIR) + +full: wx all + +# --with-libpng=builtin --with-zlib=builtin --with-libjpeg=builtin +wx: + @mkdir -p $(WXBUILDDIR) ; \ + cd $(WXBUILDDIR) ; \ + if test ! -f Makefile ; then rm -f *.o *.d ; \ + rm -f *.cache ; \ + $(WXDIR)/configure --disable-shared --enable-gui --enable-log $(WXDEBUGFLAGS) --with-threads --disable-no_rtti --without-sockets --without-odbc --with-libjpeg --with-libpng=builtin --with-zlib=builtin --enable-wave ; \ + fi; \ + make; cd contrib/src/xrc; make + +cleanapp: clean + +cleanwx: + rm -f -r $(WXBUILDDIR) + +cleanall: cleanapp cleanwx + +wxconfigtool: mkbuilddir all + +# Making a binary, RH Linux tarball release using the setup script. +# It will put the result in /tmp/wxconfigtool-deliver. +release: + echo "#include " > /tmp/appver.c + echo "#include \"symbols.h\"" >> /tmp/appver.c + echo "int main() { printf(\"%.2f\", ctVERSION_NUMBER); }" >> /tmp/appver.c + cc /tmp/appver.c -I$(APPSRCDIR) -o /tmp/appver + chmod a+x $(APPSRCDIR)/../scripts/maketarball.sh + $(APPSRCDIR)/../scripts/maketarball.sh $(APPDIR) $(APPBUILDDIR) /tmp/wxconfigtool-deliver `/tmp/appver` # --upx + echo The release is in /tmp/wxconfigtool-deliver. +# rm -f /tmp/appver /tmp/appver.c + +# Gives a list of targets +help: + @echo "Targets: full, wxconfigtool, wx, cleanall, clean, cleanwx, release" + +### File dependencies + +# Main app files + +$(APPBUILDDIR)/wxconfigtool.o: $(APPSRCDIR)/wxconfigtool.cpp $(APPINCDIR)/wxconfigtool.h $(APPSRCDIR)/symbols.h + $(CXX) -c $(CXXFLAGS) $(APPEXTRADEFS) -o $@ $< + +$(APPBUILDDIR)/appsettings.o: $(APPSRCDIR)/appsettings.cpp $(APPSRCDIR)/appsettings.h $(APPSRCDIR)/symbols.h + $(CXX) -c $(CXXFLAGS) $(APPEXTRADEFS) -o $@ $< + +$(APPBUILDDIR)/configitem.o: $(APPSRCDIR)/configitem.cpp $(APPSRCDIR)/configitem.h $(APPSRCDIR)/symbols.h + $(CXX) -c $(CXXFLAGS) $(APPEXTRADEFS) -o $@ $< + +$(APPBUILDDIR)/configitemselector.o: $(APPSRCDIR)/configitemselector.cpp $(APPSRCDIR)/configitemselector.h $(APPSRCDIR)/symbols.h + $(CXX) -c $(CXXFLAGS) $(APPEXTRADEFS) -o $@ $< + +$(APPBUILDDIR)/configtooldoc.o: $(APPSRCDIR)/configtooldoc.cpp $(APPSRCDIR)/configtooldoc.h $(APPSRCDIR)/symbols.h + $(CXX) -c $(CXXFLAGS) $(APPEXTRADEFS) -o $@ $< + +$(APPBUILDDIR)/configtoolview.o: $(APPSRCDIR)/configtoolview.cpp $(APPSRCDIR)/configtoolview.h $(APPSRCDIR)/symbols.h + $(CXX) -c $(CXXFLAGS) $(APPEXTRADEFS) -o $@ $< + +$(APPBUILDDIR)/configtree.o: $(APPSRCDIR)/configtree.cpp $(APPSRCDIR)/configtree.h $(APPSRCDIR)/symbols.h + $(CXX) -c $(CXXFLAGS) $(APPEXTRADEFS) -o $@ $< + +$(APPBUILDDIR)/custompropertydialog.o: $(APPSRCDIR)/custompropertydialog.cpp $(APPSRCDIR)/custompropertydialog.h $(APPSRCDIR)/symbols.h + $(CXX) -c $(CXXFLAGS) $(APPEXTRADEFS) -o $@ $< + +$(APPBUILDDIR)/htmlparser.o: $(APPSRCDIR)/htmlparser.cpp $(APPSRCDIR)/htmlparser.h $(APPSRCDIR)/symbols.h + $(CXX) -c $(CXXFLAGS) $(APPEXTRADEFS) -o $@ $< + +$(APPBUILDDIR)/mainframe.o: $(APPSRCDIR)/mainframe.cpp $(APPINCDIR)/mainframe.h $(APPSRCDIR)/symbols.h + $(CXX) -c $(CXXFLAGS) $(APPEXTRADEFS) -o $@ $< + +$(APPBUILDDIR)/propeditor.o: $(APPSRCDIR)/propeditor.cpp $(APPINCDIR)/propeditor.h $(APPSRCDIR)/symbols.h + $(CXX) -c $(CXXFLAGS) $(APPEXTRADEFS) -o $@ $< + +$(APPBUILDDIR)/property.o: $(APPSRCDIR)/property.cpp $(APPINCDIR)/property.h $(APPSRCDIR)/symbols.h + $(CXX) -c $(CXXFLAGS) $(APPEXTRADEFS) -o $@ $< + +$(APPBUILDDIR)/settingsdialog.o: $(APPSRCDIR)/settingsdialog.cpp $(APPINCDIR)/settingsdialog.h $(APPSRCDIR)/symbols.h + $(CXX) -c $(CXXFLAGS) $(APPEXTRADEFS) -o $@ $< + +$(APPBUILDDIR)/utils.o: $(APPSRCDIR)/utils.cpp $(APPINCDIR)/imagewindow.h $(APPSRCDIR)/symbols.h + $(CXX) -c $(CXXFLAGS) $(APPEXTRADEFS) -o $@ $< + +$(APPBUILDDIR)/wxconfigtool_resources.o: $(APPSRCDIR)/wxconfigtool.rc + $(RESCOMP) -i $< -o $@ $(RESFLAGS) --include-dir $(APPSRCDIR) + diff --git a/utils/configtool/src/Makefile.in b/utils/configtool/src/Makefile.in new file mode 100644 index 0000000000..1c4cde62cb --- /dev/null +++ b/utils/configtool/src/Makefile.in @@ -0,0 +1,28 @@ +# +# File: Makefile.in +# Author: Julian Smart +# Created: 2003 +# Updated: +# Copyright: (c) 2003 Julian Smart +# +# "%W% %G%" +# +# Makefile for wxWindows Configuration Tool (Unix) + +top_srcdir = @top_srcdir@/.. +top_builddir = ../../.. +program_dir = utils/configtool/src + +PROGRAM=wxconfigtool + +OBJECTS = wxconfigtool.o appsettings.o configitem.o configitemselector.o configtooldoc.o \ + configtoolview.o configtree.o custompropertydialog.o htmlparser.o mainframe.o \ + propeditor.o property.o settingsdialog.o utils.o + +DEPFILES=wxconfigtool.d appsettings.d configitem.d configitemselector.d configtooldoc.d \ + configtoolview.d configtree.d custompropertydialog.d htmlparser.d mainframe.d \ + propeditor.d property.d settingsdialog.o utils.d + +include ../../../src/makeprog.env + +-include $(DEPFILES) diff --git a/utils/configtool/src/appsettings.cpp b/utils/configtool/src/appsettings.cpp new file mode 100644 index 0000000000..69fd5a3d52 --- /dev/null +++ b/utils/configtool/src/appsettings.cpp @@ -0,0 +1,272 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: appsettings.cpp +// Purpose: Implements settings-related functionality +// Author: Julian Smart +// Modified by: +// Created: 2002-09-04 +// RCS-ID: $Id$ +// Copyright: (c) Julian Smart +// Licence: +///////////////////////////////////////////////////////////////////////////// + +#ifdef __GNUG__ +#pragma implementation appsettings.h +#endif + +#include "wx/wx.h" + +#ifdef __BORLANDC__ +#pragma hdrstop +#endif + +#ifndef WX_PRECOMP +#include "wx/wx.h" +#endif + +#include "wx/wfstream.h" +#include "wx/datstrm.h" +#include "wx/config.h" +#include "wx/fileconf.h" +#include "wx/dir.h" +#include "wx/valgen.h" +#include "wx/colordlg.h" +#include "wx/wxhtml.h" +#include "wx/effects.h" +#include "wx/spinctrl.h" +#include "wx/tooltip.h" + +#include "utils.h" +#include "wxconfigtool.h" +#include "appsettings.h" +#include "mainframe.h" +#include "symbols.h" +#include "settingsdialog.h" + +/* + * User-changeable settings + */ + +IMPLEMENT_DYNAMIC_CLASS(ctSettings, wxObject) + +ctSettings::ctSettings() +{ + m_noUses = 0; + m_showToolBar = TRUE; + m_showWelcomeDialog = TRUE; + m_exportDir = wxEmptyString; + + m_frameSize = wxRect(10, 10, 600, 500); + // m_backgroundColour = wxColour(140, 172, 179); // blue-grey + m_editWindowFont = wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT); + + m_appName = wxT("wxWindows Configuration Tool"); + m_appNameShort = wxT("Configuration Tool"); + m_showSplashScreen = FALSE; + m_userName = wxEmptyString; + m_frameStatus = ctSHOW_STATUS_NORMAL; + m_loadLastDocument = TRUE; + m_firstTimeRun = TRUE; + m_smallToolbar = TRUE; + m_mainSashSize = 200; + m_useToolTips = TRUE; + m_showTrayIcon = TRUE; + m_trayIconIsShown = FALSE; + m_useEnvironmentVariable = TRUE; + m_frameworkDir = wxEmptyString; +} + +// Copy constructor +ctSettings::ctSettings(const ctSettings& settings) +{ + Copy(settings); +} + + +ctSettings::~ctSettings() +{ +} + +void ctSettings::operator = (const ctSettings& settings) +{ + Copy(settings); +} + +void ctSettings::Copy (const ctSettings& settings) +{ + m_currentDocumentDir = settings.m_currentDocumentDir; + m_lastDocument = settings.m_lastDocument; + m_showToolBar = settings.m_showToolBar; + m_frameSize = settings.m_frameSize; + m_editWindowFont = settings.m_editWindowFont; + m_showSplashScreen = settings.m_showSplashScreen; + m_userName = settings.m_userName; + m_loadLastDocument = settings.m_loadLastDocument; + m_exportDir = settings.m_exportDir; + m_firstTimeRun = settings.m_firstTimeRun; + m_noUses = settings.m_noUses; + m_smallToolbar = settings.m_smallToolbar; + m_useToolTips = settings.m_useToolTips; + m_showWelcomeDialog = settings.m_showWelcomeDialog; + m_mainSashSize = settings.m_mainSashSize; + + m_showTrayIcon = settings.m_showTrayIcon; + m_trayIconIsShown = settings.m_trayIconIsShown; + + m_useEnvironmentVariable = settings.m_useEnvironmentVariable; + m_frameworkDir = settings.m_frameworkDir; +} + +// Do some initialisation within stApp::OnInit +bool ctSettings::Init() +{ + m_currentDocumentDir = wxEmptyString; + if (m_userName.IsEmpty()) + m_userName = wxGetUserName(); + + return TRUE; +} + +// Create new filename +wxString ctSettings::GenerateFilename(const wxString& rootName) +{ + wxString path; + if (!m_lastFilename.IsEmpty()) + path = wxPathOnly(m_lastFilename); + else + path = wxGetApp().GetAppDir(); + + wxString filename(path); + if (filename.Last() != wxFILE_SEP_PATH ) + filename += wxFILE_SEP_PATH; + filename += rootName; + + wxString fullFilename = filename + wxT(".wxs"); + int i = 0; + wxString postfixStr; + while (wxFileExists(fullFilename)) + { + i ++; + postfixStr.Printf("%d", i); + fullFilename = filename + postfixStr + wxT(".wxs"); + } + + m_lastFilename = fullFilename; + return fullFilename; +} + +// Load config info +bool ctSettings::LoadConfig() +{ + wxConfig config(wxGetApp().GetSettings().GetAppName(), wxT("wxWindows")); + + config.Read(wxT("Files/LastFile"), & m_lastFilename); + config.Read(wxT("Files/DocumentDir"), & m_currentDocumentDir); + config.Read(wxT("Files/ExportDir"), & m_exportDir); + config.Read(wxT("Files/FrameworkDir"), & m_frameworkDir); + config.Read(wxT("Files/UseEnvironmentVariable"), (bool*) & m_useEnvironmentVariable); + + config.Read(wxT("Misc/UserName"), & m_userName); + config.Read(wxT("Misc/FrameStatus"), & m_frameStatus); + config.Read(wxT("Misc/ShowToolTips"), (bool*) & m_useToolTips); + config.Read(wxT("Misc/LastDocument"), & m_lastDocument); + config.Read(wxT("Misc/LoadLastDocument"), (bool*) & m_loadLastDocument); + config.Read(wxT("Misc/ShowWelcomeDialog"), (bool*) & m_showWelcomeDialog); + config.Read(wxT("Misc/Ran"), & m_noUses); + config.Read(wxT("Misc/ShowTrayIcon"), (bool*) & m_showTrayIcon); + + m_noUses ++; + + config.Read(wxT("Windows/ShowToolBar"), (bool*) & m_showToolBar); + + m_firstTimeRun = !(config.Read(wxT("Windows/WindowX"), & m_frameSize.x)); + config.Read(wxT("Windows/WindowY"), & m_frameSize.y); + config.Read(wxT("Windows/WindowWidth"), & m_frameSize.width); + config.Read(wxT("Windows/WindowHeight"), & m_frameSize.height); + config.Read(wxT("Windows/ShowSplashScreen"), (bool*) & m_showSplashScreen); + config.Read(wxT("Windows/SmallToolbar"), (bool*) & m_smallToolbar); + config.Read(wxT("Windows/MainSashSize"), & m_mainSashSize); + + wxString fontSpec; + + fontSpec = wxEmptyString; + config.Read(wxT("Style/EditWindowFont"), & fontSpec); + if (!fontSpec.IsEmpty()) + m_editWindowFont = apStringToFont(fontSpec); + + // Crash-resistance + int runningProgram = 0; + config.Read(wxT("Misc/RunningProgram"), & runningProgram); + +#ifndef __WXDEBUG__ + // runningProgram should be zero if all is well. If 1, + // it crashed during a run, so we should disable the auto-load + // facility just in case it's trying to load a damaged file. + if (runningProgram != 0) + { + m_loadLastDocument = FALSE; + } +#endif + + config.Write(wxT("Misc/RunningProgram"), (long) 1); + + return TRUE; +} + +// Save config info +bool ctSettings::SaveConfig() +{ + wxConfig config(wxGetApp().GetSettings().GetAppName(), wxT("wxWindows")); + + config.Write(wxT("Files/LastFile"), m_lastFilename); + config.Write(wxT("Files/DocumentDir"), m_currentDocumentDir); + config.Write(wxT("Files/ExportDir"), m_exportDir); + config.Write(wxT("Files/FrameworkDir"), m_frameworkDir); + config.Write(wxT("Files/UseEnvironmentVariable"), m_useEnvironmentVariable); + + config.Write(wxT("Misc/UserName"), m_userName); + config.Write(wxT("Misc/FrameStatus"), (long) m_frameStatus); + config.Write(wxT("Misc/ShowToolTips"), m_useToolTips); + config.Write(wxT("Misc/LastDocument"), m_lastDocument); + config.Write(wxT("Misc/LoadLastDocument"), (long) m_loadLastDocument); + config.Write(wxT("Misc/ShowWelcomeDialog"), (long) m_showWelcomeDialog); + config.Write(wxT("Misc/Ran"), m_noUses); + config.Write(wxT("Misc/ShowTrayIcon"), (long) m_showTrayIcon); + + config.Write(wxT("Windows/ShowToolBar"), m_showToolBar); + config.Write(wxT("Windows/WindowX"), (long) m_frameSize.x); + config.Write(wxT("Windows/WindowY"), (long) m_frameSize.y); + config.Write(wxT("Windows/WindowWidth"), (long) m_frameSize.width); + config.Write(wxT("Windows/WindowHeight"), (long) m_frameSize.height); + + config.Write(wxT("Windows/ShowSplashScreen"), m_showSplashScreen); + config.Write(wxT("Windows/SmallToolbar"), (long) m_smallToolbar); + config.Write(wxT("Windows/MainSashSize"), (long) m_mainSashSize); + + /* + wxString backgroundColour(apColourToHexString(m_backgroundColour)); + config.Write(wxT("Style/BackgroundColour"), backgroundColour); + */ + + config.Write(wxT("Style/EditWindowFont"), apFontToString(m_editWindowFont)); + + // Indicate that we're no longer running, so we know if the program + // crashed last time around. + config.Write(wxT("Misc/RunningProgram"), (long) 0); + + { + config.SetPath(wxT("FileHistory/")); + wxGetApp().GetDocManager()->FileHistorySave(config); + } + + return TRUE; +} + +void ctSettings::ShowSettingsDialog(const wxString& page) +{ + ctSettingsDialog* dialog = new ctSettingsDialog(wxGetApp().GetTopWindow()); +// if (!page.IsEmpty()) +// dialog->GetNotebook()->SetSelection(apFindNotebookPage(dialog->GetNotebook(), page)); + + /* int ret = */ dialog->ShowModal(); + dialog->Destroy(); +} diff --git a/utils/configtool/src/appsettings.h b/utils/configtool/src/appsettings.h new file mode 100644 index 0000000000..8a529fc82a --- /dev/null +++ b/utils/configtool/src/appsettings.h @@ -0,0 +1,124 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: appsettings.h +// Purpose: Settings-related classes +// Author: Julian Smart +// Modified by: +// Created: 2002-09-04 +// RCS-ID: $Id$ +// Copyright: (c) Julian Smart +// Licence: +///////////////////////////////////////////////////////////////////////////// + +#ifndef _AP_APPSETTINGS_H_ +#define _AP_APPSETTINGS_H_ + +#ifdef __GNUG__ +#pragma interface appsettings.cpp +#endif + +#include "wx/notebook.h" +#include "wx/dialog.h" +#include "wx/datetime.h" +#include "wx/wave.h" + +#include "wxconfigtool.h" + +// Frame status +#define ctSHOW_STATUS_NORMAL 0x01 +#define ctSHOW_STATUS_MINIMIZED 0x02 +#define ctSHOW_STATUS_MAXIMIZED 0x03 + +/*! + * \brief ctSettings holds all the settings that can be altered + * by the user (and probably some that can't). + */ + +class ctSettings: public wxObject +{ +DECLARE_DYNAMIC_CLASS(ctSettings) +public: + /// Default constructor. + ctSettings(); + + /// Copy constructor. + ctSettings(const ctSettings& settings); + + /// Destructor. + ~ctSettings(); + +// Operations + + /// Assignment operator. + void operator = (const ctSettings& settings); + + /// Copy function. + void Copy (const ctSettings& settings); + + /// Loads configuration information from the registry or a file. + bool LoadConfig(); + + /// Saves configuration information to the registry or a file. + bool SaveConfig(); + + /// Initialisation before LoadConfig is called. + bool Init(); + + /// Shows the settings dialog. + void ShowSettingsDialog(const wxString& page = wxEmptyString); + + /// Generates a new document filename. + wxString GenerateFilename(const wxString& rootName); + +// Accessors + + /// Returns the long application name. This name is used + /// for the registry key and main frame titlebar. + wxString GetAppName() const { return m_appName; } + + /// Returns the short application name. + wxString GetShortAppName() const { return m_appNameShort; } + + /// Gets the name of the last filename to be loaded. + /// May not be needed in this application. + wxString& GetLastFilename() { return m_lastFilename; } + + /// Returns TRUE if this is the first time the application + /// has been run. + bool GetFirstTimeRun() const { return m_firstTimeRun; } + +public: + wxString m_currentDocumentDir; // Not yet used + wxString m_lastDocument; // Last document + bool m_showToolBar; + bool m_smallToolbar; + wxRect m_frameSize; + // wxColour m_backgroundColour; // background colour + wxFont m_editWindowFont; + int m_noUses; // Number of times the app was invoked + + wxString m_appName; // The current name of the app... + wxString m_appNameShort; // The short name of the app... + bool m_showSplashScreen; // Show the splash screen + wxString m_userName; + wxString m_lastFilename; // So we can auto-generate sensible filenames + bool m_loadLastDocument; + bool m_useToolTips; // Use tooltips on dialogs + int m_frameStatus; + wxString m_exportDir; // Where files are exported to + + wxString m_frameworkDir; // Where the wxWin hierarchy is + bool m_useEnvironmentVariable; // Use WXWIN + + /// This isn't explicitly held in the registry + /// but deduced from whether there are values there + bool m_firstTimeRun; + bool m_showWelcomeDialog; // Show opening helpful dialog + + int m_mainSashSize; + bool m_showTrayIcon; + bool m_trayIconIsShown; +}; + +#endif + // _AP_APPSETTINGS_H_ + diff --git a/utils/configtool/src/bitmaps/checked.xpm b/utils/configtool/src/bitmaps/checked.xpm new file mode 100644 index 0000000000..bf15083d2a --- /dev/null +++ b/utils/configtool/src/bitmaps/checked.xpm @@ -0,0 +1,23 @@ +/* XPM */ +static char * checked_xpm[] = { +"16 16 4 1", +" c None", +". c #808080", +"X c Black", +"o c #c0c0c0", +" ", +" ", +" ............ ", +" .XXXXXXXXXXo ", +" .X o ", +" .X X o ", +" .X XX o ", +" .X X XXX o ", +" .X XX XXX o ", +" .X XXXXX o ", +" .X XXX o ", +" .X X o ", +" .X o ", +" .ooooooooooo ", +" ", +" "}; diff --git a/utils/configtool/src/bitmaps/checked_dis.xpm b/utils/configtool/src/bitmaps/checked_dis.xpm new file mode 100644 index 0000000000..61e35038bb --- /dev/null +++ b/utils/configtool/src/bitmaps/checked_dis.xpm @@ -0,0 +1,23 @@ +/* XPM */ +static char * checked_dis_xpm[] = { +"16 16 4 1", +" c None", +". c #808080", +"X c Black", +"o c #c0c0c0", +" ", +" ", +" ............ ", +" .XXXXXXXXXXo ", +" .Xoooooooooo ", +" .Xooooooo.oo ", +" .Xoooooo..oo ", +" .Xo.ooo...oo ", +" .Xo..o...ooo ", +" .Xo.....oooo ", +" .Xoo...ooooo ", +" .Xooo.oooooo ", +" .Xoooooooooo ", +" .ooooooooooo ", +" ", +" "}; diff --git a/utils/configtool/src/bitmaps/checkedfolder.xpm b/utils/configtool/src/bitmaps/checkedfolder.xpm new file mode 100644 index 0000000000..2f84ad388f --- /dev/null +++ b/utils/configtool/src/bitmaps/checkedfolder.xpm @@ -0,0 +1,25 @@ +/* XPM */ +static char *checkedfolder_xpm[] = { +"16 16 6 1", +" c None", +". c #808080", +"X c #FFFF00", +"o c #C0C0C0", +"O c #FFFFFF", +"+ c #000000", +" ", +" ..... ", +" .XoXoX. ", +" .XoXoXoX...... ", +" .OOOOOOOOOOOO.+", +" .OXoXoXoXo+oX.+", +" .OoXoXoXo++Xo.+", +" .OXo+oXo+++oX.+", +" .OoX++o+++oXo.+", +" .OXo+++++oXoX.+", +" .OoXo+++oXoXo.+", +" .OXoXo+oXoXoX.+", +" ..............+", +" ++++++++++++++", +" ", +" "}; diff --git a/utils/configtool/src/bitmaps/checkedfolder_dis.xpm b/utils/configtool/src/bitmaps/checkedfolder_dis.xpm new file mode 100644 index 0000000000..5458f94ac0 --- /dev/null +++ b/utils/configtool/src/bitmaps/checkedfolder_dis.xpm @@ -0,0 +1,23 @@ +/* XPM */ +static char *checkedfolder_dis_xpm[] = { +"16 16 4 1", +" c None", +". c #808080", +"X c #C0C0C0", +"o c #000000", +" ", +" ..... ", +" .XXXXX. ", +".XXXXXXX...... ", +".XXXXXXXXXXXX.o ", +".XXXXXXXXX.XX.o ", +".XXXXXXXX..XX.o ", +".XXX.XXX...XX.o ", +".XXX..X...XXX.o ", +".XXX.....XXXX.o ", +".XXXX...XXXXX.o ", +".XXXXX.XXXXXX.o ", +"..............o ", +" oooooooooooooo ", +" ", +" "}; diff --git a/utils/configtool/src/bitmaps/closedfolder.xpm b/utils/configtool/src/bitmaps/closedfolder.xpm new file mode 100644 index 0000000000..03c55a32aa --- /dev/null +++ b/utils/configtool/src/bitmaps/closedfolder.xpm @@ -0,0 +1,25 @@ +/* XPM */ +static char * closedfolder_xpm[] = { +"16 16 6 1", +" c None", +". c #808080", +"X c Yellow", +"o c #c0c0c0", +"O c Gray100", +"+ c Black", +" ", +" ..... ", +" .XoXoX. ", +" .XoXoXoX...... ", +" .OOOOOOOOOOOO.+", +" .OXoXoXoXoXoX.+", +" .OoXoXoXoXoXo.+", +" .OXoXoXoXoXoX.+", +" .OoXoXoXoXoXo.+", +" .OXoXoXoXoXoX.+", +" .OoXoXoXoXoXo.+", +" .OXoXoXoXoXoX.+", +" ..............+", +" ++++++++++++++", +" ", +" "}; diff --git a/utils/configtool/src/bitmaps/closedfolder_dis.xpm b/utils/configtool/src/bitmaps/closedfolder_dis.xpm new file mode 100644 index 0000000000..a8ffebaead --- /dev/null +++ b/utils/configtool/src/bitmaps/closedfolder_dis.xpm @@ -0,0 +1,23 @@ +/* XPM */ +static char *closedfolder_dis_xpm[] = { +"16 16 4 1", +" c None", +". c #808080", +"X c #C0C0C0", +"o c #000000", +" ", +" ..... ", +" .XXXXX. ", +" .XXXXXXX...... ", +" .XXXXXXXXXXXX.o", +" .XXXXXXXXXXXX.o", +" .XXXXXXXXXXXX.o", +" .XXXXXXXXXXXX.o", +" .XXXXXXXXXXXX.o", +" .XXXXXXXXXXXX.o", +" .XXXXXXXXXXXX.o", +" .XXXXXXXXXXXX.o", +" ..............o", +" oooooooooooooo", +" ", +" "}; diff --git a/utils/configtool/src/bitmaps/copy.xpm b/utils/configtool/src/bitmaps/copy.xpm new file mode 100644 index 0000000000..47565c1cae --- /dev/null +++ b/utils/configtool/src/bitmaps/copy.xpm @@ -0,0 +1,25 @@ +/* XPM */ +static char *copy_xpm[] = { +/* columns rows colors chars-per-pixel */ +"16 15 4 1", +" c None", +". c Black", +"X c Gray100", +"o c #000080", +/* pixels */ +" ", +" ...... ", +" .XXXX.. ", +" .XXXX.X. ", +" .X..X.oooooo ", +" .XXXXXoXXXXoo ", +" .X....oXXXXoXo ", +" .XXXXXoX..Xoooo", +" .X....oXXXXXXXo", +" .XXXXXoX.....Xo", +" ......oXXXXXXXo", +" oX.....Xo", +" oXXXXXXXo", +" ooooooooo", +" " +}; diff --git a/utils/configtool/src/bitmaps/cut.xpm b/utils/configtool/src/bitmaps/cut.xpm new file mode 100644 index 0000000000..bfe7e95cea --- /dev/null +++ b/utils/configtool/src/bitmaps/cut.xpm @@ -0,0 +1,24 @@ +/* XPM */ +static char *cut_xpm[] = { +/* columns rows colors chars-per-pixel */ +"16 15 3 1", +" c None", +". c Black", +"X c #000080", +/* pixels */ +" ", +" . . ", +" . . ", +" . . ", +" .. .. ", +" . . ", +" ... ", +" . ", +" X.X ", +" X XXX ", +" XXX X X ", +" X X X X ", +" X X X X ", +" X X XX ", +" XX " +}; diff --git a/utils/configtool/src/bitmaps/ellipsis.xpm b/utils/configtool/src/bitmaps/ellipsis.xpm new file mode 100644 index 0000000000..5b5e925724 --- /dev/null +++ b/utils/configtool/src/bitmaps/ellipsis.xpm @@ -0,0 +1,21 @@ +/* XPM */ +static char *ellipsis_xpm[] = { +"16 16 2 1", +" c None", +". c #000000", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" .. .. .. ", +" .. .. .. ", +" ", +" ", +" ", +" "}; diff --git a/utils/configtool/src/bitmaps/folder1.xpm b/utils/configtool/src/bitmaps/folder1.xpm new file mode 100644 index 0000000000..61fae2325f --- /dev/null +++ b/utils/configtool/src/bitmaps/folder1.xpm @@ -0,0 +1,25 @@ +/* XPM */ +static char * folder1_xpm[] = { +"16 16 6 1", +" c None", +". c #808080", +"X c Yellow", +"o c None", +"O c Gray100", +"+ c Black", +" ", +" ..... ", +" .XoXoX. ", +" .XoXoXoX...... ", +" .OOOOOOOOOOOO.+", +" .OXoXoXoXoXoX.+", +" .OoXoXoXoXoXo.+", +" .OXoXoXoXoXoX.+", +" .OoXoXoXoXoXo.+", +" .OXoXoXoXoXoX.+", +" .OoXoXoXoXoXo.+", +" .OXoXoXoXoXoX.+", +" ..............+", +" ++++++++++++++", +" ", +" "}; diff --git a/utils/configtool/src/bitmaps/help.xpm b/utils/configtool/src/bitmaps/help.xpm new file mode 100644 index 0000000000..27a87ebb31 --- /dev/null +++ b/utils/configtool/src/bitmaps/help.xpm @@ -0,0 +1,24 @@ +/* XPM */ +static char *help_xpm[] = { +/* columns rows colors chars-per-pixel */ +"16 15 3 1", +" c None", +". c Black", +"X c #008080", +/* pixels */ +" ", +" ...... ", +" .XXXXX.. ", +" .XX...XX.. ", +" .X.. .X.. ", +" .X.. .XX.. ", +" .. .XX.. ", +" .XX.. ", +" .X.. ", +" .X.. ", +" .X.. ", +" .. ", +" .XX.. ", +" .XX.. ", +" ... " +}; diff --git a/utils/configtool/src/bitmaps/helpcs.xpm b/utils/configtool/src/bitmaps/helpcs.xpm new file mode 100644 index 0000000000..2f7f6d3ab1 --- /dev/null +++ b/utils/configtool/src/bitmaps/helpcs.xpm @@ -0,0 +1,24 @@ +/* XPM */ +static char *helpcs_xpm[] = { +/* width height num_colors chars_per_pixel */ +" 16 15 2 1", +/* colors */ +". c #000000", +"# c None", +/* pixels */ +"################", +".########.....##", +"..######..###..#", +"...####..####...", +"....###..####...", +".....###..###..#", +"......######..##", +".......####..###", +"........##..####", +".....#####..####", +"..#..###########", +".###..####...###", +"####..####...###", +"#####..#########", +"#####..#########" +}; diff --git a/utils/configtool/src/bitmaps/new.xpm b/utils/configtool/src/bitmaps/new.xpm new file mode 100644 index 0000000000..754d2d20a2 --- /dev/null +++ b/utils/configtool/src/bitmaps/new.xpm @@ -0,0 +1,24 @@ +/* XPM */ +static char *new_xpm[] = { +/* columns rows colors chars-per-pixel */ +"16 15 3 1", +" c None", +". c Black", +"X c Gray100", +/* pixels */ +" ", +" ........ ", +" .XXXXXX.. ", +" .XXXXXX.X. ", +" .XXXXXX.... ", +" .XXXXXXXXX. ", +" .XXXXXXXXX. ", +" .XXXXXXXXX. ", +" .XXXXXXXXX. ", +" .XXXXXXXXX. ", +" .XXXXXXXXX. ", +" .XXXXXXXXX. ", +" .XXXXXXXXX. ", +" ........... ", +" " +}; diff --git a/utils/configtool/src/bitmaps/open.xpm b/utils/configtool/src/bitmaps/open.xpm new file mode 100644 index 0000000000..54748e910d --- /dev/null +++ b/utils/configtool/src/bitmaps/open.xpm @@ -0,0 +1,26 @@ +/* XPM */ +static char *open_xpm[] = { +/* columns rows colors chars-per-pixel */ +"16 15 5 1", +" c None", +". c Black", +"X c Yellow", +"o c Gray100", +"O c #bfbf00", +/* pixels */ +" ", +" ... ", +" . . .", +" ..", +" ... ...", +" .XoX....... ", +" .oXoXoXoXo. ", +" .XoXoXoXoX. ", +" .oXoX..........", +" .XoX.OOOOOOOOO.", +" .oo.OOOOOOOOO. ", +" .X.OOOOOOOOO. ", +" ..OOOOOOOOO. ", +" ........... ", +" " +}; diff --git a/utils/configtool/src/bitmaps/paste.xpm b/utils/configtool/src/bitmaps/paste.xpm new file mode 100644 index 0000000000..69177e9b19 --- /dev/null +++ b/utils/configtool/src/bitmaps/paste.xpm @@ -0,0 +1,27 @@ +/* XPM */ +static char *paste_xpm[] = { +/* columns rows colors chars-per-pixel */ +"16 15 6 1", +" c None", +". c Black", +"X c Yellow", +"o c #808080", +"O c #000080", +"+ c Gray100", +/* pixels */ +" ", +" .... ", +" .....XX..... ", +".ooo.X..X.ooo. ", +".oo. .oo. ", +".oo........oo. ", +".oooooooooooo. ", +".oooooOOOOOOO. ", +".oooooO+++++OO ", +".oooooO+++++O+O ", +".oooooO+OOO+OOO ", +".oooooO+++++++O ", +".oooooO+OOOOO+O ", +" .....O+++++++O ", +" OOOOOOOOO " +}; diff --git a/utils/configtool/src/bitmaps/radiofolderoff.xpm b/utils/configtool/src/bitmaps/radiofolderoff.xpm new file mode 100644 index 0000000000..5e4b423380 --- /dev/null +++ b/utils/configtool/src/bitmaps/radiofolderoff.xpm @@ -0,0 +1,25 @@ +/* XPM */ +static char *radiofolderoff_xpm[] = { +"16 16 6 1", +" c None", +". c #808080", +"X c #FFFF00", +"o c #C0C0C0", +"O c #FFFFFF", +"+ c #000000", +" ", +" ..... ", +" .XoXoX. ", +" .XoXoXoX...... ", +" .OOOOOOOOOOOO.+", +" .OXoX...XoXoX.+", +" .OoX.OOO.XoXo.+", +" .OX.OOOOO.XoX.+", +" .Oo.OOOOO.oXo.+", +" .OX.OOOOO.XoX.+", +" .OoX.OOO.XoXo.+", +" .OXoX...XoXoX.+", +" ..............+", +" ++++++++++++++", +" ", +" "}; diff --git a/utils/configtool/src/bitmaps/radiofolderoff_dis.xpm b/utils/configtool/src/bitmaps/radiofolderoff_dis.xpm new file mode 100644 index 0000000000..dbb7b115ea --- /dev/null +++ b/utils/configtool/src/bitmaps/radiofolderoff_dis.xpm @@ -0,0 +1,23 @@ +/* XPM */ +static char *radiofolderoff_dis_xpm[] = { +"16 16 4 1", +" c None", +". c #808080", +"X c #C0C0C0", +"o c #000000", +" ", +" ..... ", +" .XXXXX. ", +" .XXXXXXX...... ", +" .XXXXXXXXXXXX.o", +" .XXXX...XXXXX.o", +" .XXX.XXX.XXXX.o", +" .XX.XXXXX.XXX.o", +" .XX.XXXXX.XXX.o", +" .XX.XXXXX.XXX.o", +" .XXX.XXX.XXXX.o", +" .XXXX...XXXXX.o", +" ..............o", +" oooooooooooooo", +" ", +" "}; diff --git a/utils/configtool/src/bitmaps/radiofolderon.xpm b/utils/configtool/src/bitmaps/radiofolderon.xpm new file mode 100644 index 0000000000..d6e61f2617 --- /dev/null +++ b/utils/configtool/src/bitmaps/radiofolderon.xpm @@ -0,0 +1,25 @@ +/* XPM */ +static char *radiofolderon_xpm[] = { +"16 16 6 1", +" c None", +". c #808080", +"X c #FFFF00", +"o c #C0C0C0", +"O c #FFFFFF", +"+ c #000000", +" ", +" ..... ", +" .XoXoX. ", +" .XoXoXoX...... ", +" .OOOOOOOOOOOO.+", +" .OXoX...XoXoX.+", +" .OoX.OOO.XoXo.+", +" .OX.O+++O.XoX.+", +" .Oo.O+++O.oXo.+", +" .OX.O+++O.XoX.+", +" .OoX.OOO.XoXo.+", +" .OXoX...XoXoX.+", +" ..............+", +" ++++++++++++++", +" ", +" "}; diff --git a/utils/configtool/src/bitmaps/radiofolderon_dis.xpm b/utils/configtool/src/bitmaps/radiofolderon_dis.xpm new file mode 100644 index 0000000000..92d0d9b621 --- /dev/null +++ b/utils/configtool/src/bitmaps/radiofolderon_dis.xpm @@ -0,0 +1,23 @@ +/* XPM */ +static char *radiofolderon_dis_xpm[] = { +"16 16 4 1", +" c None", +". c #808080", +"X c #C0C0C0", +"o c #000000", +" ", +" ..... ", +" .XXXXX. ", +" .XXXXXXX...... ", +" .XXXXXXXXXXXX.o", +" .XXXX...XXXXX.o", +" .XXX.XXX.XXXX.o", +" .XX.X...X.XXX.o", +" .XX.X...X.XXX.o", +" .XX.X...X.XXX.o", +" .XXX.XXX.XXXX.o", +" .XXXX...XXXXX.o", +" ..............o", +" oooooooooooooo", +" ", +" "}; diff --git a/utils/configtool/src/bitmaps/radiooff.xpm b/utils/configtool/src/bitmaps/radiooff.xpm new file mode 100644 index 0000000000..96603c812b --- /dev/null +++ b/utils/configtool/src/bitmaps/radiooff.xpm @@ -0,0 +1,23 @@ +/* XPM */ +static char * radiooff_xpm[] = { +"16 16 4 1", +" c None", +". c #808080", +"X c Black", +"o c #c0c0c0", +" ", +" ", +" .... ", +" ..XXXX.. ", +" .XX XXo ", +" .X oo ", +" .X oo ", +" .X oo ", +" .X oo ", +" .X oo ", +" .X oo ", +" .oo ooo ", +" oooooooo ", +" oooo ", +" ", +" "}; diff --git a/utils/configtool/src/bitmaps/radiooff_dis.xpm b/utils/configtool/src/bitmaps/radiooff_dis.xpm new file mode 100644 index 0000000000..0d7bef3c49 --- /dev/null +++ b/utils/configtool/src/bitmaps/radiooff_dis.xpm @@ -0,0 +1,23 @@ +/* XPM */ +static char * radiooff_dis_xpm[] = { +"16 16 4 1", +" c None", +". c #808080", +"X c Black", +"o c #c0c0c0", +" ", +" ", +" .... ", +" ..XXXX.. ", +" .XXooooXXo ", +" .Xoooooooo ", +" .Xoooooooooo ", +" .Xoooooooooo ", +" .Xoooooooooo ", +" .Xoooooooooo ", +" .Xoooooooo ", +" .ooooooooo ", +" oooooooo ", +" oooo ", +" ", +" "}; diff --git a/utils/configtool/src/bitmaps/radioon.xpm b/utils/configtool/src/bitmaps/radioon.xpm new file mode 100644 index 0000000000..f698766c9c --- /dev/null +++ b/utils/configtool/src/bitmaps/radioon.xpm @@ -0,0 +1,23 @@ +/* XPM */ +static char * radioon_xpm[] = { +"16 16 4 1", +" c None", +". c #808080", +"X c Black", +"o c #c0c0c0", +" ", +" ", +" .... ", +" ..XXXX.. ", +" .XX XXo ", +" .X oo ", +" .X XX oo ", +" .X XXXX oo ", +" .X XXXX oo ", +" .X XX oo ", +" .X oo ", +" .oo ooo ", +" oooooooo ", +" oooo ", +" ", +" "}; diff --git a/utils/configtool/src/bitmaps/radioon_dis.xpm b/utils/configtool/src/bitmaps/radioon_dis.xpm new file mode 100644 index 0000000000..ed09eaf9fe --- /dev/null +++ b/utils/configtool/src/bitmaps/radioon_dis.xpm @@ -0,0 +1,23 @@ +/* XPM */ +static char * radioon_dis_xpm[] = { +"16 16 4 1", +" c None", +". c #808080", +"X c Black", +"o c #c0c0c0", +" ", +" ", +" .... ", +" ..XXXX.. ", +" .XXooooXXo ", +" .Xoooooooo ", +" .Xooo..ooooo ", +" .Xoo....oooo ", +" .Xoo....oooo ", +" .Xooo..ooooo ", +" .Xoooooooo ", +" .ooooooooo ", +" oooooooo ", +" oooo ", +" ", +" "}; diff --git a/utils/configtool/src/bitmaps/redo.xpm b/utils/configtool/src/bitmaps/redo.xpm new file mode 100644 index 0000000000..04df64ae54 --- /dev/null +++ b/utils/configtool/src/bitmaps/redo.xpm @@ -0,0 +1,25 @@ +/* XPM */ +static char *redo_xpm[] = { +/* width height num_colors chars_per_pixel */ +" 16 15 3 1", +/* colors */ +". c #000080", +"# c #c0c0c0", +"a c #808080", +/* pixels */ +"################", +"################", +"################", +"################", +"###a....########", +"##a.####..###.##", +"##.#######.#..##", +"##.########...##", +"##.#######....##", +"##a.#####.....##", +"###.a###########", +"################", +"################", +"################", +"################" +}; diff --git a/utils/configtool/src/bitmaps/save.xpm b/utils/configtool/src/bitmaps/save.xpm new file mode 100644 index 0000000000..01b18f9340 --- /dev/null +++ b/utils/configtool/src/bitmaps/save.xpm @@ -0,0 +1,25 @@ +/* XPM */ +static char *save_xpm[] = { +/* columns rows colors chars-per-pixel */ +"16 15 4 1", +" c None", +". c Black", +"X c #808000", +"o c #808080", +/* pixels */ +" ", +" .............. ", +" .X. . . ", +" .X. ... ", +" .X. .X. ", +" .X. .X. ", +" .X. .X. ", +" .X. .X. ", +" .XX........oX. ", +" .XXXXXXXXXXXX. ", +" .XX.........X. ", +" .XX...... .X. ", +" .XX...... .X. ", +" .XX...... .X. ", +" ............. " +}; diff --git a/utils/configtool/src/bitmaps/unchecked.xpm b/utils/configtool/src/bitmaps/unchecked.xpm new file mode 100644 index 0000000000..5bb6fc8ca3 --- /dev/null +++ b/utils/configtool/src/bitmaps/unchecked.xpm @@ -0,0 +1,23 @@ +/* XPM */ +static char * unchecked_xpm[] = { +"16 16 4 1", +" c None", +". c #808080", +"X c Black", +"o c #c0c0c0", +" ", +" ", +" ............ ", +" .XXXXXXXXXXo ", +" .X o ", +" .X o ", +" .X o ", +" .X o ", +" .X o ", +" .X o ", +" .X o ", +" .X o ", +" .X o ", +" .ooooooooooo ", +" ", +" "}; diff --git a/utils/configtool/src/bitmaps/unchecked_dis.xpm b/utils/configtool/src/bitmaps/unchecked_dis.xpm new file mode 100644 index 0000000000..9bbfd717f4 --- /dev/null +++ b/utils/configtool/src/bitmaps/unchecked_dis.xpm @@ -0,0 +1,23 @@ +/* XPM */ +static char * unchecked_dis_xpm[] = { +"16 16 4 1", +" c None", +". c #808080", +"X c Black", +"o c #c0c0c0", +" ", +" ", +" ............ ", +" .XXXXXXXXXXo ", +" .Xoooooooooo ", +" .Xoooooooooo ", +" .Xoooooooooo ", +" .Xoooooooooo ", +" .Xoooooooooo ", +" .Xoooooooooo ", +" .Xoooooooooo ", +" .Xoooooooooo ", +" .Xoooooooooo ", +" .ooooooooooo ", +" ", +" "}; diff --git a/utils/configtool/src/bitmaps/uncheckedfolder.xpm b/utils/configtool/src/bitmaps/uncheckedfolder.xpm new file mode 100644 index 0000000000..127d3bbe3b --- /dev/null +++ b/utils/configtool/src/bitmaps/uncheckedfolder.xpm @@ -0,0 +1,25 @@ +/* XPM */ +static char *uncheckedfolder_xpm[] = { +"16 16 6 1", +" c None", +". c #808080", +"X c #FFFF00", +"o c #C0C0C0", +"O c #FFFFFF", +"+ c #000000", +" ", +" ..... ", +" .XoXoX. ", +" .XoXoXoX...... ", +" .OOOOOOOOOOOO.+", +" .OXoXoXoXoXoX.+", +" .OoX++oX++oXo.+", +" .OXoX++++oXoX.+", +" .OoXoX++oXoXo.+", +" .OXoX++++oXoX.+", +" .OoX++oX++oXo.+", +" .OXoXoXoXoXoX.+", +" ..............+", +" ++++++++++++++", +" ", +" "}; diff --git a/utils/configtool/src/bitmaps/uncheckedfolder_dis.xpm b/utils/configtool/src/bitmaps/uncheckedfolder_dis.xpm new file mode 100644 index 0000000000..65f3a81b9c --- /dev/null +++ b/utils/configtool/src/bitmaps/uncheckedfolder_dis.xpm @@ -0,0 +1,23 @@ +/* XPM */ +static char *uncheckedfolder_dis_xpm[] = { +"16 16 4 1", +" c None", +". c #808080", +"X c #C0C0C0", +"o c #000000", +" ", +" ..... ", +" .XXXXX. ", +" .XXXXXXX...... ", +" .XXXXXXXXXXXX.o", +" .XXXXXXXXXXXX.o", +" .XXX..XX..XXX.o", +" .XXXX....XXXX.o", +" .XXXXX..XXXXX.o", +" .XXXX....XXXX.o", +" .XXX..XX..XXX.o", +" .XXXXXXXXXXXX.o", +" ..............o", +" oooooooooooooo", +" ", +" "}; diff --git a/utils/configtool/src/bitmaps/undo.xpm b/utils/configtool/src/bitmaps/undo.xpm new file mode 100644 index 0000000000..157a623e3c --- /dev/null +++ b/utils/configtool/src/bitmaps/undo.xpm @@ -0,0 +1,25 @@ +/* XPM */ +static char *undo_xpm[] = { +/* width height num_colors chars_per_pixel */ +" 16 15 3 1", +/* colors */ +". c #000080", +"# c #c0c0c0", +"a c #808080", +/* pixels */ +"################", +"################", +"################", +"################", +"########....a###", +"##.###..####.a##", +"##..#.#######.##", +"##...########.##", +"##....#######.##", +"##.....#####.a##", +"###########a.###", +"################", +"################", +"################", +"################" +}; diff --git a/utils/configtool/src/bitmaps/wxconfigtool.ico b/utils/configtool/src/bitmaps/wxconfigtool.ico new file mode 100644 index 0000000000..8d2dc18c6b Binary files /dev/null and b/utils/configtool/src/bitmaps/wxconfigtool.ico differ diff --git a/utils/configtool/src/bitmaps/wxconfigtool.xpm b/utils/configtool/src/bitmaps/wxconfigtool.xpm new file mode 100644 index 0000000000..7825bfffe5 --- /dev/null +++ b/utils/configtool/src/bitmaps/wxconfigtool.xpm @@ -0,0 +1,41 @@ +/* XPM */ +static char *wxconfigtool_xpm[] = { +"32 32 6 1", +" c None", +". c #000000", +"X c #000084", +"o c #FFFFFF", +"O c #FFFF00", +"+ c #FF0000", +" ", +" ", +" ", +" ", +" ", +" .............. ", +" .XXXXXXXXXXXX. ", +" .XXXXXXXXXXXX. ", +" .XooXXXXXXXXX. ", +" .XooXXXXXXXXX. ", +" .XooXXXXXXXXX. ", +" .XooXXXXXX..............", +" .XooXXXXXX.OOOOOOOOOOOO.", +".........XooXXXXXX.OOOOOOOOOOOO.", +".+++++++.XooXXXXXX.OooOOOOOOOOO.", +".+++++++.XooXXXXXX.OooOOOOOOOOO.", +".+oo++++.XXXXXXXXX.OooOOOOOOOOO.", +".+oo++++.XXXXXXXXX.OooOOOOOOOOO.", +".+oo++++...........OooOOOOOOOOO.", +".+oo+++++++++. .OooOOOOOOOOO.", +".+oo+++++++++. .OooOOOOOOOOO.", +".+oo+++++++++. .OooOOOOOOOOO.", +".+oo+++++++++. .OOOOOOOOOOOO.", +".+oo+++++++++. .OOOOOOOOOOOO.", +".++++++++++++. ..............", +".++++++++++++. ", +".............. ", +" ", +" ", +" ", +" ", +" "}; diff --git a/utils/configtool/src/bitmaps/wxconfigtool16x16.xpm b/utils/configtool/src/bitmaps/wxconfigtool16x16.xpm new file mode 100644 index 0000000000..7c347167d0 --- /dev/null +++ b/utils/configtool/src/bitmaps/wxconfigtool16x16.xpm @@ -0,0 +1,25 @@ +/* XPM */ +static char *wxconfigtool16x16_xpm[] = { +"16 16 6 1", +" c None", +". c #000000", +"X c #000084", +"o c #FFFFFF", +"O c #FFFF00", +"+ c #FF0000", +" ", +" ", +" ", +" ....... ", +" .XXXXX. ", +" .oXXXX. ", +" .oXXX.......", +".....oXXX.OOOOO.", +".+++.XXXX.oOOOO.", +".o++......oOOOO.", +".o++++. .oOOOO.", +".o++++. .OOOOO.", +".+++++. .......", +"....... ", +" ", +" "}; diff --git a/utils/configtool/src/bitmaps/wxconfigtool32x32.xpm b/utils/configtool/src/bitmaps/wxconfigtool32x32.xpm new file mode 100644 index 0000000000..2940865d37 --- /dev/null +++ b/utils/configtool/src/bitmaps/wxconfigtool32x32.xpm @@ -0,0 +1,41 @@ +/* XPM */ +static char *wxconfigtool32x32_xpm[] = { +"32 32 6 1", +" c None", +". c #000000", +"X c #000084", +"o c #FFFFFF", +"O c #FFFF00", +"+ c #FF0000", +" ", +" ", +" ", +" ", +" ", +" .............. ", +" .XXXXXXXXXXXX. ", +" .XXXXXXXXXXXX. ", +" .XooXXXXXXXXX. ", +" .XooXXXXXXXXX. ", +" .XooXXXXXXXXX. ", +" .XooXXXXXX..............", +" .XooXXXXXX.OOOOOOOOOOOO.", +".........XooXXXXXX.OOOOOOOOOOOO.", +".+++++++.XooXXXXXX.OooOOOOOOOOO.", +".+++++++.XooXXXXXX.OooOOOOOOOOO.", +".+oo++++.XXXXXXXXX.OooOOOOOOOOO.", +".+oo++++.XXXXXXXXX.OooOOOOOOOOO.", +".+oo++++...........OooOOOOOOOOO.", +".+oo+++++++++. .OooOOOOOOOOO.", +".+oo+++++++++. .OooOOOOOOOOO.", +".+oo+++++++++. .OooOOOOOOOOO.", +".+oo+++++++++. .OOOOOOOOOOOO.", +".+oo+++++++++. .OOOOOOOOOOOO.", +".++++++++++++. ..............", +".++++++++++++. ", +".............. ", +" ", +" ", +" ", +" ", +" "}; diff --git a/utils/configtool/src/configitem.cpp b/utils/configtool/src/configitem.cpp new file mode 100644 index 0000000000..2db7ac8e7a --- /dev/null +++ b/utils/configtool/src/configitem.cpp @@ -0,0 +1,755 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: configitem.cpp +// Purpose: wxWindows Configuration Tool config item class +// Author: Julian Smart +// Modified by: +// Created: 2003-06-03 +// RCS-ID: $Id$ +// Copyright: (c) Julian Smart +// Licence: +///////////////////////////////////////////////////////////////////////////// + +#ifdef __GNUG__ +#pragma implementation "configitem.h" +#endif + +// Includes other headers for precompiled compilation +#include "wx/wx.h" + +#ifdef __BORLANDC__ +#pragma hdrstop +#endif + +#include "wx/tokenzr.h" + +#include "configitem.h" +#include "configtree.h" +#include "configtooldoc.h" +#include "configtoolview.h" +#include "wxconfigtool.h" +#include "mainframe.h" + +IMPLEMENT_CLASS(ctConfigItem, wxObject) + +ctConfigItem::ctConfigItem() +{ + m_modified = FALSE; + m_type = ctTypeBoolCheck; + m_treeItemId = wxTreeItemId(); + m_enabled = TRUE; + m_parent = NULL; + m_active = TRUE; +} + +ctConfigItem::ctConfigItem(ctConfigItem* parent, ctConfigType type, const wxString& name) +{ + m_modified = FALSE; + m_type = type; + m_treeItemId = wxTreeItemId(); + m_enabled = FALSE; + m_active = TRUE; + SetName(name); + m_parent = parent; + if (parent) + parent->AddChild(this); +} + +ctConfigItem::~ctConfigItem() +{ + ctConfigTreeCtrl* treeCtrl = wxGetApp().GetMainFrame()->GetConfigTreeCtrl(); + if (m_treeItemId.IsOk() && treeCtrl) + { + ctTreeItemData* data = (ctTreeItemData*) treeCtrl->GetItemData(m_treeItemId); + if (data) + data->SetConfigItem(NULL); + } + if (GetParent()) + GetParent()->RemoveChild(this); + else + { + if (wxGetApp().GetMainFrame()->GetDocument() && + wxGetApp().GetMainFrame()->GetDocument()->GetTopItem() == this) + wxGetApp().GetMainFrame()->GetDocument()->SetTopItem(NULL); + } + + Clear(); +} + +/// Can we edit this property? +bool ctConfigItem::CanEditProperty(const wxString& propName) const +{ + ctProperty* prop = m_properties.FindProperty(propName); + if (prop) + return !prop->GetReadOnly(); + else + return FALSE; +} + +/// Assignment operator. +void ctConfigItem::operator= (const ctConfigItem& item) +{ + m_properties = item.m_properties; + m_modified = item.m_modified; + m_defaultProperty = item.m_defaultProperty; + m_type = item.m_type; + m_enabled = item.m_enabled; + m_active = item.m_active; +} + +/// Sets the name property. +void ctConfigItem::SetName(const wxString& name ) +{ + m_properties.SetProperty(wxT("name"), name); +} + +/// Clear children +void ctConfigItem::Clear() +{ + wxNode* node = m_children.GetFirst(); + while (node) + { + wxNode* next = node->GetNext(); + ctConfigItem* child = (ctConfigItem*) node->GetData(); + + // This should delete 'node' too, assuming + // child's m_parent points to 'this'. If not, + // it'll be cleaned up by m_children.Clear(). + delete child; + + node = next; + } + m_children.Clear(); +} + +// Get the nth child +ctConfigItem* ctConfigItem::GetChild(int n) const +{ + wxASSERT ( n < GetChildCount() && n > -1 ); + + if ( n < GetChildCount() && n > -1 ) + { + ctConfigItem* child = wxDynamicCast(m_children.Nth(n)->Data(), ctConfigItem); + return child; + } + else + return NULL; +} + +// Get the child count +int ctConfigItem::GetChildCount() const +{ + return m_children.GetCount(); +} + +/// Add a child +void ctConfigItem::AddChild(ctConfigItem* item) +{ + m_children.Append(item); + item->SetParent(this); +} + +/// Remove (but don't delete) a child +void ctConfigItem::RemoveChild(ctConfigItem* item) +{ + m_children.DeleteObject(item); + item->SetParent(NULL); +} + +/// Initialise standard properties +void ctConfigItem::InitProperties() +{ + ctProperty* prop = m_properties.FindProperty(wxT("name")); + if (!prop) + { + prop = new ctProperty; + m_properties.AddProperty(prop); + } + prop->SetDescription(_("Name

The name of the configuration setting.")); + prop->SetReadOnly(TRUE); + + m_properties.AddProperty( + new ctProperty( + wxT("Description

The setting description."), + wxVariant(wxT(""), wxT("description")), + wxT("multiline"))); + + m_properties.AddProperty( + new ctProperty( + wxT("Default-state

The default state."), + wxVariant((bool) TRUE, wxT("default-state")), + wxT("bool"))); + + if (GetType() == ctTypeString) + { + m_properties.AddProperty( + new ctProperty( + wxT("Default-value

The default value."), + wxVariant((bool) TRUE, wxT("default-value")), + wxT(""))); + } + else if (GetType() == ctTypeInteger) + { + m_properties.AddProperty( + new ctProperty( + wxT("Default-value

The default value."), + wxVariant((long) 0, wxT("default-value")), + wxT(""))); + } + + m_properties.AddProperty( + new ctProperty( + wxT("Requires

When any of the given settings are 0, this setting must be 0. Taking wxUSE_ZIPSTREAM as an example:

If wxUSE_STREAMS is 0, then wxUSE_ZIPSTREAM must be 0.
If wxUSE_STREAMS is 1, then wxUSE_ZIPSTREAM may be 0 or 1."), + wxVariant(wxT(""), wxT("requires")), + wxT("configitems"))); + + m_properties.AddProperty( + new ctProperty( + wxT("Precludes

When any of these settings are 1, this setting must be 0. Taking wxUSE_ODBC as an example:

If wxUSE_UNICODE is 1, then wxUSE_ODBC must be 0.
If wxUSE_UNICODE is 0, then wxUSE_ODBC may be 0 or 1."), + wxVariant(wxT(""), wxT("precludes")), + wxT("configitems"))); + + m_properties.AddProperty( + new ctProperty( + wxT("Enabled-if

When any of these settings are 1, this setting must be 1."), + wxVariant(wxT(""), wxT("enabled-if")), + wxT("configitems"))); + + m_properties.AddProperty( + new ctProperty( + wxT("Enabled-if-not

When any of these settings are 0, this setting must be 1. Taking wxUSE_TOOLBAR_SIMPLE as an example:

If wxUSE_TOOLBAR_NATIVE is 0, wxUSE_TOOLBAR_SIMPLE must be 1.
If wxUSE_TOOLBAR_NATIVE is 1, wxUSE_TOOLBAR_SIMPLE may be 0 or 1."), + wxVariant(wxT(""), wxT("enabled-if-not")), + wxT("configitems"))); + + m_properties.AddProperty( + new ctProperty( + wxT("Exclusivity

The settings that are mutually exclusive with this one."), + wxVariant(wxT(""), wxT("exclusivity")), + wxT("configitems"))); + + m_properties.AddProperty( + new ctProperty( + wxT("Context

A list of symbols (config settings), at least one of which must be enabled for this item to participate in dependency rules.

\nIf empty, this item will always be used in dependency rules.

\nMostly this will be used to specify the applicable platforms, but it can contain other symbols, for example compilers."), + wxVariant(wxT(""), wxT("context")), + wxT("configitems"))); + + m_properties.AddProperty( + new ctProperty( + wxT("Configure-command

Configure command to generate if this is on."), + wxVariant(wxT(""), wxT("configure-command")), + wxT("multiline"))); + + m_properties.AddProperty( + new ctProperty( + wxT("Help-topic

The help topic in the wxWindows manual for this component or setting."), + wxVariant(wxT(""), wxT("help-topic")), + wxT("multiline"))); + + m_properties.AddProperty( + new ctProperty( + wxT("Notes

User notes."), + wxVariant(wxT(""), wxT("notes")), + wxT("multiline"))); + + m_defaultProperty = wxT("description"); +} + +/// Do additional actions to apply the property to the internal +/// representation. +void ctConfigItem::ApplyProperty(ctProperty* prop, const wxVariant& oldValue) +{ + ctConfigToolDoc* doc = GetDocument(); + bool oldModified = doc->IsModified(); + doc->Modify(TRUE); + + wxString name = prop->GetName(); + if (name == wxT("requires") || + name == wxT("precludes") || + name == wxT("enabled-if") || + name == wxT("enabled-if-not") || + name == wxT("context")) + { + doc->RefreshDependencies(); + } + if (doc && doc->GetFirstView() && oldModified != doc->IsModified()) + ((ctConfigToolView*)doc->GetFirstView())->OnChangeFilename(); +} + +/// Get the associated document (currently, assumes +/// there's only ever one document active) +ctConfigToolDoc* ctConfigItem::GetDocument() +{ + ctConfigToolDoc* doc = wxGetApp().GetMainFrame()->GetDocument(); + return doc; +} + +/// Convert string containing config item names to +/// an array of config item names +void ctConfigItem::StringToArray(const wxString& items, wxArrayString& itemsArray) +{ + wxStringTokenizer tokenizer(items, wxT(",")); + while (tokenizer.HasMoreTokens()) + { + wxString token = tokenizer.GetNextToken(); + itemsArray.Add(token); + } +} + +/// Convert array containing config item names to +/// a string +void ctConfigItem::ArrayToString(const wxArrayString& itemsArray, wxString& items) +{ + items = wxEmptyString; + size_t i; + for (i = 0; i < itemsArray.GetCount(); i++) + { + items += itemsArray[i]; + if (i < (itemsArray.GetCount() - 1)) + items += wxT(","); + } +} + +/// Populate a list of items found in the string. +void ctConfigItem::StringToItems(ctConfigItem* topItem, const wxString& items, wxList& list) +{ + wxArrayString strArray; + StringToArray(items, strArray); + size_t i; + for (i = 0; i < strArray.GetCount(); i++) + { + wxString str(strArray[i]); + ctConfigItem* item = topItem->FindItem(str); + if (item) + list.Append(item); + } +} + +/// Find an item in this hierarchy +ctConfigItem* ctConfigItem::FindItem(const wxString& name) +{ + if (GetName() == name) + return this; + + for ( wxNode* node = GetChildren().GetFirst(); node; node = node->GetNext() ) + { + ctConfigItem* child = (ctConfigItem*) node->GetData(); + ctConfigItem* found = child->FindItem(name); + if (found) + return found; + } + return NULL; +} + +/// Find the next sibling +ctConfigItem* ctConfigItem::FindNextSibling() +{ + if (!GetParent()) + return NULL; + wxNode* node = GetParent()->GetChildren().Member(this); + if (node && node->GetNext()) + { + return (ctConfigItem*) node->GetNext()->GetData(); + } + return NULL; +} + +/// Find the previous sibling +ctConfigItem* ctConfigItem::FindPreviousSibling() +{ + if (!GetParent()) + return NULL; + wxNode* node = GetParent()->GetChildren().Member(this); + if (node && node->GetPrevious()) + { + return (ctConfigItem*) node->GetPrevious()->GetData(); + } + return NULL; +} + +/// Sync appearance +void ctConfigItem::Sync() +{ + if (GetDocument()) + { + ctConfigToolView* view = (ctConfigToolView*) GetDocument()->GetFirstView(); + if (view) + { + view->SyncItem(wxGetApp().GetMainFrame()->GetConfigTreeCtrl(), this); + } + } +} + +/// Create a clone of this and children +ctConfigItem* ctConfigItem::DeepClone() +{ + ctConfigItem* newItem = Clone(); + + for ( wxNode* node = GetChildren().GetFirst(); node; node = node->GetNext() ) + { + ctConfigItem* child = (ctConfigItem*) node->GetData(); + ctConfigItem* newChild = child->DeepClone(); + newItem->AddChild(newChild); + } + return newItem; +} + +/// Detach: remove from parent, and remove tree items +void ctConfigItem::Detach() +{ + if (GetParent()) + GetParent()->RemoveChild(this); + else + GetDocument()->SetTopItem(NULL); + SetParent(NULL); + + wxTreeItemId treeItem = GetTreeItemId(); + + DetachFromTree(); + + // Will delete the branch, but not the config items. + wxGetApp().GetMainFrame()->GetConfigTreeCtrl()->Delete(treeItem); +} + +/// Hide from tree: make sure tree deletions won't delete +/// the config items +void ctConfigItem::DetachFromTree() +{ + wxTreeItemId item = GetTreeItemId(); + + ctTreeItemData* data = (ctTreeItemData*) wxGetApp().GetMainFrame()->GetConfigTreeCtrl()->GetItemData(item); + data->SetConfigItem(NULL); + m_treeItemId = wxTreeItemId(); + + for ( wxNode* node = GetChildren().GetFirst(); node; node = node->GetNext() ) + { + ctConfigItem* child = (ctConfigItem*) node->GetData(); + child->DetachFromTree(); + } +} + +/// Attach: insert after the given position +void ctConfigItem::Attach(ctConfigItem* parent, ctConfigItem* insertBefore) +{ + if (parent) + { + SetParent(parent); + wxNode* node = NULL; + if (insertBefore) + node = parent->GetChildren().Member(insertBefore); + + if (node) + parent->GetChildren().Insert(node, this); + else + parent->GetChildren().Append(this); + } + else + { + GetDocument()->SetTopItem(this); + } +} + +/// Can have children? +bool ctConfigItem::CanHaveChildren() const +{ + return (GetType() == ctTypeGroup || + GetType() == ctTypeCheckGroup || + GetType() == ctTypeRadioGroup); +} + +// An item is in the active context if: +// The context field is empty; or +// The context field contains a symbol that is currently enabled. +bool ctConfigItem::IsInActiveContext() +{ + wxString context = GetPropertyString(wxT("context")); + if (context.IsEmpty()) + return TRUE; + + wxList contextItems; + StringToItems(GetDocument()->GetTopItem(), context, contextItems); + + for ( wxNode* node = contextItems.GetFirst(); node; node = node->GetNext() ) + { + ctConfigItem* otherItem = (ctConfigItem*) node->GetData(); + if (otherItem->IsEnabled()) + return TRUE; + } + return FALSE; +} + +/// Evaluate the requires properties: +/// if any of the 'requires' items are disabled, +/// then this one is disabled (and inactive). +void ctConfigItem::EvaluateDependencies() +{ + wxList items; + wxString requires = GetPropertyString(wxT("requires")); + wxString precludes = GetPropertyString(wxT("precludes")); + wxString enabledIf = GetPropertyString(wxT("enabled-if")); + wxString enabledIfNot = GetPropertyString(wxT("enabled-if-not")); + + bool active = TRUE; + bool enabled = IsEnabled(); + bool oldEnabled = enabled; + bool oldActive = IsActive(); + bool explicitlyEnabled = FALSE; + bool explicitlyDisabled = FALSE; + bool inActiveContext = IsInActiveContext(); + + // Add the parent to the list of dependencies, if the + // parent is a check or radio group. + ctConfigItem* parent = GetParent(); + if (parent && + (parent->GetType() == ctTypeCheckGroup || + parent->GetType() == ctTypeRadioGroup)) + items.Append(parent); + + wxList tempItems; + StringToItems(GetDocument()->GetTopItem(), requires, tempItems); + + wxNode* node; + for ( node = tempItems.GetFirst(); node; node = node->GetNext() ) + { + // Only consider the dependency if both items are in + // an active context. + // Each is in the active context if: + // The context field is empty; or + // The context field contains a symbol that is currently enabled. + ctConfigItem* otherItem = (ctConfigItem*) node->GetData(); + if (inActiveContext && otherItem->IsInActiveContext()) + items.Append(otherItem); + } + + { + int enabledCount = 0; + for ( node = items.GetFirst(); node; node = node->GetNext() ) + { + ctConfigItem* otherItem = (ctConfigItem*) node->GetData(); + + if (otherItem->IsEnabled()) + { + enabledCount ++; + } + } + if (items.GetCount() > 0 && enabledCount == 0) + { + // None of the items were enabled + enabled = FALSE; + active = FALSE; + explicitlyDisabled = TRUE; + } + } + + items.Clear(); + if (!enabledIfNot.IsEmpty()) + { + StringToItems(GetDocument()->GetTopItem(), enabledIfNot, items); + int disabledCount = 0; + int inContextCount = 0; + + for ( wxNode* node = items.GetFirst(); node; node = node->GetNext() ) + { + ctConfigItem* otherItem = (ctConfigItem*) node->GetData(); + + if (inActiveContext && otherItem->IsInActiveContext()) + { + // Make this enabled and inactive, _unless_ it's + // already been explicitly disabled in the previous + // requires evaluation (it really _has_ to be off) + if (!otherItem->IsEnabled()) + { + disabledCount ++; + } + inContextCount ++; + } + } + // Enable if there were no related items that were enabled + if (inContextCount > 0 && (disabledCount == inContextCount) && !explicitlyDisabled) + { + explicitlyEnabled = TRUE; + enabled = TRUE; + active = FALSE; + } + } + + items.Clear(); + if (!enabledIf.IsEmpty()) + { + StringToItems(GetDocument()->GetTopItem(), enabledIf, items); + int enabledCount = 0; + int inContextCount = 0; + + for ( wxNode* node = items.GetFirst(); node; node = node->GetNext() ) + { + ctConfigItem* otherItem = (ctConfigItem*) node->GetData(); + + if (inActiveContext && otherItem->IsInActiveContext()) + { + // Make this enabled and inactive, _unless_ it's + // already been explicitly disabled in the previous + // requires evaluation (it really _has_ to be off) + if (otherItem->IsEnabled()) + { + enabledCount ++; + } + inContextCount ++; + } + } + // Enable if there were no related items that were disabled + if (inContextCount > 0 && (enabledCount > 0) && !explicitlyDisabled) + { + explicitlyEnabled = TRUE; + enabled = TRUE; + active = FALSE; + } + } + + items.Clear(); + if (!precludes.IsEmpty()) + { + StringToItems(GetDocument()->GetTopItem(), precludes, items); + int enabledCount = 0; + int inContextCount = 0; + + for ( wxNode* node = items.GetFirst(); node; node = node->GetNext() ) + { + ctConfigItem* otherItem = (ctConfigItem*) node->GetData(); + + if (inActiveContext && otherItem->IsInActiveContext()) + { + // Make this enabled and inactive, _unless_ it's + // already been explicitly disabled in the previous + // requires evaluation (it really _has_ to be off) + if (otherItem->IsEnabled()) + { + enabledCount ++; + } + } + } + // Disable if there were no related items that were disabled + if (inContextCount > 0 && (enabledCount == inContextCount) && !explicitlyEnabled) + { + enabled = FALSE; + active = FALSE; + } + } + + // Finally check a sort of dependency: whether our + // context is active. If not, make this inactive. + if (!IsInActiveContext()) + active = FALSE; + + SetActive(active); + + // If going active, set enabled state to the default state + if (active && + oldActive != active && + (GetType() == ctTypeBoolCheck || GetType() == ctTypeCheckGroup) && + m_properties.FindProperty(wxT("default-state"))) + { + bool defaultState = m_properties.FindProperty(wxT("default-state"))->GetVariant().GetBool(); + enabled = defaultState; + } + Enable(enabled); + + // Deal with setting a radio button + if (enabled && enabled != oldEnabled && + (GetType() == ctTypeBoolRadio || GetType() == ctTypeRadioGroup)) + { + wxList considered; + PropagateRadioButton(considered); + } +} + +/// Get description, which may be dynamically +/// generated depending on the property. +wxString ctConfigItem::GetDescription(ctProperty* property) +{ + if (property->GetName() == wxT("description")) + { + wxString value(property->GetValue()); + if (value.IsEmpty()) + return wxT("Double-click on description to write a brief explanation of the setting.

"); + else + return value; + } + else if (property->GetName() == wxT("notes")) + { + wxString value(property->GetValue()); + if (value.IsEmpty()) + return wxT("Double-click on notes to write notes about this setting.

"); + else + return value; + } + return property->GetDescription(); +} + +/// Get the title for the property editor +wxString ctConfigItem::GetTitle() +{ + wxString title(GetName()); + if (GetType() == ctTypeCheckGroup || + GetType() == ctTypeRadioGroup || + GetType() == ctTypeBoolCheck || + GetType() == ctTypeBoolRadio) + { + if (IsEnabled()) + title = title + _T(" - enabled"); + else + title = title + _T(" - disabled"); + } + return title; +} + +/// Propagate a change in enabled/disabled status +void ctConfigItem::PropagateChange(wxList& considered) +{ + if (GetType() == ctTypeCheckGroup || + GetType() == ctTypeRadioGroup || + GetType() == ctTypeBoolCheck || + GetType() == ctTypeBoolRadio) + { + // TODO: what about string, integer? Can they have + // dependencies? + + for ( wxNode* node = GetDependents().GetFirst(); node; node = node->GetNext() ) + { + ctConfigItem* child = (ctConfigItem*) node->GetData(); + + // Avoid loops + if (!considered.Member(child)) + { + considered.Append(child); + + child->EvaluateDependencies(); + child->Sync(); + + child->PropagateChange(considered); + } + } + } +} + +/// Process radio button selection +void ctConfigItem::PropagateRadioButton(wxList& considered) +{ + if ((GetType() == ctTypeBoolRadio || GetType() == ctTypeRadioGroup) && IsEnabled()) + { + wxString mutuallyExclusive(GetPropertyString(wxT("exclusivity"))); + + wxList list; + StringToItems(GetDocument()->GetTopItem(), mutuallyExclusive, list); + + for ( wxNode* node = list.GetFirst(); node; node = node->GetNext() ) + { + ctConfigItem* child = (ctConfigItem*) node->GetData(); + if (child->IsEnabled() && child != this) + { + child->Enable(FALSE); + child->Sync(); + + if (!considered.Member(child)) + child->PropagateChange(considered); + } + } + } +} diff --git a/utils/configtool/src/configitem.h b/utils/configtool/src/configitem.h new file mode 100644 index 0000000000..8ebba6932b --- /dev/null +++ b/utils/configtool/src/configitem.h @@ -0,0 +1,279 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: configitem.h +// Purpose: wxWindows Configuration Tool config item class +// Author: Julian Smart +// Modified by: +// Created: 2003-06-03 +// RCS-ID: $Id$ +// Copyright: (c) Julian Smart +// Licence: +///////////////////////////////////////////////////////////////////////////// + +#ifndef _CT_CONFIGITEM_H_ +#define _CT_CONFIGITEM_H_ + +#ifdef __GNUG__ +#pragma interface "configitem.cpp" +#endif + +#include "wx/wx.h" +#include "wx/treectrl.h" + +#include "property.h" + +class ctConfigToolDoc; + +/*! + * The type of config item + */ + +enum ctConfigType +{ + ctTypeUnknown, + ctTypeGroup, // A group with no checkbox + ctTypeCheckGroup, // A group that can be switched on/off (check) + ctTypeRadioGroup, // A group that can be switched on/off (radio) + ctTypeString, // An option with a string value + ctTypeInteger, // An option with an integer value + ctTypeBoolCheck, // An on/off option + ctTypeBoolRadio // An on/off mutually exclusive option +}; + +/*! + * ctConfigItem represents a configuration setting. + * Each setting has a number of properties, some of + * which may be specific to a particular kind of + * setting, so we make it quite generic and extensible + * by using a property list. + */ + +class ctConfigItem: public wxObject +{ +public: + /// Ctor and dtor + ctConfigItem(ctConfigItem* parent, ctConfigType type, const wxString& name); + ctConfigItem(); + ~ctConfigItem(); + + /// Copy constructor. + ctConfigItem(const ctConfigItem& item) + { + (*this) = item; + } + +/// Operations + + /// Assignment operator. + void operator= (const ctConfigItem& item); + + /// Create a clone + ctConfigItem* Clone() + { + ctConfigItem* item = new ctConfigItem; + *item = *this; + return item; + } + + /// Create a clone of this and children + ctConfigItem* DeepClone(); + + /// Do additional actions to apply the property to the internal + /// representation. + void ApplyProperty(ctProperty* prop, const wxVariant& oldValue); + + /// Clear children + void Clear(); + + /// Add a child + void AddChild(ctConfigItem* item); + + /// Remove (but don't delete) a child + void RemoveChild(ctConfigItem* item); + + /// Initialise standard properties + void InitProperties(); + + /// Convert string containing config item names to + /// an array of config item names + static void StringToArray(const wxString& items, wxArrayString& itemsArray); + + /// Convert array containing config item names to + /// a string + static void ArrayToString(const wxArrayString& itemsArray, wxString& items); + + /// Populate a list of items found in the string. + static void StringToItems(ctConfigItem* topItem, const wxString& items, wxList& list); + + /// Find an item in this hierarchy + ctConfigItem* FindItem(const wxString& name); + + /// Find the next sibling + ctConfigItem* FindNextSibling(); + + /// Find the previous sibling + ctConfigItem* FindPreviousSibling(); + + /// Sync appearance + void Sync(); + + /// Detach: remove from parent, and remove tree items + void Detach(); + + /// Attach: insert before the given position + void Attach(ctConfigItem* parent, ctConfigItem* insertbefore); + + /// Hide from tree: make sure tree deletions won't delete + /// the config items + void DetachFromTree(); + + /// Evaluate the depends-on properties: + /// if any of the depends-on items are disabled, + /// then this one is disabled (and inactive). + void EvaluateDependencies(); + + /// Propagate a change in enabled/disabled status + void PropagateChange(wxList& considered); + + /// Process radio button selection + void PropagateRadioButton(wxList& considered); + + // An item is in the active context if: + // The context field is empty; or + // The context field contains a symbol that is currently enabled. + bool IsInActiveContext(); + +/// Accessors + + /// Returns the name property. + wxString GetName() const { return GetPropertyString(wxT("name")); } + + /// Sets the name property. + void SetName(const wxString& name ) ; + + /// Returns the value property. + wxVariant GetValue() const { return m_properties.FindPropertyValue(wxT("value")); } + + /// Sets the value property. + void SetValue(const wxVariant& value ) ; + + /// Returns the string for the given property. + wxString GetPropertyString(const wxString& propName) const { return m_properties.FindPropertyValueString(propName); } + + /// Sets the string for the given property. + void SetPropertyString(const wxString& propName, const wxString& value) { m_properties.SetProperty(propName, value); } + + /// Can we edit this property? + bool CanEditProperty(const wxString& propName) const ; + + /// Returns the list of properties for + /// this item. + ctProperties& GetProperties() { return m_properties; } + + /// Set the default property. + void SetDefaultProperty(const wxString& defaultProp) { m_defaultProperty = defaultProp; } + + /// Get the default property. + wxString GetDefaultProperty() const { return m_defaultProperty; } + + /// Is this item modified? + bool IsModified() const { return m_modified; } + + /// Mark this as modified. + void Modify(bool modified = TRUE) { m_modified = modified; } + + /// Is this item enabled? (checked/unchecked) + bool IsEnabled() const { return m_enabled; } + + /// Enable or disable (check/uncheck) + void Enable(bool enable = TRUE) { m_enabled = enable; } + + /// Is this item active? (sensitive to user input) + bool IsActive() const { return m_active; } + + /// Make this (in)active + void SetActive(bool active = TRUE) { m_active = active; } + + /// Set the type + void SetType(ctConfigType type) { m_type = type; } + + // Get the type + ctConfigType GetType() const { return m_type; } + + /// Set the tree item id + void SetTreeItem(wxTreeItemId id) { m_treeItemId = id; } + + // Get the type + wxTreeItemId GetTreeItemId() const { return m_treeItemId ; } + + /// Get the list of children + wxList& GetChildren() { return m_children; } + + /// Get the nth child + ctConfigItem* GetChild(int n) const; + + /// Get the child count + int GetChildCount() const; + + /// Get the list of dependents + wxList& GetDependents() { return m_dependents; } + + /// Get the parent + ctConfigItem* GetParent() const { return m_parent; } + + /// Set the parent + void SetParent(ctConfigItem* parent) { m_parent = parent; } + + /// Get the associated document (currently, assumes + /// there's only ever one document active) + ctConfigToolDoc* GetDocument() ; + + /// Can have children? + bool CanHaveChildren() const; + + /// Get description, which may be dynamically + /// generated depending on the property. + wxString GetDescription(ctProperty* property); + + /// Get the title for the property editor + wxString GetTitle(); + +protected: + + /// The properties for this item. + ctProperties m_properties; + + /// The default property, from the point of + /// of double-clicking the config item. + wxString m_defaultProperty; + + /// Whether modified + bool m_modified; + + /// The type of the config item + ctConfigType m_type; + + /// The corresponding tree item + wxTreeItemId m_treeItemId; + + /// Is this option enabled? (checked/unchecked) + bool m_enabled; + + /// Is this option active? (i.e. sensitive to user input) + bool m_active; + + /// The list of children. + wxList m_children; + + /// The list of items that are dependent upon + // this one. This is refreshed when the configuration + // structurally changes, and is not saved to file. + wxList m_dependents; + + /// The parent config item + ctConfigItem* m_parent; + +DECLARE_CLASS(ctConfigItem) +}; + +#endif +// _CT_CONFIGITEM_H_ diff --git a/utils/configtool/src/configitemselector.cpp b/utils/configtool/src/configitemselector.cpp new file mode 100644 index 0000000000..35b6ae10bc --- /dev/null +++ b/utils/configtool/src/configitemselector.cpp @@ -0,0 +1,266 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: configitemselector.cpp +// Purpose: Selector for one or more config items +// Author: Julian Smart +// Modified by: +// Created: 2003-06-04 +// RCS-ID: $Id$ +// Copyright: (c) Julian Smart +// Licence: +///////////////////////////////////////////////////////////////////////////// + +#ifdef __GNUG__ +#pragma implementation configitemselector.cpp +#endif + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "configitemselector.h" +#include "configtooldoc.h" +#include "configtoolview.h" +#include "configitem.h" +#include "mainframe.h" +#include "wxconfigtool.h" + +////@begin XPM images +////@end XPM images + +/*! + * ctConfigItemsSelector type definition + */ + +IMPLEMENT_CLASS( ctConfigItemsSelector, wxDialog ) + +/*! + * ctConfigItemsSelector event table definition + */ + +BEGIN_EVENT_TABLE( ctConfigItemsSelector, wxDialog ) + +////@begin ctConfigItemsSelector event table entries + EVT_BUTTON( ID_CONFIG_ADD, ctConfigItemsSelector::OnConfigAdd ) + EVT_UPDATE_UI( ID_CONFIG_ADD, ctConfigItemsSelector::OnUpdateConfigAdd ) + + EVT_BUTTON( ID_CONFIG_REMOVE, ctConfigItemsSelector::OnConfigRemove ) + EVT_UPDATE_UI( ID_CONFIG_REMOVE, ctConfigItemsSelector::OnUpdateConfigRemove ) + + EVT_BUTTON( wxID_OK, ctConfigItemsSelector::OnOk ) + +////@end ctConfigItemsSelector event table entries + +END_EVENT_TABLE() + +/*! + * ctConfigItemsSelector constructor + */ + +ctConfigItemsSelector::ctConfigItemsSelector( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style ) +{ + wxDialog::Create( parent, id, caption, pos, size, style ); + + CreateControls(); + InitSourceConfigList(); +} + +/*! + * Control creation for ctConfigItemsSelector + */ + +void ctConfigItemsSelector::CreateControls() +{ +////@begin ctConfigItemsSelector content construction + + ctConfigItemsSelector* item1 = this; + + wxBoxSizer* item2 = new wxBoxSizer(wxVERTICAL); + item1->SetSizer(item2); + item1->SetAutoLayout(TRUE); + + wxBoxSizer* item3 = new wxBoxSizer(wxVERTICAL); + item2->Add(item3, 1, wxGROW|wxALL, 5); + + wxStaticText* item4 = new wxStaticText(item1, wxID_STATIC, _("Please edit the list of configuration items by selecting from the\nlist below."), wxDefaultPosition, wxDefaultSize, 0); + item3->Add(item4, 0, wxALIGN_LEFT|wxALL|wxADJUST_MINSIZE, 5); + + wxStaticText* item5 = new wxStaticText(item1, wxID_STATIC, _("&Available items:"), wxDefaultPosition, wxDefaultSize, 0); + item3->Add(item5, 0, wxALIGN_LEFT|wxALL|wxADJUST_MINSIZE, 5); + + wxString* item6Strings = NULL; + wxListBox* item6 = new wxListBox(item1, ID_AVAILABLE_CONFIG_ITEMS, wxDefaultPosition, wxSize(-1, 150), 0, item6Strings, wxLB_SINGLE|wxLB_SORT); + item3->Add(item6, 1, wxGROW|wxALL, 5); + + wxStaticText* item7 = new wxStaticText(item1, wxID_STATIC, _("&List of configuration items:"), wxDefaultPosition, wxDefaultSize, 0); + item3->Add(item7, 0, wxALIGN_LEFT|wxALL|wxADJUST_MINSIZE, 5); + + wxBoxSizer* item8 = new wxBoxSizer(wxHORIZONTAL); + item3->Add(item8, 0, wxGROW, 5); + + wxString* item9Strings = NULL; + wxListBox* item9 = new wxListBox(item1, ID_CONFIG_ITEMS, wxDefaultPosition, wxSize(-1, 100), 0, item9Strings, wxLB_SINGLE); + item8->Add(item9, 1, wxGROW|wxALL, 5); + + wxBoxSizer* item10 = new wxBoxSizer(wxVERTICAL); + item8->Add(item10, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + + wxButton* item11 = new wxButton(item1, ID_CONFIG_ADD, _("A&dd"), wxDefaultPosition, wxDefaultSize, 0); + item10->Add(item11, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); + + wxButton* item12 = new wxButton(item1, ID_CONFIG_REMOVE, _("&Remove"), wxDefaultPosition, wxDefaultSize, 0); + item10->Add(item12, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); + + wxBoxSizer* item13 = new wxBoxSizer(wxHORIZONTAL); + item3->Add(item13, 0, wxGROW, 5); + + item13->Add(5, 5, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5); + + wxButton* item15 = new wxButton(item1, wxID_OK, _("&OK"), wxDefaultPosition, wxDefaultSize, 0); + item15->SetDefault(); + item13->Add(item15, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + + wxButton* item16 = new wxButton(item1, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxDefaultSize, 0); + item13->Add(item16, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + + GetSizer()->Fit(this); + GetSizer()->SetSizeHints(this); + Centre(); +////@end ctConfigItemsSelector content construction +} + +/*! + * Event handler for ID_CONFIG_ADD + */ + +void ctConfigItemsSelector::OnConfigAdd( wxCommandEvent& event ) +{ + wxListBox* masterList = wxDynamicCast(FindWindow(ID_AVAILABLE_CONFIG_ITEMS), wxListBox); + wxListBox* listBox = wxDynamicCast(FindWindow(ID_CONFIG_ITEMS), wxListBox); + if (masterList) + { + if (masterList->GetSelection() > -1) + { + wxString str = masterList->GetStringSelection(); + if (m_configItems.Index(str) == wxNOT_FOUND) + { + listBox->Append(str); + m_configItems.Add(str); + } + } + } +} + +/*! + * Event handler for ID_CONFIG_REMOVE + */ + +void ctConfigItemsSelector::OnConfigRemove( wxCommandEvent& event ) +{ + wxListBox* listBox = wxDynamicCast(FindWindow(ID_CONFIG_ITEMS), wxListBox); + if (listBox) + { + if (listBox->GetSelection() > -1) + { + wxString str = listBox->GetStringSelection(); + listBox->Delete(listBox->GetSelection()); + m_configItems.Remove(str); + } + } +} + +/*! + * Event handler for wxID_OK + */ + +void ctConfigItemsSelector::OnOk( wxCommandEvent& event ) +{ + // Replace with custom code + event.Skip(); +} + +/*! + * Should we show tooltips? + */ + +bool ctConfigItemsSelector::ShowToolTips() +{ + return TRUE; +} +/*! + * Update event handler for ID_CONFIG_ADD + */ + +void ctConfigItemsSelector::OnUpdateConfigAdd( wxUpdateUIEvent& event ) +{ + wxListBox* masterList = wxDynamicCast(FindWindow(ID_AVAILABLE_CONFIG_ITEMS), wxListBox); + event.Enable(masterList && masterList->GetSelection() != -1); +} + +/*! + * Update event handler for ID_CONFIG_REMOVE + */ + +void ctConfigItemsSelector::OnUpdateConfigRemove( wxUpdateUIEvent& event ) +{ + wxListBox* listBox = wxDynamicCast(FindWindow(ID_CONFIG_ITEMS), wxListBox); + event.Enable(listBox && listBox->GetSelection() != -1); +} + +/// Initialise the master list +void ctConfigItemsSelector::InitSourceConfigList(ctConfigItem* item) +{ + wxListBox* masterList = wxDynamicCast(FindWindow(ID_AVAILABLE_CONFIG_ITEMS), wxListBox); + if (!item) + item = wxGetApp().GetMainFrame()->GetDocument()->GetTopItem(); + + if (!item) + return; + + bool addIt = FALSE; + + if (item->GetType() == ctTypeGroup) + addIt = FALSE; + else if (item->GetType() == ctTypeCheckGroup) + addIt = TRUE; + else if (item->GetType() == ctTypeRadioGroup) + addIt = TRUE; + else if (item->GetType() == ctTypeString) + addIt = TRUE; + else if (item->GetType() == ctTypeBoolCheck) + addIt = TRUE; + else if (item->GetType() == ctTypeBoolRadio) + addIt = TRUE; + else if (item->GetType() == ctTypeInteger) + addIt = TRUE; + if (addIt) + { + masterList->Append(item->GetName()); + } + + wxNode* node = item->GetChildren().GetFirst(); + while (node) + { + ctConfigItem* child = (ctConfigItem*) node->GetData(); + InitSourceConfigList(child); + + node = node->Next(); + } +} + +/// Set the initial list +void ctConfigItemsSelector::SetConfigList(const wxArrayString& items) +{ + m_configItems = items; + wxListBox* listBox = wxDynamicCast(FindWindow(ID_CONFIG_ITEMS), wxListBox); + listBox->Clear(); + + size_t i; + for (i = 0; i < items.GetCount(); i++) + listBox->Append(items[i]); +} + diff --git a/utils/configtool/src/configitemselector.h b/utils/configtool/src/configitemselector.h new file mode 100644 index 0000000000..7b705736ae --- /dev/null +++ b/utils/configtool/src/configitemselector.h @@ -0,0 +1,104 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: configitemselector.h +// Purpose: Selector for one or more config items +// Author: Julian Smart +// Modified by: +// Created: 2003-06-04 +// RCS-ID: $Id$ +// Copyright: (c) Julian Smart +// Licence: +///////////////////////////////////////////////////////////////////////////// + +#ifndef _CONFIGITEMSELECTOR_H_ +#define _CONFIGITEMSELECTOR_H_ + +#ifdef __GNUG__ +#pragma interface configitemselector.h +#endif + +/*! + * Includes + */ + +////@begin includes +////@end includes + +/*! + * Forward declarations + */ + +////@begin forward declarations +////@end forward declarations + +/*! + * Control identifiers + */ + +////@begin control identifiers +#define ID_DIALOG 10000 +#define ID_AVAILABLE_CONFIG_ITEMS 10002 +#define ID_CONFIG_ITEMS 10005 +#define ID_CONFIG_ADD 10006 +#define ID_CONFIG_REMOVE 10007 +////@end control identifiers + +class ctConfigItem; + +/*! + * ctConfigItemsSelector class declaration + */ + +class ctConfigItemsSelector: public wxDialog +{ +public: + /// Constructor + ctConfigItemsSelector( wxWindow* parent, wxWindowID id = -1, const wxString& caption = _("Configuration Items Selector"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU ); + + /// Creates the controls and sizers + void CreateControls(); + +////@begin ctConfigItemsSelector event handler declarations + + /// Event handler for ID_CONFIG_ADD + void OnConfigAdd( wxCommandEvent& event ); + + /// Update event handler for ID_CONFIG_ADD + void OnUpdateConfigAdd( wxUpdateUIEvent& event ); + + /// Event handler for ID_CONFIG_REMOVE + void OnConfigRemove( wxCommandEvent& event ); + + /// Update event handler for ID_CONFIG_REMOVE + void OnUpdateConfigRemove( wxUpdateUIEvent& event ); + + /// Event handler for wxID_OK + void OnOk( wxCommandEvent& event ); + +////@end ctConfigItemsSelector event handler declarations + +////@begin ctConfigItemsSelector member function declarations + +////@end ctConfigItemsSelector member function declarations + + /// Initialise the master list + void InitSourceConfigList(ctConfigItem* item = NULL); + + /// Set the initial list + void SetConfigList(const wxArrayString& items); + + /// Get the list + const wxArrayString& GetConfigList() const { return m_configItems; } + + /// Should we show tooltips? + static bool ShowToolTips(); + + DECLARE_CLASS( ctConfigItemsSelector ) + DECLARE_EVENT_TABLE() + +protected: + wxArrayString m_configItems; + +}; + +#endif + // _CONFIGITEMSELECTOR_H_ diff --git a/utils/configtool/src/configtooldoc.cpp b/utils/configtool/src/configtooldoc.cpp new file mode 100644 index 0000000000..d5ae2a8b24 --- /dev/null +++ b/utils/configtool/src/configtooldoc.cpp @@ -0,0 +1,992 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: configtooldoc.h +// Purpose: Document class +// Author: Julian Smart +// Modified by: +// Created: 2003-06-04 +// RCS-ID: $Id$ +// Copyright: (c) Julian Smart +// Licence: +///////////////////////////////////////////////////////////////////////////// + +#ifdef __GNUG__ +#pragma implementation "configtooldoc.h" +#endif + +#include "wx/wx.h" + +#ifdef __BORLANDC__ +#pragma hdrstop +#endif + +#include "wx/config.h" +#include "wx/textfile.h" +#include "wx/process.h" +#include "wx/mimetype.h" +#include "wx/process.h" +#include "wx/wfstream.h" + +#ifdef __BORLANDC__ +#pragma hdrstop +#endif + +#include "configtooldoc.h" +#include "configtoolview.h" +#include "configtree.h" +#include "mainframe.h" +#include "utils.h" +#include "wxconfigtool.h" +#include "htmlparser.h" + +IMPLEMENT_DYNAMIC_CLASS(ctConfigToolDoc, wxDocument) + +// Ctor +ctConfigToolDoc::ctConfigToolDoc() +{ + m_topItem = NULL; + m_clipboardItem = NULL; +} + +// Dtor +ctConfigToolDoc::~ctConfigToolDoc() +{ + DeleteItems(); + ClearClipboard(); + if (GetCommandProcessor()) + GetCommandProcessor()->SetEditMenu(NULL); +} + +// Delete all the items not already deleted +void ctConfigToolDoc::DeleteItems() +{ + if (m_topItem) + delete m_topItem; + m_topItem = NULL; +} + +/// Clears the clipboard item. +void ctConfigToolDoc::ClearClipboard() +{ + if (m_clipboardItem) + delete m_clipboardItem; + m_clipboardItem = NULL; +} + +/// Sets the clipboard item. +void ctConfigToolDoc::SetClipboardItem(ctConfigItem* item) +{ + if (m_clipboardItem) + delete m_clipboardItem; + m_clipboardItem = item; +} + + +// Closes and clears the document +bool ctConfigToolDoc::OnCloseDocument() +{ + if (wxDocument::OnCloseDocument()) + { + ctConfigToolHint hint(NULL, ctClear); + UpdateAllViews (NULL, & hint); + + DeleteItems(); + return TRUE; + } + else + { + return FALSE; + } +} + +// Saves the doc +bool ctConfigToolDoc::Save() +{ + bool ret = FALSE; + + if (!IsModified() && m_savedYet) return TRUE; + if (m_documentFile == wxT("") || !m_savedYet) + ret = SaveAs(); + else + ret = OnSaveDocument(m_documentFile); + if ( ret ) + SetDocumentSaved(TRUE); + return ret; +} + +// Create the document +bool ctConfigToolDoc::OnCreate(const wxString& path, long flags) +{ + GetCommandProcessor()->SetEditMenu(wxGetApp().GetMainFrame()->GetEditMenu()); + GetCommandProcessor()->Initialize(); + GetCommandProcessor()->ClearCommands(); + + // wxGetApp().m_currentDoc = this; + + if (flags & wxDOC_NEW) + { + ctConfigItem* rootItem = new ctConfigItem(NULL, ctTypeGroup, _T("Configuration")); + //rootItem->InitProperties(); + rootItem->GetProperties().AddProperty( + new ctProperty( + wxT("The item description."), + wxVariant(wxT(""), wxT("description")), + wxT("multiline"))); + + rootItem->SetPropertyString(_T("description"), + _T("This is the top-level configuration item.")); + + + SetTopItem(rootItem); + + Modify(FALSE); + SetDocumentSaved(FALSE); + + wxString rootName(wxT("untitled")); + wxStripExtension(rootName); + SetFilename(wxGetApp().GetSettings().GenerateFilename(rootName)); + } + + // Creates the view, so do any view updating after this + bool success = wxDocument::OnCreate(path, flags); + + if (success) + { + if (flags & wxDOC_NEW) + { + wxBusyCursor wait; + + ctConfigToolHint hint(NULL, ctInitialUpdate); + UpdateAllViews (NULL, & hint); + + SetFilename(GetFilename(), TRUE); + } + } + return success; +} + +// Save the document +bool ctConfigToolDoc::OnSaveDocument(const wxString& filename) +{ + wxBusyCursor cursor; + + const wxString strOldPath(GetFilename()); + + // Do some backing up first + + // This is the backup filename + wxString backupFilename(filename); + backupFilename += wxT(".bak"); + + // This is the temporary copy of the backup + wxString tempFilename(filename); + tempFilename += wxT(".tmp"); + if (wxFileExists(tempFilename)) + wxRemoveFile(tempFilename); + + bool leaveBackup = TRUE; + + bool saved = DoSave(tempFilename); + + if (saved) + { + // Remove the old .bak file + if (wxFileExists(backupFilename)) + { + wxRemoveFile(backupFilename); + } + + // Copy the old file to the .bak + + if (leaveBackup) + { + if (wxFileExists(filename)) + { + if (!wxRenameFile(filename, backupFilename)) + { + wxCopyFile(filename, backupFilename); + wxRemoveFile(filename); + } + } + } + else + { + if (wxFileExists(filename)) + wxRemoveFile(filename); + } + + // Finally, copy the temporary file to the proper filename + if (!wxRenameFile(tempFilename, filename)) + { + wxCopyFile(tempFilename, filename); + wxRemoveFile(tempFilename); + } + + Modify(FALSE); + ((ctConfigToolView*)GetFirstView())->OnChangeFilename(); + SetDocumentSaved(TRUE); + SetFilename(filename); + wxGetApp().GetSettings().m_lastFilename = filename; + } else + { + SetFilename(strOldPath); + } + wxGetApp().GetMainFrame()->UpdateFrameTitle(); + return saved; +} + +// Open the document +bool ctConfigToolDoc::OnOpenDocument(const wxString& filename) +{ + wxBusyCursor cursor; + + bool opened = DoOpen(filename); + + if (opened) + { + SetFilename(filename); + wxGetApp().GetSettings().m_lastFilename = filename; + + ((ctConfigToolView*)GetFirstView())->OnChangeFilename(); + + RefreshDependencies(); + + // ctConfigToolHint hint(NULL, ctFilenameChanged); + ctConfigToolHint hint(NULL, ctInitialUpdate); + UpdateAllViews (NULL, & hint); + } + + SetDocumentSaved(TRUE); // Necessary or it will pop up the Save As dialog + + return opened; +} + +/// Save the settings file +bool ctConfigToolDoc::DoSave(const wxString& filename) +{ + wxFileOutputStream stream(filename); + if (!stream.Ok()) + return FALSE; + + stream << wxT("\n"); + stream << wxT(""); + + DoSave(m_topItem, stream, 1); + + stream << wxT("\n\n"); + + return TRUE; +} + +inline static void OutputIndentation(wxOutputStream& stream, int indent) +{ + wxString str = wxT("\n"); + for (int i = 0; i < indent; i++) + str << wxT(' ') << wxT(' '); + stream << str ; +} + +/// Recursive helper function for file saving +bool ctConfigToolDoc::DoSave(ctConfigItem* item, wxOutputStream& stream, int indent) +{ + OutputIndentation(stream, indent*2); + + wxString name(item->GetName()); + wxString s; + wxString typeStr; + if (item->GetType() == ctTypeGroup) + typeStr = wxT("group"); + else if (item->GetType() == ctTypeCheckGroup) + typeStr = wxT("check-group"); + else if (item->GetType() == ctTypeRadioGroup) + typeStr = wxT("radio-group"); + else if (item->GetType() == ctTypeString) + typeStr = wxT("string"); + else if (item->GetType() == ctTypeBoolCheck) + typeStr = wxT("bool-check"); + else if (item->GetType() == ctTypeBoolRadio) + typeStr = wxT("bool-radio"); + else if (item->GetType() == ctTypeInteger) + typeStr = wxT("integer"); + else + typeStr = wxT("unknown"); + + stream << wxT(""); + + indent ++; + + OutputIndentation(stream, indent*2); + if (item->IsActive()) + stream << wxT("1"); + else + stream << wxT("0"); + OutputIndentation(stream, indent*2); + if (item->IsEnabled()) + stream << wxT("1"); + else + stream << wxT("0"); + + // Output properties + wxNode* node = item->GetProperties().GetList().GetFirst(); + while (node) + { + ctProperty* prop = (ctProperty*) node->GetData(); + OutputIndentation(stream, indent*2); + stream << wxT("<") << prop->GetName() ; + + if (prop->IsCustom()) + { + stream << wxT(" custom=\"true\""); + stream << wxT(" type=\"") << prop->GetVariant().GetType() << wxT("\""); + stream << wxT(" editor-type=\"") << prop->GetEditorType() << wxT("\""); + stream << wxT(" description=\"") << prop->GetDescription() << wxT("\""); + if (prop->GetChoices().GetCount() > 0) + { + wxString choices; + ctConfigItem::ArrayToString(prop->GetChoices(), choices); + stream << wxT(" choices=\"") << choices << wxT("\""); + } + } + + stream << wxT(">"); + + stream << ctEscapeHTMLCharacters(prop->GetVariant().GetString()) ; + stream << wxT("GetName() << wxT(">"); + + node = node->Next(); + } + + // Output children + node = item->GetChildren().GetFirst(); + while (node) + { + ctConfigItem* child = (ctConfigItem*) node->GetData(); + DoSave(child, stream, indent); + + node = node->Next(); + } + + indent --; + + OutputIndentation(stream, indent*2); + stream << wxT(""); + + return TRUE; +} + +/// Open the settings file +bool ctConfigToolDoc::DoOpen(const wxString& filename) +{ + wxSimpleHtmlParser parser; + if (parser.ParseFile(filename)) + { + ctConfigToolHint hint(NULL, ctClear); + UpdateAllViews (NULL, & hint); + m_topItem = NULL; + + if (parser.GetTopLevelTag()->GetChildren()) + { + wxSimpleHtmlTag* settingsTag = parser.GetTopLevelTag()->GetChildren()->FindTag(wxT("settings")); + if (settingsTag && settingsTag->GetChildren()) + { + wxSimpleHtmlTag* firstSettingTag = settingsTag->GetChildren(); + if (firstSettingTag) + DoOpen(firstSettingTag, NULL); + return TRUE; + } + return TRUE; + } + } + return FALSE; +} + +static bool GetHtmlBoolValue(const wxString& value) +{ + if (value == wxT("true") || value == wxT("TRUE") || value == wxT("1")) + return TRUE; + else + return FALSE; +} + +static int GetHtmlIntegerValue(const wxString& value) +{ + return wxAtoi(value); +} + +static double GetHtmlDoubleValue(const wxString& value) +{ + return wxAtof(value); +} + +bool ctConfigToolDoc::DoOpen(wxSimpleHtmlTag* tag, ctConfigItem* parent) +{ + ctConfigItem* newItem = NULL; + if (tag->NameIs(wxT("setting"))) + { + wxSimpleHtmlAttribute* attr = tag->FindAttribute(wxT("type")); + if (attr) + { + ctConfigType type = ctTypeUnknown; + wxString typeStr(attr->GetValue()); + if (typeStr == wxT("group")) + type = ctTypeGroup; + else if (typeStr == wxT("option-group") || typeStr == wxT("check-group")) + type = ctTypeCheckGroup; + else if (typeStr == wxT("radio-group")) + type = ctTypeRadioGroup; + else if (typeStr == wxT("bool-check")) + type = ctTypeBoolCheck; + else if (typeStr == wxT("bool-radio")) + type = ctTypeBoolRadio; + else if (typeStr == wxT("string")) + type = ctTypeString; + else if (typeStr == wxT("integer")) + type = ctTypeInteger; + else + { + wxLogError(wxT("Unknown type %s"), (const wxChar*) typeStr); + } + if (type != ctTypeUnknown) + { + newItem = new ctConfigItem(parent, type, wxT("")); + newItem->InitProperties(); + if (!parent) + SetTopItem(newItem); + } + } + } + wxSimpleHtmlTag* childTag = tag->GetChildren(); + + while (childTag) + { + if (childTag->GetType() == wxSimpleHtmlTag_Open) + { + if (childTag->GetName() == wxT("setting")) + { + DoOpen(childTag, newItem); + } + else if (childTag->GetName() == wxT("name")) + { + if (newItem) + { + wxString name(childTag->GetNext()->GetTagText()); + newItem->SetName(name); + } + } + else if (childTag->GetName() == wxT("active")) + { + if (newItem) + newItem->SetActive(GetHtmlBoolValue(childTag->GetNext()->GetTagText())); + } + else if (childTag->GetName() == wxT("enabled")) + { + if (newItem) + newItem->Enable(GetHtmlBoolValue(childTag->GetNext()->GetTagText())); + } + else + { + if (newItem) + { + ctProperty* prop = newItem->GetProperties().FindProperty(childTag->GetName()); + if (!prop) + { + // A custom property, else an obsolete + // property that we should ignore. + wxString isCustom; + if (childTag->GetAttributeValue(isCustom, wxT("custom")) && + isCustom == wxT("true")) + { + prop = new ctProperty; + + wxString name(childTag->GetName()); + wxString type(wxT("string")); + wxString choices; + wxString editorType(wxT("string")); + wxString description(wxT("")); + childTag->GetAttributeValue(type, wxT("type")); + childTag->GetAttributeValue(type, wxT("editor-type")); + childTag->GetAttributeValue(type, wxT("choices")); + childTag->GetAttributeValue(description, wxT("description")); + + if (type == wxT("bool")) + prop->GetVariant() = wxVariant((bool) FALSE, name); + else if (type == wxT("double")) + prop->GetVariant() = wxVariant((double) 0.0, name); + else if (type == wxT("long")) + prop->GetVariant() = wxVariant((long) 0, name); + else + prop->GetVariant() = wxVariant(wxT(""), name); + prop->SetDescription(description); + prop->SetCustom(TRUE); + prop->SetEditorType(editorType); + if (!choices.IsEmpty()) + { + wxArrayString arr; + ctConfigItem::StringToArray(choices, arr); + prop->SetChoices(arr); + } + newItem->GetProperties().AddProperty(prop); + } + } + if (prop) + { + if (prop->GetVariant().GetType() == wxT("string")) + prop->GetVariant() = childTag->GetNext()->GetTagText(); + else if (prop->GetVariant().GetType() == wxT("long")) + prop->GetVariant() = (long) GetHtmlIntegerValue(childTag->GetNext()->GetTagText()); + else if (prop->GetVariant().GetType() == wxT("bool")) + prop->GetVariant() = (bool) GetHtmlBoolValue(childTag->GetNext()->GetTagText()); + else if (prop->GetVariant().GetType() == wxT("double")) + prop->GetVariant() = (double) GetHtmlDoubleValue(childTag->GetNext()->GetTagText()); + } + } + } + } + childTag = childTag->GetNext(); + } + return TRUE; +} + +/// Clear dependencies +void ctConfigToolDoc::ClearDependencies(ctConfigItem* item) +{ + if (!item) + item = GetTopItem(); + + item->GetDependents().Clear(); + for ( wxNode* node = item->GetChildren().GetFirst(); node; node = node->GetNext() ) + { + ctConfigItem* child = (ctConfigItem*) node->GetData(); + ClearDependencies(child); + } +} + +/// Refresh dependencies +void ctConfigToolDoc::RefreshDependencies() +{ + ClearDependencies(GetTopItem()); + RefreshDependencies(GetTopItem()); +} + +/// Refresh dependencies +void ctConfigToolDoc::RefreshDependencies(ctConfigItem* item) +{ + wxArrayString requiresArr; + wxString requires = item->GetPropertyString(wxT("requires")); + wxString precludes = item->GetPropertyString(wxT("precludes")); + wxString enabledIf = item->GetPropertyString(wxT("enabled-if")); + wxString enabledIfNot = item->GetPropertyString(wxT("enabled-if-not")); + wxString context = item->GetPropertyString(wxT("context")); + + if (!requires.IsEmpty()) + item->StringToArray(requires, requiresArr); + + if (!precludes.IsEmpty()) + item->StringToArray(precludes, requiresArr); + + if (!enabledIfNot.IsEmpty()) + item->StringToArray(enabledIfNot, requiresArr); + + if (!enabledIf.IsEmpty()) + item->StringToArray(enabledIf, requiresArr); + + // Add the parent to the list of dependencies, if the + // parent is a check or radio group. + ctConfigItem* parent = item->GetParent(); + if (parent && + (parent->GetType() == ctTypeCheckGroup || + parent->GetType() == ctTypeRadioGroup)) + requiresArr.Add(parent->GetName()); + + // Also look in 'context' since these items + // are another kind of dependency (switching to + // a different platform may cause the dependencies + // to be evaluated differently). + if (!context.IsEmpty()) + item->StringToArray(context, requiresArr); + + size_t i; + for (i = 0; i < requiresArr.GetCount(); i++) + { + wxString itemName(requiresArr[i]); + ctConfigItem* otherItem = GetTopItem()->FindItem(itemName); + if (otherItem && !otherItem->GetDependents().Member(item)) + { + otherItem->GetDependents().Append(item); + } + } + for ( wxNode* node = item->GetChildren().GetFirst(); node; node = node->GetNext() ) + { + ctConfigItem* child = (ctConfigItem*) node->GetData(); + RefreshDependencies(child); + } +} + +/// Generate the text of a setup.h +wxString ctConfigToolDoc::GenerateSetup() +{ + wxString str; + str << wxT("/*\n * setup.h\n * Generated by wxConfigTool\n *\n */\n\n"); + + GenerateSetup(GetTopItem(), str); + + return str; +} + +/// Helper function +void ctConfigToolDoc::GenerateSetup(ctConfigItem* item, wxString& str) +{ + // Generate the setup.h entries for this item + wxString name = item->GetName(); + + // We don't process the platform choice + if (item->GetName() == wxT("Platform")) + return; + + if (item->IsInActiveContext() && + (item->GetType() == ctTypeCheckGroup || + item->GetType() == ctTypeRadioGroup || + item->GetType() == ctTypeBoolCheck || + item->GetType() == ctTypeBoolRadio)) + { + // TODO: write description + wxString name = item->GetName(); + if (name.Left(6) == wxT("wxUSE_") || + name == wxT("REMOVE_UNUSED_ARG") || // Hack alert: change to wxUSE_UNUSED_ARG_REMOVAL + name.Find(wxT("COMPATIBILITY")) != wxNOT_FOUND) + { + str << wxT("#define ") << name ; + if (item->IsEnabled()) + str << wxT(" 1"); + else + str << wxT(" 0"); + str << wxT("\n\n"); + } + } + + for ( wxNode* node = item->GetChildren().GetFirst(); node; node = node->GetNext() ) + { + ctConfigItem* child = (ctConfigItem*) node->GetData(); + GenerateSetup(child, str); + } +} + + +/// Generate a configure command +wxString ctConfigToolDoc::GenerateConfigureCommand() +{ + wxString str; + str << wxT("# configurewx\n# Generated by wxConfigTool\n\n"); + + wxString path = GetFrameworkDir(TRUE); + bool makeUnix = TRUE; + if (!path.IsEmpty()) + { + if (makeUnix) + path += wxT("/"); + else + path += wxFILE_SEP_PATH ; + } + + str << path << wxT("configure"); + + // Find the platform option to use + ctConfigItem* platformsFolder = GetTopItem()->FindItem(wxT("Platform")); + if (platformsFolder) + { + for ( wxNode* node = platformsFolder->GetChildren().GetFirst(); node; node = node->GetNext() ) + { + ctConfigItem* child = (ctConfigItem*) node->GetData(); + if (child->GetType() == ctTypeBoolRadio && child->IsEnabled()) + { + wxString configureCommand = child->GetPropertyString(wxT("configure-command")); + if (!configureCommand.IsEmpty()) + str << wxT(" ") << configureCommand; + } + } + } + + GenerateConfigureCommand(GetTopItem(), str); + return str; +} + +/// Helper function +void ctConfigToolDoc::GenerateConfigureCommand(ctConfigItem* item, wxString& str) +{ + // We don't process the platform group, since we've + // already done so. + if (item->GetName() == wxT("Platform")) + return; + + if (item->IsInActiveContext() && + (item->GetType() == ctTypeCheckGroup || + item->GetType() == ctTypeRadioGroup || + item->GetType() == ctTypeBoolCheck || + item->GetType() == ctTypeBoolRadio)) + { + wxString name = item->GetName(); + wxString configureCommand = item->GetPropertyString(wxT("configure-command")); + if (!configureCommand.IsEmpty()) + { + if (!item->IsEnabled()) + { + // Replace 'enable' with 'disable' if this + // option is off. + configureCommand.Replace(wxT("--enable-"), wxT("--disable-")); + configureCommand.Replace(wxT("--with-"), wxT("--without-")); + } + ctProperty* prop = item->GetProperties().FindProperty(wxT("builtin")); + if (prop && prop->GetVariant().GetType() == wxT("bool")) + { + bool builtin = prop->GetVariant().GetBool(); + str << wxT(" ") << configureCommand; + if (builtin) + str << wxT("=builtin"); + else + str << wxT("=sys"); + } + else + { + ctProperty* prop = item->GetProperties().FindProperty(wxT("value")); + if (prop && prop->GetVariant().GetType() == wxT("string")) + { + wxString val = prop->GetVariant().GetString(); + if (item->IsEnabled() && !val.IsEmpty()) + { + str << wxT(" ") << configureCommand; + str << wxT("=\"") << val << wxT("\""); + } + // If the string is empty, ignore this parameter, + // since it's obviously intended to be supplied + // only if there's a string to use and it's enabled. + } + else + { + str << wxT(" ") << configureCommand; + } + } + } + } + + for ( wxNode* node = item->GetChildren().GetFirst(); node; node = node->GetNext() ) + { + ctConfigItem* child = (ctConfigItem*) node->GetData(); + GenerateConfigureCommand(child, str); + } +} + +/// Gets the current framework directory +wxString ctConfigToolDoc::GetFrameworkDir(bool makeUnix) +{ + wxString path = wxGetApp().GetSettings().m_frameworkDir; + if (wxGetApp().GetSettings().m_useEnvironmentVariable) + { + // Should probably allow other variables + // to be used, and maybe expand variables within m_frameworkDir + path = wxGetenv(wxT("WXWIN")); +#ifdef __WXMSW__ + if (makeUnix) + path.Replace(wxT("\\"), wxT("/")); +#endif + } + return path; +} + + +/* + * Implements a document editing command. + */ + +ctConfigCommand::ctConfigCommand(const wxString& name, int cmdId, + ctConfigItem* activeState, ctConfigItem* savedState, + ctConfigItem* parent, ctConfigItem* insertBefore, + bool ignoreFirstTime): wxCommand(TRUE, name) +{ + m_activeState = activeState; + m_savedState = savedState; + m_ignoreThis = ignoreFirstTime; + m_cmdId = cmdId; + m_properties = NULL; + m_parent = parent; + m_insertBefore = insertBefore; +} + +ctConfigCommand::ctConfigCommand(const wxString& name, int cmdId, + ctConfigItem* activeState, ctProperties* properties, + bool ignoreFirstTime): wxCommand(TRUE, name) +{ + m_activeState = activeState; + m_savedState = NULL; + m_properties = properties; + m_ignoreThis = ignoreFirstTime; + m_cmdId = cmdId; + m_properties = properties; + m_parent = NULL; + m_insertBefore = NULL; +} + +ctConfigCommand::~ctConfigCommand() +{ + if (m_savedState) + delete m_savedState; + if (m_properties) + delete m_properties; +} + +bool ctConfigCommand::Do() +{ + return DoAndUndo(TRUE); +} + +bool ctConfigCommand::Undo() +{ + return DoAndUndo(FALSE); +} + +// Combine Do and Undo into one +bool ctConfigCommand::DoAndUndo(bool doCmd) +{ + switch (m_cmdId) + { + case ctCMD_CUT: + { + if (doCmd) + { + wxASSERT(m_savedState == NULL); + wxASSERT(m_activeState != NULL); + + ctConfigItem* newItem = m_activeState->DeepClone(); + ctConfigToolDoc* doc = m_activeState->GetDocument(); + + // This will delete the old clipboard contents, if any. + doc->SetClipboardItem(newItem); + + m_parent = m_activeState->GetParent(); + m_insertBefore = m_activeState->FindNextSibling(); + + m_activeState->Detach(); + m_savedState = m_activeState; + m_activeState = NULL; + + m_savedState->GetDocument()->Modify(TRUE); + ctConfigToolView* view = (ctConfigToolView*) m_savedState->GetDocument()->GetFirstView(); + view->OnChangeFilename(); + } + else + { + wxASSERT(m_savedState != NULL); + wxASSERT(m_activeState == NULL); + + m_savedState->GetDocument()->Modify(TRUE); + m_savedState->Attach(m_parent, m_insertBefore); + ctConfigToolView* view = (ctConfigToolView*) m_savedState->GetDocument()->GetFirstView(); + view->AddItems(wxGetApp().GetMainFrame()->GetConfigTreeCtrl(), m_savedState); + m_activeState = m_savedState; + m_savedState = NULL; + m_parent = NULL; + m_insertBefore = NULL; + view->OnChangeFilename(); + } + break; + } + case ctCMD_PASTE: + { + if (doCmd) + { + wxASSERT(m_savedState != NULL); + wxASSERT(m_activeState == NULL); + + m_savedState->GetDocument()->Modify(TRUE); + m_savedState->Attach(m_parent, m_insertBefore); + ctConfigToolView* view = (ctConfigToolView*) m_savedState->GetDocument()->GetFirstView(); + view->AddItems(wxGetApp().GetMainFrame()->GetConfigTreeCtrl(), m_savedState); + wxGetApp().GetMainFrame()->GetConfigTreeCtrl()->SelectItem(m_savedState->GetTreeItemId()); + m_activeState = m_savedState; + m_savedState = NULL; + view->OnChangeFilename(); + } + else + { + wxASSERT(m_savedState == NULL); + wxASSERT(m_activeState != NULL); + + m_activeState->GetDocument()->Modify(TRUE); + ctConfigToolView* view = (ctConfigToolView*) m_activeState->GetDocument()->GetFirstView(); + m_activeState->Detach(); + m_savedState = m_activeState; + m_activeState = NULL; + view->OnChangeFilename(); + } + break; + } + case ctCMD_NEW_ELEMENT: + { + if (doCmd) + { + wxASSERT(m_savedState != NULL); + wxASSERT(m_activeState == NULL); + + m_savedState->GetDocument()->Modify(TRUE); + m_savedState->Attach(m_parent, m_insertBefore); + ctConfigToolView* view = (ctConfigToolView*) m_savedState->GetDocument()->GetFirstView(); + view->AddItems(wxGetApp().GetMainFrame()->GetConfigTreeCtrl(), m_savedState); + wxGetApp().GetMainFrame()->GetConfigTreeCtrl()->SelectItem(m_savedState->GetTreeItemId()); + + m_activeState = m_savedState; + m_savedState = NULL; + } + else + { + wxASSERT(m_savedState == NULL); + wxASSERT(m_activeState != NULL); + + m_activeState->GetDocument()->Modify(TRUE); + m_activeState->Detach(); + m_savedState = m_activeState; + m_activeState = NULL; + } + break; + } + case ctCMD_APPLY_PROPERTY: + { + wxASSERT(m_properties != NULL); + wxASSERT(m_activeState != NULL); + + // Don't update the properties editor first time + // around since it will be done one property at a time + // initially (and no property editor update required) + if (!m_ignoreThis) + { + // Just swap the saved and current properties. + ctProperties propsTemp = m_activeState->GetProperties() ; + m_activeState->GetProperties() = (* m_properties); + (* m_properties) = propsTemp; + + // Apply only those that need applying + // (those properties in activeState that are not in propsTemp) + wxNode* node = m_activeState->GetProperties().GetList().GetFirst(); + while (node) + { + ctProperty* prop = (ctProperty*) node->GetData(); + ctProperty* otherProp = propsTemp.FindProperty(prop->GetName()); + if (otherProp && ((*prop) != (*otherProp))) + { + m_activeState->ApplyProperty(prop, otherProp->GetVariant()); + } + node = node->GetNext(); + } + m_activeState->GetDocument()->Modify(TRUE); + ctConfigToolView* view = (ctConfigToolView*) m_activeState->GetDocument()->GetFirstView(); + if (view) + { + ctConfigToolHint hint(NULL, ctValueChanged); + m_activeState->GetDocument()->UpdateAllViews (NULL, & hint); + } + } + m_ignoreThis = FALSE; + + break; + } + } + return TRUE; +} + diff --git a/utils/configtool/src/configtooldoc.h b/utils/configtool/src/configtooldoc.h new file mode 100644 index 0000000000..72baa93f61 --- /dev/null +++ b/utils/configtool/src/configtooldoc.h @@ -0,0 +1,149 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: configtooldoc.h +// Purpose: Document class +// Author: Julian Smart +// Modified by: +// Created: 2003-06-04 +// RCS-ID: $Id$ +// Copyright: (c) Julian Smart +// Licence: +///////////////////////////////////////////////////////////////////////////// + +#ifndef _CT_CONFIGTOOLDOC_H_ +#define _CT_CONFIGTOOLDOC_H_ + +#ifdef __GNUG__ +#pragma interface "configtooldoc.cpp" +#endif + +#include "wx/docview.h" +#include "wx/cmdproc.h" + +#include "configitem.h" + +class wxSimpleHtmlTag; + +/*! + * ctConfigToolDoc + */ + +class ctConfigToolDoc: public wxDocument +{ + DECLARE_DYNAMIC_CLASS(ctConfigToolDoc) +public: + ctConfigToolDoc(); + ~ctConfigToolDoc(); + +//// Overrides + virtual bool OnCreate(const wxString& path, long flags); + virtual bool OnOpenDocument(const wxString& filename); + virtual bool OnSaveDocument(const wxString& filename); + virtual bool OnNewDocument() { return TRUE; } + virtual bool OnCloseDocument() ; + virtual bool Save(); // Overridden only to correct bug in wxWindows, docview.cpp + +//// Accessors + + /// Returns the top item. + ctConfigItem* GetTopItem() const { return m_topItem; } + + /// Sets the top item. + void SetTopItem(ctConfigItem* item) { m_topItem = item; } + + /// Returns the clipboard item. + ctConfigItem* GetClipboardItem() const { return m_clipboardItem; } + + /// Sets the clipboard item. + void SetClipboardItem(ctConfigItem* item) ; + + /// Clears the clipboard item. + void ClearClipboard() ; + + /// Gets the current framework directory + wxString GetFrameworkDir(bool makeUnix); + +//// Operations + + /// Add items + void AddItems(); + + /// Delete items + void DeleteItems(); + + /// Save the settings file + bool DoSave(const wxString& filename); + + /// Recursive helper function for file saving + bool DoSave(ctConfigItem* item, wxOutputStream& stream, int indent); + + /// Open the settings file + bool DoOpen(const wxString& filename); + + /// Helper for file opening. + bool DoOpen(wxSimpleHtmlTag* tag, ctConfigItem* parent); + + /// Refresh dependencies + void RefreshDependencies(); + void RefreshDependencies(ctConfigItem* item); + + /// Clear dependencies + void ClearDependencies(ctConfigItem* item); + + /// Generate the text of a setup.h + wxString GenerateSetup(); + + /// Helper function + void GenerateSetup(ctConfigItem* item, wxString& str); + + /// Generate a configure command + wxString GenerateConfigureCommand(); + + /// Helper function + void GenerateConfigureCommand(ctConfigItem* item, wxString& str); + +protected: + ctConfigItem* m_topItem; + ctConfigItem* m_clipboardItem; +}; + + +/*! + * Implements a document editing command. + * We only need to store one state at a time, + * since we don't have (or need) multiple selection. + */ + +#define ctCMD_NEW_ELEMENT 1 +#define ctCMD_PASTE 2 +#define ctCMD_CUT 3 +#define ctCMD_APPLY_PROPERTY 4 + +class ctConfigCommand: public wxCommand +{ +public: + ctConfigCommand(const wxString& name, int cmdId, + ctConfigItem* activeState, ctConfigItem* savedState, + ctConfigItem* parent = NULL, ctConfigItem* insertBefore = NULL, + bool ignoreFirstTime = FALSE); + ctConfigCommand(const wxString& name, int cmdId, + ctConfigItem* activeState, ctProperties* properties, + bool ignoreFirstTime = FALSE); + ~ctConfigCommand(); + + bool Do(); + bool Undo(); + bool DoAndUndo(bool doCmd); // Combine Do and Undo into one + +protected: + ctConfigItem* m_activeState; + ctConfigItem* m_savedState; + ctProperties* m_properties; + bool m_ignoreThis; // Ignore 1st Do because we already did it + int m_cmdId; + ctConfigItem* m_parent; + ctConfigItem* m_insertBefore; +}; + + +#endif + // _CT_CONFIGTOOLDOC_H_ diff --git a/utils/configtool/src/configtoolview.cpp b/utils/configtool/src/configtoolview.cpp new file mode 100644 index 0000000000..10cb368559 --- /dev/null +++ b/utils/configtool/src/configtoolview.cpp @@ -0,0 +1,967 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: configtoolview.cpp +// Purpose: View class +// Author: Julian Smart +// Modified by: +// Created: 2003-06-04 +// RCS-ID: $Id$ +// Copyright: (c) Julian Smart +// Licence: +///////////////////////////////////////////////////////////////////////////// + +#ifdef __GNUG__ + #pragma implementation "configtoolview.cpp" +#endif + +// Includes other headers for precompiled compilation +#include "wx/wx.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +#include "wx/wfstream.h" + +#include "configtoolview.h" +#include "configtooldoc.h" +#include "configtree.h" +#include "wxconfigtool.h" +#include "mainframe.h" +#include "propeditor.h" +#include "utils.h" +#include "custompropertydialog.h" + +IMPLEMENT_DYNAMIC_CLASS(ctConfigToolView, wxView) + +BEGIN_EVENT_TABLE(ctConfigToolView, wxView) + EVT_MENU(ctID_ADD_ITEM_CHECKBOX, ctConfigToolView::OnAddCheckBoxItem) + EVT_MENU(ctID_ADD_ITEM_RADIOBUTTON, ctConfigToolView::OnAddRadioButtonItem) + EVT_MENU(ctID_ADD_ITEM_GROUP, ctConfigToolView::OnAddGroupItem) + EVT_MENU(ctID_ADD_ITEM_CHECK_GROUP, ctConfigToolView::OnAddCheckGroupItem) + EVT_MENU(ctID_ADD_ITEM_RADIO_GROUP, ctConfigToolView::OnAddRadioGroupItem) + EVT_MENU(ctID_ADD_ITEM_STRING, ctConfigToolView::OnAddStringItem) + EVT_MENU(ctID_RENAME_ITEM, ctConfigToolView::OnRenameItem) + EVT_MENU(ctID_DELETE_ITEM, ctConfigToolView::OnDeleteItem) + + EVT_MENU(wxID_COPY, ctConfigToolView::OnCopy) + EVT_MENU(wxID_CUT, ctConfigToolView::OnCut) + EVT_MENU(wxID_PASTE, ctConfigToolView::OnPaste) + + EVT_UPDATE_UI(wxID_COPY, ctConfigToolView::OnUpdateCopy) + EVT_UPDATE_UI(wxID_CUT, ctConfigToolView::OnUpdateCut) + EVT_UPDATE_UI(wxID_PASTE, ctConfigToolView::OnUpdatePaste) + + EVT_MENU(ctID_ITEM_HELP, ctConfigToolView::OnItemHelp) + + EVT_UPDATE_UI(ctID_ADD_ITEM_CHECKBOX, ctConfigToolView::OnUpdateAddItem) + EVT_UPDATE_UI(ctID_ADD_ITEM_RADIOBUTTON, ctConfigToolView::OnUpdateAddItem) + EVT_UPDATE_UI(ctID_ADD_ITEM_GROUP, ctConfigToolView::OnUpdateAddItem) + EVT_UPDATE_UI(ctID_ADD_ITEM_CHECK_GROUP, ctConfigToolView::OnUpdateAddItem) + EVT_UPDATE_UI(ctID_ADD_ITEM_RADIO_GROUP, ctConfigToolView::OnUpdateAddItem) + EVT_UPDATE_UI(ctID_ADD_ITEM_STRING, ctConfigToolView::OnUpdateAddItem) + EVT_UPDATE_UI(ctID_RENAME_ITEM, ctConfigToolView::OnUpdateCut) + EVT_UPDATE_UI(ctID_DELETE_ITEM, ctConfigToolView::OnUpdateCut) + EVT_UPDATE_UI(ctID_ITEM_HELP, ctConfigToolView::OnUpdateItemHelp) + + EVT_MENU(ctID_TREE_COPY, ctConfigToolView::OnContextCopy) + EVT_MENU(ctID_TREE_CUT, ctConfigToolView::OnContextCut) + EVT_MENU(ctID_TREE_PASTE_BEFORE, ctConfigToolView::OnContextPasteBefore) + EVT_MENU(ctID_TREE_PASTE_AFTER, ctConfigToolView::OnContextPasteAfter) + EVT_MENU(ctID_TREE_PASTE_AS_CHILD, ctConfigToolView::OnContextPasteAsChild) + EVT_UPDATE_UI(ctID_TREE_COPY, ctConfigToolView::OnUpdateContextCopy) + EVT_UPDATE_UI(ctID_TREE_CUT, ctConfigToolView::OnUpdateContextCut) + EVT_UPDATE_UI(ctID_TREE_PASTE_BEFORE, ctConfigToolView::OnUpdateContextPasteBefore) + EVT_UPDATE_UI(ctID_TREE_PASTE_AFTER, ctConfigToolView::OnUpdateContextPasteAfter) + EVT_UPDATE_UI(ctID_TREE_PASTE_AS_CHILD, ctConfigToolView::OnUpdateContextPasteAsChild) + + EVT_MENU(ctID_ADD_CUSTOM_PROPERTY, ctConfigToolView::OnAddCustomProperty) + EVT_MENU(ctID_EDIT_CUSTOM_PROPERTY, ctConfigToolView::OnEditCustomProperty) + EVT_MENU(ctID_DELETE_CUSTOM_PROPERTY, ctConfigToolView::OnDeleteCustomProperty) + EVT_UPDATE_UI(ctID_ADD_CUSTOM_PROPERTY, ctConfigToolView::OnUpdateAddCustomProperty) + EVT_UPDATE_UI(ctID_EDIT_CUSTOM_PROPERTY, ctConfigToolView::OnUpdateEditCustomProperty) + EVT_UPDATE_UI(ctID_DELETE_CUSTOM_PROPERTY, ctConfigToolView::OnUpdateDeleteCustomProperty) + + EVT_NOTEBOOK_PAGE_CHANGED(-1, ctConfigToolView::OnTabSelect) + + EVT_MENU(ctID_SAVE_SETUP_FILE, ctConfigToolView::OnSaveSetupFile) + EVT_MENU(ctID_SAVE_CONFIGURE_COMMAND, ctConfigToolView::OnSaveConfigureCommand) + EVT_UPDATE_UI(ctID_SAVE_SETUP_FILE, ctConfigToolView::OnUpdateSaveSetupFile) + EVT_UPDATE_UI(ctID_SAVE_CONFIGURE_COMMAND, ctConfigToolView::OnUpdateSaveConfigureCommand) +END_EVENT_TABLE() + +ctConfigToolView::ctConfigToolView() +{ +} + +// What to do when a view is created. Creates actual +// windows for displaying the view. +bool ctConfigToolView::OnCreate(wxDocument *doc, long WXUNUSED(flags) ) +{ + wxGetApp().GetDocManager()->ActivateView(this, TRUE); + wxGetApp().GetMainFrame()->SetDocument((ctConfigToolDoc*) doc); + wxGetApp().GetMainFrame()->GetSetupPage()->SetDocument((ctConfigToolDoc*) doc) ; + wxGetApp().GetMainFrame()->GetConfigurePage()->SetDocument((ctConfigToolDoc*) doc) ; + + return TRUE; +} + +void ctConfigToolView::OnDraw(wxDC *dc) +{ +} + +void ctConfigToolView::OnUpdate(wxView *WXUNUSED(sender), wxObject *hintObj) +{ + ctConfigToolDoc* doc = wxDynamicCast(GetDocument(), ctConfigToolDoc); + ctConfigTreeCtrl* treeCtrl = wxGetApp().GetMainFrame()->GetConfigTreeCtrl(); + if (!treeCtrl) + return; + + wxASSERT (doc != NULL); + + ctConfigItem* selItem = NULL; + + wxTreeItemId sel = treeCtrl->GetSelection(); + if (sel.IsOk()) + { + ctTreeItemData* data = (ctTreeItemData*) treeCtrl->GetItemData(sel); + if (data) + selItem = data->GetConfigItem() ; + } + + ctConfigToolHint* hint = (ctConfigToolHint*) hintObj; + int hintOp = ctNoHint; + if (hint) + hintOp = hint->m_op; + + switch (hintOp) + { + case ctInitialUpdate: + { + if (doc && doc->GetTopItem()) + { + wxGetApp().GetMainFrame()->GetConfigTreeCtrl()->DeleteAllItems(); + AddItems(wxGetApp().GetMainFrame()->GetConfigTreeCtrl(), doc->GetTopItem()); + wxGetApp().GetMainFrame()->GetConfigTreeCtrl()->Expand(doc->GetTopItem()->GetTreeItemId()); + } + } + break; + case ctSelChanged: + { + if (selItem) + { + wxGetApp().GetMainFrame()->GetPropertyEditor()->ShowItem(selItem); + } + } + break; + case ctAllSaved: + { + // TODO: update windows and frame title + } + break; + case ctFilenameChanged: + { + wxGetApp().GetMainFrame()->UpdateFrameTitle(); + } + break; + case ctClear: + { + // TODO: update windows + treeCtrl->DeleteAllItems(); + wxGetApp().GetMainFrame()->GetPropertyEditor()->ShowItem(NULL); + break; + } + case ctValueChanged: + { + // ctConfigItem& ti = *(ctConfigItem *)hint->m_item; + wxGetApp().GetMainFrame()->GetPropertyEditor()->ShowItem(selItem); + } + break; + + default: + break; + } +} + +// Clean up windows used for displaying the view. +bool ctConfigToolView::OnClose(bool deleteWindow) +{ + if (!GetDocument()->Close()) + return FALSE; + + ctConfigToolHint hint(NULL, ctClear); + GetDocument()->UpdateAllViews (NULL, & hint); + + wxGetApp().GetDocManager()->ActivateView(this, FALSE); + + Activate(FALSE); + + wxGetApp().GetMainFrame()->SetDocument(NULL); + wxGetApp().GetMainFrame()->GetSetupPage()->SetDocument(NULL) ; + wxGetApp().GetMainFrame()->GetConfigurePage()->SetDocument(NULL) ; + + return TRUE; +} + +void ctConfigToolView::OnChangeFilename() +{ + if (wxGetApp().GetTopWindow() && GetDocument()) + { + wxString docTitle(wxFileNameFromPath(GetDocument()->GetFilename())); + wxStripExtension(docTitle); + GetDocument()->SetTitle(docTitle); + + wxString name(GetDocument()->GetFilename()); + wxStripExtension(name); + + wxString title; + + wxString modifiedMarker; + if (GetDocument()->IsModified()) + modifiedMarker = wxT("*"); + + title = docTitle + modifiedMarker + wxString(wxT(" - ")) + wxGetApp().GetSettings().GetAppName() ; + + ((wxFrame*) wxGetApp().GetTopWindow())->SetTitle(title); + } +} + +// General disabler +void ctConfigToolView::OnUpdateDisable(wxUpdateUIEvent& event) +{ + event.Enable( FALSE ); +} + +void ctConfigToolView::OnUpdateAddItem(wxUpdateUIEvent& event) +{ + event.Enable( TRUE ); +} + +/// Add item and its children to the tree +void ctConfigToolView::AddItems(ctConfigTreeCtrl* treeControl, ctConfigItem* item) +{ + SyncItem(treeControl, item); + + int count = item->GetChildCount(); + int i; + for (i = 0; i < count; i++) + { + ctConfigItem* child = item->GetChild(i); + AddItems(treeControl, child); + } +} + +/// Gets the tree item in sync with the item +void ctConfigToolView::SyncItem(ctConfigTreeCtrl* treeControl, ctConfigItem* item) +{ + if (!item->GetTreeItemId().IsOk()) + { + if (!item->GetParent()) + { + item->SetTreeItem(treeControl->AddRoot(_(""), -1, -1, new ctTreeItemData(item))); + } + else + { + // Find the item to insert the new item after. + ctConfigItem* previousItem = item->FindPreviousSibling(); + if (previousItem && previousItem->GetTreeItemId().IsOk()) + { + item->SetTreeItem(treeControl->InsertItem(item->GetParent()->GetTreeItemId(), + previousItem->GetTreeItemId(), + item->GetName(), -1, -1, new ctTreeItemData(item))); + } + else if (!previousItem && item->GetParent()->GetChildCount() > 1 + ) + { + // Insert at the beginning + item->SetTreeItem(treeControl->InsertItem(item->GetParent()->GetTreeItemId(), + (size_t) 0, // Insert at first position + item->GetName(), -1, -1, new ctTreeItemData(item))); + } + else + { + item->SetTreeItem(treeControl->AppendItem(item->GetParent()->GetTreeItemId(), + item->GetName(), -1, -1, new ctTreeItemData(item))); + } + } + } + + if (item->GetTreeItemId().IsOk()) + { + treeControl->SetItemText(item->GetTreeItemId(), item->GetName()); + + int iconId = 0; + + if (item->GetType() == ctTypeGroup) + { + iconId = treeControl->GetIconTable().GetIconId(wxT("Group"), 0, item->IsActive()); + } + else if (item->GetType() == ctTypeCheckGroup) + { + iconId = treeControl->GetIconTable().GetIconId(wxT("CheckGroup"), item->IsEnabled() ? 0 : 1, item->IsActive()); + } + else if (item->GetType() == ctTypeRadioGroup) + { + iconId = treeControl->GetIconTable().GetIconId(wxT("RadioGroup"), item->IsEnabled() ? 0 : 1, item->IsActive()); + } + else if (item->GetType() == ctTypeBoolCheck) + { + iconId = treeControl->GetIconTable().GetIconId(wxT("Checkbox"), item->IsEnabled() ? 0 : 1, item->IsActive()); + } + else if (item->GetType() == ctTypeBoolRadio) + { + iconId = treeControl->GetIconTable().GetIconId(wxT("Radiobutton"), item->IsEnabled() ? 0 : 1, item->IsActive()); + } + treeControl->SetItemImage(item->GetTreeItemId(), iconId, wxTreeItemIcon_Normal); + treeControl->SetItemImage(item->GetTreeItemId(), iconId, wxTreeItemIcon_Selected); + + if (treeControl->GetSelection() == item->GetTreeItemId()) + { + if (wxGetApp().GetMainFrame()->GetPropertyEditor()->GetItem()) + wxGetApp().GetMainFrame()->GetPropertyEditor()->UpdateTitle(); + } + } +} + +/// Clicked an icon +void ctConfigToolView::OnIconLeftDown(ctConfigTreeCtrl* treeControl, ctConfigItem* item) +{ + if (!item->IsActive()) + return; + + if (item->GetType() == ctTypeCheckGroup || + item->GetType() == ctTypeBoolCheck || + item->GetType() == ctTypeBoolRadio || + item->GetType() == ctTypeRadioGroup + ) + { + // Don't toggle a radio button that's already + // enabled. + if ((item->GetType() == ctTypeBoolRadio || item->GetType() == ctTypeRadioGroup) + && item->IsEnabled()) + return; + + item->Enable(!item->IsEnabled()); + + GetDocument()->Modify(TRUE); + OnChangeFilename(); + + SyncItem(treeControl, item); + + wxList considered; + item->PropagateChange(considered); + if ((item->GetType() == ctTypeBoolRadio || item->GetType() == ctTypeRadioGroup) && item->IsEnabled()) + { + item->PropagateRadioButton(considered); + } + } +} + +/// Returns the selected config item, if any. +ctConfigItem* ctConfigToolView::GetSelection() +{ + wxTreeCtrl* treeCtrl = wxGetApp().GetMainFrame()->GetConfigTreeCtrl(); + if (!treeCtrl) + return NULL; + + wxTreeItemId sel = treeCtrl->GetSelection(); + if (sel.IsOk()) + { + ctTreeItemData* data = (ctTreeItemData*) treeCtrl->GetItemData(sel); + if (data) + return data->GetConfigItem() ; + } + return NULL; +} + +/// Add a checkbox item +void ctConfigToolView::OnAddCheckBoxItem(wxCommandEvent& event) +{ + AddItem(ctTypeBoolCheck, _("New checkbox item")); +} + +/// Add a radiobutton item +void ctConfigToolView::OnAddRadioButtonItem(wxCommandEvent& event) +{ + AddItem(ctTypeBoolRadio, _("New radio button item")); +} + +/// Add a group item +void ctConfigToolView::OnAddGroupItem(wxCommandEvent& event) +{ + AddItem(ctTypeGroup, _("New group item")); +} + +/// Add a group option item +void ctConfigToolView::OnAddCheckGroupItem(wxCommandEvent& event) +{ + AddItem(ctTypeCheckGroup, _("New check group item")); +} + +/// Add a group option item +void ctConfigToolView::OnAddRadioGroupItem(wxCommandEvent& event) +{ + AddItem(ctTypeRadioGroup, _("New radio group item")); +} + +/// Add a string item +void ctConfigToolView::OnAddStringItem(wxCommandEvent& event) +{ + AddItem(ctTypeString, _("New string item")); +} + +/// Add an item +void ctConfigToolView::AddItem(ctConfigType type, const wxString& msg) +{ + ctConfigItem* sel = GetSelection(); + if (sel) + { + wxString name = wxGetTextFromUser(_("Please enter a name for the new item."), + msg, wxT("")); + if (!name.IsEmpty()) + { + ctConfigItem* parent ; + ctConfigItem* insertBefore ; + if (sel->CanHaveChildren()) + { + parent = sel; + insertBefore = NULL; + } + else + { + parent = sel->GetParent(); + insertBefore = sel->FindNextSibling(); + } + + ctConfigItem* newItem = new ctConfigItem(NULL, type, name); + newItem->InitProperties(); + + newItem->GetDocument()->GetCommandProcessor()->Submit( + new ctConfigCommand(msg, ctCMD_NEW_ELEMENT, NULL, newItem, + parent, insertBefore)); + } + } +} + +/// Delete an item +void ctConfigToolView::OnDeleteItem(wxCommandEvent& event) +{ + ctConfigItem* sel = GetSelection(); + if (sel) + { + wxString msg; + msg.Printf(_("Delete %s?"), sel->GetName()); + if (wxYES == wxMessageBox(msg, _("Delete item"), wxICON_QUESTION|wxYES_NO)) + { + wxGetApp().GetMainFrame()->GetConfigTreeCtrl()->Delete(sel->GetTreeItemId()); + } + } +} + +/// Rename an item +void ctConfigToolView::OnRenameItem(wxCommandEvent& event) +{ + ctConfigItem* sel = GetSelection(); + if (sel) + { + wxString name = wxGetTextFromUser(_("Please enter a new name for the item."), + _("Rename item"), sel->GetName()); + if (!name.IsEmpty()) + { + sel->SetName(name); + SyncItem(wxGetApp().GetMainFrame()->GetConfigTreeCtrl(), sel); + + ctConfigToolHint hint(NULL, ctSelChanged); + GetDocument()->UpdateAllViews (NULL, & hint); + } + } +} + +/// Copy an item to the clipboard +void ctConfigToolView::OnCopy(wxCommandEvent& event) +{ + ctConfigToolDoc* doc = (ctConfigToolDoc*) GetDocument(); + ctConfigItem* sel = GetSelection(); + if (sel) + { + doc->SetClipboardItem(sel->DeepClone()); + } +} + +/// Copy an item to the clipboard and cut the item +void ctConfigToolView::OnCut(wxCommandEvent& event) +{ + ctConfigToolDoc* doc = (ctConfigToolDoc*) GetDocument(); + ctConfigItem* sel = GetSelection(); + if (sel) + { + { + ctConfigCommand* cmd = new ctConfigCommand(wxT("Cut Config Item"), ctCMD_CUT, + sel, (ctConfigItem*) NULL); + doc->GetCommandProcessor()->Submit(cmd); + } + } +} + +/// Paste an item from the clipboard to the tree +void ctConfigToolView::OnPaste(wxCommandEvent& event) +{ + ctConfigToolDoc* doc = (ctConfigToolDoc*) GetDocument(); + ctConfigItem* sel = GetSelection(); + if (sel && doc->GetClipboardItem()) + { + ctConfigItem* parent ; + ctConfigItem* insertBefore ; + if (sel->CanHaveChildren()) + { + parent = sel; + insertBefore = NULL; + } + else + { + parent = sel->GetParent(); + insertBefore = sel->FindNextSibling(); + } + + ctConfigItem* newItem = doc->GetClipboardItem()->DeepClone(); + ctConfigCommand* cmd = new ctConfigCommand(wxT("Paste Config Item"), ctCMD_PASTE, + NULL, newItem, parent, insertBefore); + doc->GetCommandProcessor()->Submit(cmd); + } +} + +/// Update for copy command +void ctConfigToolView::OnUpdateCopy(wxUpdateUIEvent& event) +{ + ctConfigToolDoc* doc = (ctConfigToolDoc*) GetDocument(); + event.Enable( doc && GetSelection() && GetSelection()->GetParent() ); +} + +/// Update for cut +void ctConfigToolView::OnUpdateCut(wxUpdateUIEvent& event) +{ + ctConfigToolDoc* doc = (ctConfigToolDoc*) GetDocument(); + event.Enable( doc && GetSelection() && GetSelection()->GetParent() ); +} + +/// Update for paste +void ctConfigToolView::OnUpdatePaste(wxUpdateUIEvent& event) +{ + ctConfigToolDoc* doc = (ctConfigToolDoc*) GetDocument(); + event.Enable( doc && doc->GetClipboardItem() && GetSelection() ); +} + +/// Copy an item to the clipboard +void ctConfigToolView::OnContextCopy(wxCommandEvent& event) +{ + ctConfigToolDoc* doc = (ctConfigToolDoc*) GetDocument(); + ctConfigItem* sel = wxGetApp().GetMainFrame()->GetConfigTreeCtrl()->GetContextItem(); + if (doc && sel) + { + doc->SetClipboardItem(sel->DeepClone()); + } +} + +/// Copy an item to the clipboard and cut the item +void ctConfigToolView::OnContextCut(wxCommandEvent& event) +{ + ctConfigToolDoc* doc = (ctConfigToolDoc*) GetDocument(); + ctConfigItem* sel = wxGetApp().GetMainFrame()->GetConfigTreeCtrl()->GetContextItem(); + if (sel) + { + { + ctConfigCommand* cmd = new ctConfigCommand(wxT("Cut Config Item"), ctCMD_CUT, + sel, (ctConfigItem*) NULL); + doc->GetCommandProcessor()->Submit(cmd); + } + } +} + +/// Paste an item from the clipboard to the tree +void ctConfigToolView::OnContextPasteBefore(wxCommandEvent& event) +{ + ctConfigToolDoc* doc = (ctConfigToolDoc*) GetDocument(); + ctConfigItem* sel = wxGetApp().GetMainFrame()->GetConfigTreeCtrl()->GetContextItem(); + if (sel && doc->GetClipboardItem()) + { + ctConfigItem* parent = sel->GetParent(); + ctConfigItem* insertBefore = sel; + + ctConfigItem* newItem = doc->GetClipboardItem()->DeepClone(); + ctConfigCommand* cmd = new ctConfigCommand(wxT("Paste Config Item"), ctCMD_PASTE, + NULL, newItem, parent, insertBefore); + doc->GetCommandProcessor()->Submit(cmd); + } +} + +/// Paste an item from the clipboard to the tree +void ctConfigToolView::OnContextPasteAfter(wxCommandEvent& event) +{ + ctConfigToolDoc* doc = (ctConfigToolDoc*) GetDocument(); + ctConfigItem* sel = wxGetApp().GetMainFrame()->GetConfigTreeCtrl()->GetContextItem(); + if (sel && doc->GetClipboardItem()) + { + ctConfigItem* parent = sel->GetParent(); + ctConfigItem* insertBefore = sel->FindNextSibling(); + + ctConfigItem* newItem = doc->GetClipboardItem()->DeepClone(); + ctConfigCommand* cmd = new ctConfigCommand(wxT("Paste Config Item"), ctCMD_PASTE, + NULL, newItem, parent, insertBefore); + doc->GetCommandProcessor()->Submit(cmd); + } +} + +/// Paste an item from the clipboard to the tree +void ctConfigToolView::OnContextPasteAsChild(wxCommandEvent& event) +{ + ctConfigToolDoc* doc = (ctConfigToolDoc*) GetDocument(); + ctConfigItem* sel = wxGetApp().GetMainFrame()->GetConfigTreeCtrl()->GetContextItem(); + if (sel && doc->GetClipboardItem()) + { + if (sel->CanHaveChildren()) + { + ctConfigItem* parent = sel; + ctConfigItem* insertBefore = NULL; + + ctConfigItem* newItem = doc->GetClipboardItem()->DeepClone(); + ctConfigCommand* cmd = new ctConfigCommand(wxT("Paste Config Item"), ctCMD_PASTE, + NULL, newItem, parent, insertBefore); + doc->GetCommandProcessor()->Submit(cmd); + } + } +} + +/// Copy an item to the clipboard +void ctConfigToolView::OnUpdateContextCopy(wxUpdateUIEvent& event) +{ + ctConfigToolDoc* doc = (ctConfigToolDoc*) GetDocument(); + ctConfigItem* sel = wxGetApp().GetMainFrame()->GetConfigTreeCtrl()->GetContextItem(); + event.Enable( doc && sel && sel->GetParent() ); +} + +/// Copy an item to the clipboard and cut the item +void ctConfigToolView::OnUpdateContextCut(wxUpdateUIEvent& event) +{ + ctConfigToolDoc* doc = (ctConfigToolDoc*) GetDocument(); + ctConfigItem* sel = wxGetApp().GetMainFrame()->GetConfigTreeCtrl()->GetContextItem(); + event.Enable( doc && sel && sel->GetParent() ); +} + +/// Paste an item from the clipboard to the tree +void ctConfigToolView::OnUpdateContextPasteBefore(wxUpdateUIEvent& event) +{ + ctConfigToolDoc* doc = (ctConfigToolDoc*) GetDocument(); + ctConfigItem* sel = wxGetApp().GetMainFrame()->GetConfigTreeCtrl()->GetContextItem(); + event.Enable( doc && sel && sel->GetParent() && doc->GetClipboardItem() ); +} + +/// Paste an item from the clipboard to the tree +void ctConfigToolView::OnUpdateContextPasteAfter(wxUpdateUIEvent& event) +{ + ctConfigToolDoc* doc = (ctConfigToolDoc*) GetDocument(); + ctConfigItem* sel = wxGetApp().GetMainFrame()->GetConfigTreeCtrl()->GetContextItem(); + event.Enable( doc && sel && sel->GetParent() && doc->GetClipboardItem() ); +} + +/// Paste an item from the clipboard to the tree +void ctConfigToolView::OnUpdateContextPasteAsChild(wxUpdateUIEvent& event) +{ + ctConfigToolDoc* doc = (ctConfigToolDoc*) GetDocument(); + ctConfigItem* sel = wxGetApp().GetMainFrame()->GetConfigTreeCtrl()->GetContextItem(); + event.Enable( doc && sel && sel->CanHaveChildren() && doc->GetClipboardItem() ); +} + +/// Item help +void ctConfigToolView::OnItemHelp(wxCommandEvent& event) +{ + ctConfigToolDoc* doc = (ctConfigToolDoc*) GetDocument(); + if ( doc && GetSelection() ) + { + wxString helpTopic = GetSelection()->GetPropertyString(wxT("help-topic")); + if (!helpTopic.IsEmpty()) + { + wxGetApp().GetReferenceHelpController().DisplaySection(helpTopic); + } + } +} + +/// Item help update +void ctConfigToolView::OnUpdateItemHelp(wxUpdateUIEvent& event) +{ + ctConfigToolDoc* doc = (ctConfigToolDoc*) GetDocument(); + event.Enable( doc && GetSelection() ); +} + +/// Add a custom property +void ctConfigToolView::OnAddCustomProperty(wxCommandEvent& event) +{ + ctConfigToolDoc* doc = (ctConfigToolDoc*) GetDocument(); + ctConfigItem* sel = GetSelection(); + ctPropertyEditor* editor = wxGetApp().GetMainFrame()->GetPropertyEditor(); + if (doc && sel && editor) + { + ctCustomPropertyDialog dialog(wxGetApp().GetMainFrame(), + -1, _("Add a custom property")); + if (dialog.ShowModal() == wxID_OK) + { + wxString name = dialog.GetPropertyName(); + wxString type = dialog.GetPropertyType(); + wxString descr = dialog.GetPropertyDescription(); + wxString editorType = dialog.GetEditorType(); + wxArrayString choices = dialog.GetChoices(); + + if (sel->GetProperties().FindProperty(name)) + { + wxMessageBox(_("Sorry, this name already exists."), _T("Add custom property"), + wxOK|wxICON_INFORMATION); + return; + } + ctProperty* property = new ctProperty; + if (type == wxT("bool")) + property->GetVariant() = wxVariant((bool) FALSE, name); + else if (type == wxT("double")) + property->GetVariant() = wxVariant((double) 0.0, name); + else if (type == wxT("long")) + property->GetVariant() = wxVariant((long) 0, name); + else + property->GetVariant() = wxVariant(wxT(""), name); + property->SetCustom(TRUE); + property->SetDescription(descr); + property->SetChoices(choices); + property->SetEditorType(editorType); + + sel->GetProperties().AddProperty(property); + editor->ShowItem(sel); + OnChangeFilename(); + } + } +} + +/// Edit a custom property +void ctConfigToolView::OnEditCustomProperty(wxCommandEvent& event) +{ + ctConfigToolDoc* doc = (ctConfigToolDoc*) GetDocument(); + ctConfigItem* sel = GetSelection(); + ctPropertyEditor* editor = wxGetApp().GetMainFrame()->GetPropertyEditor(); + if (doc && sel && editor) + { + int row; + ctProperty* property = editor->FindSelectedProperty(row) ; + if (property && property->IsCustom()) + { + wxString oldName = property->GetName(); + wxString oldDescription = property->GetDescription(); + wxString oldType = property->GetVariant().GetType(); + wxString oldEditorType = property->GetEditorType(); + wxArrayString oldChoices = property->GetChoices(); + + ctCustomPropertyDialog dialog(wxGetApp().GetMainFrame(), + -1, _("Edit custom property")); + dialog.SetPropertyName(oldName); + dialog.SetPropertyType(oldType); + dialog.SetPropertyDescription(oldDescription); + if (dialog.ShowModal() == wxID_OK) + { + wxString name = dialog.GetPropertyName(); + wxString type = dialog.GetPropertyType(); + wxString editorType = dialog.GetEditorType(); + wxArrayString choices = dialog.GetChoices(); + wxString descr = dialog.GetPropertyDescription(); + + if (name != oldName && sel->GetProperties().FindProperty(name)) + { + wxMessageBox(_("Sorry, this name already exists."), _T("Add custom property"), + wxOK|wxICON_INFORMATION); + return; + } + if (type != oldType) + { + if (type == wxT("bool")) + property->GetVariant() = wxVariant((bool) FALSE, name); + else if (type == wxT("double")) + property->GetVariant() = wxVariant((double) 0.0, name); + else if (type == wxT("long")) + property->GetVariant() = wxVariant((long) 0, name); + else + property->GetVariant() = wxVariant(wxT(""), name); + } + if (name != oldName) + property->GetVariant().SetName(name); + + if (choices != oldChoices) + property->SetChoices(choices); + + if (editorType != oldEditorType) + property->SetEditorType(editorType); + + if (name != oldName) + property->GetVariant().SetName(name); + + property->SetCustom(TRUE); + + if (descr != oldDescription) + property->SetDescription(descr); + + editor->ShowItem(sel); + OnChangeFilename(); + } + } + } +} + +/// Delete a custom property +void ctConfigToolView::OnDeleteCustomProperty(wxCommandEvent& event) +{ + ctConfigToolDoc* doc = (ctConfigToolDoc*) GetDocument(); + ctConfigItem* sel = GetSelection(); + ctPropertyEditor* editor = wxGetApp().GetMainFrame()->GetPropertyEditor(); + if (doc && sel && editor) + { + int row; + ctProperty* property = editor->FindSelectedProperty(row) ; + if (property && property->IsCustom()) + { + wxString name(property->GetName()); + wxString msg; + msg.Printf(_("Delete custom property '%s'?"), (const wxChar*) name); + if (wxYES == wxMessageBox(msg, _("Delete property"), wxICON_EXCLAMATION|wxYES_NO)) + { + sel->GetProperties().RemoveProperty(property); + editor->ShowItem(sel); + delete property; + OnChangeFilename(); + } + } + } +} + +/// Add a custom property: update event +void ctConfigToolView::OnUpdateAddCustomProperty(wxUpdateUIEvent& event) +{ + ctConfigToolDoc* doc = (ctConfigToolDoc*) GetDocument(); + event.Enable( doc && GetSelection() && GetSelection()->GetParent() ); +} + +/// Edit a custom property: update event +void ctConfigToolView::OnUpdateEditCustomProperty(wxUpdateUIEvent& event) +{ + ctConfigToolDoc* doc = (ctConfigToolDoc*) GetDocument(); + ctConfigItem* sel = GetSelection(); + ctPropertyEditor* editor = wxGetApp().GetMainFrame()->GetPropertyEditor(); + int row; + event.Enable( doc && sel && sel->GetParent() && editor && + editor->FindSelectedProperty(row) && + editor->FindSelectedProperty(row)->IsCustom() ); +} + +/// Delete a custom property: update event +void ctConfigToolView::OnUpdateDeleteCustomProperty(wxUpdateUIEvent& event) +{ + ctConfigToolDoc* doc = (ctConfigToolDoc*) GetDocument(); + ctConfigItem* sel = GetSelection(); + ctPropertyEditor* editor = wxGetApp().GetMainFrame()->GetPropertyEditor(); + int row; + event.Enable( doc && sel && sel->GetParent() && editor && + editor->FindSelectedProperty(row) && + editor->FindSelectedProperty(row)->IsCustom() ); +} + +/// Regenerate setup.h and configure command +void ctConfigToolView::RegenerateSetup() +{ + ctConfigToolDoc* doc = (ctConfigToolDoc*) GetDocument(); + ctOutputWindow* setupPage = wxGetApp().GetMainFrame()->GetSetupPage() ; + ctOutputWindow* configurePage = wxGetApp().GetMainFrame()->GetConfigurePage() ; + + wxString setupStr = doc->GenerateSetup(); + wxString configureStr = doc->GenerateConfigureCommand(); + + setupPage->SetText(setupStr); + configurePage->SetText(configureStr); +} + +/// Regenerate if selected a tab +void ctConfigToolView::OnTabSelect(wxNotebookEvent& event) +{ + if (wxGetApp().GetMainFrame()->GetMainNotebook() != event.GetEventObject()) + { + event.Skip(); + return; + } + + if (event.GetSelection() > 0) + { + RegenerateSetup(); + } +} + +void ctConfigToolView::OnSaveSetupFile(wxCommandEvent& event) +{ + ctConfigToolDoc* doc = (ctConfigToolDoc*) GetDocument(); + wxString setupStr = doc->GenerateSetup(); + + wxString filename = _T("setup.h"); + wxString path = doc->GetFrameworkDir(FALSE); + wxString wildcard = _T("Header files (*.h)|*.h|All files (*.*)|*.*"); + + wxFileDialog dialog(wxTheApp->GetTopWindow(), + _("Save Setup File As"), + path, filename , + wildcard, wxSAVE|wxOVERWRITE_PROMPT); + + if (dialog.ShowModal() == wxID_OK) + { + wxString fullPath = dialog.GetPath(); + + // TODO: save last saved path in settings. + + wxFileOutputStream stream(fullPath); + if (!stream.Ok()) + { + wxMessageBox(_("Sorry, could not save this file."), _("Save Setup File"), wxICON_EXCLAMATION|wxOK); + return; + } + + stream << setupStr; + } +} + +void ctConfigToolView::OnSaveConfigureCommand(wxCommandEvent& event) +{ + ctConfigToolDoc* doc = (ctConfigToolDoc*) GetDocument(); + wxString configureStr = doc->GenerateConfigureCommand(); + + wxString filename = _T("configurewx.sh"); + wxString path = doc->GetFrameworkDir(FALSE); + wxString wildcard = _T("Shell script files (*.sh)|*.sh|All files (*.*)|*.*"); + + wxFileDialog dialog(wxTheApp->GetTopWindow(), + _("Save Configure Command File As"), + path, filename , + wildcard, wxSAVE|wxOVERWRITE_PROMPT); + + if (dialog.ShowModal() == wxID_OK) + { + wxString fullPath = dialog.GetPath(); + + // TODO: save last saved path in settings. + + wxFileOutputStream stream(fullPath); + if (!stream.Ok()) + { + wxMessageBox(_("Sorry, could not save this file."), _("Save Configure Command File"), wxICON_EXCLAMATION|wxOK); + return; + } + + stream << configureStr; + } +} + +void ctConfigToolView::OnUpdateSaveSetupFile(wxUpdateUIEvent& event) +{ + event.Enable(TRUE); +} + +void ctConfigToolView::OnUpdateSaveConfigureCommand(wxUpdateUIEvent& event) +{ + event.Enable(TRUE); +} diff --git a/utils/configtool/src/configtoolview.h b/utils/configtool/src/configtoolview.h new file mode 100644 index 0000000000..85e9e58a50 --- /dev/null +++ b/utils/configtool/src/configtoolview.h @@ -0,0 +1,225 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: configtoolview.h +// Purpose: View class +// Author: Julian Smart +// Modified by: +// Created: 2003-06-04 +// RCS-ID: $Id$ +// Copyright: (c) Julian Smart +// Licence: +///////////////////////////////////////////////////////////////////////////// + +#ifndef _CT_CONFIGTOOLVIEW_H_ +#define _CT_CONFIGTOOLVIEW_H_ + +#ifdef __GNUG__ +#pragma interface "configtoolview.cpp" +#endif + +#include "wx/docview.h" +#include "wx/treectrl.h" +#include "configitem.h" + +class ctConfigTreeCtrl; +class WXDLLEXPORT wxNotebookEvent; + +/* + * ctConfigToolView + */ + +class ctConfigItem; +class ctConfigToolView: public wxView +{ + DECLARE_DYNAMIC_CLASS(ctConfigToolView) +public: + ctConfigToolView(); + ~ctConfigToolView() {}; + +//// Overrides + + bool OnCreate(wxDocument *doc, long flags); + void OnDraw(wxDC *dc); + void OnUpdate(wxView *sender, wxObject *hint = (wxObject *) NULL); + bool OnClose(bool deleteWindow = TRUE); + void OnChangeFilename(); + +//// Operations + + /// Gets the tree item in sync with the item. + void SyncItem(ctConfigTreeCtrl* treeControl, ctConfigItem* item); + + /// Add item and its children to the tree + void AddItems(ctConfigTreeCtrl* treeControl, ctConfigItem* item); + + /// Clicked an icon + void OnIconLeftDown(ctConfigTreeCtrl* treeControl, ctConfigItem* item); + + /// Add an item + void AddItem(ctConfigType type, const wxString& msg); + + /// Regenerate setup.h and configure command + void RegenerateSetup(); + +//// Accessors + + /// Returns the selected config item, if any. + ctConfigItem* GetSelection(); + +//// Event handlers + + /// General disabler + void OnUpdateDisable(wxUpdateUIEvent& event); + + /// Enable add item menu items + void OnUpdateAddItem(wxUpdateUIEvent& event); + + /// Add a checkbox item + void OnAddCheckBoxItem(wxCommandEvent& event); + + /// Add a radiobutton item + void OnAddRadioButtonItem(wxCommandEvent& event); + + /// Add a group item + void OnAddGroupItem(wxCommandEvent& event); + + /// Add a check group item + void OnAddCheckGroupItem(wxCommandEvent& event); + + /// Add a radio group item + void OnAddRadioGroupItem(wxCommandEvent& event); + + /// Add a string item + void OnAddStringItem(wxCommandEvent& event); + + /// Delete an item + void OnDeleteItem(wxCommandEvent& event); + + /// Rename an item + void OnRenameItem(wxCommandEvent& event); + + /// Copy an item to the clipboard + void OnCopy(wxCommandEvent& event); + + /// Copy an item to the clipboard and cut the item + void OnCut(wxCommandEvent& event); + + /// Paste an item from the clipboard to the tree + void OnPaste(wxCommandEvent& event); + + /// Item help + void OnItemHelp(wxCommandEvent& event); + + /// Update for copy command + void OnUpdateCopy(wxUpdateUIEvent& event); + + /// Update for cut + void OnUpdateCut(wxUpdateUIEvent& event); + + /// Update for paste + void OnUpdatePaste(wxUpdateUIEvent& event); + + /// Update for item help + void OnUpdateItemHelp(wxUpdateUIEvent& event); + + // Context menu events + + /// Copy an item to the clipboard + void OnContextCopy(wxCommandEvent& event); + + /// Copy an item to the clipboard and cut the item + void OnContextCut(wxCommandEvent& event); + + /// Paste an item from the clipboard to the tree + void OnContextPasteBefore(wxCommandEvent& event); + + /// Paste an item from the clipboard to the tree + void OnContextPasteAfter(wxCommandEvent& event); + + /// Paste an item from the clipboard to the tree + void OnContextPasteAsChild(wxCommandEvent& event); + + /// Copy an item to the clipboard + void OnUpdateContextCopy(wxUpdateUIEvent& event); + + /// Copy an item to the clipboard and cut the item + void OnUpdateContextCut(wxUpdateUIEvent& event); + + /// Paste an item from the clipboard to the tree + void OnUpdateContextPasteBefore(wxUpdateUIEvent& event); + + /// Paste an item from the clipboard to the tree + void OnUpdateContextPasteAfter(wxUpdateUIEvent& event); + + /// Paste an item from the clipboard to the tree + void OnUpdateContextPasteAsChild(wxUpdateUIEvent& event); + + // Custom property events + + /// Add a custom property + void OnAddCustomProperty(wxCommandEvent& event); + + /// Edit a custom property + void OnEditCustomProperty(wxCommandEvent& event); + + /// Delete a custom property + void OnDeleteCustomProperty(wxCommandEvent& event); + + /// Add a custom property: update event + void OnUpdateAddCustomProperty(wxUpdateUIEvent& event); + + /// Edit a custom property: update event + void OnUpdateEditCustomProperty(wxUpdateUIEvent& event); + + /// Delete a custom property: update event + void OnUpdateDeleteCustomProperty(wxUpdateUIEvent& event); + + // Notebook events + + /// Regenerate if selected a tab + void OnTabSelect(wxNotebookEvent& event); + + /// Saving setup file + void OnSaveSetupFile(wxCommandEvent& event); + + /// Save configure command file + void OnSaveConfigureCommand(wxCommandEvent& event); + + /// Saving setup file update handler + void OnUpdateSaveSetupFile(wxUpdateUIEvent& event); + + /// Save configure command file update handler + void OnUpdateSaveConfigureCommand(wxUpdateUIEvent& event); + +DECLARE_EVENT_TABLE() + +protected: +}; + +/* + * ctConfigToolHint + * + * Hint to pass to UpdateAllViews + * + */ + +// Update hint symbols +#define ctNoHint 0 +#define ctAllSaved 1 +#define ctClear 2 +#define ctValueChanged 3 +#define ctSelChanged 4 +#define ctFilenameChanged 5 +#define ctInitialUpdate 6 + +class ctConfigItem; +class ctConfigToolHint: public wxObject +{ +public: + ctConfigToolHint(ctConfigItem* item, int op) { m_item = item; m_op = op; } + + ctConfigItem* m_item; + int m_op; +}; + +#endif + // _CT_CONFIGTOOLVIEW_H_ diff --git a/utils/configtool/src/configtree.cpp b/utils/configtool/src/configtree.cpp new file mode 100644 index 0000000000..3da10101fb --- /dev/null +++ b/utils/configtool/src/configtree.cpp @@ -0,0 +1,229 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: configtree.h +// Purpose: wxWindows Configuration Tool tree class +// Author: Julian Smart +// Modified by: +// Created: 2003-06-03 +// RCS-ID: $Id$ +// Copyright: (c) Julian Smart +// Licence: +///////////////////////////////////////////////////////////////////////////// + +#ifdef __GNUG__ +#pragma implementation "configtree.h" +#endif + +// Includes other headers for precompiled compilation +#include "wx/wx.h" + +#ifdef __BORLANDC__ +#pragma hdrstop +#endif + +#include "wx/imaglist.h" +#include "wx/cshelp.h" + +// Include XPM icons +#include "bitmaps/folder1.xpm" + +#include "bitmaps/closedfolder.xpm" +#include "bitmaps/closedfolder_dis.xpm" + +#include "bitmaps/checked.xpm" +#include "bitmaps/checked_dis.xpm" +#include "bitmaps/unchecked.xpm" +#include "bitmaps/unchecked_dis.xpm" + +#include "bitmaps/radioon.xpm" +#include "bitmaps/radioon_dis.xpm" +#include "bitmaps/radiooff.xpm" +#include "bitmaps/radiooff_dis.xpm" + +#include "bitmaps/checkedfolder.xpm" +#include "bitmaps/checkedfolder_dis.xpm" +#include "bitmaps/uncheckedfolder.xpm" +#include "bitmaps/uncheckedfolder_dis.xpm" + +#include "bitmaps/radiofolderon.xpm" +#include "bitmaps/radiofolderon_dis.xpm" +#include "bitmaps/radiofolderoff.xpm" +#include "bitmaps/radiofolderoff_dis.xpm" + +#include "configtree.h" +#include "configtooldoc.h" +#include "configtoolview.h" +#include "wxconfigtool.h" +#include "mainframe.h" + +/* + * ctConfigTreeCtrl + */ + +IMPLEMENT_CLASS(ctConfigTreeCtrl, wxTreeCtrl) + +BEGIN_EVENT_TABLE(ctConfigTreeCtrl, wxTreeCtrl) + EVT_MOUSE_EVENTS(ctConfigTreeCtrl::OnMouseEvent) + EVT_CHAR(ctConfigTreeCtrl::OnKeyDown) + EVT_TREE_SEL_CHANGED(-1, ctConfigTreeCtrl::OnSelChanged) + EVT_HELP(-1, ctConfigTreeCtrl::OnHelp) +END_EVENT_TABLE() + +ctConfigTreeCtrl::ctConfigTreeCtrl(wxWindow* parent, wxWindowID id, const wxPoint& pt, + const wxSize& sz, long style): +wxTreeCtrl(parent, id, pt, sz, style) +{ + LoadIcons(); + + m_contextMenu = NULL; + m_contextMenu = new wxMenu; + + m_contextMenu->Append(ctID_TREE_PASTE_BEFORE, _("Paste &before this option")); + m_contextMenu->Append(ctID_TREE_PASTE_AFTER, _("Paste &after this option")); + m_contextMenu->Append(ctID_TREE_PASTE_AS_CHILD, _("Paste as &child of this option")); + m_contextMenu->AppendSeparator(); + m_contextMenu->Append(ctID_TREE_COPY, _("C&opy")); + m_contextMenu->Append(ctID_TREE_CUT, _("Cu&t")); + + SetHelpText(_("This shows configuration settings that you can enable and disable.")); +} + +// Load the icons and initialize the tree +void ctConfigTreeCtrl::LoadIcons() +{ + m_imageList = new wxImageList(16, 16, TRUE); + m_iconTable.SetImageList(m_imageList); + SetImageList(m_imageList); + + m_iconTable.AddInfo("Group", wxIcon(closedfolder_xpm), 0, TRUE); + m_iconTable.AddInfo("Group", wxIcon(closedfolder_dis_xpm), 0, FALSE); + + m_iconTable.AddInfo("Checkbox", wxIcon(checked_xpm), 0, TRUE); + m_iconTable.AddInfo("Checkbox", wxIcon(checked_dis_xpm), 0, FALSE); + m_iconTable.AddInfo("Checkbox", wxIcon(unchecked_xpm), 1, TRUE); + m_iconTable.AddInfo("Checkbox", wxIcon(unchecked_dis_xpm), 1, FALSE); + + m_iconTable.AddInfo("CheckGroup", wxIcon(checkedfolder_xpm), 0, TRUE); + m_iconTable.AddInfo("CheckGroup", wxIcon(checkedfolder_dis_xpm), 0, FALSE); + m_iconTable.AddInfo("CheckGroup", wxIcon(uncheckedfolder_xpm), 1, TRUE); + m_iconTable.AddInfo("CheckGroup", wxIcon(uncheckedfolder_dis_xpm), 1, FALSE); + + m_iconTable.AddInfo("RadioGroup", wxIcon(radiofolderon_xpm), 0, TRUE); + m_iconTable.AddInfo("RadioGroup", wxIcon(radiofolderon_dis_xpm), 0, FALSE); + m_iconTable.AddInfo("RadioGroup", wxIcon(radiofolderoff_xpm), 1, TRUE); + m_iconTable.AddInfo("RadioGroup", wxIcon(radiofolderoff_dis_xpm), 1, FALSE); + + m_iconTable.AddInfo("Radiobutton", wxIcon(radioon_xpm), 0, TRUE); + m_iconTable.AddInfo("Radiobutton", wxIcon(radioon_dis_xpm), 0, FALSE); + m_iconTable.AddInfo("Radiobutton", wxIcon(radiooff_xpm), 1, TRUE); + m_iconTable.AddInfo("Radiobutton", wxIcon(radiooff_dis_xpm), 1, FALSE); +} + +ctConfigTreeCtrl::~ctConfigTreeCtrl() +{ + SetImageList(NULL); + delete m_imageList; + + delete m_contextMenu; +} + +void ctConfigTreeCtrl::OnSelChanged(wxTreeEvent& event) +{ + ctConfigToolDoc* doc = wxGetApp().GetMainFrame()->GetDocument(); + if (doc) + { + ctConfigToolHint hint(NULL, ctSelChanged); + doc->UpdateAllViews(NULL, & hint); + } +} + +void ctConfigTreeCtrl::OnMouseEvent(wxMouseEvent& event) +{ + int flags = 0; + wxTreeItemId item = HitTest(wxPoint(event.GetX(), event.GetY()), flags); + + if (event.LeftDown()) + { + if (flags & wxTREE_HITTEST_ONITEMICON) + { + ctTreeItemData* data = (ctTreeItemData*) GetItemData(item); + ctConfigToolDoc* doc = wxGetApp().GetMainFrame()->GetDocument(); + if (doc) + { + ctConfigToolView* view = wxDynamicCast(doc->GetFirstView(), ctConfigToolView); + if (view) + view->OnIconLeftDown(this, data->GetConfigItem()); + } + } + } + else if (event.RightDown()) + { + if ((flags & wxTREE_HITTEST_ONITEMBUTTON) || + (flags & wxTREE_HITTEST_ONITEMICON) || + (flags & wxTREE_HITTEST_ONITEMINDENT) || + (flags & wxTREE_HITTEST_ONITEMLABEL)) + { + ctTreeItemData* data = (ctTreeItemData*) GetItemData(item); + ctConfigToolDoc* doc = wxGetApp().GetMainFrame()->GetDocument(); + if (doc && data) + { + m_contextItem = data->GetConfigItem(); + PopupMenu(m_contextMenu, event.GetX(), event.GetY()); + } + } + } + + event.Skip(); +} + +void ctConfigTreeCtrl::OnKeyDown(wxKeyEvent& event) +{ + wxTreeItemId id = GetSelection(); + if (event.GetKeyCode() == WXK_SPACE) + { + if (id.IsOk()) + { + ctConfigItem* item = ((ctTreeItemData*) GetItemData(id))->GetConfigItem(); + ctConfigToolDoc* doc = wxGetApp().GetMainFrame()->GetDocument(); + if (doc) + { + ctConfigToolView* view = wxDynamicCast(doc->GetFirstView(), ctConfigToolView); + if (view) + view->OnIconLeftDown(this, item); + } + } + } + else + { + event.Skip(); + } +} + +// Show help for this window +void ctConfigTreeCtrl::OnHelp(wxHelpEvent& event) +{ + wxPoint pt = ScreenToClient(event.GetPosition()); + int flags = 0; + wxTreeItemId id = HitTest(pt, flags); + wxHelpProvider *helpProvider = wxHelpProvider::Get(); + if ( helpProvider && id > 0) + { + ctConfigItem* item = ((ctTreeItemData*) GetItemData(id))->GetConfigItem(); + if (item) + { + wxString helpTopic = item->GetPropertyString(wxT("help-topic")); + if (!helpTopic.IsEmpty()) + { + wxGetApp().GetReferenceHelpController().DisplaySection(helpTopic); + return; + } + } + } + + event.Skip(); +} + +ctTreeItemData::~ctTreeItemData() +{ + if (m_configItem) delete m_configItem; +} + diff --git a/utils/configtool/src/configtree.h b/utils/configtool/src/configtree.h new file mode 100644 index 0000000000..57e7d057e5 --- /dev/null +++ b/utils/configtool/src/configtree.h @@ -0,0 +1,91 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: configtree.h +// Purpose: wxWindows Configuration Tool tree class +// Author: Julian Smart +// Modified by: +// Created: 2003-06-03 +// RCS-ID: $Id$ +// Copyright: (c) Julian Smart +// Licence: +///////////////////////////////////////////////////////////////////////////// + + +#ifndef _CT_CONFIGTREE_H_ +#define _CT_CONFIGTREE_H_ + +#ifdef __GNUG__ +#pragma interface "configtree.cpp" +#endif + +#include "wx/wx.h" +#include "wx/treectrl.h" + +#include "configitem.h" +#include "utils.h" + +/*! + * ctTreeItemData + * Holds the ctConfigItem for each tree item. + */ + +class ctTreeItemData : public wxTreeItemData +{ +public: + ctTreeItemData(ctConfigItem* item) : m_configItem(item) { } + ~ctTreeItemData() ; + + ctConfigItem *GetConfigItem() const { return m_configItem; } + void SetConfigItem(ctConfigItem *item) { m_configItem = item; } + +private: + ctConfigItem* m_configItem; +}; + + +/*! + * ctConfigTreeCtrl + * The options hierarchy viewer. + */ + +class ctConfigTreeCtrl: public wxTreeCtrl +{ + DECLARE_CLASS(ctConfigTreeCtrl) +public: + ctConfigTreeCtrl(wxWindow* parent, wxWindowID id, const wxPoint& pt = wxDefaultPosition, + const wxSize& sz = wxDefaultSize, long style = wxTR_HAS_BUTTONS); + ~ctConfigTreeCtrl(); + +//// Event handlers + void OnMouseEvent(wxMouseEvent& event); + void OnSelChanged(wxTreeEvent& event); + void OnHelp(wxHelpEvent& event); + void OnKeyDown(wxKeyEvent& event); + +//// Accessors + + /// Get the table of icons + wxIconTable& GetIconTable() { return m_iconTable; } + + /// Get the context menu + wxMenu* GetMenu() { return m_contextMenu; } + + /// Get the item associated with the context menu events + ctConfigItem* GetContextItem() { return m_contextItem; } + +//// Operations + + /// Loads the icons. + void LoadIcons(); + +protected: + wxImageList* m_imageList; + wxIconTable m_iconTable; + wxMenu* m_contextMenu; + // The item associated with the context menu events + ctConfigItem* m_contextItem; + + DECLARE_EVENT_TABLE() +}; + +#endif +// _CT_CONFIGTREE_H_ diff --git a/utils/configtool/src/custompropertydialog.cpp b/utils/configtool/src/custompropertydialog.cpp new file mode 100644 index 0000000000..ef631a4474 --- /dev/null +++ b/utils/configtool/src/custompropertydialog.cpp @@ -0,0 +1,261 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: custompropertydialog.cpp +// Purpose: Custom property dialog +// Author: Julian Smart +// Modified by: +// Created: 2003-06-04 +// RCS-ID: $Id$ +// Copyright: (c) Julian Smart +// Licence: +///////////////////////////////////////////////////////////////////////////// + +#ifdef __GNUG__ +#pragma implementation custompropertydialog.h +#endif + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "custompropertydialog.h" + +////@begin XPM images +////@end XPM images + +/*! + * ctCustomPropertyDialog type definition + */ + +IMPLEMENT_CLASS( ctCustomPropertyDialog, wxDialog ) + +/*! + * ctCustomPropertyDialog event table definition + */ + +BEGIN_EVENT_TABLE( ctCustomPropertyDialog, wxDialog ) + +////@begin ctCustomPropertyDialog event table entries + EVT_UPDATE_UI( ID_PROPERTY_CHOICES, ctCustomPropertyDialog::OnUpdatePropertyChoices ) + + EVT_BUTTON( ID_PROPERTY_CHOICE_ADD, ctCustomPropertyDialog::OnPropertyChoiceAdd ) + EVT_UPDATE_UI( ID_PROPERTY_CHOICE_ADD, ctCustomPropertyDialog::OnUpdatePropertyChoiceAdd ) + + EVT_BUTTON( ID_PROPERTY_CHOICE_REMOVE, ctCustomPropertyDialog::OnPropertyChoiceRemove ) + EVT_UPDATE_UI( ID_PROPERTY_CHOICE_REMOVE, ctCustomPropertyDialog::OnUpdatePropertyChoiceRemove ) + +////@end ctCustomPropertyDialog event table entries + +END_EVENT_TABLE() + +/*! + * ctCustomPropertyDialog constructor + */ + +ctCustomPropertyDialog::ctCustomPropertyDialog( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style ) +{ + m_type = wxT("string"); + + wxDialog::Create( parent, id, caption, pos, size, style ); + + CreateControls(); +} + +/*! + * Control creation for ctCustomPropertyDialog + */ + +void ctCustomPropertyDialog::CreateControls() +{ +////@begin ctCustomPropertyDialog content construction + + ctCustomPropertyDialog* item1 = this; + + wxBoxSizer* item2 = new wxBoxSizer(wxVERTICAL); + item1->SetSizer(item2); + item1->SetAutoLayout(TRUE); + + wxBoxSizer* item3 = new wxBoxSizer(wxVERTICAL); + item2->Add(item3, 1, wxGROW|wxALL, 5); + + wxStaticText* item4 = new wxStaticText(item1, wxID_STATIC, _("&Enter name, type and description for your custom property."), wxDefaultPosition, wxDefaultSize, 0); + item3->Add(item4, 0, wxALIGN_LEFT|wxALL|wxADJUST_MINSIZE, 5); + + wxStaticText* item5 = new wxStaticText(item1, wxID_STATIC, _("&Name:"), wxDefaultPosition, wxDefaultSize, 0); + item3->Add(item5, 0, wxALIGN_LEFT|wxALL|wxADJUST_MINSIZE, 5); + + wxTextCtrl* item6 = new wxTextCtrl(item1, ID_CUSTOMPROPERTYNAME, _(""), wxDefaultPosition, wxDefaultSize, 0); + item3->Add(item6, 0, wxGROW|wxALL, 5); + + wxBoxSizer* item7 = new wxBoxSizer(wxHORIZONTAL); + item3->Add(item7, 0, wxGROW, 5); + + wxBoxSizer* item8 = new wxBoxSizer(wxVERTICAL); + item7->Add(item8, 1, wxGROW, 5); + + wxStaticText* item9 = new wxStaticText(item1, wxID_STATIC, _("&Data type:"), wxDefaultPosition, wxDefaultSize, 0); + item8->Add(item9, 0, wxALIGN_LEFT|wxALL|wxADJUST_MINSIZE, 5); + + wxString item10Strings[] = { + _("string"), + _("bool"), + _("double"), + _("long") + }; + wxChoice* item10 = new wxChoice(item1, ID_CUSTOMPROPERTYTYPE, wxDefaultPosition, wxDefaultSize, 4, item10Strings, 0); + item10->SetStringSelection(_("string")); + item8->Add(item10, 1, wxGROW|wxALL, 5); + + wxBoxSizer* item11 = new wxBoxSizer(wxVERTICAL); + item7->Add(item11, 0, wxALIGN_CENTER_VERTICAL, 5); + + wxStaticText* item12 = new wxStaticText(item1, wxID_STATIC, _("&Editor type:"), wxDefaultPosition, wxDefaultSize, 0); + item11->Add(item12, 0, wxALIGN_LEFT|wxALL|wxADJUST_MINSIZE, 5); + + wxString item13Strings[] = { + _("string"), + _("choice"), + _("bool"), + _("float"), + _("integer"), + _("configitems") + }; + wxChoice* item13 = new wxChoice(item1, ID_CUSTOMPROPERTYEDITORTYPE, wxDefaultPosition, wxDefaultSize, 6, item13Strings, 0); + item13->SetStringSelection(_("string")); + item11->Add(item13, 1, wxGROW|wxALL, 5); + + wxStaticBox* item14Static = new wxStaticBox(item1, -1, _("Choices")); + wxStaticBoxSizer* item14 = new wxStaticBoxSizer(item14Static, wxHORIZONTAL); + item3->Add(item14, 0, wxGROW|wxALL, 5); + + wxString* item15Strings = NULL; + wxListBox* item15 = new wxListBox(item1, ID_PROPERTY_CHOICES, wxDefaultPosition, wxDefaultSize, 0, item15Strings, wxLB_SINGLE); + item14->Add(item15, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5); + + wxBoxSizer* item16 = new wxBoxSizer(wxVERTICAL); + item14->Add(item16, 0, wxALIGN_CENTER_VERTICAL, 5); + + wxButton* item17 = new wxButton(item1, ID_PROPERTY_CHOICE_ADD, _("&Add..."), wxDefaultPosition, wxDefaultSize, 0); + item16->Add(item17, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); + + wxButton* item18 = new wxButton(item1, ID_PROPERTY_CHOICE_REMOVE, _("&Remove"), wxDefaultPosition, wxDefaultSize, 0); + item16->Add(item18, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); + + wxStaticText* item19 = new wxStaticText(item1, wxID_STATIC, _("&Description:"), wxDefaultPosition, wxDefaultSize, 0); + item3->Add(item19, 0, wxALIGN_LEFT|wxALL|wxADJUST_MINSIZE, 5); + + wxTextCtrl* item20 = new wxTextCtrl(item1, ID_CUSTOMPROPERTYDESCRIPTION, _(""), wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_RICH); + item3->Add(item20, 1, wxGROW|wxALL, 5); + + wxBoxSizer* item21 = new wxBoxSizer(wxHORIZONTAL); + item3->Add(item21, 0, wxGROW|wxALL, 5); + + item21->Add(5, 5, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5); + + wxButton* item23 = new wxButton(item1, wxID_OK, _("&OK"), wxDefaultPosition, wxDefaultSize, 0); + item21->Add(item23, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + + wxButton* item24 = new wxButton(item1, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxDefaultSize, 0); + item21->Add(item24, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + + wxButton* item25 = new wxButton(item1, wxID_HELP, _("&Help"), wxDefaultPosition, wxDefaultSize, 0); + item21->Add(item25, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + + GetSizer()->Fit(this); + GetSizer()->SetSizeHints(this); + Centre(); +////@end ctCustomPropertyDialog content construction + + // Add validators + FindWindow(ID_CUSTOMPROPERTYNAME)->SetValidator(wxGenericValidator(& m_name)); + FindWindow(ID_CUSTOMPROPERTYTYPE)->SetValidator(wxGenericValidator(& m_type)); + FindWindow(ID_CUSTOMPROPERTYEDITORTYPE)->SetValidator(wxGenericValidator(& m_editorType)); + FindWindow(ID_CUSTOMPROPERTYDESCRIPTION)->SetValidator(wxGenericValidator(& m_description)); +} + +/*! + * Should we show tooltips? + */ + +bool ctCustomPropertyDialog::ShowToolTips() +{ + return TRUE; +} + +/*! + * Update event handler for ID_PROPERTY_CHOICES + */ + +void ctCustomPropertyDialog::OnUpdatePropertyChoices( wxUpdateUIEvent& event ) +{ + wxChoice* choice = (wxChoice* ) FindWindow(ID_CUSTOMPROPERTYTYPE); + event.Enable( choice->GetSelection() > -1 && choice->GetStringSelection() == wxT("choice") ); +} + +/*! + * Event handler for ID_PROPERTY_CHOICE_ADD + */ + +void ctCustomPropertyDialog::OnPropertyChoiceAdd( wxCommandEvent& event ) +{ + wxChoice* choice = (wxChoice* ) FindWindow(ID_CUSTOMPROPERTYTYPE); + if ( choice->GetSelection() > -1 && choice->GetStringSelection() == wxT("choice") ) + { + wxString str = wxGetTextFromUser(_T("New choice"), _("Add choice")); + if (!str.IsEmpty()) + { + wxListBox* listBox = (wxListBox* ) FindWindow(ID_PROPERTY_CHOICES); + listBox->Append(str); + m_choices.Add(str); + } + } +} + +/*! + * Update event handler for ID_PROPERTY_CHOICE_ADD + */ + +void ctCustomPropertyDialog::OnUpdatePropertyChoiceAdd( wxUpdateUIEvent& event ) +{ + wxChoice* choice = (wxChoice* ) FindWindow(ID_CUSTOMPROPERTYEDITORTYPE); + event.Enable( choice->GetSelection() > -1 && choice->GetStringSelection() == wxT("choice") ); +} + +/*! + * Event handler for ID_PROPERTY_CHOICE_REMOVE + */ + +void ctCustomPropertyDialog::OnPropertyChoiceRemove( wxCommandEvent& event ) +{ + wxChoice* choice = (wxChoice* ) FindWindow(ID_CUSTOMPROPERTYEDITORTYPE); + wxListBox* listBox = (wxListBox* ) FindWindow(ID_PROPERTY_CHOICES); + if (listBox->GetSelection() > -1) + { + listBox->Delete(listBox->GetSelection()); + m_choices.Remove(listBox->GetSelection()); + } +} + +/*! + * Update event handler for ID_PROPERTY_CHOICE_REMOVE + */ + +void ctCustomPropertyDialog::OnUpdatePropertyChoiceRemove( wxUpdateUIEvent& event ) +{ + wxChoice* choice = (wxChoice* ) FindWindow(ID_CUSTOMPROPERTYEDITORTYPE); + wxListBox* listBox = (wxListBox* ) FindWindow(ID_PROPERTY_CHOICES); + event.Enable( choice->GetSelection() > -1 && choice->GetStringSelection() == wxT("choice") && + listBox->GetSelection() > -1 ); +} + +void ctCustomPropertyDialog::SetChoices(const wxArrayString& choices) +{ + wxListBox* listBox = (wxListBox* ) FindWindow(ID_PROPERTY_CHOICES); + size_t i, len = choices.GetCount(); + for (i = 0; i < len; i++) + listBox->Append(m_choices[i]); +} diff --git a/utils/configtool/src/custompropertydialog.h b/utils/configtool/src/custompropertydialog.h new file mode 100644 index 0000000000..ffaff8f859 --- /dev/null +++ b/utils/configtool/src/custompropertydialog.h @@ -0,0 +1,113 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: custompropertydialog.h +// Purpose: Custom property dialog +// Author: Julian Smart +// Modified by: +// Created: 2003-06-04 +// RCS-ID: $Id$ +// Copyright: (c) Julian Smart +// Licence: +///////////////////////////////////////////////////////////////////////////// + +#ifndef _CUSTOMPROPERTYDIALOG_H_ +#define _CUSTOMPROPERTYDIALOG_H_ + +#ifdef __GNUG__ +#pragma interface custompropertydialog.cpp +#endif + +/*! + * Includes + */ + +////@begin includes +////@end includes + +/*! + * Forward declarations + */ + +////@begin forward declarations +////@end forward declarations + +/*! + * Control identifiers + */ + +////@begin control identifiers +#define ID_CUSTOMPROPERTYDIALOG 10000 +#define ID_CUSTOMPROPERTYNAME 10003 +#define ID_CUSTOMPROPERTYTYPE 10002 +#define ID_CUSTOMPROPERTYEDITORTYPE 10008 +#define ID_PROPERTY_CHOICES 10001 +#define ID_PROPERTY_CHOICE_ADD 10005 +#define ID_PROPERTY_CHOICE_REMOVE 10006 +#define ID_CUSTOMPROPERTYDESCRIPTION 10004 +////@end control identifiers + +/*! + * ctCustomPropertyDialog class declaration + */ + +class ctCustomPropertyDialog: public wxDialog +{ +public: + /// Constructor + ctCustomPropertyDialog( wxWindow* parent, wxWindowID id = -1, const wxString& caption = _("Edit Custom Property"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU ); + + /// Creates the controls and sizers + void CreateControls(); + +////@begin ctCustomPropertyDialog event handler declarations + + /// Update event handler for ID_PROPERTY_CHOICES + void OnUpdatePropertyChoices( wxUpdateUIEvent& event ); + + /// Event handler for ID_PROPERTY_CHOICE_ADD + void OnPropertyChoiceAdd( wxCommandEvent& event ); + + /// Update event handler for ID_PROPERTY_CHOICE_ADD + void OnUpdatePropertyChoiceAdd( wxUpdateUIEvent& event ); + + /// Event handler for ID_PROPERTY_CHOICE_REMOVE + void OnPropertyChoiceRemove( wxCommandEvent& event ); + + /// Update event handler for ID_PROPERTY_CHOICE_REMOVE + void OnUpdatePropertyChoiceRemove( wxUpdateUIEvent& event ); + +////@end ctCustomPropertyDialog event handler declarations + +////@begin ctCustomPropertyDialog member function declarations + +////@end ctCustomPropertyDialog member function declarations + + /// Should we show tooltips? + static bool ShowToolTips(); + + void SetPropertyName(const wxString& name) { m_name = name; } + wxString GetPropertyName() { return m_name; } + + void SetPropertyType(const wxString& type) { m_type = type; } + wxString GetPropertyType() { return m_type; } + + void SetEditorType(const wxString& type) { m_editorType = type; } + wxString GetEditorType() { return m_editorType; } + + void SetPropertyDescription(const wxString& descr) { m_description = descr; } + wxString GetPropertyDescription() { return m_description; } + + void SetChoices(const wxArrayString& choices) ; + wxArrayString GetChoices() { return m_choices; } + + DECLARE_CLASS( ctCustomPropertyDialog ) + DECLARE_EVENT_TABLE() + + wxString m_name; + wxString m_type; + wxString m_description; + wxString m_editorType; + wxArrayString m_choices; +}; + +#endif + // _CUSTOMPROPERTYDIALOG_H_ diff --git a/utils/configtool/src/htmlparser.cpp b/utils/configtool/src/htmlparser.cpp new file mode 100644 index 0000000000..a07089fb5a --- /dev/null +++ b/utils/configtool/src/htmlparser.cpp @@ -0,0 +1,989 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: htmlparser.cpp +// Purpose: Simple HTML parser +// Author: Julian Smart +// Modified by: +// Created: 2002-09-25 +// RCS-ID: $Id$ +// Copyright: (c) Julian Smart +// Licence: wxWindows license +///////////////////////////////////////////////////////////////////////////// + +// ---------------------------------------------------------------------------- +// headers +// ---------------------------------------------------------------------------- +#ifdef __GNUG__ + #pragma implementation "htmlparser.h" +#endif + +#include "wx/wx.h" + +#ifdef __BORLANDC__ +#pragma hdrstop +#endif + +#include "wx/textfile.h" +#include "wx/wfstream.h" +#include "wx/txtstrm.h" + +#include + +#include "htmlparser.h" + +/// Useful insertion operators for wxOutputStream. +static wxOutputStream& operator <<(wxOutputStream& stream, const wxString& s) +{ + wxTextOutputStream txt(stream); // This is to make sure the line-ending is native! + + txt.WriteString(s); + return stream; +} + +#if 0 // Gives warning because not used... +static wxOutputStream& operator <<(wxOutputStream& stream, long l) +{ + wxString str; + str.Printf("%ld", l); + return stream << str; +} + +static wxOutputStream& operator <<(wxOutputStream& stream, const char c) +{ + wxString str; + str.Printf("%c", c); + return stream << str; +} +#endif // 0 + +/* + * wxSimpleHtmlAttribute + * Representation of an attribute + */ + +wxSimpleHtmlParser::wxSimpleHtmlParser() +{ + m_topLevel = NULL; + m_pos = 0; +} + + +wxSimpleHtmlParser::~wxSimpleHtmlParser() +{ + Clear(); +} + +bool wxSimpleHtmlParser::ParseFile(const wxString& filename) +{ + wxTextFile textFile; + + if (textFile.Open(filename)) + { + wxString text; + wxString line; + int i; + int count = textFile.GetLineCount(); + for (i = 0; i < count; i++) + { + if (i == 0) + line = textFile.GetFirstLine(); + else + line = textFile.GetNextLine(); + + text += line; + if (i != (count - 1)) + text += wxT("\n"); + } + +#if 0 + for ( line = textFile.GetFirstLine(); !textFile.Eof(); line = textFile.GetNextLine() ) + { + text += line; + if (!textFile.Eof()) + text += wxT("\n"); + } +#endif + + return ParseString(text); + } + else + return FALSE; +} + +bool wxSimpleHtmlParser::ParseString(const wxString& str) +{ + Clear(); + + m_pos = 0; + m_text = str; + m_length = str.Length(); + + m_topLevel = new wxSimpleHtmlTag(wxT("TOPLEVEL"), wxSimpleHtmlTag_TopLevel); + + bool bResult = ParseHtml(m_topLevel); + + wxASSERT(bResult); // Failed to parse the TAGs. + // Hint: Check if every open tag has a close tag! + + return bResult; +} + +// Main recursive parsing function +bool wxSimpleHtmlParser::ParseHtml(wxSimpleHtmlTag* parent) +{ + if (!parent) + return FALSE; + + while (!Eof()) + { + EatWhitespace(); + if (IsComment()) + { + ParseComment(); + } + else if (IsDirective()) + { + wxSimpleHtmlTag* tag = ParseDirective(); + if (tag) + parent->AppendTag(tag); + } + else if (IsXMLDeclaration()) + { + wxSimpleHtmlTag* tag = ParseXMLDeclaration(); + if (tag) + parent->AppendTag(tag); + } + else if (IsTagClose()) + { + wxSimpleHtmlTag* tag = ParseTagClose(); + if (tag) + { + if (IsCloseTagNeeded(tag->GetName())) + { + if (!parent->GetParent()) + return FALSE; + parent->GetParent()->AppendTag(tag); + return TRUE; + } + else + parent->AppendTag(tag); + } + } + else if (IsTagStartBracket(GetChar(m_pos))) + { + wxSimpleHtmlTag* tag = ParseTagHeader(); + if (tag) + parent->AppendTag(tag); + + if (IsCloseTagNeeded(tag->GetName())) + { + if (!ParseHtml(tag)) + return FALSE; // Something didn't go ok, so don't continue. + } + } + else + { + // Just a text string + wxString text; + ParseText(text); + + wxSimpleHtmlTag* tag = new wxSimpleHtmlTag(wxT("TEXT"), wxSimpleHtmlTag_Text); + tag->SetText(text); + if(parent->GetParent()) + parent->GetParent()->AppendTag(tag); + else + parent->AppendTag(tag); // When this occurs it is probably the + // empty lines at the end of the file... + } + } + return TRUE; +} + +// Plain text, up until an angled bracket +bool wxSimpleHtmlParser::ParseText(wxString& text) +{ + while (!Eof() && GetChar(m_pos) != wxT('<')) + { + text += GetChar(m_pos); + m_pos ++; + } + DecodeSpecialChars(text); + return TRUE; +} + +wxSimpleHtmlTag* wxSimpleHtmlParser::ParseTagHeader() +{ + if (IsTagStartBracket(GetChar(m_pos))) + { + m_pos ++; + EatWhitespace(); + + wxString word; + ReadWord(word, TRUE); + + EatWhitespace(); + + wxSimpleHtmlTag* tag = new wxSimpleHtmlTag(word, wxSimpleHtmlTag_Open); + + ParseAttributes(tag); + + EatWhitespace(); + + if (IsTagEndBracket(GetChar(m_pos))) + m_pos ++; + + return tag; + } + else + return NULL; +} + +wxSimpleHtmlTag* wxSimpleHtmlParser::ParseTagClose() +{ + Matches(wxT(" + while (!IsTagEndBracket(GetChar(m_pos)) && !Eof()) + { + EatWhitespace(); + + wxString attrName, attrValue; + + if (IsString()) + { + ReadString(attrName, TRUE); + tag->AppendAttribute(attrName, wxEmptyString); + } + else if (IsNumeric(GetChar(m_pos))) + { + ReadNumber(attrName, TRUE); + tag->AppendAttribute(attrName, wxEmptyString); + } + else + { + // Try to read an attribute name/value pair, or at least a name + // without the value + ReadLiteral(attrName, TRUE); + EatWhitespace(); + + if (GetChar(m_pos) == wxT('=')) + { + m_pos ++; + EatWhitespace(); + + if (IsString()) + ReadString(attrValue, TRUE); + else if (!Eof() && !IsTagEndBracket(GetChar(m_pos))) + ReadLiteral(attrValue, TRUE); + } + if (!attrName.IsEmpty()) + tag->AppendAttribute(attrName, attrValue); + } + } + return TRUE; +} + +// e.g. +wxSimpleHtmlTag* wxSimpleHtmlParser::ParseDirective() +{ + Matches(wxT(" +wxSimpleHtmlTag* wxSimpleHtmlParser::ParseXMLDeclaration() +{ + Matches(wxT(""), TRUE)) + { + m_pos ++; + } + + return TRUE; +} + +bool wxSimpleHtmlParser::EatWhitespace() +{ + while (!Eof() && IsWhitespace(GetChar(m_pos))) + m_pos ++; + return TRUE; +} + +bool wxSimpleHtmlParser::EatWhitespace(int& pos) +{ + while (!Eof(pos) && IsWhitespace(GetChar(pos))) + pos ++; + return TRUE; +} + +bool wxSimpleHtmlParser::ReadString(wxString& str, bool eatIt) +{ + int pos = m_pos; + if (GetChar(pos) == (int) '"') + { + pos ++; + while (!Eof(pos) && GetChar(pos) != (int) '"') + { + // TODO: how are quotes escaped in HTML? + str += (wxChar) GetChar(pos); + pos ++; + } + if (GetChar(pos) == (int) '"') + pos ++; + if (eatIt) + m_pos = pos; + DecodeSpecialChars(str); + return TRUE; + } + else + return FALSE; +} + +bool wxSimpleHtmlParser::ReadWord(wxString& str, bool eatIt) +{ + int pos = m_pos; + + if (!IsAlpha(GetChar(pos))) + return FALSE; + + str += (wxChar) GetChar(pos) ; + pos ++; + + while (!Eof(pos) && IsWordChar(GetChar(pos))) + { + str += (wxChar) GetChar(pos); + pos ++; + } + if (eatIt) + m_pos = pos; + DecodeSpecialChars(str); + return TRUE; +} + +bool wxSimpleHtmlParser::ReadNumber(wxString& str, bool eatIt) +{ + int pos = m_pos; + + if (!IsNumeric(GetChar(pos))) + return FALSE; + + str += (wxChar) GetChar(pos) ; + pos ++; + + while (!Eof(pos) && IsNumeric(GetChar(pos))) + { + str += (wxChar) GetChar(pos); + pos ++; + } + if (eatIt) + m_pos = pos; + DecodeSpecialChars(str); + return TRUE; +} + +// Could be number, string, whatever, but read up until whitespace or end of tag (but not a quoted string) +bool wxSimpleHtmlParser::ReadLiteral(wxString& str, bool eatIt) +{ + int pos = m_pos; + + while (!Eof(pos) && !IsWhitespace(GetChar(pos)) && !IsTagEndBracket(GetChar(pos)) && GetChar(pos) != wxT('=')) + { + str += GetChar(pos); + pos ++; + } + if (eatIt) + m_pos = pos; + DecodeSpecialChars(str); + return TRUE; +} + +bool wxSimpleHtmlParser::IsComment() +{ + return Matches(wxT("