Repaint static / bitmap

This forum is for eXpress++ general support.
Message
Author
User avatar
jdsoft
Posts: 113
Joined: Thu Jan 28, 2010 1:13 pm
Location: Overberg
Contact:

Repaint static / bitmap

#1 Post 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
Attachments
Paint_Express.zip
Paint sample in express
(150.87 KiB) Downloaded 721 times
Regards,
Jack Duijf

User avatar
Auge_Ohr
Posts: 1407
Joined: Wed Feb 24, 2010 3:44 pm

Re: Repaint static / bitmap

#2 Post 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
greetings by OHR
Jimmy

User avatar
jdsoft
Posts: 113
Joined: Thu Jan 28, 2010 1:13 pm
Location: Overberg
Contact:

Re: Repaint static / bitmap

#3 Post 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
Regards,
Jack Duijf

User avatar
Auge_Ohr
Posts: 1407
Joined: Wed Feb 24, 2010 3:44 pm

Re: Repaint static / bitmap

#4 Post 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 ?
greetings by OHR
Jimmy

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Repaint static / bitmap

#5 Post 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
The eXpress train is coming - and it has more cars.

User avatar
jdsoft
Posts: 113
Joined: Thu Jan 28, 2010 1:13 pm
Location: Overberg
Contact:

Re: Repaint static / bitmap

#6 Post 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
Regards,
Jack Duijf

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Repaint static / bitmap

#7 Post 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
The eXpress train is coming - and it has more cars.

User avatar
jdsoft
Posts: 113
Joined: Thu Jan 28, 2010 1:13 pm
Location: Overberg
Contact:

Re: Repaint static / bitmap

#8 Post 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
Regards,
Jack Duijf

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Repaint static / bitmap

#9 Post by rdonnay »

I tried that, but it makes the bitmap disappear and paints a black background.
The eXpress train is coming - and it has more cars.

User avatar
jdsoft
Posts: 113
Joined: Thu Jan 28, 2010 1:13 pm
Location: Overberg
Contact:

Re: Repaint static / bitmap

#10 Post 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?
Attachments
Paint_Express.zip
(205.15 KiB) Downloaded 712 times
Regards,
Jack Duijf

Post Reply