ADD: DialogAPI - MsgChoiceBox and DialogBoxParam functions

This commit is contained in:
Alexander Koblov 2023-10-31 19:02:00 +03:00
commit 566b1b75e4
5 changed files with 98 additions and 24 deletions

View file

@ -91,6 +91,10 @@
#define ID_NO 7
#define ID_CLOSE 8
#define ID_HELP 9
// DialogBoxParam: Flags
#define DB_LFM 0 // Data contains a form in the LFM format
#define DB_LRS 1 // Data contains a form in the LRS format
#define DB_FILENAME 2 // Data contains a form file name (*.lfm)
/* other */
#define EXT_MAX_PATH 16384 /* 16 Kb */
@ -100,9 +104,11 @@ typedef intptr_t (DCPCALL *tDlgProc)(uintptr_t pDlg, char* DlgItemName, intptr_t
/* Definition of callback functions called by the DLL */
typedef BOOL (DCPCALL *tInputBoxProc)(char* Caption, char* Prompt, BOOL MaskInput, char* Value, int ValueMaxLen);
typedef int (DCPCALL *tMessageBoxProc)(char* Text, char* Caption, long Flags);
typedef int (DCPCALL *tMsgChoiceBoxProc)(char* Text, char* Caption, char** Buttons);
typedef BOOL (DCPCALL *tDialogBoxLFMProc)(intptr_t LFMData, unsigned long DataSize, tDlgProc DlgProc);
typedef BOOL (DCPCALL *tDialogBoxLRSProc)(intptr_t LRSData, unsigned long DataSize, tDlgProc DlgProc);
typedef BOOL (DCPCALL *tDialogBoxLFMFileProc)(char* LFMFileName, tDlgProc DlgProc);
typedef BOOL (DCPCALL *tDialogBoxParamProc)(void* Data, uint32_t DataSize, tDlgProc DlgProc, uint32_t Flags, void *UserData, void* Reserved);
typedef int (DCPCALL *tTranslateStringProc)(void *Translation, const char *Identifier, const char *Original, char *Output, int OutLen);
#pragma pack(push)
@ -119,7 +125,10 @@ typedef struct {
tDlgProc SendDlgMsg;
void *Translation;
tTranslateStringProc TranslateString;
unsigned char Reserved[4094 * sizeof(void *)];
uintptr_t VersionAPI;
tMsgChoiceBoxProc MsgChoiceBox;
tDialogBoxParamProc DialogBoxParam;
unsigned char Reserved[4091 * sizeof(void *)];
} tExtensionStartupInfo;
#pragma pack(pop)

View file

@ -95,6 +95,10 @@ const
ID_NO = 7;
ID_CLOSE = 8;
ID_HELP = 9;
// DialogBoxParam: Flags
DB_LFM = 0; // Data contains a form in the LFM format
DB_LRS = 1; // Data contains a form in the LRS format
DB_FILENAME = 2; // Data contains a form file name (*.lfm)
const
EXT_MAX_PATH = 16384; // 16 Kb
@ -107,9 +111,11 @@ type
{ Definition of callback functions called by the DLL }
TInputBoxProc = function(Caption, Prompt: PAnsiChar; MaskInput: LongBool; Value: PAnsiChar; ValueMaxLen: Integer): LongBool; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF};
TMessageBoxProc = function(Text, Caption: PAnsiChar; Flags: Longint): Integer; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF};
TMsgChoiceBoxProc = function(Text, Caption: PAnsiChar; Buttons: PPAnsiChar): Integer; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF};
TDialogBoxLFMProc = function(LFMData: Pointer; DataSize: LongWord; DlgProc: TDlgProc): LongBool; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF};
TDialogBoxLRSProc = function(LRSData: Pointer; DataSize: LongWord; DlgProc: TDlgProc): LongBool; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF};
TDialogBoxLFMFileProc = function(lfmFileName: PAnsiChar; DlgProc: TDlgProc): LongBool; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF};
TDialogBoxParamProc = function(Data: Pointer; DataSize: LongWord; DlgProc: TDlgProc; Flags: LongWord; UserData, Reserved: Pointer): LongBool; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF};
TTranslateStringProc = function(Translation: Pointer; Identifier, Original: PAnsiChar; Output: PAnsiChar; OutLen: Integer): Integer {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF};
type
@ -130,8 +136,11 @@ type
SendDlgMsg: TDlgProc;
Translation: Pointer;
TranslateString: TTranslateStringProc;
VersionAPI: UIntPtr;
MsgChoiceBox: TMsgChoiceBoxProc;
DialogBoxParam: TDialogBoxParamProc;
// Reserved for future API extension
Reserved: packed array [0..Pred(4094 * SizeOf(Pointer))] of Byte;
Reserved: packed array [0..Pred(4091 * SizeOf(Pointer))] of Byte;
end;
type