You've already forked lazarus-ccr
fpspreadsheet: Modify the define which deactivates multi-selection in the grid (old way not working for old Laz 1.3)
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4020 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -36,4 +36,9 @@
|
|||||||
FPS_LAZUTF8. Keep undefined for the current Lazarus version. }
|
FPS_LAZUTF8. Keep undefined for the current Lazarus version. }
|
||||||
{.$DEFINE FPS_LAZUTF8}
|
{.$DEFINE FPS_LAZUTF8}
|
||||||
|
|
||||||
|
{ In order to allow selection of multiple ranges in the WorksheetGrid a
|
||||||
|
sufficiently new version of the basic TCustomGrid is required. The required
|
||||||
|
property "RangeSelect" was introduced in Lazarus 1.4. In order to compile
|
||||||
|
the package with older versions activate the define FPS_NO_GRID_MULTISELECT }
|
||||||
|
{.$DEFINE FPS_NO_GRID_MULTISELECT}
|
||||||
|
|
||||||
|
@ -15,7 +15,6 @@ interface
|
|||||||
uses
|
uses
|
||||||
Classes, SysUtils;
|
Classes, SysUtils;
|
||||||
|
|
||||||
|
|
||||||
{$IFDEF FPS_VARISBOOL}
|
{$IFDEF FPS_VARISBOOL}
|
||||||
{ Needed only if FPC version is < 2.6.4 }
|
{ Needed only if FPC version is < 2.6.4 }
|
||||||
function VarIsBool(const V: Variant): Boolean;
|
function VarIsBool(const V: Variant): Boolean;
|
||||||
@ -1710,6 +1709,7 @@ end;
|
|||||||
|
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
|
|
||||||
{$IFDEF FPS_FORMATDATETIME}
|
{$IFDEF FPS_FORMATDATETIME}
|
||||||
{******************************************************************************}
|
{******************************************************************************}
|
||||||
{******************************************************************************}
|
{******************************************************************************}
|
||||||
@ -1717,13 +1717,13 @@ end;
|
|||||||
{******************************************************************************}
|
{******************************************************************************}
|
||||||
{******************************************************************************}
|
{******************************************************************************}
|
||||||
|
|
||||||
{@@
|
{@@ ----------------------------------------------------------------------------
|
||||||
Applies a formatting string to a date/time value and converts the number
|
Applies a formatting string to a date/time value and converts the number
|
||||||
to a date/time string.
|
to a date/time string.
|
||||||
|
|
||||||
This functionality is available in the SysUtils unit. But it is duplicated
|
This functionality is available in the SysUtils unit. But it is duplicated
|
||||||
here to add a patch which is not available in stable fpc.
|
here to add a patch which is not available in stable fpc.
|
||||||
}
|
-------------------------------------------------------------------------------}
|
||||||
procedure DateTimeToString(out Result: string; const FormatStr: string; const DateTime: TDateTime;
|
procedure DateTimeToString(out Result: string; const FormatStr: string; const DateTime: TDateTime;
|
||||||
const FormatSettings: TFormatSettings; Options : TFormatDateTimeOptions = []);
|
const FormatSettings: TFormatSettings; Options : TFormatDateTimeOptions = []);
|
||||||
// Copied from "fpc/rtl/objpas/sysutils/datei.inc"
|
// Copied from "fpc/rtl/objpas/sysutils/datei.inc"
|
||||||
@ -1731,44 +1731,7 @@ var
|
|||||||
ResultLen: integer;
|
ResultLen: integer;
|
||||||
ResultBuffer: array[0..255] of char;
|
ResultBuffer: array[0..255] of char;
|
||||||
ResultCurrent: pchar;
|
ResultCurrent: pchar;
|
||||||
(* ---- not needed here ---
|
|
||||||
{$IFDEF MSWindows}
|
|
||||||
isEnable_E_Format : Boolean;
|
|
||||||
isEnable_G_Format : Boolean;
|
|
||||||
eastasiainited : boolean;
|
|
||||||
|
|
||||||
procedure InitEastAsia;
|
|
||||||
var ALCID : LCID;
|
|
||||||
PriLangID , SubLangID : Word;
|
|
||||||
|
|
||||||
begin
|
|
||||||
ALCID := GetThreadLocale;
|
|
||||||
PriLangID := ALCID and $3FF;
|
|
||||||
if (PriLangID>0) then
|
|
||||||
SubLangID := (ALCID and $FFFF) shr 10
|
|
||||||
else
|
|
||||||
begin
|
|
||||||
PriLangID := SysLocale.PriLangID;
|
|
||||||
SubLangID := SysLocale.SubLangID;
|
|
||||||
end;
|
|
||||||
isEnable_E_Format := (PriLangID = LANG_JAPANESE)
|
|
||||||
or
|
|
||||||
(PriLangID = LANG_KOREAN)
|
|
||||||
or
|
|
||||||
((PriLangID = LANG_CHINESE)
|
|
||||||
and
|
|
||||||
(SubLangID = SUBLANG_CHINESE_TRADITIONAL)
|
|
||||||
);
|
|
||||||
isEnable_G_Format := (PriLangID = LANG_JAPANESE)
|
|
||||||
or
|
|
||||||
((PriLangID = LANG_CHINESE)
|
|
||||||
and
|
|
||||||
(SubLangID = SUBLANG_CHINESE_TRADITIONAL)
|
|
||||||
);
|
|
||||||
eastasiainited :=true;
|
|
||||||
end;
|
|
||||||
{$ENDIF MSWindows}
|
|
||||||
*)
|
|
||||||
procedure StoreStr(Str: PChar; Len: Integer);
|
procedure StoreStr(Str: PChar; Len: Integer);
|
||||||
begin
|
begin
|
||||||
if ResultLen + Len < SizeOf(ResultBuffer) then
|
if ResultLen + Len < SizeOf(ResultBuffer) then
|
||||||
@ -2000,38 +1963,6 @@ var
|
|||||||
StoreString(' ');
|
StoreString(' ');
|
||||||
StoreFormat(FormatSettings.LongTimeFormat, Nesting+1, True);
|
StoreFormat(FormatSettings.LongTimeFormat, Nesting+1, True);
|
||||||
end;
|
end;
|
||||||
(* ------------ not needed here...
|
|
||||||
{$IFDEF MSWindows}
|
|
||||||
'E':
|
|
||||||
begin
|
|
||||||
if not Eastasiainited then InitEastAsia;
|
|
||||||
if Not(isEnable_E_Format) then StoreStr(@FormatCurrent^, 1)
|
|
||||||
else
|
|
||||||
begin
|
|
||||||
while (P < FormatEnd) and (UpCase(P^) = Token) do
|
|
||||||
P := P + 1;
|
|
||||||
Count := P - FormatCurrent;
|
|
||||||
StoreString(ConvertEraYearString(Count,Year,Month,Day));
|
|
||||||
end;
|
|
||||||
prevlasttoken := lastformattoken;
|
|
||||||
lastformattoken:=token;
|
|
||||||
end;
|
|
||||||
'G':
|
|
||||||
begin
|
|
||||||
if not Eastasiainited then InitEastAsia;
|
|
||||||
if Not(isEnable_G_Format) then StoreStr(@FormatCurrent^, 1)
|
|
||||||
else
|
|
||||||
begin
|
|
||||||
while (P < FormatEnd) and (UpCase(P^) = Token) do
|
|
||||||
P := P + 1;
|
|
||||||
Count := P - FormatCurrent;
|
|
||||||
StoreString(ConvertEraString(Count,Year,Month,Day));
|
|
||||||
end;
|
|
||||||
prevlasttoken := lastformattoken;
|
|
||||||
lastformattoken:=token;
|
|
||||||
end;
|
|
||||||
{$ENDIF MSWindows}
|
|
||||||
*)
|
|
||||||
end;
|
end;
|
||||||
prevlasttoken := lastformattoken;
|
prevlasttoken := lastformattoken;
|
||||||
lastformattoken := token;
|
lastformattoken := token;
|
||||||
@ -2043,11 +1974,7 @@ var
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
begin (*
|
begin
|
||||||
{$ifdef MSWindows}
|
|
||||||
eastasiainited:=false;
|
|
||||||
{$endif MSWindows}
|
|
||||||
*)
|
|
||||||
DecodeDateFully(DateTime, Year, Month, Day, DayOfWeek);
|
DecodeDateFully(DateTime, Year, Month, Day, DayOfWeek);
|
||||||
DecodeTime(DateTime, Hour, Minute, Second, MilliSecond);
|
DecodeTime(DateTime, Hour, Minute, Second, MilliSecond);
|
||||||
ResultLen := 0;
|
ResultLen := 0;
|
||||||
@ -2100,6 +2027,5 @@ begin
|
|||||||
end;
|
end;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
@ -13,6 +13,7 @@ LICENSE: See the file COPYING.modifiedLGPL.txt, included in the Lazarus
|
|||||||
unit fpspreadsheetgrid;
|
unit fpspreadsheetgrid;
|
||||||
|
|
||||||
{$mode objfpc}{$H+}
|
{$mode objfpc}{$H+}
|
||||||
|
{$I fps.inc}
|
||||||
|
|
||||||
{ To do:
|
{ To do:
|
||||||
- When Lazarus 1.4 comes out remove the workaround for the RGB2HLS bug in
|
- When Lazarus 1.4 comes out remove the workaround for the RGB2HLS bug in
|
||||||
@ -28,13 +29,6 @@ uses
|
|||||||
LCLVersion,
|
LCLVersion,
|
||||||
fpstypes, fpspreadsheet, fpspreadsheetctrls;
|
fpstypes, fpspreadsheet, fpspreadsheetctrls;
|
||||||
|
|
||||||
const
|
|
||||||
{$IF (lcl_fullversion >= 1030000)}
|
|
||||||
ENABLE_MULTI_SELECT = 1; // requires Laz 1.4+ or trunk after r46767
|
|
||||||
{$ELSE}
|
|
||||||
ENABLE_MULTI_SELECT = 0;
|
|
||||||
{$ENDIF}
|
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
{ TsCustomWorksheetGrid }
|
{ TsCustomWorksheetGrid }
|
||||||
@ -356,7 +350,7 @@ type
|
|||||||
read GetWordwraps write SetWordwraps;
|
read GetWordwraps write SetWordwraps;
|
||||||
|
|
||||||
// inherited
|
// inherited
|
||||||
{$IF (ENABLE_MULTI_SELECT = 1)}
|
{$IFNDEF FPS_NO_GRID_MULTISELECT}
|
||||||
{@@ Allow multiple selections}
|
{@@ Allow multiple selections}
|
||||||
property RangeSelectMode default rsmMulti;
|
property RangeSelectMode default rsmMulti;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
@ -864,7 +858,7 @@ begin
|
|||||||
FHyperlinkTimer.Interval := HYPERLINK_TIMER_INTERVAL;
|
FHyperlinkTimer.Interval := HYPERLINK_TIMER_INTERVAL;
|
||||||
FHyperlinkTimer.OnTimer := @HyperlinkTimerElapsed;
|
FHyperlinkTimer.OnTimer := @HyperlinkTimerElapsed;
|
||||||
FOwnsWorkbook := true;
|
FOwnsWorkbook := true;
|
||||||
{$IF (ENABLE_MULTI_SELECT=1)}
|
{$IFNDEF FPS_NO_GRID_MULTISELECT}
|
||||||
RangeSelectMode := rsmMulti;
|
RangeSelectMode := rsmMulti;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
@ -3523,13 +3517,13 @@ end;
|
|||||||
procedure TsCustomWorksheetGrid.MoveSelection;
|
procedure TsCustomWorksheetGrid.MoveSelection;
|
||||||
var
|
var
|
||||||
sel: TsCellRangeArray;
|
sel: TsCellRangeArray;
|
||||||
{$IF (ENABLE_MULTI_SELECT=1)}
|
{$IFNDEF FPS_NO_GRID_MULTISELECT}
|
||||||
i: Integer;
|
i: Integer;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
begin
|
begin
|
||||||
if Worksheet <> nil then
|
if Worksheet <> nil then
|
||||||
begin
|
begin
|
||||||
{$IF (ENABLE_MULTI_SELECT=1)}
|
{$IFNDEF FPS_NO_GRID_MULTISELECT}
|
||||||
if HasMultiSelection then
|
if HasMultiSelection then
|
||||||
begin
|
begin
|
||||||
SetLength(sel, SelectedRangeCount);
|
SetLength(sel, SelectedRangeCount);
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
</Parsing>
|
</Parsing>
|
||||||
<Other>
|
<Other>
|
||||||
<CompilerMessages>
|
<CompilerMessages>
|
||||||
<IgnoredMessages idx5028="True" idx4055="True"/>
|
<IgnoredMessages idx5028="True" idx4055="True" idx2005="True"/>
|
||||||
</CompilerMessages>
|
</CompilerMessages>
|
||||||
<CustomOptions Value="$(IDEBuildOptions)"/>
|
<CustomOptions Value="$(IDEBuildOptions)"/>
|
||||||
</Other>
|
</Other>
|
||||||
@ -151,7 +151,7 @@ This package is all you need if you don't want graphical components (like grids
|
|||||||
</Item30>
|
</Item30>
|
||||||
<Item31>
|
<Item31>
|
||||||
<Filename Value="fpsreaderwriter.pas"/>
|
<Filename Value="fpsreaderwriter.pas"/>
|
||||||
<UnitName Value="fpsreaderwriter"/>
|
<UnitName Value="fpsReaderWriter"/>
|
||||||
</Item31>
|
</Item31>
|
||||||
<Item32>
|
<Item32>
|
||||||
<Filename Value="fpsnumformat.pas"/>
|
<Filename Value="fpsnumformat.pas"/>
|
||||||
|
Reference in New Issue
Block a user