| Class TDialog97 (unit Dialog97) |
TComponent
**************************************************************************** Freeware use and abuse Use at your own risk, no liablity for damages of any sort will be accept by the authors or anyone connected with them in anyway whatsoever TDialog97 a 97 style dialog for use with Delphi 1 & Delphi 3 (Different files for each) It combines the 3 ways of showing dialogs into one viz Execute,Showmessage,Messagedlg & also operates as an inputquery dialog Note: There is no wrap around for long , so if you are using long sentences then put in your own Carriage Returns. Authors Edward de la Rey & Paul Cook email:edwardr@mailbox.ru.ac.za Files: Dialog97.Pas - Install this one to install the component dialog97.dcr - Resource File for the component frmdlg97.dfm - Form file ie. Actual Dialog form frmdlg97.pas - Pas file for the form file Extra files: You will need the TExplorer freeware transparent button component installed for the Delphi 1 Version PROPERTIES: DialogType:TMsgDlgtype; DialogButtons: TMsgDlgButtons; HelpContextID: Integer; Msg:String; METHODS: InputQuery(const ACaption, APrompt: string; var Value: string): Integer; Shows as an input box, and returns the text entered, also returns mrResult value to say wether user pressed ok or cancel if no msgpassed then the msg property value is used if msg porperty is blank then no message displayed Execute: Shows the dialog form and returns result as ButtonPressed ie MROk,MRCancel etc or returns MRCANCEL if User Closes form without choosing uses the above properties ie Dialogtype etc ShowMessage(const Msg: string): Shows the dialog as an information dialog, using the message passed to it and an OK button, The name of the application's title file appears as the caption of the message box. Useful for debugging MessageDlg: Shows the dialog using the parameters passed across, returns button pressed or MRCANCEL if appropriate this is the same as normal messagedlg function EVENTS: None Note: When using the Showmessage feature, or if choosing the mtcustom message type, the caption displayed on the dialog is that of the application objects title
| Constructors |
constructor Create(AOwner: TComponent);| Functions |
function InputQuery(const ACaption, APrompt: string; var Value: string): Integer;
destructor Destroy;
function Execute:Word;
function MessageDlg (MyMsg:String;MsgType:TMsgDlgtype;DlgBtns:TmsgDlgButtons;HlpCnt:LongInt):Word;
procedure ShowMessage (MyMsg:String);with
procedure SetdialogAttributes;
procedure SetDialogType (dlgType:TmsgdlgType);
procedure SetHelpContextId (Value:LongInt);
procedure SetMessageDialogButtons (dlgBtns:TMsgDlgButtons);
procedure SetMsg (Value:String);| Properties |
property DialogButtons : TMsgDlgButtons
property DialogType : TMsgDlgtype
property HelpContextID : LongInt
property Msg : String| Events |
| Variables |
GetDialogType : TmsgdlgType;
GetHelpContextId : LongInt;
GetMessageDialogButtons : TMsgDlgButtons;
GetMsg : String;| Constructors |
constructor Create(AOwner: TComponent);Configure the dialog to show correctly
| Functions |
function InputQuery(const ACaption, APrompt: string; var Value: string): Integer;-------------------------------------------------------------} {---------------------- TDialog97 --------------------------} {-------------------------------------------------------------
destructor Destroy;
function Execute:Word;
function MessageDlg (MyMsg:String;MsgType:TMsgDlgtype;DlgBtns:TmsgDlgButtons;HlpCnt:LongInt):Word;with
procedure ShowMessage (MyMsg:String);Method Used to Execute the dialog
with
procedure SetdialogAttributes;Retore the component settings
procedure SetDialogType (dlgType:TmsgdlgType);
procedure SetHelpContextId (Value:LongInt);Setup the dialog using UserAttributes
procedure SetMessageDialogButtons (dlgBtns:TMsgDlgButtons);
procedure SetMsg (Value:String);Create and run the dialog form
| Properties |
property DialogButtons : TMsgDlgButtons
property DialogType : TMsgDlgtypeexecute is a method
property HelpContextID : LongInt
property Msg : String| Events |
| Variables |
GetDialogType : TmsgdlgType;Message to be displayed
GetHelpContextId : LongInt;
GetMessageDialogButtons : TMsgDlgButtons;The Current Messagedlg type
GetMsg : String;