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
For-in loop over constant...
by
Nel_Fie
[
Today
at 10:35:29 am]
Arabic text, problem on L...
by
Thaddy
[
Today
at 10:33:18 am]
TBGRABitmap.TextSize retu...
by
KodeZwerg
[
Today
at 10:26:36 am]
Using TAChart to Pan/Zoom...
by
deborah621
[
Today
at 10:20:36 am]
[re-opened] Package PPU l...
by
marcov
[
Today
at 10:20:20 am]
Lazreport: Question about...
by
teco
[
Today
at 09:18:07 am]
Does anyone know why this...
by
TYDQ
[
Today
at 08:50:45 am]
Values of a custom compon...
by
CM630
[
Today
at 08:35:50 am]
how to using CryptoLib4Pa...
by
paweld
[
Today
at 07:59:04 am]
Distro has depreciated qt...
by
cdbc
[
Today
at 07:39:45 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]
Demoscene Square dot flag...
by
TRon
[
Today
at 01:10:22 am]
How does Castle Game Eng...
by
michalis
[
Today
at 01:07:14 am]
How to use the Event Log?
by
piola
[
Today
at 12:18:19 am]
[solved] Lazarus does not...
by
RayoGlauco
[
Today
at 12:09:11 am]
Azure sql database will n...
by
wpflum
[April 15, 2024, 09:04:08 pm]
Your best UI design - con...
by
Lulu
[April 15, 2024, 08:51:36 pm]
Is it possible to open a ...
by
Martin_fr
[April 15, 2024, 08:50:05 pm]
JCF - File location query...
by
bglazuser
[April 15, 2024, 08:02:40 pm]
Adding a named separator
by
440bx
[April 15, 2024, 06:54:21 pm]
SDL2 Software_Render
by
mosquito
[April 15, 2024, 06:36:41 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Is posssible own MessageDlg buttons? (Read 656 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: 11906
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