1. TRxDBLookupCombo - fix fired OnClosePopup event

2. TRxDBGrid - fix show filter in table dropdown box in Windows XP



git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2702 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
alexs75
2013-03-14 14:29:55 +00:00
parent a567920d3d
commit 1edb9a7a9c
3 changed files with 31 additions and 28 deletions

View File

@ -680,9 +680,7 @@ type
read FAllowedOperations write FAllowedOperations default read FAllowedOperations write FAllowedOperations default
[aoInsert, aoUpdate, aoDelete, aoAppend]; [aoInsert, aoUpdate, aoDelete, aoAppend];
property OptionsRx: TOptionsRx read FOptionsRx write SetOptionsRx; property OptionsRx: TOptionsRx read FOptionsRx write SetOptionsRx;
// property FooterColor: TColor read FFooterColor write SetFooterColor default clWindow;
property FooterColor: TColor read GetFooterColor write SetFooterColor default clWindow; deprecated; property FooterColor: TColor read GetFooterColor write SetFooterColor default clWindow; deprecated;
// property FooterRowCount: integer read FFooterRowCount write SetFooterRowCount default 0;
property FooterRowCount: integer read GetFooterRowCount write SetFooterRowCount default 0; deprecated; property FooterRowCount: integer read GetFooterRowCount write SetFooterRowCount default 0; deprecated;
property OnFiltred: TNotifyEvent read FOnFiltred write FOnFiltred; property OnFiltred: TNotifyEvent read FOnFiltred write FOnFiltred;
@ -1694,24 +1692,25 @@ var
begin begin
if FOptionsRx = AValue then if FOptionsRx = AValue then
exit; exit;
BeginUpdate;
OldOpt := FOptionsRx; OldOpt := FOptionsRx;
FOptionsRx := AValue; FOptionsRx := AValue;
UseXORFeatures := rdgXORColSizing in AValue; UseXORFeatures := rdgXORColSizing in AValue;
if (rdgFilter in AValue) and not (rdgFilter in OldOpt) then if (rdgFilter in AValue) and not (rdgFilter in OldOpt) then
begin begin
LayoutChanged; LayoutChanged;
BeginUpdate; { BeginUpdate;
CalcTitle; CalcTitle;
EndUpdate; EndUpdate;}
end end
else else
if rdgFilter in OldOpt then if rdgFilter in OldOpt then
begin begin
FFilterListEditor.Hide; FFilterListEditor.Hide;
LayoutChanged; LayoutChanged;
BeginUpdate; { BeginUpdate;
CalcTitle; CalcTitle;
EndUpdate; EndUpdate;}
end; end;
FFooterOptions.FActive:=rdgFooterRows in FOptionsRx; FFooterOptions.FActive:=rdgFooterRows in FOptionsRx;
@ -1719,7 +1718,8 @@ begin
if (rdgWordWrap in OldOpt) and not (rdgWordWrap in FOptionsRx) then if (rdgWordWrap in OldOpt) and not (rdgWordWrap in FOptionsRx) then
ResetRowHeght; ResetRowHeght;
VisualChange; // VisualChange;
EndUpdate;
end; end;
procedure TRxDBGrid.SetPropertyStorage(const AValue: TCustomPropertyStorage); procedure TRxDBGrid.SetPropertyStorage(const AValue: TCustomPropertyStorage);
@ -3066,6 +3066,7 @@ procedure TRxDBGrid.MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: in
var var
Cell: TGridCoord; Cell: TGridCoord;
Rect: TRect; Rect: TRect;
C:TRxColumn;
begin begin
QuickUTF8Search := ''; QuickUTF8Search := '';
@ -3086,20 +3087,23 @@ begin
Rect := getFilterRect(CellRect(Cell.x, Cell.y)); Rect := getFilterRect(CellRect(Cell.x, Cell.y));
if (Cell.Y = 0) and (Cell.X >= Ord(dgIndicator in Options)) and (Rect.Top < Y) then if (Cell.Y = 0) and (Cell.X >= Ord(dgIndicator in Options)) and (Rect.Top < Y) then
begin begin
if TRxColumn(Columns[Columns.RealIndex(Cell.x - 1)]).Filter.ValueList.Count > 0 then C:=TRxColumn (Columns[Columns.RealIndex(Cell.x - 1)]);
with FFilterListEditor do if C.Filter.ValueList.Count > 0 then
begin begin
Items.Clear; FFilterListEditor.Style := csDropDownList;
Items.AddStrings(TRxColumn(Columns[Columns.RealIndex(Cell.x - 1)]).Filter.ValueList); if C.Filter.DropDownRows>0 then
Parent := Self; FFilterListEditor.DropDownCount := C.Filter.DropDownRows;
Width := Rect.Right - Rect.Left;
Height := Rect.Bottom - Rect.Top; FFilterListEditor.Parent := Self;
BoundsRect := Rect; FFilterListEditor.Width := Rect.Right - Rect.Left;
Style := csDropDownList; FFilterListEditor.Height := Rect.Bottom - Rect.Top;
DropDownCount := TRxColumn(Columns[Columns.RealIndex(Cell.x - 1)]).Filter.DropDownRows; FFilterListEditor.BoundsRect := Rect;
Text := TRxColumn(Columns[Columns.RealIndex(Cell.x - 1)]).Filter.Value;
Show(Self, Cell.x - 1); FFilterListEditor.Items.Assign(C.Filter.ValueList);
end;
FFilterListEditor.Text := C.Filter.Value;
FFilterListEditor.Show(Self, Cell.x - 1);
end;
exit; exit;
end; end;
end; end;
@ -3905,6 +3909,7 @@ var
C: TRxColumn; C: TRxColumn;
i: integer; i: integer;
begin begin
BeginUpdate;
OptionsRx := OptionsRx + [rdgFilter]; OptionsRx := OptionsRx + [rdgFilter];
for i := 0 to Columns.Count - 1 do for i := 0 to Columns.Count - 1 do
@ -3934,6 +3939,8 @@ begin
DataSource.DataSet.First; DataSource.DataSet.First;
DataSource.DataSet.EnableControls; DataSource.DataSet.EnableControls;
end; end;
EndUpdate;
end; end;
procedure TRxDBGrid.OnFilterClose(Sender: TObject); procedure TRxDBGrid.OnFilterClose(Sender: TObject);
@ -4977,10 +4984,8 @@ begin
FValueList.Sorted := True; FValueList.Sorted := True;
FColor := clWhite; FColor := clWhite;
// FColor := clSkyBlue;
FEmptyFont.Style := [fsItalic]; FEmptyFont.Style := [fsItalic];
FEmptyValue := sRxDBGridEmptiFilter; FEmptyValue := sRxDBGridEmptiFilter;
//FFont.Style := [fsItalic];
end; end;
destructor TRxColumnFilter.Destroy; destructor TRxColumnFilter.Destroy;

View File

@ -1075,7 +1075,7 @@ begin
{$IFDEF LINUX} {$IFDEF LINUX}
TempF:=FRxPopUpForm; TempF:=FRxPopUpForm;
if FRxPopUpForm.ShowModal = mrOk then if FRxPopUpForm.ShowModal = mrOk then
OnInternalClosePopup(true); {OnInternalClosePopup(true)};
TempF.Free; TempF.Free;
FRxPopUpForm:=nil FRxPopUpForm:=nil
{$ENDIF} {$ENDIF}

View File

@ -252,13 +252,11 @@ begin
Result.DataSet:=ADataSet; Result.DataSet:=ADataSet;
Result.LookupDisplayIndex:=ALookupDisplayIndex; Result.LookupDisplayIndex:=ALookupDisplayIndex;
// AControl.Caption:='';
Result.WControl:=AControl; Result.WControl:=AControl;
if Assigned(Font) then if Assigned(Font) then
begin begin
Result.FGrid.Font.Assign(Font); Result.FGrid.Font.Assign(Font);
// Result.Font.Assign(Font);
end; end;
{$IFDEF LINUX} {$IFDEF LINUX}
@ -299,7 +297,7 @@ end;
procedure TPopUpForm.FormClose(Sender: TObject; var CloseAction: TCloseAction); procedure TPopUpForm.FormClose(Sender: TObject; var CloseAction: TCloseAction);
begin begin
CloseAction:=caFree; CloseAction:=caFree;
if Assigned(FOnPopUpCloseEvent) then if (ModalResult <> mrOk) and Assigned(FOnPopUpCloseEvent) then
FOnPopUpCloseEvent(FFindResult); FOnPopUpCloseEvent(FFindResult);
end; end;
@ -321,7 +319,7 @@ end;
procedure TPopUpForm.Deactivate; procedure TPopUpForm.Deactivate;
begin begin
inherited Deactivate; inherited Deactivate;
if Assigned(FOnPopUpCloseEvent) then if (ModalResult = mrOk) and Assigned(FOnPopUpCloseEvent) then
FOnPopUpCloseEvent(FFindResult); FOnPopUpCloseEvent(FFindResult);
Close; Close;
end; end;