Skip to content

Commit

Permalink
Minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
beNative committed Nov 3, 2015
1 parent 7ddb42e commit e81d491
Show file tree
Hide file tree
Showing 2 changed files with 105 additions and 54 deletions.
24 changes: 24 additions & 0 deletions Forms/Concepts.Spring.ObjectDataSet.Form.dfm
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ object frmObjectDataSet: TfrmObjectDataSet
Images = dmResources.imlMain
TabOrder = 1
end
object btnInspectObjectDataSet: TButton
Left = 292
Top = 5
Width = 150
Height = 25
Action = actInspectObjectDataSet
TabOrder = 2
end
end
object pnlClient: TPanel
Left = 0
Expand Down Expand Up @@ -450,6 +458,14 @@ object frmObjectDataSet: TfrmObjectDataSet
Height = 19
Panels = <>
end
object btnInspectPresenter: TButton
Left = 453
Top = 5
Width = 150
Height = 25
Action = actInspectPresenter
TabOrder = 3
end
object dscMain: TDataSource
OnUpdateData = dscMainUpdateData
Left = 352
Expand Down Expand Up @@ -485,5 +501,13 @@ object frmObjectDataSet: TfrmObjectDataSet
ImageIndex = 524
OnExecute = actDisconnectPresenterExecute
end
object actInspectObjectDataSet: TAction
Caption = 'Inspect ObjectDataSet'
OnExecute = actInspectObjectDataSetExecute
end
object actInspectPresenter: TAction
Caption = 'Inspect Presenter'
OnExecute = actInspectPresenterExecute
end
end
end
135 changes: 81 additions & 54 deletions Forms/Concepts.Spring.ObjectDataSet.Form.pas
Original file line number Diff line number Diff line change
Expand Up @@ -42,60 +42,66 @@ interface
type
TfrmObjectDataSet = class(TForm)
{$REGION 'designer controls'}
aclMain : TActionList;
actConnectDataSet : TAction;
actConnectPresenter : TAction;
actDisconnectDataSet : TAction;
actDisconnectPresenter : TAction;
actFillList : TAction;
btnConnectPresenter : TButton;
btnDisconnectPresenter : TButton;
btnExecute : TButton;
btnExecute1 : TButton;
btnExecute2 : TButton;
dscMain : TDataSource;
edtAddress : TLabeledEdit;
edtCompanyName : TLabeledEdit;
edtDBAddress : TDBEdit;
edtDBCompanyName : TDBEdit;
edtDBEmail : TDBEdit;
edtDBFirstname : TDBEdit;
edtDBLastname : TDBEdit;
edtDBNumber : TDBEdit;
edtEmail : TLabeledEdit;
edtFirstname : TLabeledEdit;
edtLastname : TLabeledEdit;
edtNumber : TLabeledEdit;
edtRecordCount : TEdit;
lblRecordCount : TLabel;
navDataSet : TDBNavigator;
pnlClient : TPanel;
pnlDataAware : TPanel;
pnlLeft : TPanel;
pnlLeftFooter : TPanel;
pnlLeftHeader : TPanel;
pnlPresenter : TPanel;
pnlRight : TPanel;
pnlRightFooter : TPanel;
pnlRightHeader : TPanel;
pnlTop : TPanel;
sbrMain : TStatusBar;
splVertical : TSplitter;
pnlDataAwareControls : TPanel;
pnlVCLControls : TPanel;
lblFirstname : TLabel;
lblLastname : TLabel;
lblEmail : TLabel;
lblCompanyName : TLabel;
lblAddress : TLabel;
lblNumber : TLabel;
aclMain : TActionList;
actConnectDataSet : TAction;
actConnectPresenter : TAction;
actDisconnectDataSet : TAction;
actDisconnectPresenter : TAction;
actFillList : TAction;
actInspectObjectDataSet : TAction;
actInspectPresenter : TAction;
btnConnectPresenter : TButton;
btnDisconnectPresenter : TButton;
btnExecute : TButton;
btnExecute1 : TButton;
btnExecute2 : TButton;
btnInspectObjectDataSet : TButton;
btnInspectPresenter : TButton;
dscMain : TDataSource;
edtAddress : TLabeledEdit;
edtCompanyName : TLabeledEdit;
edtDBAddress : TDBEdit;
edtDBCompanyName : TDBEdit;
edtDBEmail : TDBEdit;
edtDBFirstname : TDBEdit;
edtDBLastname : TDBEdit;
edtDBNumber : TDBEdit;
edtEmail : TLabeledEdit;
edtFirstname : TLabeledEdit;
edtLastname : TLabeledEdit;
edtNumber : TLabeledEdit;
edtRecordCount : TEdit;
lblAddress : TLabel;
lblCompanyName : TLabel;
lblEmail : TLabel;
lblFirstname : TLabel;
lblLastname : TLabel;
lblNumber : TLabel;
lblRecordCount : TLabel;
navDataSet : TDBNavigator;
pnlClient : TPanel;
pnlDataAware : TPanel;
pnlDataAwareControls : TPanel;
pnlLeft : TPanel;
pnlLeftFooter : TPanel;
pnlLeftHeader : TPanel;
pnlPresenter : TPanel;
pnlRight : TPanel;
pnlRightFooter : TPanel;
pnlRightHeader : TPanel;
pnlTop : TPanel;
pnlVCLControls : TPanel;
sbrMain : TStatusBar;
splVertical : TSplitter;
{$ENDREGION}

procedure actFillListExecute(Sender: TObject);
procedure actConnectDataSetExecute(Sender: TObject);
procedure actDisconnectDataSetExecute(Sender: TObject);
procedure actDisconnectPresenterExecute(Sender: TObject);
procedure actConnectPresenterExecute(Sender: TObject);
procedure actInspectObjectDataSetExecute(Sender: TObject);
procedure actInspectPresenterExecute(Sender: TObject);

procedure FormResize(Sender: TObject);
procedure dscMainUpdateData(Sender: TObject);
Expand Down Expand Up @@ -143,15 +149,21 @@ implementation
uses
System.SysUtils,

Concepts.Factories, Concepts.Utils;
DSharp.Windows.ColumnDefinitions,

Concepts.Factories, Concepts.Utils, Concepts.ComponentInspector;

{$REGION 'construction and destruction'}
procedure TfrmObjectDataSet.AfterConstruction;
begin
inherited AfterConstruction;
FList := TConceptFactories.CreateContactList;
FVST := TConceptFactories.CreateVirtualStringTree(Self, pnlRight);
FTVP := TConceptFactories.CreateTreeViewPresenter(Self, FVST, FList as IObjectList);
FTVP := TConceptFactories.CreateTreeViewPresenter(
Self,
FVST,
FList as IObjectList
);
FDBG := TConceptFactories.CreateDBGrid(Self, pnlLeft, dscMain);
FObjectDataSet := TObjectDataset.Create(Self);
FObjectDataSet.DataList := FList as IObjectList;
Expand Down Expand Up @@ -192,6 +204,17 @@ procedure TfrmObjectDataSet.actFillListExecute(Sender: TObject);
DisconnectDataSet;
HourGlass(FillList);
end;

procedure TfrmObjectDataSet.actInspectObjectDataSetExecute(Sender: TObject);
begin
InspectComponents(FObjectDataSet);
end;

procedure TfrmObjectDataSet.actInspectPresenterExecute(Sender: TObject);
begin
InspectComponent(FTVP);
InspectObject(FTVP.ColumnDefinitions as TColumnDefinitions);
end;
{$ENDREGION}

{$REGION 'event handlers'}
Expand Down Expand Up @@ -263,7 +286,11 @@ procedure TfrmObjectDataSet.ConnectPresenter;
begin
if not Assigned(FTVP) then
begin
FTVP := TConceptFactories.CreateTreeViewPresenter(Self, FVST, FList as IObjectList);
FTVP := TConceptFactories.CreateTreeViewPresenter(
Self,
FVST,
FList as IObjectList // IObjectList = IList<TObject>
);
FTVP.TreeView.Header.AutoFitColumns;
// AddControlBinding(FBG, FTVP, 'View.CurrentItem.Firstname', edtFirstname);
// AddControlBinding(FBG, FTVP, 'View.CurrentItem.Lastname', edtLastname);
Expand Down Expand Up @@ -292,10 +319,10 @@ procedure TfrmObjectDataSet.DisconnectPresenter;
procedure TfrmObjectDataSet.UpdateActions;
begin
inherited;
actConnectDataSet.Enabled := not DataSetEnabled;
actDisconnectDataSet.Enabled := DataSetEnabled;
actConnectPresenter.Enabled := not PresenterEnabled;
actDisconnectPresenter.Enabled := PresenterEnabled;
actConnectDataSet.Enabled := not DataSetEnabled;
actDisconnectDataSet.Enabled := DataSetEnabled;
actConnectPresenter.Enabled := not PresenterEnabled;
actDisconnectPresenter.Enabled := PresenterEnabled;
end;
{$ENDREGION}

Expand Down

0 comments on commit e81d491

Please sign in to comment.