forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Generic Syntax Highlighting.....
Goto page 1, 2  Next
 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 4 Source Code
View previous topic :: View next topic  
Author Message
ShinobiSoft
Professional Member
Professional Member


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Sat Nov 09, 2002 9:00 am    Post subject: Generic Syntax Highlighting..... Reply with quote

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
Mr. Green Worship

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
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Sat Nov 09, 2002 9:05 am    Post subject: Reply with quote

No DLL? 8O

Where do the object commands and functions come from?

Cheers, Mac Smile

_________________
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
View user's profile Send private message Send e-mail
ShinobiSoft
Professional Member
Professional Member


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Sat Nov 09, 2002 9:35 am    Post subject: Reply with quote

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! Laughing

_________________
Bill Weckel
ShinobiSoft Software

"The way is known to all, but not all know it."
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Sat Nov 09, 2002 9:51 am    Post subject: Reply with quote

Lol, sorry.

Ya might want to move this to VDS4 source code since
it requires a DLL...

Cheers, Mac Smile

_________________
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
View user's profile Send private message Send e-mail
ShinobiSoft
Professional Member
Professional Member


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Sat Nov 09, 2002 6:40 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Sat Nov 09, 2002 7:46 pm    Post subject: Reply with quote

Moved topic and removed "no dll" from the title. Wink

Cheers, Mac Smile

_________________
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
View user's profile Send private message Send e-mail
ShinobiSoft
Professional Member
Professional Member


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Sat Nov 09, 2002 8:02 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
GeoTrail
Valued Contributor
Valued Contributor


Joined: 18 Feb 2003
Posts: 572
Location: Bergen, Norway

PostPosted: Fri Feb 21, 2003 5:06 am    Post subject: Reply with quote

Where can I get the richtext extension from?
And is it freeware?

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
ShinobiSoft
Professional Member
Professional Member


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Fri Feb 21, 2003 5:49 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
GeoTrail
Valued Contributor
Valued Contributor


Joined: 18 Feb 2003
Posts: 572
Location: Bergen, Norway

PostPosted: Fri Feb 21, 2003 5:56 am    Post subject: Reply with quote

OK, got a download link so I could try it out?
_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
ShinobiSoft
Professional Member
Professional Member


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Fri Feb 21, 2003 5:59 am    Post subject: Reply with quote

Download vdsobj2.dll here.
_________________
Bill Weckel
ShinobiSoft Software

"The way is known to all, but not all know it."
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
GeoTrail
Valued Contributor
Valued Contributor


Joined: 18 Feb 2003
Posts: 572
Location: Bergen, Norway

PostPosted: Fri Feb 21, 2003 6:08 am    Post subject: Reply with quote

Thanks Smile

Annoying popups there Laughing
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... Sad

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
PGWARE
Web Host


Joined: 29 Dec 2001
Posts: 1563

PostPosted: Fri Feb 21, 2003 6:18 am    Post subject: Reply with quote

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 Sad
Back to top
View user's profile Send private message
GeoTrail
Valued Contributor
Valued Contributor


Joined: 18 Feb 2003
Posts: 572
Location: Bergen, Norway

PostPosted: Fri Feb 21, 2003 8:06 am    Post subject: Reply with quote

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 Wink

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 Wink

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Fri Feb 21, 2003 2:23 pm    Post subject: Reply with quote

GeoTrail wrote:
Thanks Smile

Annoying popups there Laughing
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... Sad


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
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 4 Source Code All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
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

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group