Pascal Definition |
[Top] [Chapter] [Previous] [Next] |
unit WPDLL_CreateDlgInt; // ----------------------------------------------------------------------------- // Create TextDynamic Interface // Date: 5.10.2009 // -----------------------------------------------------------------------------
interface
uses Windows;
type
fkt_wptextDialogCB = function( handle : HWND; code : Integer; // mesage id iparam : Integer; // lparam : Cardinal; sparam : PAnsiChar; memo : Pointer // IWPMemo // can be null. Current editor ) : Integer;
fkt_wptextDialogShow = function( handle : HWND; code : Integer; // message id memo : Pointer; // IWPMemo; // can be null. First editor memo2 : Pointer // IWPMemo // can be null. Second editor ) : Integer;
// AnsiChar version TDCreateDialogParam = packed record size : Integer; // window modes : Integer; // 1=show statusbar // 2=modal dialog toppanel_height: Integer; // 1=show status border : Integer; // EditorStart (or use wptextSetLicense) licensename: PAnsiChar; licensekey : PAnsiChar;
// SetLayout(pccfile, pcclayout, pccpasswd, "main", "main") // pcclayout defaults to "default" // pccpasswd defaults to "" pccfile : PAnsiChar; pcclayout : PAnsiChar; pccpasswd : PAnsiChar;
// SetEditorMode editor_mode : Integer; editor_xmode : Integer; editor_gui1 : Integer; editor_gui2 : Integer;
// Layoutmode and Zoom (-1 = default, unchanged) editor1_layoutmode : Integer; editor1_autozoom : Integer; editor1_zoom : Integer; editor2_layoutmode : Integer; editor2_autozoom : Integer; editor2_zoom : Integer; // Ignored for thumbnailmode
// Toolbar Colors toolbar_mode, toolbar_colfrom, toolbar_colto : Cardinal;
// Background Colors desktop_mode : Cardinal; desktop_colfrom : Cardinal; desktop_colto : Cardinal;
// SetBProp - Index=Group, Bit Nr=Id, ADD to set, DEL to clear Memo1_SetBProp_ADD : array[0..19] of Cardinal; Memo1_SetBProp_DEL : array[0..19] of Cardinal; Memo2_SetBProp_ADD : array[0..19] of Cardinal; Memo2_SetBProp_DEL : array[0..19] of Cardinal;
// Load a file loadfile : PAnsiChar; loadfilemode : Integer; // Reserved;
// Callbacks msgwindow : HWND; OnQueryClose : fkt_wptextDialogCB; // result=0 -> may not close AfterShow : fkt_wptextDialogShow; // After show dialog - now can modify
// Spellcheck spell_inifile : PChar; spell_langid : Integer; // selected language spell_modes : Integer; // Activate SpellAsYouGo ...
end; PTDCreateDialogParam = ^TDCreateDialogParam;
fkt_wptextCreateDialog = function( parent : HWND; params : PTDCreateDialogParam; x,y,w,h : Integer ; ed : PCardinal) : HWND; stdcall;
const // MessagIDs to launch operation in editor WMP_DLLBASE = 1029; // WM_USER ... WPDLL_SYS = 10; // System commands- Use WMP_EDCOMMAND WPDLL_DATA = 100; // Create new data WPDLL_GUI = 1000; // GUI commands, enable, disable etc WPDLL_COM = 9000; // ..9999 Commands sent to the editor, change attributes etc WMP_EXCOMMAND = WMP_DLLBASE + 1; // lparam=ptr to TCOMEditDataCommand record, wparam=SizeOf(TCOMEditDataCommand) WMP_SETIPROP = WMP_DLLBASE + 2; // Set Integer Property: wparam=id, lparam = value
WPDLL_DATA_GETSTRING = WPDLL_DATA + 16; // Get Length of data buffer, fill buffer WPDLL_DATA_GETSTRINGW = WPDLL_DATA + 17; // Get Length of data buffer, fill WIDECHAR buffer
WMP_EDCOMMAND = WMP_DLLBASE + 11; // wparam=commandid, lparam=parameter for EDITOR A WMP_EDbCOMMAND = WMP_DLLBASE + 12; // wparam=commandid, lparam=parameter for EDITOR B WMP_EDCOMMANDSTR = WMP_DLLBASE + 13; // wparam=commandid, lparam=char* for EDITOR A WMP_EDbCOMMANDSTR = WMP_DLLBASE + 14; // wparam=commandid, lparam=char* for EDITOR A WMP_EDUCOMMANDSTR = WMP_DLLBASE + 15; // wparam=commandid, lparam=widechar* for EDITOR A WMP_EDUbCOMMANDSTR = WMP_DLLBASE + 16; // wparam=commandid, lparam=widechar* for EDITOR B WMP_WPA_PROCESS = WMP_DLLBASE + 22; // wparam= char *wpaAction, lparam=parama - for current editor WMP_WPA_PROCESS_1 = WMP_DLLBASE + 23; // wparam= char *wpaAction, lparam=parama - for editor #1 WMP_WPA_PROCESS_2 = WMP_DLLBASE + 24; // wparam= char *wpaAction, lparam=parama - for editor #2
WPSYS_ABOUTBOX = WPDLL_SYS + 16; // show about box, use WMP_EDCOMMAND WPSYS_CLEAR = WPDLL_SYS + 17; // clears both editors WPSYS_SETLANGUAGE = WPDLL_SYS + 18; // set language WPSYS_SETSPLITTERPOS = WPDLL_SYS + 19; // set splitter pos in % WPSYS_GETSHOWHINT = WPDLL_SYS + 20; // ShowHint WPSYS_SETSHOWHINT = WPDLL_SYS + 21; //
WPDLL_COM_REFORMAT = WPDLL_COM + 0; // Reformat in next idle phase, Param=1 at once, 2=at once + init, WPDLL_COM_ASET = WPDLL_COM + 1; // ASet() WPDLL_COM_AGET = WPDLL_COM + 2; // AGet() WPDLL_COM_ASETDEFTABFILL = WPDLL_COM + 3; // ASet() WPDLL_COM_ASETDEFTABCOLOR = WPDLL_COM + 4; // uses color UParam WPDLL_COM_STYLE_CREATE = WPDLL_COM + 5; // create a style and select it. If existing than clear it! WPDLL_COM_STYLE_SELECT = WPDLL_COM + 6; // selects/creates a style (to edit it) WPDLL_COM_STYLE_DELETE = WPDLL_COM + 7; // deletes a style WPDLL_COM_STYLE_GETLIST = WPDLL_COM + 8; // read comma separated list. // Use WPDLL_DATA_GETSTRING to read it! WPDLL_COM_STYLE_GETWPCSS = WPDLL_COM + 9; // Read WPCSS - one style WPDLL_COM_STYLE_SETWPCSS = WPDLL_COM + 10; // Set WPCSS - one style WPDLL_COM_STYLE_GETALLASSTR = WPDLL_COM + 11; // Read all as string (Param=Format: 0=WPCSS; 1=CSS, 2=INI) WPDLL_COM_STYLE_SETALLASSTR = WPDLL_COM + 12; // Set all as string (Param=Format: 0=WPCSS; 1=CSS, 2=INI) WPDLL_COM_STYLE_SAVEFILE = WPDLL_COM + 13; // Save all to file WPDLL_COM_STYLE_LOADFILE = WPDLL_COM + 14; // Load all from file // MAIN EDIT COMMANDS - some are superseded ---------------------------------- WPDLL_COM_TEXT_CLEAR = WPDLL_COM + 15; // Clear the text, Param=1 "ClearEx", + bit 2,3,4 WPDLL_COM_TEXT_CLEARBODY = WPDLL_COM + 16; // Clear only body, keep header+footer WPDLL_COM_TEXT_BACKUP = WPDLL_COM + 17; // backup template, Bit1 to ignore page size WPDLL_COM_TEXT_RESTORE = WPDLL_COM + 18; // restore template WPDLL_COM_TEXT_HIDESEL = WPDLL_COM + 19; // hide selection WPDLL_COM_TEXT_SELECTALL = WPDLL_COM + 20; // select all WPDLL_COM_TEXT_BEGINENDPRINT= WPDLL_COM + 21; // BeginPrint/EndPrint (Param=Begin) WPDLL_COM_TEXT_PRINT = WPDLL_COM + 22; // print, optionla Param, Param2 to select range [1..n] WPDLL_COM_TEXT_SELECTPRINTER= WPDLL_COM + 23; // select printer 'name' WPDLL_COM_TEXT_PRINTDIA = WPDLL_COM + 24; // print dialog WPDLL_COM_TEXT_DIALOG = WPDLL_COM + 25; // show modal dialog (previe etc) // DIALOG_.... WPDLL_COM_TEXT_LOADFILE = WPDLL_COM + 26; // buffer1=filename, buffer2=format, param=1 for 'Insert' WPDLL_COM_TEXT_SAVEFILE = WPDLL_COM + 27; // buffer1=filename, buffer2=format, param=1 for SelectionOnly WPDLL_COM_TEXT_LOADSTR = WPDLL_COM + 28; // buffer1=str, buffer2=format, param=1 for 'Insert' WPDLL_COM_TEXT_SAVESTR = WPDLL_COM + 29; // out: datastring, buffer2=format, param=1 for SelectionOnly WPDLL_COM_POS_SET = WPDLL_COM + 30; // param=what, param2=value, buffer=opt value, (bookmark), param3=1 for relative pos POSGOTO_POSITION = 0; // Absolute character Position POSGOTO_PAR = 1; // Absolute Paragraph Nr POSGOTO_POSINPAR = 2; // Position in current paragraph POSGOTO_PAGE = 3; // Absolute Page Nr POSGOTO_FIELD = 4; // Field (buffer) POSGOTO_Bookmark = 5; // Bookmark (buffer) WPDLL_COM_POS_GET = WPDLL_COM + 31; // get position // --- POS_PARAM_ .... WPDLL_COM_POS_SELECT = WPDLL_COM + 32; // param=what, param2=value, buffer=opt value (bookmark) // subset of POS_PARAM_ WPDLL_COM_MOVE = WPDLL_COM + 33; // param=what move (select end), Param2=1 to select WPDLL_COM_DROP_MARKER = WPDLL_COM + 34; // drop marker WPDLL_COM_COLLECT_MARKER = WPDLL_COM + 35; // collect marker (goto last pos) // --- DATA_PARAM_ .... WPDLL_COM_ACTIVATE = WPDLL_COM + 36; // Makes sure the editor is active WPDLL_COM_TEXT_LOADSTREAM = WPDLL_COM + 37; // buffer1=ISTREAM, buffer2=format, param=1 for Insert WPDLL_COM_TEXT_SAVESTREAM = WPDLL_COM + 38; // buffer1=ISTREAM, buffer2=format, param=1 for SelectionOnly
WPDLL_COM_ProcessWPA = WPDLL_COM + 56; // buffer1 = wpaname, buffer2=param, if buffer1=null then param=id WPDLL_COM_CheckWPA = WPDLL_COM + 57; // buffer1 = wpaname, result: bit1=enabled, bit 2=checked, bit3=hidden WPDLL_COM_FindHeader = WPDLL_COM + 58; // param=range, buffer=1 = name, Result = ID WPDLL_COM_FindFooter = WPDLL_COM + 59; // param=range, buffer=1 = name, Result = ID WPDLL_COM_GetRTFVariable = WPDLL_COM + 60; // Buffer=name, Result=String WPDLL_COM_SetRTFVariable = WPDLL_COM + 61; // Buffer=name, buffer2=texts
WPDLL_COM_TextCursor = WPDLL_COM + 62; // Result := IWPTextCursor WPDLL_COM_PDFCreator = WPDLL_COM + 63; // Result := IWPPdfCreator WPDLL_COM_TextAttr = WPDLL_COM + 64; // Result := CurrSelAttr or CurrAttr WPDLL_COM_GetIDWPA = WPDLL_COM + 65; // Result := if for wpa action WPDLL_COM_GetExceptionList = WPDLL_COM + 66; // Result := list of recent exceptions WPDLL_COM_GetMAPI = WPDLL_COM + 67; // Result := IWPMapi Interface WPDLL_COM_GetSPELL = WPDLL_COM + 68; // Result := IWPSpell Interface // Input Commands (if possible better use IWPTextCursor!) WPDLL_COM_InputText = WPDLL_COM + 70; // Param=width in %, negativ=absolute twips. Buffer=Text WPDLL_COM_InputParagraph = WPDLL_COM + 71; // Param=Mode, Buffer=StyleName WPDLL_COM_InputSection = WPDLL_COM + 72; // reserved , param=mode WPDLL_COM_InputTable = WPDLL_COM + 73; // buffer=name WPDLL_COM_InputTableRowStart= WPDLL_COM + 74; // param=Mode WPDLL_COM_InputTableCell = WPDLL_COM + 75; // buffer=StyleName, buffer2=Text WPDLL_COM_InputTableRowEnd = WPDLL_COM + 76; // Don't forget! WPDLL_COM_InputField = WPDLL_COM + 77; // buffer=name, buffer2=text WPDLL_COM_InputHyperLink = WPDLL_COM + 78; // buffer=URL, buffer2=text (wrap text if selected!) WPDLL_COM_InputBookmark = WPDLL_COM + 79; // buffer=name, buffer2=text (wrap text if selected!) WPDLL_COM_InputImage = WPDLL_COM + 80; // param=1=link, buffer=FileName WPDLL_COM_InputClearTabstop = WPDLL_COM + 81; // clears all tabs WPDLL_COM_InputTabstop = WPDLL_COM + 82; // param=Value, param2=kind, param3=FillMode, uparam=color, also inserts #9! WPDLL_COM_InputObject = WPDLL_COM + 83; // param=Typ, param2=mode, buffer=name, buffer2=Command (mode=1: create pair and place cusror inbetween WPDLL_COM_InputHeader = WPDLL_COM + 84; // param=Range, buffer=text (rtf, html) WPDLL_COM_InputFooter = WPDLL_COM + 85; // param=Range, buffer=text (rtf, html) WPDLL_COM_InputFootnote = WPDLL_COM + 86; // param=mode, buffer=text WPDLL_COM_InputTextbox = WPDLL_COM + 87; // param=width, buffer=text (rtf, html) WPDLL_COM_InputPicture = WPDLL_COM + 88; // param=w, param2=h + UParam = IPicture interface WPDLL_COM_InputPictureStream= WPDLL_COM + 89; // param=w, param2=h + UParam = IStream interface, buffer=Extension (BMP, WMF ...) // The next 3 also set the result string to the current value WPDLL_COM_INITIALDIR = WPDLL_COM + 90; // Set the initial directory for file open. WPDLL_COM_INITIALGRAPHICDIR = WPDLL_COM + 91; // Set the initial image directory for image insert WPDLL_COM_LASTFILENAME = WPDLL_COM + 92; // Retrieve the filename of the last loaded file.
WPDLL_COM_DrawToHDC = WPDLL_COM + 108; // UParam=HDC, GUIElement=X, Param3=Y, Param=Width, Param2=Height WPDLL_COM_DrawToBitmap = WPDLL_COM + 109; // UParam=HBitmap, GUIElement=X, Param3=Y, Param=Width, Param2=Height WPDLL_COM_SavePageAsMetafile = WPDLL_COM + 110; // param=pagenr, param2=options, buffer=filename
WPDLL_COM_CreateReport = WPDLL_COM + 111; WPDLL_COM_GETINTERFACE = WPDLL_COM + 112; WPDLL_COM_GETXY = WPDLL_COM + 113;
WPDLL_COM_PrintToDC = WPDLL_COM + 114; // for IViewObjectExImpl::Draw WPDLL_COM_PrintToDCGetH = WPDLL_COM + 115; // get height - in twips WPDLL_COM_EvGetButton = WPDLL_COM + 116; // Helper for VisualFoxPRO WPDLL_COM_EvGetContents = WPDLL_COM + 117; WPDLL_COM_EvGetBand = WPDLL_COM + 118;
WPDLL_COM_PROTECTEDTEXT = WPDLL_COM + 119; // Set SecurityOptions and protect them WPDLL_COM_ConvertTokens = WPDLL_COM + 120; // Convert Tokens to ReportTemplate
WPDLL_COM_PrintPDF = WPDLL_COM + 121; // same as PDFCreator Print 1. Optionally a filename can be passed as parameter. WPDLL_COM_PrintPDF2 = WPDLL_COM + 122; // same as PDFCreator PrintSecond
// ids - modify Editor #1 WIPR_ED1_PAGE_WIDTH = 1; WIPR_ED1_PAGE_HEIGHT = 2; WIPR_ED1_PAGE_LEFT_MARGIN = 3; WIPR_ED1_PAGE_RIGHT_MARGIN = 4; WIPR_ED1_PAGE_TOP_MARGIN = 5; WIPR_ED1_PAGE_BOTTOM_MARGIN = 6; WIPR_ED1_PAGE_HEADER_MARGIN = 7; WIPR_ED1_PAGE_FOOTER_MARGIN = 8; WIPR_ED1_PAGE_DRAW_MODE = 9; // Background image, address ... WIPR_ED1_PAGE_LINE_MODE = 10; // 0=adress top-left, 1=addres top right, 2=lineoffset WIPR_ED1_PAGE_LINEOFFSET_LEFT = 11; WIPR_ED1_PAGE_LINEOFFSET_RIGHT = 12; WIPR_ED1_PAGE_LINEOFFSET_TOP = 13; WIPR_ED1_PAGE_LINEOFFSET_BOTTOM = 14; WIPR_ED1_PAGES_MINCOUNT = 15; WIPR_ED1_PAGES_MAXCOUNT = 16; WIPR_ED1_PAGES_COUNT = 17; WIPR_ED1_PAGES_MULTIPLICATOR = 18;
// for Editor#2 WIPR_ED2_PAGE_WIDTH = 101; WIPR_ED2_PAGE_HEIGHT = 102; WIPR_ED2_PAGE_LEFT_MARGIN = 103; WIPR_ED2_PAGE_RIGHT_MARGIN = 104; WIPR_ED2_PAGE_TOP_MARGIN = 105; WIPR_ED2_PAGE_BOTTOM_MARGIN = 106; WIPR_ED2_PAGE_HEADER_MARGIN = 107; WIPR_ED2_PAGE_FOOTER_MARGIN = 108; WIPR_ED2_PAGE_DRAW_MODE = 109; // Background image, address ... WIPR_ED2_PAGE_LINE_MODE = 110; // 0=adress top-left, 1=addres top right, 2=lineoffset WIPR_ED2_PAGE_LINEOFFSET_LEFT = 111; WIPR_ED2_PAGE_LINEOFFSET_RIGHT = 112; WIPR_ED2_PAGE_LINEOFFSET_TOP = 113; WIPR_ED2_PAGE_LINEOFFSET_BOTTOM = 114; WIPR_ED2_PAGES_MINCOUNT = 115; WIPR_ED2_PAGES_MAXCOUNT = 116; WIPR_ED2_PAGES_COUNT = 117; WIPR_ED2_PAGES_MULTIPLICATOR = 118;
// IDs for WPDLL_COM_TEXT_DIALOG DIALOG_Print=1; // = wpaPrintDialog DIALOG_PrinterSetup=2; // = wpaPrinterSetup DIALOG_Find=3; // = wpaSearch DIALOG_Replace=4; // = wpaReplace DIALOG_OPEN=5; // = wpaOpen DIALOG_SAVE=6; // = wpaSave DIALOG_SAVEAS=7; // = wpaSaveAs DIALOG_Preview=8; DIALOG_PageProp=9; DIALOG_PagePropPaperNames=10; // like PageProp but show paper names, too DIALOG_SectionProp=11; // reserved DIALOG_ParagraphProp=12; DIALOG_Tabstops=13; DIALOG_Bullet=14; DIALOG_BulletOutlines=15; // Bullets and Numbers and Outlines DIALOG_ParagraphBorder=16; DIALOG_StyleSheet=17; DIALOG_OneStyle=18; DIALOG_Spellcheck=19; DIALOG_SpellOptions=20; DIALOG_ExportToWord=21; DIALOG_ExportToPDF=22; DIALOG_INSSymbol=23; DIALOG_INSTable=24; DIALOG_INSGRAPHIC=25; DIALOG_INSGRAPHICLINK=26; DIALOG_INSTextBox=27; DIALOG_INSHyperlink=28; DIALOG_INSBookmark=29; DIALOG_INSFields=30; DIALOG_ReportBands=31; DIALOG_PDFProperties=32; DIALOG_PrintLabels=33; DIALOG_PrintBooklet=34; DIALOG_DocInfo=35; // info + stats DIALOG_Templates=36; // quick replacement DIALOG_DocVariable=37; // caption=caption param=name (RTFVariable!) DIALOG_WPAbout=38; // TextDynamic about form DIALOG_WPDebug=39; // Debug form with current paragraph attributes DIALOG_MessageBox=40; // caption=caption param=text DIALOG_PagePropPaperTray=41; DIALOG_ManageFormulas=42; DIALOG_ManageHeaderFooter=43; DIALOG_FontSelect = 44; // Standard Font Dialog
implementation
end. |