[Datagrid] How to manage the empty area outside the selectable lines?

zryip theSlug zryip.theslug at gmail.com
Sun Apr 25 15:55:45 EDT 2010


2010/4/25 Andre.Bisseret <Andre.Bisseret at inria.fr>:

>
> Bonjour TheSlug,

Bonjour André

> one get,
> when clicking   on the headers line: graphic "dgBackground"
>                ""              on the Hscrollbar: graphic "dgBackground"
>                ""              on the rows part: graphic "dgAlternatingRows"
>                ""              on the VscrollBar: graphic
> "dgAlternatingRows"

I done the same observations when I tested. You obtain the
"dgBackground" or the "dgAlternatingRows" graphic, depending if you
have activated or not the alternating rows property of your grid.

> So it is possible to get "insensible" header line, horizontal scroll bar and
> the cornerPiece (bravo! sure I would not have think to this one ;-))

Thanks for the compliment. But I confess I would have preferred find
something more elegant ;)

> Thus one can script:
>
> on mouseUp
>   if the short name of the target is not in "dgBackground,dgCornerPiece"
> then
>      if the dgIndex of the target is empty then beep 3 -- here dispatch
> "addLine" etc.
>   end if
> end mouseUp

Can I suggest you to use "among the items" instead of "in" to prevent bugs?
I admit that is improbable in this case, but it's a good habit to have ;)

So instead of:

if the short name of the target is not in\
 "dgBackground,dgCornerPiece"

prefer:

if (the short name of the target is among the items of\
 "dgBackground,dgCornerPiece") then

Just a suggestion in case it could be useful ;)

> but the V scroll bar continue to beep like the empty rows part (even if one
> click beside a row whose is not empty)
>
> I tried different tricks but seems really impossible to distinguish the V
> scroll bar area from the rows area!!! (might be missing something?)
>

The datagrid background ends on the border of the group, so it include
the scrollbars. It seems difficult to do something by script at our
level.

> Sorry no great help! only confirmation (and for me, learning; thanks ;-))

Thanks for your feedback about this, André! ;)


Regards,
-- 
-Zryip TheSlug- wish you the best! 8)
http://www.aslugontheroad.co.cc



More information about the Use-livecode mailing list