No Existe Propiedad Background En Textedit!!!


Goto page 1, 2  Next

Subject: No Existe Propiedad Background En Textedit!!!
buenas, como saben estoy trabajando mucho con la clase textedit va conociéndola mas internamente.

ya he dicho que la función foreground del textedit a mi entender no funciona!!
pues ahora me di cuenta que la funcion background es falsa, pues no actua sobre el documento html sino sobre el fondo de la clase textedit, si le asignamos background al textedit vemos como cambia de fondo pero si exportamos a un documento el richtext vemos que el fondo no se ha modificado y si observamos el richtext en vivo nos damos cuenta que no se modifica jamas el richtext con respecto al fondo.

esta clase tiene varios defectos a corregir!! que piensan ustedes???

Last edited by v3ctor on Friday, 29 November 2019, 17:40; edited 1 time in total
Subject: Re: No Existe Propiedad Background En Textedit!!!
v3ctor escribió:  
... si exportamos a un documento el richtext ...

De que manera ?

Profile PM  
Subject: Re: No Existe Propiedad Background En Textedit!!!
vuott escribió:  
v3ctor escribió:  
... si exportamos a un documento el richtext ...

De que manera ?


file.save&/"prueba.html", textedit.richtext

Subject: Re: No Existe Propiedad Background En Textedit!!!
Prueba este codigo (usar libreria grafica QT4 o QT5):

Public Sub Form_Open()

' Colorea el fondo del "TextEdit" en amarillo:
TextEdit1.RichText = "<BODY BGColor=\"#FFFF00\">"

End


' Después de escribir en el "Textedit", hacer clic en este botón:
Public Sub Button1_Click()

File.Save("/tmp/prueba.html", TextEdit1.RichText)

End


...en fin abrir manualmente el archivo prueba.html.

Last edited by vuott on Sunday, 01 December 2019, 01:50; edited 1 time in total
Profile PM  
Subject: Re: No Existe Propiedad Background En Textedit!!!
vuott escribió:  
Prueba este codigo (usar libreria grafica QT4 o QT5):

Public Sub Form_Open()

' Colorea el fondo del "TextEdit" en amarillo:
TextEdit1.RichText = "<BODY>"

End


' Después de escribir en el "Textedit", hacer clic en este botón:
Public Sub Button1_Click()

File.Save("/tmp/prueba.html", TextEdit1.RichText)

End


...en fin abrir manualmente el archivo prueba.html.


si es la solución que estaba pensando hay tres formas de ingresar el color yo voy a usar rgb pues esos tres números ya lo tiene la clase que hice namecolor, la cual tiene el nombre del color y sus rgb. de todas maneras es algo a revisar por el creador de la clase textedit.


COLOR DE FONDO

<body>
</body>

<body>
</body>

<body>
</body>

AQUA:0,255,255
AQUAMARINE:127,255,212
AZURE:240,255,255
BEIGE:245,245,220
BISQUE:255,228,196
BLACK:0,0,0
CADETBLUE:95,158,160 etc...

Subject: Re: No Existe Propiedad Background En Textedit!!!
vuott, el body ya esta en el richtext, hay que ver como remplazar o agregar el "gbcolor=rgb(34,35,66);" o algo por el estilo ya que la idea es que el documento se vea igual que en el programa visorrv1960.

Last edited by v3ctor on Monday, 02 December 2019, 02:01; edited 1 time in total
Subject: Re: No Existe Propiedad Background En Textedit!!!
v3ctor escribió:  
vuott, el body ya esta en el richtext

Eh... prueba solo usando <gbcolor=....>.



v3ctor escribió:  
hay que ver como remplazar o agregar el "gbcolor=rgb(34,35,66);"


¿Cuál es la diferencia entre FF0000 y ....rgb(255,0,0) ?

Profile PM  
Subject: Re: No Existe Propiedad Background En Textedit!!!
ahora que veo tengo que usar bgcolor y un numero hexadecimal pero el selector de color me tira un integer,

tendré que convertirlo a hexadecimal uf no recuerdo como se hace!!!


Print txtEcapitulo1.Background
Print "hexa=" & Hex(txtEcapitulo1.Background)
Print "linea final:" & "<body bgcolor=#" & Hex(txtEcapitulo1.Background)

Last edited by v3ctor on Monday, 02 December 2019, 01:09; edited 1 time in total
Subject: Re: No Existe Propiedad Background En Textedit!!!
v3ctor escribió:  
tendré que convertirlo a hexadecimal uf no recuerdo como se hace!!!


Mira aquì:

https://www.gambas-it.org/wiki/inde..._ad_Esadecimale

Profile PM  
Subject: Re: No Existe Propiedad Background En Textedit!!!
NuevoRichText = Replace(txtEcapitulo1.RichText, "<body ", "<body gbcolor=\"#" & Hex(txtEcapitulo1.Background) & "\" ")


con esa linea funciona en el textedit pero no asi en el navegador

puede ser que los navegadores no soporten un sin números de colores ??

voy a probar con colores clásicos a ver.

Last edited by v3ctor on Monday, 02 December 2019, 01:32; edited 1 time in total
Goto page 1, 2  Next

Page 1 of 2


  
You cannot post new topics
You cannot reply to topics
You cannot edit your posts
You cannot delete your posts
You cannot vote in polls
You cannot attach files
You can download files
You cannot post calendar events

   

This is a "Lo-Fi" version of our main content. To view the full version with more information, formatting and images, please click here.

Powered by Icy Phoenix based on phpBB
Design by DiDiDaDo

Generation Time: 0.1047s (PHP: -26% SQL: 126%)
SQL queries: 27 - Debug Off - GZIP Enabled