fpspreadsheet: Add properties for direct cell font access by TsWorksheetGrid.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3040 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2014-05-11 16:16:59 +00:00
parent a954d389c0
commit 07824c46c1
6 changed files with 2187 additions and 1853 deletions

View File

@ -107,7 +107,7 @@
<PackageName Value="LCL"/>
</Item2>
</RequiredPackages>
<Units Count="55">
<Units Count="57">
<Unit0>
<Filename Value="fpsgrid.lpr"/>
<IsPartOfProject Value="True"/>
@ -126,36 +126,36 @@
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
<UnitName Value="mainform"/>
<IsVisibleTab Value="True"/>
<EditorIndex Value="1"/>
<WindowIndex Value="0"/>
<TopLine Value="526"/>
<CursorPos X="48" Y="557"/>
<TopLine Value="309"/>
<CursorPos X="18" Y="327"/>
<UsageCount Value="200"/>
<Bookmarks Count="1">
<Item0 X="3" Y="558" ID="1"/>
</Bookmarks>
<Loaded Value="True"/>
<LoadedDesigner Value="True"/>
</Unit1>
<Unit2>
<Filename Value="..\..\fpspreadsheet.pas"/>
<UnitName Value="fpspreadsheet"/>
<EditorIndex Value="5"/>
<EditorIndex Value="8"/>
<WindowIndex Value="0"/>
<TopLine Value="187"/>
<CursorPos X="10" Y="186"/>
<UsageCount Value="99"/>
<TopLine Value="2255"/>
<CursorPos X="19" Y="2262"/>
<UsageCount Value="100"/>
<Loaded Value="True"/>
</Unit2>
<Unit3>
<Filename Value="..\..\fpspreadsheetgrid.pas"/>
<UnitName Value="fpspreadsheetgrid"/>
<EditorIndex Value="4"/>
<IsVisibleTab Value="True"/>
<EditorIndex Value="6"/>
<WindowIndex Value="0"/>
<TopLine Value="1142"/>
<CursorPos X="19" Y="1161"/>
<TopLine Value="2007"/>
<CursorPos X="1" Y="1983"/>
<UsageCount Value="100"/>
<Bookmarks Count="1">
<Item0 X="7" Y="1938" ID="1"/>
</Bookmarks>
<Loaded Value="True"/>
</Unit3>
<Unit4>
@ -164,7 +164,7 @@
<WindowIndex Value="0"/>
<TopLine Value="25"/>
<CursorPos X="4" Y="44"/>
<UsageCount Value="7"/>
<UsageCount Value="6"/>
</Unit4>
<Unit5>
<Filename Value="c:\lazarus27\fpc\2.2.4\source\packages\winunits-base\src\activex.pp"/>
@ -172,7 +172,7 @@
<WindowIndex Value="0"/>
<TopLine Value="49"/>
<CursorPos X="10" Y="24"/>
<UsageCount Value="7"/>
<UsageCount Value="6"/>
</Unit5>
<Unit6>
<Filename Value="c:\lazarus27\fpc\2.2.4\source\packages\fcl-base\src\avl_tree.pp"/>
@ -180,7 +180,7 @@
<WindowIndex Value="0"/>
<TopLine Value="37"/>
<CursorPos X="14" Y="83"/>
<UsageCount Value="7"/>
<UsageCount Value="6"/>
</Unit6>
<Unit7>
<Filename Value="c:\Lazarus\lcl\grids.pas"/>
@ -188,14 +188,14 @@
<WindowIndex Value="0"/>
<TopLine Value="1516"/>
<CursorPos X="28" Y="1534"/>
<UsageCount Value="7"/>
<UsageCount Value="6"/>
</Unit7>
<Unit8>
<Filename Value="c:\Lazarus\lcl\include\customform.inc"/>
<WindowIndex Value="0"/>
<TopLine Value="2021"/>
<CursorPos X="1" Y="2041"/>
<UsageCount Value="7"/>
<UsageCount Value="6"/>
</Unit8>
<Unit9>
<Filename Value="..\..\fpsallformats.pas"/>
@ -203,7 +203,7 @@
<WindowIndex Value="0"/>
<TopLine Value="1"/>
<CursorPos X="62" Y="13"/>
<UsageCount Value="7"/>
<UsageCount Value="6"/>
</Unit9>
<Unit10>
<Filename Value="..\..\wikitable.pas"/>
@ -211,7 +211,7 @@
<WindowIndex Value="0"/>
<TopLine Value="48"/>
<CursorPos X="41" Y="60"/>
<UsageCount Value="13"/>
<UsageCount Value="12"/>
</Unit10>
<Unit11>
<Filename Value="..\..\fpsopendocument.pas"/>
@ -219,15 +219,17 @@
<WindowIndex Value="0"/>
<TopLine Value="1"/>
<CursorPos X="1" Y="1"/>
<UsageCount Value="9"/>
<UsageCount Value="8"/>
</Unit11>
<Unit12>
<Filename Value="d:\lazarus-svn\lcl\grids.pas"/>
<UnitName Value="Grids"/>
<EditorIndex Value="2"/>
<WindowIndex Value="0"/>
<TopLine Value="6924"/>
<CursorPos X="20" Y="6956"/>
<UsageCount Value="46"/>
<TopLine Value="2464"/>
<CursorPos X="1" Y="2495"/>
<UsageCount Value="48"/>
<Loaded Value="True"/>
</Unit12>
<Unit13>
<Filename Value="..\..\fpsutils.pas"/>
@ -235,23 +237,23 @@
<WindowIndex Value="0"/>
<TopLine Value="35"/>
<CursorPos X="1" Y="62"/>
<UsageCount Value="48"/>
<UsageCount Value="47"/>
</Unit13>
<Unit14>
<Filename Value="d:\lazarus-svn\lcl\include\canvas.inc"/>
<WindowIndex Value="0"/>
<TopLine Value="1212"/>
<CursorPos X="3" Y="1218"/>
<UsageCount Value="5"/>
<UsageCount Value="4"/>
</Unit14>
<Unit15>
<Filename Value="d:\lazarus-svn\lcl\graphics.pp"/>
<UnitName Value="Graphics"/>
<EditorIndex Value="3"/>
<EditorIndex Value="5"/>
<WindowIndex Value="0"/>
<TopLine Value="1937"/>
<CursorPos X="11" Y="1956"/>
<UsageCount Value="30"/>
<UsageCount Value="33"/>
<Loaded Value="True"/>
</Unit15>
<Unit16>
@ -259,16 +261,16 @@
<WindowIndex Value="0"/>
<TopLine Value="248"/>
<CursorPos X="22" Y="263"/>
<UsageCount Value="13"/>
<UsageCount Value="12"/>
</Unit16>
<Unit17>
<Filename Value="..\..\xlsbiff8.pas"/>
<UnitName Value="xlsbiff8"/>
<EditorIndex Value="7"/>
<EditorIndex Value="10"/>
<WindowIndex Value="0"/>
<TopLine Value="2008"/>
<TopLine Value="2010"/>
<CursorPos X="39" Y="1983"/>
<UsageCount Value="74"/>
<UsageCount Value="77"/>
<Loaded Value="True"/>
</Unit17>
<Unit18>
@ -277,43 +279,43 @@
<WindowIndex Value="0"/>
<TopLine Value="1091"/>
<CursorPos X="12" Y="1122"/>
<UsageCount Value="9"/>
<UsageCount Value="8"/>
</Unit18>
<Unit19>
<Filename Value="d:\lazarus-svn\lcl\include\wincontrol.inc"/>
<WindowIndex Value="0"/>
<TopLine Value="7344"/>
<CursorPos X="30" Y="7349"/>
<UsageCount Value="7"/>
<UsageCount Value="6"/>
</Unit19>
<Unit20>
<Filename Value="..\..\xlscommon.pas"/>
<UnitName Value="xlscommon"/>
<EditorIndex Value="6"/>
<EditorIndex Value="9"/>
<WindowIndex Value="0"/>
<TopLine Value="1461"/>
<CursorPos X="43" Y="1479"/>
<UsageCount Value="70"/>
<UsageCount Value="73"/>
<Loaded Value="True"/>
</Unit20>
<Unit21>
<Filename Value="..\..\xlsbiff5.pas"/>
<UnitName Value="xlsbiff5"/>
<EditorIndex Value="8"/>
<EditorIndex Value="11"/>
<WindowIndex Value="0"/>
<TopLine Value="1"/>
<CursorPos X="1" Y="1"/>
<UsageCount Value="57"/>
<UsageCount Value="60"/>
<Loaded Value="True"/>
</Unit21>
<Unit22>
<Filename Value="..\..\xlsbiff2.pas"/>
<UnitName Value="xlsbiff2"/>
<EditorIndex Value="9"/>
<EditorIndex Value="12"/>
<WindowIndex Value="0"/>
<TopLine Value="547"/>
<CursorPos X="1" Y="563"/>
<UsageCount Value="58"/>
<UsageCount Value="61"/>
<Loaded Value="True"/>
</Unit22>
<Unit23>
@ -322,7 +324,7 @@
<WindowIndex Value="0"/>
<TopLine Value="841"/>
<CursorPos X="19" Y="852"/>
<UsageCount Value="2"/>
<UsageCount Value="1"/>
</Unit23>
<Unit24>
<Filename Value="d:\lazarus-svn\fpc\2.6.2\source\packages\fcl-image\src\fpcanvas.pp"/>
@ -330,7 +332,7 @@
<WindowIndex Value="0"/>
<TopLine Value="111"/>
<CursorPos X="3" Y="112"/>
<UsageCount Value="15"/>
<UsageCount Value="14"/>
</Unit24>
<Unit25>
<Filename Value="d:\lazarus-svn\fpc\2.6.2\source\packages\fcl-image\src\fpimage.pp"/>
@ -338,14 +340,14 @@
<WindowIndex Value="0"/>
<TopLine Value="74"/>
<CursorPos X="3" Y="93"/>
<UsageCount Value="3"/>
<UsageCount Value="2"/>
</Unit25>
<Unit26>
<Filename Value="d:\lazarus-svn\fpc\2.6.2\source\rtl\objpas\classes\lists.inc"/>
<WindowIndex Value="0"/>
<TopLine Value="141"/>
<CursorPos X="3" Y="143"/>
<UsageCount Value="11"/>
<UsageCount Value="10"/>
</Unit26>
<Unit27>
<Filename Value="d:\Prog_Delphi\common\units\XLS.pas"/>
@ -353,14 +355,14 @@
<WindowIndex Value="0"/>
<TopLine Value="114"/>
<CursorPos X="42" Y="152"/>
<UsageCount Value="11"/>
<UsageCount Value="10"/>
</Unit27>
<Unit28>
<Filename Value="d:\lazarus-svn\lcl\include\pen.inc"/>
<WindowIndex Value="0"/>
<TopLine Value="354"/>
<CursorPos X="1" Y="385"/>
<UsageCount Value="16"/>
<UsageCount Value="15"/>
</Unit28>
<Unit29>
<Filename Value="d:\lazarus-svn\lcl\controls.pp"/>
@ -368,14 +370,14 @@
<WindowIndex Value="0"/>
<TopLine Value="2222"/>
<CursorPos X="14" Y="2242"/>
<UsageCount Value="11"/>
<UsageCount Value="10"/>
</Unit29>
<Unit30>
<Filename Value="d:\lazarus-svn\lcl\include\control.inc"/>
<WindowIndex Value="0"/>
<TopLine Value="4129"/>
<CursorPos X="1" Y="4161"/>
<UsageCount Value="10"/>
<UsageCount Value="9"/>
</Unit30>
<Unit31>
<Filename Value="..\..\fpspreadsheetchart.pas"/>
@ -383,7 +385,7 @@
<WindowIndex Value="0"/>
<TopLine Value="170"/>
<CursorPos X="37" Y="204"/>
<UsageCount Value="6"/>
<UsageCount Value="5"/>
</Unit31>
<Unit32>
<Filename Value="d:\lazarus-svn\components\lazutils\lazutf8.pas"/>
@ -391,16 +393,16 @@
<WindowIndex Value="0"/>
<TopLine Value="3180"/>
<CursorPos X="1" Y="3212"/>
<UsageCount Value="7"/>
<UsageCount Value="6"/>
</Unit32>
<Unit33>
<Filename Value="d:\lazarus-svn\lcl\colorbox.pas"/>
<UnitName Value="ColorBox"/>
<EditorIndex Value="2"/>
<EditorIndex Value="4"/>
<WindowIndex Value="0"/>
<TopLine Value="584"/>
<CursorPos X="3" Y="598"/>
<UsageCount Value="11"/>
<UsageCount Value="14"/>
<Loaded Value="True"/>
</Unit33>
<Unit34>
@ -409,7 +411,7 @@
<WindowIndex Value="0"/>
<TopLine Value="222"/>
<CursorPos X="3" Y="253"/>
<UsageCount Value="7"/>
<UsageCount Value="6"/>
</Unit34>
<Unit35>
<Filename Value="d:\lazarus-svn\lcl\forms.pp"/>
@ -417,7 +419,7 @@
<WindowIndex Value="0"/>
<TopLine Value="932"/>
<CursorPos X="3" Y="939"/>
<UsageCount Value="7"/>
<UsageCount Value="6"/>
</Unit35>
<Unit36>
<Filename Value="C:\development\lazarus\lcl\graphics.pp"/>
@ -425,7 +427,7 @@
<WindowIndex Value="0"/>
<TopLine Value="2053"/>
<CursorPos X="30" Y="1945"/>
<UsageCount Value="10"/>
<UsageCount Value="9"/>
</Unit36>
<Unit37>
<Filename Value="C:\development\fpc\packages\fcl-image\src\fpcanvas.pp"/>
@ -433,14 +435,14 @@
<WindowIndex Value="0"/>
<TopLine Value="89"/>
<CursorPos X="15" Y="97"/>
<UsageCount Value="9"/>
<UsageCount Value="8"/>
</Unit37>
<Unit38>
<Filename Value="C:\development\fpc\packages\fcl-image\src\fpfont.inc"/>
<WindowIndex Value="0"/>
<TopLine Value="54"/>
<CursorPos X="3" Y="57"/>
<UsageCount Value="9"/>
<UsageCount Value="8"/>
</Unit38>
<Unit39>
<Filename Value="C:\development\lazarus\lcl\graphmath.pp"/>
@ -448,7 +450,7 @@
<WindowIndex Value="0"/>
<TopLine Value="584"/>
<CursorPos X="3" Y="439"/>
<UsageCount Value="9"/>
<UsageCount Value="8"/>
</Unit39>
<Unit40>
<Filename Value="C:\development\lazarus\lcl\graphtype.pp"/>
@ -456,7 +458,7 @@
<WindowIndex Value="0"/>
<TopLine Value="234"/>
<CursorPos X="3" Y="33"/>
<UsageCount Value="9"/>
<UsageCount Value="8"/>
</Unit40>
<Unit41>
<Filename Value="C:\development\lazarus\lcl\lcltype.pp"/>
@ -464,7 +466,7 @@
<WindowIndex Value="0"/>
<TopLine Value="1628"/>
<CursorPos X="3" Y="1643"/>
<UsageCount Value="9"/>
<UsageCount Value="8"/>
</Unit41>
<Unit42>
<Filename Value="C:\development\lazarus\lcl\graphutil.pp"/>
@ -472,7 +474,7 @@
<WindowIndex Value="0"/>
<TopLine Value="128"/>
<CursorPos X="12" Y="143"/>
<UsageCount Value="9"/>
<UsageCount Value="8"/>
</Unit42>
<Unit43>
<Filename Value="C:\development\fpc\rtl\objpas\math.pp"/>
@ -480,14 +482,14 @@
<WindowIndex Value="0"/>
<TopLine Value="144"/>
<CursorPos X="10" Y="159"/>
<UsageCount Value="12"/>
<UsageCount Value="11"/>
</Unit43>
<Unit44>
<Filename Value="C:\development\fpc\rtl\i386\i386.inc"/>
<WindowIndex Value="0"/>
<TopLine Value="1551"/>
<CursorPos X="3" Y="1563"/>
<UsageCount Value="10"/>
<UsageCount Value="9"/>
</Unit44>
<Unit45>
<Filename Value="C:\development\lazarus\lcl\grids.pas"/>
@ -495,7 +497,7 @@
<WindowIndex Value="0"/>
<TopLine Value="794"/>
<CursorPos X="15" Y="1010"/>
<UsageCount Value="16"/>
<UsageCount Value="15"/>
</Unit45>
<Unit46>
<Filename Value="..\..\..\spktoolbar\SpkGraphTools\SpkGraphTools.pas"/>
@ -503,185 +505,203 @@
<WindowIndex Value="0"/>
<TopLine Value="136"/>
<CursorPos X="1" Y="143"/>
<UsageCount Value="7"/>
<UsageCount Value="6"/>
</Unit46>
<Unit47>
<Filename Value="C:\development\fpc\rtl\objpas\classes\lists.inc"/>
<WindowIndex Value="0"/>
<TopLine Value="34"/>
<CursorPos X="1" Y="49"/>
<UsageCount Value="15"/>
<UsageCount Value="14"/>
</Unit47>
<Unit48>
<Filename Value="C:\development\lazarus\lcl\include\canvas.inc"/>
<WindowIndex Value="0"/>
<TopLine Value="1705"/>
<CursorPos X="1" Y="1720"/>
<UsageCount Value="15"/>
<UsageCount Value="14"/>
</Unit48>
<Unit49>
<Filename Value="C:\development\lazarus\lcl\include\font.inc"/>
<WindowIndex Value="0"/>
<TopLine Value="1139"/>
<CursorPos X="25" Y="1161"/>
<UsageCount Value="15"/>
<UsageCount Value="14"/>
</Unit49>
<Unit50>
<Filename Value="C:\development\lazarus\lcl\include\winapih.inc"/>
<WindowIndex Value="0"/>
<TopLine Value="156"/>
<CursorPos X="10" Y="171"/>
<UsageCount Value="9"/>
<UsageCount Value="8"/>
</Unit50>
<Unit51>
<Filename Value="C:\development\lazarus\lcl\include\intfbasewinapi.inc"/>
<WindowIndex Value="0"/>
<TopLine Value="1577"/>
<CursorPos X="3" Y="1579"/>
<UsageCount Value="9"/>
<UsageCount Value="8"/>
</Unit51>
<Unit52>
<Filename Value="C:\development\fpc\rtl\inc\except.inc"/>
<WindowIndex Value="0"/>
<TopLine Value="202"/>
<CursorPos X="1" Y="227"/>
<UsageCount Value="9"/>
<UsageCount Value="8"/>
</Unit52>
<Unit53>
<Filename Value="d:\lazarus-svn\lcl\include\menuitem.inc"/>
<WindowIndex Value="0"/>
<TopLine Value="69"/>
<CursorPos X="28" Y="82"/>
<UsageCount Value="15"/>
<UsageCount Value="14"/>
</Unit53>
<Unit54>
<Filename Value="d:\lazarus-svn\lcl\include\application.inc"/>
<WindowIndex Value="0"/>
<TopLine Value="1371"/>
<CursorPos X="1" Y="1390"/>
<UsageCount Value="14"/>
<UsageCount Value="13"/>
</Unit54>
<Unit55>
<Filename Value="d:\lazarus-svn\lcl\include\font.inc"/>
<EditorIndex Value="3"/>
<WindowIndex Value="0"/>
<TopLine Value="648"/>
<CursorPos X="1" Y="675"/>
<UsageCount Value="12"/>
<Loaded Value="True"/>
</Unit55>
<Unit56>
<Filename Value="d:\lazarus-svn\lcl\include\fontdialog.inc"/>
<EditorIndex Value="7"/>
<WindowIndex Value="0"/>
<TopLine Value="24"/>
<CursorPos X="1" Y="49"/>
<UsageCount Value="12"/>
<Loaded Value="True"/>
</Unit56>
</Units>
<JumpHistory Count="30" HistoryIndex="29">
<Position1>
<Filename Value="d:\lazarus-svn\lcl\colorbox.pas"/>
<Caret Line="610" Column="15" TopLine="578"/>
<Filename Value="..\..\fpspreadsheetgrid.pas"/>
<Caret Line="1360" Column="1" TopLine="1335"/>
</Position1>
<Position2>
<Filename Value="mainform.pas"/>
<Caret Line="435" Column="32" TopLine="420"/>
<Filename Value="..\..\fpspreadsheetgrid.pas"/>
<Caret Line="1361" Column="1" TopLine="1335"/>
</Position2>
<Position3>
<Filename Value="..\..\fpspreadsheetgrid.pas"/>
<Caret Line="140" Column="14" TopLine="121"/>
<Caret Line="1362" Column="1" TopLine="1335"/>
</Position3>
<Position4>
<Filename Value="d:\lazarus-svn\lcl\colorbox.pas"/>
<Caret Line="589" Column="28" TopLine="589"/>
<Filename Value="..\..\fpspreadsheetgrid.pas"/>
<Caret Line="1363" Column="1" TopLine="1335"/>
</Position4>
<Position5>
<Filename Value="d:\lazarus-svn\lcl\colorbox.pas"/>
<Caret Line="1" Column="1" TopLine="1"/>
<Filename Value="..\..\fpspreadsheetgrid.pas"/>
<Caret Line="1368" Column="1" TopLine="1336"/>
</Position5>
<Position6>
<Filename Value="d:\lazarus-svn\lcl\colorbox.pas"/>
<Caret Line="61" Column="27" TopLine="29"/>
<Filename Value="mainform.pas"/>
<Caret Line="610" Column="1" TopLine="602"/>
</Position6>
<Position7>
<Filename Value="d:\lazarus-svn\lcl\colorbox.pas"/>
<Caret Line="169" Column="27" TopLine="137"/>
<Filename Value="mainform.pas"/>
<Caret Line="613" Column="1" TopLine="602"/>
</Position7>
<Position8>
<Filename Value="d:\lazarus-svn\lcl\colorbox.pas"/>
<Caret Line="365" Column="15" TopLine="333"/>
<Filename Value="mainform.pas"/>
<Caret Line="603" Column="19" TopLine="603"/>
</Position8>
<Position9>
<Filename Value="d:\lazarus-svn\lcl\colorbox.pas"/>
<Caret Line="463" Column="17" TopLine="431"/>
<Filename Value="mainform.pas"/>
<Caret Line="310" Column="3" TopLine="310"/>
</Position9>
<Position10>
<Filename Value="d:\lazarus-svn\lcl\colorbox.pas"/>
<Caret Line="573" Column="41" TopLine="573"/>
<Filename Value="mainform.pas"/>
<Caret Line="1" Column="1" TopLine="1"/>
</Position10>
<Position11>
<Filename Value="d:\lazarus-svn\lcl\colorbox.pas"/>
<Caret Line="1" Column="1" TopLine="1"/>
<Filename Value="mainform.pas"/>
<Caret Line="173" Column="29" TopLine="142"/>
</Position11>
<Position12>
<Filename Value="d:\lazarus-svn\lcl\colorbox.pas"/>
<Caret Line="61" Column="27" TopLine="29"/>
<Filename Value="mainform.pas"/>
<Caret Line="556" Column="17" TopLine="524"/>
</Position12>
<Position13>
<Filename Value="d:\lazarus-svn\lcl\colorbox.pas"/>
<Caret Line="169" Column="27" TopLine="137"/>
<Filename Value="..\..\fpspreadsheetgrid.pas"/>
<Caret Line="2038" Column="1" TopLine="2031"/>
</Position13>
<Position14>
<Filename Value="d:\lazarus-svn\lcl\colorbox.pas"/>
<Caret Line="365" Column="15" TopLine="333"/>
<Filename Value="..\..\fpspreadsheetgrid.pas"/>
<Caret Line="2041" Column="1" TopLine="2031"/>
</Position14>
<Position15>
<Filename Value="d:\lazarus-svn\lcl\colorbox.pas"/>
<Caret Line="463" Column="17" TopLine="431"/>
<Filename Value="..\..\fpspreadsheetgrid.pas"/>
<Caret Line="2044" Column="1" TopLine="2031"/>
</Position15>
<Position16>
<Filename Value="mainform.pas"/>
<Caret Line="420" Column="4" TopLine="420"/>
<Filename Value="d:\lazarus-svn\lcl\grids.pas"/>
<Caret Line="2483" Column="1" TopLine="2464"/>
</Position16>
<Position17>
<Filename Value="..\..\fpspreadsheetgrid.pas"/>
<Caret Line="140" Column="14" TopLine="121"/>
<Filename Value="d:\lazarus-svn\lcl\grids.pas"/>
<Caret Line="2484" Column="1" TopLine="2464"/>
</Position17>
<Position18>
<Filename Value="..\..\fpspreadsheetgrid.pas"/>
<Caret Line="1161" Column="24" TopLine="1143"/>
<Filename Value="d:\lazarus-svn\lcl\grids.pas"/>
<Caret Line="2485" Column="1" TopLine="2464"/>
</Position18>
<Position19>
<Filename Value="..\..\fpspreadsheet.pas"/>
<Caret Line="447" Column="3" TopLine="447"/>
<Filename Value="d:\lazarus-svn\lcl\grids.pas"/>
<Caret Line="2486" Column="1" TopLine="2464"/>
</Position19>
<Position20>
<Filename Value="..\..\fpspreadsheet.pas"/>
<Caret Line="1" Column="1" TopLine="1"/>
<Filename Value="d:\lazarus-svn\lcl\grids.pas"/>
<Caret Line="2490" Column="1" TopLine="2464"/>
</Position20>
<Position21>
<Filename Value="..\..\fpspreadsheetgrid.pas"/>
<Caret Line="1161" Column="24" TopLine="1142"/>
<Filename Value="d:\lazarus-svn\lcl\grids.pas"/>
<Caret Line="2492" Column="1" TopLine="2464"/>
</Position21>
<Position22>
<Filename Value="mainform.pas"/>
<Caret Line="562" Column="28" TopLine="552"/>
<Filename Value="d:\lazarus-svn\lcl\grids.pas"/>
<Caret Line="2494" Column="1" TopLine="2464"/>
</Position22>
<Position23>
<Filename Value="mainform.pas"/>
<Caret Line="433" Column="14" TopLine="417"/>
<Filename Value="d:\lazarus-svn\lcl\grids.pas"/>
<Caret Line="2495" Column="1" TopLine="2464"/>
</Position23>
<Position24>
<Filename Value="mainform.pas"/>
<Caret Line="438" Column="30" TopLine="419"/>
<Filename Value="..\..\fpspreadsheetgrid.pas"/>
<Caret Line="2038" Column="1" TopLine="2031"/>
</Position24>
<Position25>
<Filename Value="mainform.pas"/>
<Caret Line="439" Column="29" TopLine="420"/>
<Filename Value="..\..\fpspreadsheetgrid.pas"/>
<Caret Line="1626" Column="1" TopLine="1607"/>
</Position25>
<Position26>
<Filename Value="mainform.pas"/>
<Caret Line="440" Column="23" TopLine="421"/>
<Filename Value="..\..\fpspreadsheet.pas"/>
<Caret Line="414" Column="14" TopLine="397"/>
</Position26>
<Position27>
<Filename Value="mainform.pas"/>
<Caret Line="439" Column="60" TopLine="420"/>
<Caret Line="564" Column="1" TopLine="557"/>
</Position27>
<Position28>
<Filename Value="mainform.pas"/>
<Caret Line="589" Column="26" TopLine="571"/>
<Caret Line="640" Column="31" TopLine="604"/>
</Position28>
<Position29>
<Filename Value="mainform.pas"/>
<Caret Line="557" Column="3" TopLine="522"/>
<Caret Line="641" Column="31" TopLine="605"/>
</Position29>
<Position30>
<Filename Value="mainform.pas"/>
<Caret Line="165" Column="77" TopLine="134"/>
<Caret Line="640" Column="31" TopLine="604"/>
</Position30>
</JumpHistory>
</ProjectOptions>

View File

@ -169,22 +169,22 @@ object Form1: TForm1
Images = ImageList1
TabOrder = 3
object ToolButton10: TToolButton
Left = 273
Left = 296
Top = 2
Action = AcLeftAlign
end
object ToolButton12: TToolButton
Left = 296
Left = 319
Top = 2
Action = AcHorCenterAlign
end
object ToolButton13: TToolButton
Left = 319
Left = 342
Top = 2
Action = AcRightAlign
end
object FontComboBox: TComboBox
Left = 1
Left = 24
Height = 23
Top = 2
Width = 127
@ -193,7 +193,7 @@ object Form1: TForm1
TabOrder = 0
end
object FontSizeComboBox: TComboBox
Left = 128
Left = 151
Height = 23
Top = 2
Width = 48
@ -210,82 +210,75 @@ object Form1: TForm1
'20'
'24'
)
OnSelect = FontComboBoxSelect
OnSelect = FontSizeComboBoxSelect
TabOrder = 1
end
object ToolButton7: TToolButton
Left = 176
Left = 199
Top = 2
Action = AcFontBold
end
object ToolButton8: TToolButton
Left = 199
Left = 222
Top = 2
Action = AcFontItalic
end
object ToolButton9: TToolButton
Left = 222
Left = 245
Top = 2
Action = AcFontUnderline
end
object ToolButton11: TToolButton
Left = 245
Left = 268
Top = 2
Action = AcFontStrikeout
end
object ToolButton14: TToolButton
Left = 268
Left = 291
Top = 2
Width = 5
Caption = 'ToolButton14'
Style = tbsDivider
end
object ToolButton15: TToolButton
Left = 342
Left = 365
Top = 2
Width = 5
Caption = 'ToolButton15'
Style = tbsDivider
end
object ToolButton16: TToolButton
Left = 347
Left = 370
Top = 2
Action = AcVAlignTop
end
object ToolButton17: TToolButton
Left = 370
Left = 393
Top = 2
Action = AcVAlignCenter
end
object ToolButton18: TToolButton
Left = 393
Left = 416
Top = 2
Action = AcVAlignBottom
end
object ToolButton19: TToolButton
Left = 416
Left = 439
Top = 2
Width = 5
Caption = 'ToolButton19'
Style = tbsDivider
end
object TbBorders: TToolButton
Left = 421
Left = 444
Top = 2
Action = AcBorderNone
DropdownMenu = BordersPopupMenu
Style = tbsDropDown
end
object ToolButton20: TToolButton
Left = 456
Top = 2
Width = 5
Caption = 'ToolButton20'
Style = tbsDivider
end
object CbBackgroundColor: TColorBox
Left = 461
Height = 24
Left = 479
Height = 22
Top = 2
Width = 132
Style = [cbPrettyNames, cbCustomColors]
@ -294,6 +287,11 @@ object Form1: TForm1
OnSelect = CbBackgroundColorSelect
TabOrder = 2
end
object ToolButton21: TToolButton
Left = 1
Top = 2
Action = AcFont
end
end
object OpenDialog1: TOpenDialog
DefaultExt = '.xls'
@ -1842,7 +1840,6 @@ object Form1: TForm1
OnExecute = AcFontStyleExecute
end
object AcFontItalic: TAction
Tag = 1
Category = 'Format'
AutoCheck = True
Caption = 'Italic'
@ -1851,7 +1848,6 @@ object Form1: TForm1
OnExecute = AcFontStyleExecute
end
object AcFontStrikeout: TAction
Tag = 2
Category = 'Format'
AutoCheck = True
Caption = 'Strike out'
@ -1860,7 +1856,7 @@ object Form1: TForm1
OnExecute = AcFontStyleExecute
end
object AcFontUnderline: TAction
Tag = 3
Tag = 9
Category = 'Format'
AutoCheck = True
Caption = 'Underline'

File diff suppressed because it is too large Load Diff

View File

@ -134,7 +134,7 @@ type
ToolButton19: TToolButton;
ToolButton2: TToolButton;
TbBorders: TToolButton;
ToolButton20: TToolButton;
ToolButton21: TToolButton;
ToolButton3: TToolButton;
ToolButton4: TToolButton;
ToolButton5: TToolButton;
@ -147,19 +147,20 @@ type
procedure AcFontExecute(Sender: TObject);
procedure AcFontStyleExecute(Sender: TObject);
procedure AcHorAlignmentExecute(Sender: TObject);
procedure AcOpenExecute(Sender: TObject);
procedure AcQuitExecute(Sender: TObject);
procedure AcSaveAsExecute(Sender: TObject);
procedure AcTextRotationExecute(Sender: TObject);
procedure AcVertAlignmentExecute(Sender: TObject);
procedure AcWordwrapExecute(Sender: TObject);
procedure CbBackgroundColorSelect(Sender: TObject);
procedure CbShowHeadersClick(Sender: TObject);
procedure CbShowGridLinesClick(Sender: TObject);
procedure AcOpenExecute(Sender: TObject);
procedure AcQuitExecute(Sender: TObject);
procedure AcSaveAsExecute(Sender: TObject);
procedure CbBackgroundColorGetColors(Sender: TCustomColorBox; Items: TStrings);
procedure EdFrozenColsChange(Sender: TObject);
procedure EdFrozenRowsChange(Sender: TObject);
procedure FontComboBoxSelect(Sender: TObject);
procedure FontSizeComboBoxSelect(Sender: TObject);
procedure FormActivate(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure PageControl1Change(Sender: TObject);
@ -169,7 +170,9 @@ type
procedure LoadFile(const AFileName: String);
procedure SetupBackgroundColorBox;
procedure UpdateBackgroundColorIndex;
procedure UpdateFontActions(AFont: TsFont);
procedure UpdateFontNameIndex;
procedure UpdateFontSizeIndex;
procedure UpdateFontStyleActions;
procedure UpdateHorAlignmentActions;
procedure UpdateTextRotationActions;
procedure UpdateVertAlignmentActions;
@ -208,7 +211,7 @@ const
BOTTOM_BORDER_MASK = $7000;
LR_INNER_BORDER = $0008;
TB_INNER_BORDER = $0800;
// Use a combination of these bits for the "Tag" of the Border actions.
// Use a combination of these bits for the "Tag" of the Border actions - see FormCreate.
{ TForm1 }
@ -304,56 +307,31 @@ begin
end;
end;
{ Changes the font of the selected cell by calling a standard font dialog.
Note that the worksheet's and grid's fonts are implemented differently.
In particular, the worksheet's font color is an index into the workbook's
palette while the grid's font color is an rgb value. }
{ Changes the font of the selected cell by calling a standard font dialog. }
procedure TForm1.AcFontExecute(Sender: TObject);
var
r,c: Cardinal;
f: Integer;
style: TsFontStyles;
lFont: TsFont;
begin
with sWorksheetGrid1 do begin
if Worksheet <> nil then begin
c := GetWorksheetCol(Col);
r := GetWorksheetRow(Row);
f := Worksheet.GetCell(r, c)^.FontIndex;
Convert_sFont_to_Font(Workbook.GetFont(f), FontDialog1.Font);
if FontDialog1.Execute then begin
lFont := TsFont.Create;
try
Convert_Font_to_sFont(FontDialog1.Font, lFont);
WorkSheet.WriteFont(r, c, lFont.FontName, lFont.Size, lFont.Style, lFont.Color);
finally
lFont.Free;
end;
end;
end;
if Workbook = nil then
exit;
FontDialog1.Font := CellFonts[Selection];
if FontDialog1.Execute then
CellFonts[Selection] := FontDialog1.Font;
end;
end;
procedure TForm1.AcFontStyleExecute(Sender: TObject);
var
style: TsFontstyles;
f: Integer;
r,c: Cardinal;
lFont: TsFont;
begin
with sWorksheetGrid1 do begin
c := GetWorksheetCol(Col);
r := GetWorksheetRow(Row);
if Worksheet <> nil then begin
f := Worksheet.GetCell(r, c)^.FontIndex;
lFont := Workbook.GetFont(f);
style := lFont.Style;
if TAction(Sender).Checked then
Include(style, TsFontStyle(TAction(Sender).Tag))
else
Exclude(style, TsFontStyle(TAction(Sender).Tag));
Worksheet.WriteFontStyle(r, c, style);
end;
if Workbook = nil then
exit;
style := [];
if AcFontBold.Checked then Include(style, fssBold);
if AcFontItalic.Checked then Include(style, fssItalic);
if AcFontStrikeout.Checked then Include(style, fssStrikeout);
if AcFontUnderline.Checked then Include(style, fssUnderline);
CellFontStyles[Selection] := style;
end;
end;
@ -464,33 +442,20 @@ end;
procedure TForm1.FontComboBoxSelect(Sender: TObject);
var
c, r: Cardinal;
f: Integer;
lFont: TsFont;
h: Integer;
s: String;
fname: String;
begin
if sWorksheetGrid1.Workbook = nil then
exit;
fname := FontCombobox.Items[FontCombobox.ItemIndex];
if fname <> '' then
with sWorksheetGrid1 do CellFontNames[Selection] := fName;
end;
with sWorksheetGrid1 do begin
c := GetWorksheetCol(Col);
r := GetWorksheetRow(Row);
f := Worksheet.GetCell(r, c)^.FontIndex;
lFont := Workbook.GetFont(f);
if FontCombobox.ItemIndex = -1 then
s := lFont.FontName
else
s := FontCombobox.Items[FontCombobox.ItemIndex];
if FontSizeCombobox.ItemIndex = -1 then
h := round(lFont.Size)
else
h := StrToInt(FontSizeCombobox.Items[FontSizeCombobox.ItemIndex]);
Worksheet.WriteFont(r, c, s, h, lFont.Style, lFont.Color);
end;
procedure TForm1.FontSizeComboBoxSelect(Sender: TObject);
var
sz: Integer;
begin
sz := StrToInt(FontSizeCombobox.Items[FontSizeCombobox.ItemIndex]);
if sz > 0 then
with sWorksheetGrid1 do CellFontSizes[Selection] := sz;
end;
procedure TForm1.FormActivate(Sender: TObject);
@ -578,27 +543,18 @@ begin
end;
procedure TForm1.sWorksheetGrid1Selection(Sender: TObject; aCol, aRow: Integer);
var
cell: PCell;
c, r: Cardinal;
lFont: TsFont;
begin
with sWorksheetGrid1 do begin
if Worksheet = nil then exit;
if sWorksheetGrid1.Workbook = nil then
exit;
c := GetWorksheetCol(ACol);
r := GetWorksheetRow(ARow);
cell := Worksheet.FindCell(r, c);
end;
UpdateHorAlignmentActions;
UpdateVertAlignmentActions;
UpdateWordwraps;
UpdateBackgroundColorIndex;
if cell = nil then
exit;
lFont := sWorksheetGrid1.Workbook.GetFont(cell^.FontIndex);
UpdateFontActions(lFont);
// UpdateFontActions;
UpdateFontNameIndex;
UpdateFontSizeIndex;
UpdateFontStyleActions;
end;
procedure TForm1.UpdateBackgroundColorIndex;
@ -626,14 +582,37 @@ begin
end;
end;
procedure TForm1.UpdateFontActions(AFont: TsFont);
procedure TForm1.UpdateFontNameIndex;
var
fname: String;
begin
FontCombobox.ItemIndex := FontCombobox.Items.IndexOf(AFont.FontName);
FontsizeCombobox.ItemIndex := FontSizeCombobox.Items.IndexOf(IntToStr(Round(AFont.Size)));
AcFontBold.Checked := fssBold in AFont.Style;
AcFontItalic.Checked := fssItalic in AFont.Style;
AcFontUnderline.Checked := fssUnderline in AFont.Style;
AcFontStrikeout.Checked := fssStrikeOut in AFont.Style;
with sWorksheetGrid1 do fname := CellFontNames[Selection];
if fname = '' then
FontCombobox.ItemIndex := -1
else
FontCombobox.ItemIndex := FontCombobox.Items.IndexOf(fname);
end;
procedure TForm1.UpdateFontSizeIndex;
var
sz: Single;
begin
with sWorksheetGrid1 do sz := CellFontSizes[Selection];
if sz < 0 then
FontSizeCombobox.ItemIndex := -1
else
FontSizeCombobox.ItemIndex := FontSizeCombobox.Items.IndexOf(IntToStr(Round(sz)));
end;
procedure TForm1.UpdateFontStyleActions;
var
style: TsFontStyles;
begin
with sWorksheetGrid1 do style := CellFontStyles[Selection];
AcFontBold.Checked := fssBold in style;
AcFontItalic.Checked := fssItalic in style;
AcFontUnderline.Checked := fssUnderline in style;
AcFontStrikeout.Checked := fssStrikeOut in style;
end;
procedure TForm1.UpdateTextRotationActions;

View File

@ -376,7 +376,8 @@ type
AFontSize: Single; AFontStyle: TsFontStyles; AFontColor: TsColor): Integer; overload;
procedure WriteFont(ARow, ACol: Cardinal; AFontIndex: Integer); overload;
function WriteFontColor(ARow, ACol: Cardinal; AFontColor: TsColor): Integer;
function WriteFontSize(ARow, ACol: Cardinal; ASize: Integer): Integer;
function WriteFontName(ARow, ACol: Cardinal; AFontName: String): Integer;
function WriteFontSize(ARow, ACol: Cardinal; ASize: Single): Integer;
function WriteFontStyle(ARow, ACol: Cardinal; AStyle: TsFontStyles): Integer;
procedure WriteTextRotation(ARow, ACol: Cardinal; ARotation: TsTextRotation);
procedure WriteUsedFormatting(ARow, ACol: Cardinal; AUsedFormatting: TsUsedFormattingFields);
@ -1506,7 +1507,17 @@ begin
Result := WriteFont(ARow, ACol, fnt.FontName, fnt.Size, fnt.Style, AFontColor);
end;
function TsWorksheet.WriteFontSize(ARow, ACol: Cardinal; ASize: Integer): Integer;
function TsWorksheet.WriteFontName(ARow, ACol: Cardinal; AFontName: String): Integer;
var
lCell: PCell;
fnt: TsFont;
begin
lCell := GetCell(ARow, ACol);
fnt := Workbook.GetFont(lCell^.FontIndex);
result := WriteFont(ARow, ACol, AFontName, fnt.Size, fnt.Style, fnt.Color);
end;
function TsWorksheet.WriteFontSize(ARow, ACol: Cardinal; ASize: Single): Integer;
var
lCell: PCell;
fnt: TsFont;

View File

@ -37,6 +37,7 @@ type
FOldEditText: String;
FLockCount: Integer;
FEditing: Boolean;
FCellFont: TFont;
function CalcAutoRowHeight(ARow: Integer): Integer;
function CalcColWidth(AWidth: Single): Integer;
function CalcRowHeight(AHeight: Single): Integer;
@ -51,6 +52,16 @@ type
function GetCellBorders(ARect: TGridRect): TsCellBorders;
function GetCellBorderStyle(ACol, ARow: Integer; ABorder: TsCellBorder): TsCellBorderStyle;
function GetCellBorderStyles(ARect: TGridRect; ABorder: TsCellBorder): TsCellBorderStyle;
function GetCellFont(ACol, ARow: Integer): TFont;
function GetCellFonts(ARect: TGridRect): TFont;
function GetCellFontColor(ACol, ARow: Integer): TsColor;
function GetCellFontColors(ARect: TGridRect): TsColor;
function GetCellFontName(ACol, ARow: Integer): String;
function GetCellFontNames(ARect: TGridRect): String;
function GetCellFontSize(ACol, ARow: Integer): Single;
function GetCellFontSizes(ARect: TGridRect): Single;
function GetCellFontStyle(ACol, ARow: Integer): TsFontStyles;
function GetCellFontStyles(ARect: TGridRect): TsFontStyles;
function GetHorAlignment(ACol, ARow: Integer): TsHorAlignment;
function GetHorAlignments(ARect: TGridRect): TsHorAlignment;
function GetShowGridLines: Boolean;
@ -67,6 +78,16 @@ type
procedure SetCellBorders(ARect: TGridRect; AValue: TsCellBorders);
procedure SetCellBorderStyle(ACol, ARow: Integer; ABorder: TsCellBorder; AValue: TsCellBorderStyle);
procedure SetCellBorderStyles(ARect: TGridRect; ABorder: TsCellBorder; AValue: TsCellBorderStyle);
procedure SetCellFont(ACol, ARow: Integer; AValue: TFont);
procedure SetCellFonts(ARect: TGridRect; AValue: TFont);
procedure SetCellFontColor(ACol, ARow: Integer; AValue: TsColor);
procedure SetCellFontColors(ARect: TGridRect; AValue: TsColor);
procedure SetCellFontName(ACol, ARow: Integer; AValue: String);
procedure SetCellFontNames(ARect: TGridRect; AValue: String);
procedure SetCellFontStyle(ACol, ARow: Integer; AValue: TsFontStyles);
procedure SetCellFontStyles(ARect: TGridRect; AValue: TsFontStyles);
procedure SetCellFontSize(ACol, ARow: Integer; AValue: Single);
procedure SetCellFontSizes(ARect: TGridRect; AValue: Single);
procedure SetFrozenCols(AValue: Integer);
procedure SetFrozenRows(AValue: Integer);
procedure SetHorAlignment(ACol, ARow: Integer; AValue: TsHorAlignment);
@ -153,6 +174,22 @@ type
read GetCellBorderStyle write SetCellBorderStyle;
property CellBorderStyles[ARect: TGridRect; ABorder: TsCellBorder]: TsCellBorderStyle
read GetCellBorderStyles write SetCellBorderStyles;
property CellFont[ACol, ARow: Integer]: TFont
read GetCellFont write SetCellFont;
property CellFonts[ARect: TGridRect]: TFont
read GetCellFonts write SetCellFonts;
property CellFontName[ACol, ARow: Integer]: String
read GetCellFontName write SetCellFontName;
property CellFontNames[ARect: TGridRect]: String
read GetCellFontNames write SetCellFontNames;
property CellFontStyle[ACol, ARow: Integer]: TsFontStyles
read GetCellFontStyle write SetCellFontStyle;
property CellFontStyles[ARect: TGridRect]: TsFontStyles
read GetCellFontStyles write SetCellFontStyles;
property CellFontSize[ACol, ARow: Integer]: Single
read GetCellFontSize write SetCellFontSize;
property CellFontSizes[ARect: TGridRect]: Single
read GetCellFontSizes write SetCellFontSizes;
property HorAlignment[ACol, ARow: Integer]: TsHorAlignment
read GetHorAlignment write SetHorAlignment;
property HorAlignments[ARect: TGridRect]: TsHorAlignment
@ -423,11 +460,13 @@ constructor TsCustomWorksheetGrid.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
FHeaderCount := 1;
FCellFont := TFont.Create;
end;
destructor TsCustomWorksheetGrid.Destroy;
begin
FreeAndNil(FWorkbook);
FreeAndNil(FCellFont);
inherited Destroy;
end;
@ -1243,6 +1282,178 @@ begin
end;
end;
function TsCustomWorksheetGrid.GetCellFont(ACol, ARow: Integer): TFont;
var
cell: PCell;
fnt: TsFont;
begin
Result := nil;
if (FWorkbook <> nil) and (FWorksheet <> nil) then begin
cell := FWorksheet.FindCell(GetWorksheetRow(ARow), GetWorksheetCol(ACol));
if (cell <> nil) then begin
fnt := FWorkbook.GetFont(cell^.FontIndex);
Convert_sFont_to_Font(fnt, FCellFont);
Result := FCellFont;
end;
end;
end;
function TsCustomWorksheetGrid.GetCellFonts(ARect: TGridRect): TFont;
var
c, r: Integer;
sFont, sDefFont: TsFont;
cell: PCell;
begin
Result := GetCellFont(ARect.Left, ARect.Top);
sDefFont := FWorkbook.GetFont(0); // Default font
for c := ARect.Left to ARect.Right do
for r := ARect.Top to ARect.Bottom do begin
cell := FWorksheet.FindCell(GetWorksheetRow(r), GetWorksheetCol(c));
if cell <> nil then begin
sFont := FWorkbook.GetFont(cell^.FontIndex);
if (sFont.FontName <> sDefFont.FontName) and (sFont.Size <> sDefFont.Size)
and (sFont.Style <> sDefFont.Style) and (sFont.Color <> sDefFont.Color)
then begin
Convert_sFont_to_Font(sDefFont, FCellFont);
Result := FCellFont;
exit;
end;
end;
end;
end;
function TsCustomWorksheetGrid.GetCellFontColor(ACol, ARow: Integer): TsColor;
var
cell: PCell;
fnt: TsFont;
begin
Result := scNotDefined;
if (FWorkbook <> nil) and (FWorksheet <> nil) then begin
cell := FWorksheet.FindCell(GetWorksheetRow(ARow), GetWorksheetCol(ACol));
if (cell <> nil) then begin
fnt := FWorkbook.GetFont(cell^.FontIndex);
if fnt <> nil then
Result := fnt.Color;
end;
end;
end;
function TsCustomWorksheetGrid.GetCellFontColors(ARect: TGridRect): TsColor;
var
c, r: Integer;
clr: TsColor;
begin
Result := GetCellFontColor(ARect.Left, ARect.Top);
clr := Result;
for c := ARect.Left to ARect.Right do
for r := ARect.Top to ARect.Bottom do begin
Result := GetCellFontColor(c, r);
if (Result <> clr) then begin
Result := scNotDefined;
exit;
end;
end;
end;
function TsCustomWorksheetGrid.GetCellFontName(ACol, ARow: Integer): String;
var
cell: PCell;
fnt: TsFont;
begin
Result := '';
if (FWorkbook <> nil) and (FWorksheet <> nil) then begin
cell := FWorksheet.FindCell(GetWorksheetRow(ARow), GetWorksheetCol(ACol));
if (cell <> nil) then begin
fnt := FWorkbook.GetFont(cell^.FontIndex);
if fnt <> nil then
Result := fnt.FontName;
end;
end;
end;
function TsCustomWorksheetGrid.GetCellFontNames(ARect: TGridRect): String;
var
c, r: Integer;
s: String;
begin
Result := GetCellFontName(ARect.Left, ARect.Top);
s := Result;
for c := ARect.Left to ARect.Right do
for r := ARect.Top to ARect.Bottom do begin
Result := GetCellFontName(c, r);
if (Result <> '') and (Result <> s) then begin
Result := '';
exit;
end;
end;
end;
function TsCustomWorksheetGrid.GetCellFontSize(ACol, ARow: Integer): Single;
var
cell: PCell;
fnt: TsFont;
begin
Result := -1.0;
if (FWorkbook <> nil) and (FWorksheet <> nil) then begin
cell := FWorksheet.FindCell(GetWorksheetRow(ARow), GetWorksheetCol(ACol));
if (cell <> nil) then begin
fnt := FWorkbook.GetFont(cell^.FontIndex);
if fnt <> nil then
Result := fnt.Size;
end;
end;
end;
function TsCustomWorksheetGrid.GetCellFontSizes(ARect: TGridRect): Single;
var
c, r: Integer;
sz: Single;
begin
Result := GetCellFontSize(ARect.Left, ARect.Top);
sz := Result;
for c := ARect.Left to ARect.Right do
for r := ARect.Top to ARect.Bottom do begin
Result := GetCellFontSize(c, r);
if (Result <> -1) and not SameValue(Result, sz, 1E-3) then begin
Result := -1.0;
exit;
end;
end;
end;
function TsCustomWorksheetGrid.GetCellFontStyle(ACol, ARow: Integer): TsFontStyles;
var
cell: PCell;
fnt: TsFont;
begin
Result := [];
if (FWorkbook <> nil) and (FWorksheet <> nil) then begin
cell := FWorksheet.FindCell(GetWorksheetRow(ARow), GetWorksheetCol(ACol));
if (cell <> nil) then begin
fnt := FWorkbook.GetFont(cell^.FontIndex);
if fnt <> nil then
Result := fnt.Style;
end;
end;
end;
function TsCustomWorksheetGrid.GetCellFontStyles(ARect: TGridRect): TsFontStyles;
var
c, r: Integer;
style: TsFontStyles;
begin
Result := GetCellFontStyle(ARect.Left, ARect.Top);
style := Result;
for c := ARect.Left to ARect.Right do
for r := ARect.Top to ARect.Bottom do begin
Result := GetCellFontStyle(c, r);
if Result <> style then begin
Result := [];
exit;
end;
end;
end;
{ Returns the height (in pixels) of the cell at ACol/ARow (of the grid). }
function TsCustomWorksheetGrid.GetCellHeight(ACol, ARow: Integer): Integer;
var
@ -1627,7 +1838,7 @@ procedure TsCustomWorksheetGrid.SetBackgroundColor(ACol, ARow: Integer;
var
c, r: Cardinal;
begin
if Assigned(FWorkbook) then begin
if Assigned(FWorksheet) then begin
BeginUpdate;
try
c := GetWorksheetCol(ACol);
@ -1659,7 +1870,7 @@ procedure TsCustomWorksheetGrid.SetCellBorder(ACol, ARow: Integer;
var
c, r: Cardinal;
begin
if Assigned(FWorkbook) then begin
if Assigned(FWorksheet) then begin
BeginUpdate;
try
c := GetWorksheetCol(ACol);
@ -1690,7 +1901,7 @@ end;
procedure TsCustomWorksheetGrid.SetCellBorderStyle(ACol, ARow: Integer;
ABorder: TsCellBorder; AValue: TsCellBorderStyle);
begin
if Assigned(FWorkbook) then begin
if Assigned(FWorksheet) then begin
BeginUpdate;
try
FWorksheet.WriteBorderStyle(GetWorksheetRow(ARow), GetWorksheetCol(ACol), ABorder, AValue);
@ -1716,6 +1927,122 @@ begin
end;
end;
procedure TsCustomWorksheetGrid.SetCellFont(ACol, ARow: Integer; AValue: TFont);
var
fnt: TsFont;
begin
FCellFont.Assign(AValue);
if Assigned(FWorksheet) then begin
fnt := TsFont.Create;
try
Convert_Font_To_sFont(FCellFont, fnt);
FWorksheet.WriteFont(GetWorksheetRow(ARow), GetWorksheetCol(ACol),
fnt.FontName, fnt.Size, fnt.Style, fnt.Color);
finally
fnt.Free;
end;
end;
end;
procedure TsCustomWorksheetGrid.SetCellFonts(ARect: TGridRect;
AValue: TFont);
var
c,r: Integer;
begin
BeginUpdate;
try
for c := ARect.Left to ARect.Right do
for r := ARect.Top to ARect.Bottom do
SetCellFont(c, r, AValue);
finally
EndUpdate;
end;
end;
procedure TsCustomWorksheetGrid.SetCellFontColor(ACol, ARow: Integer; AValue: TsColor);
begin
if Assigned(FWorksheet) then
FWorksheet.WriteFontColor(GetWorksheetRow(ARow), GetWorksheetCol(ACol), AValue);
end;
procedure TsCustomWorksheetGrid.SetCellFontColors(ARect: TGridRect; AValue: TsColor);
var
c,r: Integer;
begin
BeginUpdate;
try
for c := ARect.Left to ARect.Right do
for r := ARect.Top to ARect.Bottom do
SetCellFontColor(c, r, AValue);
finally
EndUpdate;
end;
end;
procedure TsCustomWorksheetGrid.SetCellFontName(ACol, ARow: Integer; AValue: String);
begin
if Assigned(FWorksheet) then
FWorksheet.WriteFontName(GetWorksheetRow(ARow), GetWorksheetCol(ACol), AValue);
end;
procedure TsCustomWorksheetGrid.SetCellFontNames(ARect: TGridRect; AValue: String);
var
c,r: Integer;
begin
BeginUpdate;
try
for c := ARect.Left to ARect.Right do
for r := ARect.Top to ARect.Bottom do
SetCellFontName(c, r, AValue);
finally
EndUpdate;
end;
end;
procedure TsCustomWorksheetGrid.SetCellFontSize(ACol, ARow: Integer;
AValue: Single);
begin
if Assigned(FWorksheet) then
FWorksheet.WriteFontSize(GetWorksheetRow(ARow), GetWorksheetCol(ACol), AValue);
end;
procedure TsCustomWorksheetGrid.SetCellFontSizes(ARect: TGridRect;
AValue: Single);
var
c,r: Integer;
begin
BeginUpdate;
try
for c := ARect.Left to ARect.Right do
for r := ARect.Top to ARect.Bottom do
SetCellFontSize(c, r, AValue);
finally
EndUpdate;
end;
end;
procedure TsCustomWorksheetGrid.SetCellFontStyle(ACol, ARow: Integer;
AValue: TsFontStyles);
begin
if Assigned(FWorksheet) then
FWorksheet.WriteFontStyle(GetWorksheetRow(ARow), GetWorksheetCol(ACol), AValue);
end;
procedure TsCustomWorksheetGrid.SetCellFontStyles(ARect: TGridRect;
AValue: TsFontStyles);
var
c,r: Integer;
begin
BeginUpdate;
try
for c := ARect.Left to ARect.Right do
for r := ARect.Top to ARect.Bottom do
SetCellFontStyle(c, r, AValue);
finally
EndUpdate;
end;
end;
{ Fetches the text that is currently in the editor. It is not yet transferred
to the Worksheet because input is checked only at the end of editing. }
procedure TsCustomWorksheetGrid.SetEditText(ACol, ARow: Longint; const AValue: string);
@ -1740,7 +2067,7 @@ end;
procedure TsCustomWorksheetGrid.SetHorAlignment(ACol, ARow: Integer;
AValue: TsHorAlignment);
begin
if Assigned(FWorkbook) then
if Assigned(FWorksheet) then
FWorksheet.WriteHorAlignment(GetWorksheetRow(ARow), GetWorksheetCol(ACol), AValue);
end;
@ -1782,7 +2109,7 @@ end;
procedure TsCustomWorksheetGrid.SetTextRotation(ACol, ARow: Integer;
AValue: TsTextRotation);
begin
if Assigned(FWorkbook) then
if Assigned(FWorksheet) then
FWorksheet.WriteTextRotation(GetWorksheetRow(ARow), GetWorksheetCol(ACol), AValue);
end;
@ -1852,7 +2179,7 @@ end;
procedure TsCustomWorksheetGrid.SetVertAlignment(ACol, ARow: Integer;
AValue: TsVertAlignment);
begin
if Assigned(FWorkbook) then
if Assigned(FWorksheet) then
FWorksheet.WriteVertAlignment(GetWorksheetRow(ARow), GetWorksheetCol(ACol), AValue);
end;
@ -1874,7 +2201,7 @@ end;
procedure TsCustomWorksheetGrid.SetWordwrap(ACol, ARow: Integer;
AValue: Boolean);
begin
if Assigned(FWorkbook) then
if Assigned(FWorksheet) then
FWorksheet.WriteWordwrap(GetWorksheetRow(ARow), GetWorksheetCol(ACol), AValue);
end;
@ -1946,19 +2273,20 @@ end;
procedure TsCustomWorksheetGrid.SaveToSpreadsheetFile(AFileName: String;
AFormat: TsSpreadsheetFormat; AOverwriteExisting: Boolean = true);
begin
if FWorksheet <> nil then
if FWorkbook <> nil then
FWorkbook.WriteToFile(AFileName, AFormat, AOverwriteExisting);
end;
procedure TsCustomWorksheetGrid.SaveToSpreadsheetFile(AFileName: String;
AOverwriteExisting: Boolean = true);
begin
if FWorksheet <> nil then
if FWorkbook <> nil then
FWorkbook.WriteToFile(AFileName, AOverwriteExisting);
end;
procedure TsCustomWorksheetGrid.SelectSheetByIndex(AIndex: Integer);
begin
if FWorkbook <> nil then
LoadFromWorksheet(FWorkbook.GetWorksheetByIndex(AIndex));
end;