Hello,
I really like the TextPad Clip Library, and was wondering how can I build something similar inside my application, The TextPad Clip Library allows users to store code or text templates inside a file, and allows them to incudes those templates inside there documents;
If you have ever used Clip Library in TextPad you probably know what I'm talking about, for those who don't, here is a short example:
Example:
a PL/SQL.txt file which contains the templates for procedures, loops, etc. One file can have multiple templates as the example shows. The FILE NAME displayed inside a drop down box,
when clicked populates a list with the TEXT values parsed from the file, clicking on the TEXT in the list inserts the template body into the document.
[]
!TEXT= indicates the starting point of a template
[]
! indicates an ending point of a template
[]
\^ indicates the cursor position, when the template is inserted into the document the cursor will be located at that position and \^ will be replaces with the cursor.
[]
anything between !TEXT= ... AND ! is the templates body text
FILE FORMAT:
-- Start File --
!TEXT=insert into ... values
insert into ()
values ()
!
!TEXT=join --- cross join
/*
* Returns the cross-product of 2 tables
*/
select \^
from a cross join b
!
-- End File --
Any help is greatly appreciated
Thanks
I really like the TextPad Clip Library, and was wondering how can I build something similar inside my application, The TextPad Clip Library allows users to store code or text templates inside a file, and allows them to incudes those templates inside there documents;
If you have ever used Clip Library in TextPad you probably know what I'm talking about, for those who don't, here is a short example:
Example:
a PL/SQL.txt file which contains the templates for procedures, loops, etc. One file can have multiple templates as the example shows. The FILE NAME displayed inside a drop down box,
when clicked populates a list with the TEXT values parsed from the file, clicking on the TEXT in the list inserts the template body into the document.
[]
!TEXT= indicates the starting point of a template
[]
! indicates an ending point of a template
[]
\^ indicates the cursor position, when the template is inserted into the document the cursor will be located at that position and \^ will be replaces with the cursor.
[]
anything between !TEXT= ... AND ! is the templates body text
FILE FORMAT:
-- Start File --
!TEXT=insert into ... values
insert into ()
values ()
!
!TEXT=join --- cross join
/*
* Returns the cross-product of 2 tables
*/
select \^
from a cross join b
!
-- End File --
Any help is greatly appreciated
Thanks