fix error with empty sring in TRxDateEdit
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@358 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
parent
9c08448885
commit
68a637e733
@ -33,6 +33,7 @@
|
||||
+ TDBDateEdit inherited from TRxDateEdit, for old style use DBDateEdit_OLD compiller directive
|
||||
(see rx.inc).
|
||||
+ In RxDBGrid property FixedHotColor now published
|
||||
- fix error with empty sring in TRxDateEdit.
|
||||
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
|
||||
|
@ -39,6 +39,7 @@
|
||||
включить директиву DBDateEdit_OLD. Для работоспособности программ необходимо переоткрыть все формы
|
||||
в дизайнере.
|
||||
+ В RxDBGrid опубликованы недостающие поля
|
||||
- Исправлена ошибка в обработке пустой даты в редакторе дат.
|
||||
29.08.2007 - версия 1.1.5.98 (svn revision 39)
|
||||
+ В RxDBGrid После закрытия набора данных список помеченных строк (SelectedRows)
|
||||
очищается
|
||||
|
@ -3,6 +3,7 @@
|
||||
{$H+}
|
||||
|
||||
{$DEFINE RX_D3}
|
||||
{$DEFINE RX_D4}
|
||||
{$DEFINE HASVARIANT}
|
||||
{.$DEFINE ENABLE_Child_Defs}
|
||||
{$DEFINE NEW_STYLE_TITLE_ALIGNMENT_RXDBGRID}
|
||||
|
@ -12,7 +12,6 @@ unit rxclock;
|
||||
interface
|
||||
|
||||
{$I rx.inc}
|
||||
|
||||
uses LCLType, LMessages, SysUtils, Classes, Graphics, Controls, Forms, StdCtrls,
|
||||
ExtCtrls, Menus, messages;
|
||||
|
||||
@ -666,12 +665,16 @@ begin
|
||||
try
|
||||
Canvas.Brush.Color := Canvas.Pen.Color;
|
||||
MinDots := ((DotWidth > MinDotWidth) and (DotHeight > MinDotHeight));
|
||||
for Pos := 0 to HandPositions - 1 do begin
|
||||
for Pos := 0 to HandPositions - 1 do
|
||||
begin
|
||||
R.Top := (CircleTab^[Pos].Y * FClockRadius) div CirTabScale + FClockCenter.Y;
|
||||
R.Left := (CircleTab^[Pos].X * FClockRadius) div CirTabScale + FClockCenter.X;
|
||||
if (Pos mod 5) <> 0 then begin
|
||||
if MinDots then begin
|
||||
if Ctl3D then begin
|
||||
if (Pos mod 5) <> 0 then
|
||||
begin
|
||||
if MinDots then
|
||||
begin
|
||||
if Ctl3D then
|
||||
begin
|
||||
Canvas.Brush.Color := clBtnShadow;
|
||||
OffsetRect(R, -1, -1);
|
||||
R.Right := R.Left + 2;
|
||||
@ -790,24 +793,31 @@ begin
|
||||
Canvas.Pen.Color := Font.Color;
|
||||
Canvas.Brush.Color := Color;
|
||||
SetBkMode(Canvas.Handle, TRANSPARENT);
|
||||
if PaintMode = pmPaintAll then begin
|
||||
with Canvas do begin
|
||||
if PaintMode = pmPaintAll then
|
||||
begin
|
||||
with Canvas do
|
||||
begin
|
||||
FillRect(FClockRect);
|
||||
Pen.Color := Self.Font.Color;
|
||||
DrawAnalogFace;
|
||||
DrawFatHand(HourHandPos(FDisplayTime), True);
|
||||
DrawFatHand(FDisplayTime.Minute, False);
|
||||
Pen.Color := Brush.Color;
|
||||
if ShowSeconds then DrawSecondHand(FDisplayTime.Second);
|
||||
if ShowSeconds then
|
||||
DrawSecondHand(FDisplayTime.Second);
|
||||
end;
|
||||
end
|
||||
else begin
|
||||
with Canvas do begin
|
||||
else
|
||||
begin
|
||||
with Canvas do
|
||||
begin
|
||||
Pen.Color := Brush.Color;
|
||||
GetTime(NewTime);
|
||||
if NewTime.Hour >= 12 then Dec(NewTime.Hour, 12);
|
||||
if NewTime.Hour >= 12 then
|
||||
Dec(NewTime.Hour, 12);
|
||||
if (NewTime.Second <> FDisplayTime.Second) then
|
||||
if ShowSeconds then DrawSecondHand(FDisplayTime.Second);
|
||||
if ShowSeconds then
|
||||
DrawSecondHand(FDisplayTime.Second);
|
||||
if ((NewTime.Minute <> FDisplayTime.Minute) or
|
||||
(NewTime.Hour <> FDisplayTime.Hour)) then
|
||||
begin
|
||||
@ -818,8 +828,10 @@ begin
|
||||
DrawFatHand(HourHandPos(NewTime), True);
|
||||
end;
|
||||
Pen.Color := Brush.Color;
|
||||
if (NewTime.Second <> FDisplayTime.Second) then begin
|
||||
if ShowSeconds then DrawSecondHand(NewTime.Second);
|
||||
if (NewTime.Second <> FDisplayTime.Second) then
|
||||
begin
|
||||
if ShowSeconds then
|
||||
DrawSecondHand(NewTime.Second);
|
||||
FDisplayTime := NewTime;
|
||||
end;
|
||||
end;
|
||||
|
@ -2561,7 +2561,7 @@ begin
|
||||
if (Flags and DT_CALCRECT <> 0) and ((AText = '') or FShowAccelChar and
|
||||
(AText[1] = '&') and (AText[2] = #0)) then AText := AText + ' ';
|
||||
if not FShowAccelChar then Flags := Flags or DT_NOPREFIX;
|
||||
{$IFDEF RX_D4}
|
||||
{$IFDEF USED_BiDi}
|
||||
Flags := DrawTextBiDiModeFlags(Flags);
|
||||
{$ENDIF}
|
||||
Canvas.Font := Font;
|
||||
@ -2647,7 +2647,7 @@ begin
|
||||
InflateRect(Rect, 1, 0);
|
||||
X := Left;
|
||||
AAlignment := FAlignment;
|
||||
{$IFDEF RX_D4}
|
||||
{$IFDEF USED_BiDi}
|
||||
if UseRightToLeftAlignment then ChangeBiDiModeAlignment(AAlignment);
|
||||
{$ENDIF}
|
||||
if AAlignment = taRightJustify then Inc(X, Width - Rect.Right);
|
||||
@ -3145,7 +3145,7 @@ begin
|
||||
R.Bottom := R.Top + FTxtDivider;
|
||||
Flags := {DT_EXPANDTABS or }Alignments[FAlignment] or DT_SINGLELINE or
|
||||
DT_NOCLIP or DT_NOPREFIX;
|
||||
{$IFDEF RX_D4}
|
||||
{$IFDEF USED_BiDi}
|
||||
Flags := DrawTextBiDiModeFlags(Flags);
|
||||
{$ENDIF}
|
||||
for I := FFirstLine to FLines.Count do begin
|
||||
|
@ -538,17 +538,17 @@ function TRxMemoryData.FindFieldData(Buffer: Pointer; Field: TField): Pointer;
|
||||
var
|
||||
Index: Integer;
|
||||
begin
|
||||
{$IFDEF RX_D4}
|
||||
Index := FieldDefList.IndexOf(Field.FullName);
|
||||
{$ELSE}
|
||||
{.$IFDEF RX_D4}
|
||||
// Index := FieldDefList.IndexOf(Field.FullName);
|
||||
{.$ELSE}
|
||||
Index := FieldDefs.IndexOf(Field.FieldName);
|
||||
{$ENDIF}
|
||||
{.$ENDIF}
|
||||
if (Index >= 0) and (Buffer <> nil) and
|
||||
{$IFDEF RX_D4}
|
||||
(FieldDefList[Index].DataType in ftSupported - ftBlobTypes) then
|
||||
{$ELSE}
|
||||
{.$IFDEF RX_D4}
|
||||
// (FieldDefList[Index].DataType in ftSupported - ftBlobTypes) then
|
||||
{.$ELSE}
|
||||
(FieldDefs[Index].DataType in ftSupported - ftBlobTypes) then
|
||||
{$ENDIF}
|
||||
{.$ENDIF}
|
||||
Result := Pointer(Integer(PChar(Buffer)) + FOffsets^[Index])
|
||||
else Result := nil;
|
||||
end;
|
||||
@ -712,6 +712,7 @@ begin
|
||||
Result := RecBuf <> nil;
|
||||
end;
|
||||
|
||||
{$IFDEF FIX_BUG_FieldNo}
|
||||
function GetFieldNo(DS:TDataSet; Field:TField):integer;
|
||||
var
|
||||
i:integer;
|
||||
@ -724,6 +725,7 @@ begin
|
||||
end;
|
||||
Result:=0;
|
||||
end;
|
||||
{$ENDIF}
|
||||
|
||||
function TRxMemoryData.GetFieldData(Field: TField; Buffer: Pointer): Boolean;
|
||||
var
|
||||
@ -732,8 +734,11 @@ var
|
||||
begin
|
||||
Result := False;
|
||||
if not GetActiveRecBuf(RecBuf) then Exit;
|
||||
// if Field.FieldNo > 0 then
|
||||
{$IFDEF FIX_BUG_FieldNo}
|
||||
if GetFieldNo(Self, Field) > 0 then
|
||||
{$ELSE}
|
||||
if Field.FieldNo > 0 then
|
||||
{$ENDIF}
|
||||
begin
|
||||
Data := FindFieldData(RecBuf, Field);
|
||||
if Data <> nil then begin
|
||||
@ -767,13 +772,17 @@ procedure TRxMemoryData.SetFieldData(Field: TField; Buffer: Pointer);
|
||||
var
|
||||
RecBuf, Data: PChar;
|
||||
VarData: Variant;
|
||||
PBl:PBoolean;
|
||||
begin
|
||||
if not (State in dsWriteModes) then Error(SNotEditing);
|
||||
GetActiveRecBuf(RecBuf);
|
||||
with Field do
|
||||
begin
|
||||
// if Field.FieldNo > 0 then
|
||||
{$IFDEF FIX_BUG_FieldNo}
|
||||
if GetFieldNo(Self, Field) > 0 then
|
||||
{$ELSE}
|
||||
if Field.FieldNo > 0 then
|
||||
{$ENDIF}
|
||||
begin
|
||||
if State in [dsCalcFields, dsFilter] then Error(SNotEditing);
|
||||
if ReadOnly and not (State in [dsSetKey, dsFilter]) then
|
||||
@ -800,9 +809,12 @@ begin
|
||||
end
|
||||
else
|
||||
begin
|
||||
Boolean(Data[0]) := LongBool(Buffer);
|
||||
PBl:=Pointer(Data);
|
||||
// Boolean(Data^{[0]}) := Assigned(Buffer);//LongBool(Buffer);
|
||||
// Pbl^:=Assigned(Buffer);
|
||||
PBoolean(Pointer(Data))^:= Assigned(Buffer);
|
||||
Inc(Data);
|
||||
if LongBool(Buffer) then
|
||||
if Assigned(Buffer) then
|
||||
Move(Buffer^, Data^, CalcFieldLen(DataType, Size))
|
||||
else
|
||||
FillChar(Data^, CalcFieldLen(DataType, Size), 0);
|
||||
|
@ -233,7 +233,7 @@ var
|
||||
DC: HDC;
|
||||
PS: TPaintStruct;
|
||||
S: string;
|
||||
{$IFDEF RX_D4}
|
||||
{$IFDEF USED_BiDi}
|
||||
ExStyle: DWORD;
|
||||
const
|
||||
AlignStyle: array[Boolean, TAlignment] of DWORD =
|
||||
@ -244,13 +244,13 @@ begin
|
||||
Result := True;
|
||||
with Editor do
|
||||
begin
|
||||
{$IFDEF RX_D4}
|
||||
// if UseRightToLeftAlignment then ChangeBiDiModeAlignment(AAlignment);
|
||||
{$IFDEF USED_BiDi}
|
||||
if UseRightToLeftAlignment then ChangeBiDiModeAlignment(AAlignment);
|
||||
{$ENDIF}
|
||||
if StandardPaint and not(csPaintCopy in ControlState) then
|
||||
begin
|
||||
{$IFDEF RX_D4}
|
||||
(* if SysLocale.MiddleEast and HandleAllocated and (IsRightToLeft) then
|
||||
{$IFDEF USED_BiDi}
|
||||
if SysLocale.MiddleEast and HandleAllocated and (IsRightToLeft) then
|
||||
begin { This keeps the right aligned text, right aligned }
|
||||
ExStyle := DWORD(GetWindowLong(Handle, GWL_EXSTYLE)) and (not WS_EX_RIGHT) and
|
||||
(not WS_EX_RTLREADING) and (not WS_EX_LEFTSCROLLBAR);
|
||||
@ -262,8 +262,8 @@ begin
|
||||
AlignStyle[UseRightToLeftAlignment, AAlignment];
|
||||
if DWORD(GetWindowLong(Handle, GWL_EXSTYLE)) <> ExStyle then
|
||||
SetWindowLong(Handle, GWL_EXSTYLE, ExStyle);
|
||||
end; *)
|
||||
{$ENDIF RX_D4}
|
||||
end;
|
||||
{$ENDIF USED_BiDi}
|
||||
Result := False;
|
||||
{ return false if we need to use standard paint handler }
|
||||
Exit;
|
||||
@ -312,7 +312,7 @@ begin
|
||||
ALeft := (ClientWidth {- ButtonWidth} - AWidth) div 2;
|
||||
end;
|
||||
{ end;}
|
||||
{$IFDEF RX_D4}
|
||||
{$IFDEF USED_BiDi}
|
||||
if SysLocale.MiddleEast then UpdateTextFlags;
|
||||
{$ENDIF}
|
||||
Brush.Style := bsClear;
|
||||
@ -354,7 +354,8 @@ function TCustomRxDateEdit.GetDate: TDateTime;
|
||||
begin
|
||||
if DefaultToday then Result := SysUtils.Date
|
||||
else Result := NullDate;
|
||||
Result := StrToDateFmtDef(FDateFormat, Text, Result);
|
||||
if Text<>'' then
|
||||
Result := StrToDateFmtDef(FDateFormat, Text, Result);
|
||||
end;
|
||||
|
||||
function TCustomRxDateEdit.GetPopupColor: TColor;
|
||||
|
Loading…
Reference in New Issue
Block a user