| View previous topic :: View next topic |
| Author |
Message |
GeoTrail Valued Contributor


Joined: 18 Feb 2003 Posts: 572 Location: Bergen, Norway
|
Posted: Wed Jun 11, 2003 10:55 pm Post subject: EDIT object, only 3 styles? |
|
|
Isn't it possible to add more than 3 styles for a note object?
| Code: | | DIALOG ADD,EDIT,NOTE,80,8,192,160,,,MULTI,SCROLL,WRAP |
And one more thing, how can I make an event when the text inside the edit object is changed? _________________
 |
|
| Back to top |
|
 |
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2150 Location: A House
|
Posted: Thu Jun 12, 2003 12:17 am Post subject: |
|
|
Yes, it's possible to have more styles, but the dialog designer is limited
to so many fields. You have to add more styles in the editor itself.
For catching changes to an edit box, I'd use a :TIMER loop. When you
first load the program, "%A = @dlgtext(EDIT1)". In the timer loop
you just compare %A with the current contents like this
"IF @not(@equal(%A,@dlgtext(EDIT1)))"
If it's not equal, then something has changed and you can take appropriate
actions.
-Garrett _________________ 'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.) |
|
| Back to top |
|
 |
GeoTrail Valued Contributor


Joined: 18 Feb 2003 Posts: 572 Location: Bergen, Norway
|
Posted: Thu Jun 12, 2003 12:20 am Post subject: |
|
|
Aaa great idea.
Thanks for that Garrett  _________________
 |
|
| Back to top |
|
 |
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2150 Location: A House
|
Posted: Thu Jun 12, 2003 12:23 am Post subject: |
|
|
Oh, one more thing... If the contents do change, then you need to fill
%A with the new contents again if you want to continue to monitor
further changes to the contents of that edit box.
| Code: | If @not(@equal(%A,@dlgtext(EDIT1)))
REM -- do what you need to do here
%A = @dlgtext(EDIT1)
End |
-Garrett _________________ 'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.) |
|
| Back to top |
|
 |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Thu Jun 12, 2003 3:38 pm Post subject: |
|
|
geotrail,
there is an api that you can use from withing vds to detect whether an edit box has been modified or not...i use it often and it is very handy...can't tell you which one at the moment as i'm not running vds on my new computer...if you are stuck in that you can't find it, let me know and i will look up the code for you once i have vds reinstalled on my machine
the api "book" is available from vdsworld and has lots of very useful api's one can use in vds
Serge _________________
|
|
| Back to top |
|
 |
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2150 Location: A House
|
Posted: Thu Jun 12, 2003 7:03 pm Post subject: |
|
|
But can an event be generated using this api? Or do you have to check
in a timer loop like I do with the @dlgtext() above?
-Garrett _________________ 'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.) |
|
| Back to top |
|
 |
GeoTrail Valued Contributor


Joined: 18 Feb 2003 Posts: 572 Location: Bergen, Norway
|
Posted: Thu Jun 12, 2003 10:19 pm Post subject: |
|
|
Yeah that would be very usefull Serge
Thanks _________________
 |
|
| Back to top |
|
 |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Thu Jun 12, 2003 10:41 pm Post subject: |
|
|
garrett,
you need to use a timer label to check regularly but the advantage with that is that any modification made is picked up just as in any windows word processor
geotrail,
the api is,
| Code: |
%%dummy = @sendmsg(@win(~edit1),$0B8,0,0)
if @equal(%%dummy,1)
rem edit has been modified
elsif @equal(%%dummy,0)
rem edit has not been modified
end
|
you will also need the following api to manually set the "modified" or "not modified" flag
| Code: |
rem next line sets edit1 to "has not been modified"
%%dummy = @sendmsg(@win(~edit1),$0B9,0,0)
rem next line sets edit1 to "has been modified"
%%dummy = @sendmsg(@win(~edit1),$0B9,1,0)
|
check out the other api's available for edit boxes, there are some very useful ones including get line count of edit box, get number of characters in edit box, make edit box read only, and more...
Serge _________________
|
|
| Back to top |
|
 |
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2150 Location: A House
|
Posted: Thu Jun 12, 2003 10:56 pm Post subject: |
|
|
Well, either way then. They both do the same thing, so GeoTrail, pick
which one you like
-Garrett _________________ 'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.) |
|
| Back to top |
|
 |
GeoTrail Valued Contributor


Joined: 18 Feb 2003 Posts: 572 Location: Bergen, Norway
|
Posted: Thu Jun 12, 2003 11:13 pm Post subject: |
|
|
Thanks Serge.
I've never used @sendmsg() before
Is there a way to get the url entered in the address bar of IE? _________________
 |
|
| Back to top |
|
 |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Thu Jun 12, 2003 11:30 pm Post subject: |
|
|
no problems geotrail...do look into these api's, they really extend the functionality of vds and not just with edit boxes but with lists too, combo boxes and windows in general
to answer your question, yes there is but it is very complicated...this is what i have found anyway...can't help more now because vds is not on my pc...nor are my code files...+ i am writing school reports at the moment...will get back to you on that one later on if you are still interested
Serge _________________
|
|
| Back to top |
|
 |
GeoTrail Valued Contributor


Joined: 18 Feb 2003 Posts: 572 Location: Bergen, Norway
|
Posted: Fri Jun 13, 2003 12:00 am Post subject: |
|
|
OK, thanks Serge.
Any A+'s in there?  _________________
 |
|
| Back to top |
|
 |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Fri Jun 13, 2003 4:09 am Post subject: |
|
|
he he he...yes there are a few A+'s in there...some students are really really smart
Serge _________________
|
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Fri Jun 13, 2003 8:40 pm Post subject: |
|
|
| GeoTrail wrote: | Thanks Serge.
I've never used @sendmsg() before
Is there a way to get the url entered in the address bar of IE? |
I think I saw an example using DDE somewhere here. Let me check for ya.  _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
|
| Back to top |
|
 |
|