Could someone please help?
Thanks in advance
Otto
Could someone please help?
Thanks in advance
Otto
You should not need to save/restore screen under Windows (or any other GUI).
What do you want to achieve, exactly?
EMG
Hello Enrico,
I need an undo function on painting lines.
Please have a look at:
http://www.winhotel.net/1plan5/
(press mouse-button and keep it down )
In this case I use asp and js but I need the same in FW.
Otto
You don't have to save/restore screen. Instead you have to use a control that knows how to repaint itself. This is the basics of event driven programming.
In details, the board repaints itself using a list of lines coordinates. When you remove a line really remove its coordinates from the list and then refresh the board.
EMG
A control for this as far as I know doesn’t exist.
Therefore you have to do it yourself.
>control that knows how to repaint itself
How is it made inside?
To refresh the board if it is full of information is a time-consuming task.
Therefore it would be better only to restore a part of the screen.
Otto
Otto wrote:How is it made inside?
Otto wrote:To refresh the board if it is full of information is a time-consuming task.
Therefore it would be better only to restore a part of the screen.
>You can't. What if the board is covered by another window? It has to repaint itself.
Shure I have a repaint-button, too. But a window which covers another window must restore the background if you close it.
Or am I wrong?
Otto
Otto wrote:Shure I have a repaint-button, too. But a window which covers another window must restore the background if you close it.
Or am I wrong?
Otto:
Enrico is Right !!!!!, it's very easy to creat a control that repaints itself from source code:
http://www.google.d2g.com/objeto/prueba2d.exe
In this sample I draw by hand a grid to later print a line graph, as you can notice, you can resize the window container and the graph will paint itself as necesary, there's no delay or time comsuming with it.
If you try this sample:
http://www.google.d2g.com/objeto/test2.exe
I have converted the previous code into a control code, play around with buttons and you will see how the graphs change in run time, with no speed degradation at all.
, this is the sample:
Maybe is what you need.
Thank you Rene. These are nice samples.
I the meantime I had a closer look into Pezold and read about WM_PAINT and InvalidateRect.
Please could you have a look at the topic:
Can I change the report viewer ?
Isn't that a heavy-duty to repaint the whole window every time you move the mouse?
HairCross Cursor:
Insert
oMeta1:bMMoved:={|y,x,flags|hairCross(oMeta1,y,x) }
in FUNCTION RPreview( oDevice ) in rpreview.prg.
func hairCross(oMeta1,y,x)
nCount:=nCount+1
IF nCount > 5
nCount:=0
oMeta1:refresh()
sysrefresh()
oMeta1:line (0,x,1800,x)
oMeta1:line (y,0,y,1500)
ENDIF
return nil