Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Sun Nov 18, 2018 9:07 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Floating Canvas
PostPosted: Sun May 20, 2012 9:44 am 
Offline
User avatar

Joined: Sun Aug 05, 2007 10:46 am
Posts: 4931
Location: San Diego, CA
Let me see if I can explain this situation ......
On a form I have TWO canvas... call them Primary and Secondary for purpose of discussion.

Primary covers 80% of the form and is always visible.. Its contents are recalculated only when necessary and its paint event looks something like this

If update_required then recreate_buffer
g.drawpicture buffer,0,0


where "recreate_buffer" builds a picture object called "BUFFER" and resets the update_required flag. so 99% of the time, PAINT just refreshes the PRIMARY canvas with the contents of BUFFER.

The SECONDARY canvas is NOT visible 99% of the time... but when a certain series of events takes place (ie. Mousedown on a particular location on the PRIMARY canvas)....

SECONDARY.VISIBLE = TRUE
and the TOP and LEFT of SECONDARY then track the MOUSE via the DRAG event of PRIMARY
Upon MOUSEUP.... SECONDARY.VISIBLE=FALSE

The idea is that SECONDARY emulates dragging a rectangle across the face of PRIMARY.

Here is the problem. Under OSX.. this works PERFECTLY.. Under Windows... all the above described events take place...but SECONDARY never shows.... I do not know if it never is visible.... if it is at a wrong z-order, or if the combination of my PRIMARY paint event, along with the double buffering (on so Windows doesn't flicker)....

My next idea (one that I'm not really high on)... it to extend the Paint Even of PRIMARY to include code to "draw" what would have been in Secondary.... The code to just "move" another canvas is so much simpler, I'd rather make it work than re-write the whole concept.

Any ideas?

_________________
Dave Sisemore
iMac I7[2012], OSX Mountain Lion 10.8.3 RB2012r2.1
Note : I am not interested in any solutions that involve custom Plug-ins of any kind


Top
 Profile  
Reply with quote  
 Post subject: Re: Floating Canvas
PostPosted: Sun May 20, 2012 11:09 am 
Offline

Joined: Fri Jan 06, 2006 3:21 pm
Posts: 12388
Location: Portland, OR USA
DaveS wrote:
My next idea (one that I'm not really high on)... it to extend the Paint Even of PRIMARY to include code to "draw" what would have been in Secondary

This is the correct solution for non-Mac platforms. Use a single canvas and think of the secondary canvas as an image you move over the primary canvas. You must do in code what the Mac does for you.


Top
 Profile  
Reply with quote  
 Post subject: Re: Floating Canvas
PostPosted: Sun May 20, 2012 11:15 am 
Offline
User avatar

Joined: Sun Aug 05, 2007 10:46 am
Posts: 4931
Location: San Diego, CA
Can you explain WHY Windows won't do this the same way OSX does?

_________________
Dave Sisemore
iMac I7[2012], OSX Mountain Lion 10.8.3 RB2012r2.1
Note : I am not interested in any solutions that involve custom Plug-ins of any kind


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group