#1 2015-12-02 08:04:15

kevinday
Member
Registered: 2015-10-28
Posts: 11

Ribbon Application Notification of Marking Action

Hi,

I would like to add the ability for the ribbon to be notified when a mark sql action popup menu item has been clicked by the user.  This is so that I can update a "mark status" that I can display on my reports to show on the report what the report contains (if an item is marked since a mark action or query has been performed I clear the mark status to "Marked Items").

What I propose is in mORMotToolbar:

  TMarkActionEvent = procedure (Sender : TObject; const aRecordClass : TSqLRecordClass; aSQLAction : TSQLAction) or object;

A TSQLLister.OnMarkAction property

private
    FOnMarkAction: TMarkActionEvent;
public
    property OnMarkAction: TMarkActionEvent read FOnMarkAction write FOnMarkAction;

and a call to OnMarkAction event handler in  TSQLLister.ActionButtonClick()

begin
  if fReportDetailedIndex<0 then
    exit; // avoid recursive call after GB.Down := false below
  aAction := isActionButton(Sender);
  case A of
    actNoAction: exit;
    actUnMarkAll:
      // (un)marking are standard actions
      TableToGrid.SetMark(A);
    actMark:
      if Sender.InheritsFrom(TSynToolButton) then
        Btn.DoDropDown else
      if Sender.InheritsFrom(TMenuItem) then begin
        // actMarkAllEntries..actMarkBeforeOneYear are regrouped in
        // the only one aAction=actMark button
        TableToGrid.SetMark(TSQLAction(TMenuItem(Sender).Tag));
        if Assigned(FOnMarkAction) then
          FOnMarkAction(Sender, fClass, TSQLAction(TMenuItem(Sender).Tag));
      end
    else begin

etc.

Thanks,
Kevin.

Offline

#2 2015-12-02 13:09:42

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,240
Website

Re: Ribbon Application Notification of Marking Action

Should be included by http://synopse.info/fossil/info/39b1c09c12

Thanks for the proposal!

Offline

Board footer

Powered by FluxBB