ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/public/ibx/trunk/ibcontrols/IBDynamicGrid.pas
(Generate patch)

Comparing ibx/trunk/ibcontrols/IBDynamicGrid.pas (file contents):
Revision 40 by tony, Tue May 17 08:14:52 2016 UTC vs.
Revision 41 by tony, Sat Jul 16 12:25:48 2016 UTC

# Line 167 | Line 167 | end;
167      property OnEditingDone;
168    end;
169  
170 +  TOnSelectPanelEditor = procedure(Sender: TObject; var aEditorPanel: TWinControl) of object;
171 +
172    TDBDynamicGrid = class(TDBGrid)
173    private
174      { Private declarations }
# Line 177 | Line 179 | end;
179      FOnEditorPanelHide: TNotifyEvent;
180      FOnEditorPanelShow: TNotifyEvent;
181      FOnKeyDownHander: TKeyDownHandler;
182 +    FOnSelectPanelEditor: TOnSelectPanelEditor;
183      FResizing: boolean;
184      FWeHaveFocus: boolean;
185      FHidingEditorPanel: boolean;
# Line 224 | Line 227 | end;
227      property OnEditorPanelShow: TNotifyEvent read FOnEditorPanelShow write FOnEditorPanelShow;
228      property OnEditorPanelHide: TNotifyEvent read FOnEditorPanelHide write FOnEditorPanelHide;
229      property OnKeyDownHander: TKeyDownHandler read FOnKeyDownHander write FOnKeyDownHander;
230 +    property OnSelectPanelEditor: TOnSelectPanelEditor read FOnSelectPanelEditor
231 +                                                       write FOnSelectPanelEditor;
232   end;
233  
234    {TIBGridControlLink}
# Line 706 | Line 711 | procedure TDBDynamicGrid.UpdateActive;
711   begin
712    inherited UpdateActive;
713  
714 +  if not (csLoading in ComponentState) and assigned(DataLink)
715 +                       and assigned(DataLink.DataSet) and DataLink.DataSet.Active then
716 +    DoGridResize;
717 +
718    if not (csLoading in ComponentState) and assigned(DataLink) and
719       assigned(FEditorPanel) and not FEditorPanel.Visible and
720       assigned(DataLink.DataSet) and (DataLink.DataSet.State = dsInsert) then
# Line 744 | Line 753 | begin
753   end;
754  
755   procedure TDBDynamicGrid.ShowEditorPanel;
756 + var aEditor: TWinControl;
757   begin
758    if (csDesigning in ComponentState) or
759     (DataSource = nil) or (DataSource.DataSet = nil)
760       or ((DataSource.DataSet.RecordCount = 0) and (DataSource.DataSet.State <> dsInsert)) then
761       Exit;
762 <  Editor := FEditorPanel;
762 >  aEditor := FEditorPanel;
763 >  if assigned(FOnSelectPanelEditor) then
764 >    OnSelectPanelEditor(self,aEditor);
765 >  if FEditorPanel <> aEditor then
766 >    SetEditorPanel(aEditor);
767 >  Editor := aEditor;
768    EditorMode := true;
769   end;
770  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines