Page 1 of 3

Repaint static / bitmap

Posted: Sun Nov 28, 2010 2:24 pm
by jdsoft
Hello,

Attached you find a small test program.
It can paint in different colours on a background bitmap.
If another window is moved over the painted part, and removed, the painted colours disapear.
Then i press the "Repaint" button, an the data is back.
How can i prevent that my painted data is removed in the first place?

Regards,
Jack Duijf

Re: Repaint static / bitmap

Posted: Mon Nov 29, 2010 12:44 am
by Auge_Ohr
jdsoft wrote:If another window is moved over the painted part, and removed, the painted colours disapear.
Then i press the "Repaint" button, an the data is back.
How can i prevent that my painted data is removed in the first place?
in xbpDrawStatic() Class you are "painting" on a Presentationspace().
you need a :draw() Callback Methode to call Methode xbpDrawStatic:Repaint()

Code: Select all

LOCAL oDraw             := xbpDrawStatic():New(,,{0,40},{500,300})
...
   oDraw:draw({|| oDraw:Repaint() }
should do it

Re: Repaint static / bitmap

Posted: Mon Nov 29, 2010 8:47 am
by jdsoft
Hello Auge,

I dis as you suggested:
I changed 1 line of code, notice the EVAL:

Code: Select all

@      0,0   DCSTATIC TYPE XBPSTATIC_TYPE_RAISEDBOX   SIZE 60,12 OBJECT oFoto PARENT oStatic SUBCLASS "xbpDrawStatic()" EVAL {|o|o:Draw({||oFoto:Repaint()})}
Unfortunaly it was not succesful.
What is my mistake?

Regards,
Jack Duijf

Re: Repaint static / bitmap

Posted: Mon Nov 29, 2010 9:03 am
by Auge_Ohr
jdsoft wrote:

Code: Select all

@      0,0   DCSTATIC TYPE XBPSTATIC_TYPE_RAISEDBOX   SIZE 60,12 OBJECT oFoto PARENT oStatic SUBCLASS "xbpDrawStatic()" EVAL {|o|o:Draw({||oFoto:Repaint()})}
i´m not a Express User ...
not shure what you want to do ... did you want to "show" a Bitmap ( oFoto ) on a Static ?
if yes use oStatic:setCaption(oFoto) with oStatic:type := XBPSTATIC_TYPE_BITMAP

Class xbpDrawStatic is to "draw" Bitmap (into PresentationSpace), you do not need
to :draw it (into PresentationSpace) to "show" a Bitmap.
EVAL {|o|o:Draw({||oFoto:Repaint()}}
hm ... is o = oFoto ?

Re: Repaint static / bitmap

Posted: Mon Nov 29, 2010 9:09 am
by rdonnay
Jack -

I don't understand your test app at all.
First of all, it wouldn't compile unless I commented out all references to sy_wintoolbox.*.

Then it fails on DC_ReadModal().

Why would you be calling DC_ReadModal() instead of DCREAD GUI?

Roger

Re: Repaint static / bitmap

Posted: Mon Nov 29, 2010 10:31 am
by jdsoft
Hello Roger,

My mistake.
Please remove #include "Sy_WinToolbox.ch" from Appcons.ch
Please remove "Sy_WinToolbox.LIB" from project.xpj
Replace Dc_ReadModal(...) to DCREAD GUI FIT
Then all does compile with no problem.

Do you have teamviewer?
I can show you my problem.

Regards,
Jack Duijf

Re: Repaint static / bitmap

Posted: Mon Nov 29, 2010 11:28 am
by rdonnay
Jack -

Yes, I do have TeamViewer.
Let me first see if I can reproduce the problem.
If not, I will contact you by Skype.
I was on the phone with Bobby Drakos when you Skyped me and didn't get a chance to respond.
I saw a Skype message popup with your name but then the window disappeared.

Roger

Re: Repaint static / bitmap

Posted: Mon Nov 29, 2010 12:01 pm
by jdsoft
Hello Roger,

After some experimenting, i think i fixed the problem.
I added a xbpDrawStatic:HandleEvent()
It only is a "nervous" sccreen when repaint is done.
I can live with it.
Regards,
Jack Duijf

Code: Select all

Method xbpDrawStatic:HandleEvent(nEvent,mp1,mp2)
::DC_XbpStatic:HandleEvent(nEvent,@mp1,@mp2)
if nEvent == xbeP_Paint
   ::Repaint()
endif
Return SELF

Re: Repaint static / bitmap

Posted: Mon Nov 29, 2010 3:06 pm
by rdonnay
I tried that, but it makes the bitmap disappear and paints a black background.

Re: Repaint static / bitmap

Posted: Tue Nov 30, 2010 1:31 pm
by jdsoft
Hello Roger,

Had the same problem, but now it's fixed.
Attached you find the working sample.

Regards,
Jack Duijf

P.s. Some time ago, you mentioned a webpage to present a Express++ program.
How about that?