jsComboBoxEx and jsSysComboBox Design and Description

The following is a brief description of basic overall operation and design of the jsComboBoxEx dBL class. Because the jsSysComboBox class is a subclass of the jsComboBoxEx class, this description also applies to the jsSysComboBox class. Don't worry if you don't clearly understand what is described. Simply read it for purposes of 'awareness'. Much of the following will become clearer as you become familiar with using jsComboBoxEx. In reality, jsComboBoxEx is quite simple to use. What follows is a small attempt to satisfy those who want to know 'just a bit more'.

At design time in the Form Designer, jsComboBoxEx consists of a single PaintBox subclass. It can be placed on a Form, a SubForm, a Container, or a NoteBook. Simply ensure that the form's metric property is set to 6 - Pixels, select the jsComboBoxEx class on the Component Palette, and drop it anywhere on the Form, Container, or NoteBook, or instantiate it as you would any other class within a SubForm. The form.metric property *must* be set to 6 - Pixels for proper function of jsComboBoxEx at runtime. The form.metric setting is checked at runtime in jsComboBoxEx.onOpen and if form.metric # 6, the jsComboBoxEx object will release itself.

At runtime, a jsComboBoxEx object is really a cluster of 2 objects - a PaintBox and a ComboBoxEx window. During onOpen, jsComboBoxEx creates a ComboBoxEx window which is parented to the jsComboBoxEx PaintBox and positioned and sized the same as the jsComboBoxEx object. In effect, we now have 2 objects stacked directly on top of each other. At the bottom, directly on the surface of the form or container, is the jsComboBoxEx PaintBox. On top is the ComboBoxEx window.

Also during OnOpen, The appropriate message hooks are set between the ComboBoxEx window and the jsComboBoxEx PaintBox which allows all mouse and keyboard input received by the ComboBoxEx window to be passed forward to the jsComboBoxEx PaintBox. This allows the jsComboBoxEx dBL PaintBox object to directly receive mouse click and move messages and keyboard messages. Hooks are also set to allow the jsComboBoxEx PaintBox to receive notification messages from the ComboBoxEx window. These notification messages indicate user actions such as when the user selects an item. The jsComboBoxEx class receives the ComboBoxEx notifications through the OnMiddleMouseUp event, filters the notification message values, and fires custom events, which allows the dBL developer the ability to respond to events which occur in the ComboBoxEx window.

The remaining function of the jsComboBoxEx object is to serve as the dBL 'bridge' between the application dBL code and the ComboBoxEx window via the windows API. Through many properties and methods, the advanced functionality of the ComboBoxEx window can be directly exploited using relatively simple dBL application code. To understand 'why' there are so many properties and methods in jsComboBoxEx and to understand how to best use and take full advantage of jsComboBoxEx, it would help to first understand some basic terminology and the underlying ComboBoxEx technology.

The ComboBoxEx window is a message-based window rather than a function-based window. All ComboBoxEx functionality is implemented via messages sent to the ComboBoxEx window. Some of these messages use complex data structures to pass information to and from the ComboBoxEx window. The jsComboBoxEx class implements methods (functions) which provide wrappers for the messages and structures. Each method encapsulates a specific message supported by the ComboBoxEx window by creating and filling any necessary data structures, sending the appropriate message to the ComboBoxEx window, and then retrieving any returned data as necessary from the associated data structures, and setting values to appropriate properties of the jsComboBoxEx object as necessary for subsequent use in dBL code.

Because the jsComboBoxEx class is, in the most simple definition, a dBL 'wrapper' for the operating system's ComboBoxEx window class, the most authoritative resource for information regarding ComboBoxEx technology, operation, and reference can be found at MSDN online under Individual Control Reference. Also, be sure to search MSDN for other information and examples of using ComboBoxEx.

But most of all, be sure to read the remaining jsComboBoxEx documentation. And review the dBL sample forms included with the jsComboBoxEx package to become more familiar with how jsComboBoxEx can be used in dBL applications.