diff --git a/app/formmain.pas b/app/formmain.pas index b7a0f5861fa..fef35283792 100644 --- a/app/formmain.pas +++ b/app/formmain.pas @@ -527,7 +527,7 @@ TfmMain = class(TForm) function DoMenuEnum(const AStr: string): string; procedure DoOnTabMove(Sender: TObject; NFrom, NTo: Integer); procedure DoOps_LoadPluginFromInf(const fn_inf: string); - procedure DoPanel_Event(AControl: TControl; const AEvent: string); + procedure DoPanel_Event(AControl: TObject; const AEvent: string); procedure DoPanel_OnContextPopup(Sender: TObject; MousePos: TPoint; var Handled: Boolean); procedure DoPanel_OnSelChanged(Sender: TObject); procedure DoSidebar_OnTabClick(Sender: TObject); diff --git a/app/formmain_plugins.inc b/app/formmain_plugins.inc index 843a3bc00f5..acac8bd651a 100644 --- a/app/formmain_plugins.inc +++ b/app/formmain_plugins.inc @@ -344,7 +344,7 @@ begin DoPyCommand(PyLastCommandModule, PyLastCommandMethod, PyLastCommandParam); end; -procedure TfmMain.DoPanel_Event(AControl: TControl; const AEvent: string); +procedure TfmMain.DoPanel_Event(AControl: TObject; const AEvent: string); begin DoPyEvent(CurrentEditor, cEventOnPanel, [ @@ -356,21 +356,21 @@ end; procedure TfmMain.DoPanel_OnContextPopup(Sender: TObject; MousePos: TPoint; var Handled: Boolean); begin - DoPanel_Event(Sender as TControl, 'on_menu'); + DoPanel_Event(Sender, 'on_menu'); end; procedure TfmMain.DoPanel_OnClick(Sender: TObject); begin - DoPanel_Event(Sender as TControl, 'on_click'); + DoPanel_Event(Sender, 'on_click'); end; procedure TfmMain.DoPanel_OnDblClick(Sender: TObject); begin - DoPanel_Event(Sender as TControl, 'on_dbl_click'); + DoPanel_Event(Sender, 'on_dbl_click'); end; procedure TfmMain.DoPanel_OnSelChanged(Sender: TObject); begin - DoPanel_Event(Sender as TControl, 'on_sel'); + DoPanel_Event(Sender, 'on_sel'); end; diff --git a/app/formmain_sidepanel.inc b/app/formmain_sidepanel.inc index de6b4c67ec6..4819424723f 100644 --- a/app/formmain_sidepanel.inc +++ b/app/formmain_sidepanel.inc @@ -149,15 +149,12 @@ begin ItemListbox.ItemHeight:= ListboxOut.ItemHeight; ItemListbox.CanGetFocus:= true; - DoApplyThemeToListbox(ItemListbox); - { - //todo: events ItemListbox.OnClick:= @DoPanel_OnClick; ItemListbox.OnDblClick:= @DoPanel_OnDblClick; - ItemListbox.OnSelectionChanged:= @DoPanel_OnSelChanged; + ItemListbox.OnChangedSel:= @DoPanel_OnSelChanged; ItemListbox.OnContextPopup:=@DoPanel_OnContextPopup; - ItemListbox.OnKeyDown:= @TreeKeyDown; - } + + DoApplyThemeToListbox(ItemListbox); end; end;