Re: Now is the winter of our integer x,y, etc...
- Posted by Graeme <graemeburke at CROSSWINDS.NET> Jan 27, 2001
- 503 views
At 06:24 PM 27/01/01 -0800, you wrote: >Soooooooooooooo, > >All those numbers are assinged "automatically". Like if you wanted a window with a bitmap background, you'd use the x1,x2,y1,y2, >in the procedure (the bits in the brackets) THEN you'd use it for any window and the X,Y etc. would be assinged values according to which window you told it to use? That's a mouthfull! Here's what I mean: > >START > >procedure paintwin( integer x1,integer y,integer x2,integer y2) >-----tell windows to paint the window (I don't know the command off-hand)-- >end procedure > >paintwin[window1] > >END > >--Then the values of window1 would be plugged into all those confusing variables yes? > > Windows/win32lib will automatically repaint all of the controls on the window for you, whenever your program is not busy inside a loop, etc. If you have bitmaps, lines, text etc. drawn on the window, YOU must redraw these objects, when required. Windows lets you know when this needs to be done by triggering the onPaint event. You are expexted to provide and "onPaint_MyWindow()" or something routine to redraw anything you want to appear on the window. The whole window need not nessesarily be redrawn every time. Perhaps only the corner of your window was behind another one, and you've brought it to the front again. Only the corner that was covered by the other window needs to be redrawn. This is called the 'damaged' area (or region). win32lib passes the co-ordinates of the 'damaged' portion of the window to you routine. (x1,y1) is the top left corner of damaged section (x2,y2) is the bottom right corner of damaged section the simplest of onPaint handlers might ignore what the damaged section is, and simply redraw an entire bitmap on a window when the on paint event is triggered. A more complex one might handle sections of text, lines and polygons, multiple bitmaps, and calculate which sections of each of these objects needs to be redrawn to repair the damaged section in the quickest time possible. Hope this helps Graeme ---------------------------------------------------- http://www.geocities.com/SiliconValley/Network/6843/ ____________________________________________________________ T O P I C A -- Learn More. Surf Less. Newsletters, Tips and Discussions on Topics You Choose. http://www.topica.com/partner/tag01