TRxDBLookupCombo: fix modify TPopUpFormColumns

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2673 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
alexs75
2013-02-12 12:00:56 +00:00
parent c4c6ccb983
commit 2630770763
3 changed files with 40 additions and 13 deletions

View File

@ -4884,8 +4884,7 @@ begin
if FCommand = AValue then
exit;
FCommand := AValue;
Changed(true);
/// Changed(False);
Changed(False);
end;
procedure TRxDBGridKeyStroke.SetShortCut(const AValue: TShortCut);
@ -4894,8 +4893,7 @@ begin
exit;
FShortCut := AValue;
Menus.ShortCutToKey(FShortCut, FKey, FShift);
Changed(true);
/// Changed(False);
Changed(False);
end;
function TRxDBGridKeyStroke.GetDisplayName: string;
@ -4911,9 +4909,6 @@ begin
Command := TRxDBGridKeyStroke(Source).Command;
ShortCut := TRxDBGridKeyStroke(Source).ShortCut;
Enabled := TRxDBGridKeyStroke(Source).Enabled;
{ Shift := TSynEditKeyStroke(Source).Shift;
Shift2 := TSynEditKeyStroke(Source).Shift2; }
end
else
inherited Assign(Source);

View File

@ -621,7 +621,7 @@ begin
Glyph.Assign(P);
P.Free;
ButtonWidth:=15;
FPopUpFormOptions:=TPopUpFormOptions.Create;
FPopUpFormOptions:=TPopUpFormOptions.Create(Self);
end;
destructor TRxCustomDBLookupEdit.Destroy;
@ -1562,7 +1562,7 @@ begin
FFieldList := TStringList.Create;
FValuesList:= TStringList.Create;
FLocateObject:=CreateLocate(nil);
FPopUpFormOptions:=TPopUpFormOptions.Create;
FPopUpFormOptions:=TPopUpFormOptions.Create(Self);
//Lookup
FLookupDataLink:=TLookupSourceLink.Create;
// FLookupDataLink.FDataControl:=Self;

View File

@ -136,12 +136,14 @@ type
{ TPopUpFormColumns }
TPopUpFormColumns = class(TCollection)
TPopUpFormColumns = class(TOwnedCollection)
private
FPopUpFormOptions: TPopUpFormOptions;
function GetPopUpColumn(Index: Integer): TPopUpColumn;
procedure SetPopUpColumn(Index: Integer; const AValue: TPopUpColumn);
public
Constructor Create(AOwner: TPersistent);
procedure Assign(Source: TPersistent); override;
property PopUpFormOptions:TPopUpFormOptions read FPopUpFormOptions write FPopUpFormOptions;
property Items[Index: Integer]: TPopUpColumn read GetPopUpColumn write SetPopUpColumn; default;
end;
@ -162,6 +164,7 @@ type
FShowTitles: boolean;
FTitleButtons: boolean;
FTitleStyle: TTitleStyle;
FOwner:TPersistent;
function GetColumns: TPopUpFormColumns;
procedure SetAutoFillColumns(const AValue: boolean);
procedure SetAutoSort(const AValue: boolean);
@ -172,8 +175,10 @@ type
procedure SetShowTitles(const AValue: boolean);
procedure SetTitleButtons(const AValue: boolean);
procedure SetTitleStyle(const AValue: TTitleStyle);
protected
function GetOwner: TPersistent; dynamic;
public
constructor Create;
constructor Create(AOwner:TPersistent);
destructor Destroy; override;
procedure Assign(Source: TPersistent); override;
property DataSource:TDataSource read FDataSource write FDataSource;
@ -615,8 +620,14 @@ begin
FTitleStyle:=AValue;
end;
constructor TPopUpFormOptions.Create;
function TPopUpFormOptions.GetOwner: TPersistent;
begin
Result:=FOwner;
end;
constructor TPopUpFormOptions.Create(AOwner: TPersistent);
begin
FOwner:=AOwner;
inherited Create;
FAutoSort:=false;
FDropDownCount:=8;
@ -626,7 +637,7 @@ begin
FTitleButtons:=false;
FTitleStyle:=tsLazarus;
FBorderStyle:=bsNone;
FColumns:=TPopUpFormColumns.Create(TPopUpColumn);
FColumns:=TPopUpFormColumns.Create(AOwner);
FColumns.FPopUpFormOptions:=Self;
end;
@ -814,6 +825,27 @@ begin
Items[Index].Assign( AValue );
end;
constructor TPopUpFormColumns.Create(AOwner: TPersistent);
begin
inherited Create(AOwner, TPopUpColumn);
end;
procedure TPopUpFormColumns.Assign(Source: TPersistent);
var
i: integer;
begin
if Source is TPopUpFormColumns then
begin
Clear;
for i := 0 to TPopUpFormColumns(Source).Count-1 do
begin
with Add do
Assign(TPopUpFormColumns(Source)[i]);
end;
end else
inherited Assign(Source);
end;
{ TPopUpGrid }
procedure TPopUpGrid.ClearFind;