Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.clipper.visual-objects > #4934 > unrolled thread
| Started by | Lu <lu2k@hotmail.com> |
|---|---|
| First post | 2013-03-21 03:22 -0700 |
| Last post | 2013-04-18 23:15 +0200 |
| Articles | 10 — 5 participants |
Back to article view | Back to comp.lang.clipper.visual-objects
Different colors in MulitlineEdit Lu <lu2k@hotmail.com> - 2013-03-21 03:22 -0700
Re: Different colors in MulitlineEdit "Wolfgang Riedmann" <wriedmann@gmail.com> - 2013-03-21 11:43 +0100
Re: Different colors in MulitlineEdit Lu <lu2k@hotmail.com> - 2013-03-21 04:30 -0700
Re: Different colors in MulitlineEdit "Wolfgang Riedmann" <wriedmann@gmail.com> - 2013-03-21 14:13 +0100
Re: Different colors in MulitlineEdit Lu <lu2k@hotmail.com> - 2013-03-21 08:11 -0700
Re: Different colors in MulitlineEdit "Wolfgang Riedmann" <wriedmann@gmail.com> - 2013-03-21 16:54 +0100
Re: Different colors in MulitlineEdit "Er!k \\/!$$Er" <nospam@nospam.url> - 2013-03-21 18:34 +0100
Re: Different colors in MulitlineEdit Alain Carpentier <alain.dot.carpentier@brutele.dot.be> - 2013-03-21 22:28 +0100
Re: Different colors in MulitlineEdit Lu <lu2k@hotmail.com> - 2013-03-22 00:57 -0700
Re: Different colors in MulitlineEdit "Urs Eggmann" <Urs.Eggmann@shinternet.ch> - 2013-04-18 23:15 +0200
| From | Lu <lu2k@hotmail.com> |
|---|---|
| Date | 2013-03-21 03:22 -0700 |
| Subject | Different colors in MulitlineEdit |
| Message-ID | <80844b9e-a232-4111-aeab-d1330d0515a4@googlegroups.com> |
Hi! Is it possible to have different colors (foreground) in a multiline edit control? Thanks for any hints Lu
[toc] | [next] | [standalone]
| From | "Wolfgang Riedmann" <wriedmann@gmail.com> |
|---|---|
| Date | 2013-03-21 11:43 +0100 |
| Message-ID | <ar06j4F41urU1@mid.individual.net> |
| In reply to | #4934 |
Hi Lu, > Is it possible to have different colors (foreground) in a multiline > edit control? in the same one, i.e. a few chars in red, a few in green? If this is what you would like to have, you should use the RTF control. Wolfgang --
[toc] | [prev] | [next] | [standalone]
| From | Lu <lu2k@hotmail.com> |
|---|---|
| Date | 2013-03-21 04:30 -0700 |
| Message-ID | <b1a01d0e-d347-4ad3-8388-d8fec427565f@googlegroups.com> |
| In reply to | #4934 |
Hi Wolfgang! Thank you for your quick answer. Yes, in the same one, and how do I have to write it, to color e.g. the second row/or second word. Lu
[toc] | [prev] | [next] | [standalone]
| From | "Wolfgang Riedmann" <wriedmann@gmail.com> |
|---|---|
| Date | 2013-03-21 14:13 +0100 |
| Message-ID | <ar0fb9F5vp2U1@mid.individual.net> |
| In reply to | #4937 |
Hi Lu, > Thank you for your quick answer. Yes, in the same one, and how do I > have to write it, to color e.g. the second row/or second word. so the RTF control is your friend, as already written. Wolfgang --
[toc] | [prev] | [next] | [standalone]
| From | Lu <lu2k@hotmail.com> |
|---|---|
| Date | 2013-03-21 08:11 -0700 |
| Message-ID | <7f2c7f98-73fe-4102-88df-7599c70054ea@googlegroups.com> |
| In reply to | #4934 |
I have never used a RTF control, so are there some examples where eg. the second row has another color than the first row... or something similar examples? I could not find much information in the VO help. There is only a text, and on Cellselect in bBrowser it will be changed. On a condition a text in the rtf control should be highlighted. Lu
[toc] | [prev] | [next] | [standalone]
| From | "Wolfgang Riedmann" <wriedmann@gmail.com> |
|---|---|
| Date | 2013-03-21 16:54 +0100 |
| Message-ID | <ar0oq7F82t9U1@mid.individual.net> |
| In reply to | #4941 |
Hi Lu, > I have never used a RTF control, so are there some examples where eg. > the second row has another color than the first row... or something > similar examples? > > I could not find much information in the VO help. > > There is only a text, and on Cellselect in bBrowser it will be > changed. On a condition a text in the rtf control should be > highlighted. you will find nothing about this in the help because it is not a VO issue at all, but a Windows API issue. To change color om some parts in a RTF control, you need to read the value, change the formatting and assign the new (formatted) text. Unfortunately I don't have any code to show this - and not the time to write and test such a part of code. Wolfgang --
[toc] | [prev] | [next] | [standalone]
| From | "Er!k \\/!$$Er" <nospam@nospam.url> |
|---|---|
| Date | 2013-03-21 18:34 +0100 |
| Message-ID | <ar0ulpF9d6pU1@mid.individual.net> |
| In reply to | #4941 |
Perhaps it is a good idea to have a look at the samples that come with VO (VOPad). Erik "Lu" schreef in bericht news:7f2c7f98-73fe-4102-88df-7599c70054ea@googlegroups.com... I have never used a RTF control, so are there some examples where eg. the second row has another color than the first row... or something similar examples? I could not find much information in the VO help. There is only a text, and on Cellselect in bBrowser it will be changed. On a condition a text in the rtf control should be highlighted. Lu
[toc] | [prev] | [next] | [standalone]
| From | Alain Carpentier <alain.dot.carpentier@brutele.dot.be> |
|---|---|
| Date | 2013-03-21 22:28 +0100 |
| Message-ID | <kifu19$o44$1@speranza.aioe.org> |
| In reply to | #4941 |
An example
LOCAL r AS RTF
LOCAL c as string
r := rtf{}
c := r:Debut() + r:Color(1) + r:Gras + "BOLD RED" + r:Plain() + r:Par
+ r:Soul + r:Color(11) + "UNDERLINED BLUE" + r:Plain() + r:Par + r:Fin
oRichEdit:Value := c
----------------------------------------
CLASS RTF
INSTANCE cTableFont AS STRING
INSTANCE cTableColor AS STRING
EXPORT dwSize as DWORD
EXPORT dwPolice AS DWORD
EXPORT dwColor AS DWORD
METHOD Color(nColor) CLASS RTF
local cReturn as string
IF IsNumeric(nColor)
self:dwColor := nColor
endif
cReturn := "\cf" + NTrim(self:dwColor)
RETURN cReturn
METHOD Debut(nPolice, nSize, nColor) CLASS RTF
RETURN "{\rtf1\ansi\deff0\deftab720"+ SELF:cTableFont + CRLF +
SELF:cTableColor +;
CRLF +
"\deflang1036\pard\tx0\tx0\tx0\tx0\tx0\tx0\tx0\tx0\tx0\tx0\tx0\tx0\tx0\tx0\plain"
+;
self:Police(nPolice) + self:Taille(nSize) + self:Color(nColor)
ACCESS Fin CLASS RTF
RETURN SELF:Plain() + CRLF + "\par }"
ACCESS Gras CLASS RTF
RETURN "\b "
METHOD Init() CLASS RTF
SELF:cTableFont := "{\fonttbl"+;
"{\f0\fswiss MS Sans Serif;}"+; // police 0
"{\f1\fmodern\fprq1 Courier New;}"+; // police 1
"{\f2\fswiss\fprq2 Arial;}"+; // police 2
"}"
SELF:cTableColor := "{\colortbl" + ;
"\red0\green0\blue0;" +; // cf0 Noir
"\red128\green0\blue0;" +; // cf1 Rouge foncé
"\red128\green128\blue0;" +; // cf2 Marron clair
"\red0\green0\blue128;" +; // cf3 Bleu foncé
"\red128\green0\blue128;" +; // cf4 Violet
"\red0\green128\blue0;" +; // cf5 vert
"\red128\green128\blue128;" +; // cf6 Gris clair
"\red192\green192\blue192;" +; // cf7 Gris foncé
"\red255\green0\blue0;" +; // cf8 Rouge
"\red0\green128\blue128;" +; // cf9 Bleu-vert
"\red255\green255\blue0;" +; // cf10 Jaune
"\red0\green0\blue255;" +; // cf11 Bleu
"\red255\green0\blue255;" +; // cf12 Magenta
"\red0\green255\blue0;" +; // cf13 Vert
"\red255\green255\blue255;" +; // cf14 Blanc
"\red0\green255\blue255;}" // cf15 Cyan
self:dwSize := 10
self:dwPolice := 2
self:dwColor := 0
RETURN SELF
ACCESS Ital CLASS RTF
RETURN "\i "
ACCESS Par CLASS RTF
RETURN CRLF + "\par "
METHOD Plain(nPolice, nSize, nColor) CLASS RTF
RETURN "\plain" + self:Police(nPolice) + self:Taille(nSize) +
self:Color(nColor) + " "
METHOD Police(nPolice) CLASS RTF
LOCAL cReturn AS STRING
IF IsNumeric(nPolice)
SELF:dwPolice := nPolice
endif
DO CASE
CASE self:dwPolice = 1
cReturn := "\f1"
CASE self:dwPolice = 2
cReturn := "\f2"
otherwise
cReturn := "\f2"
ENDCASE
RETURN cReturn
METHOD RC2PAR(cTexte) CLASS RTF
local cReturn as string
Default(@cTexte, "")
// remplacer les retours chariots par des "\par "
if IsString(cTexte)
cReturn := StrTran(cTexte,retourchariot,"\par ")
endif
RETURN cReturn
ACCESS Soul CLASS RTF
RETURN "\ul "
ACCESS Tab CLASS RTF
RETURN "\tab "
METHOD Taille(nSize) CLASS RTF
local cReturn as string
if IsNumeric(nSize)
self:dwSize := nSize
endif
cReturn := "\fs" + NTrim(self:dwSize*2)
RETURN cReturn
Alain
Le 21/03/2013 16:11, Lu a écrit :
> I have never used a RTF control, so are there some examples where eg. the second row has another color than the first row... or something similar examples?
>
> I could not find much information in the VO help.
>
> There is only a text, and on Cellselect in bBrowser it will be changed. On a condition a text in the rtf control should be highlighted.
>
> Lu
>
[toc] | [prev] | [next] | [standalone]
| From | Lu <lu2k@hotmail.com> |
|---|---|
| Date | 2013-03-22 00:57 -0700 |
| Message-ID | <2259ff02-f7d8-4ccd-95ca-8ac0a162a5c0@googlegroups.com> |
| In reply to | #4934 |
Thank you for your help....I will try it Lu
[toc] | [prev] | [next] | [standalone]
| From | "Urs Eggmann" <Urs.Eggmann@shinternet.ch> |
|---|---|
| Date | 2013-04-18 23:15 +0200 |
| Message-ID | <atb63hFq6mlU1@mid.individual.net> |
| In reply to | #4934 |
Hi Lu, Sorry for my late jumping in. See the Downloads on www.voug-bodensee.net there is a sample from Markus Feser (http://www.voug-bodensee.net/Zip-Download/RTFSampleVOUG%20Bodensee.zip) dealing with your question. Regards Urs "Lu" <lu2k@hotmail.com> schrieb im Newsbeitrag news:80844b9e-a232-4111-aeab-d1330d0515a4@googlegroups.com... > Hi! > > Is it possible to have different colors (foreground) in a multiline edit > control? > > Thanks for any hints > > Lu >
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.clipper.visual-objects
csiph-web