Final version of my code below. Couldn't get bindKey to work, but OnKeyChar
did the job fine. Played around with replacing my fp.release() statements
with fp.hide() but got the strange behaviour of the control working the
first time, but not subsequently.
Anyway, code below behaves exactly as I want, ie on clicking the button I
get a scrolled list of values, I can select one, which updates the main form
and makes the list disappear, or hit esc, or click out of the area to just
make the list disappear :-
self.AccountLookupbtn = dabo.ui.dButton(self.basePanel, Left=184, Top=78,
Width=40,
Caption="Lookup",OnHit=self.DDLPanel)
def DDLPanel(self, evt):
self.fp = self.FloatingPanel
# Can use floating panel owner property to set position here)
left, top = self.Position
self.fp.Position = (left+184,top+78)
codes, keys = self.PrimaryBizobj.getAccountCodes()
self.AccountCodeDDL = dabo.ui.dListBox(self.fp, Width=60, Height=200,
Left=0, Top=0, ValueMode="Key", Choices = codes, Keys = keys,
OnHit=self.DDLClick,
OnLostFocus=self.DeleteDDL, OnKeyChar=self.keyHandler)
wd, ht = self.AccountCodeDDL.Size
self.fp.Size = (wd, ht)
self.fp.Visible = True
self.AccountCodeDDL.Visible = True
def DDLClick(self, evt):
self.PrimaryBizobj.moveToPK(self.AccountCodeDDL.Value)
self.update()
self.fp.release()
def DeleteDDL(self, evt):
self.fp.release()
def keyHandler(self, evt):
if evt.keyCode == 27:
self.fp.release()
By the way, can you point me at any documentation on the Owner property,
Thanks.
Regards,
Rodgy
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message:
http://leafe.com/archives/byMID/94bae40de05547159b0f0aca94c3a...@roger