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 } |
179 |
|
FOnEditorPanelHide: TNotifyEvent; |
180 |
|
FOnEditorPanelShow: TNotifyEvent; |
181 |
|
FOnKeyDownHander: TKeyDownHandler; |
182 |
+ |
FOnSelectPanelEditor: TOnSelectPanelEditor; |
183 |
|
FResizing: boolean; |
184 |
|
FWeHaveFocus: boolean; |
185 |
|
FHidingEditorPanel: boolean; |
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} |
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 |
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 |
|
|