Página 1 de 1

Managing TScollBox Images

Publicado: Mar Dic 06, 2005 11:07 pm
por awr
I need some advice on how to handle images in a TSrcollBox control. What I
want to achieve is something similar to the how Windows manages images when
View/Icons is selected in Explorer. In other words, I want to be able to
drag icons (actually TBtnBmp controls), show the large I beam and when
dropped, have the existing icons rearranged.
I am using TBtnBmp inside the TScrollBox because I need a text label *and*
an image. Each image and label combination represents a record that the user
wants to work with for a session. These images are restored to the last
active list when the application is restarted.
Thanks,
Andy

Managing TScollBox Images

Publicado: Mié Dic 07, 2005 12:04 pm
por jfgimenez
Andy,
there is nothing special in TScrollBox, excepting that the contained
controls coordinates are relatives to the ( ::nClientLeft, ::nClientTop )
point of the scrollbox. This point can be ( 0, 0 ) or negative values.
Xailer manages ::nClientWidth and ::nClientHeight based upon the contained
controls position and size, and thus, the scrollbars are updated to reflect
it.
In conclusion, you have to place the buttons into the scrollbox in a normal
way, although their coordinates were longer than the scrollbox size. I.e.,
suppose a 100x100 pixels clientsize scrollbox, and a set of 45x45 buttons;
you could place them at (5,5), (50,5), (5,50), (50,50), (5,100), (50,100),
(5,150), (50,150), and so on.
--
Regards,
Jose F. Gimenez