├── 10.3
├── OpenWireDsn.dpk
├── OpenWireDsn.dproj
├── OpenWireDsn.res
├── OpenWirePkg.dpk
├── OpenWirePkg.dproj
├── OpenWirePkg.res
└── OpenWirePkgGroup.groupproj
├── 10.4
├── OpenWireDsn.dpk
├── OpenWireDsn.dproj
├── OpenWireDsn.res
├── OpenWirePkg.dpk
├── OpenWirePkg.dproj
├── OpenWirePkg.res
└── OpenWirePkgGroup.groupproj
├── 11.0
├── OpenWireDsn.dpk
├── OpenWireDsn.dproj
├── OpenWireDsn.res
├── OpenWirePkg.dpk
├── OpenWirePkg.dproj
├── OpenWirePkg.res
└── OpenWirePkgGroup.groupproj
├── 12.0
├── OpenWireDsn.dpk
├── OpenWireDsn.dproj
├── OpenWireDsn.res
├── OpenWirePkg.dpk
├── OpenWirePkg.dproj
├── OpenWirePkg.res
├── OpenWirePkgGroup.groupproj
└── ReleaseOptionSet.optset
├── Mitov.Categories.OpenWire.pas
├── Mitov.Categories.OpenWire.res
├── Mitov.Definitions.inc
├── OWAboutFormUnit.dfm
├── OWAboutFormUnit.pas
├── OWAfterPinSelectFormUnit.dfm
├── OWAfterPinSelectFormUnit.pas
├── OWClassProperty.pas
├── OWDesignSelectionsList.pas
├── OWDesignTypes.pas
├── OWPins.pas
├── OWStateEditors.dfm
├── OWStateEditors.pas
├── OWStdTypes.pas
├── OWStdTypes.res
├── OpenWire.Delphi.PropertyEditors.pas
├── OpenWire.Design.pas
├── OpenWire.TypeConverters.pas
├── OpenWireLabDemo
├── 10.3
│ ├── OpenWireLabPkg.dpk
│ ├── OpenWireLabPkg.dproj
│ └── OpenWireLabPkg.res
├── 10.4
│ ├── OpenWireLabPkg.dpk
│ ├── OpenWireLabPkg.dproj
│ └── OpenWireLabPkg.res
├── 11.0
│ ├── OpenWireLabPkg.dpk
│ ├── OpenWireLabPkg.dproj
│ └── OpenWireLabPkg.res
├── 12.0
│ ├── OpenWireLabPkg.dpk
│ ├── OpenWireLabPkg.dproj
│ └── OpenWireLabPkg.res
├── OWLComps.dcr
├── OWLComps.pas
├── OWLStateComps.dcr
├── OWLStateComps.pas
└── OpenWireLabPkg.pas
├── OpenWirePinEditors.dfm
├── OpenWirePinEditors.pas
├── OpenWireResources.res
└── README.md
/10.3/OpenWireDsn.dpk:
--------------------------------------------------------------------------------
1 | package OpenWireDsn;
2 |
3 | {$R *.res}
4 | {$IFDEF IMPLICITBUILDING This IFDEF should not be used by users}
5 | {$ALIGN 8}
6 | {$ASSERTIONS ON}
7 | {$BOOLEVAL OFF}
8 | {$DEBUGINFO OFF}
9 | {$EXTENDEDSYNTAX ON}
10 | {$IMPORTEDDATA ON}
11 | {$IOCHECKS ON}
12 | {$LOCALSYMBOLS ON}
13 | {$LONGSTRINGS ON}
14 | {$OPENSTRINGS ON}
15 | {$OPTIMIZATION ON}
16 | {$OVERFLOWCHECKS OFF}
17 | {$RANGECHECKS OFF}
18 | {$REFERENCEINFO ON}
19 | {$SAFEDIVIDE OFF}
20 | {$STACKFRAMES OFF}
21 | {$TYPEDADDRESS OFF}
22 | {$VARSTRINGCHECKS ON}
23 | {$WRITEABLECONST OFF}
24 | {$MINENUMSIZE 1}
25 | {$IMAGEBASE $400000}
26 | {$DEFINE __DELPHI_DESIGN__}
27 | {$ENDIF IMPLICITBUILDING}
28 | {$DESCRIPTION 'OpenWire Project (Design Time)'}
29 | {$LIBSUFFIX '260'}
30 | {$DESIGNONLY}
31 | {$IMPLICITBUILD OFF}
32 |
33 | requires
34 | rtl,
35 | vcl,
36 | vclx,
37 | Mitov_Runtime,
38 | Mitov_VCL_Runtime,
39 | OpenWirePkg,
40 | Mitov_Delphi_Design,
41 | designide;
42 |
43 | contains
44 | OpenWirePinEditors in '..\OpenWirePinEditors.pas' {OWPinEditorForm},
45 | OWStateEditors in '..\OWStateEditors.pas' {OWStatePinForm},
46 | OWAboutFormUnit in '..\OWAboutFormUnit.pas' {OWAboutForm},
47 | OWDesignTypes in '..\OWDesignTypes.pas',
48 | OWAfterPinSelectFormUnit in '..\OWAfterPinSelectFormUnit.pas' {OWAfterPinSelectForm},
49 | OpenWire.Delphi.PropertyEditors in '..\OpenWire.Delphi.PropertyEditors.pas',
50 | OpenWire.Design in '..\OpenWire.Design.pas';
51 |
52 | end.
53 |
54 |
55 |
56 |
--------------------------------------------------------------------------------
/10.3/OpenWireDsn.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bmitov/OpenWire/ecda2b148c1f2761a20bcfedb1e37d98f6a4cc21/10.3/OpenWireDsn.res
--------------------------------------------------------------------------------
/10.3/OpenWirePkg.dpk:
--------------------------------------------------------------------------------
1 | package OpenWirePkg;
2 |
3 | {$R *.res}
4 | {$R '..\OWStdTypes.res'}
5 | {$R '..\Mitov.Categories.OpenWire.res'}
6 | {$IFDEF IMPLICITBUILDING This IFDEF should not be used by users}
7 | {$ALIGN 8}
8 | {$ASSERTIONS ON}
9 | {$BOOLEVAL OFF}
10 | {$DEBUGINFO OFF}
11 | {$EXTENDEDSYNTAX ON}
12 | {$IMPORTEDDATA ON}
13 | {$IOCHECKS ON}
14 | {$LOCALSYMBOLS ON}
15 | {$LONGSTRINGS ON}
16 | {$OPENSTRINGS ON}
17 | {$OPTIMIZATION OFF}
18 | {$OVERFLOWCHECKS OFF}
19 | {$RANGECHECKS OFF}
20 | {$REFERENCEINFO ON}
21 | {$SAFEDIVIDE OFF}
22 | {$STACKFRAMES ON}
23 | {$TYPEDADDRESS OFF}
24 | {$VARSTRINGCHECKS ON}
25 | {$WRITEABLECONST OFF}
26 | {$MINENUMSIZE 1}
27 | {$IMAGEBASE $400000}
28 | {$DEFINE DEBUG}
29 | {$ENDIF IMPLICITBUILDING}
30 | {$DESCRIPTION 'Mitov Runtime'}
31 | {$LIBSUFFIX '260'}
32 | {$RUNONLY}
33 | {$IMPLICITBUILD OFF}
34 |
35 | requires
36 | rtl,
37 | Mitov_Runtime;
38 |
39 | contains
40 | OWPins in '..\OWPins.pas',
41 | OWStdTypes in '..\OWStdTypes.pas',
42 | OpenWire.TypeConverters in '..\OpenWire.TypeConverters.pas',
43 | Mitov.Categories.OpenWire in '..\Mitov.Categories.OpenWire.pas';
44 |
45 | end.
46 |
--------------------------------------------------------------------------------
/10.3/OpenWirePkg.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bmitov/OpenWire/ecda2b148c1f2761a20bcfedb1e37d98f6a4cc21/10.3/OpenWirePkg.res
--------------------------------------------------------------------------------
/10.3/OpenWirePkgGroup.groupproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | {97aef5e4-8e8a-4194-8ca8-b56d945fc9c9}
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/10.4/OpenWireDsn.dpk:
--------------------------------------------------------------------------------
1 | package OpenWireDsn;
2 |
3 | {$R *.res}
4 | {$IFDEF IMPLICITBUILDING This IFDEF should not be used by users}
5 | {$ALIGN 8}
6 | {$ASSERTIONS ON}
7 | {$BOOLEVAL OFF}
8 | {$DEBUGINFO OFF}
9 | {$EXTENDEDSYNTAX ON}
10 | {$IMPORTEDDATA ON}
11 | {$IOCHECKS ON}
12 | {$LOCALSYMBOLS ON}
13 | {$LONGSTRINGS ON}
14 | {$OPENSTRINGS ON}
15 | {$OPTIMIZATION ON}
16 | {$OVERFLOWCHECKS OFF}
17 | {$RANGECHECKS OFF}
18 | {$REFERENCEINFO ON}
19 | {$SAFEDIVIDE OFF}
20 | {$STACKFRAMES OFF}
21 | {$TYPEDADDRESS OFF}
22 | {$VARSTRINGCHECKS ON}
23 | {$WRITEABLECONST OFF}
24 | {$MINENUMSIZE 1}
25 | {$IMAGEBASE $400000}
26 | {$DEFINE __DELPHI_DESIGN__}
27 | {$ENDIF IMPLICITBUILDING}
28 | {$DESCRIPTION 'OpenWire Project (Design Time)'}
29 | {$LIBSUFFIX '270'}
30 | {$DESIGNONLY}
31 | {$IMPLICITBUILD OFF}
32 |
33 | requires
34 | rtl,
35 | vcl,
36 | vclx,
37 | Mitov_Runtime,
38 | Mitov_VCL_Runtime,
39 | OpenWirePkg,
40 | Mitov_Delphi_Design,
41 | designide;
42 |
43 | contains
44 | OpenWirePinEditors in '..\OpenWirePinEditors.pas' {OWPinEditorForm},
45 | OWStateEditors in '..\OWStateEditors.pas' {OWStatePinForm},
46 | OWAboutFormUnit in '..\OWAboutFormUnit.pas' {OWAboutForm},
47 | OWDesignTypes in '..\OWDesignTypes.pas',
48 | OWAfterPinSelectFormUnit in '..\OWAfterPinSelectFormUnit.pas' {OWAfterPinSelectForm},
49 | OpenWire.Delphi.PropertyEditors in '..\OpenWire.Delphi.PropertyEditors.pas',
50 | OpenWire.Design in '..\OpenWire.Design.pas';
51 |
52 | end.
53 |
54 |
55 |
56 |
--------------------------------------------------------------------------------
/10.4/OpenWireDsn.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bmitov/OpenWire/ecda2b148c1f2761a20bcfedb1e37d98f6a4cc21/10.4/OpenWireDsn.res
--------------------------------------------------------------------------------
/10.4/OpenWirePkg.dpk:
--------------------------------------------------------------------------------
1 | package OpenWirePkg;
2 |
3 | {$R *.res}
4 | {$R '..\OWStdTypes.res'}
5 | {$R '..\Mitov.Categories.OpenWire.res'}
6 | {$IFDEF IMPLICITBUILDING This IFDEF should not be used by users}
7 | {$ALIGN 8}
8 | {$ASSERTIONS ON}
9 | {$BOOLEVAL OFF}
10 | {$DEBUGINFO OFF}
11 | {$EXTENDEDSYNTAX ON}
12 | {$IMPORTEDDATA ON}
13 | {$IOCHECKS ON}
14 | {$LOCALSYMBOLS ON}
15 | {$LONGSTRINGS ON}
16 | {$OPENSTRINGS ON}
17 | {$OPTIMIZATION OFF}
18 | {$OVERFLOWCHECKS OFF}
19 | {$RANGECHECKS OFF}
20 | {$REFERENCEINFO ON}
21 | {$SAFEDIVIDE OFF}
22 | {$STACKFRAMES ON}
23 | {$TYPEDADDRESS OFF}
24 | {$VARSTRINGCHECKS ON}
25 | {$WRITEABLECONST OFF}
26 | {$MINENUMSIZE 1}
27 | {$IMAGEBASE $400000}
28 | {$DEFINE DEBUG}
29 | {$ENDIF IMPLICITBUILDING}
30 | {$DESCRIPTION 'Mitov Runtime'}
31 | {$LIBSUFFIX '270'}
32 | {$RUNONLY}
33 | {$IMPLICITBUILD OFF}
34 |
35 | requires
36 | rtl,
37 | Mitov_Runtime;
38 |
39 | contains
40 | OWPins in '..\OWPins.pas',
41 | OWStdTypes in '..\OWStdTypes.pas',
42 | OpenWire.TypeConverters in '..\OpenWire.TypeConverters.pas',
43 | Mitov.Categories.OpenWire in '..\Mitov.Categories.OpenWire.pas';
44 |
45 | end.
46 |
--------------------------------------------------------------------------------
/10.4/OpenWirePkg.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bmitov/OpenWire/ecda2b148c1f2761a20bcfedb1e37d98f6a4cc21/10.4/OpenWirePkg.res
--------------------------------------------------------------------------------
/10.4/OpenWirePkgGroup.groupproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | {97aef5e4-8e8a-4194-8ca8-b56d945fc9c9}
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/11.0/OpenWireDsn.dpk:
--------------------------------------------------------------------------------
1 | package OpenWireDsn;
2 |
3 | {$R *.res}
4 | {$IFDEF IMPLICITBUILDING This IFDEF should not be used by users}
5 | {$ALIGN 8}
6 | {$ASSERTIONS ON}
7 | {$BOOLEVAL OFF}
8 | {$DEBUGINFO OFF}
9 | {$EXTENDEDSYNTAX ON}
10 | {$IMPORTEDDATA ON}
11 | {$IOCHECKS ON}
12 | {$LOCALSYMBOLS ON}
13 | {$LONGSTRINGS ON}
14 | {$OPENSTRINGS ON}
15 | {$OPTIMIZATION ON}
16 | {$OVERFLOWCHECKS ON}
17 | {$RANGECHECKS ON}
18 | {$REFERENCEINFO ON}
19 | {$SAFEDIVIDE OFF}
20 | {$STACKFRAMES OFF}
21 | {$TYPEDADDRESS OFF}
22 | {$VARSTRINGCHECKS ON}
23 | {$WRITEABLECONST OFF}
24 | {$MINENUMSIZE 1}
25 | {$IMAGEBASE $400000}
26 | {$DEFINE __DELPHI_DESIGN__}
27 | {$ENDIF IMPLICITBUILDING}
28 | {$DESCRIPTION 'OpenWire Project (Design Time)'}
29 | {$LIBSUFFIX AUTO}
30 | {$DESIGNONLY}
31 | {$IMPLICITBUILD OFF}
32 |
33 | requires
34 | rtl,
35 | vcl,
36 | vclx,
37 | Mitov_Runtime,
38 | Mitov_VCL_Runtime,
39 | OpenWirePkg,
40 | Mitov_Delphi_Design,
41 | designide;
42 |
43 | contains
44 | OpenWirePinEditors in '..\OpenWirePinEditors.pas' {OWPinEditorForm},
45 | OWStateEditors in '..\OWStateEditors.pas' {OWStatePinForm},
46 | OWAboutFormUnit in '..\OWAboutFormUnit.pas' {OWAboutForm},
47 | OWDesignTypes in '..\OWDesignTypes.pas',
48 | OWAfterPinSelectFormUnit in '..\OWAfterPinSelectFormUnit.pas' {OWAfterPinSelectForm},
49 | OpenWire.Delphi.PropertyEditors in '..\OpenWire.Delphi.PropertyEditors.pas',
50 | OpenWire.Design in '..\OpenWire.Design.pas';
51 |
52 | end.
53 |
54 |
55 |
56 |
--------------------------------------------------------------------------------
/11.0/OpenWireDsn.dproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | {5ba8197d-6fb3-40f3-9dd2-104adc709554}
4 | OpenWireDsn.dpk
5 | Debug
6 | DCC32
7 | $(SystemRoot)\System32\OpenWireDsnD11.bpl
8 | 19.5
9 | Debug
10 | True
11 | Package
12 | VCL
13 | Win32
14 | 1
15 |
16 |
17 | true
18 |
19 |
20 | true
21 | Base
22 | true
23 |
24 |
25 | true
26 | Base
27 | true
28 |
29 |
30 | true
31 | Base
32 | true
33 |
34 |
35 | true
36 | Base
37 | true
38 |
39 |
40 | true
41 | Base
42 | true
43 |
44 |
45 | true
46 | Base
47 | true
48 |
49 |
50 | true
51 | Base
52 | true
53 |
54 |
55 | true
56 | Base
57 | true
58 |
59 |
60 | true
61 | Cfg_Debug
62 | true
63 | true
64 |
65 |
66 | true
67 | Cfg_Debug
68 | true
69 | true
70 |
71 |
72 | true
73 | Cfg_Debug
74 | true
75 | true
76 |
77 |
78 | $(Auto)
79 | OpenWireDsn
80 | .\$(Platform)\$(Config)
81 | All
82 | .\$(Platform)\$(Config)
83 | .\$(Platform)\$(Config)
84 | __DELPHI_DESIGN__;$(DCC_Define)
85 | .\$(Platform)\$(Config)
86 | rtl;$(DCC_UsePackage)
87 | System;Xml;Data;Datasnap;Web;Soap;Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;$(DCC_Namespace)
88 | .\$(Platform)\$(Config)
89 | .\$(Platform)\$(Config)
90 | true
91 | CompanyName=;FileDescription=;FileVersion=8.0.0.141;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=8.0.0.141;Comments=;CompileDate=Thursday, October 07, 2010 7:57 PM
92 | 8
93 | 1033
94 | C:\Program Files (x86)\Embarcadero\RAD Studio\7.0\bin\bds.exe
95 | 00400000
96 | C:\Users\Public\Documents\RAD Studio\7.0\Bpl\OpenWireDsnD15.bpl
97 | OpenWire Project (Design Time)
98 | true
99 | true
100 | true
101 | 78
102 | true
103 |
104 |
105 | android-support-v4.dex.jar;apk-expansion.dex.jar;cloud-messaging.dex.jar;fmx.dex.jar;google-analytics-v2.dex.jar;google-play-billing.dex.jar;google-play-licensing.dex.jar;google-play-services.dex.jar
106 | false
107 | Debug
108 | package=com.embarcadero.$(MSBuildProjectName);label=$(MSBuildProjectName);versionCode=1;versionName=1.0.0;persistent=False;restoreAnyVersion=False;installLocation=preferExternal;
109 | $(BDS)\bin\Artwork\Android\FM_LauncherIcon_192x192.png
110 |
111 |
112 | package=com.embarcadero.$(MSBuildProjectName);label=$(MSBuildProjectName);versionCode=1;versionName=1.0.0;persistent=False;restoreAnyVersion=False;installLocation=preferExternal;
113 | Debug
114 | false
115 | true
116 | Base
117 | true
118 | android-support-v4.dex.jar;apk-expansion.dex.jar;cloud-messaging.dex.jar;fmx.dex.jar;google-analytics-v2.dex.jar;google-play-billing.dex.jar;google-play-licensing.dex.jar;google-play-services.dex.jar
119 | $(BDS)\bin\Artwork\Android\FM_LauncherIcon_192x192.png
120 |
121 |
122 | iPhoneAndiPad
123 | $(MSBuildProjectName)
124 | CFBundleName=$(MSBuildProjectName);CFBundleDevelopmentRegion=en;CFBundleDisplayName=$(MSBuildProjectName);CFBundleIdentifier=$(MSBuildProjectName);CFBundleInfoDictionaryVersion=7.1;CFBundleVersion=1.0.0.0;CFBundlePackageType=APPL;CFBundleSignature=????;LSRequiresIPhoneOS=true;CFBundleAllowMixedLocalizations=YES;CFBundleExecutable=$(MSBuildProjectName);UIDeviceFamily=iPhone & iPad;CFBundleResourceSpecification=ResourceRules.plist;NSLocationAlwaysUsageDescription=The reason for accessing the location information of the user;NSLocationWhenInUseUsageDescription=The reason for accessing the location information of the user
125 | Debug
126 | $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_1024x1024.png
127 |
128 |
129 | CFBundleName=$(MSBuildProjectName);CFBundleDevelopmentRegion=en;CFBundleDisplayName=$(MSBuildProjectName);CFBundleIdentifier=$(MSBuildProjectName);CFBundleInfoDictionaryVersion=7.1;CFBundleVersion=1.0.0.0;CFBundlePackageType=APPL;CFBundleSignature=????;LSRequiresIPhoneOS=true;CFBundleAllowMixedLocalizations=YES;CFBundleExecutable=$(MSBuildProjectName);UIDeviceFamily=iPhone & iPad;CFBundleResourceSpecification=ResourceRules.plist;NSLocationAlwaysUsageDescription=The reason for accessing the location information of the user;NSLocationWhenInUseUsageDescription=The reason for accessing the location information of the user
130 | iPhoneAndiPad
131 | $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_1024x1024.png
132 |
133 |
134 | Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)
135 | OpenWirePkgD16;vclx;vcl;OpenWirePkgD17;OpenWirePkgD18;OpenWirePkgD19;$(DCC_UsePackage)
136 |
137 |
138 | vclx;vcl;OpenWirePkgD17;OpenWirePkgD18;OpenWirePkgD19;$(DCC_UsePackage)
139 |
140 |
141 | $(SystemRoot)\System32\OpenWireDsnD15.bpl
142 | 7.0
143 | 0
144 | False
145 | 0
146 | RELEASE;__DELPHI_DESIGN__
147 |
148 |
149 | $(SystemRoot)\System32\OpenWireDsnD15.bpl
150 | 7.0
151 | $(BDS)\lib
152 | $(BDS)\lib
153 | $(BDS)\lib
154 | $(BDS)\lib
155 | true
156 | true
157 |
158 |
159 | true
160 |
161 |
162 | true
163 | true
164 |
165 |
166 | $(windir)\System32
167 | C:\Program Files (x86)\Embarcadero\Studio\19.0\bin\bds.exe
168 |
169 |
170 |
171 | MainSource
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 | Base
198 |
199 |
200 | Cfg_Release
201 | Base
202 |
203 |
204 | Cfg_Debug
205 | Base
206 |
207 |
208 |
209 |
210 |
211 | Delphi.Personality.12
212 | Package
213 |
214 |
215 |
216 | False
217 |
218 |
219 |
220 | C:\Program Files (x86)\Embarcadero\RAD Studio\7.0\bin\bds.exe
221 |
222 |
223 | True
224 | False
225 | 8
226 | 0
227 | 0
228 | 141
229 | False
230 | False
231 | False
232 | False
233 | False
234 | 1033
235 | 1252
236 |
237 |
238 |
239 |
240 | 8.0.0.141
241 |
242 |
243 |
244 |
245 |
246 | 8.0.0.141
247 |
248 | Thursday, October 07, 2010 7:57 PM
249 |
250 |
251 | OpenWireDsn.dpk
252 |
253 |
254 | Embarcadero C++Builder Office 2000 Servers Package
255 | Embarcadero C++Builder Office XP Servers Package
256 | Microsoft Office 2000 Sample Automation Server Wrapper Components
257 | Microsoft Office XP Sample Automation Server Wrapper Components
258 |
259 |
260 |
261 | False
262 | False
263 | False
264 | False
265 | True
266 | False
267 |
268 |
269 |
270 |
271 |
272 | 1
273 |
274 |
275 | 0
276 |
277 |
278 |
279 |
280 | classes
281 | 64
282 |
283 |
284 | classes
285 | 64
286 |
287 |
288 |
289 |
290 | res\xml
291 | 1
292 |
293 |
294 | res\xml
295 | 1
296 |
297 |
298 |
299 |
300 | library\lib\armeabi-v7a
301 | 1
302 |
303 |
304 |
305 |
306 | library\lib\armeabi
307 | 1
308 |
309 |
310 | library\lib\armeabi
311 | 1
312 |
313 |
314 |
315 |
316 | library\lib\armeabi-v7a
317 | 1
318 |
319 |
320 |
321 |
322 | library\lib\mips
323 | 1
324 |
325 |
326 | library\lib\mips
327 | 1
328 |
329 |
330 |
331 |
332 | library\lib\armeabi-v7a
333 | 1
334 |
335 |
336 | library\lib\arm64-v8a
337 | 1
338 |
339 |
340 |
341 |
342 | library\lib\armeabi-v7a
343 | 1
344 |
345 |
346 |
347 |
348 | res\drawable
349 | 1
350 |
351 |
352 | res\drawable
353 | 1
354 |
355 |
356 |
357 |
358 | res\values
359 | 1
360 |
361 |
362 | res\values
363 | 1
364 |
365 |
366 |
367 |
368 | res\values-v21
369 | 1
370 |
371 |
372 | res\values-v21
373 | 1
374 |
375 |
376 |
377 |
378 | res\values
379 | 1
380 |
381 |
382 | res\values
383 | 1
384 |
385 |
386 |
387 |
388 | res\drawable
389 | 1
390 |
391 |
392 | res\drawable
393 | 1
394 |
395 |
396 |
397 |
398 | res\drawable-xxhdpi
399 | 1
400 |
401 |
402 | res\drawable-xxhdpi
403 | 1
404 |
405 |
406 |
407 |
408 | res\drawable-xxxhdpi
409 | 1
410 |
411 |
412 | res\drawable-xxxhdpi
413 | 1
414 |
415 |
416 |
417 |
418 | res\drawable-ldpi
419 | 1
420 |
421 |
422 | res\drawable-ldpi
423 | 1
424 |
425 |
426 |
427 |
428 | res\drawable-mdpi
429 | 1
430 |
431 |
432 | res\drawable-mdpi
433 | 1
434 |
435 |
436 |
437 |
438 | res\drawable-hdpi
439 | 1
440 |
441 |
442 | res\drawable-hdpi
443 | 1
444 |
445 |
446 |
447 |
448 | res\drawable-xhdpi
449 | 1
450 |
451 |
452 | res\drawable-xhdpi
453 | 1
454 |
455 |
456 |
457 |
458 | res\drawable-mdpi
459 | 1
460 |
461 |
462 | res\drawable-mdpi
463 | 1
464 |
465 |
466 |
467 |
468 | res\drawable-hdpi
469 | 1
470 |
471 |
472 | res\drawable-hdpi
473 | 1
474 |
475 |
476 |
477 |
478 | res\drawable-xhdpi
479 | 1
480 |
481 |
482 | res\drawable-xhdpi
483 | 1
484 |
485 |
486 |
487 |
488 | res\drawable-xxhdpi
489 | 1
490 |
491 |
492 | res\drawable-xxhdpi
493 | 1
494 |
495 |
496 |
497 |
498 | res\drawable-xxxhdpi
499 | 1
500 |
501 |
502 | res\drawable-xxxhdpi
503 | 1
504 |
505 |
506 |
507 |
508 | res\drawable-small
509 | 1
510 |
511 |
512 | res\drawable-small
513 | 1
514 |
515 |
516 |
517 |
518 | res\drawable-normal
519 | 1
520 |
521 |
522 | res\drawable-normal
523 | 1
524 |
525 |
526 |
527 |
528 | res\drawable-large
529 | 1
530 |
531 |
532 | res\drawable-large
533 | 1
534 |
535 |
536 |
537 |
538 | res\drawable-xlarge
539 | 1
540 |
541 |
542 | res\drawable-xlarge
543 | 1
544 |
545 |
546 |
547 |
548 | res\values
549 | 1
550 |
551 |
552 | res\values
553 | 1
554 |
555 |
556 |
557 |
558 | 1
559 |
560 |
561 | 1
562 |
563 |
564 | 0
565 |
566 |
567 |
568 |
569 | 1
570 | .framework
571 |
572 |
573 | 1
574 | .framework
575 |
576 |
577 | 1
578 | .framework
579 |
580 |
581 | 0
582 |
583 |
584 |
585 |
586 | 1
587 | .dylib
588 |
589 |
590 | 1
591 | .dylib
592 |
593 |
594 | 1
595 | .dylib
596 |
597 |
598 | 0
599 | .dll;.bpl
600 |
601 |
602 |
603 |
604 | 1
605 | .dylib
606 |
607 |
608 | 1
609 | .dylib
610 |
611 |
612 | 1
613 | .dylib
614 |
615 |
616 | 1
617 | .dylib
618 |
619 |
620 | 1
621 | .dylib
622 |
623 |
624 | 1
625 | .dylib
626 |
627 |
628 | 0
629 | .bpl
630 |
631 |
632 |
633 |
634 | 0
635 |
636 |
637 | 0
638 |
639 |
640 | 0
641 |
642 |
643 | 0
644 |
645 |
646 | 0
647 |
648 |
649 | 0
650 |
651 |
652 | 0
653 |
654 |
655 | 0
656 |
657 |
658 | 0
659 |
660 |
661 |
662 |
663 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset
664 | 1
665 |
666 |
667 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset
668 | 1
669 |
670 |
671 |
672 |
673 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset
674 | 1
675 |
676 |
677 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset
678 | 1
679 |
680 |
681 |
682 |
683 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset
684 | 1
685 |
686 |
687 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset
688 | 1
689 |
690 |
691 |
692 |
693 | ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset
694 | 1
695 |
696 |
697 | ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset
698 | 1
699 |
700 |
701 |
702 |
703 | ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset
704 | 1
705 |
706 |
707 | ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset
708 | 1
709 |
710 |
711 |
712 |
713 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset
714 | 1
715 |
716 |
717 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset
718 | 1
719 |
720 |
721 |
722 |
723 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset
724 | 1
725 |
726 |
727 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset
728 | 1
729 |
730 |
731 |
732 |
733 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset
734 | 1
735 |
736 |
737 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset
738 | 1
739 |
740 |
741 |
742 |
743 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset
744 | 1
745 |
746 |
747 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset
748 | 1
749 |
750 |
751 |
752 |
753 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset
754 | 1
755 |
756 |
757 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset
758 | 1
759 |
760 |
761 |
762 |
763 | ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset
764 | 1
765 |
766 |
767 | ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset
768 | 1
769 |
770 |
771 |
772 |
773 | ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset
774 | 1
775 |
776 |
777 | ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset
778 | 1
779 |
780 |
781 |
782 |
783 | ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset
784 | 1
785 |
786 |
787 | ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset
788 | 1
789 |
790 |
791 |
792 |
793 | ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset
794 | 1
795 |
796 |
797 | ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset
798 | 1
799 |
800 |
801 |
802 |
803 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset
804 | 1
805 |
806 |
807 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset
808 | 1
809 |
810 |
811 |
812 |
813 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset
814 | 1
815 |
816 |
817 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset
818 | 1
819 |
820 |
821 |
822 |
823 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset
824 | 1
825 |
826 |
827 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset
828 | 1
829 |
830 |
831 |
832 |
833 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset
834 | 1
835 |
836 |
837 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset
838 | 1
839 |
840 |
841 |
842 |
843 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset
844 | 1
845 |
846 |
847 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset
848 | 1
849 |
850 |
851 |
852 |
853 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset
854 | 1
855 |
856 |
857 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset
858 | 1
859 |
860 |
861 |
862 |
863 | 1
864 |
865 |
866 | 1
867 |
868 |
869 |
870 |
871 | ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF
872 | 1
873 |
874 |
875 | ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF
876 | 1
877 |
878 |
879 | ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF
880 | 1
881 |
882 |
883 |
884 |
885 |
886 |
887 |
888 | 1
889 |
890 |
891 | 1
892 |
893 |
894 | 1
895 |
896 |
897 |
898 |
899 |
900 |
901 |
902 | Contents\Resources
903 | 1
904 |
905 |
906 | Contents\Resources
907 | 1
908 |
909 |
910 | Contents\Resources
911 | 1
912 |
913 |
914 |
915 |
916 | library\lib\armeabi-v7a
917 | 1
918 |
919 |
920 | library\lib\arm64-v8a
921 | 1
922 |
923 |
924 | 1
925 |
926 |
927 | 1
928 |
929 |
930 | 1
931 |
932 |
933 | 1
934 |
935 |
936 | 1
937 |
938 |
939 | 1
940 |
941 |
942 | 1
943 |
944 |
945 | 0
946 |
947 |
948 |
949 |
950 | library\lib\armeabi-v7a
951 | 1
952 |
953 |
954 |
955 |
956 | 1
957 |
958 |
959 | 1
960 |
961 |
962 |
963 |
964 | Assets
965 | 1
966 |
967 |
968 | Assets
969 | 1
970 |
971 |
972 |
973 |
974 | Assets
975 | 1
976 |
977 |
978 | Assets
979 | 1
980 |
981 |
982 |
983 |
984 |
985 |
986 |
987 |
988 |
989 |
990 |
991 |
992 |
993 |
994 |
995 |
996 | 12
997 |
998 |
999 |
1000 |
--------------------------------------------------------------------------------
/11.0/OpenWireDsn.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bmitov/OpenWire/ecda2b148c1f2761a20bcfedb1e37d98f6a4cc21/11.0/OpenWireDsn.res
--------------------------------------------------------------------------------
/11.0/OpenWirePkg.dpk:
--------------------------------------------------------------------------------
1 | package OpenWirePkg;
2 |
3 | {$R *.res}
4 | {$R '..\OWStdTypes.res'}
5 | {$R '..\Mitov.Categories.OpenWire.res'}
6 | {$IFDEF IMPLICITBUILDING This IFDEF should not be used by users}
7 | {$ALIGN 8}
8 | {$ASSERTIONS ON}
9 | {$BOOLEVAL OFF}
10 | {$DEBUGINFO OFF}
11 | {$EXTENDEDSYNTAX ON}
12 | {$IMPORTEDDATA ON}
13 | {$IOCHECKS ON}
14 | {$LOCALSYMBOLS ON}
15 | {$LONGSTRINGS ON}
16 | {$OPENSTRINGS ON}
17 | {$OPTIMIZATION OFF}
18 | {$OVERFLOWCHECKS ON}
19 | {$RANGECHECKS ON}
20 | {$REFERENCEINFO ON}
21 | {$SAFEDIVIDE OFF}
22 | {$STACKFRAMES ON}
23 | {$TYPEDADDRESS OFF}
24 | {$VARSTRINGCHECKS ON}
25 | {$WRITEABLECONST OFF}
26 | {$MINENUMSIZE 1}
27 | {$IMAGEBASE $400000}
28 | {$DEFINE DEBUG}
29 | {$ENDIF IMPLICITBUILDING}
30 | {$DESCRIPTION 'Mitov Runtime'}
31 | {$LIBSUFFIX AUTO}
32 | {$RUNONLY}
33 | {$IMPLICITBUILD OFF}
34 |
35 | requires
36 | rtl,
37 | Mitov_Runtime;
38 |
39 | contains
40 | OWPins in '..\OWPins.pas',
41 | OWStdTypes in '..\OWStdTypes.pas',
42 | OpenWire.TypeConverters in '..\OpenWire.TypeConverters.pas',
43 | Mitov.Categories.OpenWire in '..\Mitov.Categories.OpenWire.pas';
44 |
45 | end.
46 |
--------------------------------------------------------------------------------
/11.0/OpenWirePkg.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bmitov/OpenWire/ecda2b148c1f2761a20bcfedb1e37d98f6a4cc21/11.0/OpenWirePkg.res
--------------------------------------------------------------------------------
/11.0/OpenWirePkgGroup.groupproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | {97aef5e4-8e8a-4194-8ca8-b56d945fc9c9}
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/12.0/OpenWireDsn.dpk:
--------------------------------------------------------------------------------
1 | package OpenWireDsn;
2 |
3 | {$R *.res}
4 | {$IFDEF IMPLICITBUILDING This IFDEF should not be used by users}
5 | {$ALIGN 8}
6 | {$ASSERTIONS ON}
7 | {$BOOLEVAL OFF}
8 | {$DEBUGINFO OFF}
9 | {$EXTENDEDSYNTAX ON}
10 | {$IMPORTEDDATA ON}
11 | {$IOCHECKS ON}
12 | {$LOCALSYMBOLS ON}
13 | {$LONGSTRINGS ON}
14 | {$OPENSTRINGS ON}
15 | {$OPTIMIZATION ON}
16 | {$OVERFLOWCHECKS ON}
17 | {$RANGECHECKS ON}
18 | {$REFERENCEINFO ON}
19 | {$SAFEDIVIDE OFF}
20 | {$STACKFRAMES OFF}
21 | {$TYPEDADDRESS OFF}
22 | {$VARSTRINGCHECKS ON}
23 | {$WRITEABLECONST OFF}
24 | {$MINENUMSIZE 1}
25 | {$IMAGEBASE $400000}
26 | {$DEFINE __DELPHI_DESIGN__}
27 | {$ENDIF IMPLICITBUILDING}
28 | {$DESCRIPTION 'OpenWire Project (Design Time)'}
29 | {$LIBSUFFIX AUTO}
30 | {$DESIGNONLY}
31 | {$IMPLICITBUILD OFF}
32 |
33 | requires
34 | rtl,
35 | vcl,
36 | vclx,
37 | Mitov_Runtime,
38 | Mitov_VCL_Runtime,
39 | OpenWirePkg,
40 | Mitov_Delphi_Design,
41 | designide;
42 |
43 | contains
44 | OpenWirePinEditors in '..\OpenWirePinEditors.pas' {OWPinEditorForm},
45 | OWStateEditors in '..\OWStateEditors.pas' {OWStatePinForm},
46 | OWAboutFormUnit in '..\OWAboutFormUnit.pas' {OWAboutForm},
47 | OWDesignTypes in '..\OWDesignTypes.pas',
48 | OWAfterPinSelectFormUnit in '..\OWAfterPinSelectFormUnit.pas' {OWAfterPinSelectForm},
49 | OpenWire.Delphi.PropertyEditors in '..\OpenWire.Delphi.PropertyEditors.pas',
50 | OpenWire.Design in '..\OpenWire.Design.pas';
51 |
52 | end.
53 |
54 |
55 |
56 |
--------------------------------------------------------------------------------
/12.0/OpenWireDsn.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bmitov/OpenWire/ecda2b148c1f2761a20bcfedb1e37d98f6a4cc21/12.0/OpenWireDsn.res
--------------------------------------------------------------------------------
/12.0/OpenWirePkg.dpk:
--------------------------------------------------------------------------------
1 | package OpenWirePkg;
2 |
3 | {$R *.res}
4 | {$R '..\OWStdTypes.res'}
5 | {$R '..\Mitov.Categories.OpenWire.res'}
6 | {$IFDEF IMPLICITBUILDING This IFDEF should not be used by users}
7 | {$ALIGN 8}
8 | {$ASSERTIONS ON}
9 | {$BOOLEVAL OFF}
10 | {$DEBUGINFO OFF}
11 | {$EXTENDEDSYNTAX ON}
12 | {$IMPORTEDDATA ON}
13 | {$IOCHECKS ON}
14 | {$LOCALSYMBOLS ON}
15 | {$LONGSTRINGS ON}
16 | {$OPENSTRINGS ON}
17 | {$OPTIMIZATION OFF}
18 | {$OVERFLOWCHECKS ON}
19 | {$RANGECHECKS ON}
20 | {$REFERENCEINFO ON}
21 | {$SAFEDIVIDE OFF}
22 | {$STACKFRAMES ON}
23 | {$TYPEDADDRESS OFF}
24 | {$VARSTRINGCHECKS ON}
25 | {$WRITEABLECONST OFF}
26 | {$MINENUMSIZE 1}
27 | {$IMAGEBASE $400000}
28 | {$DEFINE DEBUG}
29 | {$ENDIF IMPLICITBUILDING}
30 | {$DESCRIPTION 'Mitov Runtime'}
31 | {$LIBSUFFIX AUTO}
32 | {$RUNONLY}
33 | {$IMPLICITBUILD OFF}
34 |
35 | requires
36 | rtl,
37 | Mitov_Runtime;
38 |
39 | contains
40 | OWPins in '..\OWPins.pas',
41 | OWStdTypes in '..\OWStdTypes.pas',
42 | OpenWire.TypeConverters in '..\OpenWire.TypeConverters.pas',
43 | Mitov.Categories.OpenWire in '..\Mitov.Categories.OpenWire.pas';
44 |
45 | end.
46 |
--------------------------------------------------------------------------------
/12.0/OpenWirePkg.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bmitov/OpenWire/ecda2b148c1f2761a20bcfedb1e37d98f6a4cc21/12.0/OpenWirePkg.res
--------------------------------------------------------------------------------
/12.0/OpenWirePkgGroup.groupproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | {97aef5e4-8e8a-4194-8ca8-b56d945fc9c9}
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/12.0/ReleaseOptionSet.optset:
--------------------------------------------------------------------------------
1 |
2 |
3 | .\$(Platform)\$(Config)
4 |
5 |
6 | Delphi.Personality.12
7 | OptionSet
8 |
9 |
10 |
11 | 12
12 |
13 |
14 |
--------------------------------------------------------------------------------
/Mitov.Categories.OpenWire.pas:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////////
2 | // //
3 | // This software is supplied under the terms of a license agreement or //
4 | // nondisclosure agreement with Mitov Software and may not be copied //
5 | // or disclosed except in accordance with the terms of that agreement. //
6 | // Copyright(c) 2002-2025 Mitov Software. All Rights Reserved. //
7 | // //
8 | ////////////////////////////////////////////////////////////////////////////////
9 |
10 | unit Mitov.Categories.OpenWire;
11 |
12 | //##HIDDENUNIT##
13 |
14 | interface
15 |
16 | {$HPPEMIT NOUSINGNAMESPACE}
17 |
18 | uses
19 | Mitov.Attributes, Mitov.Design.Components;
20 |
21 | type
22 | //##NOEXPORT##
23 | [Name( 'OpenWire' )]
24 | TOpenWireToolbarCategory = class( TClassCategory );
25 | //---------------------------------------------------------------------------
26 | implementation
27 |
28 | end.
29 |
--------------------------------------------------------------------------------
/Mitov.Categories.OpenWire.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bmitov/OpenWire/ecda2b148c1f2761a20bcfedb1e37d98f6a4cc21/Mitov.Categories.OpenWire.res
--------------------------------------------------------------------------------
/Mitov.Definitions.inc:
--------------------------------------------------------------------------------
1 | {$WARN UNSAFE_TYPE OFF}
2 | {$WARN UNSAFE_CODE OFF}
3 | {$WARN UNSAFE_CAST OFF}
4 |
5 | {$DEFINE D19}
6 | {$DEFINE XE8Up}
7 | {$DEFINE XE7Up}
8 | {$DEFINE XE5Up}
9 | {$DEFINE XE6Up}
10 | {$DEFINE RXUp}
11 |
12 | {$IF CompilerVersion = 30} // Delphi RX 10 Seattle
13 | {$DEFINE RX}
14 | {$ENDIF}
15 |
16 | {$IF CompilerVersion = 31} // Delphi RX 10.1 Berlin
17 | {$DEFINE RX10_1}
18 | {$ENDIF}
19 |
20 | {$IF CompilerVersion = 32} // Delphi RX 10.2 Tokyo
21 | {$DEFINE RX10_2}
22 | {$ENDIF}
23 |
24 | {$DEFINE RX10_3_Up}
25 |
26 | {$IF CompilerVersion = 33} // Delphi RX 10.3 Rio
27 | {$DEFINE RX10_3}
28 | {$WARN UNKNOWN_CUSTOM_ATTRIBUTE ERROR}
29 | {$ENDIF}
30 |
31 | {$IF CompilerVersion = 34} // Delphi RX 10.4 Sidney
32 | {$DEFINE RX10_4}
33 | {$WARN UNKNOWN_CUSTOM_ATTRIBUTE ERROR}
34 | {$ENDIF}
35 |
36 | {$IF CompilerVersion > 33} // Delphi RX 10.3 Rio
37 | {$DEFINE RX10_4_Up}
38 | {$ENDIF}
39 |
40 | {$IF CompilerVersion = 35} // Delphi RX 11.0 Alexandria
41 | {$DEFINE RX11_0}
42 | {$WARN UNKNOWN_CUSTOM_ATTRIBUTE ERROR}
43 | {$ENDIF}
44 |
45 | {$IF CompilerVersion > 34} // Delphi RX 10.4 Sidney
46 | {$DEFINE RX11_0_Up}
47 | {$ENDIF}
48 |
49 | {$IF CompilerVersion = 36} // Delphi RX 12.0
50 | {$DEFINE RX12_0}
51 | {$WARN UNKNOWN_CUSTOM_ATTRIBUTE ERROR}
52 | {$ENDIF}
53 |
54 | {$IF CompilerVersion >= 36} // Delphi RX 12.0
55 | {$DEFINE RX12_0_Up}
56 | {$ENDIF}
57 |
58 | {$IF CompilerVersion > 30} // Delphi RX 10.1 Berlin
59 | {$DEFINE RX10_1Up}
60 | {$DEFINE RX1Up}
61 | {$ENDIF}
62 |
63 | {$DEFINE FIXED_COMPILERS}
64 |
65 | {$DEFINE D13}
66 | {$DEFINE D16Up}
67 | {$DEFINE D17Up}
68 | {$DEFINE XE4Up}
69 |
70 | {$DEFINE INTERFACE_USE_STDCALL}
71 |
72 | {$DEFINE STANDATD_BUFFER_ALLOCATION}
73 |
74 | {$IFDEF MSWINDOWS}
75 | {$IF ( not defined(FMX)) OR ( not defined(RXUp))}
76 | {$DEFINE FMX_VCL}
77 | {$ENDIF}
78 | {$ENDIF}
79 |
80 | {$IFDEF MSWINDOWS}
81 | {$DEFINE USEMEDIATIMERS}
82 | {$ELSE}
83 | {$DEFINE USE_NATIVE_IMPLEMENTATION}
84 | {$ENDIF}
85 |
86 | {$IF defined(ANDROID) or defined(IOS)}
87 | {$DEFINE NOMODAL}
88 | {$ENDIF}
89 |
90 |
91 | {$ZEROBASEDSTRINGS OFF}
92 | {$WARN UNSUPPORTED_CONSTRUCT ERROR}
93 |
94 | {$POINTERMATH ON}
95 |
96 |
--------------------------------------------------------------------------------
/OWAboutFormUnit.pas:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////////
2 | // //
3 | // This software is supplied under the terms of a license agreement or //
4 | // nondisclosure agreement with Mitov Software and may not be copied //
5 | // or disclosed except in accordance with the terms of that agreement. //
6 | // Copyright(c) 2002-2025 Mitov Software. All Rights Reserved. //
7 | // //
8 | ////////////////////////////////////////////////////////////////////////////////
9 |
10 | unit OWAboutFormUnit;
11 |
12 | interface
13 |
14 | uses
15 | WinApi.Windows, WinApi.Messages, System.SysUtils, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms,
16 | Vcl.Dialogs, Vcl.StdCtrls, Vcl.Buttons, Vcl.ExtCtrls, Mitov.SharedImagesModuleUnit;
17 |
18 | type
19 | TOWAboutForm = class( TForm )
20 | Panel2: TPanel;
21 | Panel3: TPanel;
22 | Image1: TImage;
23 | OKButton: TButton;
24 | Label1: TLabel;
25 | OWLabel: TLabel;
26 | procedure FormKeyPress(Sender: TObject; var Key: Char);
27 | procedure OWLabelClick(Sender: TObject);
28 | procedure OWLabelMouseEnter(Sender: TObject);
29 | procedure OWLabelMouseLeave(Sender: TObject);
30 | procedure FormCreate(Sender: TObject);
31 | private
32 | { Private declarations }
33 | public
34 | { Public declarations }
35 | end;
36 |
37 | implementation
38 |
39 | {$IFNDEF FPC}
40 | uses
41 | WinApi.ShellAPI;
42 | {$ENDIF}
43 |
44 | {$IFNDEF FPC}
45 | {$R *.DFM}
46 | {$ENDIF}
47 |
48 | //---------------------------------------------------------------------------
49 | procedure TOWAboutForm.FormKeyPress(Sender: TObject; var Key: Char);
50 | begin
51 | if( Key <> #27 ) then
52 | Exit;
53 |
54 | Close();
55 | Key := '0';
56 | end;
57 | //---------------------------------------------------------------------------
58 | procedure TOWAboutForm.OWLabelClick(Sender: TObject);
59 | begin
60 | {$IFDEF FPC}
61 | OpenURL( 'http://www.openwire.org' );
62 | {$ELSE}
63 | ShellExecute( 0, 'open', 'http://www.openwire.org', '', '', SW_SHOWNORMAL );
64 | {$ENDIF}
65 | end;
66 | //---------------------------------------------------------------------------
67 | procedure TOWAboutForm.OWLabelMouseEnter(Sender: TObject);
68 | begin
69 | OWLabel.Font.Color := clRed;
70 | end;
71 | //---------------------------------------------------------------------------
72 | procedure TOWAboutForm.OWLabelMouseLeave(Sender: TObject);
73 | begin
74 | OWLabel.Font.Color := clBlue;
75 | end;
76 | //---------------------------------------------------------------------------
77 | procedure TOWAboutForm.FormCreate(Sender: TObject);
78 | begin
79 | OWLabel.OnMouseEnter := OWLabelMouseEnter;
80 | OWLabel.OnMouseLeave := OWLabelMouseLeave;
81 | end;
82 | //---------------------------------------------------------------------------
83 | //---------------------------------------------------------------------------
84 | //---------------------------------------------------------------------------
85 | //---------------------------------------------------------------------------
86 | end.
87 |
--------------------------------------------------------------------------------
/OWAfterPinSelectFormUnit.dfm:
--------------------------------------------------------------------------------
1 | inherited OWAfterPinSelectForm: TOWAfterPinSelectForm
2 | Left = 100
3 | Top = 100
4 | Caption = 'Pin Selection Dialog'
5 | ClientHeight = 264
6 | ClientWidth = 228
7 | Constraints.MinHeight = 200
8 | Constraints.MinWidth = 200
9 | Font.Name = 'MS Sans Serif'
10 | Position = poOwnerFormCenter
11 | ExplicitWidth = 244
12 | ExplicitHeight = 303
13 | TextHeight = 13
14 | inherited FooterPanel: TPanel
15 | Top = 223
16 | Width = 228
17 | TabOrder = 1
18 | inherited OKButton: TButton
19 | Left = 63
20 | end
21 | inherited CancelButton: TButton
22 | Left = 144
23 | end
24 | end
25 | object ListBox: TListBox
26 | Left = 0
27 | Top = 0
28 | Width = 228
29 | Height = 223
30 | Align = alClient
31 | ItemHeight = 13
32 | TabOrder = 0
33 | OnDblClick = ListBoxDblClick
34 | ExplicitWidth = 299
35 | ExplicitHeight = 225
36 | end
37 | end
38 |
--------------------------------------------------------------------------------
/OWAfterPinSelectFormUnit.pas:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////////
2 | // //
3 | // This software is supplied under the terms of a license agreement or //
4 | // nondisclosure agreement with Mitov Software and may not be copied //
5 | // or disclosed except in accordance with the terms of that agreement. //
6 | // Copyright(c) 2002-2025 Mitov Software. All Rights Reserved. //
7 | // //
8 | ////////////////////////////////////////////////////////////////////////////////
9 |
10 | unit OWAfterPinSelectFormUnit;
11 |
12 | {$IFDEF FPC}
13 | {$MODE DELPHI}{$H+}
14 | {$ENDIF}
15 |
16 | interface
17 |
18 | uses
19 | {$IFDEF FPC}
20 | LCLIntf, LMessages, LResources,
21 | {$ELSE}
22 | WinApi.Windows, WinApi.Messages,
23 | {$ENDIF}
24 | System.SysUtils, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms,
25 | Vcl.Dialogs, Vcl.ExtCtrls, Vcl.StdCtrls, Vcl.Buttons, OWPins,
26 | Mitov.BasicOKCancelFormUnit;
27 |
28 | type
29 | TOWAfterPinSelectForm = class( TMitov_BasicOKCancelForm )
30 | ListBox: TListBox;
31 | procedure ListBoxDblClick( Sender : TObject );
32 | private
33 | { Private declarations }
34 | public
35 | procedure FillFromDisparcher( AExcludePin : TOWBasicPin; ADispatcher : TOWBasicStateDispatcher; ANotifyAfterPin : TOWBasicPin );
36 | procedure FillFromSourcePin( AExcludePin : TOWBasicPin; ASourcePin : TOWSourcePin; ANotifyAfterPin : TOWBasicPin );
37 | function GetSelectedName() : String;
38 | function GetSelectedPin() : TOWPin;
39 |
40 | end;
41 |
42 | implementation
43 |
44 | {$IFNDEF FPC}
45 | {$R *.DFM}
46 | {$ENDIF}
47 |
48 | //---------------------------------------------------------------------------
49 | procedure TOWAfterPinSelectForm.FillFromDisparcher( AExcludePin : TOWBasicPin; ADispatcher : TOWBasicStateDispatcher; ANotifyAfterPin : TOWBasicPin );
50 | var
51 | ANotifyAfterName : String;
52 |
53 | begin
54 | ListBox.Items.Add( '(none)' );
55 | var AExecutePinRootName := AExcludePin.GetRootName();
56 | for var I : Integer := 0 to ADispatcher.PinCount - 1 do
57 | begin
58 | var APin := ADispatcher.Pins[ I ];
59 | // if( AExcludePin <> APin ) then
60 | if( ADispatcher.CanConnectAfter( AExcludePin, APin )) then
61 | ListBox.Items.AddObject( APin.GetFullName( AExecutePinRootName <> APin.GetRootName() ), APin );
62 |
63 | end;
64 |
65 | if( ANotifyAfterPin <> NIL ) then
66 | ANotifyAfterName := ANotifyAfterPin.GetFullName( AExcludePin.GetRoot() <> ANotifyAfterPin.GetRoot() );
67 |
68 | if( ANotifyAfterName <> '' ) then
69 | ListBox.ItemIndex := ListBox.Items.IndexOf( ANotifyAfterName );
70 |
71 | if( ListBox.ItemIndex < 0 ) then
72 | ListBox.ItemIndex := 0;
73 |
74 | end;
75 | //---------------------------------------------------------------------------
76 | procedure TOWAfterPinSelectForm.FillFromSourcePin( AExcludePin : TOWBasicPin; ASourcePin : TOWSourcePin; ANotifyAfterPin : TOWBasicPin );
77 | var
78 | ANotifyAfterName : String;
79 |
80 | begin
81 | ListBox.Items.Add( '(none)' );
82 | var APinRoot := AExcludePin.GetRoot();
83 | for var I : Integer := 0 to ASourcePin.SinkCount - 1 do
84 | begin
85 | var APin := ASourcePin.Sinks[ I ];
86 | // if( AExcludePin <> APin ) then
87 | if( ASourcePin.CanConnectAfter( AExcludePin, APin )) then
88 | ListBox.Items.AddObject( APin.GetFullName( APinRoot <> APin.GetRoot() ), APin );
89 |
90 | end;
91 |
92 | if( ANotifyAfterPin <> NIL ) then
93 | ANotifyAfterName := ANotifyAfterPin.GetFullName( APinRoot <> ANotifyAfterPin.GetRoot() );
94 |
95 | if( ANotifyAfterName <> '' ) then
96 | ListBox.ItemIndex := ListBox.Items.IndexOf( ANotifyAfterName );
97 |
98 | if( ListBox.ItemIndex < 0 ) then
99 | ListBox.ItemIndex := 0;
100 |
101 | end;
102 | //---------------------------------------------------------------------------
103 | function TOWAfterPinSelectForm.GetSelectedName() : String;
104 | begin
105 | if( ListBox.ItemIndex > 0 ) then
106 | Exit( ListBox.Items[ ListBox.ItemIndex ] );
107 |
108 | Result := '';
109 | end;
110 | //---------------------------------------------------------------------------
111 | function TOWAfterPinSelectForm.GetSelectedPin() : TOWPin;
112 | begin
113 | if( ListBox.ItemIndex > 0 ) then
114 | Exit( TOWPin( ListBox.Items.Objects[ ListBox.ItemIndex ] ));
115 |
116 | Result := NIL;
117 | end;
118 | //---------------------------------------------------------------------------
119 | procedure TOWAfterPinSelectForm.ListBoxDblClick( Sender : TObject );
120 | begin
121 | if( ListBox.ItemIndex > 0 ) then
122 | ModalResult := mrOk;
123 |
124 | end;
125 | //---------------------------------------------------------------------------
126 | //---------------------------------------------------------------------------
127 | //---------------------------------------------------------------------------
128 | //---------------------------------------------------------------------------
129 | {$IFDEF FPC}
130 | initialization
131 | {$i OWAfterPinSelectFormUnit.lrs}
132 | {$ENDIF}
133 |
134 | end.
135 |
--------------------------------------------------------------------------------
/OWClassProperty.pas:
--------------------------------------------------------------------------------
1 | unit OWClassProperty;
2 |
3 | REMOVED !
4 |
5 | interface
6 | uses
7 | {$IFDEF __VSDESIGN__}
8 | VSDesign,
9 | {$ELSE}
10 | DesignEditors, DesignIntf,
11 | {$ENDIF}
12 |
13 | Classes, TypInfo, Contnrs;
14 |
15 | type TOWClassPropertyEditor = class(TBasePropertyEditor, IProperty, IPropertyKind, IProperty70)
16 | protected
17 | function GetEditValue(out Value: String): Boolean; virtual;
18 | function HasInstance(Instance: TPersistent): Boolean; virtual;
19 |
20 | public
21 | procedure Activate(); virtual;
22 | procedure Initialize(); override;
23 | function AllEqual(): Boolean; virtual;
24 | function AutoFill(): Boolean; virtual;
25 | function GetPropInfo(): PPropInfo; virtual;
26 | {$IFDEF __VSDESIGN__}
27 | function GetPropType(): PTypeInfo; override;
28 | function GetOrdValue() : Longint; override;
29 | {$ELSE}
30 | function GetPropType(): PTypeInfo; virtual;
31 | {$ENDIF}
32 | function GetKind(): TTypeKind; virtual;
33 | function GetIsDefault(): Boolean; virtual;
34 | procedure Revert(); virtual;
35 | procedure Modified(); virtual;
36 |
37 | procedure SetPropEntry(Index: Integer; AInstance: TPersistent; APropInfo: PPropInfo); override;
38 |
39 | public
40 | {$IFDEF __VSDESIGN__}
41 | function GetEditLimit(): Integer; override;
42 | procedure GetProperties(Proc: TGetPropProc); override;
43 | function ValueAvailable(): Boolean; override;
44 | function GetName(): String; override;
45 | function GetAttributes(): TPropertyAttributes; override;
46 | procedure GetValues(Proc: TGetStrProc); override;
47 | procedure SetValue(const Value: String); override;
48 | function GetValue(): String; override;
49 | procedure Edit(); override;
50 | {$ELSE}
51 | function GetEditLimit(): Integer; virtual;
52 | procedure GetProperties(Proc: TGetPropProc); virtual;
53 | function ValueAvailable(): Boolean; virtual;
54 | function GetName(): String; virtual;
55 |
56 | function GetAttributes(): TPropertyAttributes; virtual;
57 | procedure GetValues(Proc: TGetStrProc); virtual;
58 | procedure SetValue(const Value: String); virtual;
59 | function GetValue(): String; virtual;
60 | procedure Edit(); virtual;
61 | {$ENDIF}
62 |
63 | protected
64 | FDesigner : IDesigner;
65 |
66 | public
67 | constructor CreateEx( const ADesigner: IDesigner );
68 |
69 | public
70 | property Designer : IDesigner read FDesigner;
71 |
72 | end;
73 |
74 | type TOWComponentEditorEvent = procedure of object;
75 | type TOWComponentEditorEvabledEvent = function() : Boolean of object;
76 | //---------------------------------------------------------------------------
77 | type TOWComponentEditorItem = class
78 | private
79 | FMenuText : String;
80 | FPropertyName : String;
81 | FFilter : TTypeKinds;
82 | FCallback : TOWComponentEditorEvent;
83 | FOnEnabledCallback : TOWComponentEditorEvabledEvent;
84 |
85 | public
86 | constructor Create( AMenuText : String; ACallback : TOWComponentEditorEvent; AOnEnabledCallback : TOWComponentEditorEvabledEvent; AFilter : TTypeKinds; APropertyName : String );
87 |
88 | public
89 | function GetEnabled() : Boolean;
90 |
91 | end;
92 | //---------------------------------------------------------------------------
93 | type
94 | TOWComponentEditorItems = class
95 | private
96 | FList : TObjectList;
97 |
98 | private
99 | function GetCount() : Integer;
100 | function GetItem( AIndex : Integer ) : TOWComponentEditorItem;
101 | procedure SetItem( AIndex : Integer; AValue : TOWComponentEditorItem );
102 |
103 | public
104 | procedure Add( AMenuText : String; ACallback : TOWComponentEditorEvent; AFilter: TTypeKinds; APropertyName : String );
105 | procedure AddEnable( AMenuText : String; ACallback : TOWComponentEditorEvent; AOnEnabledCallback : TOWComponentEditorEvabledEvent; AFilter: TTypeKinds; APropertyName : String );
106 |
107 | public
108 | constructor Create();
109 | destructor Destroy(); override;
110 |
111 | public
112 | property Count : Integer read GetCount;
113 | property Items[ Index : Integer ] : TOWComponentEditorItem read GetItem write SetItem; default;
114 |
115 | end;
116 | //---------------------------------------------------------------------------
117 | type
118 | TOWComponentEditor = class( TComponentEditor )
119 | protected
120 | LastIProp : IProperty;
121 | FTargetProperty : String;
122 | FMenuItems : TOWComponentEditorItems;
123 |
124 | protected
125 | procedure GetPropProc(const Prop: IProperty);
126 | function GetIProperty( Comp : TComponent; AFilter: TTypeKinds; PropertyName : String ) : IProperty;
127 | procedure EditProperty( PropertyName : String ); overload;
128 | procedure EditProperty( AFilter: TTypeKinds; PropertyName : String ); overload;
129 | procedure AddMenuItem( AMenuText : String; ACallback : TOWComponentEditorEvent; AOnEnabledCallback : TOWComponentEditorEvabledEvent ); overload;
130 | procedure AddMenuItem( AMenuText : String; ACallback : TOWComponentEditorEvent ); overload;
131 | procedure AddMenuItem( AMenuText : String; APropertyName : String ); overload;
132 | procedure AddMenuItem( AMenuText : String; AFilter: TTypeKinds; APropertyName : String ); overload;
133 | procedure InitMenu(); virtual;
134 |
135 | public
136 | procedure ExecuteVerb(Index: Integer); override;
137 | function GetVerb(Index: Integer) : String; override;
138 | function GetVerbCount() : Integer; override;
139 |
140 | public
141 | procedure AfterConstruction(); override;
142 |
143 | public
144 | constructor Create(AComponent: TComponent; ADesigner: IDesigner); override;
145 | destructor Destroy(); override;
146 |
147 | end;
148 |
149 | implementation
150 |
151 | {$IFNDEF FPC}
152 | uses OWDesignSelectionsList;
153 |
154 | constructor TOWClassPropertyEditor.CreateEx( const ADesigner: IDesigner );
155 | begin
156 | inherited Create( ADesigner, 1 );
157 | FDesigner := ADesigner;
158 | end;
159 | //------------------------------------------------------------------------------
160 | function TOWClassPropertyEditor.GetName(): String;
161 | begin
162 | Result := 'Unknown';
163 | end;
164 | //---------------------------------------------------------------------------
165 | function TOWClassPropertyEditor.GetAttributes() : TPropertyAttributes;
166 | begin
167 | Result := [];
168 | end;
169 | //---------------------------------------------------------------------------
170 | procedure TOWClassPropertyEditor.GetValues(Proc: TGetStrProc);
171 | begin
172 | end;
173 | //---------------------------------------------------------------------------
174 | procedure TOWClassPropertyEditor.SetValue(const Value: String);
175 | begin
176 | end;
177 | //---------------------------------------------------------------------------
178 | function TOWClassPropertyEditor.GetValue() : String;
179 | begin
180 | Result := '';
181 | end;
182 | //---------------------------------------------------------------------------
183 | function TOWClassPropertyEditor.GetEditValue(out Value: String): Boolean;
184 | begin
185 | Value := GetValue();
186 | Result := True;
187 | end;
188 | //---------------------------------------------------------------------------
189 | function TOWClassPropertyEditor.HasInstance(Instance: TPersistent): Boolean;
190 | begin
191 | Result := True;
192 | end;
193 | //---------------------------------------------------------------------------
194 | procedure TOWClassPropertyEditor.Activate();
195 | begin
196 | end;
197 | //---------------------------------------------------------------------------
198 | procedure TOWClassPropertyEditor.Initialize();
199 | begin
200 | end;
201 | //---------------------------------------------------------------------------
202 | function TOWClassPropertyEditor.AllEqual() : Boolean;
203 | begin
204 | Result := True;
205 | end;
206 | //---------------------------------------------------------------------------
207 | function TOWClassPropertyEditor.AutoFill() : Boolean;
208 | begin
209 | Result := False;
210 | end;
211 | //---------------------------------------------------------------------------
212 | function TOWClassPropertyEditor.GetEditLimit() : Integer;
213 | begin
214 | Result := 255;
215 | end;
216 | //---------------------------------------------------------------------------
217 | procedure TOWClassPropertyEditor.GetProperties(Proc: TGetPropProc);
218 | begin
219 | end;
220 | //---------------------------------------------------------------------------
221 | function TOWClassPropertyEditor.GetPropInfo() : PPropInfo;
222 | begin
223 | Result := NIL;
224 | end;
225 | //---------------------------------------------------------------------------
226 | function TOWClassPropertyEditor.GetPropType() : PTypeInfo;
227 | begin
228 | Result := TypeInfo( TPersistent );
229 | end;
230 | //---------------------------------------------------------------------------
231 | {$IFDEF __VSDESIGN__}
232 | function TOWClassPropertyEditor.GetOrdValue() : Longint;
233 | begin
234 | Result := 0;
235 | end;
236 | {$ENDIF}
237 | //---------------------------------------------------------------------------
238 | function TOWClassPropertyEditor.GetKind() : TTypeKind;
239 | begin
240 | Result := GetPropType().Kind;
241 | end;
242 | //---------------------------------------------------------------------------
243 | function TOWClassPropertyEditor.GetIsDefault() : Boolean;
244 | begin
245 | Result := False;
246 | end;
247 | //---------------------------------------------------------------------------
248 | procedure TOWClassPropertyEditor.SetPropEntry( Index: Integer; AInstance: TPersistent; APropInfo: PPropInfo);
249 | begin
250 | end;
251 | //---------------------------------------------------------------------------
252 | procedure TOWClassPropertyEditor.Revert();
253 | begin
254 | end;
255 | //---------------------------------------------------------------------------
256 | function TOWClassPropertyEditor.ValueAvailable() : Boolean;
257 | begin
258 | Result := True;
259 | end;
260 | //---------------------------------------------------------------------------
261 | procedure TOWClassPropertyEditor.Edit();
262 | begin
263 | end;
264 | //---------------------------------------------------------------------------
265 | procedure TOWClassPropertyEditor.Modified();
266 | begin
267 | if( FDesigner <> NIL ) then
268 | FDesigner.Modified();
269 |
270 | end;
271 | {$ENDIF}
272 | //---------------------------------------------------------------------------
273 | //---------------------------------------------------------------------------
274 | //---------------------------------------------------------------------------
275 | //---------------------------------------------------------------------------
276 | function TOWComponentEditor.GetIProperty( Comp : TComponent; AFilter: TTypeKinds; PropertyName : String ) : IProperty;
277 | var
278 | SelectionListI : IDesignerSelections;
279 | SelectionList : TOWDesignerSelectionList;
280 |
281 | begin
282 | LastIProp := NIL;
283 |
284 | if( Comp = NIL ) then
285 | Exit( NIL );
286 |
287 | if( PropertyName = '' ) then
288 | Exit( NIL );
289 |
290 | SelectionList := TOWDesignerSelectionList.Create();
291 | SelectionListI := SelectionList as IDesignerSelections;
292 | SelectionList.Add( Comp );
293 | FTargetProperty := PropertyName;
294 |
295 | GetComponentProperties( SelectionListI, AFilter, Designer, GetPropProc );
296 |
297 | Result := LastIProp;
298 | end;
299 | //---------------------------------------------------------------------------
300 | constructor TOWComponentEditor.Create(AComponent: TComponent; ADesigner: IDesigner);
301 | begin
302 | inherited;
303 | FMenuItems := TOWComponentEditorItems.Create();
304 | end;
305 | //---------------------------------------------------------------------------
306 | destructor TOWComponentEditor.Destroy();
307 | begin
308 | FMenuItems.Free();
309 | inherited;
310 | end;
311 | //---------------------------------------------------------------------------
312 | procedure TOWComponentEditor.AfterConstruction();
313 | begin
314 | inherited;
315 | InitMenu();
316 | end;
317 | //---------------------------------------------------------------------------
318 | procedure TOWComponentEditor.InitMenu();
319 | begin
320 | end;
321 | //---------------------------------------------------------------------------
322 | procedure TOWComponentEditor.EditProperty( PropertyName : String );
323 | begin
324 | EditProperty( tkProperties, PropertyName );
325 | end;
326 | //---------------------------------------------------------------------------
327 | procedure TOWComponentEditor.EditProperty( AFilter: TTypeKinds; PropertyName : String );
328 | var
329 | PropIProp : IProperty;
330 |
331 | begin
332 | PropIProp := GetIProperty( Component, AFilter, PropertyName );
333 | if( PropIProp <> NIL ) then
334 | PropIProp.Edit();
335 |
336 | end;
337 | //---------------------------------------------------------------------------
338 | procedure TOWComponentEditor.GetPropProc(const Prop: IProperty);
339 | begin
340 | if( Prop.GetName() = FTargetProperty ) then
341 | LastIProp := Prop;
342 |
343 | end;
344 | //---------------------------------------------------------------------------
345 | procedure TOWComponentEditor.AddMenuItem( AMenuText : String; ACallback : TOWComponentEditorEvent; AOnEnabledCallback : TOWComponentEditorEvabledEvent );
346 | begin
347 | FMenuItems.AddEnable( AMenuText, ACallback, AOnEnabledCallback, [], '' );
348 | end;
349 | //---------------------------------------------------------------------------
350 | procedure TOWComponentEditor.AddMenuItem( AMenuText : String; ACallback : TOWComponentEditorEvent );
351 | begin
352 | FMenuItems.Add( AMenuText, ACallback, [], '' );
353 | end;
354 | //---------------------------------------------------------------------------
355 | procedure TOWComponentEditor.AddMenuItem( AMenuText : String; APropertyName : String );
356 | begin
357 | AddMenuItem( AMenuText, tkProperties, APropertyName );
358 | end;
359 | //---------------------------------------------------------------------------
360 | procedure TOWComponentEditor.AddMenuItem( AMenuText : String; AFilter: TTypeKinds; APropertyName : String );
361 | begin
362 | FMenuItems.Add( AMenuText, NIL, AFilter, APropertyName );
363 | end;
364 | //---------------------------------------------------------------------------
365 | procedure TOWComponentEditor.ExecuteVerb(Index: Integer);
366 | begin
367 | if( Assigned( FMenuItems[ Index ].FCallback )) then
368 | FMenuItems[ Index ].FCallback()
369 |
370 | else
371 | EditProperty( FMenuItems[ Index ].FFilter, FMenuItems[ Index ].FPropertyName );
372 |
373 | end;
374 | //---------------------------------------------------------------------------
375 | function TOWComponentEditor.GetVerb(Index: Integer): String;
376 | var
377 | I : Integer;
378 |
379 | begin
380 | for I := 0 to FMenuItems.Count - 1 do
381 | if( not FMenuItems[ I ].GetEnabled() ) then
382 | Inc( Index );
383 |
384 | Result := FMenuItems[ Index ].FMenuText;
385 | end;
386 | //---------------------------------------------------------------------------
387 | function TOWComponentEditor.GetVerbCount() : Integer;
388 | var
389 | I : Integer;
390 |
391 | begin
392 | Result := 0;
393 | for I := 0 to FMenuItems.Count - 1 do
394 | if( FMenuItems[ I ].GetEnabled() ) then
395 | Inc( Result );
396 |
397 | end;
398 | //---------------------------------------------------------------------------
399 | //---------------------------------------------------------------------------
400 | //---------------------------------------------------------------------------
401 | //---------------------------------------------------------------------------
402 | constructor TOWComponentEditorItems.Create();
403 | begin
404 | inherited;
405 | FList := TObjectList.Create( True );
406 | end;
407 | //---------------------------------------------------------------------------
408 | destructor TOWComponentEditorItems.Destroy();
409 | begin
410 | FList.Free();
411 | inherited;
412 | end;
413 | //---------------------------------------------------------------------------
414 | function TOWComponentEditorItems.GetCount() : Integer;
415 | begin
416 | Result := FList.Count;
417 | end;
418 | //---------------------------------------------------------------------------
419 | function TOWComponentEditorItems.GetItem( AIndex : Integer ) : TOWComponentEditorItem;
420 | begin
421 | Result := TOWComponentEditorItem( FList[ AIndex ] );
422 | end;
423 | //---------------------------------------------------------------------------
424 | procedure TOWComponentEditorItems.SetItem( AIndex : Integer; AValue : TOWComponentEditorItem );
425 | begin
426 | FList[ AIndex ] := AValue;
427 | end;
428 | //---------------------------------------------------------------------------
429 | procedure TOWComponentEditorItems.Add( AMenuText : String; ACallback : TOWComponentEditorEvent; AFilter: TTypeKinds; APropertyName : String );
430 | begin
431 | FList.Add( TOWComponentEditorItem.Create( AMenuText, ACallback, NIL, AFilter, APropertyName ));
432 | end;
433 | //---------------------------------------------------------------------------
434 | procedure TOWComponentEditorItems.AddEnable( AMenuText : String; ACallback : TOWComponentEditorEvent; AOnEnabledCallback : TOWComponentEditorEvabledEvent; AFilter: TTypeKinds; APropertyName : String );
435 | begin
436 | FList.Add( TOWComponentEditorItem.Create( AMenuText, ACallback, AOnEnabledCallback, AFilter, APropertyName ));
437 | end;
438 | //---------------------------------------------------------------------------
439 | //---------------------------------------------------------------------------
440 | //---------------------------------------------------------------------------
441 | //---------------------------------------------------------------------------
442 | constructor TOWComponentEditorItem.Create( AMenuText : String; ACallback : TOWComponentEditorEvent; AOnEnabledCallback : TOWComponentEditorEvabledEvent; AFilter : TTypeKinds; APropertyName : String );
443 | begin
444 | inherited Create;
445 | FMenuText := AMenuText;
446 | FCallback := ACallback;
447 | FOnEnabledCallback := AOnEnabledCallback;
448 | FFilter := AFilter;
449 | FPropertyName := APropertyName;
450 | end;
451 | //---------------------------------------------------------------------------
452 | function TOWComponentEditorItem.GetEnabled() : Boolean;
453 | begin
454 | if( Assigned( FOnEnabledCallback )) then
455 | Result := FOnEnabledCallback()
456 |
457 | else
458 | Result := True;
459 |
460 | end;
461 | //---------------------------------------------------------------------------
462 | end.
463 |
464 |
--------------------------------------------------------------------------------
/OWDesignSelectionsList.pas:
--------------------------------------------------------------------------------
1 | unit OWDesignSelectionsList;
2 |
3 | REMOVED!
4 |
5 | interface
6 | uses
7 | {$IFDEF __VSDESIGN__}
8 | Mitov.Design
9 | {$ELSE}
10 | DesignIntf
11 | {$ENDIF}
12 | , Classes;
13 | { TOWDesignerSelectionList }
14 | { Used to transport VCL component selections between property editors }
15 | type
16 | TOWDesignerSelectionList = class(TInterfacedObject, IDesignerSelections)
17 | private
18 | FList: TList;
19 | { IDesignSelections }
20 | function IDesignerSelections.Add = Intf_Add;
21 | function Intf_Add(const Item: TPersistent): Integer;
22 | function IDesignerSelections.Equals = Intf_Equals;
23 | function Intf_Equals(const List: IDesignerSelections): Boolean;
24 | function IDesignerSelections.Get = Intf_Get;
25 | function Intf_Get(Index: Integer): TPersistent;
26 | function Get(Index: Integer): TPersistent;
27 | function GetCount: Integer;
28 | {$IFNDEF __VSDESIGN__}
29 | function GetDesignObject( Index : Integer ) : IDesignObject;
30 | {$ENDIF}
31 | { IComponentList }
32 | // function GetComponentList: TOWDesignerSelectionList;
33 | public
34 | constructor Create;
35 | destructor Destroy; override;
36 | function Add(Item: TPersistent): Integer;
37 | function ListEquals(List: TOWDesignerSelectionList): Boolean;
38 | property Count: Integer read GetCount;
39 | property Items[Index: Integer]: TPersistent read Get; default;
40 | end;
41 |
42 | implementation
43 |
44 | constructor TOWDesignerSelectionList.Create;
45 | begin
46 | inherited Create;
47 | FList := TList.Create;
48 | end;
49 |
50 | destructor TOWDesignerSelectionList.Destroy;
51 | begin
52 | FList.Free();
53 | inherited Destroy;
54 | end;
55 |
56 | function TOWDesignerSelectionList.Get(Index: Integer): TPersistent;
57 | begin
58 | Result := FList[Index];
59 | end;
60 |
61 | {$IFNDEF __VSDESIGN__}
62 | function TOWDesignerSelectionList.GetDesignObject( Index : Integer ) : IDesignObject;
63 | begin
64 | Result := IDesignObject( FList[Index] );
65 | end;
66 | {$ENDIF}
67 |
68 | function TOWDesignerSelectionList.GetCount: Integer;
69 | begin
70 | Result := FList.Count;
71 | end;
72 |
73 | function TOWDesignerSelectionList.Add(Item: TPersistent): Integer;
74 | begin
75 | Result := FList.Add(Item);
76 | end;
77 |
78 | function TOWDesignerSelectionList.ListEquals(List: TOWDesignerSelectionList): Boolean;
79 | begin
80 | Result := False;
81 | end;
82 |
83 | function TOWDesignerSelectionList.Intf_Add(const Item: TPersistent): Integer;
84 | begin
85 | Result := Add( Item );
86 | end;
87 |
88 | function TOWDesignerSelectionList.Intf_Equals(const List: IDesignerSelections): Boolean;
89 | begin
90 | Result := False;
91 | end;
92 |
93 | function TOWDesignerSelectionList.Intf_Get(Index: Integer): TPersistent;
94 | begin
95 | Result := TPersistent( FList[ Index ] );
96 | end;
97 |
98 | {
99 | function TOWDesignerSelectionList.GetComponentList: TOWDesignerSelectionList;
100 | begin
101 | Result := Self;
102 | end;
103 | }
104 |
105 | //---------------------------------------------------------------------------
106 | //---------------------------------------------------------------------------
107 | //---------------------------------------------------------------------------
108 | //---------------------------------------------------------------------------
109 |
110 | end.
111 |
112 |
113 |
--------------------------------------------------------------------------------
/OWDesignTypes.pas:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////////
2 | // //
3 | // This software is supplied under the terms of a license agreement or //
4 | // nondisclosure agreement with Mitov Software and may not be copied //
5 | // or disclosed except in accordance with the terms of that agreement. //
6 | // Copyright(c) 2002-2025 Mitov Software. All Rights Reserved. //
7 | // //
8 | ////////////////////////////////////////////////////////////////////////////////
9 |
10 | unit OWDesignTypes;
11 |
12 | {$IFDEF FPC}
13 | {$MODE DELPHI}{$H+}
14 | {$ENDIF}
15 |
16 | interface
17 |
18 | uses
19 | {$IFDEF FPC}
20 | LCLIntf, LMessages, LResources, PropEdits, ComponentEditors,
21 | {$ELSE}
22 | WinApi.Windows, Vcl.Graphics, Mitov.Containers.List,
23 |
24 | {$IFDEF __VSDESIGN__}
25 | Mitov.Design,
26 | {$ELSE}
27 | {$IFNDEF __DELPHI_DESIGN__}
28 | Mitov.Design,
29 | {$ELSE}
30 | DesignEditors,
31 | DesignIntf,
32 | System.TypInfo,
33 | {$ENDIF}
34 | {$ENDIF}
35 |
36 | {$ENDIF}
37 | Vcl.Forms, WinApi.Messages, System.Classes, OWPins, OWStdTypes, Mitov.Containers.Dictionary, Mitov.Utils,
38 | Mitov.Attributes, Mitov.Containers.Common;
39 |
40 | type TOWPropNameString = String;
41 | type TOWPropertyDesigner = IDesigner;
42 |
43 | type
44 | TOWEPinEntry = class( TBasicObject )
45 | public
46 | Pin : TOWBasicPin;
47 | PinName : String;
48 | OwnerName : String;
49 |
50 | SavedChecked : Boolean;
51 | Checked : Boolean;
52 |
53 | Dispatcher : TOWBasicStateDispatcher;
54 |
55 | end;
56 | //---------------------------------------------------------------------------
57 | TOWModulesColection = class( TStringArrayList )
58 | public
59 | procedure GetModules( const AFileName, AUnitName, AFormName, ADesignClass : String; ACoClasses : TStrings );
60 |
61 | end;
62 | //---------------------------------------------------------------------------
63 | {$IFNDEF __VSDESIGN__}
64 | {$IFDEF __DELPHI_DESIGN__}
65 | function OWCanAccessRootFromName( ADesigner : TOWPropertyDesigner; const ARootName : String ) : Boolean;
66 | procedure OWLinkAwaitsLinkingAllForms();
67 | procedure OWRequestDesignerRefresh();
68 | procedure OWGetPinValueList( ACollection : IPairCollection; AOwnerComponent : TComponent; APin : TOWPin; AFilterPins : Boolean );
69 | function OWGetMainDesignOwner( AComponent : TComponent ) : TComponent;
70 | procedure OWRequestRefreshEx( ADesigner : TOWPropertyDesigner );
71 | {$ENDIF}
72 | {$ENDIF}
73 | //---------------------------------------------------------------------------
74 | procedure OWRegisterStreamColorThickness( AStreamTypeID : TGUID; AColor : TColor; AThickness : Single );
75 | function OWGetStreamThicknessColorFromID( AStreamTypeID : TGUID; var Color : TColor; var Thickness : Single ) : Boolean;
76 | //---------------------------------------------------------------------------
77 | procedure Register;
78 | //---------------------------------------------------------------------------
79 | implementation
80 |
81 | uses
82 | System.SysUtils, Mitov.Threading,
83 | {$IFNDEF __VSDESIGN__}
84 | {$IFDEF __DELPHI_DESIGN__}
85 | ToolsAPI,
86 | {$ENDIF} // __DELPHI_DESIGN__
87 | {$ENDIF} // __VSDESIGN__
88 | System.Math, System.UITypes;
89 | //---------------------------------------------------------------------------
90 | {$IFDEF BCB}
91 | const
92 | SEPARATOR = '->';
93 | {$ELSE}
94 | const
95 | SEPARATOR = '.';
96 | {$ENDIF}
97 | //---------------------------------------------------------------------------
98 | {$IFNDEF __VSDESIGN__}
99 | {$IFDEF __DELPHI_DESIGN__}
100 | var
101 | InOppening : Boolean;
102 | {$ENDIF}
103 | {$ENDIF}
104 | //---------------------------------------------------------------------------
105 | procedure TOWModulesColection.GetModules( const AFileName, AUnitName, AFormName, ADesignClass : String; ACoClasses : TStrings );
106 | begin
107 | if( AFormName <> '' ) then
108 | Add( AFormName );
109 |
110 | end;
111 | //---------------------------------------------------------------------------
112 | //---------------------------------------------------------------------------
113 | //---------------------------------------------------------------------------
114 | //---------------------------------------------------------------------------
115 | {$IFNDEF __VSDESIGN__}
116 | {$IFDEF __DELPHI_DESIGN__}
117 | function OWCanAccessRootFromName( ADesigner : TOWPropertyDesigner; const ARootName : String ) : Boolean;
118 | begin
119 | var AComponent := ADesigner.GetComponent( ARootName + SEPARATOR + ARootName );
120 |
121 | Result := False;
122 | if( AComponent = NIL ) then
123 | begin
124 | AComponent := ADesigner.GetComponent( ARootName );
125 | if( AComponent = NIL ) then
126 | Exit;
127 |
128 | end;
129 |
130 | Result := ADesigner.IsComponentLinkable( AComponent );
131 | end;
132 | //---------------------------------------------------------------------------
133 | procedure OWLinkAwaitsLinkingAllForms();
134 | var
135 | AModule : IOTAModule;
136 | AModuleServices : IOTAModuleServices;
137 | AFormEditor : INTAFormEditor;
138 |
139 | begin
140 | if( not GPinsNeedRefresh ) then
141 | Exit;
142 |
143 | if( OWGetAllLinked() ) then
144 | Exit;
145 |
146 | InOppening := True;
147 | GPinsNeedRefresh := False;
148 |
149 | BorlandIDEServices.QueryInterface( IOTAModuleServices, AModuleServices );
150 |
151 | if( Assigned( AModuleServices )) then
152 | begin
153 | if( AModuleServices.CurrentModule.OwnerCount > 0 ) then
154 | begin
155 | var AProject : IOTAProject := AModuleServices.CurrentModule.Owners[ 0 ];
156 | for var ModuleIndex : Integer := 0 to AProject.GetModuleCount - 1 do
157 | begin
158 | if( AProject.GetModule( ModuleIndex ).GetFileName <> '' ) then
159 | begin
160 | try
161 | var AModuleFileExt := TypeString( ExtractFileExt( AProject.GetModule( ModuleIndex ).GetFileName() )).ToUpperCase();
162 | if( ( AModuleFileExt <> '.CPP' ) and ( AModuleFileExt <> '.PAS' ) and ( AModuleFileExt <> '.DFM' )) then
163 | Continue;
164 | {
165 | if( TypeString( ExtractFileExt( AProject.GetModule( ModuleIndex ).GetFileName ) ).ToUpperCase() = '.RES' ) then
166 | Continue;
167 |
168 | if( TypeString( ExtractFileExt( AProject.GetModule( ModuleIndex ).GetFileName )).ToUpperCase() = '.DCP' ) then
169 | Continue;
170 | }
171 |
172 | AProject.GetModule( ModuleIndex ).OpenModule.QueryInterface( IOTAModule, AModule );
173 | if( AProject.GetModule( ModuleIndex ).FormName = '' ) then
174 | Continue;
175 |
176 | for var I : Integer := 0 to AModule.GetModuleFileCount - 1 do
177 | begin
178 | AModule.GetModuleFileEditor( I ).QueryInterface( INTAFormEditor, AFormEditor );
179 | if( Assigned( AFormEditor )) then
180 | AFormEditor := NIL;
181 |
182 | end;
183 |
184 | finally
185 | end;
186 | end;
187 | end;
188 | end;
189 | end;
190 |
191 | InOppening := False;
192 | end;
193 | //---------------------------------------------------------------------------
194 | procedure OWRequestDesignerRefresh();
195 | begin
196 | if( InOppening ) then
197 | Exit;
198 |
199 | if( OWGetAllLinked() ) then
200 | Exit;
201 |
202 | if( GPinsNeedRefresh ) then
203 | Exit;
204 |
205 | GPinsNeedRefresh := True;
206 |
207 | MainThread.Execute( NIL, True, OWLinkAwaitsLinkingAllForms );
208 | end;
209 | //---------------------------------------------------------------------------
210 | procedure OWGetPinValueList( ACollection : IPairCollection; AOwnerComponent : TComponent; APin : TOWPin; AFilterPins : Boolean );
211 | var
212 | AFilters : TOWPinValueFilters;
213 |
214 | begin
215 | if( APin <> NIL ) then
216 | begin
217 | if( AFilterPins ) then
218 | AFilters := []
219 |
220 | else
221 | AFilters := [ pvoFullList, pvoExcludeDirectDependency ];
222 |
223 | if( GetMainOwnerComponent( APin.Owner ) <> AOwnerComponent ) then
224 | begin
225 | OWGetPinsValueListSingleRoot( ACollection, AOwnerComponent, APin, '.', AOwnerComponent.Name, AFilters );
226 | Exit;
227 | end;
228 |
229 | OWGetPinsValueListSingleRoot( ACollection, AOwnerComponent, APin, '.', '', AFilters );
230 | end;
231 |
232 | end;
233 | //---------------------------------------------------------------------------
234 | function OWGetMainDesignOwner( AComponent : TComponent ) : TComponent;
235 | begin
236 | if( AComponent.Owner = NIL ) then
237 | Exit( AComponent );
238 |
239 | Result := GetMainOwnerComponent( AComponent.Owner );
240 | end;
241 | //---------------------------------------------------------------------------
242 | procedure OWRequestRefreshEx( ADesigner : TOWPropertyDesigner );
243 | begin
244 | var AFormNamesObj := TOWModulesColection.Create();
245 | var AFormNames : IStringArrayList := AFormNamesObj;
246 |
247 | ADesigner.GetProjectModules( AFormNamesObj.GetModules );
248 | for var AName in AFormNames do
249 | OWCanAccessRootFromName( ADesigner, AName );
250 |
251 | OWRequestDesignerRefresh();
252 | end;
253 | //---------------------------------------------------------------------------
254 | {$ENDIF}
255 | {$ELSE}
256 | procedure OWResetObjectInspector( ADesigner : TOWPropertyDesigner );
257 | begin
258 | end;
259 | {$ENDIF}
260 | //---------------------------------------------------------------------------
261 | type
262 | TOWStreamInfoOWEditorExtention = class;
263 | //---------------------------------------------------------------------------
264 | IOWStreamInfoOWEditorExtention = interface( IOWStreamInfoExtention )
265 | ['{21C15026-CF32-4579-AE17-4EA6A065A7C5}']
266 |
267 | [Result : Weak]
268 | function GetInstance() : TOWStreamInfoOWEditorExtention;
269 |
270 | end;
271 | //---------------------------------------------------------------------------
272 | TOWStreamInfoOWEditorExtention = class( TOWStreamInfoExtention, IOWStreamInfoOWEditorExtention )
273 | protected
274 | FColor : TColor;
275 | FThickness : Single;
276 |
277 | protected
278 | [Result : Weak]
279 | function GetInstance() : TOWStreamInfoOWEditorExtention;
280 |
281 | public
282 | class function Create( const AExtentionId : TGUID; AColor : TColor; AThickness : Single ) : IOWStreamInfoOWEditorExtention;
283 |
284 | public
285 | constructor CreateObject( const AExtentionId : TGUID; AColor : TColor; AThickness : Single );
286 |
287 | public
288 | property Color : TColor read FColor;
289 | property Thickness : Single read FThickness;
290 |
291 | end;
292 | //---------------------------------------------------------------------------
293 | //---------------------------------------------------------------------------
294 | //---------------------------------------------------------------------------
295 | //---------------------------------------------------------------------------
296 | constructor TOWStreamInfoOWEditorExtention.CreateObject( const AExtentionId : TGUID; AColor : TColor; AThickness : Single );
297 | begin
298 | inherited CreateObject( AExtentionId );
299 | FColor := AColor;
300 | FThickness := AThickness;
301 | end;
302 | //---------------------------------------------------------------------------
303 | class function TOWStreamInfoOWEditorExtention.Create( const AExtentionId : TGUID; AColor : TColor; AThickness : Single ) : IOWStreamInfoOWEditorExtention;
304 | begin
305 | Result := CreateObject( AExtentionId, AColor, AThickness );
306 | end;
307 | //---------------------------------------------------------------------------
308 | function TOWStreamInfoOWEditorExtention.GetInstance() : TOWStreamInfoOWEditorExtention;
309 | begin
310 | Result := Self;
311 | end;
312 | //---------------------------------------------------------------------------
313 | //---------------------------------------------------------------------------
314 | //---------------------------------------------------------------------------
315 | //---------------------------------------------------------------------------
316 | procedure OWRegisterStreamColorThickness( AStreamTypeID : TGUID; AColor : TColor; AThickness : Single );
317 | begin
318 | OWRegisterStreamExtention( AStreamTypeID, TOWStreamInfoOWEditorExtention.Create( IOWStreamInfoOWEditorExtention, AColor, AThickness ) );
319 | end;
320 | //---------------------------------------------------------------------------
321 | function OWGetStreamThicknessColorFromID( AStreamTypeID : TGUID; var Color : TColor; var Thickness : Single ) : Boolean;
322 | var
323 | AExtentionIntf : IOWStreamInfoExtention;
324 |
325 | begin
326 | if( not OWGetStreamExtentionFromID( AStreamTypeID, IOWStreamInfoOWEditorExtention, AExtentionIntf )) then
327 | Exit( False );
328 |
329 | var AExtention : IOWStreamInfoOWEditorExtention := ( AExtentionIntf as IOWStreamInfoOWEditorExtention );
330 | Color := AExtention.GetInstance().Color;
331 | Thickness := AExtention.GetInstance().Thickness;
332 |
333 | Result := True;
334 | end;
335 | //---------------------------------------------------------------------------
336 | //---------------------------------------------------------------------------
337 | //---------------------------------------------------------------------------
338 | //---------------------------------------------------------------------------
339 | procedure Register;
340 | begin
341 | OWRegisterStreamColorThickness( IOWIntegerStream, TColors.Fuchsia, 1 );
342 | OWRegisterStreamColorThickness( IOWCardinalStream, TColors.Purple, 1 );
343 | OWRegisterStreamColorThickness( IOWInt64Stream, TColors.Fuchsia, 1.2 );
344 | OWRegisterStreamColorThickness( IOWUInt64Stream, TColors.Purple, 1.2 );
345 | OWRegisterStreamColorThickness( IOWFloatStream, TColors.Red, 1 );
346 | OWRegisterStreamColorThickness( IOWRealStream, TColors.Red, 1 );
347 | OWRegisterStreamColorThickness( IOWRealComplexStream, TColors.Aqua, 1 );
348 | OWRegisterStreamColorThickness( IOWFloatQuaternionStream, TColors.Fuchsia, 1.5 );
349 | OWRegisterStreamColorThickness( IOWFloatPoint3DStream, TColors.Azure, 1.5 );
350 | OWRegisterStreamColorThickness( IOWBoolStream, TColors.Blue, 1 );
351 | OWRegisterStreamColorThickness( IOWByteStream, TColors.Blue, 1.5 );
352 | OWRegisterStreamColorThickness( IOWCharStream, TColors.Teal, 1 );
353 | OWRegisterStreamColorThickness( IOWStringStream, TColors.Teal, 1.5 );
354 | OWRegisterStreamColorThickness( IOWStringListStream, TColors.Teal, 2 );
355 | OWRegisterStreamColorThickness( IOWColorStream, TColors.Navy, 1 );
356 | OWRegisterStreamColorThickness( IOWAlphaColorStream, TColors.Lightblue, 1 );
357 | OWRegisterStreamColorThickness( IOWRGBWColorStream, TColors.Darkblue, 1 );
358 | OWRegisterStreamColorThickness( IOWRGBWAlphaColorStream, TColors.Lightsteelblue, 1 );
359 | OWRegisterStreamColorThickness( IOWIntRangedStream, TColors.Fuchsia, 1 );
360 | OWRegisterStreamColorThickness( IOWInt64RangedStream, TColors.Fuchsia, 1 );
361 | OWRegisterStreamColorThickness( IOWRealRangedStream, TColors.Red, 1 );
362 | OWRegisterStreamColorThickness( IOWDateTimeStream, TColors.Yellow, 1 );
363 | OWRegisterStreamColorThickness( IOWDateTimeRangedStream, TColors.Yellow, 1 );
364 | OWRegisterStreamColorThickness( IOWStreamPersistStream, TColors.Lime, 2 );
365 | OWRegisterStreamColorThickness( IOWIntegerListStream, TColors.Fuchsia, 2.5 );
366 | OWRegisterStreamColorThickness( IOWInt64ListStream, TColors.Fuchsia, 2.5 );
367 | OWRegisterStreamColorThickness( IOWFloatListStream, TColors.Red, 2.5 );
368 | OWRegisterStreamColorThickness( IOWRealListStream, TColors.Red, 2.5 );
369 | OWRegisterStreamColorThickness( IOWClockStream, TColors.Orange, 1 );
370 | end;
371 |
372 | initialization
373 | {$IFNDEF __VSDESIGN__}
374 | {$IFDEF __DELPHI_DESIGN__}
375 | InOppening := False;
376 | {$ENDIF}
377 | {$ENDIF}
378 |
379 | end.
380 |
--------------------------------------------------------------------------------
/OWStateEditors.pas:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////////
2 | // //
3 | // This software is supplied under the terms of a license agreement or //
4 | // nondisclosure agreement with Mitov Software and may not be copied //
5 | // or disclosed except in accordance with the terms of that agreement. //
6 | // Copyright(c) 2002-2025 Mitov Software. All Rights Reserved. //
7 | // //
8 | ////////////////////////////////////////////////////////////////////////////////
9 |
10 | unit OWStateEditors;
11 |
12 | interface
13 |
14 | {$I Mitov.Definitions.inc}
15 |
16 | uses
17 | WinApi.Windows,
18 | WinApi.Messages, System.SysUtils, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ComCtrls,
19 | Vcl.ImgList, Vcl.StdCtrls, Vcl.ExtCtrls, Vcl.Buttons, OWPins, OWDesignTypes, Vcl.ActnList,
20 | System.Actions, System.ImageList, Mitov.Containers.List,
21 | Vcl.BaseImageCollection, Vcl.ImageCollection, Vcl.VirtualImageList,
22 | Mitov.BasicOKCancelFormUnit;
23 |
24 | type
25 | TOWStatePinForm = class( TMitov_BasicOKCancelForm )
26 | Panel3: TPanel;
27 | Panel4: TPanel;
28 | Label1: TLabel;
29 | FormsComboBox: TComboBox;
30 | Panel5: TPanel;
31 | LinksCountLabel: TLabel;
32 | StaticLabel: TLabel;
33 | ImageList1: TImageList;
34 | PinsImageList: TImageList;
35 | ActionList1: TActionList;
36 | RenameAction: TAction;
37 | ActionImageList: TImageList;
38 | TreeView: TTreeView;
39 | Panel6: TPanel;
40 | StatesImageList: TImageList;
41 | ImageCollection: TImageCollection;
42 | VirtualImageList: TVirtualImageList;
43 | AboutPanel: TPanel;
44 | Image1: TImage;
45 | RestoreButton: TButton;
46 | RenameButton: TButton;
47 | procedure Image1Click(Sender: TObject);
48 | procedure Image1MouseDown(Sender: TObject; Button: TMouseButton;
49 | Shift: TShiftState; X, Y: Integer);
50 | procedure Image1MouseUp(Sender: TObject; Button: TMouseButton;
51 | Shift: TShiftState; X, Y: Integer);
52 | procedure FormShow(Sender: TObject);
53 | procedure FormsComboBoxChange(Sender: TObject);
54 | procedure FormCreate(Sender: TObject);
55 | procedure FormDestroy(Sender: TObject);
56 | procedure TreeViewKeyPress(Sender: TObject; var Key: Char);
57 | procedure RestoreButtonClick(Sender: TObject);
58 | procedure TreeViewEditing(Sender: TObject; Node: TTreeNode;
59 | var AllowEdit: Boolean);
60 | procedure TreeViewEdited(Sender: TObject; Node: TTreeNode;
61 | var S: String);
62 | procedure ActionList1Update(Action: TBasicAction;
63 | var Handled: Boolean);
64 | procedure RenameActionExecute(Sender: TObject);
65 | procedure TreeViewAdvancedCustomDrawItem(Sender: TCustomTreeView;
66 | Node: TTreeNode; State: TCustomDrawState; Stage: TCustomDrawStage;
67 | var PaintImages, DefaultDraw: Boolean);
68 | procedure HeaderControlSectionResize(HeaderControl: THeaderControl;
69 | Section: THeaderSection);
70 | procedure TreeViewDblClick(Sender: TObject);
71 | procedure HeaderControlResize(Sender: TObject);
72 | procedure RenameActionUpdate(Sender: TObject);
73 | procedure TreeViewClick(Sender: TObject);
74 | procedure TreeViewCollapsed(Sender: TObject; Node: TTreeNode);
75 | procedure TreeViewExpanded(Sender: TObject; Node: TTreeNode);
76 |
77 | private
78 | FDesigner : TOWPropertyDesigner;
79 | FStatePin : TOWStatePin;
80 | FRoot : TComponent;
81 | FPinsList : IObjectOwnerArrayList;
82 | FListUpdating : Boolean;
83 |
84 | public
85 | AllSelected : Boolean;
86 |
87 | private
88 | procedure FillFormsInfo();
89 | procedure PopulateAll();
90 | procedure PopulateAllEntries();
91 | procedure PopulateForm( ARootComponent : TComponent );
92 | procedure UpdateLinksCount();
93 | function RootFromName( const ARootName : String ) : TComponent;
94 | procedure ClearData();
95 | procedure PopulateSingleForm( ACurrentRoot : TComponent; ARootComponent : TComponent; AOnlyConnected : Boolean; AFullPath : Boolean );
96 | procedure PopulateSingleFormEntries( ACurrentRoot : TComponent; ARootComponent : TComponent; AFullPath : Boolean );
97 | procedure PopulateSingleStateForm( ACurrentRoot : TComponent; ARootComponent : TComponent; AOnlyConnected : Boolean; AFullPath : Boolean );
98 | procedure PopulateSingleStateFormEntries( ACurrentRoot : TComponent; ARootComponent : TComponent; AFullPath : Boolean );
99 |
100 | function GetTreeItems() : TTreeNodes;
101 | procedure ChangeState( ANode : TTreeNode );
102 |
103 | function EntryFromPin( APin : TOWBasicPin ) : TOWEPinEntry;
104 | function EntryFromDispatcher( ADispatcher : TOWBasicStateDispatcher ) : TOWEPinEntry;
105 |
106 | public
107 | function ExecuteForState( ADesigner : TOWPropertyDesigner; AStatePin : TOWStatePin ): Integer; virtual;
108 |
109 | public
110 | property Items : TTreeNodes read GetTreeItems;
111 |
112 | end;
113 |
114 | function OWStatePinEdit( ADesigner : TOWPropertyDesigner; AStatePin : TOWStatePin ) : Boolean;
115 |
116 | implementation
117 |
118 | {$R *.DFM}
119 |
120 | uses
121 | System.Generics.Collections, Mitov.Containers.Common, Mitov.Containers.Dictionary,
122 | ToolsAPI,
123 | System.UITypes, OWAboutFormUnit, Mitov.Utils;
124 |
125 | {$IFDEF BCB}
126 | const
127 | SEPARATOR = '->';
128 | {$ELSE}
129 | const
130 | SEPARATOR = '.';
131 | {$ENDIF}
132 |
133 | const siNone : TImageIndex = 0;
134 | const siLinkPlus : TImageIndex = 0;
135 | const siLinkMinus : TImageIndex = 1;
136 | const siPinGreen : TImageIndex = 2;
137 | const siPinGreenSink : TImageIndex = 3;
138 | const siPinGreenSource : TImageIndex = 4;
139 | const siPinBlue : TImageIndex = 5;
140 | const siPinBlueSink : TImageIndex = 6;
141 | const siPinBlueSource : TImageIndex = 7;
142 | const siPinRed : TImageIndex = 8;
143 | const siPinRedSink : TImageIndex = 9;
144 | const siPinRedSource : TImageIndex = 10;
145 |
146 | const siRadioClear : TImageIndex = 1;
147 | const siRadioCheck : TImageIndex = 2;
148 | const siClear : TImageIndex = 3;
149 | const siCheck : TImageIndex = 4;
150 | const siDotLine : TImageIndex = 5;
151 | const siCrosForm : TImageIndex = 6;
152 | const siCrosFormMissing : TImageIndex = 7;
153 |
154 | var GOWStatePinEditorForm : TOWStatePinForm;
155 |
156 | //---------------------------------------------------------------------------
157 | //---------------------------------------------------------------------------
158 | //---------------------------------------------------------------------------
159 | //---------------------------------------------------------------------------
160 | procedure TOWStatePinForm.FillFormsInfo();
161 | begin
162 | var AFormNamesObj := TOWModulesColection.Create();
163 | var AFormNames : IStringArrayList := AFormNamesObj;
164 | //{$IFNDEF BDS2005_OR_2006_BUG}
165 | // Designer.GetProjectModules( AFormNames.GetModules );
166 |
167 | //{$ELSE}
168 | // Workaround for BDS 2005 and 2006 bug.
169 | var ACurProject := GetActiveProject();
170 |
171 | if( ACurProject <> NIL ) then
172 | for var I : Integer := 0 to ACurProject.GetModuleCount() - 1 do
173 | begin
174 | var AModuleInfo := ACurProject.GetModule( I );
175 | AFormNamesObj.GetModules( AModuleInfo.FileName, AModuleInfo.Name, AModuleInfo.FormName, AModuleInfo.DesignClass, NIL );
176 | end;
177 |
178 | //{$ENDIF}
179 |
180 | FormsComboBox.Items.Clear();
181 |
182 | if( AFormNames.Count = 0 ) then
183 | AFormNames.Add( FRoot.Name );
184 |
185 | for var AName in AFormNames do
186 | if( OWCanAccessRootFromName( FDesigner, AName ) ) then
187 | begin
188 | if( AName = FRoot.Name ) then
189 | begin
190 | FormsComboBox.Items.Add( AName + ' (Current)' );
191 | FormsComboBox.ItemIndex := FormsComboBox.Items.Count - 1;
192 | end
193 |
194 | else
195 | FormsComboBox.Items.Add( AName );
196 |
197 | end;
198 |
199 | if( AFormNames.Count > 1 ) then
200 | FormsComboBox.Items.Add( 'All forms' );
201 |
202 | PopulateAllEntries();
203 | if( AllSelected ) then
204 | FormsComboBox.ItemIndex := FormsComboBox.Items.Count - 1;
205 |
206 | FormsComboBoxChange( Self );
207 | end;
208 | //---------------------------------------------------------------------------
209 | procedure TOWStatePinForm.PopulateAll();
210 | begin
211 | ClearData();
212 | for var I : Integer := 0 to FormsComboBox.Items.Count - 2 do
213 | begin
214 | var ACurrentRoot : TComponent := RootFromName( FormsComboBox.Items.Strings[ I ] );
215 | PopulateSingleForm( NIL, ACurrentRoot, False, True );
216 | end;
217 |
218 | RootFromName( FRoot.Name );
219 | end;
220 | //---------------------------------------------------------------------------
221 | procedure TOWStatePinForm.PopulateAllEntries();
222 | begin
223 | FPinsList.Clear();
224 | for var I : Integer := 0 to FormsComboBox.Items.Count - 2 do
225 | begin
226 | var ACurrentRoot : TComponent := RootFromName( FormsComboBox.Items.Strings[ I ] );
227 | PopulateSingleFormEntries( NIL, ACurrentRoot, True );
228 | end;
229 |
230 | PopulateSingleFormEntries( NIL, FRoot, False );
231 | RootFromName( FRoot.Name );
232 | end;
233 | //---------------------------------------------------------------------------
234 | procedure TOWStatePinForm.PopulateForm( ARootComponent : TComponent );
235 | begin
236 | ClearData();
237 | PopulateSingleForm( ARootComponent, ARootComponent, False, False );
238 |
239 | for var I : Integer := 0 to FormsComboBox.Items.Count - 2 do
240 | begin
241 | var ACurrentRoot : TComponent := RootFromName( FormsComboBox.Items.Strings[ I ] );
242 | if( ARootComponent <> ACurrentRoot ) then
243 | PopulateSingleForm( ARootComponent, ACurrentRoot, True, True );
244 |
245 | end;
246 |
247 | end;
248 | //---------------------------------------------------------------------------
249 | procedure TOWStatePinForm.UpdateLinksCount();
250 | begin
251 | var ACounter : Integer := 0;
252 | var ACurItem := TreeView.Items.GetFirstNode();
253 | while ACurItem <> nil do
254 | begin
255 | if( ACurItem.StateIndex = siRadioCheck ) then
256 | begin
257 | if( ACurItem.Count = 0 ) then
258 | ACounter := 1
259 |
260 | else
261 | begin
262 | if( TOWEPinEntry( ACurItem.Data ).Dispatcher.IsConnectedTo( FStatePin ) )then
263 | ACounter := ACurItem.Count - 1
264 |
265 | else
266 | ACounter := ACurItem.Count;
267 |
268 | end;
269 |
270 | Break;
271 | end;
272 |
273 | ACurItem := ACurItem.GetNextSibling();
274 | end;
275 |
276 | LinksCountLabel.Caption := IntToStr( ACounter );
277 | end;
278 | //---------------------------------------------------------------------------
279 | function TOWStatePinForm.ExecuteForState( ADesigner : TOWPropertyDesigner; AStatePin : TOWStatePin ): Integer;
280 | begin
281 | FDesigner := ADesigner;
282 | FStatePin := AStatePin;
283 | FRoot := ADesigner.GetRoot();
284 |
285 | // LinkAllButton.Visible := True;
286 | // UnlinkAllButton.Visible := True;
287 |
288 | // ListView.Columns.Items[0].Caption := 'Sink pin';
289 | // ListView.Columns.Items[2].Caption := 'Connected to';
290 | Caption := 'Connections - State Pin : ' + OWValueToString( FStatePin, False, False );
291 |
292 | // ListView.StateImages := SourcesImageList;
293 | OWLinkAwaitsLinkingAllForms();
294 | Result := ShowModal();
295 | end;
296 | //---------------------------------------------------------------------------
297 | procedure TOWStatePinForm.Image1Click(Sender: TObject);
298 | begin
299 | AboutPanel.BevelInner := bvLowered;
300 | try
301 | var AForm := TSmartPointer.Create( TOWAboutForm.Create( Self ));
302 | AForm.ShowModal();
303 | finally
304 | AboutPanel.BevelInner := bvRaised;
305 | end;
306 |
307 | end;
308 | //---------------------------------------------------------------------------
309 | procedure TOWStatePinForm.Image1MouseDown(Sender: TObject;
310 | Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
311 | begin
312 | AboutPanel.BevelInner := bvLowered;
313 | end;
314 | //---------------------------------------------------------------------------
315 | procedure TOWStatePinForm.Image1MouseUp(Sender: TObject;
316 | Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
317 | begin
318 | AboutPanel.BevelInner := bvRaised;
319 | end;
320 | //---------------------------------------------------------------------------
321 | procedure TOWStatePinForm.FormShow(Sender: TObject);
322 | begin
323 | FillFormsInfo();
324 | UpdateLinksCount();
325 | end;
326 | //---------------------------------------------------------------------------
327 | procedure TOWStatePinForm.FormsComboBoxChange(Sender: TObject);
328 | var
329 | ASelectedRoot : TComponent;
330 |
331 | begin
332 | ASelectedRoot := NIL;
333 | AllSelected := False;
334 | if( FormsComboBox.Items.Count > 1 ) then
335 | if( FormsComboBox.ItemIndex = FormsComboBox.Items.Count - 1 ) then
336 | begin
337 | PopulateAll();
338 | AllSelected := True;
339 | Exit;
340 | end;
341 |
342 | if( FormsComboBox.ItemIndex <> -1 ) then
343 | begin
344 | var AFormName := FormsComboBox.Items.Strings[ FormsComboBox.ItemIndex ];
345 | ASelectedRoot := RootFromName( AFormName );
346 | end;
347 |
348 | PopulateForm( ASelectedRoot );
349 | end;
350 | //---------------------------------------------------------------------------
351 | function TOWStatePinForm.RootFromName( const ARootName : String ) : TComponent;
352 | begin
353 | var ARealName := ARootName;
354 | var APos := Pos( ' ', ARealName );
355 | if( APos > 0 ) then
356 | Delete( ARealName, APos, 10000 );
357 |
358 | Result := FDesigner.GetComponent( ARealName + SEPARATOR + ARealName );
359 |
360 | var CurrentComp := Result;
361 | if( CurrentComp <> NIL ) then
362 | while( CurrentComp.Owner <> NIL ) do
363 | begin
364 | if( Result is TDataModule ) then
365 | Break;
366 |
367 | if( ( CurrentComp.Owner is TCustomForm ) or ( CurrentComp.Owner is TDataModule ) ) then
368 | Result := CurrentComp.Owner;
369 |
370 | CurrentComp := CurrentComp.Owner
371 | end;
372 |
373 | if( Result = NIL ) then
374 | Result := FRoot;
375 |
376 | end;
377 | //---------------------------------------------------------------------------
378 | procedure TOWStatePinForm.ClearData();
379 | begin
380 | TreeView.Items.Clear();
381 | end;
382 | //---------------------------------------------------------------------------
383 | procedure TOWStatePinForm.PopulateSingleForm( ACurrentRoot : TComponent; ARootComponent : TComponent; AOnlyConnected : Boolean; AFullPath : Boolean );
384 | begin
385 | FListUpdating := True;
386 | try
387 | PopulateSingleStateForm( ACurrentRoot, ARootComponent, AOnlyConnected, AFullPath );
388 | finally
389 | FListUpdating := False;
390 | end;
391 |
392 | end;
393 | //---------------------------------------------------------------------------
394 | procedure TOWStatePinForm.PopulateSingleFormEntries( ACurrentRoot : TComponent; ARootComponent : TComponent; AFullPath : Boolean );
395 | begin
396 | PopulateSingleStateFormEntries( ACurrentRoot, ARootComponent, AFullPath )
397 | end;
398 | //---------------------------------------------------------------------------
399 | procedure TOWStatePinForm.PopulateSingleStateForm( ACurrentRoot : TComponent; ARootComponent : TComponent; AOnlyConnected : Boolean; AFullPath : Boolean );
400 | begin
401 | Items.BeginUpdate();
402 | try
403 | if( ARootComponent = NIL ) then
404 | ARootComponent := GetMainOwnerComponent( FStatePin.Owner );
405 |
406 | var ACollection : IArrayPairList := TArrayPairList.Create();
407 | OWGetPinValueList( ACollection.GetAsPairCollection(), ARootComponent, FStatePin, False );
408 | if( TreeView.Items.Count = 0 ) then
409 | begin // First form
410 | for var I : Integer := 0 to OWGetDispatcherCount() - 1 do
411 | begin
412 | var ADispatcher := OWGetDispatcher( I );
413 | if( not FStatePin.CanConnectToState( ADispatcher )) then
414 | Continue;
415 |
416 | var AEntry := EntryFromDispatcher( ADispatcher );
417 | var ANode := TreeView.Items.AddObject( NIL, ADispatcher.Name, AEntry );
418 | if( FStatePin.IsConnectedToState( ADispatcher )) then
419 | begin
420 | ANode.StateIndex := siRadioCheck;
421 | AEntry.SavedChecked := True;
422 | end
423 |
424 | else
425 | ANode.StateIndex := siRadioClear;
426 |
427 | ANode.ImageIndex := siLinkPlus;
428 | ANode.SelectedIndex := ANode.ImageIndex;
429 |
430 | for var J : Integer := 0 to ADispatcher.PinCount - 1 do
431 | begin
432 | var APin := ADispatcher.Pins[ J ];
433 | var APinName := APin.GetFullName( True );
434 | if( ACurrentRoot <> NIL ) then
435 | if( APin.GetRootName() = ACurrentRoot.Name ) then
436 | begin
437 | Delete( APinName, 1, Pos( '.', APinName ));
438 | // APinName := OWValueToString( ADispatcher.Pins[ J ], '.', False, False );
439 | end;
440 |
441 | var ASubNode := TreeView.Items.AddChildObject( ANode, APinName, EntryFromPin( APin ));
442 | if( APin.GetRootName() <> GetMainOwnerComponent( FStatePin.Owner ).Name ) then
443 | begin
444 | if( APin.GetIsRealPin() ) then
445 | ASubNode.StateIndex := siCrosForm
446 |
447 | else
448 | ASubNode.StateIndex := siCrosFormMissing;
449 |
450 | end
451 |
452 | else
453 | ASubNode.StateIndex := siDotLine;
454 |
455 | if( APin = FStatePin ) then
456 | ASubNode.ImageIndex := siPinRed
457 |
458 | else
459 | ASubNode.ImageIndex := siPinBlue;
460 |
461 | ASubNode.SelectedIndex := ASubNode.ImageIndex;
462 | end;
463 | {
464 | for J := 0 to ADispatcher.PinCount - 1 do
465 | begin
466 | if( OWGetMainOwnerComponent( ADispatcher.Pins[ J ].Owner ) <> ACurrentRoot ) then
467 | APinName := OWValueToString( ADispatcher.Pins[ J ], '.', True, False )
468 |
469 | else
470 | APinName := OWValueToString( ADispatcher.Pins[ J ], '.', False, False );
471 |
472 | ASubNode := TreeView.Items.AddChildObject( ANode, APinName, ADispatcher.Pins[ J ] );
473 | if( OWGetMainOwnerComponent( ADispatcher.Pins[ J ].Owner ) <> OWGetMainOwnerComponent( FStatePin.Owner ) ) then
474 | ASubNode.StateIndex := siCrosForm
475 |
476 | else
477 | ASubNode.StateIndex := siDotLine;
478 |
479 | if( ADispatcher.Pins[ J ] = FStatePin ) then
480 | ASubNode.ImageIndex := siPinRed
481 |
482 | else
483 | ASubNode.ImageIndex := siPinBlue;
484 |
485 | ASubNode.SelectedIndex := ASubNode.ImageIndex;
486 | end;
487 | }
488 | if( FStatePin.IsConnectedToState( ADispatcher )) then
489 | begin
490 | ANode.Expand( False );
491 | ANode.ImageIndex := siLinkMinus;
492 | ANode.SelectedIndex := ANode.ImageIndex;
493 | end;
494 | end;
495 | end;
496 |
497 | for var APair in ACollection do
498 | begin
499 | var AOtherPin := APair.Value;
500 | if( AOtherPin = FStatePin ) then
501 | Continue;
502 |
503 | var AEntry := EntryFromPin( AOtherPin );
504 | if( AOnlyConnected ) then
505 | begin
506 | if( AEntry <> NIL ) then
507 | begin
508 | if( not AEntry.Checked ) then
509 | Continue;
510 |
511 | end
512 |
513 | else
514 | if( not FStatePin.IsLinkedTo( APair.Key )) then
515 | Continue;
516 |
517 | end;
518 |
519 | if( not AOtherPin.IsStateConnected() ) then
520 | begin
521 | var ANode := TreeView.Items.AddObject( NIL, APair.Key, AEntry );
522 | ANode.StateIndex := siRadioClear;
523 | ANode.ImageIndex := siPinGreen;
524 | if( AOtherPin is TOWSinkPin ) then
525 | ANode.ImageIndex := ANode.ImageIndex + 1
526 |
527 | else if( AOtherPin is TOWSourcePin ) then
528 | ANode.ImageIndex := ANode.ImageIndex + 2;
529 |
530 | ANode.SelectedIndex := ANode.ImageIndex;
531 | // ANode := TreeView.Items.AddObject( NIL, OtherStatePin.Name, OtherStatePin );
532 | end;
533 |
534 | end;
535 |
536 | finally
537 | Items.EndUpdate();
538 | end;
539 |
540 | end;
541 | //---------------------------------------------------------------------------
542 | procedure TOWStatePinForm.PopulateSingleStateFormEntries( ACurrentRoot : TComponent; ARootComponent : TComponent; AFullPath : Boolean );
543 | var
544 | APair : TPair;
545 |
546 | begin
547 | if( ARootComponent = NIL ) then
548 | ARootComponent := GetMainOwnerComponent( FStatePin.Owner );
549 |
550 | for var I : Integer := 0 to OWGetDispatcherCount() - 1 do
551 | begin
552 | var ADispatcher := OWGetDispatcher( I );
553 | if( not FStatePin.CanConnectToState( ADispatcher )) then
554 | Continue;
555 |
556 | var AEntry := TOWEPinEntry.Create();
557 | FPinsList.Add( AEntry );
558 | AEntry.Dispatcher := ADispatcher;
559 | AEntry.PinName := ADispatcher.Name;
560 |
561 | // AEntry.CanConnect := True;
562 | for var J : Integer := 0 to ADispatcher.PinCount - 1 do
563 | begin
564 | var APin := ADispatcher.Pins[ J ];
565 | AEntry := TOWEPinEntry.Create();
566 | AEntry.Dispatcher := ADispatcher;
567 | AEntry.Pin := APin;
568 | AEntry.PinName := APin.GetName();
569 | FPinsList.Add( AEntry );
570 | end;
571 | end;
572 |
573 | var ACollection : IArrayPairList := TArrayPairList.Create();
574 | OWGetPinValueList( ACollection.GetAsPairCollection(), ARootComponent, FStatePin, False );
575 | for APair in ACollection do
576 | begin
577 | var AOtherPin := APair.Value;
578 |
579 | if( not AOtherPin.IsStateConnected() ) then
580 | begin
581 | var AEntry := TOWEPinEntry.Create();
582 | FPinsList.Add( AEntry );
583 |
584 | AEntry.Pin := AOtherPin;
585 | AEntry.PinName := AOtherPin.Name;
586 |
587 | // AEntry.CanConnect := True;
588 | end;
589 | end;
590 |
591 | end;
592 | //---------------------------------------------------------------------------
593 | function TOWStatePinForm.EntryFromPin( APin : TOWBasicPin ) : TOWEPinEntry;
594 | begin
595 | if( APin = NIL ) then
596 | Exit( NIL );
597 |
598 | for var AItem in FPinsList do
599 | if( AItem.Pin = APin ) then
600 | Exit( AItem );
601 |
602 | Result := NIL;
603 | end;
604 | //---------------------------------------------------------------------------
605 | function TOWStatePinForm.EntryFromDispatcher( ADispatcher : TOWBasicStateDispatcher ) : TOWEPinEntry;
606 | begin
607 | for var AItem in FPinsList do
608 | if( AItem.Dispatcher = ADispatcher ) then
609 | Exit( AItem );
610 |
611 | Result := NIL;
612 | end;
613 | //---------------------------------------------------------------------------
614 | function TOWStatePinForm.GetTreeItems() : TTreeNodes;
615 | begin
616 | Result := TreeView.Items;
617 | end;
618 | //---------------------------------------------------------------------------
619 | procedure TOWStatePinForm.FormCreate(Sender: TObject);
620 | begin
621 | FPinsList := TObjectOwnerArrayList.Create();
622 | // ColumnToSort := 0;
623 | // Direction := True;
624 | AllSelected := False;
625 | // Panel6.DoubleBuffered := True;
626 | // TreeView.DoubleBuffered := True;
627 | end;
628 | //---------------------------------------------------------------------------
629 | procedure TOWStatePinForm.FormDestroy(Sender: TObject);
630 | begin
631 | GOWStatePinEditorForm := NIL;
632 | end;
633 | //---------------------------------------------------------------------------
634 | procedure TOWStatePinForm.ChangeState( ANode : TTreeNode );
635 | begin
636 | if( ANode = NIL ) then
637 | Exit;
638 |
639 | if( ANode.Parent <> NIL ) then
640 | Exit;
641 |
642 | if( ANode.StateIndex = siRadioClear ) then
643 | begin
644 | ANode.StateIndex := siRadioCheck;
645 | var ACurItem := TreeView.Items.GetFirstNode();
646 | while ACurItem <> nil do
647 | begin
648 | if( ACurItem <> ANode ) then
649 | ACurItem.StateIndex := siRadioClear;
650 |
651 | ACurItem := ACurItem.GetNextSibling();
652 | end;
653 | end
654 |
655 | else
656 | ANode.StateIndex := siRadioClear;
657 |
658 | UpdateLinksCount();
659 | TreeView.Invalidate();
660 | end;
661 | //---------------------------------------------------------------------------
662 | procedure TOWStatePinForm.TreeViewKeyPress(Sender: TObject; var Key: Char);
663 | begin
664 | if( TreeView.IsEditing()) then
665 | Exit;
666 |
667 | if( Key = ' ' )then
668 | if( TreeView.Selected <> NIL ) then
669 | begin
670 | ChangeState( TreeView.Selected );
671 | Key := #0;
672 | end;
673 |
674 | end;
675 | //---------------------------------------------------------------------------
676 | procedure TOWStatePinForm.RestoreButtonClick(Sender: TObject);
677 | begin
678 | var ACurItem := GOWStatePinEditorForm.TreeView.Items.GetFirstNode();
679 | while ACurItem <> nil do
680 | begin
681 | var AEntry := TOWEPinEntry( ACurItem.Data );
682 | if( AEntry.SavedChecked ) then
683 | ACurItem.StateIndex := siRadioCheck
684 |
685 | else
686 | ACurItem.StateIndex := siRadioClear;
687 |
688 | ACurItem := ACurItem.GetNextSibling();
689 | end;
690 |
691 | UpdateLinksCount();
692 | end;
693 | //---------------------------------------------------------------------------
694 | procedure TOWStatePinForm.TreeViewEditing(Sender: TObject; Node: TTreeNode; var AllowEdit: Boolean);
695 | begin
696 | var AEntry := TOWEPinEntry( Node.Data );
697 | AllowEdit := ( AEntry.Dispatcher <> NIL );
698 | if( AllowEdit )then
699 | begin
700 | OkButton.Default := False;
701 | CancelButton.Cancel := False;
702 | TreeView.Repaint();
703 | end;
704 |
705 | end;
706 | //---------------------------------------------------------------------------
707 | procedure TOWStatePinForm.TreeViewEdited( Sender : TObject; Node : TTreeNode; var S : String );
708 | begin
709 | var AEntry := TOWEPinEntry( Node.Data );
710 | if( TOWStateDispatcher.IsUniqueName( S, True ) ) then
711 | AEntry.Dispatcher.Name := S
712 |
713 | else
714 | begin
715 | MessageDlg('Already existing name : ' + S, mtError, [ mbOK ], 0 );
716 | S := AEntry.Dispatcher.Name;
717 | end;
718 |
719 | OkButton.Default := True;
720 | CancelButton.Cancel := True;
721 | end;
722 | //---------------------------------------------------------------------------
723 | procedure TOWStatePinForm.ActionList1Update(Action: TBasicAction; var Handled: Boolean);
724 | begin
725 | if( TreeView.IsEditing() ) then
726 | begin
727 | OkButton.Default := False;
728 | CancelButton.Cancel := False;
729 | end
730 |
731 | else
732 | begin
733 | OkButton.Default := True;
734 | CancelButton.Cancel := True;
735 | end;
736 |
737 | end;
738 | //---------------------------------------------------------------------------
739 | procedure TOWStatePinForm.RenameActionExecute(Sender: TObject);
740 | begin
741 | if( TreeView.Selected <> NIL ) then
742 | begin
743 | TreeView.SetFocus();
744 | TreeView.Selected.EditText();
745 | end;
746 |
747 | end;
748 | //---------------------------------------------------------------------------
749 | procedure TOWStatePinForm.TreeViewAdvancedCustomDrawItem(
750 | Sender: TCustomTreeView; Node: TTreeNode; State: TCustomDrawState;
751 | Stage: TCustomDrawStage; var PaintImages, DefaultDraw: Boolean);
752 | begin
753 | if( Node = NIl ) then
754 | Exit;
755 |
756 | if( Stage = cdPrePaint ) then
757 | begin
758 | {
759 | if( cdsSelected in State ) then
760 | begin
761 | ANodeRect := Node.DisplayRect(True);
762 | ANodeRect.Right :=HeaderControl.Sections.Items[ 1 ].Right;
763 | Sender.Canvas.FillRect( ANodeRect );
764 | Sender.Canvas.Font.Style := [];
765 | // DefaultDraw := False;
766 | end;
767 | }
768 | end
769 |
770 | else if( Stage = cdPostPaint ) then
771 | begin
772 | // Exit;
773 | var ABegRect := Node.DisplayRect(True);
774 | var ANodeRect := ABegRect;
775 | // ANodeRect.Bottom := ANodeRect.Bottom - 1;
776 | // ANodeRect.Right :=HeaderControl.Sections.Items[ 1 ].Left;
777 | // if( ( not OkButton.Default ) and ( cdsFocused in State )) then
778 | // if( Sender.IsEditing()) then
779 | ANodeRect.Left := ABegRect.Right;
780 | // Sender.Canvas.FillRect( ANodeRect );
781 |
782 | // else
783 | // Sender.Canvas.TextRect( ANodeRect, ANodeRect.Left, ANodeRect.Top, Node.Text );
784 |
785 | // ANodeRect.Left := HeaderControl.Sections.Items[ 1 ].Left;
786 | // ANodeRect.Right :=HeaderControl.Sections.Items[ 1 ].Right;
787 | ANodeRect.Right := Sender.ClientRect.Right;
788 | var AEntry := TOWEPinEntry( Node.Data );
789 | {
790 | if( ( Node.Parent = NIL ) and ( AEntry <> NIL ) and ( AEntry.Dispatcher <> NIL )) then
791 | Sender.Canvas.TextRect( ANodeRect, ANodeRect.Left, ANodeRect.Top, IntToStr( AEntry.Dispatcher.PinCount ))
792 |
793 | else
794 | Sender.Canvas.FillRect( ANodeRect );
795 | }
796 | if( ( Node.Parent = NIL ) and ( AEntry <> NIL ) and ( AEntry.Dispatcher <> NIL )) then
797 | begin
798 | Sender.Canvas.Brush.Style := bsClear;
799 | Sender.Canvas.Font.Color := clWindowText;
800 | Sender.Canvas.TextOut( ANodeRect.Left + 10, ANodeRect.Top, '[ ' + IntToStr( AEntry.Dispatcher.PinCount ) + ' ]' );
801 | end;
802 |
803 | // else
804 | // Sender.Canvas.FillRect( ANodeRect );
805 |
806 | DefaultDraw := False;
807 | // ANodeRect.Left := HeaderControl.Sections.Items[ 1 ].Right;
808 |
809 | // Sender.Canvas.FillRect( ANodeRect );
810 | {
811 | if( cdsFocused in State ) then
812 | begin
813 | ANodeRect.Left := ABegRect.Left;
814 | Sender.Canvas.DrawFocusRect( ANodeRect );
815 | end;
816 | }
817 | // ShowMessage( 'Test' );
818 | end;
819 |
820 | end;
821 | //---------------------------------------------------------------------------
822 | procedure TOWStatePinForm.HeaderControlSectionResize(
823 | HeaderControl: THeaderControl; Section: THeaderSection);
824 | begin
825 | TreeView.Invalidate();
826 | end;
827 | //---------------------------------------------------------------------------
828 | procedure TOWStatePinForm.TreeViewDblClick(Sender: TObject);
829 | begin
830 | {
831 | var AMousePos := TreeView.ScreenToClient( Mouse.CursorPos );
832 | if( htOnIcon in TreeView.GetHitTestInfoAt( AMousePos.x, AMousePos.y ) ) then
833 | if( Node.Expanded ) then
834 | Node.Collapse( False )
835 |
836 | else
837 | Node.Expand( False );
838 | }
839 | {
840 | if( TreeView.Selected <> NIL ) then
841 | begin
842 | if( TreeView.Selected.Expanded ) then
843 | TreeView.Selected.Collapse( False )
844 |
845 | else
846 | TreeView.Selected.Expand( False );
847 |
848 | end;
849 | }
850 | end;
851 | //---------------------------------------------------------------------------
852 | procedure TOWStatePinForm.HeaderControlResize(Sender: TObject);
853 | begin
854 | TreeView.Invalidate();
855 | end;
856 | //---------------------------------------------------------------------------
857 | procedure TOWStatePinForm.RenameActionUpdate(Sender: TObject);
858 | begin
859 | if( TreeView.Selected <> NIL ) then
860 | if( TreeView.Selected.Parent = NIL ) then
861 | if( TreeView.Selected.Data <> NIL ) then
862 | if( TOWEPinEntry( TreeView.Selected.Data ).Dispatcher <> NIL ) then
863 | begin
864 | RenameAction.Enabled := True;
865 | Exit;
866 | end;
867 |
868 | RenameAction.Enabled := False;
869 | end;
870 | //---------------------------------------------------------------------------
871 | procedure TOWStatePinForm.TreeViewClick(Sender: TObject);
872 | begin
873 | var AMousePos := TreeView.ScreenToClient( Mouse.CursorPos );
874 | var ANode := TreeView.GetNodeAt( AMousePos.X, AMousePos.Y );
875 | var AHitTestRes : THitTests := TreeView.GetHitTestInfoAt( AMousePos.X, AMousePos.Y );
876 | if( ANode = NIL ) then
877 | Exit;
878 |
879 | if( htOnStateIcon in AHitTestRes ) then
880 | ChangeState( ANode )
881 |
882 | else if( htOnIcon in AHitTestRes ) then
883 | begin
884 | if( ANode.Expanded ) then
885 | ANode.Collapse( False )
886 |
887 | else
888 | ANode.Expand( False );
889 |
890 | end;
891 |
892 | end;
893 | //---------------------------------------------------------------------------
894 | procedure TOWStatePinForm.TreeViewCollapsed(Sender: TObject; Node: TTreeNode);
895 | begin
896 | if( Node.ImageIndex = siLinkMinus ) then
897 | begin
898 | Node.ImageIndex := siLinkPlus;
899 | Node.SelectedIndex := Node.ImageIndex;
900 | TreeView.Invalidate();
901 | end;
902 |
903 | end;
904 | //---------------------------------------------------------------------------
905 | procedure TOWStatePinForm.TreeViewExpanded(Sender: TObject; Node: TTreeNode);
906 | begin
907 | if( Node.ImageIndex = siLinkPlus ) then
908 | begin
909 | Node.ImageIndex := siLinkMinus;
910 | Node.SelectedIndex := Node.ImageIndex;
911 | TreeView.Invalidate();
912 | end;
913 |
914 | end;
915 | //---------------------------------------------------------------------------
916 | function OWStatePinEdit( ADesigner : TOWPropertyDesigner; AStatePin : TOWStatePin ) : Boolean;
917 | begin
918 | Result := False;
919 |
920 | var AStateChanged := False;
921 | if( AStatePin = NIL ) then
922 | Exit;
923 |
924 | if( GOWStatePinEditorForm.ExecuteForState( ADesigner, AStatePin ) = mrOk ) then
925 | begin
926 | var ACurItem := GOWStatePinEditorForm.TreeView.Items.GetFirstNode();
927 | while ACurItem <> nil do
928 | begin
929 | if( ACurItem.StateIndex = siRadioCheck ) then
930 | begin
931 | var AEntry := TOWEPinEntry( ACurItem.Data );
932 | if( AEntry.Dispatcher <> NIL ) then
933 | begin
934 | if( not AStatePin.IsConnectedToState( AEntry.Dispatcher ) ) then
935 | AStateChanged := True;
936 |
937 | end
938 |
939 | else
940 | AStateChanged := True;
941 |
942 | Break;
943 | end;
944 |
945 | ACurItem := ACurItem.GetNextSibling();
946 | end;
947 |
948 | if( ACurItem = NIL ) then
949 | AStateChanged := True;
950 |
951 | if( AStateChanged ) then
952 | if( AStatePin <> NIL ) then
953 | begin
954 | var AStateRoot : TComponent := OWGetMainDesignOwner( AStatePin.Owner );
955 | if( AStateRoot is TCustomForm ) then
956 | if( Assigned( TCustomForm( AStateRoot ).Designer )) then
957 | TCustomForm( AStateRoot ).Designer.Modified();
958 |
959 | end;
960 |
961 | if( not AStateChanged ) then
962 | Exit;
963 |
964 | AStatePin.Disconnect();
965 | ACurItem := GOWStatePinEditorForm.TreeView.Items.GetFirstNode();
966 | while ACurItem <> nil do
967 | begin
968 | if( ACurItem.StateIndex = siRadioCheck ) then
969 | begin
970 | var AEntry := TOWEPinEntry( ACurItem.Data );
971 | if( AEntry.Dispatcher <> NIL ) then
972 | AStatePin.ConnectToState( AEntry.Dispatcher )
973 |
974 | else if( AEntry.Pin <> NIL ) then
975 | AStatePin.Connect( AEntry.Pin );
976 |
977 | Break;
978 | end;
979 |
980 | ACurItem := ACurItem.GetNextSibling();
981 | end;
982 |
983 | Result := True;
984 | end;
985 |
986 | end;
987 | //---------------------------------------------------------------------------
988 | //---------------------------------------------------------------------------
989 | //---------------------------------------------------------------------------
990 | //---------------------------------------------------------------------------
991 | initialization
992 | GOWStatePinEditorForm := TOWStatePinForm.Create( Application );
993 |
994 | finalization
995 | if( GOWStatePinEditorForm <> NIL ) then
996 | {$IFDEF RX12_0_Up}
997 | GOWStatePinEditorForm.Free();
998 | {$ELSE}
999 | GOWStatePinEditorForm.DisposeOf();
1000 | {$ENDIF}
1001 |
1002 | GOWStatePinEditorForm := NIL;
1003 | end.
1004 |
--------------------------------------------------------------------------------
/OWStdTypes.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bmitov/OpenWire/ecda2b148c1f2761a20bcfedb1e37d98f6a4cc21/OWStdTypes.res
--------------------------------------------------------------------------------
/OpenWire.Delphi.PropertyEditors.pas:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////////
2 | // //
3 | // This software is supplied under the terms of a license agreement or //
4 | // nondisclosure agreement with Mitov Software and may not be copied //
5 | // or disclosed except in accordance with the terms of that agreement. //
6 | // Copyright(c) 2002-2025 Mitov Software. All Rights Reserved. //
7 | // //
8 | ////////////////////////////////////////////////////////////////////////////////
9 |
10 | unit OpenWire.Delphi.PropertyEditors;
11 |
12 | interface
13 |
14 | uses
15 | System.Classes, System.Types, Vcl.Graphics, DesignIntf, VCLEditors,
16 | Mitov.Design, OpenWirePinEditors, Mitov.TypeInfo, Mitov.Containers.List;
17 |
18 | type
19 | TOWPinListOwnerPropertyEditorProxy = class( OpenWirePinEditors.TOWPinListOwnerPropertyEditor, IInterface, IProperty, IPropertyKind, IProperty70, IInheritedPropertyEditor,
20 | ICustomPropertyDrawing, ICustomPropertyListDrawing, ICustomPropertyDrawing80
21 | )
22 |
23 | protected
24 | FNestedEditor : IPropertyEditor;
25 | FDesigner : IDesigner;
26 | FValueRect : TRect;
27 | HInGetValues : Boolean;
28 | FOwnerTypeInfo : ITypeInfo; // For chache speedup!
29 |
30 | protected
31 | function QueryInterface( const IID: TGUID; out Obj ): HResult; stdcall;
32 |
33 | protected
34 | procedure PropDrawName( ACanvas : TCanvas; const ARect : TRect; ASelected : Boolean );
35 | procedure PropDrawValue( ACanvas : TCanvas; const ARect : TRect; ASelected : Boolean );
36 |
37 | function PropDrawNameRect( const ARect : TRect ): TRect;
38 | function PropDrawValueRect( const ARect : TRect ): TRect;
39 |
40 | protected
41 | procedure ListMeasureWidth( const AValue : String; ACanvas : TCanvas; var AWidth : Integer );
42 | procedure ListMeasureHeight( const AValue : String; ACanvas : TCanvas; var AHeight : Integer );
43 | procedure ListDrawValue( const AValue : String; ACanvas : TCanvas; const ARect : TRect; ASelected : Boolean );
44 |
45 | public
46 | procedure Edit(); override;
47 | function GetAttributes() : TPropertyAttributes; override;
48 | procedure GetValues( AProc : TGetStrProc ); override;
49 | procedure Initialize(); override;
50 | function GetName(): String; override;
51 | function GetValue() : String; override;
52 | function GetValueW() : WideString; override;
53 | procedure SetValue( const AValue : String ); overload; override;
54 | procedure SetValue( const AValue : WideString ); overload; override;
55 | function GetParentStrings() : IStringArrayList;
56 | procedure SetParentString( const AValue : String );
57 | function ValueAvailable() : Boolean;
58 | procedure GetProperties( AProc : TGetPropProc ); override;
59 | function GetPropCount() : Integer;
60 | function GetDesigner() : DesignIntf.IDesigner;
61 | function GetNestedPropertyEditor( out APropertyEditor : IPropertyEditor ) : Boolean;
62 |
63 | end;
64 | //---------------------------------------------------------------------------
65 | procedure Register;
66 | //---------------------------------------------------------------------------
67 | implementation
68 |
69 | uses
70 | Winapi.ActiveX, Mitov.Delphi.PropertyEditors, OpenWire.Design;
71 |
72 | //---------------------------------------------------------------------------
73 | procedure TOWPinListOwnerPropertyEditorProxy.Initialize();
74 | begin
75 | inherited;
76 | InitializeEditor( FOwnerTypeInfo, Self, FNestedEditor );
77 | end;
78 | //---------------------------------------------------------------------------
79 | function TOWPinListOwnerPropertyEditorProxy.GetName(): String;
80 | begin
81 | Result := FNestedEditor.GetName();
82 | end;
83 | //---------------------------------------------------------------------------
84 | function TOWPinListOwnerPropertyEditorProxy.GetValue() : String;
85 | begin
86 | Result := FNestedEditor.GetStringValues()[ 0 ];
87 | end;
88 | //---------------------------------------------------------------------------
89 | function TOWPinListOwnerPropertyEditorProxy.GetValueW() : WideString;
90 | begin
91 | Result := FNestedEditor.GetStringValues()[ 0 ];
92 | end;
93 | //---------------------------------------------------------------------------
94 | procedure TOWPinListOwnerPropertyEditorProxy.SetValue( const AValue : String);
95 | begin
96 | FNestedEditor.SetStringValue( Value );
97 | end;
98 | //---------------------------------------------------------------------------
99 | procedure TOWPinListOwnerPropertyEditorProxy.SetValue( const AValue : WideString);
100 | begin
101 | FNestedEditor.SetStringValue( Value );
102 | end;
103 | //---------------------------------------------------------------------------
104 | function TOWPinListOwnerPropertyEditorProxy.GetParentStrings() : IStringArrayList;
105 | begin
106 | Result := TStringArrayList.Create();
107 | Result.Add( inherited GetValue());
108 | end;
109 | //---------------------------------------------------------------------------
110 | procedure TOWPinListOwnerPropertyEditorProxy.SetParentString( const AValue : String );
111 | begin
112 | inherited SetValue( AValue );
113 | end;
114 | //---------------------------------------------------------------------------
115 | function TOWPinListOwnerPropertyEditorProxy.ValueAvailable() : Boolean;
116 | begin
117 | Result := inherited;
118 | if( Result ) then
119 | Result := FNestedEditor.GetIsVisible();
120 |
121 | end;
122 | //---------------------------------------------------------------------------
123 | procedure TOWPinListOwnerPropertyEditorProxy.GetProperties( AProc : TGetPropProc );
124 | begin
125 | if( EditorGetProperties( FNestedEditor, Designer, AProc )) then
126 | Exit;
127 |
128 | inherited;
129 | end;
130 | //---------------------------------------------------------------------------
131 | function TOWPinListOwnerPropertyEditorProxy.GetPropCount() : Integer;
132 | begin
133 | Result := PropCount;
134 | end;
135 | //---------------------------------------------------------------------------
136 | function TOWPinListOwnerPropertyEditorProxy.GetDesigner() : DesignIntf.IDesigner;
137 | begin
138 | Result := Designer;
139 | end;
140 | //---------------------------------------------------------------------------
141 | function TOWPinListOwnerPropertyEditorProxy.GetNestedPropertyEditor( out APropertyEditor : IPropertyEditor ) : Boolean;
142 | begin
143 | APropertyEditor := FNestedEditor;
144 | Result := True;
145 | end;
146 | //---------------------------------------------------------------------------
147 | function TOWPinListOwnerPropertyEditorProxy.QueryInterface( const IID: TGUID; out Obj): HResult; stdcall;
148 | begin
149 | Result := EditorQueryInterface( FNestedEditor, IID, Obj);
150 | if( Succeeded( Result ) ) then
151 | Result := inherited QueryInterface( IID, Obj );
152 |
153 | end;
154 | //---------------------------------------------------------------------------
155 | procedure TOWPinListOwnerPropertyEditorProxy.PropDrawName( ACanvas : TCanvas; const ARect : TRect; ASelected : Boolean );
156 | begin
157 | EditorPropDrawName( Self, FNestedEditor, ACanvas, ARect, ASelected );
158 | end;
159 | //---------------------------------------------------------------------------
160 | procedure TOWPinListOwnerPropertyEditorProxy.PropDrawValue( ACanvas : TCanvas; const ARect : TRect; ASelected : Boolean );
161 | begin
162 | EditorPropDrawValue( Self, FNestedEditor, ACanvas, ARect, FValueRect, ASelected );
163 | end;
164 | //---------------------------------------------------------------------------
165 | function TOWPinListOwnerPropertyEditorProxy.PropDrawNameRect( const ARect : TRect ) : TRect;
166 | begin
167 | Result := EditorPropDrawNameRect( FNestedEditor, ARect );
168 | end;
169 | //---------------------------------------------------------------------------
170 | function TOWPinListOwnerPropertyEditorProxy.PropDrawValueRect( const ARect : TRect ) : TRect;
171 | begin
172 | FValueRect := ARect;
173 | Result := EditorPropDrawValueRect( FNestedEditor, ARect );
174 | end;
175 | //---------------------------------------------------------------------------
176 | procedure TOWPinListOwnerPropertyEditorProxy.ListMeasureWidth( const AValue : String; ACanvas : TCanvas; var AWidth: Integer );
177 | begin
178 | EditorListMeasureWidth( FNestedEditor, Value, ACanvas, AWidth );
179 | end;
180 | //---------------------------------------------------------------------------
181 | procedure TOWPinListOwnerPropertyEditorProxy.ListMeasureHeight( const AValue : String; ACanvas : TCanvas; var AHeight : Integer );
182 | begin
183 | EditorListMeasureHeight( FNestedEditor, Value, ACanvas, AHeight );
184 | end;
185 | //---------------------------------------------------------------------------
186 | procedure TOWPinListOwnerPropertyEditorProxy.ListDrawValue( const AValue : String; ACanvas : TCanvas; const ARect : TRect; ASelected : Boolean );
187 | begin
188 | EditorListDrawValue( FNestedEditor, Value, ACanvas, ARect, ASelected );
189 | end;
190 | //---------------------------------------------------------------------------
191 | procedure TOWPinListOwnerPropertyEditorProxy.Edit();
192 | begin
193 | if( CheckEditorDialog( Self, FNestedEditor )) then
194 | Exit;
195 |
196 | inherited;
197 | end;
198 | //---------------------------------------------------------------------------
199 | function TOWPinListOwnerPropertyEditorProxy.GetAttributes() : TPropertyAttributes;
200 | begin
201 | Result := inherited;
202 | CheckEditorAttributes( FNestedEditor, Result );
203 | end;
204 | //---------------------------------------------------------------------------
205 | procedure TOWPinListOwnerPropertyEditorProxy.GetValues( AProc : TGetStrProc );
206 | begin
207 | if( not HInGetValues ) then
208 | begin
209 | HInGetValues := True;
210 | try
211 | if( CheckEditorDropDownList( FNestedEditor, AProc )) then
212 | Exit;
213 |
214 | finally
215 | HInGetValues := False;
216 | end;
217 | end;
218 |
219 | inherited;
220 | end;
221 | //---------------------------------------------------------------------------
222 | //---------------------------------------------------------------------------
223 | //---------------------------------------------------------------------------
224 | //---------------------------------------------------------------------------
225 | procedure Register;
226 | begin
227 | RegisterEditorProxyAssociation( TOWPinListOwnerPropertyEditor, TOWPinListOwnerPropertyEditorProxy );
228 | end;
229 | //---------------------------------------------------------------------------
230 | //---------------------------------------------------------------------------
231 | //---------------------------------------------------------------------------
232 | //---------------------------------------------------------------------------
233 | end.
234 |
235 |
--------------------------------------------------------------------------------
/OpenWire.Design.pas:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////////
2 | // //
3 | // This software is supplied under the terms of a license agreement or //
4 | // nondisclosure agreement with Mitov Software and may not be copied //
5 | // or disclosed except in accordance with the terms of that agreement. //
6 | // Copyright(c) 2002-2025 Mitov Software. All Rights Reserved. //
7 | // //
8 | ////////////////////////////////////////////////////////////////////////////////
9 |
10 | unit OpenWire.Design;
11 |
12 | {$IFDEF __DELPHI_DESIGN__}
13 | {$DEFINE VCL_EDITORS}
14 | {$ELSE}
15 | {$IFNDEF __VSDESIGN__}
16 | {$DEFINE FORM_EDITORS}
17 | {$ENDIF}
18 | {$ENDIF}
19 |
20 | interface
21 |
22 | uses
23 | Mitov.Design, Mitov.Containers.List;
24 |
25 | type
26 | TOWPinListOwnerPropertyEditor = class( TSinglePropertyEditor )
27 | {$IFNDEF VCL_EDITORS}
28 | protected
29 | function GetStringValuesInternal( const AObjectsList : IObjectArrayList = NIL ) : IStringArrayList; override;
30 |
31 | public
32 | function GetDisplayValues( const AObjectsList : IObjectArrayList = NIL ) : IStringArrayList; override;
33 | procedure SetStringValue( const AValue : String ); override;
34 | {$ENDIF}
35 | end;
36 | //---------------------------------------------------------------------------
37 | {$IFDEF FORM_EDITORS}
38 | procedure Register;
39 | {$ENDIF}
40 | //---------------------------------------------------------------------------
41 | implementation
42 |
43 | uses
44 | System.SysUtils, System.Rtti, OWPins, Mitov.Utils;
45 |
46 | {$IFNDEF VCL_EDITORS}
47 | function TOWPinListOwnerPropertyEditor.GetDisplayValues( const AObjectsList : IObjectArrayList = NIL ) : IStringArrayList;
48 | begin
49 | Result := GetStringValues( AObjectsList );
50 | for var AValue in GetInstanceValues( AObjectsList ) do
51 | begin
52 | var ACount := AValue.AsType.Count;
53 | if( ACount = 1 ) then
54 | Result.Add( '1 Item' )
55 |
56 | else
57 | Result.Add( ACount.ToString() + ' Items' );
58 |
59 | end;
60 |
61 | end;
62 | //---------------------------------------------------------------------------
63 | function TOWPinListOwnerPropertyEditor.GetStringValuesInternal( const AObjectsList : IObjectArrayList = NIL ) : IStringArrayList;
64 | begin
65 | Result := TStringArrayList.Create();
66 | for var AValue in GetInstanceValues( AObjectsList ) do
67 | Result.Add( AValue.AsType.Count.ToString());
68 |
69 | end;
70 | //---------------------------------------------------------------------------
71 | procedure TOWPinListOwnerPropertyEditor.SetStringValue( const AValue : String );
72 | var
73 | AModification : IManagedSection;
74 |
75 | begin
76 | var APinList := GetInstanceValues()[ 0 ].AsType;
77 | var ANewValue := StrToIntDef( AValue, APinList.Count );
78 | if( ANewValue <> APinList.Count ) then
79 | begin
80 | AModification := BeginModify( False );
81 | APinList.Count := ANewValue;
82 | // Modified();
83 | end;
84 |
85 | end;
86 | {$ENDIF}
87 | //---------------------------------------------------------------------------
88 | //---------------------------------------------------------------------------
89 | //---------------------------------------------------------------------------
90 | //---------------------------------------------------------------------------
91 | {$IFDEF FORM_EDITORS}
92 | procedure Register;
93 | begin
94 | RegisterPropertyEditor( TypeInfo(TOWPin), NIL, '', THiddenEditor );
95 | RegisterPropertyEditor( TypeInfo(TOWPinList), NIL, '', THiddenEditor );
96 | RegisterPropertyEditor( TypeInfo(TOWPinListOwner), NIL, '', TOWPinListOwnerPropertyEditor );
97 | end;
98 | {$ENDIF}
99 | //---------------------------------------------------------------------------
100 | end.
101 |
--------------------------------------------------------------------------------
/OpenWire.TypeConverters.pas:
--------------------------------------------------------------------------------
1 | unit OpenWire.TypeConverters;
2 |
3 | interface
4 |
5 | uses
6 | OWPins, Mitov.Containers.List, Mitov.Containers.Dictionary, Mitov.Elements, Mitov.Containers.Common;
7 |
8 | type
9 | TOWTypeConverterEntry = class;
10 | //---------------------------------------------------------------------------
11 | IOWTypeConverterEntry = interface
12 | ['{C8A8135F-6D0F-45CE-AFB5-12A414F3DFA2}']
13 |
14 | [Result : Weak]
15 | function GetInstance() : TOWTypeConverterEntry;
16 |
17 | end;
18 | //---------------------------------------------------------------------------
19 | TOWTypeConverterEntry = class( TBasicInterfacedObject, IOWTypeConverterEntry )
20 | protected
21 | FInputID : TGUID;
22 | FOutputID : TGUID;
23 | FConverterClasses : IArrayList;
24 |
25 | protected
26 | function GetConverterClass() : TOWFormatConverterClass;
27 |
28 | protected
29 | [Result : Weak]
30 | function GetInstance() : TOWTypeConverterEntry;
31 |
32 | public
33 | property InputID : TGUID read FInputID;
34 | property OutputID : TGUID read FOutputID;
35 | property ConverterClass : TOWFormatConverterClass read GetConverterClass;
36 | property ConverterClasses : IArrayList read FConverterClasses;
37 |
38 | public
39 | procedure ReplaceConverterClass( AConverterClass : TOWFormatConverterClass );
40 |
41 | public
42 | constructor Create( const AInputID : TGUID; const AOutputID : TGUID; AConverterClass : TOWFormatConverterClass );
43 |
44 | end;
45 | //---------------------------------------------------------------------------
46 | procedure OWRegisterTypeConverter( const AInputID : TGUID; const AOutputID : TGUID; AConverterClass : TOWFormatConverterClass ); overload;
47 | procedure OWRegisterTypeConverter( AConverterClass : TOWFormatConverterClass ); overload;
48 | procedure OWRegisterTypeConverters( const AConverterClasses : TArray );
49 | function OWGetConverter( const AInputID : TGUID; const AOutputID : TGUID; out AConverterClass : TOWFormatConverterClass ) : Boolean;
50 | function OWCanConvert( const AInputID : TGUID; const AOutputID : TGUID ) : Boolean;
51 | function OWSetTypeConvertrsEnabled( AValue : Boolean ) : Boolean;
52 | //---------------------------------------------------------------------------
53 | procedure TypeConvertersInitGlobals();
54 | //---------------------------------------------------------------------------
55 | implementation
56 |
57 | uses
58 | Mitov.TypeInfo;
59 |
60 | type
61 | IOWTypeConverterEntryDictionary = interface( IDictionary, IOWTypeConverterEntry> )
62 | ['{C211D13D-DD5C-4F4D-AB8C-86BDC1C6F353}']
63 | end;
64 | //---------------------------------------------------------------------------
65 | TOWTypeConverterEntryDictionary = class( TDictionary, IOWTypeConverterEntry>, IOWTypeConverterEntryDictionary );
66 | //---------------------------------------------------------------------------
67 | var
68 | GOWConverterTypes : IOWTypeConverterEntryDictionary;
69 | GConvertersDisabled : Boolean;
70 | //---------------------------------------------------------------------------
71 | //---------------------------------------------------------------------------
72 | //---------------------------------------------------------------------------
73 | //---------------------------------------------------------------------------
74 | constructor TOWTypeConverterEntry.Create( const AInputID : TGUID; const AOutputID : TGUID; AConverterClass : TOWFormatConverterClass );
75 | begin
76 | inherited Create();
77 | FInputID := AInputID;
78 | FOutputID := AOutputID;
79 | FConverterClasses := TArrayList.Create();
80 | FConverterClasses.Add( AConverterClass );
81 | end;
82 | //---------------------------------------------------------------------------
83 | function TOWTypeConverterEntry.GetInstance() : TOWTypeConverterEntry;
84 | begin
85 | Result := Self;
86 | end;
87 | //---------------------------------------------------------------------------
88 | function TOWTypeConverterEntry.GetConverterClass() : TOWFormatConverterClass;
89 | begin
90 | Result := FConverterClasses[ 0 ];
91 | end;
92 | //---------------------------------------------------------------------------
93 | procedure TOWTypeConverterEntry.ReplaceConverterClass( AConverterClass : TOWFormatConverterClass );
94 | begin
95 | FConverterClasses.Insert( 0, AConverterClass );
96 | end;
97 | //---------------------------------------------------------------------------
98 | //---------------------------------------------------------------------------
99 | //---------------------------------------------------------------------------
100 | //---------------------------------------------------------------------------
101 | procedure TypeConvertersInitGlobals();
102 | begin
103 | if( GOWConverterTypes = NIL ) then
104 | GOWConverterTypes := TOWTypeConverterEntryDictionary.Create();
105 |
106 | end;
107 | //---------------------------------------------------------------------------
108 | //---------------------------------------------------------------------------
109 | //---------------------------------------------------------------------------
110 | //---------------------------------------------------------------------------
111 | function _OWGetTypeConverterEntry( const AInputID : TGUID; const AOutputID : TGUID; out AEntry : TOWTypeConverterEntry ) : Boolean;
112 | var
113 | AConverter : IOWTypeConverterEntry;
114 |
115 | begin
116 | if( GOWConverterTypes.GetValue( TRecTuple.Create( AInputID, AOutputID ), AConverter )) then
117 | begin
118 | AEntry := AConverter.GetInstance();
119 | Exit( True );
120 | end;
121 |
122 | AEntry := NIL;
123 | Result := False;
124 | end;
125 | //---------------------------------------------------------------------------
126 | procedure OWRegisterTypeConverter( const AInputID : TGUID; const AOutputID : TGUID; AConverterClass : TOWFormatConverterClass );
127 | var
128 | AEntry : TOWTypeConverterEntry;
129 |
130 | begin
131 | if( _OWGetTypeConverterEntry( AInputID, AOutputID, AEntry ) ) then
132 | AEntry.ReplaceConverterClass( AConverterClass )
133 |
134 | else
135 | GOWConverterTypes[ TRecTuple.Create(AInputID, AOutputID)] := TOWTypeConverterEntry.Create( AInputID, AOutputID, AConverterClass );
136 |
137 | end;
138 | //---------------------------------------------------------------------------
139 | procedure OWRegisterTypeConverter( AConverterClass : TOWFormatConverterClass );
140 | begin
141 | AConverterClass.ClassTypeInfo().AccessAttributes.GetAll.Query().ForEach(
142 | procedure( const AAttribute : OWConvertDataTypeAttribute )
143 | begin
144 | OWRegisterTypeConverter( AAttribute.FromDataType, AAttribute.ToDataType, AConverterClass );
145 | end
146 | );
147 |
148 | end;
149 | //---------------------------------------------------------------------------
150 | procedure OWRegisterTypeConverters( const AConverterClasses : TArray );
151 | begin
152 | for var AConverterClass in AConverterClasses do
153 | OWRegisterTypeConverter( AConverterClass );
154 |
155 | end;
156 | //---------------------------------------------------------------------------
157 | function OWGetConverter( const AInputID : TGUID; const AOutputID : TGUID; out AConverterClass : TOWFormatConverterClass ) : Boolean;
158 | var
159 | AEntry : TOWTypeConverterEntry;
160 |
161 | begin
162 | if( GConvertersDisabled ) then
163 | Exit( False );
164 |
165 | if( _OWGetTypeConverterEntry( AInputID, AOutputID, AEntry ) ) then
166 | begin
167 | AConverterClass := AEntry.ConverterClass;
168 | Exit( True );
169 | end;
170 |
171 | AConverterClass := NIL;
172 | Exit( False );
173 | end;
174 | //---------------------------------------------------------------------------
175 | function OWCanConvert( const AInputID : TGUID; const AOutputID : TGUID ) : Boolean;
176 | begin
177 | if( GConvertersDisabled ) then
178 | Exit( False );
179 |
180 | Result := GOWConverterTypes.ContainsKey( TRecTuple.Create( AInputID, AOutputID ));
181 | end;
182 | //---------------------------------------------------------------------------
183 | function OWSetTypeConvertrsEnabled( AValue : Boolean ) : Boolean;
184 | begin
185 | Result := not GConvertersDisabled;
186 | GConvertersDisabled := not AValue;
187 | end;
188 | //---------------------------------------------------------------------------
189 | //---------------------------------------------------------------------------
190 | //---------------------------------------------------------------------------
191 | //---------------------------------------------------------------------------
192 | procedure GModuleUnloadProc( AHInstance : NativeInt );
193 | begin
194 | GOWConverterTypes.RemoveAll(
195 | function( const AKey : TRecTuple; const AValue : IOWTypeConverterEntry ) : Boolean
196 | var
197 | ATypeConverterEntryList : IArrayList;
198 |
199 | begin
200 | ATypeConverterEntryList := AValue.GetInstance().ConverterClasses;
201 | ATypeConverterEntryList.RemoveAll(
202 | function( const AClass : TOWFormatConverterClass ) : Boolean
203 | begin
204 | Result := ( NativeInt( FindClassHInstance( AClass )) = AHInstance );
205 | end
206 | );
207 |
208 | Result := ( ATypeConverterEntryList.Count = 0 );
209 | end
210 | );
211 |
212 | end;
213 | //---------------------------------------------------------------------------
214 | //---------------------------------------------------------------------------
215 | //---------------------------------------------------------------------------
216 | //---------------------------------------------------------------------------
217 | initialization
218 | OWInitGlobals();
219 | AddModuleUnloadProc( GModuleUnloadProc );
220 |
221 | finalization
222 | RemoveModuleUnloadProc( GModuleUnloadProc );
223 | //---------------------------------------------------------------------------
224 |
225 | end.
226 |
--------------------------------------------------------------------------------
/OpenWireLabDemo/10.3/OpenWireLabPkg.dpk:
--------------------------------------------------------------------------------
1 | package OpenWireLabPkg;
2 |
3 | {$R *.res}
4 | {$R '..\OWLComps.dcr'}
5 | {$IFDEF IMPLICITBUILDING This IFDEF should not be used by users}
6 | {$ALIGN 8}
7 | {$ASSERTIONS ON}
8 | {$BOOLEVAL OFF}
9 | {$DEBUGINFO OFF}
10 | {$EXTENDEDSYNTAX ON}
11 | {$IMPORTEDDATA ON}
12 | {$IOCHECKS ON}
13 | {$LOCALSYMBOLS ON}
14 | {$LONGSTRINGS ON}
15 | {$OPENSTRINGS ON}
16 | {$OPTIMIZATION ON}
17 | {$OVERFLOWCHECKS OFF}
18 | {$RANGECHECKS OFF}
19 | {$REFERENCEINFO ON}
20 | {$SAFEDIVIDE OFF}
21 | {$STACKFRAMES OFF}
22 | {$TYPEDADDRESS OFF}
23 | {$VARSTRINGCHECKS ON}
24 | {$WRITEABLECONST OFF}
25 | {$MINENUMSIZE 1}
26 | {$IMAGEBASE $400000}
27 | {$ENDIF IMPLICITBUILDING}
28 | {$DESCRIPTION 'OpenWire DemoLab demonstration package'}
29 | {$LIBSUFFIX '260'}
30 | {$IMPLICITBUILD OFF}
31 |
32 | requires
33 | rtl,
34 | vcl,
35 | vclx,
36 | OpenWirePkg;
37 |
38 | contains
39 | OWLStateComps in '..\OWLStateComps.pas',
40 | OWLComps in '..\OWLComps.pas';
41 |
42 | end.
43 |
44 |
--------------------------------------------------------------------------------
/OpenWireLabDemo/10.3/OpenWireLabPkg.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bmitov/OpenWire/ecda2b148c1f2761a20bcfedb1e37d98f6a4cc21/OpenWireLabDemo/10.3/OpenWireLabPkg.res
--------------------------------------------------------------------------------
/OpenWireLabDemo/10.4/OpenWireLabPkg.dpk:
--------------------------------------------------------------------------------
1 | package OpenWireLabPkg;
2 |
3 | {$R *.res}
4 | {$R '..\OWLComps.dcr'}
5 | {$IFDEF IMPLICITBUILDING This IFDEF should not be used by users}
6 | {$ALIGN 8}
7 | {$ASSERTIONS ON}
8 | {$BOOLEVAL OFF}
9 | {$DEBUGINFO OFF}
10 | {$EXTENDEDSYNTAX ON}
11 | {$IMPORTEDDATA ON}
12 | {$IOCHECKS ON}
13 | {$LOCALSYMBOLS ON}
14 | {$LONGSTRINGS ON}
15 | {$OPENSTRINGS ON}
16 | {$OPTIMIZATION ON}
17 | {$OVERFLOWCHECKS OFF}
18 | {$RANGECHECKS OFF}
19 | {$REFERENCEINFO ON}
20 | {$SAFEDIVIDE OFF}
21 | {$STACKFRAMES OFF}
22 | {$TYPEDADDRESS OFF}
23 | {$VARSTRINGCHECKS ON}
24 | {$WRITEABLECONST OFF}
25 | {$MINENUMSIZE 1}
26 | {$IMAGEBASE $400000}
27 | {$ENDIF IMPLICITBUILDING}
28 | {$DESCRIPTION 'OpenWire DemoLab demonstration package'}
29 | {$LIBSUFFIX '270'}
30 | {$IMPLICITBUILD OFF}
31 |
32 | requires
33 | rtl,
34 | vcl,
35 | vclx,
36 | OpenWirePkg;
37 |
38 | contains
39 | OWLStateComps in '..\OWLStateComps.pas',
40 | OWLComps in '..\OWLComps.pas';
41 |
42 | end.
43 |
44 |
--------------------------------------------------------------------------------
/OpenWireLabDemo/10.4/OpenWireLabPkg.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bmitov/OpenWire/ecda2b148c1f2761a20bcfedb1e37d98f6a4cc21/OpenWireLabDemo/10.4/OpenWireLabPkg.res
--------------------------------------------------------------------------------
/OpenWireLabDemo/11.0/OpenWireLabPkg.dpk:
--------------------------------------------------------------------------------
1 | package OpenWireLabPkg;
2 |
3 | {$R *.res}
4 | {$R '..\OWLComps.dcr'}
5 | {$IFDEF IMPLICITBUILDING This IFDEF should not be used by users}
6 | {$ALIGN 8}
7 | {$ASSERTIONS ON}
8 | {$BOOLEVAL OFF}
9 | {$DEBUGINFO OFF}
10 | {$EXTENDEDSYNTAX ON}
11 | {$IMPORTEDDATA ON}
12 | {$IOCHECKS ON}
13 | {$LOCALSYMBOLS ON}
14 | {$LONGSTRINGS ON}
15 | {$OPENSTRINGS ON}
16 | {$OPTIMIZATION ON}
17 | {$OVERFLOWCHECKS ON}
18 | {$RANGECHECKS ON}
19 | {$REFERENCEINFO ON}
20 | {$SAFEDIVIDE OFF}
21 | {$STACKFRAMES OFF}
22 | {$TYPEDADDRESS OFF}
23 | {$VARSTRINGCHECKS ON}
24 | {$WRITEABLECONST OFF}
25 | {$MINENUMSIZE 1}
26 | {$IMAGEBASE $400000}
27 | {$ENDIF IMPLICITBUILDING}
28 | {$DESCRIPTION 'OpenWire DemoLab demonstration package'}
29 | {$LIBSUFFIX AUTO}
30 | {$IMPLICITBUILD OFF}
31 |
32 | requires
33 | rtl,
34 | vcl,
35 | vclx,
36 | OpenWirePkg;
37 |
38 | contains
39 | OWLStateComps in '..\OWLStateComps.pas',
40 | OWLComps in '..\OWLComps.pas';
41 |
42 | end.
43 |
44 |
--------------------------------------------------------------------------------
/OpenWireLabDemo/11.0/OpenWireLabPkg.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bmitov/OpenWire/ecda2b148c1f2761a20bcfedb1e37d98f6a4cc21/OpenWireLabDemo/11.0/OpenWireLabPkg.res
--------------------------------------------------------------------------------
/OpenWireLabDemo/12.0/OpenWireLabPkg.dpk:
--------------------------------------------------------------------------------
1 | package OpenWireLabPkg;
2 |
3 | {$R *.res}
4 | {$R '..\OWLComps.dcr'}
5 | {$IFDEF IMPLICITBUILDING This IFDEF should not be used by users}
6 | {$ALIGN 8}
7 | {$ASSERTIONS ON}
8 | {$BOOLEVAL OFF}
9 | {$DEBUGINFO OFF}
10 | {$EXTENDEDSYNTAX ON}
11 | {$IMPORTEDDATA ON}
12 | {$IOCHECKS ON}
13 | {$LOCALSYMBOLS ON}
14 | {$LONGSTRINGS ON}
15 | {$OPENSTRINGS ON}
16 | {$OPTIMIZATION ON}
17 | {$OVERFLOWCHECKS ON}
18 | {$RANGECHECKS ON}
19 | {$REFERENCEINFO ON}
20 | {$SAFEDIVIDE OFF}
21 | {$STACKFRAMES OFF}
22 | {$TYPEDADDRESS OFF}
23 | {$VARSTRINGCHECKS ON}
24 | {$WRITEABLECONST OFF}
25 | {$MINENUMSIZE 1}
26 | {$IMAGEBASE $400000}
27 | {$ENDIF IMPLICITBUILDING}
28 | {$DESCRIPTION 'OpenWire DemoLab demonstration package'}
29 | {$LIBSUFFIX AUTO}
30 | {$IMPLICITBUILD OFF}
31 |
32 | requires
33 | rtl,
34 | vcl,
35 | vclx,
36 | OpenWirePkg;
37 |
38 | contains
39 | OWLStateComps in '..\OWLStateComps.pas',
40 | OWLComps in '..\OWLComps.pas';
41 |
42 | end.
43 |
44 |
--------------------------------------------------------------------------------
/OpenWireLabDemo/12.0/OpenWireLabPkg.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bmitov/OpenWire/ecda2b148c1f2761a20bcfedb1e37d98f6a4cc21/OpenWireLabDemo/12.0/OpenWireLabPkg.res
--------------------------------------------------------------------------------
/OpenWireLabDemo/OWLComps.dcr:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bmitov/OpenWire/ecda2b148c1f2761a20bcfedb1e37d98f6a4cc21/OpenWireLabDemo/OWLComps.dcr
--------------------------------------------------------------------------------
/OpenWireLabDemo/OWLComps.pas:
--------------------------------------------------------------------------------
1 | // OpenWire demo components.
2 | // The package is not designed for a real usage, but to demonstrate the power of OpenWire,
3 | // however the components are fully implemented and can be used in a real application.
4 |
5 | {$IFNDEF FMX}
6 | unit OWLComps;
7 | {$ENDIF}
8 |
9 | {$IFDEF FPC}
10 | {$MODE DELPHI}{$H+}
11 | {$ENDIF}
12 |
13 | interface
14 |
15 | uses
16 | System.Classes, System.SysUtils,
17 | {$IFDEF FMX}
18 | FMX.Types, FMX.Controls,
19 | {$ELSE}
20 | Vcl.Controls, Vcl.Forms, Vcl.StdCtrls, Vcl.ExtCtrls,
21 | {$ENDIF}
22 | OWStdTypes, OWPins;
23 |
24 | type PSingle = ^Single;
25 |
26 | type
27 | TOWLAdd = class( TComponent )
28 | protected // OpenWire support
29 | FOutputPin : TOWFloatSourcePin;
30 | FPositiveInputPins : TOWPinListOwner;
31 | FNegativeInputPins : TOWPinListOwner;
32 |
33 | private
34 | FPositiveDataArray : TArray;
35 | FNegativeDataArray : TArray;
36 |
37 | protected
38 | function PinNotification( AOtherPin : TOWBasicPin; const AHandler : IOWDataStream; const ADataTypeID : TGUID; const AOperation : IOWNotifyOperation; AState : TOWNotifyState; var AHandled : Boolean ) : TOWNotifyResult;
39 |
40 | function CreatePositivePin( APinListOwner : TOWPinList; const AOnCreated : TProc ) : TOWPin;
41 | function CreateNegativePin( APinListOwner : TOWPinList; const AOnCreated : TProc ) : TOWPin;
42 |
43 | procedure DestroyPositivePin( APinListOwner : TOWPinList; APin : TOWBasicPin );
44 | procedure DestroyNegativePin( APinListOwner : TOWPinList; APin : TOWBasicPin );
45 |
46 | public
47 | constructor Create(AOwner : TComponent); override;
48 | destructor Destroy(); override;
49 |
50 | published // OpenWire support
51 | property OutputPin : TOWFloatSourcePin read FOutputPin write FOutputPin;
52 | property PositiveInputPins : TOWPinListOwner read FPositiveInputPins write FPositiveInputPins;
53 | property NegativeInputPins : TOWPinListOwner read FNegativeInputPins write FNegativeInputPins;
54 |
55 | end;
56 |
57 | TOWLTestClock = class( TTimer )
58 | protected // OpenWire support
59 | FOutputPin : TOWFloatSourcePin;
60 |
61 | protected
62 | FCounter : Single;
63 | FStep : Single;
64 | FMax : Single;
65 | FMin : Single;
66 | FStartReported : Boolean;
67 |
68 | protected
69 | {$IFDEF FPC}
70 | procedure DoOnTimer; override;
71 | {$ELSE}
72 | {$IFDEF FMX}
73 | procedure DoOnTimer; override;
74 | {$ELSE}
75 | procedure Timer; override;
76 | {$ENDIF}
77 | {$ENDIF}
78 | procedure Loaded; override;
79 |
80 | procedure STestClockComponentTimer( ASender : TObject );
81 |
82 | protected
83 | procedure SetMax( Value : Single );
84 | procedure SetMin( Value : Single );
85 |
86 | public
87 | constructor Create(AOwner : TComponent); override;
88 | destructor Destroy(); override;
89 |
90 | published // OpenWire support
91 | property OutputPin : TOWFloatSourcePin read FOutputPin write FOutputPin;
92 |
93 | published
94 | property Step : Single read FStep write FStep;
95 | property Max : Single read FMax write SetMax;
96 | property Min : Single read FMin write SetMin;
97 |
98 | end;
99 |
100 | type
101 | TOWLMultiply = class( TComponent )
102 | protected // OpenWire support
103 | FOutputPin : TOWFloatSourcePin;
104 | FInputPins : TOWPinListOwner;
105 |
106 | private
107 | FInputDataArray : TArray;
108 |
109 | protected
110 | function PinNotification( AOtherPin : TOWBasicPin; const AHandler : IOWDataStream; const ADataTypeID : TGUID; const AOperation : IOWNotifyOperation; AState : TOWNotifyState; var AHandled : Boolean ) : TOWNotifyResult;
111 |
112 | function CreateInputPin( APinListOwner : TOWPinList; const AOnCreated : TProc ) : TOWPin;
113 | procedure DestroyInputPin( APinListOwner : TOWPinList; APin : TOWBasicPin );
114 |
115 | public
116 | constructor Create(AOwner : TComponent); override;
117 | destructor Destroy(); override;
118 |
119 | published // OpenWire support
120 | property OutputPin : TOWFloatSourcePin read FOutputPin write FOutputPin;
121 | property InputPins : TOWPinListOwner read FInputPins write FInputPins;
122 |
123 | end;
124 |
125 | type
126 | TOWLDivide = class( TComponent )
127 | private
128 | FDivisible : Single;
129 | FDivider : Single;
130 |
131 | protected
132 | FOutputPin : TOWFloatSourcePin;
133 | FDivisibleInputPin : TOWFloatSinkPin;
134 | FDividerInputPin : TOWFloatSinkPin;
135 |
136 | protected
137 | procedure SendDivisibleData( ASender : TOWPin; const AValue : Single; AOnConnect : Boolean );
138 | procedure SendDividerData( ASender : TOWPin; const AValue : Single; AOnConnect : Boolean );
139 | function PinNotification( AOtherPin : TOWBasicPin; const AHandler : IOWDataStream; const ADataTypeID : TGUID; const AOperation : IOWNotifyOperation; AState : TOWNotifyState; var AHandled : Boolean ) : TOWNotifyResult;
140 |
141 | public
142 | constructor Create(AOwner : TComponent); override;
143 | destructor Destroy(); override;
144 |
145 | published // OpenWire support
146 | property OutputPin : TOWFloatSourcePin read FOutputPin write FOutputPin;
147 | property DivisibleInputPin : TOWFloatSinkPin read FDivisibleInputPin write FDivisibleInputPin;
148 | property DividerInputPin : TOWFloatSinkPin read FDividerInputPin write FDividerInputPin;
149 |
150 | end;
151 |
152 | type
153 | TOWLLabel = class( TLabel )
154 | protected
155 | FInputPin : TOWFloatSinkPin;
156 |
157 | protected
158 | procedure PinValueChange( ASender : TOWPin; const AValue : Single; AOnConnect : Boolean );
159 |
160 | public
161 | constructor Create(AOwner : TComponent); override;
162 | destructor Destroy(); override;
163 |
164 | published
165 | property InputPin : TOWFloatSinkPin read FInputPin write FInputPin;
166 |
167 | end;
168 |
169 | procedure Register;
170 | //---------------------------------------------------------------------------
171 | implementation
172 |
173 |
174 | //---------------------------------------------------------------------------
175 | constructor TOWLAdd.Create( AOwner : TComponent );
176 | begin
177 | inherited;
178 | TOWFloatSourcePin.CreateEx( TOWPin.PinOwnerSetter( FOutputPin, Self, Self ), NIL, PinNotification );
179 | TOWPinListOwner.CreateEx( TOWPinList.PinListOwnerSetter( FPositiveInputPins, Self, Self ), NIL, 1, [pcSink], 1, 100, CreatePositivePin, DestroyPositivePin );
180 | TOWPinListOwner.CreateEx( TOWPinList.PinListOwnerSetter( FNegativeInputPins, Self, Self ), NIL, 1, [pcSink], 1, 100, CreateNegativePin, DestroyNegativePin );
181 | end;
182 | //---------------------------------------------------------------------------
183 | destructor TOWLAdd.Destroy();
184 | begin
185 | FNegativeInputPins.Free();
186 | FPositiveInputPins.Free();
187 | FOutputPin.Free();
188 | inherited;
189 | end;
190 | //---------------------------------------------------------------------------
191 | function TOWLAdd.CreatePositivePin( APinListOwner : TOWPinList; const AOnCreated : TProc ) : TOWPin;
192 | begin
193 | SetLength( FPositiveDataArray, APinListOwner.Count + 1 );
194 | FPositiveDataArray[ APinListOwner.Count ] := 0.0;
195 |
196 | var APin := TOWFloatSinkPin.Create( TOWPin.PinListAddSetter( APinListOwner ), NIL,
197 | procedure( ASender : TOWPin; const AValue : Single; AOnConnect : Boolean )
198 | begin
199 | FPositiveDataArray[ APinListOwner.IndexOf( ASender ) ] := AValue;
200 | FOutputPin.Notify( TOWNotifyOperation.Make() );
201 | end
202 | );
203 |
204 | FOutputPin.FunctionSources.Add( APin );
205 | Result := APin;
206 | end;
207 | //---------------------------------------------------------------------------
208 | function TOWLAdd.CreateNegativePin( APinListOwner : TOWPinList; const AOnCreated : TProc ) : TOWPin;
209 | begin
210 | SetLength( FNegativeDataArray, APinListOwner.Count + 1 );
211 | FNegativeDataArray[ APinListOwner.Count ] := 0.0;
212 |
213 | var APin := TOWFloatSinkPin.Create( TOWPin.PinListAddSetter( APinListOwner ), NIL,
214 | procedure( ASender : TOWPin; const AValue : Single; AOnConnect : Boolean )
215 | begin
216 | FNegativeDataArray[ APinListOwner.IndexOf( ASender ) ] := AValue;
217 | FOutputPin.Notify( TOWNotifyOperation.Make() );
218 | end
219 | );
220 |
221 | FOutputPin.FunctionSources.Add( APin );
222 | Result := APin;
223 | end;
224 | //---------------------------------------------------------------------------
225 | procedure TOWLAdd.DestroyPositivePin( APinListOwner : TOWPinList; APin : TOWBasicPin );
226 | begin
227 | SetLength( FPositiveDataArray, APinListOwner.Count );
228 | end;
229 | //---------------------------------------------------------------------------
230 | procedure TOWLAdd.DestroyNegativePin( APinListOwner : TOWPinList; APin : TOWBasicPin );
231 | begin
232 | SetLength( FNegativeDataArray, APinListOwner.Count );
233 | end;
234 | //---------------------------------------------------------------------------
235 | function TOWLAdd.PinNotification( AOtherPin : TOWBasicPin; const AHandler : IOWDataStream; const ADataTypeID : TGUID; const AOperation : IOWNotifyOperation; AState : TOWNotifyState; var AHandled : Boolean ) : TOWNotifyResult;
236 | begin
237 | var AValue : Single := 0.0;
238 |
239 | for var I : Integer := 0 to FPositiveInputPins.Count - 1 do
240 | AValue := AValue + FPositiveDataArray[ I ];
241 |
242 | for var I : Integer := 0 to FNegativeInputPins.Count - 1 do
243 | AValue := AValue - FNegativeDataArray[ I ];
244 |
245 | AHandler.DispatchData( AOtherPin, ADataTypeID, TOWTypedSuppliedOperation.Make( AValue ), AState );
246 | // Handler.SendFloatData( AValue );
247 | Result := [];
248 | end;
249 | //---------------------------------------------------------------------------
250 | //---------------------------------------------------------------------------
251 | //---------------------------------------------------------------------------
252 | //---------------------------------------------------------------------------
253 | constructor TOWLMultiply.Create(AOwner : TComponent);
254 | begin
255 | inherited;
256 | TOWFloatSourcePin.CreateEx( TOWPin.PinOwnerSetter( FOutputPin, Self, Self ), NIL, PinNotification );
257 | TOWPinListOwner.CreateEx( TOWPinList.PinListOwnerSetter( FInputPins, Self, Self ), NIL, 1, [pcSink], 1, 100, CreateInputPin, DestroyInputPin );
258 | end;
259 | //---------------------------------------------------------------------------
260 | destructor TOWLMultiply.Destroy();
261 | begin
262 | FInputPins.Free();
263 | FOutputPin.Free();
264 | inherited;
265 | end;
266 | //---------------------------------------------------------------------------
267 | function TOWLMultiply.CreateInputPin( APinListOwner : TOWPinList; const AOnCreated : TProc ) : TOWPin;
268 | begin
269 | SetLength( FInputDataArray, APinListOwner.Count + 1 );
270 | FInputDataArray[ APinListOwner.Count ] := 1.0;
271 |
272 | var APin := TOWFloatSinkPin.Create( TOWPin.PinListAddSetter( APinListOwner ), NIL,
273 | procedure ( ASender : TOWPin; const AValue : Single; AOnConnect : Boolean )
274 | begin
275 | FInputDataArray[ APinListOwner.IndexOf( ASender ) ] := AValue;
276 | FOutputPin.Notify( TOWNotifyOperation.Make() );
277 | end
278 | );
279 |
280 | FOutputPin.FunctionSources.Add( APin );
281 |
282 | Result := APin;
283 | end;
284 | //---------------------------------------------------------------------------
285 | procedure TOWLMultiply.DestroyInputPin( APinListOwner : TOWPinList; APin : TOWBasicPin );
286 | begin
287 | SetLength( FInputDataArray, APinListOwner.Count );
288 | end;
289 | //---------------------------------------------------------------------------
290 | function TOWLMultiply.PinNotification( AOtherPin : TOWBasicPin; const AHandler : IOWDataStream; const ADataTypeID : TGUID; const AOperation : IOWNotifyOperation; AState : TOWNotifyState; var AHandled : Boolean ) : TOWNotifyResult;
291 | begin
292 | var AValue : Single := 1;
293 |
294 | for var I : Integer := 0 to FInputPins.Count - 1 do
295 | AValue := AValue * FInputDataArray[ I ];
296 |
297 | AHandler.DispatchData( AOtherPin, ADataTypeID, TOWTypedSuppliedOperation.Make( AValue ), AState );
298 | Result := [];
299 | end;
300 | //---------------------------------------------------------------------------
301 | //---------------------------------------------------------------------------
302 | //---------------------------------------------------------------------------
303 | //---------------------------------------------------------------------------
304 | constructor TOWLDivide.Create(AOwner : TComponent);
305 | begin
306 | inherited;
307 | FDivisible := 0;
308 | FDivider := 1;
309 |
310 | TOWFloatSourcePin.CreateEx( TOWPin.PinOwnerSetter( FOutputPin, Self, Self ), NIL, PinNotification );
311 | TOWFloatSinkPin.Create( TOWPin.PinOwnerSetter( FDivisibleInputPin, Self, Self ), NIL, SendDivisibleData, NIL );
312 | TOWFloatSinkPin.Create( TOWPin.PinOwnerSetter( FDividerInputPin, Self, Self ), NIL, SendDividerData, NIL );
313 | FOutputPin.FunctionSources.Add( FDivisibleInputPin );
314 | FOutputPin.FunctionSources.Add( FDividerInputPin );
315 | end;
316 | //---------------------------------------------------------------------------
317 | destructor TOWLDivide.Destroy();
318 | begin
319 | FDividerInputPin.Free();
320 | FDivisibleInputPin.Free();
321 | FOutputPin.Free();
322 | inherited;
323 | end;
324 | //---------------------------------------------------------------------------
325 | function TOWLDivide.PinNotification( AOtherPin : TOWBasicPin; const AHandler : IOWDataStream; const ADataTypeID : TGUID; const AOperation : IOWNotifyOperation; AState : TOWNotifyState; var AHandled : Boolean ) : TOWNotifyResult;
326 | var
327 | AValue : Single;
328 |
329 | begin
330 | if( FDivider <> 0 ) then
331 | AValue := FDivisible / FDivider
332 |
333 | else
334 | AValue := 0;
335 |
336 | AHandler.DispatchData( AOtherPin, ADataTypeID, TOWTypedSuppliedOperation.Make( AValue ), AState );
337 | Result := [];
338 | end;
339 | //---------------------------------------------------------------------------
340 | procedure TOWLDivide.SendDivisibleData( ASender : TOWPin; const AValue : Single; AOnConnect : Boolean );
341 | begin
342 | FDivisible := AValue;
343 | FOutputPin.Notify( TOWNotifyOperation.Make() );
344 | end;
345 | //---------------------------------------------------------------------------
346 | procedure TOWLDivide.SendDividerData( ASender : TOWPin; const AValue : Single; AOnConnect : Boolean );
347 | begin
348 | FDivider := AValue;
349 | FOutputPin.Notify( TOWNotifyOperation.Make() );
350 | end;
351 | //---------------------------------------------------------------------------
352 | //---------------------------------------------------------------------------
353 | //---------------------------------------------------------------------------
354 | //---------------------------------------------------------------------------
355 | constructor TOWLTestClock.Create(AOwner : TComponent);
356 | begin
357 | inherited;
358 | TOWFloatSourcePin.Create( TOWPin.PinOwnerSetter( FOutputPin, Self, Self ), NIL );
359 | FCounter := 1;
360 | FStep := 0.5;
361 | FMin := 1;
362 | FMax := 1000;
363 | end;
364 | //---------------------------------------------------------------------------
365 | destructor TOWLTestClock.Destroy();
366 | begin
367 | FOutputPin.Free();
368 | inherited;
369 | end;
370 |
371 | //---------------------------------------------------------------------------
372 | {$IFDEF FPC}
373 | procedure TOWLTestClock.DoOnTimer;
374 | {$ELSE}
375 | {$IFDEF FMX}
376 | procedure TOWLTestClock.DoOnTimer;
377 | {$ELSE}
378 | procedure TOWLTestClock.Timer;
379 | {$ENDIF}
380 | {$ENDIF}
381 | begin
382 | inherited;
383 |
384 | if( not FStartReported ) then
385 | begin
386 | FOutputPin.Notify( TOWStartRateOperation.Make( 1000 / Interval ) );
387 | FStartReported := True;
388 | end;
389 |
390 | FOutputPin.Value := FCounter;
391 |
392 | if( FCounter > FMax ) then
393 | FCounter := FMax;
394 |
395 | if( FCounter < FMin ) then
396 | FCounter := FMin;
397 |
398 | FCounter := FCounter + FStep;
399 | if( FCounter > FMax ) then
400 | FCounter := FMin;
401 |
402 | end;
403 | //---------------------------------------------------------------------------
404 | procedure TOWLTestClock.Loaded;
405 | begin
406 | inherited;
407 | if( ( not Assigned( OnTimer ) ) and ( not ( csDesigning in ComponentState ) )) then
408 | OnTimer := STestClockComponentTimer;
409 |
410 | FOutputPin.Value := FCounter;
411 | end;
412 | //---------------------------------------------------------------------------
413 | procedure TOWLTestClock.STestClockComponentTimer( ASender : TObject );
414 | begin
415 | end;
416 | //---------------------------------------------------------------------------
417 | procedure TOWLTestClock.SetMax( Value : Single );
418 | begin
419 | if( Value = FMax ) then
420 | Exit;
421 |
422 | FMax := Value;
423 | if( FMax < FMin ) then
424 | FMin := FMax;
425 |
426 | if( FCounter > FMax ) then
427 | FCounter := FMax;
428 |
429 | end;
430 | //---------------------------------------------------------------------------
431 | procedure TOWLTestClock.SetMin( Value : Single );
432 | begin
433 | if( Value = FMin ) then
434 | Exit;
435 |
436 | FMin := Value;
437 | if( FMax < FMin ) then
438 | FMax := FMin;
439 |
440 | if( FCounter < FMin ) then
441 | FCounter := FMin;
442 |
443 | end;
444 | //---------------------------------------------------------------------------
445 | //---------------------------------------------------------------------------
446 | //---------------------------------------------------------------------------
447 | //---------------------------------------------------------------------------
448 | constructor TOWLLabel.Create(AOwner : TComponent);
449 | begin
450 | inherited;
451 | TOWFloatSinkPin.Create( TOWPin.PinOwnerSetter( FInputPin, Self, Self ), NIL, PinValueChange );
452 | end;
453 | //---------------------------------------------------------------------------
454 | destructor TOWLLabel.Destroy();
455 | begin
456 | FInputPin.Free();
457 | inherited;
458 | end;
459 | //---------------------------------------------------------------------------
460 | procedure TOWLLabel.PinValueChange( ASender : TOWPin; const AValue : Single; AOnConnect : Boolean );
461 | begin
462 | {$IFDEF FMX}
463 | Text := FloatToStr( AValue );
464 | {$ELSE}
465 | Caption := FloatToStr( AValue );
466 | {$ENDIF}
467 | end;
468 | //---------------------------------------------------------------------------
469 | //---------------------------------------------------------------------------
470 | //---------------------------------------------------------------------------
471 | //---------------------------------------------------------------------------
472 | procedure Register;
473 | begin
474 | RegisterComponents('OpenWire', [TOWLAdd, TOWLMultiply, TOWLDivide]);
475 | RegisterComponents('OpenWire', [TOWLTestClock]);
476 | RegisterComponents('OpenWire', [TOWLLabel]);
477 | end;
478 | //---------------------------------------------------------------------------
479 | end.
480 |
481 |
--------------------------------------------------------------------------------
/OpenWireLabDemo/OWLStateComps.dcr:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bmitov/OpenWire/ecda2b148c1f2761a20bcfedb1e37d98f6a4cc21/OpenWireLabDemo/OWLStateComps.dcr
--------------------------------------------------------------------------------
/OpenWireLabDemo/OWLStateComps.pas:
--------------------------------------------------------------------------------
1 | // OpenWire demo components.
2 | // The package is not designed for a real usage, but to demonstrate the power of OpenWire,
3 | // however the components are fully implemented and can be used in a real application.
4 |
5 | unit OWLStateComps;
6 |
7 | {$IFDEF FPC}
8 | {$MODE DELPHI}{$H+}
9 | {$ENDIF}
10 |
11 | interface
12 |
13 | uses
14 | System.Classes, Vcl.ComCtrls, OWStdTypes, OWPins;
15 |
16 | type
17 | TOWLTrackBar = class( TTrackBar )
18 | protected // OpenWire support
19 | FPositionPin : TOWIntegerStatePin;
20 |
21 | public
22 | constructor Create(AOwner : TComponent); override;
23 | destructor Destroy; override;
24 |
25 | protected
26 | {$IFDEF FPC}
27 | procedure EditingDone(); override;
28 | {$ELSE}
29 | procedure Changed(); override;
30 | {$ENDIF}
31 |
32 | protected
33 | procedure OnIntegerChangeEvent( Sender : TOWPin; const AValue : Integer; AOnConnect : Boolean );
34 |
35 | published // OpenWire support
36 | property PositionPin : TOWIntegerStatePin read FPositionPin write FPositionPin;
37 |
38 | end;
39 |
40 | type
41 | TOWLProgressBar = class( TProgressBar )
42 | protected // OpenWire support
43 | FPositionPin : TOWFloatIntStatePin;
44 |
45 | public
46 | constructor Create( AOwner : TComponent); override;
47 | destructor Destroy; override;
48 |
49 | protected
50 | procedure FloatChangeEvent( Sender : TOWPin; const AValue : Single; AOnConnect : Boolean );
51 |
52 | published // OpenWire support
53 | property PositionPin : TOWFloatIntStatePin read FPositionPin write FPositionPin;
54 |
55 | end;
56 |
57 | procedure Register;
58 |
59 | implementation
60 |
61 | constructor TOWLTrackBar.Create( AOwner : TComponent);
62 | begin
63 | inherited;
64 | TOWIntegerStatePin.Create( TOWPin.PinOwnerSetter( FPositionPin, Self, Self ), NIL, OnIntegerChangeEvent );
65 | end;
66 |
67 | destructor TOWLTrackBar.Destroy;
68 | begin
69 | FPositionPin.Free();
70 | inherited;
71 | end;
72 |
73 | procedure TOWLTrackBar.OnIntegerChangeEvent( Sender : TOWPin; const AValue : Integer; AOnConnect : Boolean );
74 | begin
75 | Position := AValue;
76 | end;
77 |
78 | {$IFDEF FPC}
79 | procedure TOWLTrackBar.EditingDone();
80 | {$ELSE}
81 | procedure TOWLTrackBar.Changed();
82 | {$ENDIF}
83 | begin
84 | inherited;
85 | FPositionPin.Value := Position;
86 | end;
87 |
88 | constructor TOWLProgressBar.Create( AOwner : TComponent );
89 | begin
90 | inherited;
91 | TOWFloatIntStatePin.Create( TOWPin.PinOwnerSetter( FPositionPin, Self, Self ), NIL, FloatChangeEvent );
92 | end;
93 |
94 | destructor TOWLProgressBar.Destroy;
95 | begin
96 | FPositionPin.Free();
97 | inherited;
98 | end;
99 |
100 | procedure TOWLProgressBar.FloatChangeEvent( Sender : TOWPin; const AValue : Single; AOnConnect : Boolean );
101 | begin
102 | Position := Round( AValue );
103 | end;
104 |
105 | procedure Register;
106 | begin
107 | RegisterComponents('OpenWire', [TOWLTrackBar]);
108 | RegisterComponents('OpenWire', [TOWLProgressBar]);
109 | end;
110 |
111 | end.
112 |
--------------------------------------------------------------------------------
/OpenWireLabDemo/OpenWireLabPkg.pas:
--------------------------------------------------------------------------------
1 | { This file was automatically created by Lazarus. do not edit!
2 | This source is only used to compile and install the package.
3 | }
4 |
5 | unit OpenWireLabPkg;
6 |
7 | interface
8 |
9 | uses
10 | OWLComps, OWLStateComps, OpenWireLabPkgLazRes, LazarusPackageIntf;
11 |
12 | implementation
13 |
14 | procedure Register;
15 | begin
16 | RegisterUnit('OWLComps', @OWLComps.Register);
17 | RegisterUnit('OWLStateComps', @OWLStateComps.Register);
18 | end;
19 |
20 | initialization
21 | RegisterPackage('OpenWireLabPkg', @Register);
22 | end.
23 |
--------------------------------------------------------------------------------
/OpenWireResources.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bmitov/OpenWire/ecda2b148c1f2761a20bcfedb1e37d98f6a4cc21/OpenWireResources.res
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # OpenWire
2 | OpenWire is a free open source library.
3 |
4 | The library allows writing advanced VCL and FireMonkey components for rapid codeless application development. The components developed with the library allow creation of complex applications with zero lines of program code.
5 |
6 | 
7 |
8 |
9 | Here is a video demos of OpenWire in Delphi:
10 |
11 | [](https://youtu.be/twdZiy9ePz8 "OpenWire Demo")
12 |
--------------------------------------------------------------------------------