Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 5 of 5 total
Thread ShowMessageEx request
Thu, Sep 22 2016 12:40 PMPermanent Link

Trinione

Tim:
I know I can have my own form with this, but it may be a great feature to have within the EWB arsenal by default.

The current ShowMessage with the following additions:
1 - Ability to specify the Top and Left position of the window
2 - Ability to hide the close 'X' icon (users tend to click on 'OK' button)
3 - Set color of border from default (blue in my case)
4 - Icon setting, to replace the current 'i' icon

and, this would really put the 'Ex' in ShowMessageEx:

5 - Ability to specify the max height and max width
6 - Have text in a Scroll Panel.

Items 5 and 6 would really help as there are times when the Caption text can be very long. By limiting to the maximum height especially then the user can scroll thru the text in the message.

Again, I know a form can be created for this, but I am thinking a ShowMessageX would be useful overall.
Thu, Sep 22 2016 3:40 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

<< Again, I know a form can be created for this, but I am thinking a ShowMessageX would be useful overall. >>

That is way too many parameters for a procedure/method call.  You should use an inherited dialog if you want that much control over the placement and usage of the dialog.

Tim Young
Elevate Software
www.elevatesoft.com
Thu, Sep 22 2016 4:44 PMPermanent Link

Trinione

Tim Young [Elevate Software] wrote:
<< That is way too many parameters for a procedure/method call. >>


Tim:
Yes. Just re-reading it gave me a headache.

The only one that would be useful with the standard ShowMessage is item #2. Other that that I can roll my own.
Fri, Sep 23 2016 2:07 AMPermanent Link

Michael Dreher

Trinione wrote:

 // The only one that would be useful with the standard ShowMessage is
 // item #2. Other that that I can roll my own.

My suggestion is this procedure:

procedure ShowMessageEx(const msg : String;
                       allowClose : boolean = false;
                       animationStyle : TAnimationStyle = asNone;
                       animationDuration: Integer = 0);
begin
  MessageDlg(msg, Translate('DLG_MSG'), mtInformation,  [mbOk], mbOk, nil, allowClose,
             animationStyle, animationDuration);
end;

Application:
 ShowMessageEx('Hallo', true);  // with X
 ShowMessageEx('World', false); // without X

You dont have to call it "ShowMessageEx". ShowMessage will also do because of the overload mechanism.

Michael Dreher
Fri, Sep 23 2016 11:27 AMPermanent Link

Trinione

Michael :

Great! Thanks! Works perfectly. I even added the DlgCaption also.


procedure MyShowMessage(const msg : String;
                      const DlgCaption: String='';
                      allowClose : boolean = false;
                      animationStyle : TAnimationStyle = asNone;
                      animationDuration: Integer = 0);
Image