Skip to content

Commit 42cfc41

Browse files
Fixed #4 error when adding TLabeledNumberBox to a form.
1 parent c0e2277 commit 42cfc41

File tree

9 files changed

+247
-7
lines changed

9 files changed

+247
-7
lines changed
-41.5 KB
Binary file not shown.

Demo/Main.dfm

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -145,23 +145,23 @@ object MainForm: TMainForm
145145
Align = alBottom
146146
TabOrder = 1
147147
object FontLabel: TLabel
148-
Left = 353
148+
Left = 368
149149
Top = 129
150150
Width = 66
151151
Height = 15
152152
Alignment = taRightJustify
153153
Caption = 'Font Height:'
154154
end
155155
object RowLinesLabel: TLabel
156-
Left = 363
156+
Left = 378
157157
Top = 154
158158
Width = 56
159159
Height = 15
160160
Alignment = taRightJustify
161161
Caption = 'Row Lines:'
162162
end
163163
object RowMarginLabel: TLabel
164-
Left = 352
164+
Left = 367
165165
Top = 186
166166
Width = 67
167167
Height = 15
@@ -248,7 +248,7 @@ object MainForm: TMainForm
248248
OnClick = cbCustomDrawClick
249249
end
250250
object FontTrackBar: TTrackBar
251-
Left = 425
251+
Left = 440
252252
Top = 119
253253
Width = 133
254254
Height = 25
@@ -309,7 +309,7 @@ object MainForm: TMainForm
309309
OnClick = rgCtl3DClick
310310
end
311311
object LineTrackBar: TTrackBar
312-
Left = 425
312+
Left = 440
313313
Top = 150
314314
Width = 133
315315
Height = 25
@@ -320,7 +320,7 @@ object MainForm: TMainForm
320320
OnChange = LineTrackBarChange
321321
end
322322
object RowMarginTrackBar: TTrackBar
323-
Left = 425
323+
Left = 440
324324
Top = 181
325325
Width = 133
326326
Height = 25

Packages/D12/DBAwareLabeledComponents.dproj

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<Platform Condition="'$(Platform)'==''">Win32</Platform>
1010
<TargetedPlatforms>1</TargetedPlatforms>
1111
<AppType>Package</AppType>
12+
<ProjectName Condition="'$(ProjectName)'==''">DBAwareLabeledComponents</ProjectName>
1213
</PropertyGroup>
1314
<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
1415
<Base>true</Base>
@@ -18,6 +19,11 @@
1819
<CfgParent>Base</CfgParent>
1920
<Base>true</Base>
2021
</PropertyGroup>
22+
<PropertyGroup Condition="('$(Platform)'=='Win64x' and '$(Base)'=='true') or '$(Base_Win64x)'!=''">
23+
<Base_Win64x>true</Base_Win64x>
24+
<CfgParent>Base</CfgParent>
25+
<Base>true</Base>
26+
</PropertyGroup>
2127
<PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_1)'!=''">
2228
<Cfg_1>true</Cfg_1>
2329
<CfgParent>Base</CfgParent>
@@ -61,6 +67,11 @@
6167
<DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
6268
<BT_BuildType>Debug</BT_BuildType>
6369
</PropertyGroup>
70+
<PropertyGroup Condition="'$(Base_Win64x)'!=''">
71+
<DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;$(DCC_Namespace)</DCC_Namespace>
72+
<BT_BuildType>Debug</BT_BuildType>
73+
<VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
74+
</PropertyGroup>
6475
<PropertyGroup Condition="'$(Cfg_1)'!=''">
6576
<DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
6677
<DCC_DebugDCUs>true</DCC_DebugDCUs>
@@ -131,10 +142,13 @@
131142
<Source Name="MainSource">DBAwareLabeledComponents.dpk</Source>
132143
</Source>
133144
<Excluded_Packages/>
145+
<WelcomePageFile Path="..\..\README.htm"/>
146+
<WelcomePageFolder/>
134147
</Delphi.Personality>
135148
<Platforms>
136149
<Platform value="Win32">True</Platform>
137150
<Platform value="Win64">False</Platform>
151+
<Platform value="Win64x">False</Platform>
138152
</Platforms>
139153
</BorlandProject>
140154
<ProjectFileVersion>12</ProjectFileVersion>
0 Bytes
Binary file not shown.

Packages/D12/dclDBAwareLabeledComponents.dproj

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<Platform Condition="'$(Platform)'==''">Win32</Platform>
1010
<TargetedPlatforms>1</TargetedPlatforms>
1111
<AppType>Package</AppType>
12+
<ProjectName Condition="'$(ProjectName)'==''">dclDBAwareLabeledComponents</ProjectName>
1213
</PropertyGroup>
1314
<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
1415
<Base>true</Base>
@@ -18,6 +19,11 @@
1819
<CfgParent>Base</CfgParent>
1920
<Base>true</Base>
2021
</PropertyGroup>
22+
<PropertyGroup Condition="('$(Platform)'=='Win64x' and '$(Base)'=='true') or '$(Base_Win64x)'!=''">
23+
<Base_Win64x>true</Base_Win64x>
24+
<CfgParent>Base</CfgParent>
25+
<Base>true</Base>
26+
</PropertyGroup>
2127
<PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_1)'!=''">
2228
<Cfg_1>true</Cfg_1>
2329
<CfgParent>Base</CfgParent>
@@ -62,6 +68,11 @@
6268
<BT_BuildType>Debug</BT_BuildType>
6369
<DCC_UsePackage>DBAwareLabeledComponents;$(DCC_UsePackage)</DCC_UsePackage>
6470
</PropertyGroup>
71+
<PropertyGroup Condition="'$(Base_Win64x)'!=''">
72+
<DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;$(DCC_Namespace)</DCC_Namespace>
73+
<BT_BuildType>Debug</BT_BuildType>
74+
<VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
75+
</PropertyGroup>
6576
<PropertyGroup Condition="'$(Cfg_1)'!=''">
6677
<DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
6778
<DCC_DebugDCUs>true</DCC_DebugDCUs>
@@ -106,10 +117,13 @@
106117
<Source Name="MainSource">dclDBAwareLabeledComponents.dpk</Source>
107118
</Source>
108119
<Excluded_Packages/>
120+
<WelcomePageFile Path="..\..\README.htm"/>
121+
<WelcomePageFolder/>
109122
</Delphi.Personality>
110123
<Platforms>
111124
<Platform value="Win32">True</Platform>
112125
<Platform value="Win64">False</Platform>
126+
<Platform value="Win64x">False</Platform>
113127
</Platforms>
114128
</BorlandProject>
115129
<ProjectFileVersion>12</ProjectFileVersion>
0 Bytes
Binary file not shown.

README.htm

Lines changed: 207 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,207 @@
1+
<style type="text/css">
2+
code{
3+
font-family: "Consolas", monospace;
4+
}
5+
pre{
6+
border: 1px solid #ddd;
7+
border-left: 3px solid #f36d33;
8+
overflow: auto;
9+
padding: 1em 1.5em;
10+
display: block;
11+
}
12+
Blockquote{
13+
border-left: 3px solid #d0d0d0;
14+
padding-left: 0.5em;
15+
margin-left:1em;
16+
}
17+
Blockquote p{
18+
margin: 0;
19+
}
20+
table{
21+
border:1px solid;
22+
border-collapse:collapse;
23+
}
24+
th{ padding:5px;
25+
border:1px solid;
26+
}
27+
td{
28+
padding:5px;
29+
border:1px solid;
30+
}
31+
</style>
32+
<h1>DBAwareLabeledComponents</h1>
33+
<p><a href="https://opensource.org/licenses/Apache-2.0"><img src="https://img.shields.io/badge/License-Apache%202.0-yellowgreen.svg" alt="License"/></a></p>
34+
<p>An extended TDBGrid plus classic Delphi-VCL Editors with Boundary-Label (DB-Aware and Standard) including NumberBox</p>
35+
<h3>Actual official version 1.3.2 (VCL)</h3>
36+
<p>An advanced TDbGrid component:</p>
37+
<p>TLabeledDbGrid is an advanced version of classic TDbGrid with a boundary Label, plus some extra features:</p>
38+
<ul>
39+
<li>ShowSortOrder: shows an indicator of sorting column</li>
40+
<li>Embedeed CheckBox for boolean fields</li>
41+
<li>Incremental search, when typing into a ReadOnly DbGrid</li>
42+
<li>Alternate row-color</li>
43+
<li>Custom row-colors</li>
44+
<li>Show sort order</li>
45+
<li>Incremental search</li>
46+
<li>Lines per Rows (to show memo fields with multiple lines)</li>
47+
<li>RowMargin (to enlarge heigh of any row)</li>
48+
</ul>
49+
<p>*Example of a TLabeledDbGrid (with some extended functionality like inplace checkbox and sorting) with the label aligned TopCenter (inside the client area of the grid aligned alClient).</p>
50+
<p><img src="./Images/DemoDataAwareDbGridTopCenter.png" alt="Preview Thumbnails Dark"/></p>
51+
<p>This library contains also the classic VCL editors (standard and data-aware) with the addition of a &ldquo;label&rdquo; attached to the component itself (like the native component TLabeledEdit).</p>
52+
<p>It is no longer necessary to keep the Label &ldquo;connected&rdquo; and &ldquo;aligned&rdquo; by hand to the editor: on every component you can specify 3 simple properties:</p>
53+
<ul>
54+
<li>BoundCaption</li>
55+
<li>BoundLabel.Labelposition (default lpTopLeft)</li>
56+
<li>BoundLabel.LabelSpacing (default 1)</li>
57+
</ul>
58+
<p>The label can be positioned with 12 alignements:
59+
<strong>lpTopLeft, lpTopCenter, lpTopRight, lpBottomLeft, lpBottomCenter, lpBottomRight, lpLeftTop, lpLeftMiddle, lpLeftBottom, lpRightTop, lpRightMiddle, lpRightBottom</strong></p>
60+
<h2>TLabeledButtonEdit:</h2>
61+
<p>Also available for D10.3 to latest, TLabeledButtonEdit and TLabeledDBButtonEdit are a classic editors with a button inside (on the right). For Date Fields the button opens automatically a Popup-Calendar.</p>
62+
<p><em>Look at those examples, showing all the components with different Label alignments: the demo is available into Demo Folder</em></p>
63+
<table>
64+
<tr>
65+
<th>Sample</th>
66+
<th>Description</th>
67+
</tr>
68+
<tr>
69+
<td><img src="./Images/DemoDataAwareDbGridLinesPerRow3.png" alt="DemoDataAwareDbGridLinesPerRow3"/></td>
70+
<td>Example of LabeledDbGrid with LinesPerRow = 3 to show multiline content of memo fields</td>
71+
</tr>
72+
<tr>
73+
<td><img src="./Images/DemoDataAwareDbGridRowMargin15.png" alt="DemoDataAwareDbGridRowMargin15"/></td>
74+
<td>Example of LabeledDbGrid with RowMargin = 15 to to change height of grid Row. Fully compatible with Styles (light and dark)</td>
75+
</tr>
76+
<tr>
77+
<td><img src="./Images/DemoDataAwareTopLeft.png" alt="DemoDataAwareTopLeft"/></td>
78+
<td>Example of collection of Dataaware components with label aligned to &ldquo;TopLeft&rdquo;</td>
79+
</tr>
80+
<tr>
81+
<td><img src="./Images/DemoDataAwareNumberEditorsLeftMiddle.png" alt="DemoDataAwareNumberEditorsLeftMiddle"/></td>
82+
<td>Example of LabeledDBCurrencyEdit and LabeledDBNumberBox (only for 10.4.2): Dataware components for numeric input (from right to left) with label aligned to &ldquo;LeftMiddle&rdquo;</td>
83+
</tr>
84+
<tr>
85+
<td><img src="./Images/DemoNonDataAwareTopRight.png" alt="Preview Thumbnails Dark"/></td>
86+
<td>Example of collection of Standard components with label aligned to &ldquo;TopRight&rdquo;</td>
87+
</tr>
88+
<tr>
89+
<td><img src="./Images/DemoColorsImagesBottomCenter.png" alt="Preview Thumbnails Dark"/></td>
90+
<td>Example of collection of components with label aligned to &ldquo;BottomCenter&rdquo;</td>
91+
</tr>
92+
<tr>
93+
<td><img src="./Images/DemoNumberInputStyled.png" alt="Preview Thumbnails Dark"/></td>
94+
<td>All components are fully VCL styles compatible</td>
95+
</tr>
96+
</table>
97+
<p>A complete Demo is available in Demo Folder.</p>
98+
<h2>Support for new NumberBox component</h2>
99+
<p><strong>TNumberBox</strong> component (available from D10.4.2) is the new component for advanced numeric input. In this library you can find:</p>
100+
<ul>
101+
<li>TDBNumberBox: the standard component with classic DataAeware support (DataSource + DataField) without Label.</li>
102+
<li>TLabeledNumberBox: a TNumberBox component with boudary label</li>
103+
<li>TLabeledDBNumberBox: a TDBNumberBox with boudary label</li>
104+
</ul>
105+
<h3>Available from Delphi XE3 to Delphi 12 (32bit and 64bit platforms)</h3>
106+
<p><img src="./Images/SupportingDelphi.jpg" alt="Delphi Support"/></p>
107+
<p>Related links: https://www.embarcadero.com/ - https://learndelphi.org/</p>
108+
<h2>INSTALLATION</h2>
109+
<p>Clone repository, open Package Group &ldquo;PackageGroup.groupproj&rdquo; of your Delphi version located in:</p>
110+
<p><em>DBAwareLabeledComponents\Packages\DXXX</em></p>
111+
<p>Build RunTime package: DBAwareLabeledComponents.dproj</p>
112+
<p>Install DesignTime package: dclDBAwareLabeledComponents.dproj</p>
113+
<p><strong>Remember to add those folders to Search Path:</strong></p>
114+
<p><em>{InstallDir}\Source</em></p>
115+
<h3>DOCUMENTATION</h3>
116+
<p>Coming soon, into Wiki section.</p>
117+
<h3>RELEASE NOTES</h3>
118+
<p>08 Jul 2024: ver.1.3.2</p>
119+
<ul>
120+
<li>Fixed error when adding TLabeledNumberBox to a form.</li>
121+
</ul>
122+
<p>13 Jan 2024: ver.1.3.1</p>
123+
<ul>
124+
<li>Fixed DbGrid rendering</li>
125+
<li>Updated Copyright</li>
126+
</ul>
127+
<h3>RELEASE NOTES</h3>
128+
<p>21 Aug 2023: ver.1.3.0</p>
129+
<ul>
130+
<li>Added support for Delphi 12</li>
131+
<li>Added WrapAllText, ColMoving and IncrementalSearchType to TLabeledDbGrid</li>
132+
<li>Fixed 64Bit issue for TLabeledDBComboBox</li>
133+
</ul>
134+
<p>05 Sep 2022: ver.1.2.2</p>
135+
<ul>
136+
<li>Refactoring of rendering TLabeledDBGrid to fix some problems when dgRowSelect is active</li>
137+
</ul>
138+
<p>19 Aug 2022: ver.1.2.1</p>
139+
<ul>
140+
<li>Fixed checkbox drawing in &ldquo;Windows&rdquo; style, using rowmargin and/or LinesPerRow</li>
141+
<li>Fixed drawing cell right aligned</li>
142+
<li>Fixed Setting custom cursor for Grid</li>
143+
</ul>
144+
<p>15 Jun 2022: ver.1.2.0</p>
145+
<ul>
146+
<li>Added TLabeledButtonEdit and TLabeledDBButtonEdit (from Delphi 10.1)</li>
147+
<li>Updated Demo with TLabeledButtonEdit and TLabeledDBButtonEdit examples</li>
148+
<li>Added Packages for Delphi 10.1 and Delphi XE8</li>
149+
</ul>
150+
<p>17 May 2022: ver.1.1.0</p>
151+
<ul>
152+
<li>Added LinesPerRow and RowMargin to TLabeledDbGrid</li>
153+
<li>Updated Demo with full features of TLabeledDbGrid</li>
154+
<li>Changed LibSuffix for Packages (D10.4 and D11)</li>
155+
<li>Renamed Package Description to &ldquo;Ethea: Dataaware Labeled Components&rdquo;</li>
156+
</ul>
157+
<p>10 Oct 2021:</p>
158+
<ul>
159+
<li>Fixed LabeledDbGrid for Rendering selected cell with Windows 11</li>
160+
<li>Fixex LabeledDbGrid columns draw in High-DPI app</li>
161+
</ul>
162+
<p>03 Sep 2021:</p>
163+
<ul>
164+
<li>Added support for Delphi 11</li>
165+
</ul>
166+
<p>25 Apr 2021: version 1.0.0</p>
167+
<p>Components released:</p>
168+
<p>only for D10.4.2 and above</p>
169+
<ul>
170+
<li>TDBNumberBox</li>
171+
<li>TLabeledNumberBox</li>
172+
<li>TLabeledDBNumberBox</li>
173+
</ul>
174+
<p>only for D10.1 and above</p>
175+
<ul>
176+
<li>TLabeledDBButtonEdit</li>
177+
<li>TLabeledButtonEdit</li>
178+
</ul>
179+
<p>for all Delphi versions (from XE3)</p>
180+
<ul>
181+
<li>TLabeledColorGrid</li>
182+
<li>TLabeledCurrencyEdit</li>
183+
<li>TLabeledDBCurrencyEdit</li>
184+
<li>TLabeledSpinEdit</li>
185+
<li>TLabeledRichEdit</li>
186+
<li>TLabeledCheckListBox</li>
187+
<li>TLabeledEditEx (similar to TLabeledEdit)</li>
188+
<li>TLabeledComboBox</li>
189+
<li>TLabeledListBox</li>
190+
<li>TLabeledMemo</li>
191+
<li>TLabeledDBEdit</li>
192+
<li>TLabeledDBLabel</li>
193+
<li>TLabeledDBComboBox</li>
194+
<li>TLabeledDBListBox</li>
195+
<li>TLabeledDBMemo</li>
196+
<li>TLabeledDBImage</li>
197+
<li>TLabeledDBLookupListBox</li>
198+
<li>TLabeledDBLookupComboBox</li>
199+
<li>TLabeledDbGrid</li>
200+
<li>TLabeledDBRichEdit</li>
201+
<li>TLabeledDBCtrlGrid</li>
202+
<li>TLabeledDBListView</li>
203+
<li>TLabeledMaskEdit</li>
204+
<li>TLabeledRadioGroup</li>
205+
<li>TLabeledImage</li>
206+
<li>TLabeledColorBox</li>
207+
</ul>

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
An extended TDBGrid plus classic Delphi-VCL Editors with Boundary-Label (DB-Aware and Standard) including NumberBox
66

7-
### Actual official version 1.3.1 (VCL)
7+
### Actual official version 1.3.2 (VCL)
88

99
An advanced TDbGrid component:
1010

@@ -83,6 +83,9 @@ _{InstallDir}\Source_
8383
Coming soon, into Wiki section.
8484

8585
### RELEASE NOTES
86+
08 Jul 2024: ver.1.3.2
87+
- Fixed error when adding TLabeledNumberBox to a form.
88+
8689
13 Jan 2024: ver.1.3.1
8790
- Fixed DbGrid rendering
8891
- Updated Copyright

Source/Vcl.BoundLabel.pas

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,8 @@ function GetEditControlFont(AEditControl: TControl): TFont;
461461
else if AEditControl is TLabeledDBImage then
462462
Result := TLabeledDBImage(AEditControl).Font
463463
{$IFDEF D10_4+}
464+
else if AEditControl is TLabeledNumberBox then
465+
Result := TLabeledNumberBox(AEditControl).Font
464466
else if AEditControl is TLabeledDBNumberBox then
465467
Result := TLabeledDBNumberBox(AEditControl).Font
466468
{$ENDIF}

0 commit comments

Comments
 (0)