View previous topic :: View next topic |
Author |
Message |
ShinobiSoft Professional Member
Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Sat Nov 09, 2002 9:00 am Post subject: Generic Syntax Highlighting..... |
|
|
Here it is folks. There's a few bugs in it still but it works just fine for small descriptions (ie;dialog descriptions).
This example looks for and highlights the word 'Dialog'. Actually it works perfect for say..., my Script Checker program.
Code: |
:HighLight
%%c = DkGreen
%%searchText = @object(dlgtext,RichEdit1)
%%searchText2 = %%searchText
%%findTextOld =
list create,1
list assign,1,%%searchText
%%findText = "Dialog"
%%len = @len(%%findText)
repeat
list seek,1,0
if @null(%%findAgain)
%%find = @pos(%%findText,%%searchText)
else
%%findTextOld = @substr(%%searchText2,1,@sum(@len(%%findTextOld),%%find))
%%searchText = @substr(%%searchText,@succ(%%find),65537)
%P = @pos(%%searchText,@text(1))
%%PP = @substr(@text(1),%P,@sum(%P,25))
%M = @match(1,%%PP)
%%idx = @index(1)
%%item = @item(1)
%%find = @pos(%%findText,%%searchText)
end
if @greater(%%find,0)
%%color = @object(getformat,RichEdit1,C)
if @not(@equal(%%color,%%c))
%%start = @pred(@diff(@sum(@pred(@len(%%findTextOld)),%%find),%%idx))
%%end = @sum(%%start,%%len)
object format,RichEdit1,clipboard,select,%%start,%%end
object format,RichEdit1,bold,on
object format,RichEdit1,Setfont,Arial,10,%%c
object format,RichEdit1,Bold,Off
object format,RichEdit1,clipboard,select,@succ(%%end),@len(@object(dlgtext,RichEdit1))
object format,RichEdit1,Setfont,Arial,10,Black
%%findAgain = 1
end
else
%%findAgain =
end
until @null(%%findAgain)
list close,1
exit
|
NOTE:
It would probably be better to assign the text to a string list and loop through it line by line instead of tring to do this all in a variable.
If there aren't enough comments within this example I'm sorry. I will edit this post to contain more comments if necessary. I would like some feed back from any of y'all about this.
Happy Computing _________________ Bill Weckel
ShinobiSoft Software
"The way is known to all, but not all know it."
Last edited by ShinobiSoft on Mon Dec 16, 2002 2:25 am; edited 3 times in total |
|
Back to top |
|
|
Mac Professional Member
Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Sat Nov 09, 2002 9:05 am Post subject: |
|
|
No DLL? 8O
Where do the object commands and functions come from?
Cheers, Mac _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
|
|
Back to top |
|
|
ShinobiSoft Professional Member
Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Sat Nov 09, 2002 9:35 am Post subject: |
|
|
Just let me rephrase that. No external dll for the highlighting. Of course there's a needed dll for the RichEdit object.
My head was swollen when I made this post. Thanks for bursting my bubble! _________________ Bill Weckel
ShinobiSoft Software
"The way is known to all, but not all know it." |
|
Back to top |
|
|
Mac Professional Member
Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Sat Nov 09, 2002 9:51 am Post subject: |
|
|
Lol, sorry.
Ya might want to move this to VDS4 source code since
it requires a DLL...
Cheers, Mac _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
|
|
Back to top |
|
|
ShinobiSoft Professional Member
Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Sat Nov 09, 2002 6:40 pm Post subject: |
|
|
I just tried to move this post with no luck. Anyone know how???
I moved it when I first posted it, I think, becasue there weren't any replies. _________________ Bill Weckel
ShinobiSoft Software
"The way is known to all, but not all know it." |
|
Back to top |
|
|
Mac Professional Member
Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Sat Nov 09, 2002 7:46 pm Post subject: |
|
|
Moved topic and removed "no dll" from the title.
Cheers, Mac _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
|
|
Back to top |
|
|
ShinobiSoft Professional Member
Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Sat Nov 09, 2002 8:02 pm Post subject: |
|
|
Thanks for moving this topic for me Mac! _________________ Bill Weckel
ShinobiSoft Software
"The way is known to all, but not all know it." |
|
Back to top |
|
|
GeoTrail Valued Contributor
Joined: 18 Feb 2003 Posts: 572 Location: Bergen, Norway
|
Posted: Fri Feb 21, 2003 5:06 am Post subject: |
|
|
Where can I get the richtext extension from?
And is it freeware? _________________
|
|
Back to top |
|
|
ShinobiSoft Professional Member
Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Fri Feb 21, 2003 5:49 am Post subject: |
|
|
The current version of the dll used to create the RichEdit control is the
Vdsobj2.dll. Is isn't FREEWARE but I do believe it's $30.00 US to
register it. _________________ Bill Weckel
ShinobiSoft Software
"The way is known to all, but not all know it." |
|
Back to top |
|
|
GeoTrail Valued Contributor
Joined: 18 Feb 2003 Posts: 572 Location: Bergen, Norway
|
Posted: Fri Feb 21, 2003 5:56 am Post subject: |
|
|
OK, got a download link so I could try it out? _________________
|
|
Back to top |
|
|
ShinobiSoft Professional Member
Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Fri Feb 21, 2003 5:59 am Post subject: |
|
|
Download vdsobj2.dll here. _________________ Bill Weckel
ShinobiSoft Software
"The way is known to all, but not all know it." |
|
Back to top |
|
|
GeoTrail Valued Contributor
Joined: 18 Feb 2003 Posts: 572 Location: Bergen, Norway
|
Posted: Fri Feb 21, 2003 6:08 am Post subject: |
|
|
Thanks
Annoying popups there
I tried the Gadget extension, well I tried to try it. But I didn't get to see any features of it. Stupid popup keeped poping up every 0.5 seconds... _________________
|
|
Back to top |
|
|
PGWARE Web Host
Joined: 29 Dec 2001 Posts: 1563
|
Posted: Fri Feb 21, 2003 6:18 am Post subject: |
|
|
Hopefully the vdsobj isn't popping up that frequently, I added in a function so it would popup after a random number of functions/commands were used. Still though the popups are there, sorry but it's the only real way to prevent people from distributing the extension without supporting their local garage programmer |
|
Back to top |
|
|
GeoTrail Valued Contributor
Joined: 18 Feb 2003 Posts: 572 Location: Bergen, Norway
|
Posted: Fri Feb 21, 2003 8:06 am Post subject: |
|
|
No I totally understand that.
I was able to try the VDSOBJ ext. Popups varied, but atleast I got to try some of it's functions
One guy in the MMB scene made a cool plugin. And instead of adding popups, he made a small picture with a link and some text in a small space that appeared in the corner of the program. And it wasen't possible top put any objects ontop of that. I think that is the best solution I've seen so far.
But, a popup that doesn't kill the opportunity to try the product is all good _________________
|
|
Back to top |
|
|
vdsalchemist Admin Team
Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Fri Feb 21, 2003 2:23 pm Post subject: |
|
|
GeoTrail wrote: | Thanks
Annoying popups there
I tried the Gadget extension, well I tried to try it. But I didn't get to see any features of it. Stupid popup keeped poping up every 0.5 seconds... |
Sorry GeoTrail about all the popups in the Gadget extension. I have fixed that problem but I have not uploaded the new version of the extension yet. It will be up soon. _________________ Home of
Give VDS a new purpose!
|
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|