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();