Fixed focus issues

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2333 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
jujibo
2012-03-06 15:59:19 +00:00
parent 41d2a7604a
commit 1f687faa43
5 changed files with 38 additions and 1 deletions

View File

@ -3,7 +3,11 @@ JUJIBOUTILS
Note: Lazarus Trunk required
Version pre-1.0
Version pre-1.1
--------------------------------------------------
2012-03-06 Fixed: Focus issues
Version 1.0
--------------------------------------------------
2011-10-14 Released jujiboutils 1.0
2011-09-30 Added: ftString support to TJDBGridControl. MaxLength property.

View File

@ -430,6 +430,9 @@ end;
function TJDbGridDateTimeCtrl.CanDefocus: boolean;
begin
if not updated then
Result:= True
else
if CellEditor.Focused and (Length(CellEditor.Text) = 0) then
Result := True
else
@ -604,6 +607,9 @@ end;
function TJDbGridTimeCtrl.CanDefocus: boolean;
begin
if not updated then
Result:= True
else
if CellEditor.Focused and (Length(CellEditor.Text) = 0) then
Result := True
else
@ -780,6 +786,9 @@ end;
function TJDbGridDateCtrl.CanDefocus: boolean;
begin
if not updated then
Result:= True
else
if CellEditor.Focused and (Length(CellEditor.Text) = 0) then
Result := True
else

View File

@ -66,6 +66,7 @@ type
procedure KeyDown(var Key: word; Shift: TShiftState); override;
procedure KeyPress(var Key: char); override;
procedure DoEnter; override;
procedure DoExit; override;
function GetReadOnly: boolean; override;
procedure SetReadOnly(Value: boolean); override;
@ -358,6 +359,12 @@ begin
inherited DoEnter;
end;
procedure TJDBLabeledCurrencyEdit.DoExit;
begin
formatInput;
inherited DoExit;
end;
constructor TJDBLabeledCurrencyEdit.Create(TheOwner: TComponent);
begin
inherited Create(TheOwner);

View File

@ -27,6 +27,9 @@ uses
SysUtils, jinputconsts;
type
{ TJDBLabeledFloatEdit }
TJDBLabeledFloatEdit = class(TCustomLabeledEdit)
private
fFormat: string;
@ -63,6 +66,7 @@ type
procedure KeyDown(var Key: word; Shift: TShiftState); override;
procedure KeyPress(var Key: char); override;
procedure DoEnter; override;
procedure DoExit; override;
function GetReadOnly: boolean; override;
procedure SetReadOnly(Value: boolean); override;
@ -353,6 +357,12 @@ begin
inherited DoEnter;
end;
procedure TJDBLabeledFloatEdit.DoExit;
begin
formatInput;
inherited DoExit;
end;
constructor TJDBLabeledFloatEdit.Create(TheOwner: TComponent);
begin
inherited Create(TheOwner);

View File

@ -62,6 +62,7 @@ type
procedure KeyDown(var Key: word; Shift: TShiftState); override;
procedure KeyPress(var Key: char); override;
procedure DoEnter; override;
procedure DoExit; override;
function GetReadOnly: boolean; override;
procedure SetReadOnly(Value: boolean); override;
@ -319,6 +320,12 @@ begin
inherited DoEnter;
end;
procedure TJDBLabeledIntegerEdit.DoExit;
begin
formatInput;
inherited DoExit;
end;
constructor TJDBLabeledIntegerEdit.Create(TheOwner: TComponent);
begin
inherited Create(TheOwner);