Page 1 of 1

On Paint, define please

Posted: Wed Feb 01, 2017 7:40 pm
by bluebird
If a window had an ON PAINT action, does this mean that if any Bos Taurus function is called the action will proceed?

Is it just applicable to BT commands?

Sorry if this is too elementary but what is "painting" exactly?

On Paint, define please

Posted: Sat Feb 04, 2017 4:04 pm
by Pablo César
bluebird wrote: Wed Feb 01, 2017 7:40 pm If a window had an ON PAINT action, does this mean that if any Bos Taurus function is called the action will proceed?

Is it just applicable to BT commands?

Sorry if this is too elementary but what is "painting" exactly?
Hil Bill,

On Paint, it means as it draws the canvas. While the screen is built.

ON PAINT (event) has nothing to do with BossTaurus library

Re: On Paint, define please

Posted: Sun Feb 05, 2017 12:45 am
by bluebird
Thanks for the reply.

Does this mean that if I place msgbox("Am I here") inside the ON Paint function, it will pop up for every dot that I draw in a line,
or does it pop up once for each line or other object placed in the form?

On Paint, define please

Posted: Sun Feb 05, 2017 4:08 pm
by Pablo César
Hi Bill,

I'm not the best person to clarify how ON PAINT works on HMG, let alone an expert on Windows.
I just decided to clarify your doubts a little more and pass on what I just know.

What I think is that the event "ON PAINT" refers to the construction of the window and this refers to everything to which an image is emitted.
That's why Dr. Claudio has given several examples, because BosTaurus is an image manipulation library.
bluebird wrote: Sun Feb 05, 2017 12:45 am Does this mean that if I place msgbox("Am I here") inside the ON Paint function, it will pop up for every dot that I draw in a line,
or does it pop up once for each line or other object placed in the form?
I do not think so. Do you have your own test already to know the result ?

I have prepared, alias I adapted an example where you can see the difference making a background of screen in "ON PAINT" and out of it:
 
BosTaurus_Demo1.rar
Bos Taurus Source files - Demo1 (modified)
(110.69 KiB) Downloaded 238 times
 
  1. You can compile this demo and test by:
    1. Click on new button "Edge" and see a rectangle made around the image.
    2. Try to minimize and then restore it again the same window/session.
    You will see the Edge effects it has disappeared... :|
    This result is because edge was applied after ON PAINTing process.
     
  2. Now you can remove the comment characters (/* and */) at line # 40 where form ON PAINT is, but let the command character.
    Save it and re-compile again. You will see with the same procedure of minimizing/restoring as previous instruction that the egde will be displayed forever because now it has constructed at ON PAINT.
I hope you have clarified your doubts a bit more Bill.
 
@ Claudio

En el Demo1 del Bos Taurus SAMPLES hice algunos cambios y si te gustan lo puedes remplazarlos a tu gusto:
  • Alteré las imagenes con el recuadrado en color diferenciado de acuerdo su extension.
  • Adicioné en el .RC para que funcione de acuerdo
  • Agregué la funcion Proc_ON_CLICK para que cambie los archivos de imagenes
  • Agregué parametros, variables y dejé el código un poco más limpio
  • Agregué tambien la funcion DrawEdge que llama la funcion BT_DRAWEDGE y tuve dificultad en encontrar los valores nWidth y nHeight ya que no son los mismos que se utilizaron con la funcion BT_DrawBitmap. :?
Digo dificultad con BT_DRAWEDGE porque no encontré ejemplo alguno y como te habia dicho anteriormente, no esta función no está documentada.
Seria bueno conseguir otro ejemplo mejor con respecto al manejo del ancho y altura como tambien incluirla en la documentacion del Bos Taurus. Puede ser ?