RE: Strange behavior with listivews and popups
> From: Jonas Temple [mailto:jtemple at yhti.net]
> I've noticed that when I use popup() from a listview a dotted
> rectangle
> (similar to what you would see in a drag/copy operation in a word
> processor) is showing up if an item is clicked in the popup.
> Has anyone
> seen this or know how to fix this?
>
> I've attached a small example:
>
<SNIP>
It seems that the ListView doesn't get the WM_RBUTTONUP messages after
WM_RBUTTONDOWN. This may be because the focus changes to the menu. In
face, ListViews never seem to see WM_RBUTTONUP. Instead they go directly to
its parent, except when following WM_RDOUBLECLICK. But neither one does
when the popup is created. Very strange. However, here's a work around,
using a timer:
atom x, y
x = 0
y = 0
procedure ontimer(integer self, integer event, sequence params)
if params[1] = 1 then
killTimer(TestLV, 1)
popup(TestPM, x,y)
end if
end procedure
setHandler(TestLV, w32HTimer, routine_id("ontimer"))
procedure TestLV_onMouse (integer self, integer event, sequence params)
--params is ( int event, int x, int y, int shift )
sequence pos
-- Right mouse button down, show the popup
if params[1] = RightDown then
captureMouse( TestLV )
releaseMouse()
pos = getPointerRelPos(Window1)
x = pos[1]
y = pos[2]
setTimer(TestLV, 1, 1 )
end if
end procedure
setHandler( TestLV, w32HMouse, routine_id("TestLV_onMouse"))
Matt Lewis
|
Not Categorized, Please Help
|
|