I've been stuck trying to achieve a particular cosmetic issue with data grid scrollbars.
This is to replicate the a layout i have in a FileMaker Pro solution:
In a master-detail layout, the 'master' list is on a dark background; the row is indicated by a white triangle on the right side, which blends into the 'detail' section of the layout. To enhance the effect, the scrollbar of the 'master' list is hidden, transiently appears when scrolling or when hovering at the edge of the list, appears semi-transparent at the edge of the list and then auto-hides when scrolling stops. Here is a screen shot showing the master section without and with the scrollbar in the FileMaker Pro solution: Unfortunately i've not been able to approximate the scrollbar management even remotely in LiveCode.
I can show/hide the scrollbar by trapping the rawKeyDown message to detect when scrolling the list and then send a message to hide the scrollbar. But a) this introduces palpable delays in scrolling, and more importantly
b) because the scroll is ongoing, i end up in an endless cycle of showing/hiding the scrollbar that can go on for minutes while locking the interface.
I tried to check the pendingMessages for rawKeyDown and only try to hide the scrollbar if there are no rawKeyDown messages pending, but that does nothing.
Here's the code in my data grid that tries to achieve this effect:
Code: Select all
on rawKeyDown pKey
if pKey = 65308 or pKey = 65309 then -- key codes for scroll down and scroll up respectively
show scrollbar "dgScrollbar" of group "dates"
end if
if "rawKeyDown" is not in the pendingMessages then
hideScroller
end if
pass rawKeyDown
end rawKeyDown
on hideScroller
lock screen for visual effect in rect the rect of the scrollbar "dgScrollbar" of me
set the visible of scrollbar "dgScrollbar" of me to false
unlock screen with visual effect "dissolve" very fast
end hideScroller
What i'd like to achieve is an effect where the scrollbar is not visible, becomes visible on scrolling and then hides again when not scrolling.
Very grateful for any suggestions!