On 4/16/06, Vincent Snijders <[EMAIL PROTECTED]> wrote:
> Alexandrov Alexandru wrote:
> > multiple instances of same form works now..
>
> Please, attach a patch :-)
>
> Vincent

sorry

Alex
Index: fieldseditor.lfm
===================================================================
--- fieldseditor.lfm    (revision 9130)
+++ fieldseditor.lfm    (working copy)
@@ -1,26 +1,27 @@
 object DSFieldsEditorFrm: TDSFieldsEditorFrm
   Caption = 'Fields Editor'
   ClientHeight = 288
-  ClientWidth = 180
+  ClientWidth = 215
   OnClose = FieldsEditorFrmClose
   OnDestroy = FieldsEditorFrmDestroy
   PixelsPerInch = 96
-  HorzScrollBar.Page = 179
+  Position = poDefaultPosOnly
+  HorzScrollBar.Page = 214
   VertScrollBar.Page = 287
-  Left = 228
+  Left = 256
   Height = 288
-  Top = 96
-  Width = 180
+  Top = 117
+  Width = 215
   object FieldsListBox: TListBox
     Align = alClient
-    ExtendedSelect = True
+    BorderSpacing.OnChange = nil
     MultiSelect = True
     OnClick = ListBox1Click
     OnKeyDown = FieldsListBoxKeyDown
     PopupMenu = PopupMenu1
     TabOrder = 0
     Height = 288
-    Width = 180
+    Width = 215
   end
   object PopupMenu1: TPopupMenu
     left = 8
Index: fieldseditor.pas
===================================================================
--- fieldseditor.pas    (revision 9130)
+++ fieldseditor.pas    (working copy)
@@ -174,10 +174,13 @@
 
 procedure TDSFieldsEditorFrm.FieldsEditorFrmDestroy(Sender: TObject);
 begin
+  if Assigned(FComponentEditor) then begin
+    if Assigned(LinkDataset) And (Not (csDestroying in 
LinkDataset.ComponentState)) And (FieldsListBox.SelCount > 0) then
+         GlobalDesignHook.SelectOnlyThis(LinkDataset);
+    FComponentEditor.EditorWindowClose;
+  end;
   if Assigned(GlobalDesignHook) then
     GlobalDesignHook.RemoveAllHandlersForObject(Self);
-  if Assigned(FComponentEditor) then
-    FComponentEditor.EditorWindowClose;
   inherited Destroy;
 end;
 
@@ -413,10 +416,6 @@
 
 procedure TFieldsComponentEditor.ExecuteVerb(Index: Integer);
 var ADataset: TDataset;
-    i: Integer;
-    b: boolean;
-    fTop, fLeft, fHeight, fWidth: integer;
-    aForm: TForm;
 begin
   case index of
     0: begin
@@ -424,27 +423,7 @@
       if ADataset = nil
       then raise Exception.Create('TFieldsComponentEditor.Edit 
LinkDataset=nil');
       if fWindowClosed then begin
-        //close other Fields designer forms
-        // and save window pos.
-        b := False;
-        with Application do
-          for i := 0 to ComponentCount - 1 do
-            if Components[i] is TDSFieldsEditorFrm then begin
-              b := True;
-              aForm := Components[i] as TDSFieldsEditorFrm;
-              fTop := aForm.Top;
-              fLeft := aForm.Left;
-              fHeight := aForm.Height;
-              fWidth := aForm.Width;
-              TDSFieldsEditorFrm(Components[i]).Free;
-            end;
         FFieldsEditorForm := TDSFieldsEditorFrm.Create(Application, ADataset, 
Designer);
-        if b then begin
-          FFieldsEditorForm.Top := fTop;
-          FFieldsEditorForm.Left := fLeft;
-          FFieldsEditorForm.Height := fHeight;
-          FFieldsEditorForm.Width := fWidth;
-        end;
         fWindowClosed := False;
       end;
       with FFieldsEditorForm do begin

Reply via email to