Hi,
thanks to https://ask.libreoffice.org/t/how-to-use-a-gridcontrol-in-a-dialog-as-kind-of-multicolumn-listbox/64152 I could create a grid control.
But when I try to get any events captured, nothing happens.
My XGridSelectionListener:
class GridSelectionListener(unohelper.Base, XGridSelectionListener):
def __init__(self):
super().__init__()
pass
def selectionChanged(self, evt: GridSelectionEvent):
self.count = self.count + 1
mri(evt)
log("EventListener", evt.Source.Model.Name)
#if evt.Source.Model.Name == _MY_BUTTON:
# evt.Source.Model.Label = _MY_LABEL+ str( self.count )
return
def actionPerformed(self, evt: EventObject):
self.count = self.count + 1
mri(evt)
log("EventListener", evt.Source.Model.Name)
#if evt.Source.Model.Name == _MY_BUTTON:
# evt.Source.Model.Label = _MY_LABEL+ str( self.count )
return
def disposing(self, evt: GridSelectionEvent): # mandatory routine
pass
and I assigned to the grid control:
def callDialog():
doc = XSCRIPTCONTEXT.getDocument()
dp = SM.createInstanceWithArguments("com.sun.star.awt.DialogProvider", (doc,))
ui = dp.createDialog("vnd.sun.star.script:Standard.dlg_Mapping?location=document")
act = ActionListener()
ctl = ui.getControl("cmd_zuordnen") #ctl.Model.Label = "xxx"
ctl.addActionListener(act)
gsl = GridSelectionListener()
grid = ui.getControl("grid_transaktionen")
grid.addSelectionListener(gsl)
And idea what could be wrong with the event listener (i would expect it to trigger when I select new lines/cells in the grid …)
Thank you