Files
wxWidgets/misc/schema
Bill SuandVadim Zeitlin d18d35523d
Unix builds / Ubuntu 24.04 wxGTK with ASAN (push) Has been cancelled
Unix builds / Ubuntu 18.04 wxGTK 3 compatible 3.0 (push) Has been cancelled
Unix builds / Ubuntu 18.04 wxGTK UTF-8 (push) Has been cancelled
Unix builds / Ubuntu 18.04 wxQt (push) Has been cancelled
Unix builds / Ubuntu 18.04 wxX11 (push) Has been cancelled
Unix builds / Ubuntu 20.04 wxGTK 3 with clang (push) Has been cancelled
Unix builds / Ubuntu 22.04 wxGTK with wx containers (push) Has been cancelled
Unix builds / Ubuntu 24.04 wxGTK with UBSAN (push) Has been cancelled
Unix builds / Ubuntu 18.04 wxDFB (push) Has been cancelled
Unix builds / Ubuntu 18.04 wxGTK 3 static with gcc 4.8 (push) Has been cancelled
Unix builds / Ubuntu 18.04 wxGTK 2 (push) Has been cancelled
CMake builds / Ubuntu 22.04 wxGTK 3 (push) Has been cancelled
CMake builds / MSW/MSVC wxMSW (push) Has been cancelled
CMake builds / MSW/Clang wxMSW (push) Has been cancelled
CMake builds / macOS latest wxOSX Ninja (push) Has been cancelled
CMake builds / macOS 14 wxOSX Xcode (push) Has been cancelled
CMake builds / macOS 14 wxIOS (push) Has been cancelled
CMake builds / MSW/MSVC wxQt 5.15 (push) Has been cancelled
CMake builds / MSW/MSVC wxQt 6.8 (push) Has been cancelled
Mac builds / wxMac Universal C++14 (push) Has been cancelled
Mac builds / wxMac ARM with ASAN (push) Has been cancelled
Mac builds / wxiOS (push) Has been cancelled
Mac builds / wxMac Intel C++17 (push) Has been cancelled
Mac Xcode builds / iOS Simulator static (push) Has been cancelled
Mac Xcode builds / macOS dynamic Release (push) Has been cancelled
Mac Xcode builds / iOS static Debug (push) Has been cancelled
MSW builds / wxMSW vs2022 DLL Debug x64 (push) Has been cancelled
MSW builds / wxMSW vs2022 DLL Release x64 (push) Has been cancelled
MSW builds / wxMSW vs2022 Debug Win32 (push) Has been cancelled
MSW builds / wxMSW vs2022 Release arm64 (push) Has been cancelled
MSW cross-builds / wxMSW 64 bits (push) Has been cancelled
MSW cross-builds / wxMSW/Univ (push) Has been cancelled
MSW cross-builds / wxMSW 32 bits (push) Has been cancelled
Code Checks / Check Spelling (push) Has been cancelled
Code Checks / Check Whitespace (push) Has been cancelled
Code Checks / Check Mixed EOL (push) Has been cancelled
Code Checks / Check C++ Style (push) Has been cancelled
Code Checks / Check All Headers In allheaders.h (push) Has been cancelled
Update Documentation / Update Online Documentation (push) Has been cancelled
No Response / no-response (push) Has been cancelled
Add wxAuiPaneInfo::FloatingClientSize()
Using wxWindow::SetClientSize() can be more convenient than using
wxWindow::SetSize() and is guaranteed to work under all platforms, even
when the window decorations size may be unknown, so allow setting the
client size of floating wxAUI panes directly too.

Closes #25483.
2025-06-26 12:55:09 +02:00
..

                      Schema for Validation of XRC files
                      ==================================

0. Overview
-----------

The files in this directory allow you to check correctness of the XRC files by
verifying that their contents conforms to wxWidgets XRC schema. Doing this is a
good way to detect some common errors in manually-written XRC files, even
though it doesn't currently detect all the possible errors.


1. Installation
---------------

To use them, you need to install Jing, a RELAX NG validator, on your system.
Jing is available from http://www.thaiopensource.com/relaxng/jing.html and is a
Java program, so it requires a working Java Runtime Environment installation.

If you are using Windows and already have a working JRE, you can download Jing
packaged as a Windows executable from

    http://sourceforge.net/projects/wxwindows/files/tools/jing.zip/download


2. Usage
--------

Once you have a working version of Jing, you can use it directly as following:

    jing -c http://www.wxwidgets.org/wxxrc your-file.xrc

Alternatively, you can also use wxrc --validate or --validate-only options:

    wxrc --validate-only your-file.xrc

(notice that this still requires jing to be installed).


3. Customization
----------------

Using xrc_schema.rnc only validates the standard wxWidgets classes and skips
any custom ones, for which you might have your own XRC handlers defined. If
you don't use any custom XRC handlers at all, you may prefer to use
xrc_schema_builtin_only.rnc schema instead of xrc_schema.rnc which won't accept
any non-standard classes at all -- this is useful for detecting any typos.

If you do use your own custom classes, then you need to define your own
validations rules for them. Please see comments in xrc_schema.rnc for more
details about how to do it, but here is a motivating example showing that it is
not too difficult to validate your own classes:

    #
    # RELAX NG schema for extended XRC with support for custom handlers.
    #

    default namespace = "http://www.wxwidgets.org/wxxrc"
    namespace xrc = "http://www.wxwidgets.org/wxxrc"

    include "http://www.wxwidgets.org/wxxrc" {
        customClasses = RoundingButtons | InputSequenceEntry
    }

    # Simplest possible example: no special properties for this handler.
    RoundingButtons =
        element object {
            attribute class { "RoundingButtons" } &
            stdObjectNodeAttributes &
            stdWindowProperties
        }

    # This handler has an optional property called "title" containing text.
    InputSequenceEntry =
        element object {
            attribute class { "InputSequenceEntry" } &
            stdObjectNodeAttributes &
            stdWindowProperties &
            [xrc:p="o"] element title {_, t_text }*
        }


To use a custom schema, you need to pass the full path to the local file
containing it to Jing or use wxrc --xrc-schema command line option, so you
could do, for example:

    jing -c $(WXWIN)/misc/schema/xrc_schema_builtin_only.rnc your-file.xrc

or

    wxrc --validate-only --xrc-schema=my_custom.rnc your-file.xrc