You've already forked lazarus-ccr
jvcllaz: Minor refactoring of JvYearGrid
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8485 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -295,7 +295,7 @@ var
|
|||||||
AYear, AMonth, ADay: Word;
|
AYear, AMonth, ADay: Word;
|
||||||
begin
|
begin
|
||||||
inherited Create(AOwner);
|
inherited Create(AOwner);
|
||||||
|
|
||||||
FCellMargins := TJvRect.Create;
|
FCellMargins := TJvRect.Create;
|
||||||
FCellMargins.Top := 2;
|
FCellMargins.Top := 2;
|
||||||
FCellMargins.Left := 2;
|
FCellMargins.Left := 2;
|
||||||
@ -998,20 +998,15 @@ var
|
|||||||
ADate: TDate;
|
ADate: TDate;
|
||||||
InfoText: string;
|
InfoText: string;
|
||||||
InfoColor: TColor;
|
InfoColor: TColor;
|
||||||
// Month, Day: Word;
|
|
||||||
MonthIndex, DayIndex: Integer;
|
MonthIndex, DayIndex: Integer;
|
||||||
CanSelect: Boolean;
|
CanSelect: Boolean;
|
||||||
begin
|
begin
|
||||||
|
Result := False;
|
||||||
|
|
||||||
CanSelect := True;
|
CanSelect := True;
|
||||||
if Assigned(OnSelectCell) then
|
if Assigned(OnSelectCell) then
|
||||||
OnSelectCell(Self, ACol, ARow, CanSelect);
|
OnSelectCell(Self, ACol, ARow, CanSelect);
|
||||||
if not CanSelect then
|
if (not CanSelect) or (ACol < 1) or (ARow < 1) then
|
||||||
begin
|
|
||||||
Result := False;
|
|
||||||
Exit;
|
|
||||||
end;
|
|
||||||
Result := False;
|
|
||||||
if (ACol < 1) or (ARow < 1) then
|
|
||||||
Exit;
|
Exit;
|
||||||
|
|
||||||
ColRowToDayMonthIndex(ACol, ARow, DayIndex, MonthIndex);
|
ColRowToDayMonthIndex(ACol, ARow, DayIndex, MonthIndex);
|
||||||
@ -1019,16 +1014,18 @@ begin
|
|||||||
DS := FYearData[DayIndex, MonthIndex].DisplayText;
|
DS := FYearData[DayIndex, MonthIndex].DisplayText;
|
||||||
if DS = '' then
|
if DS = '' then
|
||||||
Exit;
|
Exit;
|
||||||
// Month := ARow;
|
|
||||||
// Day := StrToInt(FYearData[ACol, ARow].DisplayText);
|
|
||||||
ADate := EncodeDate(Year, MonthIndex, FYearData[DayIndex, MonthIndex].DayInMonth);
|
ADate := EncodeDate(Year, MonthIndex, FYearData[DayIndex, MonthIndex].DayInMonth);
|
||||||
|
|
||||||
InfoText := FYearData[DayIndex, MonthIndex].InfoText;
|
InfoText := FYearData[DayIndex, MonthIndex].InfoText;
|
||||||
if FYearData[DayIndex, MonthIndex].Custom then
|
if FYearData[DayIndex, MonthIndex].Custom then
|
||||||
InfoColor := FYearData[DayIndex, MonthIndex].CustomColor
|
InfoColor := FYearData[DayIndex, MonthIndex].CustomColor
|
||||||
else
|
else
|
||||||
InfoColor := FYearData[DayIndex, MonthIndex].DefaultColor;
|
InfoColor := FYearData[DayIndex, MonthIndex].DefaultColor;
|
||||||
|
|
||||||
if Assigned(FOnSelectDate) then
|
if Assigned(FOnSelectDate) then
|
||||||
FOnSelectDate(Self, ADate, InfoText, InfoColor);
|
FOnSelectDate(Self, ADate, InfoText, InfoColor);
|
||||||
|
|
||||||
Result := True;
|
Result := True;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user