Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
General
»
Is posssible own MessageDlg buttons?
Free Pascal
Website
Downloads
Wiki
Documentation
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Documentation (RTL/FCL/LCL)
Bugtracker
CCR Bugs
IRC channel
GIT
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
Form scaling
by
fxeconomist
[
Today
at 06:11:14 pm]
Does anyone know why this...
by
Laksen
[
Today
at 06:01:04 pm]
For-in loop over constant...
by
alpine
[
Today
at 05:20:47 pm]
pre-processor symbol when...
by
paule32
[
Today
at 05:11:35 pm]
How can i make this windo...
by
TRon
[
Today
at 05:06:35 pm]
How are cookies share Web...
by
Thaddy
[
Today
at 04:59:59 pm]
CORBA interface and Varia...
by
JdeHaan
[
Today
at 04:56:48 pm]
Azure sql database will n...
by
wpflum
[
Today
at 04:04:56 pm]
Values of a custom compon...
by
CM630
[
Today
at 01:42:08 pm]
Arabic text, problem on L...
by
marius.maximus
[
Today
at 12:59:47 pm]
[solved] Lazarus does not...
by
wp
[
Today
at 12:38:09 pm]
How does Castle Game Eng...
by
Aistis
[
Today
at 12:21:03 pm]
CocoaInt.CocoaIconUse no ...
by
MISV
[
Today
at 11:51:28 am]
Minimum code for implemen...
by
MISV
[
Today
at 11:37:54 am]
[re-opened] Package PPU l...
by
CCRDude
[
Today
at 11:19:11 am]
Distro has depreciated qt...
by
TheMouseAUS
[
Today
at 11:12:25 am]
How can I draw a rectangl...
by
jcmontherock
[
Today
at 11:08:24 am]
TBGRABitmap.TextSize retu...
by
KodeZwerg
[
Today
at 10:26:36 am]
Lazreport: Question about...
by
teco
[
Today
at 09:18:07 am]
how to using CryptoLib4Pa...
by
paweld
[
Today
at 07:59:04 am]
How to: create DLL file f...
by
paule32
[
Today
at 07:03:32 am]
[solved]FP IDE(FP.exe) fa...
by
gasensor
[
Today
at 03:00:19 am]
ThumbControl : how to loa...
by
the_magik_mushroom
[
Today
at 01:48:57 am]
[solved] Iteration of cla...
by
Joanna
[
Today
at 01:45:47 am]
leetcode doesn’t support ...
by
Joanna
[
Today
at 01:18:56 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Is posssible own MessageDlg buttons? (Read 657 times)
Borneq
Full Member
Posts: 248
Is posssible own MessageDlg buttons?
«
on:
December 10, 2019, 09:39:35 pm »
For example is:
Code: Pascal
[Select]
[+]
[-]
res
:
=
MessageDlg
(
'Save file?'
,
mtError
,
[
mbYes
,
mbNo
,
mbCancel
]
,
0
)
;
But is needed more info to user: No can means "close file and discard changes" or "not close"
list: "Yes", "Save All", "Close discard changes", "Discard all", "Cancel"
Logged
wp
Hero Member
Posts: 11910
Re: Is posssible own MessageDlg buttons?
«
Reply #1 on:
December 10, 2019, 10:03:56 pm »
You are probably searching for the extremely flexible QuestionDlg (
https://wiki.freepascal.org/Dialog_Examples#QuestionDlg
):
Code: Pascal
[Select]
[+]
[-]
const
mrSaveAll
=
-
1
;
mrCloseAndDiscard
=
-
2
;
mrDiscard
=
-
3
;
procedure
TForm1
.
Button1Click
(
Sender
:
TObject
)
;
var
res
:
Integer
;
begin
res
:
=
QuestionDlg
(
'Caption of the form'
,
'This text is displayed inside the form'
,
mtWarning
,
[
mrYes
,
'Yes'
,
mrSaveAll
,
'Save All'
,
mrCloseAndDiscard
,
'Close && discard changes'
,
mrDiscard
,
'Discard'
,
mrCancel
,
'Cancel'
]
,
0
)
;
case
res
of
mrYes
:
ShowMessage
(
'"Yes" clicked'
)
;
mrSaveAll
:
ShowMessage
(
'"Save All" clicked'
)
;
mrCloseAndDiscard
:
ShowMessage
(
'"Close & discard changes" clicked'
)
;
mrDiscard
:
ShowMessage
(
'"Discard" clicked'
)
;
mrCancel
:
ShowMessage
(
'"Cancel" clicked.'
)
;
end
;
end
;
«
Last Edit: December 10, 2019, 10:09:57 pm by wp
»
Logged
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
General
»
Is posssible own MessageDlg buttons?
TinyPortal
© 2005-2018