NG DialogPack Guide


Overview


LMD NG-DialogPack is a part of Next Generation (NG) package suite. All these packages are based on new IDE and language features of latest Delphi IDE versions.

 

NG-DialogPack is based on the features provided by Microsoft Windows Vista Task Dialog API, which allows to create and show Windows Vista (Windows 7) like dialogs. The package extends platform API with emulation mode, which allows to use NG-DialogPack components in previous OS versions, such as Windows XP. Also, emulation mode provides additional features, such as Input Dialog, which has no analog in platform API.

 

Following is a simple example of the task dialog:

 

clip0001

 

Features

 

NG-DialogPack package contains tree major components:

 

TNGTaskDialog component allows to configure and show Windows Vista (Windows 7) like task dialogs. Task dialog can contain:

o Caption, Title and Content texts.

oMainIcon, which can be one of the standard icons, like Information, Warning, Error, ect.; or a custom icon.

oStandard buttons, such as Ok, Cancel, Yes, No, Retry, ect; or a custom buttons, with custom Caption, ModalResult and Enabled state, configurable by the user. There is the ability to show custom buttons as command links, supporting CommandLinkHint feature.

oRadio buttons with Caption and Enabled state configurable by the user.

oProgress bar with various configurable properties, such as Min, Max and Position.

oExpandable additional information text with expand/collapse button.

oVerification check-box with configurable initial check-box state and check-box caption.

oFooter area with FooterIcon, analogous to MainIcon, and FooterText.

TNGInputDialog component allows to configure and show input dialog, which is a dialog that contains some input control, such as edit or memo, and provides a way for the user to input a value. Input dialog can contain:

oCaption, Title and Content texts, MainIcon, standard and custom buttons, expandable additional information, verification check-box and footer area - all these features are analogous to TNGTaskDialog.

oInput control, which can be configured by the user by assigning a value to InputType property. Input control can be one of the following: edit, memo, password edit, editable combo-ox, non-editable combo-box, date-time picker or a custom input control (or several controls) configured as a mini-HTML template, using TemplateHtml property.

oInputValue property can be used to specify initial input value, which is shown when the dialog executed. As well, InputItems property can be used to configure combo-box items.

TNGMessageDialog component allows to configure and show simple message dialogs with a look, compatible with TNGTaskDialog. The main purpose of the component is to be used internally inside TNGDialogs.Message overloaded methods, so, it, probably, need not be used explicitly. The component provides a set of properties, which are analogous to Delphi standard MessageDlg function parameters.

 

First two dialog components support advanced set of features, such as callback timer, OnButtonClick event with the ability of dialog content modification from the event handler, and navigation.

 

Fluent interface

 

We are proud to introduce a simple, very convenient API for executing dialogs. The API is organized as static methods of TNGDialogs structure, most of which are overloaded. In most cases this API allows to show required dialog writing one or just several lines of code without placing dialog components on the form. The API provides replacement for standard Delphi dialog functions, such as ShowMessage, MessageDlg, InputBox and InputQuert to allow to show dialogs, compatible with task dialog look and feel. It also contains some additional simple dialog functions, such as Error, Warning or Information. All these function are overloaded, which allows to specify only required parameters.

 

Another part of Fluent Interface API is our unique dialog builders, available for task and input dialogs. Following are some usage examples:

 

The code:

 

  TNGDialogs.Task('My caption', 'My title', 'My description text')

            .Icon(tdiInformation)

            .Buttons([tcbOk, tcbCancel], tcbOk)

            .Execute;

 

will show the following simple dialog:

 

clip0002

 

More complex example:

 

  case TNGDialogs.Task('My caption', 'My title', 'My description text')

                 .Icon(Application.Icon)

                 .Button('My button', 100, True)

                 .Buttons([tcbOk, tcbCancel])

                 .ExpandableInfo('My long long expandable information text')

                 .Footer('My footer text', tdiWarning)

                 .Execute of

    100:      ; // My button clicked.

    mrOk:     ;

    mrCancel: ;

  end;

 

will show the following:

 

clip0003

 

For more information please look at Fluent Interface description.

 

Design-time editor

 

The package provides design-time editor for TNGTaskDialog and TNGInputDialog components. Double click on the dialog component. placed on a form, to execute design-time editor. The editor provides a simple way to configure dialog, and provides the ability to look at the resulting dialog by clicking "Show Dialog" button:

 

clip0004