Home » U++ Library support » Draw, Display, Images, Bitmaps, Icons » How to Draw a couple of lines over an ArrayCtrl
How to Draw a couple of lines over an ArrayCtrl [message #4130] |
Mon, 24 July 2006 05:23  |
Ordog
Messages: 13 Registered: July 2006
|
Promising Member |
|
|
At a button triggered situation during runtime id like to Draw some Lines forming a graph over an ArrayCtrl.
From other posts in this forum i assume that can be done.
Im assuming that when i omit the DrawRect(rectwithsizeofwindow, color) that is used in the examples paint method that gives me a transparent "canvas" over my mainwindow.
My question now is how do i accomplish that?
First i need a Drawing overlaying my arrayCtrl.
so my headerfile holds
From this point im a bit lost in the black magic done by the Draw package
So what exactly does the Paint() method ?
I assume it holds initial values for the canvas. So i defined my Paint method as follows:
void myguiclass::Paint(Draw& w) {
w.DrawDrawing(8, 90, 600, 460, dw);
}
which is (startx, starty, widthx, widthy, thedrawing)
now i got the canvas positioned over my ArrayCtrl... i guess.
Within my triggered function to draw the graph i introduce the drawing by using
where the arguments correlate with the size of my canvas.
from here on i should be able to use
w.DrawLine(int x1¸ int y1¸ int x2¸ int y2¸ int width = 0¸ Color color = SBlack)(
to form my graph linebyline from the coordinates extracted from my dataholding structure and apply the changes by using
right?
Meanwhile i implemented the above and surprisingly (for me ^^) it compiles.
The Applications Gui got some artifacts though, e.g.
-no background of the main window
So i put in the white rectangle of the example and it shows that the canvas is behind the widgets.
When i trigger the function that initializes the DrawingDraw and uses DrawLine the line is drawn but behind the widgets as expected.
Before i tinker around with this id be pleased if somebody could point me into the right direction
PS: im using a layoutfile can i represent the drawing there somehow? should i use another layout when triggering the draw process?
PPS: i find it a bit confusing that 0,0 is at the upper left corner (i supposed to draw in a carthesian coordinate system so is there a better way to draw my chart in the Draw or some other package?)
[Updated on: Mon, 24 July 2006 05:56] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Sun Jul 13 00:54:31 CEST 2025
Total time taken to generate the page: 0.05079 seconds
|