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


Joined: 11 Jun 2001 Posts: 625 Location: Northern Ireland
|
Posted: Thu Dec 12, 2002 4:14 pm Post subject: RICHEDIT Object (vdsobj.dll) |
|
|
This is what i want to add to a richedit object :
OBJECT LOADFILE,RICHEDIT1,lst.rtf
OBJECT FORMAT,RICHEDIT1,SETFONT,Arial,12,RED
OBJECT append,RICHEDIT1,COLOUR
OBJECT FORMAT,RICHEDIT1,SETFONT,Verdana,10,BLACK
OBJECT APPEND,RICHEDIT1,My text
OBJECT SAVEFILE,RICHEDIT1,lst.rtf
It won;t change and save the different colour for each line. Any ideas? |
|
| Back to top |
|
 |
PGWARE Web Host

Joined: 29 Dec 2001 Posts: 1565
|
Posted: Thu Dec 12, 2002 4:48 pm Post subject: |
|
|
| What you have to do is use the FORMAT SELECT command to select the first character in the line (even if there is no character there) it basically just sets the cursor pointer there so it knows where to start the new formating of colors/fonts. Take a look at the rather crude example I included with the vdsobj. |
|
| Back to top |
|
 |
Rubes_sw Valued Contributor


Joined: 11 Jun 2001 Posts: 625 Location: Northern Ireland
|
Posted: Thu Dec 12, 2002 4:53 pm Post subject: |
|
|
I still can't get it to work :
heres the code:
OBJECT LOADFILE,RICHEDIT1,lst.rtf
OBJECT FORMAT,RICHEDIT1,SETFONT,Arial,12,RED
OBJECT APPEND,RICHEDIT1,COLOUR @cr()
OBJECT COMMAND,RICHEDIT1,CLIPBOARD,SELECT,@len(@object(dlgtext,richedit1)),@len(@object(dlgtext,richedit1))
OBJECT COMMAND,RICHEDIT1,@cr()
OBJECT COMMAND,RICHEDIT1,SETFONT,Arial,10,BLACK
OBJECT APPEND,RICHEDIT1,Heres more text but different color and size
OBJECT SAVEFILE,RICHEDIT1,lst.rtf
I want to basicaly create a file, add a coloured line to it, save it, then repeat the process. Allowing different coloured lines of text.
Nathan |
|
| Back to top |
|
 |
PGWARE Web Host

Joined: 29 Dec 2001 Posts: 1565
|
Posted: Thu Dec 12, 2002 5:28 pm Post subject: |
|
|
Hi Nathan, you seem to have a very old version of VDSOBJ, because your using the OBJECT COMMAND which no longer exists in the current version. First download the new version of VDSOBJ, then use the following code:
| Code: |
external vdsobj.dll
title Test
DIALOG CREATE,Test,-1,0,536,525,CLASS mywindow
OBJECT CLASS,mywindow
OBJECT ADD,RICHEDIT,RICHEDIT1,10,10,400,400,,WRAP
DIALOG SHOW
OBJECT LOADFILE,RICHEDIT1,lst.rtf
OBJECT APPEND,RICHEDIT1,@cr()@cr()
OBJECT FORMAT,RICHEDIT1,CLIPBOARD,SELECT,@len(@object(dlgtext,richedit1)),@len(@object(dlgtext,richedit1))
OBJECT FORMAT,RICHEDIT1,SETFONT,Arial,12,RED
OBJECT APPEND,RICHEDIT1,COLOUR
OBJECT FORMAT,RICHEDIT1,@cr()@cr()
OBJECT FORMAT,RICHEDIT1,CLIPBOARD,SELECT,@len(@object(dlgtext,richedit1)),@len(@object(dlgtext,richedit1))
OBJECT FORMAT,RICHEDIT1,SETFONT,Arial,10,BLACK
OBJECT APPEND,RICHEDIT1,Heres more text but different color and size
OBJECT SAVEFILE,RICHEDIT1,lst.rtf
:evloop
wait event
goto @event()
:close
exit
|
|
|
| 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
|
|