Samples Overview

The samples on this page might give you an idea of the capabilities of wxArt2D. Their sources are in wxArt2D\samples. So you have a starting point on how to implement the features you need.

editor module samples

vdrawm

Is the most advanged example. It sets up a multi document drawing program. And has a menu of screens which demo all drawing features<br> of the library. You can open files in SVG, CVG and GDSII format. You can draw and edit all kinds of primitives. Each new drawing gets its own drawing editor complete with undo redo. There are dialogs to set style for drawing primitives. For many features there is a menu to test it.<br> You can create multiple views on a document via the main window its file open icons, and see how all view are updated when drawing things.<br> The screen are all created by program code, so if you need to know how to fill a drawing document using program code, look at the specific screen<br> its code.

vdrawm sample

vdraws

Instead of a multiple view and document drawing program, this sample shows how to make a single view but multiple document drawing program.

sample

wires

sample sample sample sample

viewmul

The basis for a multiple view and document drawing program is shown. You can create drawings with rectangles in a specific style using the draw rectangle tool. After drawing you can edit and drag the rectangles around. You can save and open the drawings you create. The document used is not a default wxCanvasDocument, but a derived one with its own saving and loading methods. The same for the views new view connector are created, which  are used to create application specific views for the documents.

tuto4

A single window application, showing how to fill a derived wxCanvas its document with objects. The derived canvas class creates a stack based toolcontroller  in order to have the default zoom and dragtools available. It aslo set the canvas to have the Yaxis pointing up. It shows you how to set up scroll bars and drawing size mapping. The canvas intercepts some events to automatically zoomout at startup and when resizing the canvas window, the drawing fits the new size. The document contains the special wxCanvasXYDisplayGroup to contain some curve objects and markers on those curves.

sample

tuto3

This sample sets up a wxCanvas window with mapping and scrolling. And set a toolcontroller for zooming and dragging. Its fill the document with drawing objects in order to have the canvas display the sin(x)/x function plus a ticed y and x axis with text at each tic. You can zoom and in and out using the popup menu. And you can drag parts of the drawing around. This sample uses plaind basic drawing primitives to fill a document, and to show this to the user in a flexible zoomable manner. It does not create advanged objects from basic objects to achieve this, and also does not use advanged curve object to achieve the same more easily. For use of advanged objects look at tuto4.

vdraws sample

tuto

This sample sets up a wxCanvas window with mapping and scrolling. And set a toolcontroller for zooming and dragging. It also creates a derived circle object, with special style and added text property and its property display object. It intercepts wxCanvasObject events to display some properties, when the mouse hits the object.

single2

single

editmdi

vdraws sample

canvas module samples

simple

Two smilies walking across vertical lines using a times and a wxWidgets button on top.

sample

split

Two smilies walking across vertical lines using a timer, and three wxCanvasWidgetButton's in a wxCanvasWidgetButtonGroup.<br>

vdraws sample

canmdi

Mdi application using docview module. Like editmdi sample, but not using tools from the editor module.

cansim

boolop

Sample to demo the use of the boolean operation module kbool, and how to use the wxBooleanWalkerHandler and wxDocviewWalkerIOHandler to perform boolean operation on a wxCanvasDocument its wxCanavsObjects. wxDocviewWalkerIOHandler is a base class for interating through a wxCanvasDocument, it allows you te write algorithms for wxCanvasDocument, without the need to extend the library itself.

sample

curves module samples

curtuto1

Display different curves types in curve groups. Marker objects and marker show objects are used to display values at certain points on the curves. Deep edit can be used to edit the curves one by one, and one can zoom into a curve group. The Curve markers can be dragged along the curves.<br> The titles of the curve plot can be edited. The showmarker objects can be edited to move markers. Several tools can be pushed on the tools stack in order to draw on the curves/canvas and to add text. In that sence this sample is just a graphics editor that also displays some curve objects. The whole drawing can be saved and loaded back in CVG format.

sample sample

aggdrawer module samples

tutoagg

sample

docview module samples

This samples do only use the docview module, and although they do draw something, the canvas and editor module are not involved. The examples multiframe, singleframe, splitwin, multiwin use one and the same editor class and 3 view classes. The singleframe is actually a combination of single switch views in one frame, and view generating new frames and window. Splitwin has a single frame with a splitter window which can have attached views.<br> MultiWin is an experiment, it has moveable window in a frame ( sort of MDI like thing ). The Nonmanaged example show how the docview classes can be used without a docmanager.

MultiFrame

Multiframe demonstrates the use of wxViewConnector to generate frames with a view.

sample

SingleFrame

A single frame, meaning documents are opened in a single frame window, but still other frames can be generated. In principle there is no need for a single frame specific setting. It is just a matter of allowing the user to generate extra frames or not.

sample

Splitwin

The use of a wxSplitterWindow to have seperate wxViewRef's in each wxWindow of the splitter.

sample

TabFrame

How to use a wxNoteBook as a container for wxView's plus its display Windows. One Tab contains the drawing and the other a statistics view of colors and objects used.

sample sample

mdi

mdi application showing two open documents with several views.

sample

nonmanaged

Application Overview

For the moment there is only one application called teto, its goal is a multi document drawing application.