diff options
author | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2009-12-15 12:06:14 +0200 |
---|---|---|
committer | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2009-12-15 12:06:14 +0200 |
commit | f9aed3bf96db7c51b2362e9149279015ed9eb28c (patch) | |
tree | c6b8756f59500c1c7b373c55a32dc2d875164bc5 /extras | |
parent | 88b70e36fbb0ff9b00ec6343d175a626a829c10a (diff) | |
download | fpGUI-f9aed3bf96db7c51b2362e9149279015ed9eb28c.tar.xz |
Updated Demo 21 to support latest tiOPF2 changes.
* tiOPF2 classes got renamed a bit.
Diffstat (limited to 'extras')
6 files changed, 30 insertions, 30 deletions
diff --git a/extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmaddressmaint.pas b/extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmaddressmaint.pas index b8212b3d..931b36c5 100644 --- a/extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmaddressmaint.pas +++ b/extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmaddressmaint.pas @@ -8,7 +8,7 @@ uses SysUtils, Classes, fpg_base, fpg_main, fpg_edit, fpg_widget, fpg_form, fpg_label, fpg_button, fpg_combobox, fpg_dialogs, fpg_menu, - model, tiFormMediator; + model, tiModelMediator; type TAddressEditForm = class(TfpgForm) @@ -32,7 +32,7 @@ type btnCancel: TfpgButton; {@VFD_HEAD_END: AddressEditForm} FData: TAddress; - FMediator: TFormMediator; + FMediator: TtiModelMediator; procedure SetData(const AValue: TAddress); procedure SetupMediators; public @@ -76,7 +76,7 @@ procedure TAddressEditForm.SetupMediators; begin if not Assigned(FMediator) then begin - FMediator := TFormMediator.Create(self); + FMediator := TtiModelMediator.Create(self); FMediator.AddProperty('AddressType', cbType).ValueList := gContactManager.AddressTypeList; FMediator.AddProperty('Nr', edNo); FMediator.AddProperty('Street', edStreet); diff --git a/extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmcitylist.pas b/extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmcitylist.pas index f14c13ee..522362d1 100644 --- a/extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmcitylist.pas +++ b/extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmcitylist.pas @@ -9,7 +9,7 @@ uses fpg_widget, fpg_form, fpg_button, fpg_grid, fpg_dialogs, fpg_menu, fpg_panel, - tiFormMediator, model; + tiModelMediator, model; type @@ -24,7 +24,7 @@ type btnCancel: TfpgButton; {@VFD_HEAD_END: CityListForm} FData: TCityList; - FMediator: TFormMediator; + FMediator: TtiModelMediator; procedure SetData(const AValue: TCityList); procedure SetupMediators; procedure btnEditClicked(Sender: TObject); @@ -63,7 +63,7 @@ procedure TCityListForm.SetupMediators; begin if not Assigned(FMediator) then begin - FMediator := TFormMediator.Create(self); + FMediator := TtiModelMediator.Create(self); FMediator.AddComposite('Name(110);Zip(80);CountryAsString(150)', grdName1); end; FMediator.Subject := FData; @@ -74,7 +74,7 @@ procedure TCityListForm.btnEditClicked(Sender: TObject); var c: TCity; begin - c := TCity(TStringGridMediator(FMediator.FindByComponent(grdName1).Mediator).SelectedObject); + c := TCity(TtiStringGridMediatorView(FMediator.FindByComponent(grdName1).Mediator).SelectedObject); // tiShowString(c.AsDebugString); if not Assigned(c) then diff --git a/extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmcitymaint.pas b/extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmcitymaint.pas index 31a6326d..1b6f27f7 100644 --- a/extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmcitymaint.pas +++ b/extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmcitymaint.pas @@ -8,7 +8,7 @@ uses SysUtils, Classes, fpg_base, fpg_main, fpg_edit, fpg_widget, fpg_form, fpg_label, fpg_button, fpg_dialogs, fpg_combobox, - model, tiFormMediator; + model, tiModelMediator; type @@ -25,7 +25,7 @@ type btnCancel: TfpgButton; btnDebug: TfpgButton; {@VFD_HEAD_END: CityEditForm} - FMediator: TFormMediator; + FMediator: TtiModelMediator; FData: TCity; procedure SetData(const AValue: TCity); procedure SetupMediators; @@ -72,7 +72,7 @@ procedure TCityEditForm.SetupMediators; begin if not Assigned(FMediator) then begin - FMediator := TFormMediator.Create(self); + FMediator := TtiModelMediator.Create(self); FMediator.AddProperty('Name', edName); FMediator.AddProperty('ZIP', edZIP); FMediator.AddProperty('Country', cbCountry).ValueList := gContactManager.CountryList; diff --git a/extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmcontactmaint.pas b/extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmcontactmaint.pas index 5832af55..8bd46e31 100644 --- a/extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmcontactmaint.pas +++ b/extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmcontactmaint.pas @@ -8,7 +8,7 @@ uses SysUtils, Classes, fpg_base, fpg_main, fpg_edit, fpg_widget, fpg_form, fpg_label, fpg_button, fpg_listview, fpg_memo, - model, tiFormMediator; + model, tiModelMediator; type @@ -35,8 +35,8 @@ type btnDebug: TfpgButton; {@VFD_HEAD_END: ContactEditForm} FData: TContact; - FMediator: TFormMediator; - FAdrsMediator: TFormMediator; + FMediator: TtiModelMediator; + FAdrsMediator: TtiModelMediator; procedure SetData(const AValue: TContact); procedure SetupMediators; procedure btnDebugClicked(Sender: TObject); @@ -77,7 +77,7 @@ procedure TContactEditForm.SetupMediators; begin if not Assigned(FMediator) then begin - FMediator := TFormMediator.Create(self); + FMediator := TtiModelMediator.Create(self); FMediator.AddProperty('FirstName', edFName); FMediator.AddProperty('LastName', edLName); FMediator.AddProperty('EMail', edEmail); @@ -89,7 +89,7 @@ begin if not Assigned(FAdrsMediator) then begin - FAdrsMediator := TFormMediator.Create(self); + FAdrsMediator := TtiModelMediator.Create(self); FAdrsMediator.AddComposite({'AddressType.Name;}'AddressType4GUI(50,"Type");Nr;Street;Telephone1', lvAddresses); end; FAdrsMediator.Subject := FData.AddressList; @@ -105,7 +105,7 @@ procedure TContactEditForm.btnEditClicked(Sender: TObject); var obj: TAddress; begin - obj := TAddress(TListViewMediator(FAdrsMediator.FindByComponent(lvAddresses).Mediator).SelectedObject); + obj := TAddress(TtiListViewMediatorView(FAdrsMediator.FindByComponent(lvAddresses).Mediator).SelectedObject); tiShowString(obj.AsDebugString); if not Assigned(obj) then diff --git a/extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmcountrylist.pas b/extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmcountrylist.pas index 0a6a6332..c9f54537 100644 --- a/extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmcountrylist.pas +++ b/extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmcountrylist.pas @@ -9,7 +9,7 @@ uses fpg_widget, fpg_form, fpg_button, fpg_grid, fpg_dialogs, fpg_menu, fpg_panel, - model, tiFormMediator; + model, tiModelMediator; type @@ -24,7 +24,7 @@ type btnCancel: TfpgButton; {@VFD_HEAD_END: CountryListForm} FData: TCountryList; - FMediator: TFormMediator; + FMediator: TtiModelMediator; procedure SetData(const AValue: TCountryList); procedure SetupMediators; procedure btnEditClicked(Sender: TObject); @@ -62,7 +62,7 @@ procedure TCountryListForm.SetupMediators; begin if not Assigned(FMediator) then begin - FMediator := TFormMediator.Create(self); + FMediator := TtiModelMediator.Create(self); FMediator.AddComposite('ISO(60);Name(110)', grdName1); end; FMediator.Subject := FData; diff --git a/extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmmain.pas b/extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmmain.pas index 374a971a..979e6592 100644 --- a/extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmmain.pas +++ b/extras/tiopf/demos/Demo_21_AdrsBook_MGM/frmmain.pas @@ -10,7 +10,7 @@ uses fpg_base, fpg_main, fpg_widget, fpg_form, fpg_button, fpg_grid, fpg_dialogs, fpg_menu, { tiOPF } - tiFormMediator; + tiModelMediator; type { The main application window } @@ -26,7 +26,7 @@ type miEdit: TfpgPopupMenu; miSystem: TfpgPopupMenu; {@VFD_HEAD_END: MainForm} - FMediator: TFormMediator; + FMediator: TtiModelMediator; procedure FormShow(Sender: TObject); procedure GridDoubleClicked(Sender: TObject; AButton: TMouseButton; AShift: TShiftState; const AMousePos: TPoint); procedure SetupMediators; @@ -68,7 +68,7 @@ procedure TMainForm.SetupMediators; begin if not Assigned(FMediator) then begin - FMediator := TFormMediator.Create(self); + FMediator := TtiModelMediator.Create(self); FMediator.AddComposite('FirstName;LastName(130);EMail(180);Mobile(130);Comments(200)', grdContacts); end; FMediator.Subject := gContactManager.ContactList; @@ -95,7 +95,7 @@ begin tiAppError('You need to select a Contact first'); Exit; end; - c := TContact(TStringGridMediator(FMediator.FindByComponent(grdContacts).Mediator).SelectedObject); + c := TContact(TtiStringGridMediatorView(FMediator.FindByComponent(grdContacts).Mediator).SelectedObject); if not Assigned(c) then Exit; //==> @@ -115,7 +115,7 @@ begin tiAppError('You need to select a Contact first'); Exit; end; - c := TContact(TStringGridMediator(FMediator.FindByComponent(grdContacts).Mediator).SelectedObject); + c := TContact(TtiStringGridMediatorView(FMediator.FindByComponent(grdContacts).Mediator).SelectedObject); if tiAppConfirmation('Are you sure you want to delete <%s>', [c.FirstName + ' ' + c.LastName]) then begin @@ -266,11 +266,11 @@ end; initialization RegisterFallBackMediators; - gMediatorManager.RegisterMediator(TStringGridMediator, TContactList); - gMediatorManager.RegisterMediator(TListViewMediator, TAddressList); - gMediatorManager.RegisterMediator(TStringGridMediator, TCityList); - gMediatorManager.RegisterMediator(TStringGridMediator, TCountryList); - gMediatorManager.RegisterMediator(TMediatorDynamicComboBoxView, TCity, 'Country'); - gMediatorManager.RegisterMediator(TMediatorDynamicComboBoxView, TAddressType, 'AddressType'); + gMediatorManager.RegisterMediator(TtiStringGridMediatorView, TContactList); + gMediatorManager.RegisterMediator(TtiListViewMediatorView, TAddressList); + gMediatorManager.RegisterMediator(TtiStringGridMediatorView, TCityList); + gMediatorManager.RegisterMediator(TtiStringGridMediatorView, TCountryList); + gMediatorManager.RegisterMediator(TtiDynamicComboBoxMediatorView, TCity, 'Country'); + gMediatorManager.RegisterMediator(TtiDynamicComboBoxMediatorView, TAddressType, 'AddressType'); end. |