All of these examples are included in the OWLNext code repository with full source code. You can find more examples on the old web site, but note that these are old projects and may not be compatible with the latest OWLNext version out of the box. Another excellent source of relatively recent examples and useful OWLNext components is Mohsen Jahanshahi's OWLNext page. See Links for further sources of OWLNext examples and code.
The following code implements a minimal OWL application. When run it should show an empty window with the title "Hello World!".
#include <owl/applicat.h>
int OwlMain(int, owl::tchar* []) // argc, argv
{
return owl::TApplication(_T("Hello World!")).Run();
}
OWLMaker is our build tool, itself written in OWLNext. It is by far the most comprehensive example of modern OWLNext and C++ programming in our code base. It demonstrates the use of many OWL classes, including TMDIClient, TTabbedWindow, TPropertySheet, TTreeViewCtrl, TListViewCtrl, TTransferWindow (using the Dialog Data Transfer framework), TSysLink, TModuleVersionInfo and TSystem. The TCoolEdit class in the CoolPrj extension library is used to provide a syntax highlighting code editor within OWLMaker itself.
OWLMaker is also an asynchronous application that launches multiple worker threads to execute build commands in parallel. As such, it serves as an example of how to write OWLNext applications that remain responsive while performing time-consuming tasks, and how to use multi-threading simply and safely with OWLNext. For more details, see Multi-threading and OWLNext.
No matter how large hard disk drive you have, over time it fills up and you need to clean it. To do that effectivly, you need to easily know how much disk space each folder and subfolder occupies.
FolderSize is a tool that scans recursively the selected folder and calculates the total size of all files. Then the folder tree is displayed in the left pane with color coding and sizes. Clicking on a folder will display the files from it in the right pane and on a separate tab are displayed statistics of file sizes grouped by type.
The goal of the example is to demonstrate combining modern C++ features like std::filesystem and std::async with classic Explorer-like UI built up with the OWLNext classes TTreeViewCtrl, TListViewCtrl and others.
The processing of the subfolders is done in a background thread, and the UI is updated periodically, in order to keep it responsive. The tree view nodes are populated on demand - when expanded - to improve performance.
The example is also published in the Microsoft Store (by Shapeshift Ltd.) to demonstrate how an OWLNext desktop application can be packaged and distributed.
Razee is a simple dice game, similar to Yahtzee, but played with 6 dice and with a scoreboard without the boring upper part of Yahtzee (that is where the name comes from; a razee is a ship without the upper deck). Razee is played against the clock in one of three modes — easy, hard or mean — giving you a decreasing amount of time to complete the scoreboard. The game comes with a high-score list, and it even reads out the game instructions to you aloud in a friendly voice (using Microsoft's built-in speech synthesis).
This neat search-and-replace tool recurses files and folders matching the given filters. It also can perform a similarly recursive touch operation on files, i.e. changing file date and time. Replace Plus supports command-line parameters, so it can be called from a batch file, in which case it will not display the GUI. Replace Plus demonstrates use of the following OWLNext classes:
Browse the Replace Plus source
This small application is a converted Borland C++ 5.02 example. The original version implemented a clock that played a chime every hour and showed an animated cuckoo at midnight. It should've been an owl, shouldn't it? Well, now it is! The latest version on the trunk is much improved. It even speaks the time and reminds you about your pizza.
Browse the Animated Clock source
This example shows you how to use OWLNext and TModule to implement and encapsulate a DLL. It shows you how to control resource loading, and various ways to design the DLL API; from exposing a TDialog derived class, to a fully decoupled C-compatible interface hiding the OWLNext dependency of the implementation. See the FAQ for some tips on using DLLs and compartmentalisation to mix modules using OWLNext with modules created with other frameworks.
VCL2OWL is based on an article by Kent Reisdorph, and demonstrates how to link a VCL application with an OWLNext dialog. The idea is to use a unit for each OWL Dialog. When calling the OWL dialog a window object is created by aliasing the interface element handle from the VCL form. The form itself is used as the parent window. Notes:
These previously separate examples are now consolidated into a single project.
Select Examples | TBitmapView from the Classes main menu.
This small application is a converted Borland C++ 5.02 example. It implements a simple bitmap viewer that can display bitmaps loaded from a file or from a resource.
Select Examples | Transfer from the Classes main menu.
This test project exercises the new dialog data transfer (DDT) framework introduced in OWLNext 6.32. This framework is very similar to the DDX framework in MFC (Microsoft Foundation Classes). See Dialog Data Transfer for more information.
Select Examples | Dialog Data Transfer from the Classes main menu.
This example demonstrates different programming styles and frameworks for transferring data to and from controls. A simple search dialog is used as a demonstration case. There are two accompanying articles that use this example as a case study:
Select Examples | TransferBuffer from the Classes main menu.
This test project exercises the new safe transfer buffer features introduced in OWLNext 6.32. These features aim to provide safety for legacy code that uses the old error-prone transfer buffers promoted by OWL. Note that transfer buffers are deprecated. New code should use the DDT framework. See Safe Transfer Buffers for more information.
Select Examples | TTabbedWindow from the Classes main menu.
This example exercises TTabbedWindow and especially the TNoteTab control. The latter is a custom control that provides a tabbed interface at the bottom of a window. The original OWL 5 implementation has been comprehensibly overhauled, and TNoteTab can now draw in many styles, including the classic style, flat style and modern themed style. Most of its properties, such as font, dimensions and colours, are customisable.
Select Examples | TColumnHeaderDlg from the Classes main menu.
This example demonstrates the use of a TColumnHeader control below a TListViewCtrl to provide a summary footer for the list view.
Select Examples | TValidate from the Classes main menu.
This simple example demonstrates the use of the TValidator-derived classes (TFilterValidator, TPictureValidator and TRangeValidator) to validate input in dialog boxes.
Select Examples | Controls from the Classes main menu.
The XP Themes sample demonstrates how to use the themed visual style introduced in Windows XP in an OWLNext application. This entails embedding a manifest in the application, instructing Windows to use version 6 of the Common Controls library. Without such a manifest, the application will use the old control library with the classic chiseled 3D style (Windows 95).
Discussion: facing issues in OWLNext 6.43.
Discussion: facing issues in OWLNext 6.43.
Discussion: Using smart pointers in OWLNext 7
Discussion: OWL_Slider WndProc
Discussion: Array replacement
Discussion: Array replacement
Discussion: owl-630-v10-tu.lib Build Errors
Discussion: OWLNext 7 and Windows 7
Wiki: Dialog_Data_Transfer
Wiki: Frequently_Asked_Questions
Wiki: Installing_OWLNext
Wiki: Installing_OWLNext_from_the_Code_Repository
Wiki: Links
Wiki: Main_Page
Wiki: Making_an_application_Unicode-ready
Wiki: Multi-threading_and_OWLNext
Wiki: OWLMaker
Wiki: Packaging OWLNext application for Windows Store
Wiki: Safe_Transfer_Buffers