New topic: 

Dynamically add content to a window?

<http://forums.realsoftware.com/viewtopic.php?t=34340>

         Page 1 of 1
   [ 4 posts ]                 Previous topic | Next topic          Author  
Message        JustSomeGuy          Post subject: Dynamically add content to a 
window?Posted: Sun Jun 20, 2010 7:34 pm                         
Joined: Fri May 11, 2007 11:35 am
Posts: 891                I have a canvas control that I use on a status window.
I want be able to add and remove these canvas objects and have them in a 
horizontal stack at run time.
I thought if I had a listbox on the window, should I not be able to draw the 
canvas control in the listbox drawcell method?

Is there something that has to be done with the size of the canvas object vs 
the cell dimensions... 
i.e. one should grow to match the other or the other should shirk to match.

How do I get the canvas object to draw in the cellBackgroundPaint?
i.e... how do i use the graphics object that is passed to the cell paint method 
to draw the canvas object?      
_________________
6502 Assembler on Steroids  
                             Top                JustSomeGuy          Post 
subject: Re: Dynamically add content to a window?Posted: Sun Jun 20, 2010 8:21 
pm                         
Joined: Fri May 11, 2007 11:35 am
Posts: 891                I put this code into the CellBackgroundPaint event of 
my listbox:Code:Function CellBackgroundPaint(g As Graphics, row As Integer, 
column As Integer) As Boolean
 dim c as new SevenSegment  'which is a window that inherits from Canvas.
 c.SetNumber(7)
 c.Width = 42
 c.Height = 77
 c.Left = 0
 c.Top = 0
 c.Visible = true
 c.EraseBackground = true
 c.Enabled = true
 c.ForegroundColour=&cFF0000
 c.BackgroundColour=&c00FFFF
  
 c.DrawInto(g, 0, 0)
End Functionbut nothing is drawn...
I don't understand.      
_________________
6502 Assembler on Steroids  
                             Top                JustSomeGuy          Post 
subject: Re: Dynamically add content to a window?Posted: Sun Jun 20, 2010 9:24 
pm                         
Joined: Fri May 11, 2007 11:35 am
Posts: 891                return true... still no difference...      
_________________
6502 Assembler on Steroids  
                             Top                timhare          Post subject: 
Re: Dynamically add content to a window?Posted: Mon Jun 21, 2010 3:14 am        
                 
Joined: Fri Jan 06, 2006 3:21 pm
Posts: 7920
Location: Portland, OR  USA                Take whatever code you have in the 
canvas subclass and put it into the listbox CellBackgroundPaint event.   
                             Top             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 4 posts ]      
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to