Artistic Style Wx

A Graphical User Interface for Artistic Style
Using wxWidgets

Project Page: http://astyle.sourceforge.net/astylewx/
SourceForge: https://sourceforge.net/projects/astylewx.astyle.p/

 

Artistic Style Wx (AStyleWx) was developed as a Graphical User Interface test program for Artistic Style. It is licensed under the MIT license and built using wxWidgets version 3 or higher. It will run on Windows, Linux, or Mac. The source code is available to be used and modified for any purpose you choose. Developers using Artistic Style in another project may use any part of AStyleWx in their project. The modified source code does NOT need to be made available to others.

A compiled version of wxWidgets must be available for compiling and running AStyleWx. The Install Information page has instructions for setting up wxWidgets and compiling the AStyleWx source code. A Visual Studio Static Compile page has instructions for setting up the static compile that uses a static runtime library, no exception handling, and no runtime type information (RTTI).

The latest development files can be checked out from the Artistic Style repository using Subversion. Files for the latest release can be downloaded from the Files section on the AStyleWx SourceForge page. The Windows package contains a compiled binary. Other platforms will need to compile the source code. Makefiles are included for the most popular compilers. Follow the install instructions for the appropriate platform as described in the "Install Information" page.

Links

Install Information

Visual Studio Static Compile

Release Notes

RAD Tools for Dialogs

The Rapid Application Development (RAD) tool used to design the AStyleWx dialog interfaces is wxFormBuilder. It allows separation of the generated and written code by using inheritance. I prefer this to having the code combined in the same source file as it seems like a safer way to do it. The wxFormBuilder files and the generated source code are in the AStyleWx "dialog" folder.

The most current wxFormBuilder repository is available at GitHub. The version at SourceForge is an older version. Linux users may need to compile it from source. There are more up to date builds available in the Git repository if you want to use them.

To compile the Linux build, open a terminal in the top wxFormBuilder directory.

cmake CMakeLists.txt 
make 
sudo make install

You may need to create a menu item after the install.

Another RAD tool that will work, with modifications, is wxCrafter. It has a GUI similar to wxFormBuilder and generates code in a similar manner. It expects the generated code to be used as a base class. It does not convert the wxStyledTextCtrl, which will need to be rebuilt. It is being maintained so it may be a better choice. It can import an XRC file from any RAD application that will generate one.

Book Classes for Dialogs

wxFormBuilder generates wxNotebook (not wxAuiNotebook) controls for the Editor and AStyle dialog windows. It uses tabs to change the dialog pages. AStyleWx makes use of the base class wxBookCtrl so the "book" class can be converted to wxChoiceBook, wxListBook, or wxTreeBook controls. This is done using the script "to_xxbook.py". This is a Python script available in the "file-py" folder. You must have Python installed to run it. In the script change the variable "__new_book" to the value of the desired book control and run the script. When recompiled, the dialogs will display the new wxWidgets book control. The main window is NOT changed.

Main Window

The main window for Artistic Style Wx does NOT use a RAD. It is created by written, not generated, code. The controls are sized by the source code, not by wxWidgets sizers. The notebook control is actually a wxAuiNotebook which allows the user to rearrange the tab order using drag-and-drop.

Most status bar fields can be left-clicked for a menu or various other information. This is not documented so try it to see what information is displayed.

The Help, About, dialog displays the Artistic Style and wxWidgets versions used in the build. The information can also be displayed by clicking on the Encoding status bar field on the main window. This field will be empty if the system encoding is used.