- Fix error in TRxLookupEdit

+ In RxDBGrid published new property from DBGrid


git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@329 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
alexs75
2008-01-28 05:21:43 +00:00
parent 54d663b3da
commit a559cb6c4a
5 changed files with 85 additions and 18 deletions

View File

@ -15,6 +15,11 @@
+ New procedure StrToStrings in module rxstrutils - fill List:TStrings
procedure StrToStrings(const S:string; const List:TStrings; const Delims:Char);
+ New editor for TField object with Lookup source in TRxDBGrid - base on class TRxDBLookupCombo
+ In TRxDBLookupCombo work property AutoSize
+ After change property Font in TRxDBLookupCombo dropdown list used this font
+ In RxDBGrid create lookup editor for TField
- Fix error in TRxLookupEdit
+ In RxDBGrid published new property from DBGrid
29.08.2007 - ������ 1.1.5.98 (svn revision 39)
+ In RxDBgrid - after close dataset list of SelectedRows is cleared
+ fix resaizing find form for RxDbGrd

View File

@ -160,6 +160,7 @@ type
procedure SetDate(const AValue: TDateTime);
procedure TopPanelDblClick(Sender: TObject);
procedure MonthMenuClick(Sender: TObject);
procedure CalendarDblClick(Sender: TObject);
protected
procedure KeyDown(var Key: Word; Shift: TShiftState); override;
procedure KeyPress(var Key: Char); override;
@ -842,6 +843,7 @@ begin
Align := alClient;
OnChange := @CalendarChange;
OnMouseUp := @CalendarMouseUp;
OnDblClick := @CalendarDblClick;
end;
FBtns[0] := TRxTimerSpeedButton.Create(Self);
@ -942,6 +944,11 @@ begin
FCalendar.Month:=Cmd;
end;
procedure TPopupCalendar.CalendarDblClick(Sender: TObject);
begin
ModalResult:=mrOk;
end;
procedure TPopupCalendar.KeyDown(var Key: Word; Shift: TShiftState);
begin
if FCalendar <> nil then
@ -986,7 +993,7 @@ begin
inherited Deactivate;
{ if Assigned(FOnPopUpCloseEvent) then
FOnPopUpCloseEvent(FFindResult);}
Close;
// Close;
end;
procedure TPopupCalendar.PrevYearBtnClick(Sender: TObject);

View File

@ -62,7 +62,7 @@ type
function MCountLines:integer;
function MGetLine(ALine:integer):string;
protected
procedure SetCaption(const AValue: string); override;
procedure SetCaption(const AValue: TCaption); override;
public
constructor Create(TheColumn: TGridColumn); override;
destructor Destroy; override;
@ -323,6 +323,7 @@ type
property Anchors;
property AutoAdvance default aaRightDown;
property AutoFillColumns;
property AutoEdit;
//property BiDiMode;
property BorderSpacing;
property BorderStyle;
@ -345,6 +346,8 @@ type
property FixedColor;
property Flat;
property Font;
property HeaderHotZones;
property HeaderPushZones;
//property ImeMode;
//property ImeName;
property Options;
@ -356,7 +359,7 @@ type
//property ParentShowHint;
property PopupMenu;
property ReadOnly;
property Scrollbars;
property Scrollbars default ssBoth;
property ShowHint;
property TabOrder;
property TabStop;
@ -1894,7 +1897,7 @@ begin
Result:='';
end;
procedure TRxColumnTitle.SetCaption(const AValue: string);
procedure TRxColumnTitle.SetCaption(const AValue: TCaption);
var
c:integer;
s:string;

View File

@ -376,7 +376,7 @@ begin
if not FPopupVisible then
begin
ShowPopUp;
FList.Columns.Clear;
{ FList.Columns.Clear;
W:=16;
for I:=0 to FFieldList.Count-1 do
begin;
@ -388,7 +388,7 @@ begin
GC.Width:=GC.Field.DisplayWidth * FList.Canvas.TextWidth('W');
W:=W+GC.Width + 4;
end;
FPopupVisible:=true;
FPopupVisible:=true;}
end;
end;

View File

@ -58,6 +58,10 @@ type
procedure SetWeekends(const AValue: TDaysOfWeek);
procedure SetYearDigits(const AValue: TYearDigits);
procedure CalendarHintsChanged(Sender: TObject);
// function AcceptPopup(var Value: Variant): Boolean;
procedure AcceptValue(const AValue: TDateTime);
// procedure SetPopupValue(const Value: Variant);
protected
FPopup: TPopupCalendar;
procedure UpdateFormat;
@ -108,6 +112,7 @@ type
property BlanksChar;
property StartOfWeek;
property DialogTitle;
property DirectInput;
Property OnAcceptDate;
property OKCaption;
property CancelCaption;
@ -442,6 +447,36 @@ begin
if not (csDesigning in ComponentState) then UpdatePopup;
end;
{function TCustomRxDateEdit.AcceptPopup(var Value: Variant): Boolean;
var
D: TDateTime;
begin
Result := True;
if Assigned(FOnAcceptDate) then begin
if VarIsNull(Value) or VarIsEmpty(Value) then D := NullDate
else
try
D := VarToDateTime(Value);
except
if DefaultToday then D := SysUtils.Date else D := NullDate;
end;
FOnAcceptDate(Self, D, Result);
if Result then Value := VarFromDateTime(D);
end;
end;}
procedure TCustomRxDateEdit.AcceptValue(const AValue: TDateTime);
begin
SetDate(AValue);
// UpdatePopupVisible;
if Modified then inherited Change;
end;
{procedure TCustomRxDateEdit.SetPopupValue(const Value: Variant);
begin
end;}
procedure TCustomRxDateEdit.UpdateFormat;
begin
FDateFormat := DefDateFormat(FourDigitYear);
@ -463,7 +498,8 @@ var
P: TPoint;
Y: Integer;
begin
if (FPopup <> nil) and not (ReadOnly or FPopupVisible) then begin
if (FPopup <> nil) and not (ReadOnly {or FPopupVisible}) then
begin
P := Parent.ClientToScreen(Point(Left, Top));
Y := P.Y + Height;
if Y + FPopup.Height > Screen.Height then
@ -483,17 +519,19 @@ begin
if P.X < 0 then P.X := 0
else if P.X + FPopup.Width > Screen.Width then
P.X := Screen.Width - FPopup.Width;
{ if Text <> '' then
SetPopupValue(Text)
if Text <> '' then
FPopup.Date:=StrToDateDef(Text, Date)
else
SetPopupValue(Null);}
if CanFocus then SetFocus;
FPopup.Date:=Date;
ShowPopup(Point(P.X, Y));
FPopupVisible := True;
if DisableEdit then begin
// FPopupVisible := True;
{ if DisableEdit then
begin
inherited ReadOnly := True;
HideCaret(Handle);
end;
end;}
end;
end;
@ -501,6 +539,7 @@ procedure TCustomRxDateEdit.PopupCloseUp(Sender: TObject; Accept: Boolean);
var
AValue: Variant;
begin
(*
if (FPopup <> nil) and FPopupVisible then
begin
{ if GetCapture <> 0 then
@ -517,7 +556,7 @@ begin
except
{ ignore exceptions }
end;
// SetDirectInput(DirectInput);
// DirectInput:=DirectInput;
Invalidate;
{ if Accept and AcceptPopup(AValue) and EditCanModify then
begin
@ -528,6 +567,7 @@ begin
FPopupVisible := False;
end;
end;
*)
end;
procedure TCustomRxDateEdit.HidePopup;
@ -536,8 +576,20 @@ begin
end;
procedure TCustomRxDateEdit.ShowPopup(AOrigin: TPoint);
var
FAccept:boolean;
begin
FPopup.Show;
FPopup.Left:=AOrigin.X;
FPopup.Top:=AOrigin.Y;
FAccept:=FPopup.ShowModal = mrOk;
if CanFocus then SetFocus;
if FAccept {and AcceptPopup(AValue) and EditCanModify }then
begin
AcceptValue(FPopup.Date);
if Focused then inherited SelectAll;
end;
{ FPopup.Show(AOrigin);
SetWindowPos(Handle, HWND_TOP, Origin.X, Origin.Y, 0, 0,
SWP_NOACTIVATE or SWP_SHOWWINDOW or SWP_NOSIZE);
@ -616,9 +668,9 @@ begin
inherited DoButtonClick(Sender);
if FPopup <> nil then
begin
if FPopupVisible then
{ if FPopupVisible then
PopupCloseUp(FPopup, True)
else
else}
PopupDropDown(True);
end
else