store/restore parts of the screen
store/restore parts of the screen
Could someone please help?
Thanks in advance
Otto
Thanks in advance
Otto
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: store/restore parts of the screen
You should not need to save/restore screen under Windows (or any other GUI).
What do you want to achieve, exactly?
EMG
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
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
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
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
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
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
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Just use the paint event of any container.Otto wrote:How is it made inside?
You can't. What if the board is covered by another window? It has to repaint itself.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.
EMG
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
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.
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.
Saludos
R.F.
R.F.
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
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