Update of /cvsroot/instantobjects/Demos/PrimerCross
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10783/Demos/PrimerCross
Modified Files:
Main.dfm Main.pas
Log Message:
Added Model export menuitem
Index: Main.pas
===================================================================
RCS file: /cvsroot/instantobjects/Demos/PrimerCross/Main.pas,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** Main.pas 7 Dec 2004 08:45:33 -0000 1.6
--- Main.pas 10 Feb 2005 12:55:08 -0000 1.7
***************
*** 52,55 ****
--- 52,57 ----
ExportItem: TMenuItem;
ImportItem: TMenuItem;
+ N3: TMenuItem;
+ ExportModelItem: TMenuItem;
procedure ActionListUpdate(Action: TBasicAction; var Handled: Boolean);
procedure FormCreate(Sender: TObject);
***************
*** 73,76 ****
--- 75,79 ----
procedure ExportItemClick(Sender: TObject);
procedure ImportItemClick(Sender: TObject);
+ procedure ExportModelItemClick(Sender: TObject);
private
FActiveSubView: TBasicViewForm;
***************
*** 479,482 ****
--- 482,486 ----
Filter := XMLFilter;
DefaultExt := XMLExt;
+ InitialDir := ExtractFilePath(Application.ExeName);
if Execute then
ExportObjects(TContact, FileName);
***************
*** 661,665 ****
Height := Parent.ClientHeight;
Width := Parent.ClientWidth;
! Show;
end;
end;
--- 665,669 ----
Height := Parent.ClientHeight;
Width := Parent.ClientWidth;
! FormShow(FActiveSubView);
end;
end;
***************
*** 786,789 ****
--- 790,807 ----
end;
+ procedure TMainForm.ExportModelItemClick(Sender: TObject);
+ begin
+ with TSaveDialog.Create(nil) do
+ try
+ Filter := XMLFilter;
+ DefaultExt := XMLExt;
+ InitialDir := ExtractFilePath(Application.ExeName);
+ if Execute then
+ InstantModel.SaveToFile(FileName);
+ finally
+ Free;
+ end;
+ end;
+
initialization
{$IFDEF MSWINDOWS}
Index: Main.dfm
===================================================================
RCS file: /cvsroot/instantobjects/Demos/PrimerCross/Main.dfm,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Main.dfm 17 Nov 2004 20:59:47 -0000 1.2
--- Main.dfm 10 Feb 2005 12:54:52 -0000 1.3
***************
*** 170,180 ****
end
object ExportItem: TMenuItem
! Caption = '&Export...'
OnClick = ExportItemClick
end
object ImportItem: TMenuItem
! Caption = '&Import...'
OnClick = ImportItemClick
end
object N1: TMenuItem
Caption = '-'
--- 170,187 ----
end
object ExportItem: TMenuItem
! Caption = '&Export all Contacts...'
OnClick = ExportItemClick
end
object ImportItem: TMenuItem
! Caption = '&Import Contacts from file...'
OnClick = ImportItemClick
end
+ object N3: TMenuItem
+ Caption = '-'
+ end
+ object ExportModelItem: TMenuItem
+ Caption = 'Export model...'
+ OnClick = ExportModelItemClick
+ end
object N1: TMenuItem
Caption = '-'
|