minor fix in RxDBGrid and TRxDBLookupCombo

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@330 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
alexs75
2008-01-28 20:37:35 +00:00
parent a559cb6c4a
commit b1ecbb3004
6 changed files with 39 additions and 15 deletions

View File

@ -20,6 +20,9 @@
+ In RxDBGrid create lookup editor for TField + In RxDBGrid create lookup editor for TField
- Fix error in TRxLookupEdit - Fix error in TRxLookupEdit
+ In RxDBGrid published new property from DBGrid + In RxDBGrid published new property from DBGrid
+ Cosmetic fix in paint TRxCustomDBLookupCombo
+ Dropdown list in TRxCustomDBLookupCombo show after clikc on component
+ minor fix in RxDBGrid paint sort marker and column title
29.08.2007 - ������ 1.1.5.98 (svn revision 39) 29.08.2007 - ������ 1.1.5.98 (svn revision 39)
+ In RxDBgrid - after close dataset list of SelectedRows is cleared + In RxDBgrid - after close dataset list of SelectedRows is cleared
+ fix resaizing find form for RxDbGrd + fix resaizing find form for RxDbGrd

View File

@ -23,6 +23,11 @@
+ ��� ��������� �������� Font � TRxDBLookupCombo ���������� ������ ���������� ���� �� ����� + ��� ��������� �������� Font � TRxDBLookupCombo ���������� ������ ���������� ���� �� �����
+ ���� � ������� TField ������������ �������� ��������� �� ��� �������������� � RxDBGrid + ���� � ������� TField ������������ �������� ��������� �� ��� �������������� � RxDBGrid
������ ���� ���������� �������� �� ������ TRxDBLookupCombo ������ ���� ���������� �������� �� ������ TRxDBLookupCombo
- ���������� ������ � ���������� TRxLookupEdit - �� ��������� ���������� ���������� ������
+ � RxDBGrid ������������� ����������� ����
+ ������������� ��������� ��������� TRxCustomDBLookupCombo
+ ���������� ������ � TRxCustomDBLookupCombo ������������ ������ �� ����� �� ����������
+ � RxDBGrid ���������� ��������� ������� ���������� � ��������� �������
29.08.2007 - ������ 1.1.5.98 (svn revision 39) 29.08.2007 - ������ 1.1.5.98 (svn revision 39)
+ � RxDBGrid ����� �������� ������ ������ ������ ���������� ����� (SelectedRows) + � RxDBGrid ����� �������� ������ ������ ������ ���������� ����� (SelectedRows)
��������� ���������

View File

@ -914,16 +914,21 @@ begin
if TextOrient = toHorizontal then if TextOrient = toHorizontal then
begin begin
aRect2:=aRect;
aRect2.Left:=aRect2.Left - 2;
if ASortMarker <> smNone then
aRect2.Right := aRect2.Right - FMarkerDown.Width;
if Assigned(FTit) and (FTit.MCountLines>0) then if Assigned(FTit) and (FTit.MCountLines>0) then
begin begin
aRect2:=aRect;
aRect2.Left:=aRect2.Left - 2;
dW:=Canvas.TextHeight('W') + 4; dW:=Canvas.TextHeight('W') + 4;
for i:=0 to FTit.MCountLines-1 do for i:=0 to FTit.MCountLines-1 do
begin begin
FCap:=FTit.MGetLine(i); FCap:=FTit.MGetLine(i);
dww:=ATextWidth(FCap) * dW; dww:=ATextWidth(FCap) * dW;
aRect2.Bottom:=aRect2.Top + dww; aRect2.Bottom:=aRect2.Top + dww;
WriteTextHeader(Canvas, aRect2, FCap, GetColumnAlignment(aCol, true)); WriteTextHeader(Canvas, aRect2, FCap, GetColumnAlignment(aCol, true));
aRect2.Top:=aRect2.Top + dww; aRect2.Top:=aRect2.Top + dww;
@ -939,7 +944,9 @@ begin
end; end;
end end
else else
WriteTextHeader(Canvas, aRect, FCap, GetColumnAlignment(aCol, true)) begin
WriteTextHeader(Canvas, aRect2, FCap, GetColumnAlignment(aCol, true))
end;
end end
else else
begin begin

View File

@ -195,6 +195,7 @@ type
procedure Notification(AComponent: TComponent; Operation: TOperation); override; procedure Notification(AComponent: TComponent; Operation: TOperation); override;
procedure CMVisibleChanged(var Msg: TLMessage); message CM_VISIBLECHANGED; procedure CMVisibleChanged(var Msg: TLMessage); message CM_VISIBLECHANGED;
procedure CMEnabledChanged(var Msg: TLMessage); message CM_ENABLEDCHANGED; procedure CMEnabledChanged(var Msg: TLMessage); message CM_ENABLEDCHANGED;
procedure MouseDown(Button: TMouseButton; Shift:TShiftState; X,Y:Integer); override;
procedure Paint; override; procedure Paint; override;
procedure LookupDataSetChanged; virtual; procedure LookupDataSetChanged; virtual;
@ -797,8 +798,8 @@ begin
if FValuesList.Count=0 then exit; if FValuesList.Count=0 then exit;
if ColorToRGB(Self.Color) <> ColorToRGB(clBtnFace) then if ColorToRGB(Self.Color) <> ColorToRGB(clBtnFace) then
ACanvas.Pen.Color := clBtnFace ACanvas.Pen.Color := clBtnFace
else ACanvas.Pen.Color := clBtnShadow; else
// LastIndex := FFieldList.Count-1; ACanvas.Pen.Color := clBtnShadow;
LastIndex := FValuesList.Count-1; LastIndex := FValuesList.Count-1;
TxtWidth := ACanvas.TextWidth('M'); TxtWidth := ACanvas.TextWidth('M');
ATop := Max(0, (HeightOf(R) - ACanvas.TextHeight('Xy')) div 2); ATop := Max(0, (HeightOf(R) - ACanvas.TextHeight('Xy')) div 2);
@ -981,7 +982,7 @@ end;
procedure TRxCustomDBLookupCombo.DoAutoSize; procedure TRxCustomDBLookupCombo.DoAutoSize;
begin begin
Height:=Canvas.TextHeight('Wg')+10; Height:=Canvas.TextHeight('Wg')+12;
end; end;
procedure TRxCustomDBLookupCombo.SetEnabled(Value: Boolean); procedure TRxCustomDBLookupCombo.SetEnabled(Value: Boolean);
@ -1124,10 +1125,17 @@ begin
FButton.Enabled:=Enabled; FButton.Enabled:=Enabled;
end; end;
procedure TRxCustomDBLookupCombo.MouseDown(Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
inherited MouseDown(Button, Shift, X, Y);
DoButtonClick(Self);
end;
procedure TRxCustomDBLookupCombo.Paint; procedure TRxCustomDBLookupCombo.Paint;
var var
Selected:boolean; Selected:boolean;
R: TRect; R, R1: TRect;
X, TextMargin: Integer; X, TextMargin: Integer;
AText: string; AText: string;
begin begin
@ -1157,12 +1165,12 @@ begin
end; end;
TextMargin := 0; TextMargin := 0;
if ClientWidth > 4 then if ClientWidth > 6 then
begin begin
SetRect(R, 2, 2, ClientWidth - 2, ClientHeight - 2); SetRect(R1, 3, 3, ClientWidth - 3, ClientHeight - 3);
if TextMargin > 0 then Inc(TextMargin); if TextMargin > 0 then Inc(TextMargin);
X := 2 + TextMargin; X := 3 + TextMargin;
Canvas.FillRect(R); Canvas.FillRect(R1);
R.Right:=R.Right - GetButtonWidth; R.Right:=R.Right - GetButtonWidth;
if FDisplayAll then if FDisplayAll then
PaintDisplayValues(Canvas, R, TextMargin) PaintDisplayValues(Canvas, R, TextMargin)
@ -1179,7 +1187,7 @@ begin
AText:=FValuesList[FLookupDisplayIndex] AText:=FValuesList[FLookupDisplayIndex]
else else
AText:=''; AText:='';
Canvas.TextRect(R, X, Max(0, (HeightOf(R) - Canvas.TextHeight(AText)) div 2), AText); Canvas.TextRect(R, X, Max(0, (HeightOf(R) - Canvas.TextHeight('Wg')) div 2), AText);
end end
end; end;
end; end;

View File

@ -93,7 +93,7 @@ type
property CalendarStyle: TCalendarStyle read GetCalendarStyle property CalendarStyle: TCalendarStyle read GetCalendarStyle
write SetCalendarStyle default dcsDefault; write SetCalendarStyle default dcsDefault;
property PopupVisible: Boolean read GetPopupVisible; property PopupVisible: Boolean read GetPopupVisible;
property PopupAlign: TPopupAlign read FPopupAlign write FPopupAlign default epaRight; property PopupAlign: TPopupAlign read FPopupAlign write FPopupAlign default epaLeft;
public public
constructor Create(AOwner: TComponent); override; constructor Create(AOwner: TComponent); override;
destructor Destroy; override; destructor Destroy; override;
@ -699,6 +699,7 @@ begin
FBlanksChar := ' '; FBlanksChar := ' ';
FDialogTitle := sDateDlgTitle; FDialogTitle := sDateDlgTitle;
FPopupColor := clBtnFace; FPopupColor := clBtnFace;
FPopupAlign := epaLeft;
FStartOfWeek := Mon; FStartOfWeek := Mon;
FWeekends := [Sun]; FWeekends := [Sun];
FWeekendColor := clRed; FWeekendColor := clRed;

View File

@ -14,8 +14,8 @@ uses
type type
TTextOrientation = (toHorizontal, toVertical90, toHorizontal180, toVertical270, toHorizontal360); TTextOrientation = (toHorizontal, toVertical90, toHorizontal180, toVertical270, toHorizontal360);
function WidthOf(R: TRect): Integer; function WidthOf(R: TRect): Integer; inline;
function HeightOf(R: TRect): Integer; function HeightOf(R: TRect): Integer; inline;
procedure RxFrame3D(Canvas: TCanvas; var Rect: TRect; TopColor, BottomColor: TColor; procedure RxFrame3D(Canvas: TCanvas; var Rect: TRect; TopColor, BottomColor: TColor;
Width: Integer); Width: Integer);