* Cursor disappearing in iup.list

For plugin authors to discuss plugin programming
Post Reply
avatar
jelv
Megastar
Posts: 700
Joined: 03 Feb 2020 22:57
Family Historian: V7
Location: Mere, Wiltshire

Cursor disappearing in iup.list

Post by jelv »

The script below demonstrates the odd behaviour I've found with the an iup.list.

If you key a few leading characters of a place in your project then cursor down it selects the first place that matches.

Click the down arrow at the end of the edit box and the list is opened at the matching point in the list and the first matching entry selected. You can use the mouse to select another entry.

Key a few leading place name characters and key Alt+cursor down and it behaves the same except the mouse pointer disappears. Moving the mouse you'll find it's still working and if you find the right place you can move up and down the list.

Is this a FH bug?

Code: Select all

-- Test plugin for list with edit box behaviour

require("iuplua");
iup.SetGlobal("CUSTOMQUITMESSAGE","YES");
fhu = require('fhutils')

fhInitialise(7);

function main()
	PlaceList = fhu.createPlaceList()
	local listDistrictName = iup.list{dropdown = 'YES', editbox = 'YES', visibleitems = 15, expand = 'HORIZONTAL'}
	PopulateList(listDistrictName, PlaceList)
	label = iup.label{title = 'Compare using the down arrow on the edit box with keying Alt+Cursor down'}
	local hboxDistrictName = iup.hbox{
		iup.label{title='District:', size = '35x0', padding = '2x0'}, listDistrictName;
		margin = '10x5', alignment = 'ACENTER'
		}
	local btnCancel = iup.button{title = 'Cancel', padding = '10x10', action = function(self) return iup.CLOSE end}
	local Form = iup.vbox{label,hboxDistrictName, btnCancel; gap = 50, alignment = 'ACENTER', margin = '10x20' }
	local dialogTest= iup.dialog{Form;resize = 'No', minbox = 'No', maxbox = 'No',
		title = 'Test iup.list with edit box'}
	dialogTest:popup()
	dialogTest:destroy()
end

-- Populate an iuplist with values from an array
function PopulateList(iuplist, tblVals)
	local is_indexed = (rawget( tblVals, 1 ) ~= nil)
	if not is_indexed then
	    local i=1
	    for k, _ in pairs(tblVals) do
	        iuplist[tostring(i)]=k
	        i=i+1
	    end
	else
		for i, v in ipairs(tblVals) do
			iuplist[tostring(i)]=v
		end
	end
end

main();
John Elvin
User avatar
tatewise
Megastar
Posts: 28953
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Cursor disappearing in iup.list

Post by tatewise »

The invisible cursor problem seems to depend on where the cursor is located initially.

If the cursor is outside the plugin dialogue window then Alt + arrow may cause it to vanish.
If the cursor is inside the plugin dialogue window it never vanishes!

It seems like a bug, but is probably in the IUP script and not something FH can affect.

BTW: After entering a few characters using up/down arrow will step up/down through the list items.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
avatar
jelv
Megastar
Posts: 700
Joined: 03 Feb 2020 22:57
Family Historian: V7
Location: Mere, Wiltshire

Re: Cursor disappearing in iup.list

Post by jelv »

tatewise wrote: 10 May 2024 19:36 If the cursor is outside the plugin dialogue window then Alt + arrow may cause it to vanish.
If the cursor is inside the plugin dialogue window it never vanishes!
That's not quite what I'm seeing. If the mouse is over the list control when Alt+arrow is keyed it stays visible. Even if it is over the dialog but outside of the list control it vanishes.
tatewise wrote: 10 May 2024 19:36 BTW: After entering a few characters using up/down arrow will step up/down through the list items.
Yes, that's how I mainly use it. I'm finding my plugin much quicker than Add GRO Index Source Citation which I was using before and it imposes stricter consistency to my chosen format. Saving keying the district and individual names in the majority of cases is the big bonus.
John Elvin
avatar
jelv
Megastar
Posts: 700
Joined: 03 Feb 2020 22:57
Family Historian: V7
Location: Mere, Wiltshire

Re: Cursor disappearing in iup.list

Post by jelv »

I'm trying to raise a ticket to see what CP say but get the following when I try to attach the test plugin:
upload error.png
upload error.png (4.11 KiB) Viewed 964 times
John Elvin
User avatar
tatewise
Megastar
Posts: 28953
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Cursor disappearing in iup.list

Post by tatewise »

I found the behaviour was not entirely consistent. However, the position of the cursor certainly affects its visibility.
It may be due to subtle differences in the OS - I'm running a native Windows 10 desktop.
I suspect it is an IUP bug rather than an FH bug.
It might have to be reported to the IUP author.

Refer CP to this thread so they can obtain the script.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
Post Reply