From 9a16735c5ebee4513d02b8f28b2147ec9407c18a Mon Sep 17 00:00:00 2001 From: Olivier Hallot Date: Fri, 12 May 2017 15:46:17 -0300 Subject: tdf#84675 (part) document hidden BASIC func/const Help page for MsgBox function and MsgBox statement Constants MB_* ID* Fix: remove MB_DEFBUTTON1 fix bug# Change-Id: Id8cbadc92a8e9c5902c3ff23b4e04bff3de3c03d Reviewed-on: https://gerrit.libreoffice.org/37558 Reviewed-by: Olivier Hallot Tested-by: Olivier Hallot --- source/text/sbasic/shared/03010101.xhp | 182 ++++++++++++++++++--- source/text/sbasic/shared/03010102.xhp | 279 ++++++++++++++++++++++++++++++--- 2 files changed, 419 insertions(+), 42 deletions(-) diff --git a/source/text/sbasic/shared/03010101.xhp b/source/text/sbasic/shared/03010101.xhp index 86acce126b..27782f5eab 100644 --- a/source/text/sbasic/shared/03010101.xhp +++ b/source/text/sbasic/shared/03010101.xhp @@ -47,31 +47,177 @@ Text: String expression displayed as a message in the dialog box. Line breaks can be inserted with Chr$(13). DialogTitle: String expression displayed in the title bar of the dialog. If omitted, the title bar displays the name of the respective application. Type: Any integer expression that specifies the dialog type, as well as the number and type of buttons to display, and the icon type. Type represents a combination of bit patterns, that is, a combination of elements can be defined by adding their respective values: -0 : Display OK button only. -1 : Display OK and Cancel buttons. -2 : Display Abort, Retry, and Ignore buttons. -3 : Display Yes, No and Cancel buttons. -4 : Display Yes and No buttons. -5 : Display Retry and Cancel buttons. -16 : Add the Stop icon to the dialog. -32 : Add the Question icon to the dialog. -48 : Add the Exclamation icon to the dialog. -64 : Add the Information icon to the dialog. -128 : First button in the dialog as default button. -256 : Second button in the dialog as default button. -512 : Third button in the dialog as default button. + + + + + Named constant + + + Integer value + + + Definition + + + + + MB_OK + + + 0 + + + Display OK button only. + + + + + MB_OKCANCEL + + + 1 + + + Display OK and Cancel buttons. + + + + + MB_ABORTRETRYCANCEL + + + 2 + + + Display Abort, Retry, and Ignore buttons. + + + + + MB_YESNOCANCEL + + + 3 + + + Display Yes, No, and Cancel buttons. + + + + + MB_YESNO + + + 4 + + + Display Yes and No buttons. + + + + + MB_RETRYCANCEL + + + 5 + + + Display Retry and Cancel buttons. + + + + + MB_ICONSTOP + + + 16 + + + Add the Stop icon to the dialog. + + + + + MB_ICONQUESTION + + + 32 + + + Add the Question icon to the dialog. + + + + + MB_ICONEXCLAMATION + + + 48 + + + Add the Exclamation Point icon to the dialog. + + + + + MB_ICONINFORMATION + + + 64 + + + Add the Information icon to the dialog. + + + + + + + + 128 + + + First button in the dialog as default button. + + + + + MB_DEFBUTTON2 + + + 256 + + + Second button in the dialog as default button. + + + + + MB_DEFBUTTON3 + + + 512 + + + Third button in the dialog as default button. + + +
+ Example: Sub ExampleMsgBox - Const sText1 = "An unexpected error occurred." - Const sText2 = "The program execution will continue, however." - Const sText3 = "Error" - MsgBox(sText1 + Chr(13) + sText2,16,sText3) + Const sText1 = "An unexpected error occurred." + Const sText2 = "The program execution will continue, however." + Const sText3 = "Error" + MsgBox(sText1 + Chr(13) + sText2,16,sText3) + MsgBox(sText1 + Chr(13) + sText2, MB_ICONSTOP, sText3) End Sub - \ No newline at end of file + diff --git a/source/text/sbasic/shared/03010102.xhp b/source/text/sbasic/shared/03010102.xhp index b11459e74f..aa54b77c56 100644 --- a/source/text/sbasic/shared/03010102.xhp +++ b/source/text/sbasic/shared/03010102.xhp @@ -51,27 +51,257 @@ DialogTitle: String expression displayed in the title bar of the dialog. If omitted, the name of the respective application is displayed. Type: Any integer expression that specifies the dialog type and defines the number and type of buttons or icons displayed. Type represents a combination of bit patterns (dialog elements defined by adding the respective values): Values -0 : Display OK button only. -1 : Display OK and Cancel buttons. -2 : Display Abort, Retry, and Ignore buttons. -3 : Display Yes, No, and Cancel buttons. -4 : Display Yes and No buttons. -5 : Display Retry and Cancel buttons. -16 : Add the Stop icon to the dialog. -32 : Add the Question icon to the dialog. -48 : Add the Exclamation Point icon to the dialog. -64 : Add the Information icon to the dialog. -128 : First button in the dialog as default button. -256 : Second button in the dialog as default button. -512 : Third button in the dialog as default button. + + + + + Named constant + + + Integer value + + + Definition + + + + + MB_OK + + + 0 + + + Display OK button only. + + + + + MB_OKCANCEL + + + 1 + + + Display OK and Cancel buttons. + + + + + MB_ABORTRETRYCANCEL + + + 2 + + + Display Abort, Retry, and Ignore buttons. + + + + + MB_YESNOCANCEL + + + 3 + + + Display Yes, No, and Cancel buttons. + + + + + MB_YESNO + + + 4 + + + Display Yes and No buttons. + + + + + MB_RETRYCANCEL + + + 5 + + + Display Retry and Cancel buttons. + + + + + MB_ICONSTOP + + + 16 + + + Add the Stop icon to the dialog. + + + + + MB_ICONQUESTION + + + 32 + + + Add the Question icon to the dialog. + + + + + MB_ICONEXCLAMATION + + + 48 + + + Add the Exclamation Point icon to the dialog. + + + + + MB_ICONINFORMATION + + + 64 + + + Add the Information icon to the dialog. + + + + + + + + 128 + + + First button in the dialog as default button. + + + + + MB_DEFBUTTON2 + + + 256 + + + Second button in the dialog as default button. + + + + + MB_DEFBUTTON3 + + + 512 + + + Third button in the dialog as default button. + + +
+ Return value: -1 : OK -2 : Cancel -3 : Abort -4 : Retry -5 : Ignore -6 : Yes -7 : No + + + + + Named constant + + + Integer value + + + Definition + + + + + IDOK + + + 1 + + + OK + + + + + IDCANCEL + + + 2 + + + Cancel + + + + + IDABORT + + + 3 + + + Abort + + + + + IDRETRY + + + 4 + + + Retry + + + + + IDIGNORE + + + 5 + + + Ignore + + + + + IDYES + + + 6 + + + Yes + + + + + IDNO + + + 7 + + + No + + +
+ @@ -79,11 +309,12 @@ Sub ExampleMsgBox Dim sVar As Integer - sVar = MsgBox("Las Vegas") - sVar = MsgBox("Las Vegas",1) - sVar = MsgBox( "Las Vegas",256 + 16 + 2,"Dialog title") + sVar = MsgBox("Las Vegas") + sVar = MsgBox("Las Vegas",1) + sVar = MsgBox( "Las Vegas",256 + 16 + 2,"Dialog title") + sVar = MsgBox("Las Vegas", MB_DEFBUTTON2 + MB_ICONSTOP + MB_ABORTRETRYCANCEL, "Dialog title") End Sub - \ No newline at end of file + -- cgit v1.2.3