Portal    Foro    Buscar    FAQ    Registrarse    Conectarse

No Existe Propiedad Background En Textedit!!!

No Existe Propiedad Background En Textedit!!!
Artículo
Responder citando    Descargar mensaje  
Mensaje 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???



 
última edición por v3ctor el Viernes, 29 Noviembre 2019, 17:40; editado 1 vez 
v3ctor - Ver perfil del usuario Enviar mensaje privado  
v3ctor [ Viernes, 29 Noviembre 2019, 17:40 ]
 


No Existe Propiedad Background En Textedit!!!
Comentarios
Responder citando    Descargar mensaje  
Mensaje Re: No Existe Propiedad Background En Textedit!!! 
 
v3ctor escribió:  
... si exportamos a un documento el richtext ...

De que manera ?



 
vuott - Ver perfil del usuario Enviar mensaje privado  
vuott [ Sabado, 30 Noviembre 2019, 00:52 ]
Responder citando    Descargar mensaje  
Mensaje 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



 
v3ctor - Ver perfil del usuario Enviar mensaje privado  
v3ctor [ Sabado, 30 Noviembre 2019, 23:50 ]
Responder citando    Descargar mensaje  
Mensaje 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.



 
última edición por vuott el Domingo, 01 Diciembre 2019, 01:50; editado 1 vez 
vuott - Ver perfil del usuario Enviar mensaje privado  
vuott [ Domingo, 01 Diciembre 2019, 01:43 ]
Responder citando    Descargar mensaje  
Mensaje 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...



 
v3ctor - Ver perfil del usuario Enviar mensaje privado  
v3ctor [ Domingo, 01 Diciembre 2019, 04:46 ]
Responder citando    Descargar mensaje  
Mensaje 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.



 
última edición por v3ctor el Lunes, 02 Diciembre 2019, 02:01; editado 1 vez 
v3ctor - Ver perfil del usuario Enviar mensaje privado  
v3ctor [ Domingo, 01 Diciembre 2019, 04:50 ]
Responder citando    Descargar mensaje  
Mensaje 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) ?



 
vuott - Ver perfil del usuario Enviar mensaje privado  
vuott [ Domingo, 01 Diciembre 2019, 16:11 ]
Responder citando    Descargar mensaje  
Mensaje 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)




 
última edición por v3ctor el Lunes, 02 Diciembre 2019, 01:09; editado 1 vez 
v3ctor - Ver perfil del usuario Enviar mensaje privado  
v3ctor [ Lunes, 02 Diciembre 2019, 01:01 ]
Responder citando    Descargar mensaje  
Mensaje 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



 
vuott - Ver perfil del usuario Enviar mensaje privado  
vuott [ Lunes, 02 Diciembre 2019, 01:07 ]
Responder citando    Descargar mensaje  
Mensaje 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.



 
última edición por v3ctor el Lunes, 02 Diciembre 2019, 01:32; editado 1 vez 
v3ctor - Ver perfil del usuario Enviar mensaje privado  
v3ctor [ Lunes, 02 Diciembre 2019, 01:31 ]
Mostrar mensajes anteriores:    
 
Publicar nuevo tema  Responder al tema  Página 1 de 2
Ir a la página 1, 2  Siguiente
 

Usuarios navegando en este tema: 0 registrados, 0 ocultos y 3 invitados
Usuarios registrados conectados: Ninguno


 



 

cron