I apologise for the lengthy explanation but I hope it is clear.
All objects must be produced on the fly, not ready made components.
In generic terms, I want a large board on top of which are say 4 smaller boards side by side all touching and covering the lower board.
On each of the 4 top boards I want say 50 square objects, all of which touch side by side, and completely cover the boards below.
I want the first board to be a TobjectList containing the 4
TObjectLists for the upper boards which in turn each
contain the list of 50 square objects.
I want to click (the position of) any square and have it react, and also have it's board react because the board knows one of it's squares was clicked.
I tried to use TGraphicControls for the final squares and picked up the mouse event.
However they do not know which lists they belong to and so I cannot call a method in one of the four boards.
OOP wise I seem to be working backwards.
I tried to pick up the mouse event for the bottom board (a TScrollBox) but I cannot get below the squares on top.
I feel that I should be able to click on the first board, pick up the coords, pass coords (modified in relative terms) to the appropriate one of the 4 boards, have the board react, then pass coords on to the square that resides at that position and have it react.
My problems are:
If I use graphic controls as above, I cannot click on the underlying boards.
I don't know how to draw the squares without them being controls. (Say, have a board draw them.)
If I used a bitmap in some way as the bottom board and paint everything on it I presume the repaint would always repaint the whole surface instead of as at present only the square clicked on.
If I did know how to draw them and achieved it, could I click the underlying boards through the images assuming they would not be controls?
Any clues would be gratefully received as I am totally lost. Please keep any explanation fairly simple.
Regards
All objects must be produced on the fly, not ready made components.
In generic terms, I want a large board on top of which are say 4 smaller boards side by side all touching and covering the lower board.
On each of the 4 top boards I want say 50 square objects, all of which touch side by side, and completely cover the boards below.
I want the first board to be a TobjectList containing the 4
TObjectLists for the upper boards which in turn each
contain the list of 50 square objects.
I want to click (the position of) any square and have it react, and also have it's board react because the board knows one of it's squares was clicked.
I tried to use TGraphicControls for the final squares and picked up the mouse event.
However they do not know which lists they belong to and so I cannot call a method in one of the four boards.
OOP wise I seem to be working backwards.
I tried to pick up the mouse event for the bottom board (a TScrollBox) but I cannot get below the squares on top.
I feel that I should be able to click on the first board, pick up the coords, pass coords (modified in relative terms) to the appropriate one of the 4 boards, have the board react, then pass coords on to the square that resides at that position and have it react.
My problems are:
If I use graphic controls as above, I cannot click on the underlying boards.
I don't know how to draw the squares without them being controls. (Say, have a board draw them.)
If I used a bitmap in some way as the bottom board and paint everything on it I presume the repaint would always repaint the whole surface instead of as at present only the square clicked on.
If I did know how to draw them and achieved it, could I click the underlying boards through the images assuming they would not be controls?
Any clues would be gratefully received as I am totally lost. Please keep any explanation fairly simple.
Regards