Topic: Pop-up info box

Hi Guys,


How can I have a pop-up info box linked from image or button without creating new form.


Hints are OK for short messages but when info message is longer then they are not convenient / practical.

Adam
God... please help me become the person my dog thinks I am.

Re: Pop-up info box

I imagine we all do it in different ways.
For what it's worth, I try to provide the user with a general help file but back it up with field specific help;  when it's too long for text-hints or where the hints disappear before you've had time to read it all, I use 'showmessage' and usually initiate it on a button click (but it can be fired from image-hover, image-click etc etc). 
It's not sophisticated but it's quick and simple (like  most of my stuff - LOL!).
Have a look at the attached and see if it's of any interest.
Derek.

Post's attachments

Attachment icon adh hints.zip 336.9 kb, 455 downloads since 2016-10-21 

Re: Pop-up info box

Hello AD1408

You can create a Memo component on runtime
Perhaps this snippet can be a clue  :

procedure MyMemo;
var   MyMemo1: TMemo;
begin
  MyMemo11:= TMemo.Create(frmMainIDE);
  with MyMemo1 do
  begin
    Parent:= Form1.Self;
    Align:= alClient;
    Font.Name:= 'Courier New';
    Font.Size:= 10;
    Font.Style:= [fsBold];
    Name:= 'MyMemo';
    Scrollbars:= ssVertical;
    Visible:= True;
  end;
end;

After you chose what to display in the memo.
To put behind OnClick Event from your image (or others events : OnKey..., OnEnter... OnMouse...)

As I read again this snippet, I get a doubt on good syntaxe for instruction Parent.

JB

Re: Pop-up info box

Hi Guys,


Thank you very much.......


Derek, I like your showmessage solution.

Adam
God... please help me become the person my dog thinks I am.

Re: Pop-up info box

Hello all,


Just so the thread is complete, you could also use the MessageDLG. The advantage are that without creating a new form, you can have warnings, error, confirmation or information messages and, if more than one button present on the message, you can trigger different actions depending on the button clicked by the user.


The Information message could suit your needs to deliver info to your user.


Here is a small project to illustrate all that.


Have a good week-end


Cheers



Mathias

Post's attachments

Attachment icon MSGDLG.zip 334.04 kb, 461 downloads since 2016-10-21 

I'm a very good housekeeper !
Each time I get a divorce, I keep the house

Zaza Gabor

Re: Pop-up info box

Thanks a lot Mathias...........


Nice contribution. Indeed, your post answers additional questions on the subject matter. Now, I know how to use different types of message windows.

Adam
God... please help me become the person my dog thinks I am.

Re: Pop-up info box

Hi Guys,


Sorry guys, I have one more question on this subject matter. Can we get message window display just an image, no text, no message type icon?

Adam
God... please help me become the person my dog thinks I am.

Re: Pop-up info box

I'll wait for the others confirmation, but the dLGMessage has its own icons that can not be modified appart from choosing between the type of message, and the showmessage instruction has no option for image, it only display strings (as far as I know)


I'm affraid you'll have to design your own form for that smile


Mathias

I'm a very good housekeeper !
Each time I get a divorce, I keep the house

Zaza Gabor

Re: Pop-up info box

Hello AD1408, MAthias

In your case, Windows manages this kind of message box, and we, poor users, have to deal with.
Otherwise, you could use a pop-up windows displaying an image (with eventually some text) triggered by a button ar other event

JB

10 (edited by AD1408 2016-10-28 20:35:38)

Re: Pop-up info box

Hi Guys,


I couldn't work out displaying  text with paragraphs plus line breaks on dialog windows.


procedure Form1_Button5_OnClick (Sender: string; var Cancel: boolean);
begin
    MessageDlg('Unfortunatly, there is no known URL for this asset.'+#13#10+
    'Unfortunatly, there is no known URL for this asset.'+#13#10+
    'Unfortunatly, there is no known URL for this asset.'+#13#10+
    'Unfortunatly, there is no known URL for this asset.'+#13#10+
    'Unfortunatly, there is no known URL for this asset.'+#13#10+
    'Unfortunatly, there is no known URL for this asset.'+#13#10+
    'Unfortunatly, there is no known URL for this asset.'+#13#10+
    'Unfortunatly, there is no known URL for this asset.'+#13#10+
    'Unfortunatly, there is no known URL for this asset.'+#13#10+
    'Unfortunatly, there is no known URL for this asset.'+#13#10+
    'Unfortunatly, there is no known URL for this asset.'+#13#10+
    'Unfortunatly, there is no known URL for this asset.'+#13#10+
    'Unfortunatly, there is no known URL for this asset.'+#13#10+
    'Unfortunatly, there is no known URL for this asset.'+#13#10,mtInformation,mbOK,0);
end;

The above displayed like this on dialog window:
Unfortunatly, there is no known URL for this asset
Unfortunatly, there is no known URL for this asset
Unfortunatly, there is no known URL for this asset
Unfortunatly, there is no known URL for this asset
Unfortunatly, there is no known URL for this asset
Unfortunatly, there is no known URL for this asset
Unfortunatly, there is no known URL for this asset
Unfortunatly, there is no known URL for this asset
Unfortunatly, there is no known URL for this asset
Unfortunatly, there is no known URL for this asset
Unfortunatly, there is no known URL for this asset
Unfortunatly, there is no known URL for this asset
Unfortunatly, there is no known URL for this asset
Unfortunatly, there is no known URL for this asset


I wanted add paragraph plus line break (space) like this:
Unfortunatly, there is no known URL for this asset
Unfortunatly, there is no known URL for this asset
Unfortunatly, there is no known URL for this asset


Unfortunatly, there is no known URL for this asset
Unfortunatly, there is no known URL for this asset
Unfortunatly, there is no known URL for this asset
Unfortunatly, there is no known URL for this asset
Unfortunatly, there is no known URL for this asset


Unfortunatly, there is no known URL for this asset
Unfortunatly, there is no known URL for this asset
Unfortunatly, there is no known URL for this asset
Unfortunatly, there is no known URL for this asset
Unfortunatly, there is no known URL for this asset
Unfortunatly, there is no known URL for this asset


Please ignore double spacing, I meant single line break.


---------------------------------------


edit:


It seems adding
''+#13#10+
where line space required doing the job. However, I have no idea currently what #13#10 stands for tho.


procedure Form1_Button5_OnClick (Sender: string; var Cancel: boolean);
begin
    MessageDlg('Unfortunatly, there is no known URL for this asset.'+#13#10+
    'Unfortunatly, there is no known URL for this asset.'+#13#10+
    'Unfortunatly, there is no known URL for this asset.'+#13#10+
    'Unfortunatly, there is no known URL for this asset.'+#13#10+
    ''+#13#10+ //Line space
    'Unfortunatly, there is no known URL for this asset.'+#13#10+
    'Unfortunatly, there is no known URL for this asset.'+#13#10+
    'Unfortunatly, there is no known URL for this asset.'+#13#10+
    'Unfortunatly, there is no known URL for this asset.'+#13#10+
    ''+#13#10+ //Line space
    'Unfortunatly, there is no known URL for this asset.'+#13#10+
    'Unfortunatly, there is no known URL for this asset.'+#13#10+
    'Unfortunatly, there is no known URL for this asset.'+#13#10+
    'Unfortunatly, there is no known URL for this asset.'+#13#10+
    'Unfortunatly, there is no known URL for this asset.'+#13#10+
    'Unfortunatly, there is no known URL for this asset.'+#13#10,mtInformation,mbOK,0);
end;
Adam
God... please help me become the person my dog thinks I am.

Re: Pop-up info box

#10 and #13 are ascii for line feed and carriage return

lee