I wasted too many hours on this, enough hours to understand where the problem lies.
The code below is in the Canvas.MouseDown Event.
When I click at X,Y: 301,55, the second part is drawn (Draw_Son_Grand("List_Data")).
But that cannot be: watch carefully the Rect_Son values for Y.
[Worst: the click is located in the Rect_Father Y displayed area, 15 pixels above the Rect_Son.Top value !.]
Relevant part of the used code:
[code] // Fills the Father_Rect Structure
Rect_Father = New Realbasic.Rect
Rect_Father.Left = 20 // X
Rect_Father.Top = 20 // Y
Rect_Father.Width = 385
Rect_Father.Height = 50
// Fills the Son_Rect Structure
Rect_Son = New Realbasic.Rect
Rect_Son.Left = 40 // X
Rect_Son.Top = 70 // Y
Rect_Son.Width = 470 // Arbitrary value
Rect_Son.Height = 450 // Arbitrary value
// Rect_Father holds the X,Y, W,H of the file name (no Extension) and the # of available TABLE(s)
If Rect_Father.Contains(RB_Point) Then
// Draw the list of Tables / # Of Record(s)
Draw_Son()
// Handled
Return True
End If
// Rect_Son holds the X,Y, W,H of the list of TABLE(s)
If Rect_Son.Contains(RB_Point) Then
// Yes ! Draw That TABLEs Columns Names
Draw_Son_Grand(“List_Data”) // Set a TABLE default name (for testings)
[quote=410815:@JulianS]Where do you define RB_Point?
How and where do you assign values to it?[/quote]
Good questions:
[code] Dim RB_Point As New Realbasic.Point
RB_Point.X = X
RB_Point.Y = Y[/code]
I love to use system.DebugLog !
I also discovered (somewhere ?) MouseMove: I use it now to report the Mouse location (X,y) in a TextField at the window bottom.
Also: I created a brand new project to try to make the code working (to be sure the other parts of the project does not interfere with that code).
I am quite capable of walking next to my shoes, but what I want to do is so simple that I wonder how it would be possible!
Unless the mistake is so big that I do not see it!
I will start a brand new project with two simple bitmap rectangles that draws simple graphics figures from nothing (no copy/paste code, no file loading ) in a few minutes.
Ive may use a wrong y value. I have to inspect my brand new project/code a bit more and check the previous one with that in mind. But I took the values in the MouseMove reported values.
If this is the answer, I had a large stone between the screen and my eyes (or ;).