├── .gitignore
├── CTreeListCtrl.chm
├── LICENSE
├── PB
├── TreeList.dll
├── TreeList.pbr
├── TreeList105.pbw
├── TreeList115.pbw
├── TreeList90.pbw
├── TreeListA.dll
├── rebuild_105.bat
├── rebuild_115.bat
├── rebuild_90.bat
├── rebuild_orca.bat
├── rebuild_pbl_from_src.orca
├── rebuild_pbl_from_src_90.orca
├── res
│ ├── TreeList.ico
│ ├── flags.bmp
│ └── header.bmp
├── src
│ ├── 90
│ │ ├── n_choosefont.sru
│ │ ├── n_cst_numerical.sru
│ │ ├── treelist90.pbg
│ │ ├── treelist90.pbt
│ │ ├── treelist90.sra
│ │ ├── vo_treelist.sru
│ │ └── w_test.srw
│ ├── 105
│ │ ├── n_choosefont.sru
│ │ ├── n_cst_numerical.sru
│ │ ├── treelist105.pbg
│ │ ├── treelist105.pbt
│ │ ├── treelist105.sra
│ │ ├── vo_treelist.sru
│ │ └── w_test.srw
│ └── 115
│ │ ├── n_choosefont.sru
│ │ ├── n_cst_numerical.sru
│ │ ├── treelist115.pbg
│ │ ├── treelist115.pbt
│ │ ├── treelist115.sra
│ │ ├── treelistdemo.srj
│ │ ├── vo_treelist.sru
│ │ └── w_test.srw
├── treelist105.pbt
└── treelist115.pbt
├── README.md
├── SimpleTest.vcproj
├── StdAfx.cpp
├── StdAfx.h
├── TreeList.clw
├── TreeList.cpp
├── TreeList.def
├── TreeList.dsp
├── TreeList.dsw
├── TreeList.h
├── TreeList.rc
├── TreeList.sln
├── TreeList.vcproj
├── TreeListA.def
├── TreeListCtrl.cpp
├── TreeListCtrl.h
├── TreeListDlg.cpp
├── TreeListDlg.h
├── TreeListDll.cpp
├── TreeListDll.rc
├── TreeListWnd.cpp
├── TreeListWnd.h
├── conv_defs.pl
├── demo_pb.png
├── demo_vc.png
├── help.pdf
├── res
├── DataFinder.rc2
├── TreeList.exe.manifest
├── TreeList.ico
├── TreeList.rc2
├── checks.bmp
└── flags.bmp
├── resource.h
└── tests
├── TreeList.exe
├── build_simple_static.bat
├── flags.bmp
├── header.bmp
├── simple.cpp
├── simple.rc
├── simple_ansi.cpp
├── simple_dll.cpp
└── simple_dll.exe
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 |
4 | # User-specific files
5 | *.suo
6 | *.user
7 | *.sln.docstates
8 |
9 | # Build results
10 | [Dd]ebug*/
11 | [Dd]ebugPublic/
12 | [Rr]elease*/
13 | [Rr]eleases/
14 | x64/
15 | build/
16 | bld/
17 | [Bb]in/
18 | [Oo]bj/
19 | PB/*.dll
20 |
21 | # PB files
22 | *.prp
23 | PB/TreeList105.pbl
24 | PB/TreeList115.pbl
25 |
26 | # Roslyn cache directories
27 | *.ide/
28 |
29 | # MSTest test Results
30 | [Tt]est[Rr]esult*/
31 | [Bb]uild[Ll]og.*
32 |
33 | #NUNIT
34 | *.VisualState.xml
35 | TestResult.xml
36 |
37 | # Build Results of an ATL Project
38 | [Dd]ebugPS/
39 | [Rr]eleasePS/
40 | dlldata.c
41 |
42 | *_i.c
43 | *_p.c
44 | *_i.h
45 | *.ilk
46 | *.meta
47 | *.obj
48 | *.pch
49 | *.pdb
50 | *.pgc
51 | *.pgd
52 | *.rsp
53 | *.sbr
54 | *.tlb
55 | *.tli
56 | *.tlh
57 | *.tmp
58 | *.tmp_proj
59 | *.log
60 | *.vspscc
61 | *.vssscc
62 | .builds
63 | *.pidb
64 | *.svclog
65 | *.scc
66 |
67 | # Chutzpah Test files
68 | _Chutzpah*
69 |
70 | # Visual C++ cache files
71 | ipch/
72 | *.aps
73 | *.ncb
74 | *.opensdf
75 | *.sdf
76 | *.cachefile
77 |
78 | # Visual Studio profiler
79 | *.psess
80 | *.vsp
81 | *.vspx
82 |
83 | # TFS 2012 Local Workspace
84 | $tf/
85 |
86 | # Guidance Automation Toolkit
87 | *.gpState
88 |
89 | # ReSharper is a .NET coding add-in
90 | _ReSharper*/
91 | *.[Rr]e[Ss]harper
92 | *.DotSettings.user
93 |
94 | # JustCode is a .NET coding addin-in
95 | .JustCode
96 |
97 | # TeamCity is a build add-in
98 | _TeamCity*
99 |
100 | # DotCover is a Code Coverage Tool
101 | *.dotCover
102 |
103 | # NCrunch
104 | _NCrunch_*
105 | .*crunch*.local.xml
106 |
107 | # MightyMoose
108 | *.mm.*
109 | AutoTest.Net/
110 |
111 | # Web workbench (sass)
112 | .sass-cache/
113 |
114 | # Installshield output folder
115 | [Ee]xpress/
116 |
117 | # DocProject is a documentation generator add-in
118 | DocProject/buildhelp/
119 | DocProject/Help/*.HxT
120 | DocProject/Help/*.HxC
121 | DocProject/Help/*.hhc
122 | DocProject/Help/*.hhk
123 | DocProject/Help/*.hhp
124 | DocProject/Help/Html2
125 | DocProject/Help/html
126 |
127 | # Click-Once directory
128 | publish/
129 |
130 | # Publish Web Output
131 | *.[Pp]ublish.xml
132 | *.azurePubxml
133 | ## TODO: Comment the next line if you want to checkin your
134 | ## web deploy settings but do note that will include unencrypted
135 | ## passwords
136 | *.pubxml
137 |
138 | # NuGet Packages Directory
139 | packages/*
140 | ## TODO: If the tool you use requires repositories.config
141 | ## uncomment the next line
142 | #!packages/repositories.config
143 |
144 | # Enable "build/" folder in the NuGet Packages folder since
145 | # NuGet packages use it for MSBuild targets.
146 | # This line needs to be after the ignore of the build folder
147 | # (and the packages folder if the line above has been uncommented)
148 | !packages/build/
149 |
150 | # Windows Azure Build Output
151 | csx/
152 | *.build.csdef
153 |
154 | # Windows Store app package directory
155 | AppPackages/
156 |
157 | # Others
158 | sql/
159 | *.Cache
160 | ClientBin/
161 | [Ss]tyle[Cc]op.*
162 | ~$*
163 | *~
164 | *.dbmdl
165 | *.dbproj.schemaview
166 | *.pfx
167 | *.publishsettings
168 | node_modules/
169 |
170 | # RIA/Silverlight projects
171 | Generated_Code/
172 |
173 | # Backup & report files from converting an old project file
174 | # to a newer Visual Studio version. Backup files are not needed,
175 | # because we have git ;-)
176 | _UpgradeReport_Files/
177 | Backup*/
178 | UpgradeLog*.XML
179 | UpgradeLog*.htm
180 |
181 | # SQL Server files
182 | *.mdf
183 | *.ldf
184 |
185 | # Business Intelligence projects
186 | *.rdl.data
187 | *.bim.layout
188 | *.bim_*.settings
189 |
190 | # Microsoft Fakes
191 | FakesAssemblies/
192 | /dll_debug_unicode
193 | /PB/treelist115.usr.opt
194 |
--------------------------------------------------------------------------------
/CTreeListCtrl.chm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sebkirche/treelist/f005e8d715aa0c831c5bc98ef6add7798d1c26dd/CTreeListCtrl.chm
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 | {one line to give the program's name and a brief idea of what it does.}
635 | Copyright (C) {year} {name of author}
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | {project} Copyright (C) {year} {fullname}
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
--------------------------------------------------------------------------------
/PB/TreeList.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sebkirche/treelist/f005e8d715aa0c831c5bc98ef6add7798d1c26dd/PB/TreeList.dll
--------------------------------------------------------------------------------
/PB/TreeList.pbr:
--------------------------------------------------------------------------------
1 | res\flags.bmp
2 | res\TreeList.ico
3 |
--------------------------------------------------------------------------------
/PB/TreeList105.pbw:
--------------------------------------------------------------------------------
1 | Save Format v3.0(19990112)
2 | @begin Unchecked
3 | @end;
4 | @begin Targets
5 | 0 "treelist105.pbt";
6 | @end;
7 | DefaultTarget "treelist105.pbt";
8 | DefaultRemoteTarget "treelist105.pbt";
9 |
--------------------------------------------------------------------------------
/PB/TreeList115.pbw:
--------------------------------------------------------------------------------
1 | Save Format v3.0(19990112)
2 | @begin Unchecked
3 | @end;
4 | @begin Targets
5 | 0 "treelist115.pbt";
6 | @end;
7 | DefaultTarget "treelist115.pbt";
8 | DefaultRemoteTarget "treelist115.pbt";
9 |
--------------------------------------------------------------------------------
/PB/TreeList90.pbw:
--------------------------------------------------------------------------------
1 | Save Format v3.0(19990112)
2 | @begin Unchecked
3 | @end;
4 | @begin Targets
5 | 0 "treelist90.pbt";
6 | @end;
7 | DefaultTarget "treelist90.pbt";
8 | DefaultRemoteTarget "treelist90.pbt";
9 |
--------------------------------------------------------------------------------
/PB/TreeListA.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sebkirche/treelist/f005e8d715aa0c831c5bc98ef6add7798d1c26dd/PB/TreeListA.dll
--------------------------------------------------------------------------------
/PB/rebuild_105.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 |
3 | %~d0
4 | cd "%~dp0"
5 |
6 | call rebuild_orca.bat 105 TreeList105
7 |
--------------------------------------------------------------------------------
/PB/rebuild_115.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 |
3 | %~d0
4 | cd "%~dp0"
5 |
6 | call rebuild_orca.bat 115 TreeList115
7 |
--------------------------------------------------------------------------------
/PB/rebuild_90.bat:
--------------------------------------------------------------------------------
1 | rem @echo off
2 |
3 | %~d0
4 | cd "%~dp0"
5 |
6 | call rebuild_orca.bat 90 TreeList90
7 |
--------------------------------------------------------------------------------
/PB/rebuild_orca.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 |
3 | set pbver=%1
4 | set target=%2
5 |
6 | %~d0
7 |
8 | set logfile=%~dp0src\%pbver%\rebuild_%target%.log
9 | REM ~ set lpath=%~dp0
10 | REM ~ if %lpath:~-1%==\ set lpath=%lpath:~0,-1%
11 | REM for offline reconstruct, we need to work with all files in the same directory
12 | set lpath=".\\"
13 |
14 | REM ~ for the project path, the backslashes need to be doubled (WTF ?!!)
15 | set ppath=%~dp0src\%pbver%
16 | set ppath=%ppath:\=\\%
17 |
18 | REM ~ work in source directory
19 | cd %~dp0src\%pbver%
20 |
21 | echo Rebuild the pbl from sources
22 | echo working dir=%cd%
23 | echo lpath=%lpath%
24 | echo ppath=%ppath%
25 | echo.
26 | if %pbver%==90 (
27 | rem orcascr9 is a different from later versions, we need a specific script
28 | orcascr9 /D targetname="%target%" /D lpath="%lpath%" /D ppath="%ppath%" /D logfilename="%logfile%" ..\..\rebuild_pbl_from_src_90.orca
29 | ) else (
30 | orcascr%pbver% /D targetname="%target%" /D lpath="%lpath%" /D ppath="%ppath%" /D logfilename="%logfile%" ..\..\rebuild_pbl_from_src.orca
31 | )
32 | echo.
33 |
34 | if errorlevel 1 goto failed
35 | goto ok
36 |
37 | :failed
38 | echo Process failed ?
39 | goto end:
40 |
41 | :ok
42 | attrib -R ..\..\%target%.pbt
43 | copy /Y %target%.pbt ..\..\
44 | move /Y %target%.pbl ..\..\
45 | cd "%~dp0"
46 | echo Done.
47 | echo %target%.pbl should have been copied in the project directory.
48 |
49 | :end
50 | pause
51 |
--------------------------------------------------------------------------------
/PB/rebuild_pbl_from_src.orca:
--------------------------------------------------------------------------------
1 |
2 | ; This script can reconstruct the project pbl after a git update
3 | ;
4 | ; IMPORTANT WARNING : to work successfully in offline mode,
5 | ; the .pbt, .pbg(s) and all other .srx files MUST be in the SAME directory...
6 | ; otherwise you will have weird errors like "library list (or application) not defined"
7 | ; or "cannot find the application" :^S
8 |
9 | set targetFile = targetname
10 | set targetFile += ".pbt"
11 |
12 | ;echo target targetname
13 | ;echo local path lpath
14 | ;echo project ppath
15 |
16 | start session
17 |
18 | scc set connect property localprojpath lpath
19 | scc set connect property project ppath
20 | scc set connect property logfile logfilename
21 | scc set connect property logappend true
22 | scc set connect property deletetempfiles true
23 |
24 | ;do not actually connect through source control
25 | ;just get the sources files from the current directory
26 | scc connect offline
27 |
28 | scc set target targetFile refresh_all importonly
29 |
30 | ;a mentioned pbl/pbd must be in library list / target
31 | ;scc exclude liblist "pbnihash.pbd"
32 |
33 | ;If you're trying to recreate the PBLs from source, you should use the
34 | ;migrate option rather than full. That lets ORCAScript know that it needs to
35 | ;be able to deal with missing ancestors during import.
36 | ;scc refresh target full
37 | scc refresh target migrate
38 |
39 | scc close
40 | end session
41 |
--------------------------------------------------------------------------------
/PB/rebuild_pbl_from_src_90.orca:
--------------------------------------------------------------------------------
1 |
2 | ; This script can reconstruct the project pbl after a git update
3 | ;
4 | ; IMPORTANT WARNING : to work successfully in offline mode,
5 | ; the .pbt, .pbg(s) and all other .srx files MUST be in the SAME directory...
6 | ; otherwise you will have weird errors like "library list (or application) not defined"
7 | ; or "cannot find the application" :^S
8 |
9 | set targetFile = targetname
10 | set targetFile += ".pbt"
11 |
12 | ;echo target targetname
13 | ;echo local path lpath
14 | ;echo project ppath
15 |
16 | start session
17 |
18 | scc set connect property provider "PB Native"
19 | scc set connect property userid "johndoe"
20 | scc set connect property localprojpath lpath
21 | scc set connect property project ppath
22 | scc set connect property logfile logfilename
23 | scc set connect property logappend true
24 | scc set connect property deletetempfiles true
25 |
26 | scc connect
27 |
28 | scc set target targetFile refresh_all importonly
29 |
30 | ;a mentioned pbl/pbd must be in library list / target
31 | ;scc exclude liblist "pbnihash.pbd"
32 |
33 | ;If you're trying to recreate the PBLs from source, you should use the
34 | ;migrate option rather than full. That lets ORCAScript know that it needs to
35 | ;be able to deal with missing ancestors during import.
36 | ;scc refresh target full
37 | scc refresh target migrate
38 |
39 | scc close
40 | end session
41 |
--------------------------------------------------------------------------------
/PB/res/TreeList.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sebkirche/treelist/f005e8d715aa0c831c5bc98ef6add7798d1c26dd/PB/res/TreeList.ico
--------------------------------------------------------------------------------
/PB/res/flags.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sebkirche/treelist/f005e8d715aa0c831c5bc98ef6add7798d1c26dd/PB/res/flags.bmp
--------------------------------------------------------------------------------
/PB/res/header.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sebkirche/treelist/f005e8d715aa0c831c5bc98ef6add7798d1c26dd/PB/res/header.bmp
--------------------------------------------------------------------------------
/PB/src/105/n_choosefont.sru:
--------------------------------------------------------------------------------
1 | HA$PBExportHeader$n_choosefont.sru
2 | forward
3 | global type n_choosefont from nonvisualobject
4 | end type
5 | type choosefont from structure within n_choosefont
6 | end type
7 | type logfont from structure within n_choosefont
8 | end type
9 | end forward
10 |
11 | type choosefont from structure
12 | long lstructsize
13 | ulong hwnd
14 | ulong hdc
15 | long lplogfont
16 | long ipointsize
17 | long flags
18 | long rgbcolors
19 | long lcustdata
20 | long lpfnhook
21 | string templatename
22 | ulong hinstance
23 | string lpszstyle
24 | integer nfonttype
25 | integer missingalignment
26 | long nsizemin
27 | ulong nsizelong
28 | end type
29 |
30 | type logfont from structure
31 | long lfheight
32 | long lfwidth
33 | long lfescapement
34 | long lforientation
35 | long lfweight
36 | byte lfitalic
37 | byte lfunderline
38 | byte lfstrikeout
39 | byte lfcharset
40 | byte lfoutprecision
41 | byte lfclipprecision
42 | byte lfquality
43 | byte lfpitchandfamily
44 | character lffacename[32]
45 | end type
46 |
47 | global type n_choosefont from nonvisualobject autoinstantiate
48 | end type
49 |
50 | type prototypes
51 | Function boolean ChooseFont ( &
52 | Ref CHOOSEFONT lpcf &
53 | ) Library "comdlg32.dll" Alias For "ChooseFontW"
54 |
55 | Subroutine CopyMemory ( &
56 | Ref LOGFONT Destination, &
57 | long Source, &
58 | long Length &
59 | ) Library "kernel32.dll" Alias For "RtlMoveMemory"
60 |
61 | Subroutine CopyMemory ( &
62 | long Destination, &
63 | LOGFONT Source, &
64 | long Length &
65 | ) Library "kernel32.dll" Alias For "RtlMoveMemory"
66 |
67 | Function ulong GlobalAlloc ( &
68 | ulong uFlags, &
69 | long dwBytes &
70 | ) Library "kernel32.dll"
71 |
72 | Function ulong GlobalLock ( &
73 | ulong hMem &
74 | ) Library "kernel32.dll"
75 |
76 | Function ulong GlobalUnlock ( &
77 | ulong hMem &
78 | ) Library "kernel32.dll"
79 |
80 | Function ulong GlobalFree ( &
81 | ulong hMem &
82 | ) Library "kernel32.dll"
83 |
84 | end prototypes
85 |
86 | type variables
87 |
88 | // ChooseFont standard dialog wrapper - Roland Smith 2009
89 | //
90 | // see http://www.topwizprogramming.com/freecode_choosefont.html
91 |
92 | Integer iTextSize
93 | Boolean iBold
94 | Boolean iUnderline
95 | Boolean iItalic
96 | Boolean iStrikeout
97 | String iFaceName
98 | Long iTextColor
99 | Long iWeight
100 |
101 | end variables
102 |
103 | forward prototypes
104 | public function boolean of_choosefont (window aw_parent, string as_fontname)
105 | end prototypes
106 |
107 | public function boolean of_choosefont (window aw_parent, string as_fontname);Constant Integer CF_SCREENFONTS = 1
108 | Constant Integer CF_INITTOLOGFONTSTRUCT = 64
109 | Constant Integer CF_EFFECTS = 256
110 | Constant Integer GMEM_MOVEABLE = 2
111 | CHOOSEFONT lstr_choosefont
112 | LOGFONT lstr_logfont
113 | Long ll_LogFont
114 |
115 | // we allocate a piece of memory with the size of the logfont structure
116 | // and we lock it
117 | ll_LogFont = GlobalAlloc(GMEM_MOVEABLE, 120)
118 | If ll_LogFont = 0 Then Return False
119 |
120 | ll_LogFont = GlobalLock(ll_LogFont)
121 | If ll_LogFont = 0 Then Return False
122 |
123 | /* initialise the logfont structure */
124 |
125 | // default font
126 | If as_fontname = "" Then
127 | lstr_logfont.lffacename = "Arial"
128 | Else
129 | lstr_logfont.lffacename = as_fontname
130 | End If
131 | lstr_logfont.lfweight = 400
132 | lstr_logfont.lfheight = 12
133 |
134 | // copy the structure to the allocated piece in memory
135 | CopyMemory(ll_LogFont, lstr_Logfont, 60)
136 |
137 | // assign the pointer to the fontinfo in memory to the dialog font
138 | lstr_ChooseFont.lplogfont = ll_LogFont
139 |
140 | // initialise the structure further
141 | lstr_ChooseFont.lstructsize = 60
142 | lstr_ChooseFont.hwnd = Handle(aw_parent)
143 | lstr_ChooseFont.flags = CF_SCREENFONTS+CF_INITTOLOGFONTSTRUCT+CF_EFFECTS
144 |
145 | // call the dialog
146 | If Not ChooseFont(lstr_ChooseFont) Then
147 | GlobalUnlock(ll_LogFont)
148 | GlobalFree(ll_LogFont)
149 | Return False
150 | End If
151 |
152 | // The memory piece now contains the selected log information
153 | // Copy this information back to the structure so we can access it
154 | CopyMemory(lstr_LogFont, lstr_ChooseFont.lplogfont, 120)
155 |
156 | // release the used memory
157 | GlobalUnlock(ll_LogFont)
158 | GlobalFree(ll_LogFont)
159 |
160 | // save the results in instance variables
161 | iTextSize = (lstr_ChooseFont.iPointSize / 10) * -1
162 | iWeight = lstr_LogFont.lfWeight
163 | If iWeight = 700 Then
164 | iBold = True
165 | Else
166 | iBold = False
167 | End If
168 | iFaceName = Trim(lstr_LogFont.lfFaceName)
169 | iTextColor = lstr_ChooseFont.rgbColors
170 |
171 | iUnderline = (lstr_LogFont.lfUnderline > 0)
172 | iItalic = (lstr_LogFont.lfItalic > 0)
173 | iStrikeout = (lstr_LogFont.lfStrikeout > 0)
174 |
175 | Return True
176 |
177 | end function
178 |
179 | on n_choosefont.create
180 | call super::create
181 | TriggerEvent( this, "constructor" )
182 | end on
183 |
184 | on n_choosefont.destroy
185 | TriggerEvent( this, "destructor" )
186 | call super::destroy
187 | end on
188 |
189 |
--------------------------------------------------------------------------------
/PB/src/105/n_cst_numerical.sru:
--------------------------------------------------------------------------------
1 | HA$PBExportHeader$n_cst_numerical.sru
2 | forward
3 | global type n_cst_numerical from nonvisualobject
4 | end type
5 | end forward
6 |
7 | global type n_cst_numerical from nonvisualobject autoinstantiate
8 | end type
9 |
10 | forward prototypes
11 | public function string of_binary (long al_decimal)
12 | public function long of_decimal (string as_binary)
13 | public function boolean of_getbit (long al_decimal, unsignedinteger aui_bit)
14 | public function long of_bitwiseand (long al_decimala, long al_decimalb)
15 | public function long of_bitwiseor (long al_decimala, long al_decimalb)
16 | public function long of_setbit (long al_decimal, unsignedinteger aui_bit)
17 | public function long of_clearbit (long al_decimal, unsignedinteger aui_bit)
18 | public function long of_flipbit (long al_decimal, unsignedinteger aui_bit)
19 | public function long of_bitwisenot (long al_decimal)
20 | public function long of_bitwisexor (long al_decimala, long al_decimalb)
21 | public function integer of_bitwiseand (integer ai_decimala, integer ai_decimalb)
22 | public function integer of_bitwiseor (integer ai_decimala, integer ai_decimalb)
23 | public function int of_setbit (int ai_decimal, unsignedinteger aui_bit)
24 | public function int of_clearbit (int ai_decimal, unsignedinteger aui_bit)
25 | public function int of_flipbit (int ai_decimal, unsignedinteger aui_bit)
26 | public function integer of_bitwisenot (integer ai_decimal)
27 | public function integer of_bitwisexor (integer ai_decimala, integer ai_decimalb)
28 | end prototypes
29 |
30 | public function string of_binary (long al_decimal);//////////////////////////////////////////////////////////////////////////////
31 | //
32 | // Function: of_Binary
33 | //
34 | // Access: public
35 | //
36 | // Arguments:
37 | // al_decimal unsigned long to convert to bit string
38 | //
39 | // Returns: string
40 | //
41 | // Description: Convert al_decimal to a string of 32 1's and 0's in
42 | // big-endian format i.e with LSB at position 1.
43 | //
44 | //////////////////////////////////////////////////////////////////////////////
45 | //
46 | // Revision History
47 | //
48 | // Version
49 | // 1.0 Initial version
50 | //
51 | //////////////////////////////////////////////////////////////////////////////
52 | //
53 | // Copyright $$HEX2$$a9002000$$ENDHEX$$1996 Simon Harris (simon@addease.com.au). All Rights Reserved.
54 | //
55 | //////////////////////////////////////////////////////////////////////////////
56 |
57 | string ls_binary
58 | unsignedint lui_cnt
59 | long ll_remainder
60 | unsignedlong lul_decimal
61 |
62 | lul_decimal = al_decimal
63 |
64 | for lui_cnt = 1 to 32
65 | ll_remainder = mod(lul_decimal, 2)
66 | lul_decimal = lul_decimal / 2
67 |
68 | ls_binary = ls_binary + string(ll_remainder)
69 | next
70 |
71 | return ls_binary
72 | end function
73 |
74 | public function long of_decimal (string as_binary);//////////////////////////////////////////////////////////////////////////////
75 | //
76 | // Function: of_Decimal
77 | //
78 | // Access: public
79 | //
80 | // Arguments:
81 | // as_binary string to convert
82 | //
83 | // Returns: long
84 | //
85 | // Description: Convert an array of 1's and 0's in big-endian format
86 | // i.e. LSB at index 1 to a number.
87 | //
88 | //////////////////////////////////////////////////////////////////////////////
89 | //
90 | // Revision History
91 | //
92 | // Version
93 | // 1.0 Initial version
94 | //
95 | //////////////////////////////////////////////////////////////////////////////
96 | //
97 | // Copyright $$HEX2$$a9002000$$ENDHEX$$1996 Simon Harris (simon@addease.com.au). All Rights Reserved.
98 | //
99 | //////////////////////////////////////////////////////////////////////////////
100 |
101 | long ll_decimal
102 | unsignedint lui_cnt
103 |
104 | // Propogate the sign bit
105 | as_binary += Fill(Right(as_binary, 1), 31)
106 |
107 | // Calculate the value
108 | for lui_cnt = 1 to 32
109 | ll_decimal = ll_decimal + (long(Mid(as_binary, lui_cnt, 1)) * (2 ^ (lui_cnt - 1)))
110 | next
111 |
112 | return ll_decimal
113 | end function
114 |
115 | public function boolean of_getbit (long al_decimal, unsignedinteger aui_bit);//////////////////////////////////////////////////////////////////////////////
116 | //
117 | // Function: of_GetBit
118 | //
119 | // Access: public
120 | //
121 | // Arguments:
122 | // al_decimal value
123 | // aui_bit bit number to test
124 | //
125 | // Returns: boolean
126 | //
127 | // Description: Tests a given bit in a number.
128 | //
129 | //////////////////////////////////////////////////////////////////////////////
130 | //
131 | // Revision History
132 | //
133 | // Version
134 | // 1.0 Initial version
135 | //
136 | //////////////////////////////////////////////////////////////////////////////
137 | //
138 | // Copyright $$HEX2$$a9002000$$ENDHEX$$1996 Simon Harris (simon@addease.com.au). All Rights Reserved.
139 | //
140 | //////////////////////////////////////////////////////////////////////////////
141 |
142 | unsignedlong lul_decimal
143 |
144 | lul_decimal = al_decimal
145 |
146 | if (Mod(long(lul_decimal / 2 ^(aui_bit - 1)), 2) > 0) then
147 | return true
148 | end if
149 |
150 | return false
151 | end function
152 |
153 | public function long of_bitwiseand (long al_decimala, long al_decimalb);//////////////////////////////////////////////////////////////////////////////
154 | //
155 | // Function: of_BitwiseAND
156 | //
157 | // Access: public
158 | //
159 | // Arguments:
160 | // al_decimala
161 | // al_decimalb
162 | //
163 | // Returns: long
164 | //
165 | // Description: Logically AND 2 numbers
166 | //
167 | // a b result
168 | // -- -- ------
169 | // 0 0 0
170 | // 0 1 0
171 | // 1 0 0
172 | // 1 1 1
173 | //
174 | //////////////////////////////////////////////////////////////////////////////
175 | //
176 | // Revision History
177 | //
178 | // Version
179 | // 1.0 Initial version
180 | //
181 | //////////////////////////////////////////////////////////////////////////////
182 | //
183 | // Copyright $$HEX2$$a9002000$$ENDHEX$$1996 Simon Harris (simon@addease.com.au). All Rights Reserved.
184 | //
185 | //////////////////////////////////////////////////////////////////////////////
186 |
187 | unsignedint lui_bit
188 | long ll_decimal
189 |
190 | ll_decimal = 0
191 |
192 | for lui_bit = 1 to 32
193 | if this.of_GetBit(al_decimala, lui_bit) and this.of_GetBit(al_decimalb, lui_bit) then
194 | ll_decimal = this.of_SetBit(ll_decimal, lui_bit)
195 | end if
196 | next
197 |
198 | return ll_decimal
199 | end function
200 |
201 | public function long of_bitwiseor (long al_decimala, long al_decimalb);//////////////////////////////////////////////////////////////////////////////
202 | //
203 | // Function: of_BitwiseOR
204 | //
205 | // Access: public
206 | //
207 | // Arguments:
208 | // al_decimala
209 | // al_decimalb
210 | //
211 | // Returns: long
212 | //
213 | // Description: Logically OR 2 numbers
214 | //
215 | // a b result
216 | // -- -- ------
217 | // 0 0 0
218 | // 0 1 1
219 | // 1 0 1
220 | // 1 1 1
221 | //
222 | //////////////////////////////////////////////////////////////////////////////
223 | //
224 | // Revision History
225 | //
226 | // Version
227 | // 1.0 Initial version
228 | //
229 | //////////////////////////////////////////////////////////////////////////////
230 | //
231 | // Copyright $$HEX2$$a9002000$$ENDHEX$$1996 Simon Harris (simon@addease.com.au). All Rights Reserved.
232 | //
233 | //////////////////////////////////////////////////////////////////////////////
234 |
235 | unsignedint lui_bit
236 | long ll_decimal
237 |
238 | ll_decimal = 0
239 |
240 | for lui_bit = 1 to 32
241 | if this.of_GetBit(al_decimala, lui_bit) or this.of_GetBit(al_decimalb, lui_bit) then
242 | ll_decimal = this.of_SetBit(ll_decimal, lui_bit)
243 | end if
244 | next
245 |
246 | return ll_decimal
247 | end function
248 |
249 | public function long of_setbit (long al_decimal, unsignedinteger aui_bit);//////////////////////////////////////////////////////////////////////////////
250 | //
251 | // Function: of_SetBit
252 | //
253 | // Access: public
254 | //
255 | // Arguments:
256 | // al_decimal value
257 | // aui_bit bit number to set
258 | //
259 | // Returns: new value
260 | //
261 | // Description: Sets a given bit in a number.
262 | //
263 | //////////////////////////////////////////////////////////////////////////////
264 | //
265 | // Revision History
266 | //
267 | // Version
268 | // 1.0 Initial version
269 | //
270 | //////////////////////////////////////////////////////////////////////////////
271 | //
272 | // Copyright $$HEX2$$a9002000$$ENDHEX$$1996 Simon Harris (simon@addease.com.au). All Rights Reserved.
273 | //
274 | //////////////////////////////////////////////////////////////////////////////
275 |
276 | if not this.of_GetBit(al_decimal, aui_bit) then
277 | return al_decimal + (2 ^ (aui_bit - 1))
278 | end if
279 |
280 | return al_decimal
281 | end function
282 |
283 | public function long of_clearbit (long al_decimal, unsignedinteger aui_bit);//////////////////////////////////////////////////////////////////////////////
284 | //
285 | // Function: of_ClearBit
286 | //
287 | // Access: public
288 | //
289 | // Arguments:
290 | // al_decimal value
291 | // aui_bit bit number to clear
292 | //
293 | // Returns: new value
294 | //
295 | // Description: Clears a given bit in a number.
296 | //
297 | //////////////////////////////////////////////////////////////////////////////
298 | //
299 | // Revision History
300 | //
301 | // Version
302 | // 1.0 Initial version
303 | //
304 | //////////////////////////////////////////////////////////////////////////////
305 | //
306 | // Copyright $$HEX2$$a9002000$$ENDHEX$$1996 Simon Harris (simon@addease.com.au). All Rights Reserved.
307 | //
308 | //////////////////////////////////////////////////////////////////////////////
309 |
310 | if of_GetBit(al_decimal, aui_bit) then
311 | return al_decimal - (2 ^ (aui_bit - 1))
312 | end if
313 |
314 | return al_decimal
315 | end function
316 |
317 | public function long of_flipbit (long al_decimal, unsignedinteger aui_bit);//////////////////////////////////////////////////////////////////////////////
318 | //
319 | // Function: of_FlipBit
320 | //
321 | // Access: public
322 | //
323 | // Arguments:
324 | // al_decimal value
325 | // aui_bit bit number to flip
326 | //
327 | // Returns: new value
328 | //
329 | // Description: Flips a given bit in a number.
330 | //
331 | //////////////////////////////////////////////////////////////////////////////
332 | //
333 | // Revision History
334 | //
335 | // Version
336 | // 1.0 Initial version
337 | //
338 | //////////////////////////////////////////////////////////////////////////////
339 | //
340 | // Copyright $$HEX2$$a9002000$$ENDHEX$$1996 Simon Harris (simon@addease.com.au). All Rights Reserved.
341 | //
342 | //////////////////////////////////////////////////////////////////////////////
343 |
344 | if not this.of_GetBit(al_decimal, aui_bit) then
345 | return this.of_SetBit(al_decimal, aui_bit)
346 | else
347 | return this.of_ClearBit(al_decimal, aui_bit)
348 | end if
349 | end function
350 |
351 | public function long of_bitwisenot (long al_decimal);//////////////////////////////////////////////////////////////////////////////
352 | //
353 | // Function: of_BitwiseNOT
354 | //
355 | // Access: public
356 | //
357 | // Arguments:
358 | // al_decimal value to not
359 | //
360 | // Returns: none
361 | //
362 | // Description: Logically NOT all bits in a number
363 | //
364 | // a result
365 | // -- ------
366 | // 0 1
367 | // 1 0
368 | //
369 | //////////////////////////////////////////////////////////////////////////////
370 | //
371 | // Revision History
372 | //
373 | // Version
374 | // 1.0 Initial version
375 | //
376 | //////////////////////////////////////////////////////////////////////////////
377 | //
378 | // Copyright $$HEX2$$a9002000$$ENDHEX$$1996 Simon Harris (simon@addease.com.au). All Rights Reserved.
379 | //
380 | //////////////////////////////////////////////////////////////////////////////
381 |
382 | unsignedint lui_bit
383 | long ll_decimal
384 |
385 | ll_decimal = 0
386 |
387 | for lui_bit = 1 to 32
388 | if not this.of_GetBit(al_decimal, lui_bit) then
389 | ll_decimal = this.of_SetBit(ll_decimal, lui_bit)
390 | end if
391 | next
392 |
393 | return ll_decimal
394 | end function
395 |
396 | public function long of_bitwisexor (long al_decimala, long al_decimalb);//////////////////////////////////////////////////////////////////////////////
397 | //
398 | // Function: of_BitwiseXOR
399 | //
400 | // Access: public
401 | //
402 | // Arguments:
403 | // al_decimala
404 | // al_decimalb
405 | //
406 | // Returns: long
407 | //
408 | // Description: Logically XOR 2 numbers
409 | //
410 | // a b result
411 | // -- -- ------
412 | // 0 0 0
413 | // 0 1 1
414 | // 1 0 1
415 | // 1 1 0
416 | //
417 | //////////////////////////////////////////////////////////////////////////////
418 | //
419 | // Revision History
420 | //
421 | // Version
422 | // 1.0 Initial version
423 | //
424 | //////////////////////////////////////////////////////////////////////////////
425 | //
426 | // Copyright $$HEX2$$a9002000$$ENDHEX$$1996 Simon Harris (simon@addease.com.au). All Rights Reserved.
427 | //
428 | //////////////////////////////////////////////////////////////////////////////
429 |
430 | unsignedint lui_bit
431 | long ll_decimal
432 |
433 | ll_decimal = 0
434 |
435 | for lui_bit = 1 to 32
436 | if this.of_GetBit(al_decimala, lui_bit) <> this.of_GetBit(al_decimalb, lui_bit) then
437 | ll_decimal += (2 ^ (lui_bit - 1))
438 | end if
439 | next
440 |
441 | return ll_decimal
442 | end function
443 |
444 | public function integer of_bitwiseand (integer ai_decimala, integer ai_decimalb);//////////////////////////////////////////////////////////////////////////////
445 | //
446 | // Function: of_BitwiseAND
447 | //
448 | // Access: public
449 | //
450 | // Arguments:
451 | // ai_decimala
452 | // ai_decimalb
453 | //
454 | // Returns: int
455 | //
456 | // Description: Logically AND 2 numbers
457 | //
458 | // a b result
459 | // -- -- ------
460 | // 0 0 0
461 | // 0 1 0
462 | // 1 0 0
463 | // 1 1 1
464 | //
465 | //////////////////////////////////////////////////////////////////////////////
466 | //
467 | // Revision History
468 | //
469 | // Version
470 | // 1.0 Initial version
471 | //
472 | //////////////////////////////////////////////////////////////////////////////
473 | //
474 | // Copyright $$HEX2$$a9002000$$ENDHEX$$1996 Simon Harris (simon@addease.com.au). All Rights Reserved.
475 | //
476 | //////////////////////////////////////////////////////////////////////////////
477 |
478 | unsignedint lui_bit
479 | int li_decimal
480 |
481 | li_decimal = 0
482 |
483 | for lui_bit = 1 to 16
484 | if this.of_GetBit(ai_decimala, lui_bit) and this.of_GetBit(ai_decimalb, lui_bit) then
485 | li_decimal = this.of_SetBit(li_decimal, lui_bit)
486 | end if
487 | next
488 |
489 | return li_decimal
490 | end function
491 |
492 | public function integer of_bitwiseor (integer ai_decimala, integer ai_decimalb);//////////////////////////////////////////////////////////////////////////////
493 | //
494 | // Function: of_BitwiseOR
495 | //
496 | // Access: public
497 | //
498 | // Arguments:
499 | // ai_decimala
500 | // ai_decimalb
501 | //
502 | // Returns: int
503 | //
504 | // Description: Logically OR 2 numbers
505 | //
506 | // a b result
507 | // -- -- ------
508 | // 0 0 0
509 | // 0 1 1
510 | // 1 0 1
511 | // 1 1 1
512 | //
513 | //////////////////////////////////////////////////////////////////////////////
514 | //
515 | // Revision History
516 | //
517 | // Version
518 | // 1.0 Initial version
519 | //
520 | //////////////////////////////////////////////////////////////////////////////
521 | //
522 | // Copyright $$HEX2$$a9002000$$ENDHEX$$1996 Simon Harris (simon@addease.com.au). All Rights Reserved.
523 | //
524 | //////////////////////////////////////////////////////////////////////////////
525 |
526 | unsignedint lui_bit
527 | int li_decimal
528 |
529 | li_decimal = 0
530 |
531 | for lui_bit = 1 to 16
532 | if this.of_GetBit(ai_decimala, lui_bit) or this.of_GetBit(ai_decimalb, lui_bit) then
533 | li_decimal = this.of_SetBit(li_decimal, lui_bit)
534 | end if
535 | next
536 |
537 | return li_decimal
538 | end function
539 |
540 | public function int of_setbit (int ai_decimal, unsignedinteger aui_bit);//////////////////////////////////////////////////////////////////////////////
541 | //
542 | // Function: of_SetBit
543 | //
544 | // Access: public
545 | //
546 | // Arguments:
547 | // ai_decimal value
548 | // aui_bit bit number to set
549 | //
550 | // Returns: new value
551 | //
552 | // Description: Sets a given bit in a number.
553 | //
554 | //////////////////////////////////////////////////////////////////////////////
555 | //
556 | // Revision History
557 | //
558 | // Version
559 | // 1.0 Initial version
560 | //
561 | //////////////////////////////////////////////////////////////////////////////
562 | //
563 | // Copyright $$HEX2$$a9002000$$ENDHEX$$1996 Simon Harris (simon@addease.com.au). All Rights Reserved.
564 | //
565 | //////////////////////////////////////////////////////////////////////////////
566 |
567 | if not this.of_GetBit(ai_decimal, aui_bit) then
568 | return ai_decimal + (2 ^ (aui_bit - 1))
569 | end if
570 |
571 | return ai_decimal
572 | end function
573 |
574 | public function int of_clearbit (int ai_decimal, unsignedinteger aui_bit);//////////////////////////////////////////////////////////////////////////////
575 | //
576 | // Function: of_ClearBit
577 | //
578 | // Access: public
579 | //
580 | // Arguments:
581 | // ai_decimal value
582 | // aui_bit bit number to clear
583 | //
584 | // Returns: new value
585 | //
586 | // Description: Clears a given bit in a number.
587 | //
588 | //////////////////////////////////////////////////////////////////////////////
589 | //
590 | // Revision History
591 | //
592 | // Version
593 | // 1.0 Initial version
594 | //
595 | //////////////////////////////////////////////////////////////////////////////
596 | //
597 | // Copyright $$HEX2$$a9002000$$ENDHEX$$1996 Simon Harris (simon@addease.com.au). All Rights Reserved.
598 | //
599 | //////////////////////////////////////////////////////////////////////////////
600 |
601 | if of_GetBit(ai_decimal, aui_bit) then
602 | return ai_decimal - (2 ^ (aui_bit - 1))
603 | end if
604 |
605 | return ai_decimal
606 | end function
607 |
608 | public function int of_flipbit (int ai_decimal, unsignedinteger aui_bit);//////////////////////////////////////////////////////////////////////////////
609 | //
610 | // Function: of_FlipBit
611 | //
612 | // Access: public
613 | //
614 | // Arguments:
615 | // ai_decimal value
616 | // aui_bit bit number to flip
617 | //
618 | // Returns: new value
619 | //
620 | // Description: Flips a given bit in a number.
621 | //
622 | //////////////////////////////////////////////////////////////////////////////
623 | //
624 | // Revision History
625 | //
626 | // Version
627 | // 1.0 Initial version
628 | //
629 | //////////////////////////////////////////////////////////////////////////////
630 | //
631 | // Copyright $$HEX2$$a9002000$$ENDHEX$$1996 Simon Harris (simon@addease.com.au). All Rights Reserved.
632 | //
633 | //////////////////////////////////////////////////////////////////////////////
634 |
635 | if not this.of_GetBit(ai_decimal, aui_bit) then
636 | return this.of_SetBit(ai_decimal, aui_bit)
637 | else
638 | return this.of_ClearBit(ai_decimal, aui_bit)
639 | end if
640 | end function
641 |
642 | public function integer of_bitwisenot (integer ai_decimal);//////////////////////////////////////////////////////////////////////////////
643 | //
644 | // Function: of_BitwiseNOT
645 | //
646 | // Access: public
647 | //
648 | // Arguments:
649 | // ai_decimal value to not
650 | //
651 | // Returns: none
652 | //
653 | // Description: Logically NOT all bits in a number
654 | //
655 | // a result
656 | // -- ------
657 | // 0 1
658 | // 1 0
659 | //
660 | //////////////////////////////////////////////////////////////////////////////
661 | //
662 | // Revision History
663 | //
664 | // Version
665 | // 1.0 Initial version
666 | //
667 | //////////////////////////////////////////////////////////////////////////////
668 | //
669 | // Copyright $$HEX2$$a9002000$$ENDHEX$$1996 Simon Harris (simon@addease.com.au). All Rights Reserved.
670 | //
671 | //////////////////////////////////////////////////////////////////////////////
672 |
673 | unsignedint lui_bit
674 | int li_decimal
675 |
676 | li_decimal = 0
677 |
678 | for lui_bit = 1 to 16
679 | if not this.of_GetBit(ai_decimal, lui_bit) then
680 | li_decimal = this.of_SetBit(li_decimal, lui_bit)
681 | end if
682 | next
683 |
684 | return li_decimal
685 | end function
686 |
687 | public function integer of_bitwisexor (integer ai_decimala, integer ai_decimalb);//////////////////////////////////////////////////////////////////////////////
688 | //
689 | // Function: of_BitwiseXOR
690 | //
691 | // Access: public
692 | //
693 | // Arguments:
694 | // ai_decimala
695 | // ai_decimalb
696 | //
697 | // Returns: int
698 | //
699 | // Description: Logically XOR 2 numbers
700 | //
701 | // a b result
702 | // -- -- ------
703 | // 0 0 0
704 | // 0 1 1
705 | // 1 0 1
706 | // 1 1 0
707 | //
708 | //////////////////////////////////////////////////////////////////////////////
709 | //
710 | // Revision History
711 | //
712 | // Version
713 | // 1.0 Initial version
714 | //
715 | //////////////////////////////////////////////////////////////////////////////
716 | //
717 | // Copyright $$HEX2$$a9002000$$ENDHEX$$1996 Simon Harris (simon@addease.com.au). All Rights Reserved.
718 | //
719 | //////////////////////////////////////////////////////////////////////////////
720 |
721 | unsignedint lui_bit
722 | int li_decimal
723 |
724 | li_decimal = 0
725 |
726 | for lui_bit = 1 to 16
727 | if this.of_GetBit(ai_decimala, lui_bit) <> this.of_GetBit(ai_decimalb, lui_bit) then
728 | li_decimal = this.of_SetBit(li_decimal, lui_bit)
729 | end if
730 | next
731 |
732 | return li_decimal
733 | end function
734 |
735 | on n_cst_numerical.create
736 | TriggerEvent( this, "constructor" )
737 | end on
738 |
739 | on n_cst_numerical.destroy
740 | TriggerEvent( this, "destructor" )
741 | end on
742 |
743 |
--------------------------------------------------------------------------------
/PB/src/105/treelist105.pbg:
--------------------------------------------------------------------------------
1 | Save Format v3.0(19990112)
2 | @begin Libraries
3 | "treelist105.pbl" "";
4 | @end;
5 | @begin Objects
6 | "n_cst_numerical.sru" "treelist105.pbl";
7 | "vo_treelist.sru" "treelist105.pbl";
8 | "w_test.srw" "treelist105.pbl";
9 | "treelist105.sra" "treelist105.pbl";
10 | "n_choosefont.sru" "treelist105.pbl";
11 | @end;
12 |
--------------------------------------------------------------------------------
/PB/src/105/treelist105.pbt:
--------------------------------------------------------------------------------
1 | Save Format v3.0(19990112)
2 | appname "treelist105";
3 | applib "treelist105.pbl";
4 | liblist "treelist105.pbl";
5 | type "pb";
6 |
--------------------------------------------------------------------------------
/PB/src/105/treelist105.sra:
--------------------------------------------------------------------------------
1 | HA$PBExportHeader$treelist105.sra
2 | $PBExportComments$Generated Application Object
3 | forward
4 | global type treelist105 from application
5 | end type
6 | global transaction sqlca
7 | global dynamicdescriptionarea sqlda
8 | global dynamicstagingarea sqlsa
9 | global error error
10 | global message message
11 | end forward
12 |
13 | global type treelist105 from application
14 | string appname = "treelist105"
15 | end type
16 | global treelist105 treelist105
17 |
18 | on treelist105.create
19 | appname="treelist105"
20 | message=create message
21 | sqlca=create transaction
22 | sqlda=create dynamicdescriptionarea
23 | sqlsa=create dynamicstagingarea
24 | error=create error
25 | end on
26 |
27 | on treelist105.destroy
28 | destroy(sqlca)
29 | destroy(sqlda)
30 | destroy(sqlsa)
31 | destroy(error)
32 | destroy(message)
33 | end on
34 |
35 | event open;
36 | open(w_test)
37 |
38 | end event
39 |
40 |
--------------------------------------------------------------------------------
/PB/src/105/vo_treelist.sru:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sebkirche/treelist/f005e8d715aa0c831c5bc98ef6add7798d1c26dd/PB/src/105/vo_treelist.sru
--------------------------------------------------------------------------------
/PB/src/105/w_test.srw:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sebkirche/treelist/f005e8d715aa0c831c5bc98ef6add7798d1c26dd/PB/src/105/w_test.srw
--------------------------------------------------------------------------------
/PB/src/115/n_choosefont.sru:
--------------------------------------------------------------------------------
1 | HA$PBExportHeader$n_choosefont.sru
2 | forward
3 | global type n_choosefont from nonvisualobject
4 | end type
5 | type choosefont from structure within n_choosefont
6 | end type
7 | type logfont from structure within n_choosefont
8 | end type
9 | end forward
10 |
11 | type choosefont from structure
12 | long lstructsize
13 | ulong hwnd
14 | ulong hdc
15 | long lplogfont
16 | long ipointsize
17 | long flags
18 | long rgbcolors
19 | long lcustdata
20 | long lpfnhook
21 | string templatename
22 | ulong hinstance
23 | string lpszstyle
24 | integer nfonttype
25 | integer missingalignment
26 | long nsizemin
27 | ulong nsizelong
28 | end type
29 |
30 | type logfont from structure
31 | long lfheight
32 | long lfwidth
33 | long lfescapement
34 | long lforientation
35 | long lfweight
36 | byte lfitalic
37 | byte lfunderline
38 | byte lfstrikeout
39 | byte lfcharset
40 | byte lfoutprecision
41 | byte lfclipprecision
42 | byte lfquality
43 | byte lfpitchandfamily
44 | character lffacename[32]
45 | end type
46 |
47 | global type n_choosefont from nonvisualobject autoinstantiate
48 | end type
49 |
50 | type prototypes
51 | Function boolean ChooseFont ( &
52 | Ref CHOOSEFONT lpcf &
53 | ) Library "comdlg32.dll" Alias For "ChooseFontW"
54 |
55 | Subroutine CopyMemory ( &
56 | Ref LOGFONT Destination, &
57 | long Source, &
58 | long Length &
59 | ) Library "kernel32.dll" Alias For "RtlMoveMemory"
60 |
61 | Subroutine CopyMemory ( &
62 | long Destination, &
63 | LOGFONT Source, &
64 | long Length &
65 | ) Library "kernel32.dll" Alias For "RtlMoveMemory"
66 |
67 | Function ulong GlobalAlloc ( &
68 | ulong uFlags, &
69 | long dwBytes &
70 | ) Library "kernel32.dll"
71 |
72 | Function ulong GlobalLock ( &
73 | ulong hMem &
74 | ) Library "kernel32.dll"
75 |
76 | Function ulong GlobalUnlock ( &
77 | ulong hMem &
78 | ) Library "kernel32.dll"
79 |
80 | Function ulong GlobalFree ( &
81 | ulong hMem &
82 | ) Library "kernel32.dll"
83 |
84 | end prototypes
85 |
86 | type variables
87 |
88 | // ChooseFont standard dialog wrapper - Roland Smith 2009
89 | //
90 | // see http://www.topwizprogramming.com/freecode_choosefont.html
91 |
92 | Integer iTextSize
93 | Boolean iBold
94 | Boolean iUnderline
95 | Boolean iItalic
96 | Boolean iStrikeout
97 | String iFaceName
98 | Long iTextColor
99 | Long iWeight
100 |
101 | end variables
102 |
103 | forward prototypes
104 | public function boolean of_choosefont (window aw_parent, string as_fontname)
105 | end prototypes
106 |
107 | public function boolean of_choosefont (window aw_parent, string as_fontname);Constant Integer CF_SCREENFONTS = 1
108 | Constant Integer CF_INITTOLOGFONTSTRUCT = 64
109 | Constant Integer CF_EFFECTS = 256
110 | Constant Integer GMEM_MOVEABLE = 2
111 | CHOOSEFONT lstr_choosefont
112 | LOGFONT lstr_logfont
113 | Long ll_LogFont
114 |
115 | // we allocate a piece of memory with the size of the logfont structure
116 | // and we lock it
117 | ll_LogFont = GlobalAlloc(GMEM_MOVEABLE, 120)
118 | If ll_LogFont = 0 Then Return False
119 |
120 | ll_LogFont = GlobalLock(ll_LogFont)
121 | If ll_LogFont = 0 Then Return False
122 |
123 | /* initialise the logfont structure */
124 |
125 | // default font
126 | If as_fontname = "" Then
127 | lstr_logfont.lffacename = "Arial"
128 | Else
129 | lstr_logfont.lffacename = as_fontname
130 | End If
131 | lstr_logfont.lfweight = 400
132 | lstr_logfont.lfheight = 12
133 |
134 | // copy the structure to the allocated piece in memory
135 | CopyMemory(ll_LogFont, lstr_Logfont, 60)
136 |
137 | // assign the pointer to the fontinfo in memory to the dialog font
138 | lstr_ChooseFont.lplogfont = ll_LogFont
139 |
140 | // initialise the structure further
141 | lstr_ChooseFont.lstructsize = 60
142 | lstr_ChooseFont.hwnd = Handle(aw_parent)
143 | lstr_ChooseFont.flags = CF_SCREENFONTS+CF_INITTOLOGFONTSTRUCT+CF_EFFECTS
144 |
145 | // call the dialog
146 | If Not ChooseFont(lstr_ChooseFont) Then
147 | GlobalUnlock(ll_LogFont)
148 | GlobalFree(ll_LogFont)
149 | Return False
150 | End If
151 |
152 | // The memory piece now contains the selected log information
153 | // Copy this information back to the structure so we can access it
154 | CopyMemory(lstr_LogFont, lstr_ChooseFont.lplogfont, 120)
155 |
156 | // release the used memory
157 | GlobalUnlock(ll_LogFont)
158 | GlobalFree(ll_LogFont)
159 |
160 | // save the results in instance variables
161 | iTextSize = (lstr_ChooseFont.iPointSize / 10) * -1
162 | iWeight = lstr_LogFont.lfWeight
163 | If iWeight = 700 Then
164 | iBold = True
165 | Else
166 | iBold = False
167 | End If
168 | iFaceName = Trim(lstr_LogFont.lfFaceName)
169 | iTextColor = lstr_ChooseFont.rgbColors
170 |
171 | iUnderline = (lstr_LogFont.lfUnderline > 0)
172 | iItalic = (lstr_LogFont.lfItalic > 0)
173 | iStrikeout = (lstr_LogFont.lfStrikeout > 0)
174 |
175 | Return True
176 |
177 | end function
178 |
179 | on n_choosefont.create
180 | call super::create
181 | TriggerEvent( this, "constructor" )
182 | end on
183 |
184 | on n_choosefont.destroy
185 | TriggerEvent( this, "destructor" )
186 | call super::destroy
187 | end on
188 |
189 |
--------------------------------------------------------------------------------
/PB/src/115/n_cst_numerical.sru:
--------------------------------------------------------------------------------
1 | HA$PBExportHeader$n_cst_numerical.sru
2 | forward
3 | global type n_cst_numerical from nonvisualobject
4 | end type
5 | end forward
6 |
7 | global type n_cst_numerical from nonvisualobject autoinstantiate
8 | end type
9 |
10 | forward prototypes
11 | public function string of_binary (long al_decimal)
12 | public function long of_decimal (string as_binary)
13 | public function boolean of_getbit (long al_decimal, unsignedinteger aui_bit)
14 | public function long of_bitwiseand (long al_decimala, long al_decimalb)
15 | public function long of_bitwiseor (long al_decimala, long al_decimalb)
16 | public function long of_setbit (long al_decimal, unsignedinteger aui_bit)
17 | public function long of_clearbit (long al_decimal, unsignedinteger aui_bit)
18 | public function long of_flipbit (long al_decimal, unsignedinteger aui_bit)
19 | public function long of_bitwisenot (long al_decimal)
20 | public function long of_bitwisexor (long al_decimala, long al_decimalb)
21 | public function integer of_bitwiseand (integer ai_decimala, integer ai_decimalb)
22 | public function integer of_bitwiseor (integer ai_decimala, integer ai_decimalb)
23 | public function int of_setbit (int ai_decimal, unsignedinteger aui_bit)
24 | public function int of_clearbit (int ai_decimal, unsignedinteger aui_bit)
25 | public function int of_flipbit (int ai_decimal, unsignedinteger aui_bit)
26 | public function integer of_bitwisenot (integer ai_decimal)
27 | public function integer of_bitwisexor (integer ai_decimala, integer ai_decimalb)
28 | end prototypes
29 |
30 | public function string of_binary (long al_decimal);//////////////////////////////////////////////////////////////////////////////
31 | //
32 | // Function: of_Binary
33 | //
34 | // Access: public
35 | //
36 | // Arguments:
37 | // al_decimal unsigned long to convert to bit string
38 | //
39 | // Returns: string
40 | //
41 | // Description: Convert al_decimal to a string of 32 1's and 0's in
42 | // big-endian format i.e with LSB at position 1.
43 | //
44 | //////////////////////////////////////////////////////////////////////////////
45 | //
46 | // Revision History
47 | //
48 | // Version
49 | // 1.0 Initial version
50 | //
51 | //////////////////////////////////////////////////////////////////////////////
52 | //
53 | // Copyright $$HEX2$$a9002000$$ENDHEX$$1996 Simon Harris (simon@addease.com.au). All Rights Reserved.
54 | //
55 | //////////////////////////////////////////////////////////////////////////////
56 |
57 | string ls_binary
58 | unsignedint lui_cnt
59 | long ll_remainder
60 | unsignedlong lul_decimal
61 |
62 | lul_decimal = al_decimal
63 |
64 | for lui_cnt = 1 to 32
65 | ll_remainder = mod(lul_decimal, 2)
66 | lul_decimal = lul_decimal / 2
67 |
68 | ls_binary = ls_binary + string(ll_remainder)
69 | next
70 |
71 | return ls_binary
72 | end function
73 |
74 | public function long of_decimal (string as_binary);//////////////////////////////////////////////////////////////////////////////
75 | //
76 | // Function: of_Decimal
77 | //
78 | // Access: public
79 | //
80 | // Arguments:
81 | // as_binary string to convert
82 | //
83 | // Returns: long
84 | //
85 | // Description: Convert an array of 1's and 0's in big-endian format
86 | // i.e. LSB at index 1 to a number.
87 | //
88 | //////////////////////////////////////////////////////////////////////////////
89 | //
90 | // Revision History
91 | //
92 | // Version
93 | // 1.0 Initial version
94 | //
95 | //////////////////////////////////////////////////////////////////////////////
96 | //
97 | // Copyright $$HEX2$$a9002000$$ENDHEX$$1996 Simon Harris (simon@addease.com.au). All Rights Reserved.
98 | //
99 | //////////////////////////////////////////////////////////////////////////////
100 |
101 | long ll_decimal
102 | unsignedint lui_cnt
103 |
104 | // Propogate the sign bit
105 | as_binary += Fill(Right(as_binary, 1), 31)
106 |
107 | // Calculate the value
108 | for lui_cnt = 1 to 32
109 | ll_decimal = ll_decimal + (long(Mid(as_binary, lui_cnt, 1)) * (2 ^ (lui_cnt - 1)))
110 | next
111 |
112 | return ll_decimal
113 | end function
114 |
115 | public function boolean of_getbit (long al_decimal, unsignedinteger aui_bit);//////////////////////////////////////////////////////////////////////////////
116 | //
117 | // Function: of_GetBit
118 | //
119 | // Access: public
120 | //
121 | // Arguments:
122 | // al_decimal value
123 | // aui_bit bit number to test
124 | //
125 | // Returns: boolean
126 | //
127 | // Description: Tests a given bit in a number.
128 | //
129 | //////////////////////////////////////////////////////////////////////////////
130 | //
131 | // Revision History
132 | //
133 | // Version
134 | // 1.0 Initial version
135 | //
136 | //////////////////////////////////////////////////////////////////////////////
137 | //
138 | // Copyright $$HEX2$$a9002000$$ENDHEX$$1996 Simon Harris (simon@addease.com.au). All Rights Reserved.
139 | //
140 | //////////////////////////////////////////////////////////////////////////////
141 |
142 | unsignedlong lul_decimal
143 |
144 | lul_decimal = al_decimal
145 |
146 | if (Mod(long(lul_decimal / 2 ^(aui_bit - 1)), 2) > 0) then
147 | return true
148 | end if
149 |
150 | return false
151 | end function
152 |
153 | public function long of_bitwiseand (long al_decimala, long al_decimalb);//////////////////////////////////////////////////////////////////////////////
154 | //
155 | // Function: of_BitwiseAND
156 | //
157 | // Access: public
158 | //
159 | // Arguments:
160 | // al_decimala
161 | // al_decimalb
162 | //
163 | // Returns: long
164 | //
165 | // Description: Logically AND 2 numbers
166 | //
167 | // a b result
168 | // -- -- ------
169 | // 0 0 0
170 | // 0 1 0
171 | // 1 0 0
172 | // 1 1 1
173 | //
174 | //////////////////////////////////////////////////////////////////////////////
175 | //
176 | // Revision History
177 | //
178 | // Version
179 | // 1.0 Initial version
180 | //
181 | //////////////////////////////////////////////////////////////////////////////
182 | //
183 | // Copyright $$HEX2$$a9002000$$ENDHEX$$1996 Simon Harris (simon@addease.com.au). All Rights Reserved.
184 | //
185 | //////////////////////////////////////////////////////////////////////////////
186 |
187 | unsignedint lui_bit
188 | long ll_decimal
189 |
190 | ll_decimal = 0
191 |
192 | for lui_bit = 1 to 32
193 | if this.of_GetBit(al_decimala, lui_bit) and this.of_GetBit(al_decimalb, lui_bit) then
194 | ll_decimal = this.of_SetBit(ll_decimal, lui_bit)
195 | end if
196 | next
197 |
198 | return ll_decimal
199 | end function
200 |
201 | public function long of_bitwiseor (long al_decimala, long al_decimalb);//////////////////////////////////////////////////////////////////////////////
202 | //
203 | // Function: of_BitwiseOR
204 | //
205 | // Access: public
206 | //
207 | // Arguments:
208 | // al_decimala
209 | // al_decimalb
210 | //
211 | // Returns: long
212 | //
213 | // Description: Logically OR 2 numbers
214 | //
215 | // a b result
216 | // -- -- ------
217 | // 0 0 0
218 | // 0 1 1
219 | // 1 0 1
220 | // 1 1 1
221 | //
222 | //////////////////////////////////////////////////////////////////////////////
223 | //
224 | // Revision History
225 | //
226 | // Version
227 | // 1.0 Initial version
228 | //
229 | //////////////////////////////////////////////////////////////////////////////
230 | //
231 | // Copyright $$HEX2$$a9002000$$ENDHEX$$1996 Simon Harris (simon@addease.com.au). All Rights Reserved.
232 | //
233 | //////////////////////////////////////////////////////////////////////////////
234 |
235 | unsignedint lui_bit
236 | long ll_decimal
237 |
238 | ll_decimal = 0
239 |
240 | for lui_bit = 1 to 32
241 | if this.of_GetBit(al_decimala, lui_bit) or this.of_GetBit(al_decimalb, lui_bit) then
242 | ll_decimal = this.of_SetBit(ll_decimal, lui_bit)
243 | end if
244 | next
245 |
246 | return ll_decimal
247 | end function
248 |
249 | public function long of_setbit (long al_decimal, unsignedinteger aui_bit);//////////////////////////////////////////////////////////////////////////////
250 | //
251 | // Function: of_SetBit
252 | //
253 | // Access: public
254 | //
255 | // Arguments:
256 | // al_decimal value
257 | // aui_bit bit number to set
258 | //
259 | // Returns: new value
260 | //
261 | // Description: Sets a given bit in a number.
262 | //
263 | //////////////////////////////////////////////////////////////////////////////
264 | //
265 | // Revision History
266 | //
267 | // Version
268 | // 1.0 Initial version
269 | //
270 | //////////////////////////////////////////////////////////////////////////////
271 | //
272 | // Copyright $$HEX2$$a9002000$$ENDHEX$$1996 Simon Harris (simon@addease.com.au). All Rights Reserved.
273 | //
274 | //////////////////////////////////////////////////////////////////////////////
275 |
276 | if not this.of_GetBit(al_decimal, aui_bit) then
277 | return al_decimal + (2 ^ (aui_bit - 1))
278 | end if
279 |
280 | return al_decimal
281 | end function
282 |
283 | public function long of_clearbit (long al_decimal, unsignedinteger aui_bit);//////////////////////////////////////////////////////////////////////////////
284 | //
285 | // Function: of_ClearBit
286 | //
287 | // Access: public
288 | //
289 | // Arguments:
290 | // al_decimal value
291 | // aui_bit bit number to clear
292 | //
293 | // Returns: new value
294 | //
295 | // Description: Clears a given bit in a number.
296 | //
297 | //////////////////////////////////////////////////////////////////////////////
298 | //
299 | // Revision History
300 | //
301 | // Version
302 | // 1.0 Initial version
303 | //
304 | //////////////////////////////////////////////////////////////////////////////
305 | //
306 | // Copyright $$HEX2$$a9002000$$ENDHEX$$1996 Simon Harris (simon@addease.com.au). All Rights Reserved.
307 | //
308 | //////////////////////////////////////////////////////////////////////////////
309 |
310 | if of_GetBit(al_decimal, aui_bit) then
311 | return al_decimal - (2 ^ (aui_bit - 1))
312 | end if
313 |
314 | return al_decimal
315 | end function
316 |
317 | public function long of_flipbit (long al_decimal, unsignedinteger aui_bit);//////////////////////////////////////////////////////////////////////////////
318 | //
319 | // Function: of_FlipBit
320 | //
321 | // Access: public
322 | //
323 | // Arguments:
324 | // al_decimal value
325 | // aui_bit bit number to flip
326 | //
327 | // Returns: new value
328 | //
329 | // Description: Flips a given bit in a number.
330 | //
331 | //////////////////////////////////////////////////////////////////////////////
332 | //
333 | // Revision History
334 | //
335 | // Version
336 | // 1.0 Initial version
337 | //
338 | //////////////////////////////////////////////////////////////////////////////
339 | //
340 | // Copyright $$HEX2$$a9002000$$ENDHEX$$1996 Simon Harris (simon@addease.com.au). All Rights Reserved.
341 | //
342 | //////////////////////////////////////////////////////////////////////////////
343 |
344 | if not this.of_GetBit(al_decimal, aui_bit) then
345 | return this.of_SetBit(al_decimal, aui_bit)
346 | else
347 | return this.of_ClearBit(al_decimal, aui_bit)
348 | end if
349 | end function
350 |
351 | public function long of_bitwisenot (long al_decimal);//////////////////////////////////////////////////////////////////////////////
352 | //
353 | // Function: of_BitwiseNOT
354 | //
355 | // Access: public
356 | //
357 | // Arguments:
358 | // al_decimal value to not
359 | //
360 | // Returns: none
361 | //
362 | // Description: Logically NOT all bits in a number
363 | //
364 | // a result
365 | // -- ------
366 | // 0 1
367 | // 1 0
368 | //
369 | //////////////////////////////////////////////////////////////////////////////
370 | //
371 | // Revision History
372 | //
373 | // Version
374 | // 1.0 Initial version
375 | //
376 | //////////////////////////////////////////////////////////////////////////////
377 | //
378 | // Copyright $$HEX2$$a9002000$$ENDHEX$$1996 Simon Harris (simon@addease.com.au). All Rights Reserved.
379 | //
380 | //////////////////////////////////////////////////////////////////////////////
381 |
382 | unsignedint lui_bit
383 | long ll_decimal
384 |
385 | ll_decimal = 0
386 |
387 | for lui_bit = 1 to 32
388 | if not this.of_GetBit(al_decimal, lui_bit) then
389 | ll_decimal = this.of_SetBit(ll_decimal, lui_bit)
390 | end if
391 | next
392 |
393 | return ll_decimal
394 | end function
395 |
396 | public function long of_bitwisexor (long al_decimala, long al_decimalb);//////////////////////////////////////////////////////////////////////////////
397 | //
398 | // Function: of_BitwiseXOR
399 | //
400 | // Access: public
401 | //
402 | // Arguments:
403 | // al_decimala
404 | // al_decimalb
405 | //
406 | // Returns: long
407 | //
408 | // Description: Logically XOR 2 numbers
409 | //
410 | // a b result
411 | // -- -- ------
412 | // 0 0 0
413 | // 0 1 1
414 | // 1 0 1
415 | // 1 1 0
416 | //
417 | //////////////////////////////////////////////////////////////////////////////
418 | //
419 | // Revision History
420 | //
421 | // Version
422 | // 1.0 Initial version
423 | //
424 | //////////////////////////////////////////////////////////////////////////////
425 | //
426 | // Copyright $$HEX2$$a9002000$$ENDHEX$$1996 Simon Harris (simon@addease.com.au). All Rights Reserved.
427 | //
428 | //////////////////////////////////////////////////////////////////////////////
429 |
430 | unsignedint lui_bit
431 | long ll_decimal
432 |
433 | ll_decimal = 0
434 |
435 | for lui_bit = 1 to 32
436 | if this.of_GetBit(al_decimala, lui_bit) <> this.of_GetBit(al_decimalb, lui_bit) then
437 | ll_decimal += (2 ^ (lui_bit - 1))
438 | end if
439 | next
440 |
441 | return ll_decimal
442 | end function
443 |
444 | public function integer of_bitwiseand (integer ai_decimala, integer ai_decimalb);//////////////////////////////////////////////////////////////////////////////
445 | //
446 | // Function: of_BitwiseAND
447 | //
448 | // Access: public
449 | //
450 | // Arguments:
451 | // ai_decimala
452 | // ai_decimalb
453 | //
454 | // Returns: int
455 | //
456 | // Description: Logically AND 2 numbers
457 | //
458 | // a b result
459 | // -- -- ------
460 | // 0 0 0
461 | // 0 1 0
462 | // 1 0 0
463 | // 1 1 1
464 | //
465 | //////////////////////////////////////////////////////////////////////////////
466 | //
467 | // Revision History
468 | //
469 | // Version
470 | // 1.0 Initial version
471 | //
472 | //////////////////////////////////////////////////////////////////////////////
473 | //
474 | // Copyright $$HEX2$$a9002000$$ENDHEX$$1996 Simon Harris (simon@addease.com.au). All Rights Reserved.
475 | //
476 | //////////////////////////////////////////////////////////////////////////////
477 |
478 | unsignedint lui_bit
479 | int li_decimal
480 |
481 | li_decimal = 0
482 |
483 | for lui_bit = 1 to 16
484 | if this.of_GetBit(ai_decimala, lui_bit) and this.of_GetBit(ai_decimalb, lui_bit) then
485 | li_decimal = this.of_SetBit(li_decimal, lui_bit)
486 | end if
487 | next
488 |
489 | return li_decimal
490 | end function
491 |
492 | public function integer of_bitwiseor (integer ai_decimala, integer ai_decimalb);//////////////////////////////////////////////////////////////////////////////
493 | //
494 | // Function: of_BitwiseOR
495 | //
496 | // Access: public
497 | //
498 | // Arguments:
499 | // ai_decimala
500 | // ai_decimalb
501 | //
502 | // Returns: int
503 | //
504 | // Description: Logically OR 2 numbers
505 | //
506 | // a b result
507 | // -- -- ------
508 | // 0 0 0
509 | // 0 1 1
510 | // 1 0 1
511 | // 1 1 1
512 | //
513 | //////////////////////////////////////////////////////////////////////////////
514 | //
515 | // Revision History
516 | //
517 | // Version
518 | // 1.0 Initial version
519 | //
520 | //////////////////////////////////////////////////////////////////////////////
521 | //
522 | // Copyright $$HEX2$$a9002000$$ENDHEX$$1996 Simon Harris (simon@addease.com.au). All Rights Reserved.
523 | //
524 | //////////////////////////////////////////////////////////////////////////////
525 |
526 | unsignedint lui_bit
527 | int li_decimal
528 |
529 | li_decimal = 0
530 |
531 | for lui_bit = 1 to 16
532 | if this.of_GetBit(ai_decimala, lui_bit) or this.of_GetBit(ai_decimalb, lui_bit) then
533 | li_decimal = this.of_SetBit(li_decimal, lui_bit)
534 | end if
535 | next
536 |
537 | return li_decimal
538 | end function
539 |
540 | public function int of_setbit (int ai_decimal, unsignedinteger aui_bit);//////////////////////////////////////////////////////////////////////////////
541 | //
542 | // Function: of_SetBit
543 | //
544 | // Access: public
545 | //
546 | // Arguments:
547 | // ai_decimal value
548 | // aui_bit bit number to set
549 | //
550 | // Returns: new value
551 | //
552 | // Description: Sets a given bit in a number.
553 | //
554 | //////////////////////////////////////////////////////////////////////////////
555 | //
556 | // Revision History
557 | //
558 | // Version
559 | // 1.0 Initial version
560 | //
561 | //////////////////////////////////////////////////////////////////////////////
562 | //
563 | // Copyright $$HEX2$$a9002000$$ENDHEX$$1996 Simon Harris (simon@addease.com.au). All Rights Reserved.
564 | //
565 | //////////////////////////////////////////////////////////////////////////////
566 |
567 | if not this.of_GetBit(ai_decimal, aui_bit) then
568 | return ai_decimal + (2 ^ (aui_bit - 1))
569 | end if
570 |
571 | return ai_decimal
572 | end function
573 |
574 | public function int of_clearbit (int ai_decimal, unsignedinteger aui_bit);//////////////////////////////////////////////////////////////////////////////
575 | //
576 | // Function: of_ClearBit
577 | //
578 | // Access: public
579 | //
580 | // Arguments:
581 | // ai_decimal value
582 | // aui_bit bit number to clear
583 | //
584 | // Returns: new value
585 | //
586 | // Description: Clears a given bit in a number.
587 | //
588 | //////////////////////////////////////////////////////////////////////////////
589 | //
590 | // Revision History
591 | //
592 | // Version
593 | // 1.0 Initial version
594 | //
595 | //////////////////////////////////////////////////////////////////////////////
596 | //
597 | // Copyright $$HEX2$$a9002000$$ENDHEX$$1996 Simon Harris (simon@addease.com.au). All Rights Reserved.
598 | //
599 | //////////////////////////////////////////////////////////////////////////////
600 |
601 | if of_GetBit(ai_decimal, aui_bit) then
602 | return ai_decimal - (2 ^ (aui_bit - 1))
603 | end if
604 |
605 | return ai_decimal
606 | end function
607 |
608 | public function int of_flipbit (int ai_decimal, unsignedinteger aui_bit);//////////////////////////////////////////////////////////////////////////////
609 | //
610 | // Function: of_FlipBit
611 | //
612 | // Access: public
613 | //
614 | // Arguments:
615 | // ai_decimal value
616 | // aui_bit bit number to flip
617 | //
618 | // Returns: new value
619 | //
620 | // Description: Flips a given bit in a number.
621 | //
622 | //////////////////////////////////////////////////////////////////////////////
623 | //
624 | // Revision History
625 | //
626 | // Version
627 | // 1.0 Initial version
628 | //
629 | //////////////////////////////////////////////////////////////////////////////
630 | //
631 | // Copyright $$HEX2$$a9002000$$ENDHEX$$1996 Simon Harris (simon@addease.com.au). All Rights Reserved.
632 | //
633 | //////////////////////////////////////////////////////////////////////////////
634 |
635 | if not this.of_GetBit(ai_decimal, aui_bit) then
636 | return this.of_SetBit(ai_decimal, aui_bit)
637 | else
638 | return this.of_ClearBit(ai_decimal, aui_bit)
639 | end if
640 | end function
641 |
642 | public function integer of_bitwisenot (integer ai_decimal);//////////////////////////////////////////////////////////////////////////////
643 | //
644 | // Function: of_BitwiseNOT
645 | //
646 | // Access: public
647 | //
648 | // Arguments:
649 | // ai_decimal value to not
650 | //
651 | // Returns: none
652 | //
653 | // Description: Logically NOT all bits in a number
654 | //
655 | // a result
656 | // -- ------
657 | // 0 1
658 | // 1 0
659 | //
660 | //////////////////////////////////////////////////////////////////////////////
661 | //
662 | // Revision History
663 | //
664 | // Version
665 | // 1.0 Initial version
666 | //
667 | //////////////////////////////////////////////////////////////////////////////
668 | //
669 | // Copyright $$HEX2$$a9002000$$ENDHEX$$1996 Simon Harris (simon@addease.com.au). All Rights Reserved.
670 | //
671 | //////////////////////////////////////////////////////////////////////////////
672 |
673 | unsignedint lui_bit
674 | int li_decimal
675 |
676 | li_decimal = 0
677 |
678 | for lui_bit = 1 to 16
679 | if not this.of_GetBit(ai_decimal, lui_bit) then
680 | li_decimal = this.of_SetBit(li_decimal, lui_bit)
681 | end if
682 | next
683 |
684 | return li_decimal
685 | end function
686 |
687 | public function integer of_bitwisexor (integer ai_decimala, integer ai_decimalb);//////////////////////////////////////////////////////////////////////////////
688 | //
689 | // Function: of_BitwiseXOR
690 | //
691 | // Access: public
692 | //
693 | // Arguments:
694 | // ai_decimala
695 | // ai_decimalb
696 | //
697 | // Returns: int
698 | //
699 | // Description: Logically XOR 2 numbers
700 | //
701 | // a b result
702 | // -- -- ------
703 | // 0 0 0
704 | // 0 1 1
705 | // 1 0 1
706 | // 1 1 0
707 | //
708 | //////////////////////////////////////////////////////////////////////////////
709 | //
710 | // Revision History
711 | //
712 | // Version
713 | // 1.0 Initial version
714 | //
715 | //////////////////////////////////////////////////////////////////////////////
716 | //
717 | // Copyright $$HEX2$$a9002000$$ENDHEX$$1996 Simon Harris (simon@addease.com.au). All Rights Reserved.
718 | //
719 | //////////////////////////////////////////////////////////////////////////////
720 |
721 | unsignedint lui_bit
722 | int li_decimal
723 |
724 | li_decimal = 0
725 |
726 | for lui_bit = 1 to 16
727 | if this.of_GetBit(ai_decimala, lui_bit) <> this.of_GetBit(ai_decimalb, lui_bit) then
728 | li_decimal = this.of_SetBit(li_decimal, lui_bit)
729 | end if
730 | next
731 |
732 | return li_decimal
733 | end function
734 |
735 | on n_cst_numerical.create
736 | TriggerEvent( this, "constructor" )
737 | end on
738 |
739 | on n_cst_numerical.destroy
740 | TriggerEvent( this, "destructor" )
741 | end on
742 |
743 |
--------------------------------------------------------------------------------
/PB/src/115/treelist115.pbg:
--------------------------------------------------------------------------------
1 | Save Format v3.0(19990112)
2 | @begin Libraries
3 | "treelist115.pbl" "";
4 | @end;
5 | @begin Objects
6 | "w_test.srw" "treelist115.pbl";
7 | "treelist115.sra" "treelist115.pbl";
8 | "n_cst_numerical.sru" "treelist115.pbl";
9 | "treelistdemo.srj" "treelist115.pbl";
10 | "n_choosefont.sru" "treelist115.pbl";
11 | "vo_treelist.sru" "treelist115.pbl";
12 | @end;
13 |
--------------------------------------------------------------------------------
/PB/src/115/treelist115.pbt:
--------------------------------------------------------------------------------
1 | Save Format v3.0(19990112)
2 | @begin Projects
3 | @end;
4 | appname "treelist115";
5 | applib "treelist115.pbl";
6 | LibList "treelist115.pbl";
7 | type "pb";
8 |
--------------------------------------------------------------------------------
/PB/src/115/treelist115.sra:
--------------------------------------------------------------------------------
1 | HA$PBExportHeader$treelist115.sra
2 | $PBExportComments$Generated Application Object
3 | forward
4 | global type treelist115 from application
5 | end type
6 | global transaction sqlca
7 | global dynamicdescriptionarea sqlda
8 | global dynamicstagingarea sqlsa
9 | global error error
10 | global message message
11 | end forward
12 |
13 | global type treelist115 from application
14 | string appname = "treelist115"
15 | end type
16 | global treelist115 treelist115
17 |
18 | on treelist115.create
19 | appname="treelist115"
20 | message=create message
21 | sqlca=create transaction
22 | sqlda=create dynamicdescriptionarea
23 | sqlsa=create dynamicstagingarea
24 | error=create error
25 | end on
26 |
27 | on treelist115.destroy
28 | destroy(sqlca)
29 | destroy(sqlda)
30 | destroy(sqlsa)
31 | destroy(error)
32 | destroy(message)
33 | end on
34 |
35 | event open;
36 | open(w_test)
37 |
38 | end event
39 |
40 |
--------------------------------------------------------------------------------
/PB/src/115/treelistdemo.srj:
--------------------------------------------------------------------------------
1 | HA$PBExportHeader$treelistdemo.srj
2 | EXE:TreeListDemo115.exe,TreeList.pbr,0,1,1
3 | CMP:0,0,0,2,0,0,1
4 | COM:seki.fr
5 | DES:TreeList Demo sample
6 | CPY:2014
7 | PRD:TreeList Demo
8 | PVS:1.0.0.1
9 | PVN:1,0,0,1
10 | FVS:1.0.0.1
11 | FVN:1,0,0,1
12 | MAN:0,asInvoker,0
13 | PBD:treelist115.pbl,TreeList.pbr,0
14 | OBJ:C:\dev\c_cpp\win32\TreeList\PB\treelist115.pbl,treelist115,a
15 | OBJ:c:\dev\c_cpp\win32\treelist\pb\treelist115.pbl,w_test,w
16 | OBJ:c:\dev\c_cpp\win32\treelist\pb\treelist115.pbl,n_cst_numerical,u
17 | OBJ:c:\dev\c_cpp\win32\treelist\pb\treelist115.pbl,n_choosefont,u
18 | OBJ:c:\dev\c_cpp\win32\treelist\pb\treelist115.pbl,vo_treelist,u
19 |
--------------------------------------------------------------------------------
/PB/src/90/n_choosefont.sru:
--------------------------------------------------------------------------------
1 | $PBExportHeader$n_choosefont.sru
2 | forward
3 | global type n_choosefont from nonvisualobject
4 | end type
5 | type choosefont from structure within n_choosefont
6 | end type
7 | type logfont from structure within n_choosefont
8 | end type
9 | end forward
10 |
11 | type choosefont from structure
12 | long lstructsize
13 | ulong hwnd
14 | ulong hdc
15 | long lplogfont
16 | long ipointsize
17 | long flags
18 | long rgbcolors
19 | long lcustdata
20 | long lpfnhook
21 | string templatename
22 | ulong hinstance
23 | string lpszstyle
24 | integer nfonttype
25 | integer missingalignment
26 | long nsizemin
27 | ulong nsizelong
28 | end type
29 |
30 | type logfont from structure
31 | long lfheight
32 | long lfwidth
33 | long lfescapement
34 | long lforientation
35 | long lfweight
36 | character lfitalic
37 | character lfunderline
38 | character lfstrikeout
39 | character lfcharset
40 | character lfoutprecision
41 | character lfclipprecision
42 | character lfquality
43 | character lfpitchandfamily
44 | character lffacename[32]
45 | end type
46 |
47 | global type n_choosefont from nonvisualobject autoinstantiate
48 | end type
49 |
50 | type prototypes
51 | Function boolean ChooseFont ( &
52 | Ref CHOOSEFONT lpcf &
53 | ) Library "comdlg32.dll" Alias For "ChooseFontA"
54 |
55 | Subroutine CopyMemory ( &
56 | Ref LOGFONT Destination, &
57 | long Source, &
58 | long Length &
59 | ) Library "kernel32.dll" Alias For "RtlMoveMemory"
60 |
61 | Subroutine CopyMemory ( &
62 | long Destination, &
63 | LOGFONT Source, &
64 | long Length &
65 | ) Library "kernel32.dll" Alias For "RtlMoveMemory"
66 |
67 | Function ulong GlobalAlloc ( &
68 | ulong uFlags, &
69 | long dwBytes &
70 | ) Library "kernel32.dll"
71 |
72 | Function ulong GlobalLock ( &
73 | ulong hMem &
74 | ) Library "kernel32.dll"
75 |
76 | Function ulong GlobalUnlock ( &
77 | ulong hMem &
78 | ) Library "kernel32.dll"
79 |
80 | Function ulong GlobalFree ( &
81 | ulong hMem &
82 | ) Library "kernel32.dll"
83 |
84 | end prototypes
85 |
86 | type variables
87 | Integer iTextSize
88 | Boolean iBold
89 | Boolean iUnderline
90 | Boolean iItalic
91 | Boolean iStrikeout
92 | String iFaceName
93 | Long iTextColor
94 | Long iWeight
95 |
96 | end variables
97 |
98 | forward prototypes
99 | public function boolean of_choosefont (window aw_parent, string as_fontname)
100 | end prototypes
101 |
102 | public function boolean of_choosefont (window aw_parent, string as_fontname);Constant Integer CF_SCREENFONTS = 1
103 | Constant Integer CF_INITTOLOGFONTSTRUCT = 64
104 | Constant Integer CF_EFFECTS = 256
105 | Constant Integer GMEM_MOVEABLE = 2
106 | CHOOSEFONT lstr_choosefont
107 | LOGFONT lstr_logfont
108 | Integer li_Underline, li_Italic, li_Strikeout
109 | Long ll_LogFont
110 |
111 | // we allocate a piece of memory with the size of the logfont structure
112 | // and we lock it
113 | ll_LogFont = GlobalAlloc(GMEM_MOVEABLE, 60)
114 | If ll_LogFont = 0 Then Return False
115 |
116 | ll_LogFont = GlobalLock(ll_LogFont)
117 | If ll_LogFont = 0 Then Return False
118 |
119 | /* initialise the logfont structure */
120 |
121 | // default font
122 | If as_fontname = "" Then
123 | lstr_logfont.lffacename = "Arial"
124 | Else
125 | lstr_logfont.lffacename = as_fontname
126 | End If
127 | lstr_logfont.lfweight = 400
128 |
129 | // copy the structure to the allocated piece in memory
130 | CopyMemory(ll_LogFont, lstr_Logfont, 60)
131 |
132 | // assign the pointer to the fontinfo in memory to the dialog font
133 | lstr_ChooseFont.lplogfont = ll_LogFont
134 |
135 | // initialise the structure further
136 | lstr_ChooseFont.lstructsize = 60
137 | lstr_ChooseFont.hwnd = Handle(aw_parent)
138 | lstr_ChooseFont.flags = CF_SCREENFONTS+CF_INITTOLOGFONTSTRUCT+CF_EFFECTS
139 |
140 | // call the dialog
141 | If Not ChooseFont(lstr_ChooseFont) Then
142 | GlobalUnlock(ll_LogFont)
143 | GlobalFree(ll_LogFont)
144 | Return False
145 | End If
146 |
147 | // The memory piece now contains the selected log information
148 | // Copy this information back to the structure so we can access it
149 | CopyMemory(lstr_LogFont, lstr_ChooseFont.lplogfont, 60)
150 |
151 | // release the used memory
152 | GlobalUnlock(ll_LogFont)
153 | GlobalFree(ll_LogFont)
154 |
155 | // save the results in instance variables
156 | iTextSize = (lstr_ChooseFont.iPointSize / 10) * -1
157 | iWeight = lstr_LogFont.lfWeight
158 | If iWeight = 700 Then
159 | iBold = True
160 | Else
161 | iBold = False
162 | End If
163 | iFaceName = Trim(lstr_LogFont.lfFaceName)
164 | iTextColor = lstr_ChooseFont.rgbColors
165 |
166 | li_Underline = Asc(lstr_LogFont.lfUnderline)
167 | li_Italic = Asc(lstr_LogFont.lfItalic)
168 | li_Strikeout = Asc(lstr_LogFont.lfStrikeout)
169 |
170 | iUnderline = (li_Underline > 0)
171 | iItalic = (li_Italic > 0)
172 | iStrikeout = (li_Strikeout > 0)
173 |
174 | Return True
175 |
176 | end function
177 |
178 | on n_choosefont.create
179 | call super::create
180 | TriggerEvent( this, "constructor" )
181 | end on
182 |
183 | on n_choosefont.destroy
184 | TriggerEvent( this, "destructor" )
185 | call super::destroy
186 | end on
187 |
188 |
--------------------------------------------------------------------------------
/PB/src/90/n_cst_numerical.sru:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sebkirche/treelist/f005e8d715aa0c831c5bc98ef6add7798d1c26dd/PB/src/90/n_cst_numerical.sru
--------------------------------------------------------------------------------
/PB/src/90/treelist90.pbg:
--------------------------------------------------------------------------------
1 | Save Format v3.0(19990112)
2 | @begin Libraries
3 | "treelist90.pbl" "";
4 | @end;
5 | @begin Objects
6 | "n_cst_numerical.sru" "treelist90.pbl";
7 | "n_choosefont.sru" "treelist90.pbl";
8 | "treelist90.sra" "treelist90.pbl";
9 | "vo_treelist.sru" "treelist90.pbl";
10 | "w_test.srw" "treelist90.pbl";
11 | @end;
12 |
--------------------------------------------------------------------------------
/PB/src/90/treelist90.pbt:
--------------------------------------------------------------------------------
1 | Save Format v3.0(19990112)
2 | appname "treelist90";
3 | applib "treelist90.pbl";
4 | liblist "treelist90.pbl";
5 | type "pb";
6 |
--------------------------------------------------------------------------------
/PB/src/90/treelist90.sra:
--------------------------------------------------------------------------------
1 | $PBExportHeader$treelist90.sra
2 | $PBExportComments$Generated Application Object
3 | forward
4 | global type treelist90 from application
5 | end type
6 | global transaction sqlca
7 | global dynamicdescriptionarea sqlda
8 | global dynamicstagingarea sqlsa
9 | global error error
10 | global message message
11 | end forward
12 |
13 | global type treelist90 from application
14 | string appname = "treelist90"
15 | event myevent ( readonly integer ai_val )
16 | end type
17 | global treelist90 treelist90
18 |
19 | event myevent(readonly integer ai_val);
20 | int t
21 | t = ai_val
22 |
23 | int toto
24 |
25 | toto = + 1
26 |
27 | dec n
28 |
29 | n = +4.0
30 |
31 |
32 | int i = +12, j = -1; long z
33 |
34 | i = -j
35 | z = j - i + -2
36 |
37 | for i = 42+5*7 to long("42") step -2.0
38 |
39 | next
40 |
41 | end event
42 |
43 | on treelist90.create
44 | appname="treelist90"
45 | message=create message
46 | sqlca=create transaction
47 | sqlda=create dynamicdescriptionarea
48 | sqlsa=create dynamicstagingarea
49 | error=create error
50 | end on
51 |
52 | on treelist90.destroy
53 | destroy(sqlca)
54 | destroy(sqlda)
55 | destroy(sqlsa)
56 | destroy(error)
57 | destroy(message)
58 | end on
59 |
60 | event open;
61 | string s
62 | s = "t~000est"
63 | s += "truc"
64 | //messagebox("escape", s)
65 |
66 | /*
67 | powerobject o
68 |
69 | o.create()
70 | */
71 |
72 | open(w_test)
73 |
74 |
75 | end event
76 |
77 |
--------------------------------------------------------------------------------
/PB/src/90/vo_treelist.sru:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sebkirche/treelist/f005e8d715aa0c831c5bc98ef6add7798d1c26dd/PB/src/90/vo_treelist.sru
--------------------------------------------------------------------------------
/PB/treelist105.pbt:
--------------------------------------------------------------------------------
1 | Save Format v3.0(19990112)
2 | appname "treelist105";
3 | applib "treelist105.pbl";
4 | liblist "treelist105.pbl";
5 | type "pb";
6 |
--------------------------------------------------------------------------------
/PB/treelist115.pbt:
--------------------------------------------------------------------------------
1 | Save Format v3.0(19990112)
2 | @begin Projects
3 | @end;
4 | appname "treelist115";
5 | applib "treelist115.pbl";
6 | LibList "treelist115.pbl";
7 | type "pb";
8 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | TreeList
2 | ========
3 |
4 | A combined win32 ListView/TreeView forked from [Anton Zechner's TreeList](http://members.inode.at/anton.zechner/az/TreeList.htm)
5 |
6 | Here is a view of the sample application that comes with the original code:
7 | 
8 |
9 | I am working to wrap it into a visual control for PowerBuilder and for now my PB sample look like that:
10 | 
11 |
12 | I am also adding some functionnalities, for now:
13 |
14 | * the TreeList header can have its own image list instead of sharing it with the tree / list part this can be activated by using the `TVS_EX_HEADEROWNIMGLIST` extended style.
15 | * the control responds to the `WM_GETFONT` message
16 | * when setting a new font via `WM_SETFONT`, we generate an additional bold font from the given font
17 | * the Visual Studio solution can build a standalone dll
18 |
19 | I am also fixing some bugs, as I encounter them. These fixes should be sent back to Mr. Zechner, but I changed somewhat the coding style to my habit and sending a patch would not be so easy...
20 |
--------------------------------------------------------------------------------
/SimpleTest.vcproj:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
14 |
15 |
16 |
17 |
18 |
25 |
28 |
31 |
34 |
37 |
40 |
52 |
55 |
58 |
61 |
71 |
74 |
77 |
80 |
83 |
86 |
89 |
92 |
95 |
96 |
104 |
107 |
110 |
113 |
116 |
119 |
128 |
131 |
134 |
137 |
149 |
152 |
155 |
158 |
161 |
164 |
167 |
170 |
173 |
174 |
181 |
184 |
187 |
190 |
193 |
196 |
208 |
211 |
214 |
217 |
227 |
230 |
233 |
236 |
239 |
242 |
245 |
248 |
251 |
252 |
260 |
263 |
266 |
269 |
272 |
275 |
284 |
287 |
290 |
293 |
305 |
308 |
311 |
314 |
317 |
320 |
323 |
326 |
329 |
330 |
337 |
340 |
343 |
346 |
349 |
352 |
364 |
367 |
370 |
373 |
383 |
386 |
389 |
392 |
395 |
398 |
401 |
404 |
407 |
408 |
409 |
410 |
411 |
412 |
417 |
420 |
424 |
427 |
428 |
432 |
435 |
436 |
439 |
442 |
443 |
444 |
447 |
451 |
454 |
455 |
459 |
462 |
463 |
467 |
470 |
471 |
475 |
478 |
479 |
480 |
481 |
486 |
489 |
490 |
491 |
496 |
499 |
500 |
503 |
504 |
507 |
508 |
509 |
510 |
511 |
512 |
513 |
--------------------------------------------------------------------------------
/StdAfx.cpp:
--------------------------------------------------------------------------------
1 | //*****************************************************************************
2 | //*
3 | //*
4 | //* StdAfx.cpp
5 | //*
6 | //*
7 | //*****************************************************************************
8 | #include "StdAfx.h"
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/StdAfx.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sebkirche/treelist/f005e8d715aa0c831c5bc98ef6add7798d1c26dd/StdAfx.h
--------------------------------------------------------------------------------
/TreeList.clw:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sebkirche/treelist/f005e8d715aa0c831c5bc98ef6add7798d1c26dd/TreeList.clw
--------------------------------------------------------------------------------
/TreeList.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sebkirche/treelist/f005e8d715aa0c831c5bc98ef6add7798d1c26dd/TreeList.cpp
--------------------------------------------------------------------------------
/TreeList.def:
--------------------------------------------------------------------------------
1 | LIBRARY TreeList
2 | EXPORTS
3 | DllMain
4 | TreeListRegister
--------------------------------------------------------------------------------
/TreeList.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sebkirche/treelist/f005e8d715aa0c831c5bc98ef6add7798d1c26dd/TreeList.dsp
--------------------------------------------------------------------------------
/TreeList.dsw:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sebkirche/treelist/f005e8d715aa0c831c5bc98ef6add7798d1c26dd/TreeList.dsw
--------------------------------------------------------------------------------
/TreeList.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sebkirche/treelist/f005e8d715aa0c831c5bc98ef6add7798d1c26dd/TreeList.h
--------------------------------------------------------------------------------
/TreeList.rc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sebkirche/treelist/f005e8d715aa0c831c5bc98ef6add7798d1c26dd/TreeList.rc
--------------------------------------------------------------------------------
/TreeList.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 9.00
3 | # Visual Studio 2005
4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TreeList", "TreeList.vcproj", "{2BB726AC-03CD-41AA-885C-043AFA8BAE92}"
5 | EndProject
6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SimpleTest", "SimpleTest.vcproj", "{AE688866-22EC-4FAD-8C1F-F1BC0159910A}"
7 | ProjectSection(ProjectDependencies) = postProject
8 | {2BB726AC-03CD-41AA-885C-043AFA8BAE92} = {2BB726AC-03CD-41AA-885C-043AFA8BAE92}
9 | EndProjectSection
10 | EndProject
11 | Global
12 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
13 | Debug Unicode|Win32 = Debug Unicode|Win32
14 | Debug|Win32 = Debug|Win32
15 | Dll Debug Unicode mini test|Win32 = Dll Debug Unicode mini test|Win32
16 | Dll Debug Unicode|Win32 = Dll Debug Unicode|Win32
17 | Dll Debug|Win32 = Dll Debug|Win32
18 | Dll Release Unicode|Win32 = Dll Release Unicode|Win32
19 | Dll Release|Win32 = Dll Release|Win32
20 | mini test ansi|Win32 = mini test ansi|Win32
21 | mini test unicode|Win32 = mini test unicode|Win32
22 | Release Unicode|Win32 = Release Unicode|Win32
23 | Release|Win32 = Release|Win32
24 | EndGlobalSection
25 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
26 | {2BB726AC-03CD-41AA-885C-043AFA8BAE92}.Debug Unicode|Win32.ActiveCfg = Debug Unicode|Win32
27 | {2BB726AC-03CD-41AA-885C-043AFA8BAE92}.Debug Unicode|Win32.Build.0 = Debug Unicode|Win32
28 | {2BB726AC-03CD-41AA-885C-043AFA8BAE92}.Debug|Win32.ActiveCfg = Debug|Win32
29 | {2BB726AC-03CD-41AA-885C-043AFA8BAE92}.Debug|Win32.Build.0 = Debug|Win32
30 | {2BB726AC-03CD-41AA-885C-043AFA8BAE92}.Dll Debug Unicode mini test|Win32.ActiveCfg = Dll Debug Unicode mini test|Win32
31 | {2BB726AC-03CD-41AA-885C-043AFA8BAE92}.Dll Debug Unicode mini test|Win32.Build.0 = Dll Debug Unicode mini test|Win32
32 | {2BB726AC-03CD-41AA-885C-043AFA8BAE92}.Dll Debug Unicode|Win32.ActiveCfg = Dll Debug Unicode|Win32
33 | {2BB726AC-03CD-41AA-885C-043AFA8BAE92}.Dll Debug Unicode|Win32.Build.0 = Dll Debug Unicode|Win32
34 | {2BB726AC-03CD-41AA-885C-043AFA8BAE92}.Dll Debug|Win32.ActiveCfg = Dll Debug|Win32
35 | {2BB726AC-03CD-41AA-885C-043AFA8BAE92}.Dll Debug|Win32.Build.0 = Dll Debug|Win32
36 | {2BB726AC-03CD-41AA-885C-043AFA8BAE92}.Dll Release Unicode|Win32.ActiveCfg = Dll Release Unicode|Win32
37 | {2BB726AC-03CD-41AA-885C-043AFA8BAE92}.Dll Release Unicode|Win32.Build.0 = Dll Release Unicode|Win32
38 | {2BB726AC-03CD-41AA-885C-043AFA8BAE92}.Dll Release|Win32.ActiveCfg = Dll Release|Win32
39 | {2BB726AC-03CD-41AA-885C-043AFA8BAE92}.Dll Release|Win32.Build.0 = Dll Release|Win32
40 | {2BB726AC-03CD-41AA-885C-043AFA8BAE92}.mini test ansi|Win32.ActiveCfg = mini test ansi|Win32
41 | {2BB726AC-03CD-41AA-885C-043AFA8BAE92}.mini test ansi|Win32.Build.0 = mini test ansi|Win32
42 | {2BB726AC-03CD-41AA-885C-043AFA8BAE92}.mini test unicode|Win32.ActiveCfg = mini test unicode|Win32
43 | {2BB726AC-03CD-41AA-885C-043AFA8BAE92}.mini test unicode|Win32.Build.0 = mini test unicode|Win32
44 | {2BB726AC-03CD-41AA-885C-043AFA8BAE92}.Release Unicode|Win32.ActiveCfg = Release Unicode|Win32
45 | {2BB726AC-03CD-41AA-885C-043AFA8BAE92}.Release Unicode|Win32.Build.0 = Release Unicode|Win32
46 | {2BB726AC-03CD-41AA-885C-043AFA8BAE92}.Release|Win32.ActiveCfg = Release|Win32
47 | {2BB726AC-03CD-41AA-885C-043AFA8BAE92}.Release|Win32.Build.0 = Release|Win32
48 | {AE688866-22EC-4FAD-8C1F-F1BC0159910A}.Debug Unicode|Win32.ActiveCfg = Debug|Win32
49 | {AE688866-22EC-4FAD-8C1F-F1BC0159910A}.Debug Unicode|Win32.Build.0 = Debug|Win32
50 | {AE688866-22EC-4FAD-8C1F-F1BC0159910A}.Debug|Win32.ActiveCfg = Debug|Win32
51 | {AE688866-22EC-4FAD-8C1F-F1BC0159910A}.Debug|Win32.Build.0 = Debug|Win32
52 | {AE688866-22EC-4FAD-8C1F-F1BC0159910A}.Dll Debug Unicode mini test|Win32.ActiveCfg = Debug|Win32
53 | {AE688866-22EC-4FAD-8C1F-F1BC0159910A}.Dll Debug Unicode mini test|Win32.Build.0 = Debug|Win32
54 | {AE688866-22EC-4FAD-8C1F-F1BC0159910A}.Dll Debug Unicode|Win32.ActiveCfg = Debug|Win32
55 | {AE688866-22EC-4FAD-8C1F-F1BC0159910A}.Dll Debug Unicode|Win32.Build.0 = Debug|Win32
56 | {AE688866-22EC-4FAD-8C1F-F1BC0159910A}.Dll Debug|Win32.ActiveCfg = Dll Debug|Win32
57 | {AE688866-22EC-4FAD-8C1F-F1BC0159910A}.Dll Debug|Win32.Build.0 = Dll Debug|Win32
58 | {AE688866-22EC-4FAD-8C1F-F1BC0159910A}.Dll Release Unicode|Win32.ActiveCfg = Release|Win32
59 | {AE688866-22EC-4FAD-8C1F-F1BC0159910A}.Dll Release Unicode|Win32.Build.0 = Release|Win32
60 | {AE688866-22EC-4FAD-8C1F-F1BC0159910A}.Dll Release|Win32.ActiveCfg = Dll Release|Win32
61 | {AE688866-22EC-4FAD-8C1F-F1BC0159910A}.Dll Release|Win32.Build.0 = Dll Release|Win32
62 | {AE688866-22EC-4FAD-8C1F-F1BC0159910A}.mini test ansi|Win32.ActiveCfg = mini test ansi|Win32
63 | {AE688866-22EC-4FAD-8C1F-F1BC0159910A}.mini test ansi|Win32.Build.0 = mini test ansi|Win32
64 | {AE688866-22EC-4FAD-8C1F-F1BC0159910A}.mini test unicode|Win32.ActiveCfg = Release|Win32
65 | {AE688866-22EC-4FAD-8C1F-F1BC0159910A}.mini test unicode|Win32.Build.0 = Release|Win32
66 | {AE688866-22EC-4FAD-8C1F-F1BC0159910A}.Release Unicode|Win32.ActiveCfg = Release|Win32
67 | {AE688866-22EC-4FAD-8C1F-F1BC0159910A}.Release Unicode|Win32.Build.0 = Release|Win32
68 | {AE688866-22EC-4FAD-8C1F-F1BC0159910A}.Release|Win32.ActiveCfg = Release|Win32
69 | {AE688866-22EC-4FAD-8C1F-F1BC0159910A}.Release|Win32.Build.0 = Release|Win32
70 | EndGlobalSection
71 | GlobalSection(SolutionProperties) = preSolution
72 | HideSolutionNode = FALSE
73 | EndGlobalSection
74 | EndGlobal
75 |
--------------------------------------------------------------------------------
/TreeListA.def:
--------------------------------------------------------------------------------
1 | LIBRARY TreeListA
2 | EXPORTS
3 | DllMain
4 | TreeListRegister
--------------------------------------------------------------------------------
/TreeListCtrl.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sebkirche/treelist/f005e8d715aa0c831c5bc98ef6add7798d1c26dd/TreeListCtrl.cpp
--------------------------------------------------------------------------------
/TreeListCtrl.h:
--------------------------------------------------------------------------------
1 | //*****************************************************************************
2 | //*
3 | //*
4 | //* TreeListCtrl.h
5 | //*
6 | //*
7 | //*****************************************************************************
8 | #ifndef __TREELISTCTRL_H__
9 | #define __TREELISTCTRL_H__
10 |
11 | #if _MSC_VER > 1000
12 | #pragma once
13 | #endif
14 |
15 | #include
16 | #include "TreeListWnd.h"
17 |
18 | class CHeaderCtrl;
19 | class CDialog;
20 |
21 | #define ID_TREELISTCTRL_DEF 0x9719
22 |
23 |
24 | //*****************************************************************************
25 | //*
26 | //* CTreeListCtrl
27 | //*
28 | //*****************************************************************************
29 | class CTreeListCtrl : public CTreeCtrl
30 | {
31 |
32 | DECLARE_DYNAMIC(CTreeListCtrl)
33 |
34 | public:
35 | CTreeListCtrl(){};
36 |
37 | BOOL Create ( DWORD dwStyle,const RECT &sRect,CWnd *pParentWnd,UINT nId=ID_TREELISTCTRL_DEF);
38 | BOOL CreateEx (DWORD dwExStyle,DWORD dwStyle,const RECT &sRect,CWnd *pParentWnd,UINT nId=ID_TREELISTCTRL_DEF);
39 | BOOL Create ( DWORD dwStyle,UINT uItem,CDialog *pDlg,UINT nId=ID_TREELISTCTRL_DEF);
40 | BOOL CreateEx (DWORD dwExStyle,DWORD dwStyle,UINT uItem,CDialog *pDlg,UINT nId=ID_TREELISTCTRL_DEF);
41 | INT InsertColumn (int nCol, LPCTSTR pColumnText, int nFormat=TVCFMT_LEFT,int nWidth=-1,int nMin=0x8000);
42 | INT InsertColumn (int nCol, const TV_COLUMN* pColumn );
43 | BOOL SetColumn (int nCol, const TV_COLUMN* pColumn );
44 | BOOL GetColumn (int nCol, TV_COLUMN* pColumn ) const;
45 | INT GetColumnWidth (int nCol) const;
46 | BOOL SetColumnWidth (int nCol, int iWidth);
47 | BOOL SetColumnImage (int nCol, int iImage);
48 | BOOL SetColumnText (int nCol, LPCTSTR pText);
49 | BOOL SetColumnMark (int nCol, BOOL bOn=TRUE);
50 | BOOL FixColumnSize (int nCol, BOOL bOn=TRUE,int iWidth=-1);
51 | BOOL DeleteColumn (int nCol);
52 | INT GetColumnCount () const;
53 | CEdit *GetEditControl () const;
54 | CHeaderCtrl *GetHeaderCtrl () const;
55 | CComboBox *GetComboControl () const;
56 | VOID GetEditControl (HWND &hWnd) const;
57 | VOID GetHeaderCtrl (HWND &hWnd) const;
58 | VOID GetComboControl (HWND &hWnd) const;
59 | CEdit *EditLabel (HTREEITEM hItem,int nCol=0,int iFull=0 ,int iSel=0);
60 | CComboBox *EditLabelCb (HTREEITEM hItem,int nCol=0,int iFull=0,int iList=0,int iSel=0);
61 | CImageList *CreateDragImage (HTREEITEM hItem,int nCol=0);
62 | CImageList *SetImageList (CImageList *pImageList,int nImageListType);
63 | HIMAGELIST SetImageList (HIMAGELIST hImageList,int nImageListType);
64 | DWORD GetStyle () const;
65 | DWORD SetStyle (DWORD dwStyle);
66 | DWORD SetStyle (DWORD dwStyle,DWORD dwMask);
67 | DWORD GetExtendedStyle () const;
68 | DWORD SetExtendedStyle (DWORD dwStyle);
69 | DWORD SetExtendedStyle (DWORD dwStyle,DWORD dwMask);
70 | COLORREF GetColor (int iIndex) const;
71 | COLORREF SetColor (int iIndex ,COLORREF uColor);
72 | COLORREF GetItemBkColor (HTREEITEM hItem,int nCol=0) const;
73 | COLORREF SetItemBkColor (HTREEITEM hItem,int nCol,COLORREF uColor);
74 | COLORREF GetItemTextColor (HTREEITEM hItem,int nCol=0) const;
75 | COLORREF SetItemTextColor (HTREEITEM hItem,int nCol,COLORREF uColor);
76 | BOOL ExpandAll (HTREEITEM hItem,int iCode=0);
77 | BOOL CollapseAll (HTREEITEM hItem,int iCode=0);
78 | INT IsItemVisible (HTREEITEM hItem,int nCol=-1);
79 | BOOL EnsureVisible (HTREEITEM hItem,int nCol);
80 | BOOL DeleteChildItems (HTREEITEM hItem);
81 | BOOL EnsureVisible (HTREEITEM hItem);
82 | BOOL SelectDropTarget (HTREEITEM hItem,int nCol=0);
83 | BOOL SelectItem (HTREEITEM hItem,int nCol=0);
84 | BOOL StartEdit (HTREEITEM hItem,int nCol=0);
85 | BOOL SelectChilds (HTREEITEM hItem=TVI_ROOT,int iMode=TVIS_WITHCHILDS);
86 | BOOL GetItemRect (HTREEITEM hItem,int nCol,RECT *pRect,int iCode);
87 | BOOL GetItemRect (HTREEITEM hItem, RECT *pRect,int iCode);
88 | BOOL GetItemText (HTREEITEM hItem,LPTSTR pBuffer,int iMax,int nCol=0);
89 | LPCTSTR GetItemText (HTREEITEM hItem, int nCol=0);
90 | BOOL SetItemText (HTREEITEM hItem,LPCTSTR pText ,int nCol=0);
91 | INT GetItemImageEx (HTREEITEM hItem ,int nCol=0);
92 | BOOL GetItemImageEx (HTREEITEM hItem,int *pImage ,int nCol=0);
93 | BOOL SetItemImageEx (HTREEITEM hItem,int nImage ,int nCol=0);
94 | UINT GetItemState (HTREEITEM hItem,UINT nStateMask ,int nCol=0);
95 | BOOL SetItemState (HTREEITEM hItem, UINT nState,UINT nStateMask);
96 | BOOL SetItemState (HTREEITEM hItem,int nCol,UINT nState,UINT nStateMask);
97 | BOOL SetItem (HTREEITEM hItem,int nCol,UINT nMask, LPCTSTR pText,int nImage,int nSelectedImage,UINT nState,UINT nStateMask, LPARAM lParam=0);
98 | BOOL SetItem (TVITEM *pItem);
99 | BOOL SortChildrenEX (LPTVSORTEX pSort,BOOL bRecusive=FALSE);
100 | BOOL SortChildrenCB (LPTVSORTCB pSort,BOOL bRecusive=FALSE);
101 | BOOL SortChildren (HTREEITEM hItem ,BOOL bRecusive=FALSE);
102 | BOOL SetColumnOrderArray (int iCount,const int *pArray);
103 | BOOL GetColumnOrderArray (int iCount,int *pArray);
104 | BOOL SetItemCheckBox (HTREEITEM hItem,int iState,int nCol=0,UINT uMask=0x0F);
105 | INT GetItemCheckBox (HTREEITEM hItem ,int nCol=0,UINT uMask=0x0F);
106 | BOOL DisableItemAutoEdit (HTREEITEM hItem,int nCol,BOOL bDisable =TRUE);
107 | BOOL SetFocusItem (HTREEITEM hItem,int nCol=-1);
108 | LPVOID GetUserData (HTREEITEM hItem) const;
109 | INT SetUserDataSize (int iSize);
110 | INT GetUserDataSize () const;
111 | HTREEITEM GetFirstItem ();
112 | HTREEITEM GetFocusItem ();
113 | HTREEITEM GetFirstSelected ();
114 | HTREEITEM GetLastChild (HTREEITEM hItem);
115 | HTREEITEM GetNextItem (HTREEITEM hItem,UINT nCode=TVGN_NEXT);
116 | HTREEITEM GetNextSelected (HTREEITEM hItem);
117 | HTREEITEM GetNextSelectedChild (HTREEITEM hItem);
118 | HTREEITEM FindItem (HTREEITEM hItem,TVFIND *pFind);
119 | HTREEITEM FindItem (HTREEITEM hItem,int iFlags,int nCol,LPCTSTR pText,LPARAM lParam=0,UINT uState=0,UINT uStateMask=0);
120 | HTREEITEM FindItem (HTREEITEM hItem,LPCTSTR pText ,int nCol=0,int iCase=0);
121 | HTREEITEM FindItem (HTREEITEM hItem,LPARAM lParam);
122 | HTREEITEM InsertItem (UINT nMask, LPCTSTR pText,int nImage,int nSelImage,UINT nState,UINT nStateMask,LPARAM lParam,HTREEITEM hParent=TVI_ROOT,HTREEITEM hInsertAfter=TVI_LAST);
123 | HTREEITEM InsertItem (UINT nMask, LPCTSTR pText,int nImage,int nSelImage,UINT nState,UINT nStateMask,LPARAM lParam,PFNTVSORTEX pCmpProc ,HTREEITEM hParent =TVI_ROOT);
124 | HTREEITEM InsertItem ( LPCTSTR pText,int nImage,int nSelImg, HTREEITEM hParent=TVI_ROOT,HTREEITEM hInsertAfter=TVI_LAST);
125 | HTREEITEM InsertItem ( LPCTSTR pText,int nImage,int nSelImg, HTREEITEM hParent ,HTREEITEM hInsertAfter ,LPARAM lParam );
126 | HTREEITEM InsertItem ( LPCTSTR pText,int nImage,int nSelImg, PFNTVSORTEX pCmpProc ,HTREEITEM hParent =TVI_ROOT,LPARAM lParam=0);
127 | HTREEITEM InsertItem ( LPCTSTR pText,int nImage, HTREEITEM hParent=TVI_ROOT,HTREEITEM hInsertAfter=TVI_LAST);
128 | HTREEITEM InsertItem ( LPCTSTR pText,int nImage, HTREEITEM hParent ,HTREEITEM hInsertAfter ,LPARAM lParam );
129 | HTREEITEM InsertItem ( LPCTSTR pText,int nImage, PFNTVSORTEX pCmpProc ,HTREEITEM hParent =TVI_ROOT,LPARAM lParam=0);
130 | HTREEITEM InsertItem ( LPCTSTR pText, HTREEITEM hParent=TVI_ROOT,HTREEITEM hInsertAfter=TVI_LAST);
131 | HTREEITEM InsertItem ( LPCTSTR pText, HTREEITEM hParent ,HTREEITEM hInsertAfter ,LPARAM lParam );
132 | HTREEITEM InsertItem ( LPCTSTR pText, PFNTVSORTEX pCmpProc ,HTREEITEM hParent =TVI_ROOT,LPARAM lParam=0);
133 | HTREEITEM InsertItem (LPTVINSERTSTRUCT pInsert);
134 | HTREEITEM EnumItems (HTREEITEM hLast=TVI_ROOT);
135 | INT GetOption (int iOption);
136 | INT SetOption (int iOption,int iValue);
137 | INT SetColumnAutoEdit (int nCol,int iMode=TVAE_EDIT);
138 | INT SetColumnAutoEdit (int nCol,int iMode, LPTSTR *pList,int iMax=0);
139 | INT SetColumnAutoEdit (int nCol,int iMode, LPCTSTR *pList,int iMax=0);
140 | INT SetColumnAutoEdit (int nCol,int iMode, LPCTSTR pText,int iMax=0);
141 | INT SetColumnAutoEdit (int nCol,int iMode,TCHAR cChar,LPCTSTR pText,int iMax=0);
142 | INT SetColumnAutoIcon (int nCol,int iIcon);
143 | INT GetFocusColumn ();
144 | INT GetSelectionColumn ();
145 | INT GetDropHilightColumn ();
146 |
147 | // ListCtrl Functions
148 |
149 | INT GetCountPerPage () const;
150 | INT GetRowCount () const;
151 | INT GetRowOfItem (HTREEITEM hItem) const;
152 | HTREEITEM GetItemOfRow (int iRow) const;
153 | CEdit *ListEditLabel (int iRow,int nCol=0,int iFull=0 ,int iSel=0);
154 | CComboBox *ListEditLabelCb (int iRow,int nCol=0,int iFull=0,int iList=0,int iSel=0);
155 | CImageList *ListCreateDragImage (int iRow,int nCol=0);
156 | BOOL ListDeleteItem (int iRow);
157 | INT ListInsertItem (int iRow, LPCTSTR pText,int nImage=-1,int nState=-1,int iMask=TVIS_BOLD|TVIS_UNDERLINE|TVIS_SELECTED|TVIS_OVERLAYMASK|TVIS_STATEIMAGEMASK);
158 | BOOL ListSetItem (int iRow, LPCTSTR pText,int nImage=-1,int nState=-1,int iMask=TVIS_BOLD|TVIS_UNDERLINE|TVIS_SELECTED|TVIS_OVERLAYMASK|TVIS_STATEIMAGEMASK);
159 | BOOL ListSetItem (int iRow,int iCol,LPCTSTR pText,int nImage=-1,int nState=-1,int iMask=TVIS_BOLD|TVIS_UNDERLINE|TVIS_SELECTED|TVIS_OVERLAYMASK|TVIS_STATEIMAGEMASK);
160 | BOOL ListSetColor (int iRow,int iCol,COLORREF uBkColor=TV_NOCOLOR,COLORREF uTextColor=TV_NOCOLOR);
161 | BOOL ListGetColor (int iRow,int iCol,COLORREF &uBkColor ,COLORREF &uTextColor);
162 | LRESULT ListGetItemData (int iRow);
163 | LPCTSTR ListGetItemText (int iRow, int nCol=0);
164 | BOOL ListGetItemText (int iRow,LPTSTR pBuffer,int iMax,int nCol=0);
165 | BOOL ListSetItemText (int iRow,LPCTSTR pText ,int nCol=0);
166 | UINT ListGetItemState (int iRow,UINT nStateMask ,int nCol=0);
167 | BOOL ListSetItemState (int iRow, UINT nState ,UINT nStateMask);
168 | BOOL ListSetItemState (int iRow,int nCol,UINT nState ,UINT nStateMask);
169 | INT ListGetItemCheckBox (int iRow ,int nCol=0,UINT uMask=0x0F);
170 | BOOL ListSetItemCheckBox (int iRow,int iState,int nCol=0,UINT uMask=0x0F);
171 | BOOL ListSelectItem (int iRow,int nCol= 0);
172 | BOOL ListSetFocusItem (int iRow,int nCol=-1);
173 | BOOL ListEnsureVisible (int iRow,int nCol );
174 | INT ListEnsureVisible (int iRow);
175 | INT ListGetItemImageEx (int iRow ,int nCol=0);
176 | BOOL ListGetItemImageEx (int iRow,int *pImage ,int nCol=0);
177 | BOOL ListSetItemImageEx (int iRow,int nImage ,int nCol=0);
178 | INT ListGetItemImage (int iRow,int &nImage,int &nSelectedImage);
179 | BOOL ListSetItemImage (int iRow,int nImage,int nSelectedImage);
180 | LPVOID ListGetUserData (int iRow) const;
181 | INT ListGetNextSelected (int iRow);
182 | COLORREF ListGetItemBkColor (int iRow,int nCol=0) const;
183 | COLORREF ListSetItemBkColor (int iRow,int nCol,COLORREF uColor);
184 | COLORREF ListGetItemTextColor (int iRow,int nCol=0) const;
185 | COLORREF ListSetItemTextColor (int iRow,int nCol,COLORREF uColor);
186 | BOOL ListSelectDropTarget (int iRow,int nCol=0);
187 | BOOL ListGetItemRect (int iRow,int nCol,RECT *pRect,int iCode);
188 | BOOL ListGetItemRect (int iRow, RECT *pRect,int iCode);
189 | BOOL ListSetTopIndex (int iRow);
190 | INT ListGetFirstSelected ();
191 | INT ListGetFocusItem ();
192 | INT ListGetTopIndex ();
193 |
194 |
195 |
196 | };
197 |
198 |
199 | //*****************************************************************************
200 | //*
201 | //* Inline Funktions
202 | //*
203 | //*****************************************************************************
204 | #define TLC_SORT_PARAMS1 HTREEITEM P,HTREEITEM A,LPARAM L
205 | #define TLC_SORT_PARAMS2 PFNTVSORTEX O,HTREEITEM P,LPARAM L
206 |
207 | inline LPVOID CTreeListCtrl::GetUserData(HTREEITEM hItem) const { ASSERT(::IsWindow(m_hWnd)); return TreeList_GetUserData(m_hWnd,hItem);}
208 | inline INT CTreeListCtrl::GetUserDataSize() const { ASSERT(::IsWindow(m_hWnd)); return TreeList_GetUserDataSize(m_hWnd);}
209 | inline INT CTreeListCtrl::SetUserDataSize(int iSize) { ASSERT(::IsWindow(m_hWnd)); return TreeList_SetUserDataSize(m_hWnd,iSize);}
210 | inline BOOL CTreeListCtrl::GetColumn (int nCol, TV_COLUMN *pColumn) const { ASSERT(::IsWindow(m_hWnd)); return TreeList_GetColumn(m_hWnd,nCol,pColumn);}
211 | inline BOOL CTreeListCtrl::SetColumn (int nCol, const TV_COLUMN *pColumn) { ASSERT(::IsWindow(m_hWnd)); return TreeList_SetColumn(m_hWnd,nCol,pColumn);}
212 | inline INT CTreeListCtrl::InsertColumn(int nCol, const TV_COLUMN *pColumn) { ASSERT(::IsWindow(m_hWnd)); return TreeList_InsertColumn(m_hWnd,nCol,pColumn); }
213 | inline BOOL CTreeListCtrl::DeleteColumn(int nCol) { ASSERT(::IsWindow(m_hWnd)); return TreeList_DeleteColumn(m_hWnd,nCol); }
214 | inline INT CTreeListCtrl::GetColumnCount() const { ASSERT(::IsWindow(m_hWnd)); return TreeList_GetColumnCount(m_hWnd); }
215 | inline BOOL CTreeListCtrl::SortChildren (HTREEITEM hItem,BOOL bRecusive) { ASSERT(::IsWindow(m_hWnd)); return TreeList_SortChildren (m_hWnd,hItem,bRecusive); }
216 | inline BOOL CTreeListCtrl::SortChildrenCB(LPTVSORTCB pSort,BOOL bRecusive) { ASSERT(::IsWindow(m_hWnd)); return TreeList_SortChildrenCB(m_hWnd,pSort,bRecusive); }
217 | inline BOOL CTreeListCtrl::SortChildrenEX(LPTVSORTEX pSort,BOOL bRecusive) { ASSERT(::IsWindow(m_hWnd)); return TreeList_SortChildrenEX(m_hWnd,pSort,bRecusive); }
218 | inline INT CTreeListCtrl::GetColumnWidth(int nCol) const { ASSERT(::IsWindow(m_hWnd)); return TreeList_GetColumnWidth(m_hWnd,nCol); }
219 | inline BOOL CTreeListCtrl::SetColumnWidth(int nCol, int iWidth) { ASSERT(::IsWindow(m_hWnd)); return TreeList_SetColumnWidth(m_hWnd,nCol,iWidth); }
220 | inline BOOL CTreeListCtrl::SetColumnOrderArray (int iCount,const int *pArray) { ASSERT(::IsWindow(m_hWnd)); return TreeList_SetColumnOrderArray(m_hWnd,iCount,pArray);}
221 | inline BOOL CTreeListCtrl::GetColumnOrderArray (int iCount,int *pArray) { ASSERT(::IsWindow(m_hWnd)); return TreeList_GetColumnOrderArray(m_hWnd,iCount,pArray);}
222 | inline HTREEITEM CTreeListCtrl::FindItem(HTREEITEM hItem,TVFIND *pFind) { ASSERT(::IsWindow(m_hWnd)); return TreeList_FindItem(m_hWnd,hItem,pFind); }
223 | inline HTREEITEM CTreeListCtrl::GetItemOfRow(int iRow) const { ASSERT(::IsWindow(m_hWnd)); return TreeList_GetItemOfRow(m_hWnd,iRow); }
224 | inline INT CTreeListCtrl::GetRowOfItem(HTREEITEM hItem) const { ASSERT(::IsWindow(m_hWnd)); return TreeList_GetRowOfItem(m_hWnd,hItem); }
225 | inline INT CTreeListCtrl::GetRowCount () const { ASSERT(::IsWindow(m_hWnd)); return TreeList_GetRowCount (m_hWnd); }
226 | inline INT CTreeListCtrl::GetCountPerPage() const { ASSERT(::IsWindow(m_hWnd)); return TreeList_GetCountPerPage(m_hWnd); }
227 | inline DWORD CTreeListCtrl::GetStyle() const { ASSERT(::IsWindow(m_hWnd)); return TreeList_GetStyle(m_hWnd); }
228 | inline DWORD CTreeListCtrl::SetStyle(DWORD dwStyle) { ASSERT(::IsWindow(m_hWnd)); return TreeList_SetStyle(m_hWnd,dwStyle); }
229 | inline DWORD CTreeListCtrl::SetStyle(DWORD dwStyle,DWORD dwMask) { ASSERT(::IsWindow(m_hWnd)); return TreeList_SetStyleEx(m_hWnd,dwStyle,dwMask); }
230 | inline DWORD CTreeListCtrl::GetExtendedStyle() const { ASSERT(::IsWindow(m_hWnd)); return TreeList_GetExtendedStyle(m_hWnd); }
231 | inline DWORD CTreeListCtrl::SetExtendedStyle(DWORD dwStyle) { ASSERT(::IsWindow(m_hWnd)); return TreeList_SetExtendedStyle(m_hWnd,dwStyle); }
232 | inline DWORD CTreeListCtrl::SetExtendedStyle(DWORD dwStyle,DWORD dwMask) { ASSERT(::IsWindow(m_hWnd)); return TreeList_SetExtendedStyleEx(m_hWnd,dwStyle,dwMask); }
233 | inline COLORREF CTreeListCtrl::GetColor(int iIndex) const { ASSERT(::IsWindow(m_hWnd)); return TreeList_GetColor(m_hWnd,iIndex); }
234 | inline COLORREF CTreeListCtrl::SetColor(int iIndex,COLORREF uColor) { ASSERT(::IsWindow(m_hWnd)); return TreeList_SetColor(m_hWnd,iIndex,uColor); }
235 | inline COLORREF CTreeListCtrl::GetItemBkColor (HTREEITEM hItem,int nCol) const { ASSERT(::IsWindow(m_hWnd)); return TreeList_GetItemBkColor(m_hWnd,hItem,nCol); }
236 | inline COLORREF CTreeListCtrl::SetItemBkColor (HTREEITEM hItem,int nCol,COLORREF uColor) { ASSERT(::IsWindow(m_hWnd)); return TreeList_SetItemBkColor(m_hWnd,hItem,nCol,uColor); }
237 | inline COLORREF CTreeListCtrl::GetItemTextColor(HTREEITEM hItem,int nCol) const { ASSERT(::IsWindow(m_hWnd)); return TreeList_GetItemTextColor(m_hWnd,hItem,nCol); }
238 | inline COLORREF CTreeListCtrl::SetItemTextColor(HTREEITEM hItem,int nCol,COLORREF uColor) { ASSERT(::IsWindow(m_hWnd)); return TreeList_SetItemTextColor(m_hWnd,hItem,nCol,uColor); }
239 | inline INT CTreeListCtrl::IsItemVisible (HTREEITEM hItem,int nCol) { ASSERT(::IsWindow(m_hWnd)); return TreeList_IsItemVisible(m_hWnd,hItem,nCol); }
240 | inline BOOL CTreeListCtrl::EnsureVisible (HTREEITEM hItem,int nCol) { ASSERT(::IsWindow(m_hWnd)); return TreeList_EnsureVisibleEx(m_hWnd,hItem,nCol); }
241 | inline BOOL CTreeListCtrl::SelectDropTarget(HTREEITEM hItem,int nCol) { ASSERT(::IsWindow(m_hWnd)); return TreeList_SelectDropTargetEx(m_hWnd,hItem,nCol); }
242 | inline BOOL CTreeListCtrl::SelectItem (HTREEITEM hItem,int nCol) { ASSERT(::IsWindow(m_hWnd)); return TreeList_SelectSubItem(m_hWnd,hItem,nCol); }
243 | inline BOOL CTreeListCtrl::StartEdit (HTREEITEM hItem,int nCol) { ASSERT(::IsWindow(m_hWnd)); return TreeList_StartEdit(m_hWnd,hItem,nCol); }
244 | inline BOOL CTreeListCtrl::SelectChilds (HTREEITEM hItem,int iMode) { ASSERT(::IsWindow(m_hWnd)); return TreeList_SelectChilds(m_hWnd,hItem,iMode); }
245 | inline BOOL CTreeListCtrl::DeleteChildItems(HTREEITEM hItem) { ASSERT(::IsWindow(m_hWnd)); return TreeList_DeleteChildItems(m_hWnd,hItem); }
246 | inline BOOL CTreeListCtrl::GetItemRect (HTREEITEM hItem,int nCol,RECT *pRect,int C){ ASSERT(::IsWindow(m_hWnd)); return TreeList_GetItemRect (m_hWnd,hItem,nCol,pRect,C); }
247 | inline BOOL CTreeListCtrl::SetFocusItem (HTREEITEM hItem,int nCol) { ASSERT(::IsWindow(m_hWnd)); return TreeList_SetFocusItem(m_hWnd,hItem,nCol);}
248 | inline HTREEITEM CTreeListCtrl::GetNextItem (HTREEITEM hItem,UINT nCode) { ASSERT(::IsWindow(m_hWnd)); return TreeList_GetNextItem (m_hWnd,hItem,nCode); }
249 | inline HTREEITEM CTreeListCtrl::GetNextSelectedChild(HTREEITEM hItem) { ASSERT(::IsWindow(m_hWnd)); return TreeList_GetNextSelectedChild(m_hWnd,hItem); }
250 | inline HTREEITEM CTreeListCtrl::GetNextSelected (HTREEITEM hItem) { ASSERT(::IsWindow(m_hWnd)); return TreeList_GetNextSelected(m_hWnd,hItem); }
251 | inline HTREEITEM CTreeListCtrl::GetLastChild (HTREEITEM hItem) { ASSERT(::IsWindow(m_hWnd)); return TreeList_GetLastChild(m_hWnd,hItem); }
252 | inline HTREEITEM CTreeListCtrl::GetFirstSelected() { ASSERT(::IsWindow(m_hWnd)); return TreeList_GetNextSelected(m_hWnd,TVI_ROOT); }
253 | inline HTREEITEM CTreeListCtrl::GetFirstItem() { ASSERT(::IsWindow(m_hWnd)); return TreeList_GetNextItem(m_hWnd,TVI_ROOT,TVGN_CHILD); }
254 | inline HTREEITEM CTreeListCtrl::GetFocusItem() { ASSERT(::IsWindow(m_hWnd)); return TreeList_GetFocus(m_hWnd); }
255 | inline INT CTreeListCtrl::GetFocusColumn() { ASSERT(::IsWindow(m_hWnd)); return TreeList_GetFocusColumn(m_hWnd); }
256 | inline INT CTreeListCtrl::GetSelectionColumn() { ASSERT(::IsWindow(m_hWnd)); return TreeList_GetSelectionColumn(m_hWnd); }
257 | inline INT CTreeListCtrl::GetDropHilightColumn() { ASSERT(::IsWindow(m_hWnd)); return TreeList_GetDropHilightColumn(m_hWnd); }
258 | inline CEdit *CTreeListCtrl::EditLabel (HTREEITEM hItem,int nCol,int iF ,int iS) { ASSERT(::IsWindow(m_hWnd)); return (CEdit *)CEdit ::FromHandle(TreeList_EditLabel(m_hWnd,hItem,TVIR_EDITCOL(nCol)|((iF)? TVIR_EDITFULL:0)|(iS))); }
259 | inline CComboBox *CTreeListCtrl::EditLabelCb(HTREEITEM hItem,int nCol,int iF,int iL,int iS) { ASSERT(::IsWindow(m_hWnd)); return (CComboBox *)CEdit ::FromHandle(TreeList_EditLabel(m_hWnd,hItem,TVIR_EDITCOL(nCol)|((iF)? TVIR_EDITFULL:0)|(iS)|((iL)? TVIR_EDITCOMBOLIST:TVIR_EDITCOMBOBOX))); }
260 | inline CHeaderCtrl *CTreeListCtrl::GetHeaderCtrl () const { ASSERT(::IsWindow(m_hWnd)); return (CHeaderCtrl*)CHeaderCtrl::FromHandle(TreeList_GetHeader(m_hWnd)); }
261 | inline CComboBox *CTreeListCtrl::GetComboControl() const { ASSERT(::IsWindow(m_hWnd)); return (CComboBox *)CWnd ::FromHandle((HWND)::SendMessage(m_hWnd,TVM_GETEDITCONTROL,0,0));}
262 | inline CEdit *CTreeListCtrl::GetEditControl () const { ASSERT(::IsWindow(m_hWnd)); return (CEdit *)CWnd ::FromHandle((HWND)::SendMessage(m_hWnd,TVM_GETEDITCONTROL,0,0));}
263 | inline INT CTreeListCtrl::SetColumnAutoEdit(int n,int m ) { ASSERT(::IsWindow(m_hWnd)); return TreeList_SetColumnAutoEdit(m_hWnd,n, m ,NULL ); }
264 | inline INT CTreeListCtrl::SetColumnAutoEdit(int n,int m, LPTSTR *pList,int x) { ASSERT(::IsWindow(m_hWnd)); return TreeList_SetColumnAutoEdit(m_hWnd,n,(m|TVAE_COUNT(x) )| TVAE_PTRLIST,pList); }
265 | inline INT CTreeListCtrl::SetColumnAutoEdit(int n,int m, LPCTSTR *pList,int x) { ASSERT(::IsWindow(m_hWnd)); return TreeList_SetColumnAutoEdit(m_hWnd,n,(m|TVAE_COUNT(x) )| TVAE_PTRLIST,pList); }
266 | inline INT CTreeListCtrl::SetColumnAutoEdit(int n,int m, LPCTSTR pText,int x) { ASSERT(::IsWindow(m_hWnd)); return TreeList_SetColumnAutoEdit(m_hWnd,n,(m|TVAE_COUNT(x) )&~TVAE_PTRLIST,pText); }
267 | inline INT CTreeListCtrl::SetColumnAutoEdit(int n,int m,TCHAR c,LPCTSTR pText,int x) { ASSERT(::IsWindow(m_hWnd)); return TreeList_SetColumnAutoEdit(m_hWnd,n,(m|TVAE_COUNT(x)|TVAE_CHAR(c))&~TVAE_PTRLIST,pText); }
268 | inline INT CTreeListCtrl::SetColumnAutoIcon(int n,int iIcon ) { ASSERT(::IsWindow(m_hWnd)); return TreeList_SetColumnAutoIcon(m_hWnd,n,iIcon); }
269 | inline INT CTreeListCtrl::GetOption(int iOption) { ASSERT(::IsWindow(m_hWnd)); return TreeList_GetOption(m_hWnd,iOption); }
270 | inline INT CTreeListCtrl::SetOption(int iOption,int iValue) { ASSERT(::IsWindow(m_hWnd)); return TreeList_SetOption(m_hWnd,iOption,iValue); }
271 | inline HIMAGELIST CTreeListCtrl::SetImageList(HIMAGELIST hImageList,int nImageListType ) { ASSERT(::IsWindow(m_hWnd)); return TreeList_SetImageList(m_hWnd,hImageList,nImageListType);}
272 | inline HTREEITEM CTreeListCtrl::InsertItem(LPTVINSERTSTRUCT pInsert) { ASSERT(::IsWindow(m_hWnd)); return (HTREEITEM) ::SendMessage(m_hWnd,TVM_INSERTITEM,0,(LPARAM)pInsert);}
273 | inline HTREEITEM CTreeListCtrl::InsertItem(LPCTSTR I,int M,int S,HTREEITEM P,HTREEITEM A) { ASSERT(::IsWindow(m_hWnd)); return InsertItem(TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE ,I,M,S,0,0,0,P,A);}
274 | inline HTREEITEM CTreeListCtrl::InsertItem(LPCTSTR I,int M,int S,TLC_SORT_PARAMS1 ) { ASSERT(::IsWindow(m_hWnd)); return InsertItem(TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE|TVIF_PARAM,I,M,S,0,0,L,P,A);}
275 | inline HTREEITEM CTreeListCtrl::InsertItem(LPCTSTR I,int M,int S,TLC_SORT_PARAMS2 ) { ASSERT(::IsWindow(m_hWnd)); return InsertItem(TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE|TVIF_PARAM,I,M,S,0,0,L,O,P);}
276 | inline HTREEITEM CTreeListCtrl::InsertItem(LPCTSTR I,int M, HTREEITEM P,HTREEITEM A) { ASSERT(::IsWindow(m_hWnd)); return InsertItem(TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE ,I,M,M,0,0,0,P,A);}
277 | inline HTREEITEM CTreeListCtrl::InsertItem(LPCTSTR I,int M, TLC_SORT_PARAMS1 ) { ASSERT(::IsWindow(m_hWnd)); return InsertItem(TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE|TVIF_PARAM,I,M,M,0,0,L,P,A);}
278 | inline HTREEITEM CTreeListCtrl::InsertItem(LPCTSTR I,int M, TLC_SORT_PARAMS2 ) { ASSERT(::IsWindow(m_hWnd)); return InsertItem(TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE|TVIF_PARAM,I,M,M,0,0,L,O,P);}
279 | inline HTREEITEM CTreeListCtrl::InsertItem(LPCTSTR I, HTREEITEM P,HTREEITEM A) { ASSERT(::IsWindow(m_hWnd)); return InsertItem(TVIF_TEXT ,I,0,0,0,0,0,P,A);}
280 | inline HTREEITEM CTreeListCtrl::InsertItem(LPCTSTR I, TLC_SORT_PARAMS1 ) { ASSERT(::IsWindow(m_hWnd)); return InsertItem(TVIF_TEXT |TVIF_PARAM,I,0,0,0,0,L,P,A);}
281 | inline HTREEITEM CTreeListCtrl::InsertItem(LPCTSTR I, TLC_SORT_PARAMS2 ) { ASSERT(::IsWindow(m_hWnd)); return InsertItem(TVIF_TEXT |TVIF_PARAM,I,0,0,0,0,L,O,P);}
282 | inline HTREEITEM CTreeListCtrl::EnumItems(HTREEITEM hLast) { ASSERT(::IsWindow(m_hWnd)); return TreeList_GetNextItem(m_hWnd,hLast,TVGN_NEXTITEM); }
283 |
284 | inline HTREEITEM CTreeListCtrl::FindItem(HTREEITEM hItem,LPCTSTR pText,int nCol,int iCase) { return FindItem(hItem,(iCase)? TVIF_CHILD|TVIF_TEXT|TVIF_CASE:TVIF_CHILD|TVIF_TEXT,nCol,pText);}
285 | inline HTREEITEM CTreeListCtrl::FindItem(HTREEITEM hItem,LPARAM lParam) { return FindItem(hItem, TVIF_CHILD|TVIF_PARAM ,0,0,lParam);}
286 | inline BOOL CTreeListCtrl::DisableItemAutoEdit(HTREEITEM hItem,int nCol,BOOL bDisable) { return SetItemState(hItem,nCol,(bDisable)? TVIS_DISABLEBIT:0,TVIS_DISABLEBIT);}
287 | inline BOOL CTreeListCtrl::SetItemState(HTREEITEM hItem,UINT nState,UINT nMask) { return SetItemState(hItem,0,nState,nMask);}
288 | inline BOOL CTreeListCtrl::EnsureVisible(HTREEITEM hItem) { return EnsureVisible(hItem,0xFFFFFFFF); }
289 | inline BOOL CTreeListCtrl::ExpandAll(HTREEITEM hItem,int iCode) { return Expand(hItem,iCode|TVE_EXPAND|TVE_EXPANDRECURSIVE); }
290 | inline BOOL CTreeListCtrl::CollapseAll(HTREEITEM hItem,int iCode) { return Expand(hItem,iCode|TVE_COLLAPSE|TVE_ALLCHILDS); }
291 | inline BOOL CTreeListCtrl::GetItemRect(HTREEITEM hItem,RECT *pRect,int iCode) { return GetItemRect(hItem,pRect,iCode); }
292 | inline BOOL CTreeListCtrl::SetItem(TVITEM* pItem) { return CTreeCtrl::SetItem(pItem); }
293 | inline BOOL CTreeListCtrl::SetItemCheckBox(HTREEITEM hItem,int iBits,int nCol,UINT uM) { return SetItemState(hItem,nCol,iBits<<12,TVIS_STATEIMAGEMASK&(uM<<12));}
294 | inline BOOL CTreeListCtrl::GetItemCheckBox(HTREEITEM hItem, int nCol,UINT uM) { return(GetItemState(hItem,TVIS_STATEIMAGEMASK,nCol)>>12)&uM; }
295 | inline CImageList *CTreeListCtrl::SetImageList(CImageList* pImageList, int nImageListType ) { return CTreeCtrl::SetImageList(pImageList,nImageListType); }
296 |
297 | inline VOID CTreeListCtrl::GetHeaderCtrl (HWND &hWnd) const { ASSERT(::IsWindow(m_hWnd)); hWnd=(HWND)::SendMessage(m_hWnd,TVM_GETHEADER ,0,0);}
298 | inline VOID CTreeListCtrl::GetEditControl (HWND &hWnd) const { ASSERT(::IsWindow(m_hWnd)); hWnd=(HWND)::SendMessage(m_hWnd,TVM_GETEDITCONTROL,0,0);}
299 | inline VOID CTreeListCtrl::GetComboControl(HWND &hWnd) const { ASSERT(::IsWindow(m_hWnd)); hWnd=(HWND)::SendMessage(m_hWnd,TVM_GETEDITCONTROL,0,0);}
300 |
301 | // ListCtrl Functions
302 |
303 | inline BOOL CTreeListCtrl::ListSetItem(int iRow,LPCTSTR pTxt,int nImg,int nSt,int iMsk){ return ListSetItem(iRow,0,pTxt,nImg,nSt,iMsk); }
304 | inline BOOL CTreeListCtrl::ListSetTopIndex (int iRow) { return TreeList_SelectSetFirstVisible(m_hWnd,GetItemOfRow(iRow));}
305 | inline CEdit *CTreeListCtrl::ListEditLabel (int iRow,int nCol,int iF ,int iS){ return EditLabel (GetItemOfRow(iRow),nCol,iF ,iS); }
306 | inline CComboBox *CTreeListCtrl::ListEditLabelCb (int iRow,int nCol,int iF,int iL,int iS){ return EditLabelCb (GetItemOfRow(iRow),nCol,iF,iL,iS); }
307 | inline CImageList *CTreeListCtrl::ListCreateDragImage (int iRow,int nCol) { return CreateDragImage (GetItemOfRow(iRow),nCol); }
308 | inline LPCTSTR CTreeListCtrl::ListGetItemText (int iRow, int nCol){ return GetItemText (GetItemOfRow(iRow) ,nCol);}
309 | inline BOOL CTreeListCtrl::ListSetItemText (int iRow,LPCTSTR pText ,int nCol){ return SetItemText (GetItemOfRow(iRow),pText ,nCol);}
310 | inline LRESULT CTreeListCtrl::ListGetItemData (int iRow ){ return GetItemData (GetItemOfRow(iRow) );}
311 | inline UINT CTreeListCtrl::ListGetItemState (int iRow,UINT nStateMask ,int nCol){ return GetItemState (GetItemOfRow(iRow),nStateMask, nCol);}
312 | inline BOOL CTreeListCtrl::ListSetItemState (int iRow, UINT nStat,UINT nMsk){ return SetItemState (GetItemOfRow(iRow), nStat,nMsk); }
313 | inline BOOL CTreeListCtrl::ListSetItemState (int iRow,int nCol,UINT nStat,UINT nMsk){ return SetItemState (GetItemOfRow(iRow),nCol,nStat,nMsk); }
314 | inline BOOL CTreeListCtrl::ListGetItemCheckBox (int iRow ,int nCol,UINT uMsk){ return GetItemCheckBox (GetItemOfRow(iRow), nCol,uMsk); }
315 | inline BOOL CTreeListCtrl::ListSetItemCheckBox (int iRow,int iState,int nCol,UINT uMsk){ return SetItemCheckBox (GetItemOfRow(iRow),iState,nCol,uMsk); }
316 | inline BOOL CTreeListCtrl::ListSelectItem (int iRow,int nCol) { return SelectItem (GetItemOfRow(iRow),nCol); }
317 | inline BOOL CTreeListCtrl::ListSetFocusItem (int iRow,int nCol) { return SetFocusItem (GetItemOfRow(iRow),nCol); }
318 | inline BOOL CTreeListCtrl::ListEnsureVisible (int iRow,int nCol) { return EnsureVisible (GetItemOfRow(iRow),nCol); }
319 | inline BOOL CTreeListCtrl::ListEnsureVisible (int iRow) { return EnsureVisible (GetItemOfRow(iRow)); }
320 | inline LPVOID CTreeListCtrl::ListGetUserData (int iRow) const { return GetUserData (GetItemOfRow(iRow)); }
321 | inline INT CTreeListCtrl::ListGetItemImageEx (int iRow ,int nCol) { return GetItemImageEx (GetItemOfRow(iRow) ,nCol); }
322 | inline BOOL CTreeListCtrl::ListGetItemImageEx (int iRow,int *pImage ,int nCol) { return GetItemImageEx (GetItemOfRow(iRow),pImage,nCol); }
323 | inline BOOL CTreeListCtrl::ListSetItemImageEx (int iRow,int nImage ,int nCol) { return SetItemImageEx (GetItemOfRow(iRow),nImage,nCol); }
324 | inline INT CTreeListCtrl::ListGetItemImage (int iRow,int &nImage,int &nSelImage) { return GetItemImage (GetItemOfRow(iRow),nImage,nSelImage); }
325 | inline BOOL CTreeListCtrl::ListSetItemImage (int iRow,int nImage,int nSelImage) { return SetItemImage (GetItemOfRow(iRow),nImage,nSelImage); }
326 | inline INT CTreeListCtrl::ListGetNextSelected (int iRow) { return GetRowOfItem (GetNextSelected(GetItemOfRow(iRow))); }
327 | inline INT CTreeListCtrl::ListGetFirstSelected( ) { return GetRowOfItem (GetFirstSelected()); }
328 | inline COLORREF CTreeListCtrl::ListGetItemBkColor (int iRow,int nCol) const { return GetItemBkColor (GetItemOfRow(iRow),nCol); }
329 | inline COLORREF CTreeListCtrl::ListSetItemBkColor (int iRow,int nCol,COLORREF uColor) { return SetItemBkColor (GetItemOfRow(iRow),nCol,uColor); }
330 | inline COLORREF CTreeListCtrl::ListGetItemTextColor(int iRow,int nCol) const { return GetItemTextColor(GetItemOfRow(iRow),nCol); }
331 | inline COLORREF CTreeListCtrl::ListSetItemTextColor(int iRow,int nCol,COLORREF uColor) { return SetItemTextColor(GetItemOfRow(iRow),nCol,uColor); }
332 | inline BOOL CTreeListCtrl::ListSelectDropTarget(int iRow,int nCol) { return SelectDropTarget(GetItemOfRow(iRow),nCol); }
333 | inline BOOL CTreeListCtrl::ListGetItemRect (int iRow,int nCol,RECT *pRec,int iCode){ return GetItemRect (GetItemOfRow(iRow),nCol,pRec,iCode); }
334 | inline BOOL CTreeListCtrl::ListGetItemRect (int iRow, RECT *pRec,int iCode){ return GetItemRect (GetItemOfRow(iRow), pRec,iCode); }
335 | inline INT CTreeListCtrl::ListGetFocusItem () { return GetRowOfItem (GetFocusItem()); }
336 | inline INT CTreeListCtrl::ListGetTopIndex () { int i= GetRowOfItem (GetFirstVisibleItem());if(i<0)i=0;return i;}
337 |
338 |
339 |
340 |
341 | #endif
342 |
343 |
--------------------------------------------------------------------------------
/TreeListDlg.h:
--------------------------------------------------------------------------------
1 | //*****************************************************************************
2 | //*
3 | //*
4 | //* TreeListDlg.h
5 | //*
6 | //*
7 | //*****************************************************************************
8 | #ifndef AFX_TREELISTDLG_H__C9C3C776_6449_4E21_8D23_9B5ED42A4027__INCLUDED_
9 | #define AFX_TREELISTDLG_H__C9C3C776_6449_4E21_8D23_9B5ED42A4027__INCLUDED_
10 |
11 | #if _MSC_VER > 1000
12 | #pragma once
13 | #endif
14 |
15 | #include "TreeListCtrl.h"
16 |
17 | //*****************************************************************************
18 | //*
19 | //* CTreeListDlg
20 | //*
21 | //*****************************************************************************
22 | class CTreeListDlg : public CDialog
23 | {
24 | public:
25 | CTreeListDlg(CWnd *pParent = NULL);
26 |
27 | //{{AFX_DATA(CTreeListDlg)
28 | enum { IDD = IDD_TREELIST_DIALOG };
29 | BOOL m_bFullWidth;
30 | BOOL m_bOnlyReturn;
31 | BOOL m_bPtrList;
32 | BOOL m_bDropDown;
33 | BOOL m_bDblClick;
34 | BOOL m_bNextLine;
35 | BOOL m_bStateEnable;
36 | BOOL m_bIconClick;
37 | BOOL m_bAutoEnable;
38 | int m_iCheckMode;
39 | int m_iAutoEditMode;
40 | //}}AFX_DATA
41 |
42 | //{{AFX_VIRTUAL(CTreeListDlg)
43 | protected:
44 | virtual void DoDataExchange(CDataExchange *pDX);
45 | //}}AFX_VIRTUAL
46 |
47 | protected:
48 |
49 | HTREEITEM m_hSelect;
50 | int m_iSelCol;
51 | HICON m_hIcon;
52 | CTreeListCtrl m_cTreeList;
53 | CImageList m_cImages;
54 | CImageList m_cChecks;
55 | CString m_sUserData;
56 | unsigned m_uSelState;
57 |
58 | //{{AFX_MSG(CTreeListDlg)
59 | virtual BOOL OnInitDialog();
60 | virtual void OnCancel();
61 | virtual void OnOK();
62 | afx_msg HCURSOR OnQueryDragIcon();
63 | afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
64 | afx_msg void OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT pDrawItemStruct);
65 | afx_msg void OnPaint();
66 | afx_msg void OnCombo();
67 | afx_msg void OnRadio1();
68 | afx_msg void OnRadio2();
69 | afx_msg void OnRadio3();
70 | afx_msg void OnRadio4();
71 | afx_msg void OnRadio5();
72 | afx_msg void OnRadio6();
73 | afx_msg void OnRadio7();
74 | afx_msg void OnRadio8();
75 | afx_msg void OnCheck1();
76 | afx_msg void OnCheck2();
77 | afx_msg void OnCheck3();
78 | afx_msg void OnCheck4();
79 | afx_msg void OnCheck5();
80 | afx_msg void OnCheck6();
81 | afx_msg void OnCheck7();
82 | afx_msg void OnCheck8();
83 | afx_msg void OnCheck9();
84 | afx_msg void OnCheck10();
85 | afx_msg void OnCheck11();
86 | afx_msg void OnCheck12();
87 | afx_msg void OnCheck13();
88 | afx_msg void OnCheck14();
89 | afx_msg void OnCheck15();
90 | afx_msg void OnCheck16();
91 | afx_msg void OnCheck17();
92 | afx_msg void OnCheck18();
93 | afx_msg void OnCheck19();
94 | afx_msg void OnCheck20();
95 | afx_msg void OnCheck21();
96 | afx_msg void OnCheck22();
97 | afx_msg void OnCheck23();
98 | afx_msg void OnCheck24();
99 | afx_msg void OnCheck25();
100 | afx_msg void OnCheck26();
101 | afx_msg void OnCheck27();
102 | afx_msg void OnCheck28();
103 | afx_msg void OnCheck29();
104 | afx_msg void OnCheck30();
105 | afx_msg void OnCheck31();
106 | afx_msg void OnCheck32();
107 | afx_msg void OnCheck33();
108 | afx_msg void OnCheck34();
109 | afx_msg void OnCheck35();
110 | afx_msg void OnCheck36();
111 | afx_msg void OnCheck37();
112 | afx_msg void OnCheck38();
113 | afx_msg void OnCheck39();
114 | afx_msg void OnCheck40();
115 | afx_msg void OnCheck41();
116 | afx_msg void OnCheck42();
117 | afx_msg void OnCheck43();
118 | afx_msg void OnCheck44();
119 | afx_msg void OnChangeCheck();
120 | afx_msg void OnChangeColor1();
121 | afx_msg void OnChangeColor2();
122 | afx_msg void OnChangeColor3();
123 | afx_msg void OnChangeColor4();
124 | afx_msg void OnChangeColor5();
125 | afx_msg void OnChangeColor6();
126 | afx_msg void OnChangeColor7();
127 | afx_msg void OnChangeColor8();
128 | afx_msg void OnContextMenu(CWnd *pWnd,CPoint sPoint);
129 | afx_msg void OnEdit();
130 | //}}AFX_MSG
131 | DECLARE_MESSAGE_MAP()
132 |
133 | void OnCheck(int iID);
134 | void OnReturn (NMHDR *pNmHdr, LRESULT *pResult);
135 | void OnSelChanged (NMHDR *pNmHdr, LRESULT *pResult);
136 | void OnColumnClick (NMHDR *pNmHdr, LRESULT *pResult);
137 | void OnItemExpanded (NMHDR *pNmHdr, LRESULT *pResult);
138 | void OnEndLabelEdit (NMHDR *pNmHdr, LRESULT *pResult);
139 | void OnTooltipNotify (NMHDR *pNmHdr, LRESULT *pResult);
140 | void OnBeginLabelEdit(NMHDR *pNmHdr, LRESULT *pResult);
141 | void OnCbStateChanged(NMHDR *pNmHdr, LRESULT *pResult);
142 | void OnUpdateAutoEdit();
143 | void OnUpdateState ();
144 |
145 | };
146 |
147 | //{{AFX_INSERT_LOCATION}}
148 |
149 | #endif
150 |
--------------------------------------------------------------------------------
/TreeListDll.cpp:
--------------------------------------------------------------------------------
1 |
2 | #include "stdafx.h"
3 | #include
4 | #include "TreeListWnd.h"
5 |
6 | __declspec(dllexport) BOOL __stdcall DllMain(HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) {
7 | switch (ul_reason_for_call) {
8 | case DLL_PROCESS_ATTACH:
9 | OutputDebugString(TEXT("DLL_PROCESS_ATTACH\n"));
10 | TreeListRegister((HINSTANCE)hModule);
11 | break;
12 | case DLL_THREAD_ATTACH:
13 | OutputDebugString(TEXT("DLL_THREAD_ATTACH\n"));
14 | break;
15 | case DLL_THREAD_DETACH:
16 | OutputDebugString(TEXT("DLL_THREAD_DETACH\n"));
17 | break;
18 | case DLL_PROCESS_DETACH:
19 | OutputDebugString(TEXT("DLL_PROCESS_DETACH\n"));
20 | TreeListUnregister((HINSTANCE)hModule);
21 | break;
22 | }
23 | return TRUE;
24 | }
25 |
--------------------------------------------------------------------------------
/TreeListDll.rc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sebkirche/treelist/f005e8d715aa0c831c5bc98ef6add7798d1c26dd/TreeListDll.rc
--------------------------------------------------------------------------------
/TreeListWnd.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sebkirche/treelist/f005e8d715aa0c831c5bc98ef6add7798d1c26dd/TreeListWnd.cpp
--------------------------------------------------------------------------------
/TreeListWnd.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sebkirche/treelist/f005e8d715aa0c831c5bc98ef6add7798d1c26dd/TreeListWnd.h
--------------------------------------------------------------------------------
/conv_defs.pl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sebkirche/treelist/f005e8d715aa0c831c5bc98ef6add7798d1c26dd/conv_defs.pl
--------------------------------------------------------------------------------
/demo_pb.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sebkirche/treelist/f005e8d715aa0c831c5bc98ef6add7798d1c26dd/demo_pb.png
--------------------------------------------------------------------------------
/demo_vc.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sebkirche/treelist/f005e8d715aa0c831c5bc98ef6add7798d1c26dd/demo_vc.png
--------------------------------------------------------------------------------
/help.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sebkirche/treelist/f005e8d715aa0c831c5bc98ef6add7798d1c26dd/help.pdf
--------------------------------------------------------------------------------
/res/DataFinder.rc2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sebkirche/treelist/f005e8d715aa0c831c5bc98ef6add7798d1c26dd/res/DataFinder.rc2
--------------------------------------------------------------------------------
/res/TreeList.exe.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 | Your application description here.
10 |
11 |
12 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/res/TreeList.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sebkirche/treelist/f005e8d715aa0c831c5bc98ef6add7798d1c26dd/res/TreeList.ico
--------------------------------------------------------------------------------
/res/TreeList.rc2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sebkirche/treelist/f005e8d715aa0c831c5bc98ef6add7798d1c26dd/res/TreeList.rc2
--------------------------------------------------------------------------------
/res/checks.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sebkirche/treelist/f005e8d715aa0c831c5bc98ef6add7798d1c26dd/res/checks.bmp
--------------------------------------------------------------------------------
/res/flags.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sebkirche/treelist/f005e8d715aa0c831c5bc98ef6add7798d1c26dd/res/flags.bmp
--------------------------------------------------------------------------------
/resource.h:
--------------------------------------------------------------------------------
1 | //{{NO_DEPENDENCIES}}
2 | // Microsoft Visual C++ generated include file.
3 | // Used by TreeList.rc
4 | //
5 | #define IDM_ABOUTBOX 0x0010
6 | #define IDC_EDIT 52
7 | #define IDD_ABOUTBOX 100
8 | #define IDS_ABOUTBOX 101
9 | #define IDD_TREELIST_DIALOG 102
10 | #define IDR_MAINFRAME 128
11 | #define IDB_FLAGS 129
12 | #define IDB_CHECKS 130
13 | #define IDC_FRAME 1000
14 | #define IDC_CHECK1 1001
15 | #define IDC_CHECK2 1002
16 | #define IDC_CHECK3 1003
17 | #define IDC_CHECK4 1004
18 | #define IDC_CHECK5 1005
19 | #define IDC_CHECK6 1006
20 | #define IDC_CHECK7 1007
21 | #define IDC_CHECK8 1008
22 | #define IDC_CHECK9 1009
23 | #define IDC_CHECK10 1010
24 | #define IDC_CHECK11 1011
25 | #define IDC_CHECK12 1012
26 | #define IDC_CHECK13 1013
27 | #define IDC_CHECK14 1014
28 | #define IDC_CHECK15 1015
29 | #define IDC_CHECK16 1016
30 | #define IDC_CHECK17 1017
31 | #define IDC_CHECK18 1018
32 | #define IDC_CHECK19 1019
33 | #define IDC_CHECK20 1020
34 | #define IDC_CHECK21 1021
35 | #define IDC_CHECK22 1022
36 | #define IDC_COMBO1 1023
37 | #define IDC_COMBO2 1024
38 | #define IDC_COMBO3 1025
39 | #define IDC_COMBO4 1026
40 | #define IDC_COMBO5 1027
41 | #define IDC_COMBO6 1028
42 | #define IDC_COMBO7 1029
43 | #define IDC_COMBO8 1030
44 | #define IDC_EDIT1 1031
45 | #define IDC_EDIT2 1032
46 | #define IDC_EDIT4 1033
47 | #define IDC_COMBO 1034
48 | #define IDC_COMBO9 1035
49 | #define IDC_RADIO1 1039
50 | #define IDC_RADIO2 1040
51 | #define IDC_RADIO3 1041
52 | #define IDC_RADIO4 1042
53 | #define IDC_RADIO5 1043
54 | #define IDC_CHECK23 1044
55 | #define IDC_CHECK24 1045
56 | #define IDC_CHECK25 1046
57 | #define IDC_CHECK26 1052
58 | #define IDC_CHECK27 1059
59 | #define IDC_CHECK28 1061
60 | #define IDC_CHECK29 1062
61 | #define IDC_RADIO6 1063
62 | #define IDC_CHECK30 1064
63 | #define IDC_RADIO7 1065
64 | #define IDC_RADIO8 1066
65 | #define IDC_CHECK31 1067
66 | #define IDC_EDIT3 1068
67 | #define IDC_CHECK40 1069
68 | #define IDC_CHECK32 1072
69 | #define IDC_CHECK33 1073
70 | #define IDC_CHECK34 1074
71 | #define IDC_CHECK35 1075
72 | #define IDC_CHECK36 1076
73 | #define IDC_CHECK37 1077
74 | #define IDC_CHECK38 1082
75 | #define IDC_CHECK39 1083
76 | #define IDC_CHECK41 1084
77 | #define IDC_CHECK42 1085
78 | #define IDC_CHECK43 1086
79 | #define IDC_CHECK44 1087
80 |
81 | // Next default values for new objects
82 | //
83 | #ifdef APSTUDIO_INVOKED
84 | #ifndef APSTUDIO_READONLY_SYMBOLS
85 | #define _APS_NEXT_RESOURCE_VALUE 131
86 | #define _APS_NEXT_COMMAND_VALUE 40001
87 | #define _APS_NEXT_CONTROL_VALUE 1088
88 | #define _APS_NEXT_SYMED_VALUE 101
89 | #endif
90 | #endif
91 |
--------------------------------------------------------------------------------
/tests/TreeList.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sebkirche/treelist/f005e8d715aa0c831c5bc98ef6add7798d1c26dd/tests/TreeList.exe
--------------------------------------------------------------------------------
/tests/build_simple_static.bat:
--------------------------------------------------------------------------------
1 | cl simple_static.cpp ..\TreeListWnd.cpp user32.lib comctl32.lib gdi32.lib /I ..
2 |
--------------------------------------------------------------------------------
/tests/flags.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sebkirche/treelist/f005e8d715aa0c831c5bc98ef6add7798d1c26dd/tests/flags.bmp
--------------------------------------------------------------------------------
/tests/header.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sebkirche/treelist/f005e8d715aa0c831c5bc98ef6add7798d1c26dd/tests/header.bmp
--------------------------------------------------------------------------------
/tests/simple.cpp:
--------------------------------------------------------------------------------
1 |
2 | //#define UNICODE
3 | #include
4 | #include
5 | #include
6 | #include "../TreeListWnd.h"
7 | #include "../resource.h"
8 |
9 | HINSTANCE hInst;
10 | BOOL bUseDll = FALSE;
11 | LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
12 |
13 | int main(int argc, char *argv[]) {
14 |
15 | HINSTANCE hInst;
16 |
17 | hInst = GetModuleHandle(NULL);
18 |
19 | //printf("argc = %d argv=%s\n", argc, argc==2 && argv[1]?argv[1]:"");
20 | if (argc == 2 && _stricmp(argv[1], "dll") == 0){
21 | printf("use dll\n");
22 | bUseDll = TRUE;
23 | }
24 |
25 | WNDCLASSEX wcex = {
26 | sizeof(WNDCLASSEX), 0, WndProc, 0, 0, hInst, /*IDR_MAINFRAME */ LoadIcon(NULL, IDI_APPLICATION),
27 | LoadCursor(NULL, IDC_ARROW), (HBRUSH)(COLOR_WINDOW + 1), NULL, TEXT("TreeListDemo"), NULL,
28 | };
29 | if(!RegisterClassEx(&wcex))
30 | return MessageBox(NULL, TEXT("Cannot register class !"), TEXT("Error"), MB_ICONERROR | MB_OK);
31 |
32 | int nX = (GetSystemMetrics(SM_CXSCREEN) - 860) / 2, nY = (GetSystemMetrics(SM_CYSCREEN) - 600) / 2;
33 | HWND hWnd = CreateWindowEx(0, wcex.lpszClassName, TEXT("TestTreeList"),
34 | WS_OVERLAPPEDWINDOW, nX, nY, 860, 600, NULL, NULL, hInst, NULL);
35 | if(!hWnd)
36 | return MessageBox(NULL, TEXT("Cannot create window !"), TEXT("Error"), MB_ICONERROR | MB_OK);
37 | ShowWindow(hWnd, SW_SHOWNORMAL);
38 | UpdateWindow(hWnd);
39 | MSG msg;
40 | while(GetMessage(&msg, NULL, 0, 0)) {
41 | TranslateMessage(&msg);
42 | DispatchMessage(&msg);
43 | }
44 | return (int) msg.wParam;
45 | }
46 |
47 | LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) {
48 | static HWND hWndTL;
49 | switch(message) {
50 | case WM_CREATE: {
51 |
52 | HINSTANCE hInst;
53 | HMODULE hLib;
54 |
55 | hInst = GetModuleHandle(NULL);
56 | if (bUseDll){
57 | hLib = LoadLibrary(TEXT("..\\PB\\TreeList.dll"));
58 | printf("class registration: hInst=%08lx, hLib=%08lx\n", hInst, hLib);
59 | }
60 | else
61 | TreeListRegister(hInst);
62 |
63 | hWndTL = CreateWindow(TEXT(TVC_CLASSNAME), TEXT("TreeList"), WS_VISIBLE | WS_CHILD | TVS_HASLINES | TVS_LINESATROOT | TVS_HASBUTTONS, 0, 0, 430, 300, hWnd, 0, hInst, NULL);
64 | printf("created windows is %08lx\n", hWndTL);
65 |
66 | SendMessage(hWndTL, TVM_SETEXTENDEDSTYLE, 0, TVS_EX_ITEMLINES | TVS_EX_ALTERNATECOLOR | TVS_EX_FULLROWMARK);
67 |
68 | HIMAGELIST hImgTree = ImageList_LoadImage(NULL, TEXT("flags.bmp"), 16, 10, CLR_DEFAULT, IMAGE_BITMAP, LR_LOADFROMFILE /*LR_CREATEDIBSECTION | LR_DEFAULTSIZE | LR_SHARED | LR_LOADTRANSPARENT*/);
69 | if(NULL == hImgTree){
70 | DWORD dwErr = ::GetLastError();
71 | printf("ImageList_LoadImage() tree failed: %d.\n", dwErr);
72 | } else{
73 | printf("ImageList_LoadImage() tree succeeded, TVM_SETIMAGELIST returned %d.\n", SendMessage(hWndTL, TVM_SETIMAGELIST, TVSIL_NORMAL, (LPARAM)hImgTree));
74 | ;
75 | }
76 | HIMAGELIST hImgHead = ImageList_LoadImage(NULL, TEXT("header.bmp"), 16, 10, CLR_DEFAULT, IMAGE_BITMAP, LR_LOADFROMFILE /*LR_CREATEDIBSECTION | LR_DEFAULTSIZE | LR_SHARED | LR_LOADTRANSPARENT*/);
77 | if(NULL == hImgHead){
78 | DWORD dwErr = ::GetLastError();
79 | printf("ImageList_LoadImage() header failed: %d.\n", dwErr);
80 | } else{
81 | printf("ImageList_LoadImage() header succeeded, TVM_SETIMAGELIST returned %d.\n", SendMessage(hWndTL, TVM_SETIMAGELIST, TVSIL_HEADER, (LPARAM)hImgHead));
82 | ;
83 | }
84 |
85 | //------------------------COLUMNS----------------------------------------------------------------
86 | int colIdx = 0;
87 | TV_COLUMN col;
88 | memset(&col, 0, sizeof(TV_COLUMN));
89 | col.mask = TVCF_TEXT;
90 | col.pszText = TEXT("Tree (col 0)");
91 | col.cchTextMax = 256;
92 | //TreeList_InsertColumn(hWndTL, colIdx++, &col);
93 | LRESULT col1 = SendMessage(hWndTL, TVM_INSERTCOLUMN, (WPARAM)colIdx++, (LPARAM)&col);
94 | printf("TVM_INSERTCOLUMN returned %08lx\n", col1);
95 |
96 | col.mask = TVCF_TEXT | TVCF_IMAGE | TVCF_FMT;
97 | col.fmt = /*LVCFMT_CENTER | */ LVCFMT_BITMAP_ON_RIGHT;
98 | col.pszText = TEXT("col 1");
99 | col.iImage = 0;
100 | //TreeList_InsertColumn(hWndTL, colIdx++, &col);
101 | LRESULT col2 = SendMessage(hWndTL, TVM_INSERTCOLUMN, (WPARAM)colIdx++, (LPARAM)&col);
102 | printf("TVM_INSERTCOLUMN returned %08lx\n", col2);
103 |
104 | col.mask = TVCF_TEXT | TVCF_IMAGE | TVCF_FMT;
105 | col.fmt = /*LVCFMT_CENTER | */ LVCFMT_BITMAP_ON_RIGHT;
106 | col.pszText = TEXT("col 2");
107 | col.iImage = 1;
108 | col.fmt = /*LVCFMT_CENTER | */ LVCFMT_BITMAP_ON_RIGHT;
109 | //TreeList_InsertColumn(hWndTL, colIdx++, &col);
110 | LRESULT col3 = SendMessage(hWndTL, TVM_INSERTCOLUMN, (WPARAM)colIdx++, (LPARAM)&col);
111 | printf("TVM_INSERTCOLUMN returned %08lx\n", col3);
112 |
113 | col.mask = TVCF_TEXT | TVCF_IMAGE | TVCF_FMT;
114 | col.fmt = /*LVCFMT_CENTER | */ LVCFMT_BITMAP_ON_RIGHT;
115 | col.pszText = TEXT("col 3");
116 | col.iImage = 2;
117 | col.fmt = /*LVCFMT_CENTER | */ LVCFMT_BITMAP_ON_RIGHT;
118 | //TreeList_InsertColumn(hWndTL, colIdx++, &col);
119 | LRESULT col4 = SendMessage(hWndTL, TVM_INSERTCOLUMN, (WPARAM)colIdx++, (LPARAM)&col);
120 | printf("TVM_INSERTCOLUMN returned %08lx\n", col4);
121 |
122 | //------------------------LINES----------------------------------------------------------------
123 |
124 | HTREEITEM inserted, inserted2;
125 | TVINSERTSTRUCT item;
126 | item.hParent = 0;
127 | item.hInsertAfter = TVI_SORTEX;
128 | item.item.hItem = 0;//(HTREEITEM)pCmpProc;
129 | item.item.pszText = TEXT("Item 1");
130 | item.item.mask = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
131 | item.item.iImage = 0;
132 | item.item.iSelectedImage = 2;
133 | item.item.state = 0;
134 | item.item.stateMask = 0;
135 | item.item.lParam = 0;
136 | inserted = (HTREEITEM)SendMessage(hWndTL, TVM_INSERTITEM, 0, (LPARAM)&item);
137 | printf("inserted = %08lx\n", inserted);
138 |
139 | TVINSERTSTRUCT item2;
140 | item2.hParent = inserted;
141 | item2.hInsertAfter = TVI_LAST ;
142 | item2.item.hItem = 0;
143 | item2.item.pszText = TEXT("Item 2");
144 | item2.item.mask = TVIF_TEXT;
145 | item2.item.iImage = TV_NOIMAGE;
146 | item2.item.iSelectedImage = TV_NOIMAGE;
147 | item2.item.state = 0;
148 | item2.item.stateMask = 0;
149 | item2.item.lParam = 0;
150 | inserted2 = (HTREEITEM)SendMessage(hWndTL, TVM_INSERTITEM, 0, (LPARAM)&item2);
151 | printf("inserted = %08lx\n", inserted2);
152 | if(inserted2) {
153 | SendMessage(hWndTL, TVM_EXPAND, TVE_EXPAND, (LPARAM)inserted);
154 | TV_ITEM itm;
155 | itm.mask = TVIF_SUBITEM | TVIF_TEXT;
156 | itm.hItem = inserted2;
157 | itm.state = 0;
158 | itm.stateMask = 0;
159 | itm.pszText = TEXT("blah blah");
160 | itm.cchTextMax = 256;
161 | itm.iImage = 0;
162 | itm.iSelectedImage = 0;
163 | itm.cChildren = 1;
164 | itm.lParam = 0;
165 | SendMessage(hWndTL, TVM_SETITEM, 0, (LPARAM)&itm);
166 |
167 | itm.mask = TVIF_SUBITEM | TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
168 | itm.pszText = TEXT("bli bli");
169 | itm.cChildren = 2;
170 | itm.iImage = 11;
171 | itm.iSelectedImage = 11;
172 | SendMessage(hWndTL, TVM_SETITEM, 0, (LPARAM)&itm);
173 | }
174 |
175 | TVINSERTSTRUCT item3;
176 | item3.hParent = inserted2;
177 | item3.hInsertAfter = TVI_LAST ;
178 | item3.item.hItem = 0;
179 | item3.item.pszText = TEXT("Item 3");
180 | item3.item.mask = TVIF_TEXT;
181 | item3.item.iImage = TV_NOIMAGE;
182 | item3.item.iSelectedImage = TV_NOIMAGE;
183 | item3.item.state = 0;
184 | item3.item.stateMask = 0;
185 | item3.item.lParam = 0;
186 | inserted2 = (HTREEITEM)SendMessage(hWndTL, TVM_INSERTITEM, 0, (LPARAM)&item3);
187 | printf("inserted = %08lx\n", inserted2);
188 |
189 | TVINSERTSTRUCT item4;
190 | item4.hParent = inserted;
191 | item4.hInsertAfter = TVI_LAST ;
192 | item4.item.hItem = 0;
193 | item4.item.pszText = TEXT("Item 4");
194 | item4.item.mask = TVIF_TEXT;
195 | item4.item.iImage = TV_NOIMAGE;
196 | item4.item.iSelectedImage = TV_NOIMAGE;
197 | item4.item.state = 0;
198 | item4.item.stateMask = 0;
199 | item4.item.lParam = 0;
200 | inserted = (HTREEITEM)SendMessage(hWndTL, TVM_INSERTITEM, 0, (LPARAM)&item4);
201 | printf("inserted = %08lx\n", inserted);
202 |
203 | SetWindowLong(hWndTL, GWL_EXSTYLE, GetWindowLong(hWndTL, GWL_EXSTYLE) | TVS_EX_ITEMLINES);
204 |
205 | //---------------SET THE FONT--------------------------------------------
206 |
207 | HFONT hf;
208 | HDC hdc;
209 | long lfHeight;
210 |
211 | hdc = GetDC(NULL);
212 | lfHeight = -MulDiv(10, GetDeviceCaps(hdc, LOGPIXELSY), 72);
213 | ReleaseDC(NULL, hdc);
214 |
215 | hf = CreateFont(lfHeight, 0, 0, 0, FW_NORMAL, FALSE /*italic*/, FALSE /*underline*/, FALSE /*strikethrough*/, 0, 0, 0, 0, 0, TEXT("Comic Sans MS"));
216 | if(hf){
217 | printf("CreateFont succeeded.\n");
218 | SendMessage(hWndTL, WM_SETFONT, (WPARAM)hf, TRUE);
219 | //DeleteObject(hf);
220 | } else
221 | printf("CreateFont failed!\n");
222 |
223 | LVCOLUMN tcol;
224 | tcol.fmt = TVCFMT_FIXED|TVCFMT_MARK;
225 | tcol.mask = TVCF_FIXED | TVCF_MARK | TVCF_WIDTH;
226 | tcol.cx = 1;
227 | SendMessage(hWndTL, TVM_SETCOLUMN, col2, (LPARAM)&tcol);
228 |
229 | SendMessage(hWndTL, TVM_GETUNICODEFORMAT, 0, 0);
230 |
231 | return 0;
232 | }
233 | break;
234 | case WM_SIZE: {
235 | MoveWindow(hWndTL, 0, 0, LOWORD(lParam), HIWORD(lParam), TRUE);
236 | return 0;
237 | }
238 | break;
239 | case WM_DESTROY: {
240 | TCHAR sMsg[50];
241 | wsprintf(sMsg, TEXT("%d items"), SendMessage(hWndTL, TVM_GETROWCOUNT, (WPARAM)NULL, (LPARAM)NULL));
242 | OutputDebugString(sMsg);
243 | printf("%s", sMsg);
244 | PostQuitMessage(0);
245 | return 0;
246 | }
247 | break;
248 | default
249 | :
250 | return DefWindowProc(hWnd, message, wParam, lParam);
251 | }
252 | return 0;
253 | }
254 |
--------------------------------------------------------------------------------
/tests/simple.rc:
--------------------------------------------------------------------------------
1 | // Microsoft Visual C++ generated resource script.
2 | //
3 |
4 | #include "resource.h"
5 | #include "TreeListwnd.h"
6 |
7 | #include "afxres.h"
8 |
9 | /////////////////////////////////////////////////////////////////////////////
10 | // German (Germany) resources
11 |
12 | LANGUAGE LANG_GERMAN, SUBLANG_GERMAN
13 |
14 | /////////////////////////////////////////////////////////////////////////////
15 | //
16 | // Version
17 | //
18 |
19 | VS_VERSION_INFO VERSIONINFO
20 | FILEVERSION 2,4,0,0
21 | PRODUCTVERSION 2,4,0,0
22 | FILEFLAGSMASK 0x3fL
23 | #ifdef _DEBUG
24 | FILEFLAGS 0x1L
25 | #else
26 | FILEFLAGS 0x0L
27 | #endif
28 | FILEOS 0x4L
29 | FILETYPE 0x1L
30 | FILESUBTYPE 0x0L
31 | BEGIN
32 | BLOCK "StringFileInfo"
33 | BEGIN
34 | BLOCK "040704b0"
35 | BEGIN
36 | VALUE "CompanyName", "seki.fr"
37 | VALUE "FileDescription", "TreeList simple test"
38 | VALUE "FileVersion", "2, 4, 0, 0"
39 | VALUE "InternalName", TVC_CLASSNAME
40 | VALUE "LegalCopyright", "Copyright (C) 2014"
41 | VALUE "OriginalFilename", "simple.exe"
42 | VALUE "ProductName", "TreeList"
43 | VALUE "ProductVersion", "2, 4, 0, 0"
44 | END
45 | END
46 | BLOCK "VarFileInfo"
47 | BEGIN
48 | VALUE "Translation", 0x407, 1200
49 | END
50 | END
51 |
52 | /////////////////////////////////////////////////////////////////////////////
53 | //
54 | // Icon
55 | //
56 |
57 | // Icon with lowest ID value placed first to ensure application icon
58 | // remains consistent on all systems.
59 | IDR_MAINFRAME ICON "res\\TreeList.ico"
60 |
61 |
62 |
--------------------------------------------------------------------------------
/tests/simple_ansi.cpp:
--------------------------------------------------------------------------------
1 |
2 | //#define UNICODE
3 | #include
4 | #include
5 | #include
6 | #include "../TreeListWnd.h"
7 | #include "../resource.h"
8 |
9 | HINSTANCE hInst;
10 | BOOL bUseDll = FALSE;
11 | LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
12 |
13 | void showConstants(void);
14 |
15 |
16 | int main(int argc, char *argv[]) {
17 |
18 | HINSTANCE hInst;
19 |
20 | hInst = GetModuleHandle(NULL);
21 |
22 | showConstants();
23 |
24 | //printf("argc = %d argv=%s\n", argc, argc==2 && argv[1]?argv[1]:"");
25 | if (argc == 2 && _stricmp(argv[1], "dll") == 0){
26 | printf("use dll\n");
27 | bUseDll = TRUE;
28 | }
29 |
30 | WNDCLASSEX wcex = {
31 | sizeof(WNDCLASSEX), 0, WndProc, 0, 0, hInst, /*IDR_MAINFRAME */ LoadIcon(NULL, IDI_APPLICATION),
32 | LoadCursor(NULL, IDC_ARROW), (HBRUSH)(COLOR_WINDOW + 1), NULL, TEXT("TreeListDemo"), NULL,
33 | };
34 | if(!RegisterClassEx(&wcex))
35 | return MessageBox(NULL, TEXT("Cannot register class !"), TEXT("Error"), MB_ICONERROR | MB_OK);
36 |
37 | int nX = (GetSystemMetrics(SM_CXSCREEN) - 860) / 2, nY = (GetSystemMetrics(SM_CYSCREEN) - 600) / 2;
38 | HWND hWnd = CreateWindowEx(0, wcex.lpszClassName, TEXT("TestTreeList"),
39 | WS_OVERLAPPEDWINDOW, nX, nY, 860, 600, NULL, NULL, hInst, NULL);
40 | if(!hWnd)
41 | return MessageBox(NULL, TEXT("Cannot create window !"), TEXT("Error"), MB_ICONERROR | MB_OK);
42 | ShowWindow(hWnd, SW_SHOWNORMAL);
43 | UpdateWindow(hWnd);
44 | MSG msg;
45 | while(GetMessage(&msg, NULL, 0, 0)) {
46 | TranslateMessage(&msg);
47 | DispatchMessage(&msg);
48 | }
49 | return (int) msg.wParam;
50 | }
51 |
52 | LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) {
53 | static HWND hWndTL;
54 | switch(message) {
55 | case WM_CREATE: {
56 |
57 | HINSTANCE hInst;
58 | HMODULE hLib;
59 |
60 | hInst = GetModuleHandle(NULL);
61 | if (bUseDll){
62 | hLib = LoadLibrary(TEXT("..\\PB\\TreeListA.dll"));
63 | printf("class registration: hInst=%08lx, hLib=%08lx\n", hInst, hLib);
64 | }
65 | else
66 | TreeListRegister(hInst);
67 |
68 | hWndTL = CreateWindow(TEXT(TVC_CLASSNAME), TEXT("TreeList"), WS_VISIBLE | WS_CHILD | TVS_HASLINES | TVS_LINESATROOT | TVS_HASBUTTONS, 0, 0, 430, 300, hWnd, 0, hInst, NULL);
69 | printf("created windows is %08lx\n", hWndTL);
70 |
71 | SendMessage(hWndTL, TVM_SETEXTENDEDSTYLE, 0, TVS_EX_ITEMLINES | TVS_EX_ALTERNATECOLOR | TVS_EX_FULLROWMARK);
72 |
73 | HIMAGELIST hImgTree = ImageList_LoadImage(NULL, TEXT("flags.bmp"), 16, 10, CLR_DEFAULT, IMAGE_BITMAP, LR_LOADFROMFILE /*LR_CREATEDIBSECTION | LR_DEFAULTSIZE | LR_SHARED | LR_LOADTRANSPARENT*/);
74 | if(NULL == hImgTree){
75 | DWORD dwErr = ::GetLastError();
76 | printf("ImageList_LoadImage() tree failed: %d.\n", dwErr);
77 | } else{
78 | printf("ImageList_LoadImage() tree succeeded, TVM_SETIMAGELIST returned %d.\n", SendMessage(hWndTL, TVM_SETIMAGELIST, TVSIL_NORMAL, (LPARAM)hImgTree));
79 | ;
80 | }
81 | HIMAGELIST hImgHead = ImageList_LoadImage(NULL, TEXT("header.bmp"), 16, 10, CLR_DEFAULT, IMAGE_BITMAP, LR_LOADFROMFILE /*LR_CREATEDIBSECTION | LR_DEFAULTSIZE | LR_SHARED | LR_LOADTRANSPARENT*/);
82 | if(NULL == hImgHead){
83 | DWORD dwErr = ::GetLastError();
84 | printf("ImageList_LoadImage() header failed: %d.\n", dwErr);
85 | } else{
86 | printf("ImageList_LoadImage() header succeeded, TVM_SETIMAGELIST returned %d.\n", SendMessage(hWndTL, TVM_SETIMAGELIST, TVSIL_HEADER, (LPARAM)hImgHead));
87 | ;
88 | }
89 |
90 | //------------------------COLUMNS----------------------------------------------------------------
91 | int colIdx = 0;
92 | TV_COLUMN col;
93 | memset(&col, 0, sizeof(TV_COLUMN));
94 | col.mask = TVCF_TEXT;
95 | col.pszText = TEXT("Tree (col 0)");
96 | col.cchTextMax = 256;
97 | //TreeList_InsertColumn(hWndTL, colIdx++, &col);
98 | LRESULT col1 = SendMessage(hWndTL, TVM_INSERTCOLUMN, (WPARAM)colIdx++, (LPARAM)&col);
99 | printf("TVM_INSERTCOLUMN returned %08lx\n", col1);
100 |
101 | col.mask = TVCF_TEXT | TVCF_IMAGE | TVCF_FMT;
102 | col.fmt = /*LVCFMT_CENTER | */ LVCFMT_BITMAP_ON_RIGHT;
103 | col.pszText = TEXT("col 1");
104 | col.iImage = 0;
105 | //TreeList_InsertColumn(hWndTL, colIdx++, &col);
106 | LRESULT col2 = SendMessage(hWndTL, TVM_INSERTCOLUMN, (WPARAM)colIdx++, (LPARAM)&col);
107 | printf("TVM_INSERTCOLUMN returned %08lx\n", col2);
108 |
109 | col.mask = TVCF_TEXT | TVCF_IMAGE | TVCF_FMT;
110 | col.fmt = /*LVCFMT_CENTER | */ LVCFMT_BITMAP_ON_RIGHT;
111 | col.pszText = TEXT("col 2");
112 | col.iImage = 1;
113 | col.fmt = /*LVCFMT_CENTER | */ LVCFMT_BITMAP_ON_RIGHT;
114 | //TreeList_InsertColumn(hWndTL, colIdx++, &col);
115 | LRESULT col3 = SendMessage(hWndTL, TVM_INSERTCOLUMN, (WPARAM)colIdx++, (LPARAM)&col);
116 | printf("TVM_INSERTCOLUMN returned %08lx\n", col3);
117 |
118 | col.mask = TVCF_TEXT | TVCF_IMAGE | TVCF_FMT;
119 | col.fmt = /*LVCFMT_CENTER | */ LVCFMT_BITMAP_ON_RIGHT;
120 | col.pszText = TEXT("col 3");
121 | col.iImage = 2;
122 | col.fmt = /*LVCFMT_CENTER | */ LVCFMT_BITMAP_ON_RIGHT;
123 | //TreeList_InsertColumn(hWndTL, colIdx++, &col);
124 | LRESULT col4 = SendMessage(hWndTL, TVM_INSERTCOLUMN, (WPARAM)colIdx++, (LPARAM)&col);
125 | printf("TVM_INSERTCOLUMN returned %08lx\n", col4);
126 |
127 | //------------------------LINES----------------------------------------------------------------
128 |
129 | HTREEITEM inserted, inserted2;
130 | TVINSERTSTRUCT item;
131 | item.hParent = 0;
132 | item.hInsertAfter = TVI_SORTEX;
133 | item.item.hItem = 0;//(HTREEITEM)pCmpProc;
134 | item.item.pszText = TEXT("Item 1");
135 | item.item.mask = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
136 | item.item.iImage = 0;
137 | item.item.iSelectedImage = 2;
138 | item.item.state = 0;
139 | item.item.stateMask = 0;
140 | item.item.lParam = 0;
141 | inserted = (HTREEITEM)SendMessage(hWndTL, TVM_INSERTITEM, 0, (LPARAM)&item);
142 | printf("inserted 1 = %08lx\n", inserted);
143 | if (inserted){
144 | TV_ITEM itm;
145 | itm.mask = TVIF_SUBITEM | TVIF_TEXT | TVIF_STATE;
146 | itm.hItem = inserted;
147 | itm.state = 2;
148 | itm.stateMask = 2;
149 | itm.cChildren = 1;
150 | itm.pszText = "un texte";
151 | itm.cchTextMax = strlen(itm.pszText);
152 | SendMessage(hWndTL, TVM_SETITEM, 0, (LPARAM)&itm);
153 | }
154 |
155 | TVINSERTSTRUCT item2;
156 | item2.hParent = inserted;
157 | item2.hInsertAfter = TVI_LAST ;
158 | item2.item.hItem = 0;
159 | item2.item.pszText = TEXT("Item 2");
160 | item2.item.mask = TVIF_TEXT;
161 | item2.item.iImage = TV_NOIMAGE;
162 | item2.item.iSelectedImage = TV_NOIMAGE;
163 | item2.item.state = 0;
164 | item2.item.stateMask = 0;
165 | item2.item.lParam = 0;
166 | inserted2 = (HTREEITEM)SendMessage(hWndTL, TVM_INSERTITEM, 0, (LPARAM)&item2);
167 | printf("inserted 2 = %08lx\n", inserted2);
168 | if(inserted2) {
169 | SendMessage(hWndTL, TVM_EXPAND, TVE_EXPAND, (LPARAM)inserted);
170 | TV_ITEM itm;
171 | itm.mask = TVIF_SUBITEM | TVIF_TEXT;
172 | itm.hItem = inserted2;
173 | itm.state = 0;
174 | itm.stateMask = 0;
175 | itm.pszText = TEXT("blah blah");
176 | itm.cchTextMax = 256;
177 | itm.iImage = 0;
178 | itm.iSelectedImage = 0;
179 | itm.cChildren = 1;
180 | itm.lParam = 0;
181 | SendMessage(hWndTL, TVM_SETITEM, 0, (LPARAM)&itm);
182 |
183 | itm.mask = TVIF_SUBITEM | TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_STATE;
184 | itm.pszText = TEXT("bli bli");
185 | itm.cChildren = 2;
186 | itm.iImage = 11;
187 | itm.iSelectedImage = 11;
188 | itm.stateMask = TVIS_BOLD | TVIS_EXPANDED;
189 | itm.state = TVIS_BOLD | TVIS_EXPANDED;
190 | SendMessage(hWndTL, TVM_SETITEM, 0, (LPARAM)&itm);
191 | }
192 |
193 | TVINSERTSTRUCT item3;
194 | item3.hParent = inserted2;
195 | item3.hInsertAfter = TVI_LAST ;
196 | item3.item.hItem = 0;
197 | item3.item.pszText = TEXT("Item 3");
198 | item3.item.mask = TVIF_TEXT;
199 | item3.item.iImage = TV_NOIMAGE;
200 | item3.item.iSelectedImage = TV_NOIMAGE;
201 | item3.item.state = 0;
202 | item3.item.stateMask = 0;
203 | item3.item.lParam = 0;
204 | inserted2 = (HTREEITEM)SendMessage(hWndTL, TVM_INSERTITEM, 0, (LPARAM)&item3);
205 | printf("inserted 3 = %08lx\n", inserted2);
206 |
207 | TVINSERTSTRUCT item4;
208 | item4.hParent = inserted;
209 | item4.hInsertAfter = TVI_LAST ;
210 | item4.item.hItem = 0;
211 | item4.item.pszText = TEXT("Item 4");
212 | item4.item.mask = TVIF_TEXT;
213 | item4.item.iImage = TV_NOIMAGE;
214 | item4.item.iSelectedImage = TV_NOIMAGE;
215 | item4.item.state = 0;
216 | item4.item.stateMask = 0;
217 | item4.item.lParam = 0;
218 | inserted = (HTREEITEM)SendMessage(hWndTL, TVM_INSERTITEM, 0, (LPARAM)&item4);
219 | printf("inserted 4 = %08lx\n", inserted);
220 |
221 | SetWindowLong(hWndTL, GWL_EXSTYLE, GetWindowLong(hWndTL, GWL_EXSTYLE) | TVS_EX_ITEMLINES);
222 |
223 | //---------------SET THE FONT--------------------------------------------
224 |
225 | HFONT hf;
226 | HDC hdc;
227 | long lfHeight;
228 |
229 | hdc = GetDC(NULL);
230 | lfHeight = -MulDiv(10, GetDeviceCaps(hdc, LOGPIXELSY), 72);
231 | ReleaseDC(NULL, hdc);
232 |
233 | hf = CreateFont(lfHeight, 0, 0, 0, FW_NORMAL, FALSE /*italic*/, FALSE /*underline*/, FALSE /*strikethrough*/, 0, 0, 0, 0, 0, TEXT("Comic Sans MS"));
234 | //hf = CreateFont(lfHeight, 0, 0, 0, FW_NORMAL, FALSE /*italic*/, FALSE /*underline*/, FALSE /*strikethrough*/, 0, 0, 0, 0, 0, TEXT("Arial"));
235 | if(hf){
236 | printf("CreateFont succeeded.\n");
237 | SendMessage(hWndTL, WM_SETFONT, (WPARAM)hf, TRUE);
238 | //DeleteObject(hf);
239 | } else
240 | printf("CreateFont failed!\n");
241 |
242 | LVCOLUMN tcol;
243 | tcol.fmt = TVCFMT_FIXED|TVCFMT_MARK;
244 | tcol.mask = TVCF_FIXED | TVCF_MARK | TVCF_WIDTH;
245 | tcol.cx = 1;
246 | SendMessage(hWndTL, TVM_SETCOLUMN, col2, (LPARAM)&tcol);
247 |
248 | SendMessage(hWndTL, TVM_GETUNICODEFORMAT, 0, 0);
249 |
250 |
251 | TVITEM itm;
252 | char buffer[42];
253 | itm.hItem = (HTREEITEM)3;
254 | //itm.cChildren = 1;
255 | itm.mask = TVIF_STATE | TVIF_HANDLE /*| TVIF_SUBITEM*/ | TVIF_TEXT;
256 | itm.stateMask = TVIS_BOLD;
257 | itm.state = 0;
258 | itm.pszText = buffer;
259 | itm.cchTextMax = sizeof(buffer);
260 |
261 | LRESULT lr = SendMessage(hWndTL, TVM_GETITEM, 0, (LPARAM)&itm);
262 | printf("getstate = %d state = %08lx text = `%s` \n", lr, itm.state, itm.pszText);
263 |
264 | itm.state |= TVIS_BOLD;
265 | lr = SendMessage(hWndTL, TVM_SETITEM, 0, (LPARAM)&itm);
266 | printf("setstate = %d \n", lr);
267 |
268 |
269 | return 0;
270 | }
271 | break;
272 | case WM_SIZE: {
273 | MoveWindow(hWndTL, 0, 0, LOWORD(lParam), HIWORD(lParam), TRUE);
274 | return 0;
275 | }
276 | break;
277 | case WM_DESTROY: {
278 | TCHAR sMsg[50];
279 | wsprintf(sMsg, TEXT("%d items"), SendMessage(hWndTL, TVM_GETROWCOUNT, (WPARAM)NULL, (LPARAM)NULL));
280 | OutputDebugString(sMsg);
281 | printf("%s", sMsg);
282 | PostQuitMessage(0);
283 | return 0;
284 | }
285 | break;
286 | default
287 | :
288 | return DefWindowProc(hWnd, message, wParam, lParam);
289 | }
290 | return 0;
291 | }
292 |
293 | void showConstants(void){
294 | printf("sizeof(NMHDR) = %ld\n", sizeof(NMHDR));
295 | printf("sizeof(TVITEM) = %ld\n", sizeof(TVITEM));
296 | printf("sizeof(POINT) = %ld\n", sizeof(POINT));
297 | printf("sizeof(NMTREEVIEW) = %ld\n", sizeof(NMTREEVIEW));
298 | printf("sizeof(TVFIND) = %ld\n", sizeof(TVFIND));
299 | printf("sizeof(TVCOLUMN) = %ld\n", sizeof(TVCOLUMN));
300 | printf("sizeof(TVINSERTSTRUCT) = %ld\n", sizeof(TVINSERTSTRUCT));
301 | //printf("//SIZEOF_NMHEADER=SIZEOF_NMHDR+3*4 = %ld\n", //SIZEOF_NMHEADER=SIZEOF_NMHDR+3*4);
302 |
303 | printf("TVC_BK = %ld\n", TVC_BK);
304 | printf("TVC_ODD = %ld\n", TVC_ODD);
305 | printf("TVC_EVEN = %ld\n", TVC_EVEN);
306 | printf("TVC_FRAME = %ld\n", TVC_FRAME);
307 | printf("TVC_TEXT = %ld\n", TVC_TEXT);
308 | printf("TVC_LINE = %ld\n", TVC_LINE);
309 | printf("TVC_BOX = %ld\n", TVC_BOX);
310 | printf("TVC_TRACK = %ld\n", TVC_TRACK);
311 | printf("TVC_MARK = %ld\n", TVC_MARK);
312 | printf("TVC_MARKODD = %ld\n", TVC_MARKODD);
313 | printf("TVC_MARKEVEN = %ld\n", TVC_MARKEVEN);
314 | printf("TVC_INSERT = %ld\n", TVC_INSERT);
315 | printf("TVC_BOXBG = %ld\n", TVC_BOXBG);
316 | printf("TVC_COLBK = %ld\n", TVC_COLBK);
317 | printf("TVC_COLODD = %ld\n", TVC_COLODD);
318 | printf("TVC_COLEVEN = %ld\n", TVC_COLEVEN);
319 | printf("TVC_GRAYED = %ld\n", TVC_GRAYED);
320 |
321 | printf("TVCFMT_BITMAP_ON_RIGHT = %ld\n", TVCFMT_BITMAP_ON_RIGHT );
322 | printf("TVCFMT_CENTER = %ld\n", TVCFMT_CENTER );
323 | printf("TVCFMT_COL_HAS_IMAGES = %ld\n", TVCFMT_COL_HAS_IMAGES );
324 | printf("TVCFMT_FIXED = %ld\n", TVCFMT_FIXED );
325 | printf("TVCFMT_IMAGE = %ld\n", TVCFMT_IMAGE );
326 | printf("TVCFMT_LEFT = %ld\n", TVCFMT_LEFT );
327 | printf("TVCFMT_MARK = %ld\n", TVCFMT_MARK );
328 | printf("TVCFMT_RIGHT = %ld\n", TVCFMT_RIGHT );
329 | printf("TVCF_FIXED = %ld\n", TVCF_FIXED );
330 | printf("TVCF_FMT = %ld\n", TVCF_FMT );
331 | printf("TVCF_IMAGE = %ld\n", TVCF_IMAGE );
332 | printf("TVCF_LASTSIZE = %ld\n", TVCF_LASTSIZE );
333 | printf("TVCF_MARK = %ld\n", TVCF_MARK );
334 | printf("TVCF_MIN = %ld\n", TVCF_MIN );
335 | printf("TVCF_TEXT = %ld\n", TVCF_TEXT );
336 | printf("TVCF_VWIDTH = %ld\n", TVCF_VWIDTH );
337 | printf("TVCF_WIDTH = %ld\n", TVCF_WIDTH );
338 | printf("TVE_ALLCHILDS = %ld\n", TVE_ALLCHILDS );
339 | printf("TVE_COLLAPSE = %ld\n", TVE_COLLAPSE );
340 | printf("TVE_COLLAPSERESET = %ld\n", TVE_COLLAPSERESET );
341 | printf("TVE_EXPAND = %ld\n", TVE_EXPAND );
342 | printf("TVE_EXPANDFORCE = %ld\n", TVE_EXPANDFORCE );
343 | printf("TVE_EXPANDNEXT = %ld\n", TVE_EXPANDNEXT );
344 | printf("TVE_EXPANDPARTIAL = %ld\n", TVE_EXPANDPARTIAL );
345 | printf("TVE_EXPANDRECURSIVE = %ld\n", TVE_EXPANDRECURSIVE );
346 | printf("TVE_ONLYCHILDS = %ld\n", TVE_ONLYCHILDS );
347 | printf("TVE_TOGGLE = %ld\n", TVE_TOGGLE );
348 | printf("TVGN_CARET = %ld\n", TVGN_CARET );
349 | printf("TVGN_CARETSUB = %ld\n", TVGN_CARETSUB );
350 | printf("TVGN_CHILD = %ld\n", TVGN_CHILD );
351 | printf("TVGN_DROPHILITE = %ld\n", TVGN_DROPHILITE );
352 | printf("TVGN_DROPHILITESUB = %ld\n", TVGN_DROPHILITESUB );
353 | printf("TVGN_FIRSTVISIBLE = %ld\n", TVGN_FIRSTVISIBLE );
354 | printf("TVGN_FOCUS = %ld\n", TVGN_FOCUS );
355 | printf("TVGN_FOCUSSUB = %ld\n", TVGN_FOCUSSUB );
356 | printf("TVGN_LASTCHILD = %ld\n", TVGN_LASTCHILD );
357 | printf("TVGN_LASTVISIBLE = %ld\n", TVGN_LASTVISIBLE );
358 | printf("TVGN_NEXT = %ld\n", TVGN_NEXT );
359 | printf("TVGN_NEXTITEM = %ld\n", TVGN_NEXTITEM );
360 | printf("TVGN_NEXTSELCHILD = %ld\n", TVGN_NEXTSELCHILD );
361 | printf("TVGN_NEXTSELECTED = %ld\n", TVGN_NEXTSELECTED );
362 | printf("TVGN_NEXTVISIBLE = %ld\n", TVGN_NEXTVISIBLE );
363 | printf("TVGN_PARENT = %ld\n", TVGN_PARENT );
364 | printf("TVGN_PREVIOUS = %ld\n", TVGN_PREVIOUS );
365 | printf("TVGN_PREVIOUSVISIBLE = %ld\n", TVGN_PREVIOUSVISIBLE );
366 | printf("TVGN_ROOT = %ld\n", TVGN_ROOT );
367 | printf("TVIF_CANCELED = %ld\n", TVIF_CANCELED );
368 | printf("TVIF_CASE = %ld\n", TVIF_CASE );
369 | printf("TVIF_CHILD = %ld\n", TVIF_CHILD );
370 | printf("TVIF_CHILDREN = %ld\n", TVIF_CHILDREN );
371 | printf("TVIF_DI_SETITEM = %ld\n", TVIF_DI_SETITEM );
372 | printf("TVIF_HANDLE = %ld\n", TVIF_HANDLE );
373 | printf("TVIF_IMAGE = %ld\n", TVIF_IMAGE );
374 | printf("TVIF_INTEGRAL = %ld\n", TVIF_INTEGRAL );
375 | printf("TVIF_NEXT = %ld\n", TVIF_NEXT );
376 | printf("TVIF_ONLYFOCUS = %ld\n", TVIF_ONLYFOCUS );
377 | printf("TVIF_PARAM = %ld\n", TVIF_PARAM );
378 | printf("TVIF_RETURNEXIT = %ld\n", TVIF_RETURNEXIT );
379 | printf("TVIF_SELECTEDIMAGE = %ld\n", TVIF_SELECTEDIMAGE );
380 | printf("TVIF_STATE = %ld\n", TVIF_STATE );
381 | printf("TVIF_SUBITEM = %ld\n", TVIF_SUBITEM );
382 | printf("TVIF_SUBNUMBER = %ld\n", TVIF_SUBNUMBER );
383 | printf("TVIF_TEXT = %ld\n", TVIF_TEXT );
384 | printf("TVIF_TEXTCHANGED = %ld\n", TVIF_TEXTCHANGED );
385 | printf("TVIF_TEXTPTR = %ld\n", TVIF_TEXTPTR );
386 | printf("TVIF_TOOLTIPTIME = %ld\n", TVIF_TOOLTIPTIME );
387 | printf("TVIS_BOLD = %ld\n", TVIS_BOLD );
388 | printf("TVIS_UNDERLINE = %ld\n", TVIS_UNDERLINE );
389 | printf("TVI_AFTER = %ld\n", TVI_AFTER );
390 | printf("TVI_BEFORE = %ld\n", TVI_BEFORE );
391 | printf("TVI_FIRST = %ld\n", TVI_FIRST );
392 | printf("TVI_LAST = %ld\n", TVI_LAST );
393 | printf("TVI_ROOT = %ld\n", TVI_ROOT );
394 | printf("TVI_SORT = %ld\n", TVI_SORT );
395 | printf("TVI_SORTEX = %ld\n", TVI_SORTEX );
396 | printf("TVM_COLUMNAUTOEDIT = %ld\n", TVM_COLUMNAUTOEDIT );
397 | printf("TVM_COLUMNAUTOICON = %ld\n", TVM_COLUMNAUTOICON );
398 | printf("TVM_CREATEDRAGIMAGE = %ld\n", TVM_CREATEDRAGIMAGE );
399 | printf("TVM_DELETECOLUMN = %ld\n", TVM_DELETECOLUMN );
400 | printf("TVM_DELETEITEM = %ld\n", TVM_DELETEITEM );
401 | printf("TVM_EDITLABEL = %ld\n", TVM_EDITLABEL );
402 | printf("TVM_EDITLABELA = %ld\n", TVM_EDITLABELA );
403 | printf("TVM_EDITLABELW = %ld\n", TVM_EDITLABELW );
404 | printf("TVM_ENDEDITLABELNOW = %ld\n", TVM_ENDEDITLABELNOW );
405 | printf("TVM_ENSUREVISIBLE = %ld\n", TVM_ENSUREVISIBLE );
406 | printf("TVM_EXPAND = %ld\n", TVM_EXPAND );
407 | printf("TVM_FINDITEM = %ld\n", TVM_FINDITEM );
408 | printf("TVM_GETBKCOLOR = %ld\n", TVM_GETBKCOLOR );
409 | printf("TVM_GETCOLUMN = %ld\n", TVM_GETCOLUMN );
410 | printf("TVM_GETCOLUMNCOUNT = %ld\n", TVM_GETCOLUMNCOUNT );
411 | printf("TVM_GETCOLUMNORDERARRAY = %ld\n", TVM_GETCOLUMNORDERARRAY );
412 | printf("TVM_GETCOLUMNWIDTH = %ld\n", TVM_GETCOLUMNWIDTH );
413 | printf("TVM_GETCOUNT = %ld\n", TVM_GETCOUNT );
414 | printf("TVM_GETCOUNTPERPAGE = %ld\n", TVM_GETCOUNTPERPAGE );
415 | printf("TVM_GETEDITCONTROL = %ld\n", TVM_GETEDITCONTROL );
416 | printf("TVM_GETEXTENDEDSTYLE = %ld\n", TVM_GETEXTENDEDSTYLE );
417 | printf("TVM_GETHEADER = %ld\n", TVM_GETHEADER );
418 | printf("TVM_GETIMAGELIST = %ld\n", TVM_GETIMAGELIST );
419 | printf("TVM_GETINDENT = %ld\n", TVM_GETINDENT );
420 | printf("TVM_GETINSERTMARKCOLOR = %ld\n", TVM_GETINSERTMARKCOLOR );
421 | printf("TVM_GETISEARCHSTRING = %ld\n", TVM_GETISEARCHSTRING );
422 | printf("TVM_GETISEARCHSTRINGA = %ld\n", TVM_GETISEARCHSTRINGA );
423 | printf("TVM_GETISEARCHSTRINGW = %ld\n", TVM_GETISEARCHSTRINGW );
424 | printf("TVM_GETITEM = %ld\n", TVM_GETITEM );
425 | printf("TVM_GETITEMA = %ld\n", TVM_GETITEMA );
426 | printf("TVM_GETITEMBKCOLOR = %ld\n", TVM_GETITEMBKCOLOR );
427 | printf("TVM_GETITEMHEIGHT = %ld\n", TVM_GETITEMHEIGHT );
428 | printf("TVM_GETITEMOFROW = %ld\n", TVM_GETITEMOFROW );
429 | printf("TVM_GETITEMRECT = %ld\n", TVM_GETITEMRECT );
430 | printf("TVM_GETITEMSTATE = %ld\n", TVM_GETITEMSTATE );
431 | printf("TVM_GETITEMTEXTCOLOR = %ld\n", TVM_GETITEMTEXTCOLOR );
432 | printf("TVM_GETITEMW = %ld\n", TVM_GETITEMW );
433 | printf("TVM_GETLINECOLOR = %ld\n", TVM_GETLINECOLOR );
434 | printf("TVM_GETNEXTITEM = %ld\n", TVM_GETNEXTITEM );
435 | printf("TVM_GETROWCOUNT = %ld\n", TVM_GETROWCOUNT );
436 | printf("TVM_GETROWOFITEM = %ld\n", TVM_GETROWOFITEM );
437 | printf("TVM_GETSCROLLTIME = %ld\n", TVM_GETSCROLLTIME );
438 | printf("TVM_GETSETOPTION = %ld\n", TVM_GETSETOPTION );
439 | printf("TVM_GETTEXTCOLOR = %ld\n", TVM_GETTEXTCOLOR );
440 | printf("TVM_GETTOOLTIPS = %ld\n", TVM_GETTOOLTIPS );
441 | printf("TVM_GETUNICODEFORMAT = %ld\n", TVM_GETUNICODEFORMAT );
442 | printf("TVM_GETUSERDATA = %ld\n", TVM_GETUSERDATA );
443 | printf("TVM_GETUSERDATASIZE = %ld\n", TVM_GETUSERDATASIZE );
444 | printf("TVM_GETVISIBLECOUNT = %ld\n", TVM_GETVISIBLECOUNT );
445 | printf("TVM_HITTEST = %ld\n", TVM_HITTEST );
446 | printf("TVM_INSERTCOLUMN = %ld\n", TVM_INSERTCOLUMN );
447 | printf("TVM_INSERTITEM = %ld\n", TVM_INSERTITEM );
448 | printf("TVM_INSERTITEMA = %ld\n", TVM_INSERTITEMA );
449 | printf("TVM_INSERTITEMW = %ld\n", TVM_INSERTITEMW );
450 | printf("TVM_ISITEMVISIBLE = %ld\n", TVM_ISITEMVISIBLE );
451 | // printf("TVM_MAPACCIDTOHTREEITEM = %ld\n", TVM_MAPACCIDTOHTREEITEM );
452 | // printf("TVM_MAPHTREEITEMTOACCID = %ld\n", TVM_MAPHTREEITEMTOACCID );
453 | printf("TVM_SELECTCHILDS = %ld\n", TVM_SELECTCHILDS );
454 | printf("TVM_SELECTDROP = %ld\n", TVM_SELECTDROP );
455 | printf("TVM_SELECTITEM = %ld\n", TVM_SELECTITEM );
456 | printf("TVM_SELECTSUBITEM = %ld\n", TVM_SELECTSUBITEM );
457 | printf("TVM_SETBKCOLOR = %ld\n", TVM_SETBKCOLOR );
458 | printf("TVM_SETCOLUMN = %ld\n", TVM_SETCOLUMN );
459 | printf("TVM_SETCOLUMNORDERARRAY = %ld\n", TVM_SETCOLUMNORDERARRAY );
460 | printf("TVM_SETCOLUMNWIDTH = %ld\n", TVM_SETCOLUMNWIDTH );
461 | printf("TVM_SETEXTENDEDSTYLE = %ld\n", TVM_SETEXTENDEDSTYLE );
462 | printf("TVM_SETFOCUSITEM = %ld\n", TVM_SETFOCUSITEM );
463 | printf("TVM_SETIMAGELIST = %ld\n", TVM_SETIMAGELIST );
464 | printf("TVM_SETINDENT = %ld\n", TVM_SETINDENT );
465 | printf("TVM_SETINSERTMARK = %ld\n", TVM_SETINSERTMARK );
466 | printf("TVM_SETINSERTMARKCOLOR = %ld\n", TVM_SETINSERTMARKCOLOR );
467 | printf("TVM_SETITEM = %ld\n", TVM_SETITEM );
468 | printf("TVM_SETITEMA = %ld\n", TVM_SETITEMA );
469 | printf("TVM_SETITEMBKCOLOR = %ld\n", TVM_SETITEMBKCOLOR );
470 | printf("TVM_SETITEMHEIGHT = %ld\n", TVM_SETITEMHEIGHT );
471 | printf("TVM_SETITEMTEXTCOLOR = %ld\n", TVM_SETITEMTEXTCOLOR );
472 | printf("TVM_SETITEMW = %ld\n", TVM_SETITEMW );
473 | printf("TVM_SETLINECOLOR = %ld\n", TVM_SETLINECOLOR );
474 | printf("TVM_SETSCROLLTIME = %ld\n", TVM_SETSCROLLTIME );
475 | printf("TVM_SETTEXTCOLOR = %ld\n", TVM_SETTEXTCOLOR );
476 | printf("TVM_SETTOOLTIPS = %ld\n", TVM_SETTOOLTIPS );
477 | printf("TVM_SETUNICODEFORMAT = %ld\n", TVM_SETUNICODEFORMAT );
478 | printf("TVM_SETUSERDATASIZE = %ld\n", TVM_SETUSERDATASIZE );
479 | printf("TVM_SORTCHILDREN = %ld\n", TVM_SORTCHILDREN );
480 | printf("TVM_SORTCHILDRENCB = %ld\n", TVM_SORTCHILDRENCB );
481 | printf("TVM_SORTCHILDRENEX = %ld\n", TVM_SORTCHILDRENEX );
482 | printf("TVN_BEGINDRAG = %ld\n", TVN_BEGINDRAG );
483 | printf("TVN_BEGINDRAGA = %ld\n", TVN_BEGINDRAGA );
484 | printf("TVN_BEGINDRAGW = %ld\n", TVN_BEGINDRAGW );
485 | printf("TVN_BEGINLABELEDIT = %ld\n", TVN_BEGINLABELEDIT );
486 | printf("TVN_BEGINLABELEDITA = %ld\n", TVN_BEGINLABELEDITA );
487 | printf("TVN_BEGINLABELEDITW = %ld\n", TVN_BEGINLABELEDITW );
488 | printf("TVN_BEGINRDRAG = %ld\n", TVN_BEGINRDRAG );
489 | printf("TVN_BEGINRDRAGA = %ld\n", TVN_BEGINRDRAGA );
490 | printf("TVN_BEGINRDRAGW = %ld\n", TVN_BEGINRDRAGW );
491 | printf("TVN_CBSTATECHANGED = %ld\n", TVN_CBSTATECHANGED );
492 | printf("TVN_COLUMNCHANGED = %ld\n", TVN_COLUMNCHANGED );
493 | printf("TVN_COLUMNCLICK = %ld\n", TVN_COLUMNCLICK );
494 | printf("TVN_COLUMNDBLCLICK = %ld\n", TVN_COLUMNDBLCLICK );
495 | printf("TVN_DELETEITEM = %ld\n", TVN_DELETEITEM );
496 | printf("TVN_DELETEITEMA = %ld\n", TVN_DELETEITEMA );
497 | printf("TVN_DELETEITEMW = %ld\n", TVN_DELETEITEMW );
498 | printf("TVN_ENDLABELEDIT = %ld\n", TVN_ENDLABELEDIT );
499 | printf("TVN_ENDLABELEDITA = %ld\n", TVN_ENDLABELEDITA );
500 | printf("TVN_ENDLABELEDITW = %ld\n", TVN_ENDLABELEDITW );
501 | printf("TVN_FIRST = %ld\n", TVN_FIRST );
502 | printf("TVN_GETDISPINFO = %ld\n", TVN_GETDISPINFO );
503 | printf("TVN_GETDISPINFOA = %ld\n", TVN_GETDISPINFOA );
504 | printf("TVN_GETDISPINFOW = %ld\n", TVN_GETDISPINFOW );
505 | printf("TVN_GETINFOTIP = %ld\n", TVN_GETINFOTIP );
506 | printf("TVN_GETINFOTIPA = %ld\n", TVN_GETINFOTIPA );
507 | printf("TVN_GETINFOTIPW = %ld\n", TVN_GETINFOTIPW );
508 | printf("TVN_ITEMEXPANDED = %ld\n", TVN_ITEMEXPANDED );
509 | printf("TVN_ITEMEXPANDEDA = %ld\n", TVN_ITEMEXPANDEDA );
510 | printf("TVN_ITEMEXPANDEDW = %ld\n", TVN_ITEMEXPANDEDW );
511 | printf("TVN_ITEMEXPANDING = %ld\n", TVN_ITEMEXPANDING );
512 | printf("TVN_ITEMEXPANDINGA = %ld\n", TVN_ITEMEXPANDINGA );
513 | printf("TVN_ITEMEXPANDINGW = %ld\n", TVN_ITEMEXPANDINGW );
514 | printf("TVN_ITEMTOOLTIP = %ld\n", TVN_ITEMTOOLTIP );
515 | printf("TVN_KEYDOWN = %ld\n", TVN_KEYDOWN );
516 | printf("TVN_LAST = %ld\n", TVN_LAST );
517 | printf("TVN_LBUTTONUP = %ld\n", TVN_LBUTTONUP );
518 | printf("TVN_RBUTTONUP = %ld\n", TVN_RBUTTONUP );
519 | printf("TVN_SELCHANGED = %ld\n", TVN_SELCHANGED );
520 | printf("TVN_SELCHANGEDA = %ld\n", TVN_SELCHANGEDA );
521 | printf("TVN_SELCHANGEDW = %ld\n", TVN_SELCHANGEDW );
522 | printf("TVN_SELCHANGING = %ld\n", TVN_SELCHANGING );
523 | printf("TVN_SELCHANGINGA = %ld\n", TVN_SELCHANGINGA );
524 | printf("TVN_SELCHANGINGW = %ld\n", TVN_SELCHANGINGW );
525 | printf("TVN_SETDISPINFO = %ld\n", TVN_SETDISPINFO );
526 | printf("TVN_SETDISPINFOA = %ld\n", TVN_SETDISPINFOA );
527 | printf("TVN_SETDISPINFOW = %ld\n", TVN_SETDISPINFOW );
528 | printf("TVN_SINGLEEXPAND = %ld\n", TVN_SINGLEEXPAND );
529 | printf("TVN_STARTEDIT = %ld\n", TVN_STARTEDIT );
530 | printf("TVN_STEPSTATECHANGED = %ld\n", TVN_STEPSTATECHANGED );
531 | printf("TVS_CHECKBOXES = %ld\n", TVS_CHECKBOXES );
532 | printf("TVS_DISABLEDRAGDROP = %ld\n", TVS_DISABLEDRAGDROP );
533 | printf("TVS_EDITLABELS = %ld\n", TVS_EDITLABELS );
534 | printf("TVS_EX_ALTERNATECOLOR = %ld\n", TVS_EX_ALTERNATECOLOR );
535 | printf("TVS_EX_AUTOEXPANDICON = %ld\n", TVS_EX_AUTOEXPANDICON );
536 | printf("TVS_EX_AUTOHSCROLL = %ld\n", TVS_EX_AUTOHSCROLL );
537 | printf("TVS_EX_BITCHECKBOX = %ld\n", TVS_EX_BITCHECKBOX );
538 | printf("TVS_EX_EDITCLICK = %ld\n", TVS_EX_EDITCLICK );
539 | printf("TVS_EX_FIXEDCOLSIZE = %ld\n", TVS_EX_FIXEDCOLSIZE );
540 | printf("TVS_EX_FULLROWITEMS = %ld\n", TVS_EX_FULLROWITEMS );
541 | printf("TVS_EX_FULLROWMARK = %ld\n", TVS_EX_FULLROWMARK );
542 | printf("TVS_EX_GRAYEDDISABLE = %ld\n", TVS_EX_GRAYEDDISABLE );
543 | printf("TVS_EX_HEADERCHGNOTIFY = %ld\n", TVS_EX_HEADERCHGNOTIFY );
544 | printf("TVS_EX_HEADERDRAGDROP = %ld\n", TVS_EX_HEADERDRAGDROP );
545 | printf("TVS_EX_HEADEROWNIMGLIST = %ld\n", TVS_EX_HEADEROWNIMGLIST );
546 | printf("TVS_EX_HIDEHEADERS = %ld\n", TVS_EX_HIDEHEADERS );
547 | printf("TVS_EX_HOMEENDSELECT = %ld\n", TVS_EX_HOMEENDSELECT );
548 | printf("TVS_EX_ITEMLINES = %ld\n", TVS_EX_ITEMLINES );
549 | printf("TVS_EX_MULTISELECT = %ld\n", TVS_EX_MULTISELECT );
550 | printf("TVS_EX_NOCHARSELCET = %ld\n", TVS_EX_NOCHARSELCET );
551 | printf("TVS_EX_NOCOLUMNRESIZE = %ld\n", TVS_EX_NOCOLUMNRESIZE );
552 | printf("TVS_EX_NOCURSORSET = %ld\n", TVS_EX_NOCURSORSET );
553 | printf("TVS_EX_SHAREIMAGELISTS = %ld\n", TVS_EX_SHAREIMAGELISTS );
554 | printf("TVS_EX_SINGLECHECKBOX = %ld\n", TVS_EX_SINGLECHECKBOX );
555 | printf("TVS_EX_STEPOUT = %ld\n", TVS_EX_STEPOUT );
556 | printf("TVS_EX_SUBSELECT = %ld\n", TVS_EX_SUBSELECT );
557 | printf("TVS_EX_TOOLTIPNOTIFY = %ld\n", TVS_EX_TOOLTIPNOTIFY );
558 | printf("TVS_FULLROWSELECT = %ld\n", TVS_FULLROWSELECT );
559 | printf("TVS_HASBUTTONS = %ld\n", TVS_HASBUTTONS );
560 | printf("TVS_HASLINES = %ld\n", TVS_HASLINES );
561 | printf("TVS_INFOTIP = %ld\n", TVS_INFOTIP );
562 | printf("TVS_LINESATROOT = %ld\n", TVS_LINESATROOT );
563 | printf("TVS_NOHSCROLL = %ld\n", TVS_NOHSCROLL );
564 | printf("TVS_NONEVENHEIGHT = %ld\n", TVS_NONEVENHEIGHT );
565 | printf("TVS_NOSCROLL = %ld\n", TVS_NOSCROLL );
566 | printf("TVS_NOTOOLTIPS = %ld\n", TVS_NOTOOLTIPS );
567 | printf("TVS_RTLREADING = %ld\n", TVS_RTLREADING );
568 | printf("TVS_SHOWSELALWAYS = %ld\n", TVS_SHOWSELALWAYS );
569 | printf("TVS_SINGLEEXPAND = %ld\n", TVS_SINGLEEXPAND );
570 | printf("TVS_TRACKSELECT = %ld\n", TVS_TRACKSELECT );
571 | printf("TVSIL_NORMAL = %ld\n", TVSIL_NORMAL );
572 | printf("TVSIL_STATE = %ld\n", TVSIL_STATE );
573 | printf("TVSIL_CHECK = %ld\n", TVSIL_CHECK );
574 | printf("TVSIL_SUBIMAGES = %ld\n", TVSIL_SUBIMAGES );
575 | printf("TVSIL_HEADER = %ld\n", TVSIL_HEADER );
576 |
577 | printf("TV_FIRST = %ld\n", TV_FIRST );
578 | printf("TV_NOIMAGE = %ld\n", TV_NOIMAGE);
579 | printf("TV_NOCOLOR = %ld\n", TV_NOCOLOR);
580 |
581 |
582 | }
--------------------------------------------------------------------------------
/tests/simple_dll.cpp:
--------------------------------------------------------------------------------
1 |
2 | #define UNICODE
3 | #include
4 | #include
5 | #include
6 | #include "TreeListWnd.h"
7 |
8 | HINSTANCE hInst;
9 |
10 | LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
11 |
12 | int main(int argc, char *argv[]){
13 |
14 | HINSTANCE hInst;
15 | hInst = GetModuleHandle(NULL);
16 |
17 | printf("SIZEOF(NMHDR)=%d\n", sizeof(NMHDR));
18 | printf("SIZEOF(TVITEM)=%d\n", sizeof(TVITEM));
19 | printf("SIZEOF(POINT)=%d\n", sizeof(POINT));
20 | printf("SIZEOF(NMTREEVIEW)=%d\n", sizeof(NMTREEVIEW));
21 | printf("SIZEOF(TVFIND)=%d\n", sizeof(TVFIND));
22 | printf("SIZEOF(TVCOLUMN)=%d\n", sizeof(TVCOLUMN));
23 | printf("SIZEOF(TVINSERTSTRUCT)=%d\n", sizeof(TVINSERTSTRUCT));
24 |
25 | WNDCLASSEX wcex = {
26 | sizeof(WNDCLASSEX), 0, WndProc, 0, 0, hInst, LoadIcon(NULL, IDI_APPLICATION),
27 | LoadCursor(NULL, IDC_ARROW), (HBRUSH)(COLOR_WINDOW + 1), NULL, TEXT("TreeListDemo"), NULL,
28 | };
29 | if(!RegisterClassEx(&wcex))
30 | return MessageBox(NULL, TEXT("Cannot register class !"), TEXT("Error"), MB_ICONERROR | MB_OK);
31 |
32 | int nX = (GetSystemMetrics(SM_CXSCREEN) - 860) / 2, nY = (GetSystemMetrics(SM_CYSCREEN) - 600) / 2;
33 | HWND hWnd = CreateWindowEx(0, wcex.lpszClassName, TEXT("TestTreeList"),
34 | WS_OVERLAPPEDWINDOW, nX, nY, 860, 600, NULL, NULL, hInst, NULL);
35 | if(!hWnd)
36 | return MessageBox(NULL, TEXT("Cannot create window !"), TEXT("Error"), MB_ICONERROR | MB_OK);
37 | ShowWindow(hWnd, SW_SHOWNORMAL);
38 | UpdateWindow(hWnd);
39 | MSG msg;
40 | while(GetMessage(&msg, NULL, 0, 0)) {
41 | TranslateMessage(&msg);
42 | DispatchMessage(&msg);
43 | }
44 | return (int) msg.wParam;
45 | }
46 |
47 | LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) {
48 | static HWND hWndTL;
49 | switch(message) {
50 | case WM_CREATE: {
51 | BOOL bRet;
52 |
53 | typedef int (* PTLR)(HINSTANCE hInstance);
54 | HINSTANCE hInst;
55 | PTLR pTLR;
56 | int initRet = 0;
57 | hInst = GetModuleHandle(NULL);
58 | HMODULE hLib = LoadLibrary(TEXT("TreeList.dll"));
59 | //not necessary to register the control : it is done during dll init
60 | //~ if(hLib){
61 | //~ pTLR = (PTLR)GetProcAddress(hLib, "TreeListRegister");
62 | //~ if(pTLR)
63 | //~ initRet = pTLR(hInst);
64 | //~ }
65 | printf("class registration: hInst=%08lx, hLib=%08lx, TreeListRegister=%08lx returned %d\n", hInst, hLib, pTLR, initRet);
66 |
67 | //~ hWndTL = CreateWindow( TEXT(TVC_CLASSNAME), TEXT("blah"), WS_VISIBLE |WS_CHILD|TVS_HASLINES|TVS_LINESATROOT|TVS_HASBUTTONS, 0, 0, 430, 300, hWnd, 0, hLib, NULL );
68 | hWndTL = CreateWindow( TEXT(TVC_CLASSNAME), TEXT("blah"), WS_VISIBLE |WS_CHILD|TVS_HASLINES|TVS_LINESATROOT|TVS_HASBUTTONS, 0, 0, 430, 300, hWnd, 0, hInst, NULL );
69 | printf("created windows is %08lx\n", hWndTL);
70 |
71 | int colIdx = 0;
72 | int lret;
73 | TV_COLUMN col;
74 | memset(&col, 0, sizeof(TV_COLUMN));
75 | col.mask = 0;
76 | col.mask |= TVCF_TEXT;
77 | col.pszText = TEXT("titi");
78 | col.cchTextMax = 256;
79 | //TreeList_InsertColumn(hWndTL, colIdx++, &col);
80 | lret = SendMessage(hWndTL, TVM_INSERTCOLUMN, (WPARAM)colIdx++, (LPARAM)&col);
81 | printf("TVM_INSERTCOLUMN returned %08lx\n", lret);
82 |
83 | col.pszText = TEXT("toto");
84 | //TreeList_InsertColumn(hWndTL, colIdx++, &col);
85 | lret = SendMessage(hWndTL, TVM_INSERTCOLUMN, (WPARAM)colIdx++, (LPARAM)&col);
86 | printf("TVM_INSERTCOLUMN returned %08lx\n", lret);
87 |
88 | //~ InsertItem(pItems1[i], i, i, TVI_ROOT)
89 | //~ InsertItem(TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE ,I,M,S,0,0,0,P,A)
90 | //~ InsertItem(UINT nMask, LPCTSTR pText, int nImage, int nSelImage, UINT nState, UINT nStateMask, LPARAM lParam, HTREEITEM hParent, HTREEITEM hInsertAfter) {
91 |
92 | HTREEITEM inserted, inserted2;
93 | TVINSERTSTRUCT item;
94 | item.hParent = 0;
95 | item.hInsertAfter = TVI_SORTEX;
96 | item.item.hItem = 0;//(HTREEITEM)pCmpProc;
97 | item.item.pszText = TEXT("Item 1");
98 | item.item.mask = TVIF_TEXT;
99 | item.item.iImage = TV_NOIMAGE;
100 | item.item.iSelectedImage = TV_NOIMAGE;
101 | item.item.state = 0;
102 | item.item.stateMask = 0;
103 | item.item.lParam = 0;
104 | inserted = (HTREEITEM)SendMessage(hWndTL, TVM_INSERTITEM, 0, (LPARAM)&item);
105 | printf("inserted = %08lx\n", inserted);
106 |
107 | TVINSERTSTRUCT item2;
108 | item2.hParent = inserted;
109 | item2.hInsertAfter = TVI_LAST ;
110 | item2.item.hItem = 0;
111 | item2.item.pszText = TEXT("Item 2");
112 | item2.item.mask = TVIF_TEXT;
113 | item2.item.iImage = TV_NOIMAGE;
114 | item2.item.iSelectedImage = TV_NOIMAGE;
115 | item2.item.state = 0;
116 | item2.item.stateMask = 0;
117 | item2.item.lParam = 0;
118 | inserted2 = (HTREEITEM)SendMessage(hWndTL, TVM_INSERTITEM, 0, (LPARAM)&item2);
119 | printf("inserted = %08lx\n", inserted2);
120 | if(inserted2){
121 | SendMessage(hWndTL, TVM_EXPAND, TVE_EXPAND, (LPARAM)inserted);
122 | TV_ITEM itm;
123 | itm.mask = TVIF_SUBITEM | TVIF_TEXT;
124 | itm.hItem = inserted2;
125 | itm.state = 0;
126 | itm.stateMask = 0;
127 | itm.pszText = TEXT("blah blah");
128 | itm.cchTextMax = 256;
129 | itm.iImage = 0;
130 | itm.iSelectedImage = 0;
131 | itm.cChildren = 1;
132 | itm.lParam = 0;
133 | SendMessage(hWndTL, TVM_SETITEM, 0, (LPARAM)&itm);
134 | }
135 |
136 | TVINSERTSTRUCT item3;
137 | item3.hParent = inserted2;
138 | item3.hInsertAfter = TVI_LAST ;
139 | item3.item.hItem = 0;
140 | item3.item.pszText = TEXT("Item 3");
141 | item3.item.mask = TVIF_TEXT;
142 | item3.item.iImage = TV_NOIMAGE;
143 | item3.item.iSelectedImage = TV_NOIMAGE;
144 | item3.item.state = 0;
145 | item3.item.stateMask = 0;
146 | item3.item.lParam = 0;
147 | inserted2 = (HTREEITEM)SendMessage(hWndTL, TVM_INSERTITEM, 0, (LPARAM)&item3);
148 | printf("inserted = %08lx\n", inserted2);
149 |
150 | TVINSERTSTRUCT item4;
151 | item4.hParent = inserted;
152 | item4.hInsertAfter = TVI_LAST ;
153 | item4.item.hItem = 0;
154 | item4.item.pszText = TEXT("Item 4");
155 | item4.item.mask = TVIF_TEXT;
156 | item4.item.iImage = TV_NOIMAGE;
157 | item4.item.iSelectedImage = TV_NOIMAGE;
158 | item4.item.state = 0;
159 | item4.item.stateMask = 0;
160 | item4.item.lParam = 0;
161 | inserted = (HTREEITEM)SendMessage(hWndTL, TVM_INSERTITEM, 0, (LPARAM)&item4);
162 | printf("inserted = %08lx\n", inserted);
163 |
164 |
165 | return 0;
166 | }
167 | break;
168 | case WM_SIZE: {
169 | MoveWindow(hWndTL, 0, 0, LOWORD(lParam), HIWORD(lParam), TRUE);
170 | return 0;
171 | }
172 | break;
173 | case WM_DESTROY: {
174 | TCHAR sMsg[50];
175 | wsprintf(sMsg, TEXT("%d items"), SendMessage(hWndTL, TVM_GETROWCOUNT, (WPARAM)NULL, (LPARAM)NULL));
176 | OutputDebugString(sMsg);
177 | printf("%s",sMsg);
178 | PostQuitMessage(0);
179 | return 0;
180 | }
181 | break;
182 | default:
183 | return DefWindowProc(hWnd, message, wParam, lParam);
184 | }
185 | return 0;
186 | }
187 |
--------------------------------------------------------------------------------
/tests/simple_dll.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sebkirche/treelist/f005e8d715aa0c831c5bc98ef6add7798d1c26dd/tests/simple_dll.exe
--------------------------------------------------------------------------------