home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 5 Edit
/
05-Edit.zip
/
eeedit22.zip
/
enhanced.zip
/
Plugin.api
< prev
next >
Wrap
Text File
|
2001-04-15
|
3KB
|
103 lines
/****************************************/
/* Sample API's for use in plugins */
/* */
/* Many other calls to the editor can */
/* be found in the "addon.ext" code */
/* templates */
/****************************************/
/****************************************/
/* Variables you can use */
/****************************************/
Window = Is the Control ID for the editor itself
Target = Is the Control ID for the edit window (MLE)
IniDir = Location of the editor (no trailing backslash)
/****************************************/
/* Turn the red "Working" light ON/OFF */
/****************************************/
Call VpSetItemValue EEEmainwin,1019,rdledon
Call VpSetItemValue EEEmainwin,1019,rdledoff
/****************************************/
/* Messagebox API's */
/* "response" will hold the user action */
/****************************************/
response=VpMessageBox(window,'title','message')
response=VpMessageBox(window,'title','message','YESNO')
response=VpMessageBox(window,'title','message','YESNOCNCL')
response=VpMessageBox(window,'title','message','RETRY')
response=VpMessageBox(window,'title','message','IGNORE')
/****************************************/
/* Make the editor load a file */
/****************************************/
Call Openfile FileName
/****************************************/
/* API's for the edit window */
/****************************************/
/* Get first character position Target (MLE) */
FirstChar=VpItem(window,Target,'SENDMSG','0x01d6')
/* Get selection range Target (MLE) */
PARSE VALUE VpGetIndex(window,Target) with First Last
/* Get text in range Target (MLE) */
/* needs the previous call to get the "First" & "Last" variables */
SelectedText = VpGetItemValue(window,Target,First,Last)
/* Get all text in Target (MLE) */
Document = VpGetItemValue(window,Target)
/* Select a range the Target (MLE) */
CALL VpSelect window,Target,First,Last
/* Select all items Target (MLE) */
CALL VpSelect window,Target,'ALL',1
/* Add item at current location Target (MLE) */
CALL VpAddItem window, Target, 'CURRENT', value
/* Set item value Target (MLE) */
/* Replaces all text in MLE with value */
CALL VpSetItemValue window,Target,value
/* Highlight the text from "First" to "Last" */
Call VpSelect window,Target,First,Last
/* Reset undo flag in the (MLE) */
CALL VpItem window,Target,'SENDMSG','0x01cf'
/* Enable/Disable painting of the Target (MLE) */
CALL VpItem window,Target,'DISABLEPAINT'
CALL VpItem window,Target,'ENABLEPAINT'
/* Enable/Disable Stdio window */
/* Helps when debugging your plugin */
CALL VpWindow window,'ENABLESTDIO'
CALL VpWindow window,'DISABLESTDIO'
/* Set window title */
CALL VpWindow window,"SETTITLE",value
/* Set InfoLine text */
CALL VpWindow window, "SETINFOLINE", value
/* Cut selected text to clipboard */
CALL VpItem window,ITEMID,'SENDMSG','0x01d8'
/* Copy selected text to clipboard */
CALL VpItem window,ITEMID,'SENDMSG','0x01d9'
/* Paste text from clipboard */
CALL VpItem window,ITEMID,'SENDMSG','0x01da'
/* Delete selected text */
CALL VpItem window,ITEMID,'SENDMSG','0x01db'