OWLNext 7.0
Borland's Object Windows Library for the modern age
|
Accessing application objects | You might need to access an application object from outside that object's scope |
Finding the object | To find the current application object from a window object, TWindow has a member function, TWindow::GetApplication(), that returns a pointer to the application object |
Creating a small application | Here's the smallest application you can create |
Using WinMain and OwlMain | ObjectWindows provides a default WinMain function that provides extensive error checking and exception handling |
▼About command enabling | ObjectWindows provides a mechanism, command enabling, that you can use to dynamically change the appearance of controls to indicate if a feature is available or to indicate the state of the application |
Handling command-enabling messages | The basic idea behind command enabling is that the decision to enable or disable a function should be made by the object that handles the command |
▼Working with command-enabling | If you receive a command-enabling message and the handler function was called, you can perform actions using the command-enabling object passed to the handler function |
TCommandEnabler: The command-enabling interface | Although in command-enabling functions you always manipulate an object derived from TCommandEnabler as opposed to an actual TCommandEnabler object, in practice it appears as if you are working with a TCommandEnabler object |
▼Common command-enabling tasks | This section describes how to perform some of the more common tasks for which you'll use command enabling, including |
Enabling and disabling command items | Enabling and disabling command items is as simple as calling the TCommandEnabler::Enable() function in your handler function |
Changing menu item text | You use the SetText function to specify the text of a menu item |
Toggling command items | You can use command-item toggling to provide the users of your applications visual cues about what functions are enabled, various application states, and so on |
▼ObjectWindows Exception Handling | ObjectWindows provides a robust exception-handling mechanism for dealing with exceptional situations |
ObjectWindows Exception Hierarchy | ObjectWindows provides a number of classes that can be thrown as exceptions |
▼Working with TXBase | As the base class for the ObjectWindows exception classes, TXBase provides the basic interface for working with ObjectWindows exceptions |
Constructing and Destroying TXBase | TXBase provides two public constructors: |
Cloning Exception Objects | TXBase contains a function called TXBase::Clone() |
Throwing TXBase Exceptions | After you have created or cloned a TXBase object, you can throw the object in two ways: |
▼Working with TXOwl | As the base class for the ObjectWindows exception classes, TXOwl provides the basic interface for working with ObjectWindows exceptions |
Constructing and Destroying TXOwl | TXOwl has two constructors to provide flexibility in passing the exception message string: |
Cloning TXOwl and TXOwl-Derived Exception Objects | TXOwl contains a Clone function |
Specialized ObjectWindows Exception Classes | A number of regular ObjectWindows classes implement specialized exception classes, all of which are based on TXOwl that are defined within the implementing class definition to provide name scoping |
Todo List |