Module cSigCJTreeView.pkg
1//==============================================================================
2// Project : SigCj - VDF Classes for Codejock
3// File : cSigCJTreeView.pkg
4// Description : VDF Class for Codejock control
5//
6// Revision : $Rev: 675 $
7// $Date: 2011-02-23 10:51:39 -0500 (Wed, 23 Feb 2011) $
8// $Author: martin $ Martin Pincott
9//
10// Requirements : Visual DataFlex 12.1+
11// Codejock SuitePro - Version 12.0.0+
12//
13// Copyright : (c) 2008 VDF SIG UK
14// Visual DataFlex Special Interest Group UK.
15// http://www.vdfsig.co.uk/
16// dev@vdfsig.co.uk
17//
18// This file is part of SigCj.
19//
20// SigCj is free software: you can redistribute it and/or modify
21// it under the terms of the GNU Lesser General Public License
22// as published by the Free Software Foundation, either version
23// 2.1 of the License, or (at your option) any later version.
24//
25// SigCj is distributed in the hope that it will be useful, but
26// WITHOUT ANY WARRANTY; without even the implied warranty of
27// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28// GNU Lesser General Public License for more details.
29//
30// If you have the complete SigCj workspace then a copy of the
31// GNU Lesser General Public License is in the Docs folder. If
32// not, see <http://www.gnu.org/licenses/>.
33//
34//==============================================================================
35
36Use SigCjW_Controls.pkg
37Use cSigCJMethods_Mixin.pkg
38Use cSigCJImage_Manager_Mixin.pkg
39
40//-----------------------------------------------------------------------------
41//Redefine Constants
42
43Define xtpTreeViewHideLines for OLExtpTreeViewHideLines //0
44Define xtpTreeViewShowLines for OLExtpTreeViewShowLines //1
45Define xtpTreeViewShowLinesAtRoot for OLExtpTreeViewShowLinesAtRoot //2
46
47Define xtpTreeViewLabelAutomatic for OLExtpTreeViewLabelAutomatic //0
48Define xtpTreeViewLabelManual for OLExtpTreeViewLabelManual //1
49
50Define xtpTreeViewFirst for OLExtpTreeViewFirst //0
51Define xtpTreeViewLast for OLExtpTreeViewLast //1
52Define xtpTreeViewNext for OLExtpTreeViewNext //2
53Define xtpTreeViewPrev for OLExtpTreeViewPrevious //3
54Define xtpTreeViewChild for OLExtpTreeViewChild //4
55
56Define xtpOLEDropNone for OLExtpOLEDropNone //0
57Define xtpOLEDropManual for OLExtpOLEDropManual //1
58
59Enum_List
60 Define eTV_ThisNode
61 Define eTV_FirstChild
62 Define eTV_FirstSibling
63 Define eTV_LastSibling
64 Define eTV_NextSibling
65 Define eTV_Parent
66 Define eTV_PreviousSibling
67 Define eTV_Root
68End_Enum_List
69
70Struct tdTreeviewNodeTag
71 Integer iLevel
72 Integer iRecnum
73 String sRowId
74 Handle hDDO
75 String sCargo
76End_Struct
77
78Class cSigCjTreeViewNode is a cSigCjComTreeViewNode
79 Import_Class_Protocol cSigCJMethods_Mixin
80
81 Procedure Construct_Object
82 Forward Send Construct_Object
83
84 { DesignTime=False }
85 Property Integer Private_piBackColor clWindow
86
87 { DesignTime=False }
88 Property Integer Private_piForeColor clBlue
89
90 { DesignTime=False }
91 Property Boolean Private_pbBold False
92
93 { DesignTime=False }
94 Property Boolean Private_pbChecked False
95
96 { DesignTime=False }
97 Property Boolean Private_pbExpanded False
98
99 { DesignTime=False }
100 Property Boolean Private_pbSelected False
101
102 { DesignTime=False }
103 Property String Private.psImage
104
105 { DesignTime=False }
106 Property Integer Private.piImage
107
108 { DesignTime=False }
109 Property Integer Private_piIndex
110
111 { DesignTime=False }
112 Property String Private_psKey
113
114 { DesignTime=False }
115 Property String Private_psText
116
117 { DesignTime=False }
118 Property Variant Private_pvTag
119
120 End_Procedure // Construct_Object
121
122 //-------------------------------------------------------------------------
123
124 { MethodType=Property Category="CodeJock" PropertyType=Color InitialValue=clWindow }
125 Procedure Set piBackColor Integer iColour
126 Set SigCJProperty Set_Private_piBackColor Set_ComBackColor to iColour
127 End_Procedure
128
129 Function piBackColor Returns Integer
130 Function_Return (SigCJProperty(Self, Get_Private_piBackColor, Get_ComBackColor ))
131 End_Function
132
133 //-------------------------------------------------------------------------
134
135 { MethodType=Property Category="CodeJock" PropertyType=Color InitialValue=clBlue }
136 Procedure Set piForeColor Integer iColour
137 Set SigCJProperty Set_Private_piForeColor Set_ComForeColor to iColour
138 End_Procedure
139
140 Function piForeColor Returns Integer
141 Function_Return (SigCJProperty(Self, Get_Private_piForeColor, Get_ComForeColor ))
142 End_Function
143
144 //-------------------------------------------------------------------------
145
146 { MethodType=Property Category="CodeJock" InitialValue=False }
147 Procedure Set pbBold Boolean bState
148 Set SigCJProperty Set_Private_pbBold Set_ComBold to bState
149 End_Procedure
150
151 Function pbBold Returns Boolean
152 Function_Return (SigCJProperty(Self, Get_Private_pbBold, Get_ComBold ))
153 End_Function
154
155 //-------------------------------------------------------------------------
156
157 { MethodType=Property Category="CodeJock" InitialValue=False }
158 Procedure Set pbChecked Boolean bState
159 Set SigCJProperty Set_Private_pbChecked Set_ComChecked to bState
160 End_Procedure
161
162 Function pbChecked Returns Boolean
163 Function_Return (SigCJProperty(Self, Get_Private_pbChecked, Get_ComChecked ))
164 End_Function
165
166 //-------------------------------------------------------------------------
167
168 { MethodType=Property Category="CodeJock" InitialValue=False }
169 Procedure Set pbExpanded Boolean bState
170 Set SigCJProperty Set_Private_pbExpanded Set_ComExpanded to bState
171 End_Procedure
172
173 Function pbExpanded Returns Boolean
174 Function_Return (SigCJProperty(Self, Get_Private_pbExpanded, Get_ComExpanded ))
175 End_Function
176
177 //-------------------------------------------------------------------------
178
179 { MethodType=Property Category="CodeJock" InitialValue=False }
180 Procedure Set pbSelected Boolean bState
181 Set SigCJProperty Set_Private_pbSelected Set_ComSelected to bState
182 End_Procedure
183
184 Function pbSelected Returns Boolean
185 Function_Return (SigCJProperty(Self, Get_Private_pbSelected, Get_ComSelected ))
186 End_Function
187
188 //-------------------------------------------------------------------------
189
190 { MethodType=Property Category="CodeJock" }
191 Procedure Set psImage String sImage
192 Integer iImageId
193 Variant vImage
194
195 Get AddImage of ghoSigCjGlobalSetting sImage 0 OLExtpImageNormal to iImageId
196 Set Private.piImage to iImageId
197 Set Private.psImage to sImage
198
199 If (IsComObjectCreated(Self)) Set ComImage to iImageId
200 End_Procedure
201
202 { MethodType=Property Category="CodeJock" }
203 Function psImage Returns String
204 Function_Return (Private.psImage(Self))
205 End_Function
206
207 //-------------------------------------------------------------------------
208
209 { MethodType=Property Category="CodeJock" InitialValue=0 }
210 Procedure Set piIndex Integer iValue
211 Set SigCJProperty Set_Private_piIndex Set_ComIndex to iValue
212 End_Procedure
213
214 Function piIndex Returns Integer
215 Function_Return (SigCJProperty(Self, Get_Private_piIndex, Get_ComIndex ))
216 End_Function
217
218 //-------------------------------------------------------------------------
219
220 { MethodType=Property Category="CodeJock" InitialValue="" }
221 Procedure Set psKey String sValue
222 Set SigCJProperty Set_Private_psKey Set_ComKey to sValue
223 End_Procedure
224
225 Function psKey Returns String
226 Function_Return (SigCJProperty(Self, Get_Private_psKey, Get_ComKey ))
227 End_Function
228
229 //-------------------------------------------------------------------------
230
231 { MethodType=Property Category="CodeJock" InitialValue="" }
232 Procedure Set psText String sValue
233 Set SigCJProperty Set_Private_psText Set_ComText to sValue
234 End_Procedure
235
236 Function psText Returns String
237 Function_Return (SigCJProperty(Self, Get_Private_psText, Get_ComText ))
238 End_Function
239
240 //-------------------------------------------------------------------------
241
242 { MethodType=Property Category="CodeJock" InitialValue="" }
243 Procedure Set pvTag Variant vValue
244 Set SigCJProperty Set_Private_pvTag Set_ComTag to vValue
245 End_Procedure
246
247 Function pvTag Returns Variant
248 Function_Return (SigCJProperty(Self, Get_Private_pvTag, Get_ComTag ))
249 End_Function
250
251 //-------------------------------------------------------------------------
252
253 // Read only Properties
254 { MethodType=Property Category="CodeJock" DesignTime=False }
255 Function psFullPath Returns String
256 Function_Return (ComFullPath(Self))
257 End_Function
258
259 { MethodType=Property Category="CodeJock" DesignTime=False }
260 Function pvParent Returns Variant
261 Function_Return (ComParent(Self))
262 End_Function
263
264 { MethodType=Property Category="CodeJock" DesignTime=False }
265 Function pvChild Returns Variant
266 Function_Return (ComChild(Self))
267 End_Function
268
269 { MethodType=Property Category="CodeJock" DesignTime=False }
270 Function piChildren Returns Integer
271 Function_Return (ComChildren(Self))
272 End_Function
273
274 { MethodType=Property Category="CodeJock" DesignTime=False }
275 Function pvFirstSibling Returns Variant
276 Function_Return (ComFirstSibling(Self))
277 End_Function
278
279 { MethodType=Property Category="CodeJock" DesignTime=False }
280 Function pvLastSibling Returns Variant
281 Function_Return (ComLastSibling(Self))
282 End_Function
283
284 { MethodType=Property Category="CodeJock" DesignTime=False }
285 Function pvNext Returns Variant
286 Function_Return (ComNext(Self))
287 End_Function
288
289 { MethodType=Property Category="CodeJock" DesignTime=False }
290 Function pvPrevious Returns Variant
291 Function_Return (ComPrevious(Self))
292 End_Function
293
294 //-------------------------------------------------------------------------
295
296 { MethodType=Property DesignTime=False }
297 Function Node_Index Returns Integer
298 Function_Return (ComIndex(Self))
299 End_Function
300
301 { MethodType=Property DesignTime=False }
302 Function Node_Key Handle hoNode Returns String
303 Function_Return (ComKey(Self))
304 End_Function
305
306 //-------------------------------------------------------------------------
307
308 { MethodType=Property DesignTime=False }
309 Procedure Set Node_Level Integer iLevel
310 Integer iIndex
311 tdTreeviewNodeTag[] tNodeTags
312
313 Get ptNodeTags to tNodeTags
314 Get ComIndex to iIndex
315 Move iLevel to tNodeTags[iIndex].iLevel
316 Set ptNodeTags to tNodeTags
317 End_Procedure
318
319 Function Node_Level Returns Integer
320 Integer iIndex
321 tdTreeviewNodeTag[] tNodeTags
322
323 Get ptNodeTags to tNodeTags
324 Get ComIndex to iIndex
325
326 Function_Return tNodeTags[iIndex].iLevel
327 End_Function
328
329 //-------------------------------------------------------------------------
330
331 { MethodType=Property DesignTime=False }
332 Procedure Set Node_Cargo String sCargo
333 Integer iIndex
334 tdTreeviewNodeTag[] tNodeTags
335
336 Get ptNodeTags to tNodeTags
337 Get ComIndex to iIndex
338 Move sCargo to tNodeTags[iIndex].sCargo
339 Set ptNodeTags to tNodeTags
340 End_Procedure
341
342 Function Node_Cargo Returns String
343 Integer iIndex
344 tdTreeviewNodeTag[] tNodeTags
345
346 Get ptNodeTags to tNodeTags
347 Get ComIndex to iIndex
348
349 Function_Return tNodeTags[iIndex].sCargo
350 End_Function
351
352 //-------------------------------------------------------------------------
353
354 { MethodType=Property DesignTime=False }
355 Procedure Set Node_DDO Handle hoDDO
356 Integer iIndex
357 tdTreeviewNodeTag[] tNodeTags
358
359 Get ptNodeTags to tNodeTags
360 Get ComIndex to iIndex
361 Move hoDDO to tNodeTags[iIndex].hDDO
362 Set ptNodeTags to tNodeTags
363 End_Procedure
364
365 Function Node_DDO Returns Handle
366 Integer iIndex
367 tdTreeviewNodeTag[] tNodeTags
368
369 Get ptNodeTags to tNodeTags
370 Get ComIndex to iIndex
371
372 Function_Return tNodeTags[iIndex].hDDO
373 End_Function
374
375 //-------------------------------------------------------------------------
376
377 { MethodType=Property DesignTime=False }
378 Procedure Set Node_RowId RowID rRowid
379 Integer iIndex
380 tdTreeviewNodeTag[] tNodeTags
381
382 Get ptNodeTags to tNodeTags
383 Get ComIndex to iIndex
384 Move (SerializeRowID(rRowid)) to tNodeTags[iIndex].sRowId
385 Set ptNodeTags to tNodeTags
386 End_Procedure
387
388 Function Node_RowId Returns RowID
389 Integer iIndex
390 tdTreeviewNodeTag[] tNodeTags
391
392 Get ptNodeTags to tNodeTags
393 Get ComIndex to iIndex
394
395 Function_Return (DeserializeRowId(tNodeTags[iIndex].sRowId))
396 End_Function
397
398 //-------------------------------------------------------------------------
399
400 { MethodType=Property DesignTime=False }
401 Procedure Set Node_Recnum Integer iRecnum
402 Integer iIndex
403 tdTreeviewNodeTag[] tNodeTags
404
405 Get ptNodeTags to tNodeTags
406 Get ComIndex to iIndex
407 Move iRecnum to tNodeTags[iIndex].iRecnum
408 Set ptNodeTags to tNodeTags
409 End_Procedure
410
411 Function Node_Recnum Returns Integer
412 Integer iIndex
413 tdTreeviewNodeTag[] tNodeTags
414
415 Get ptNodeTags to tNodeTags
416 Get ComIndex to iIndex
417
418 Function_Return tNodeTags[iIndex].iRecnum
419 End_Function
420
421 //-------------------------------------------------------------------------
422
423 Procedure Remove_Children
424 Handle hoChildNode
425 Variant vChild
426 Integer iIndex iChildren
427
428 Get phoChildNode to hoChildNode
429
430 Get ComChildren to iChildren
431 If (iChildren > 0) Begin
432 Repeat
433 Get ComChild to vChild
434 Set pvComObject of hoChildNode to vChild
435 Get ComIndex of hoChildNode to iIndex
436 Send Remove_Node iIndex
437 Get ComChildren to iChildren
438 Until (iChildren <= 0)
439 End
440 End_Procedure // Remove_Children
441
442 //-------------------------------------------------------------------------
443
444 Procedure OnCreate
445 Forward Send OnCreate
446
447 Set ComBackColor to (Private_piBackColor(Self))
448 Set ComForeColor to (Private_piForeColor(Self))
449 Set ComBold to (Private_pbBold(Self))
450 Set ComExpanded to (Private_pbExpanded(Self))
451 End_Procedure
452
453End_Class // cSigCjTreeViewNode
454
455
456//=============================================================================
457
458{ OverrideProperty=Label_Col_Offset DesignTime=False }
459{ OverrideProperty=Label_Justification_Mode DesignTime=False }
460{ OverrideProperty=Label_Row_Offset DesignTime=False }
461{ OverrideProperty=piMinSize DesignTime=False }
462{ OverrideProperty=Border_Style DesignTime=False }
463{ OverrideProperty=Visible_State DesignTime=False }
464{ OverrideProperty=Attach_Parent_State DesignTime=False }
465{ OverrideProperty=Block_Mouse_State DesignTime=False }
466{ OverrideProperty=Client_Area_State DesignTime=False }
467{ OverrideProperty=Delegation_Mode DesignTime=False }
468{ OverrideProperty=Focus_Mode DesignTime=False }
469{ OverrideProperty=pbBindValue DesignTime=False }
470{ OverrideProperty=peAutoCreate DesignTime=False }
471{ OverrideProperty=peNeighborhood DesignTime=False }
472{ OverrideProperty=Popup_State DesignTime=False }
473{ OverrideProperty=Ring_State DesignTime=False }
474{ OverrideProperty=Scope_State DesignTime=False }
475{ OverrideProperty=Search_Case DesignTime=False }
476{ OverrideProperty=Skip_State DesignTime=False }
477{ OverrideProperty=Help_Id DesignTime=False }
478{ OverrideProperty=Help_Keyword DesignTime=False }
479{ OverrideProperty=psHtmlHelpTopic DesignTime=False }
480{ OverrideProperty=Status_Help DesignTime=False }
481{ OverrideProperty=Use_Parent_Status_Help DesignTime=False }
482{ OverrideProperty=psLicenseKey DesignTime=False }
483{ OverrideProperty=psProgID DesignTime=False }
484{ OverrideProperty=Color DesignTime=False }
485{ OverrideProperty=TextColor DesignTime=False }
486{ OverrideProperty=Label DesignTime=False }
487{ OverrideProperty=Label_Color DesignTime=False }
488{ OverrideProperty=Label_FontSize DesignTime=False }
489{ OverrideProperty=Label_FontItalics DesignTime=False }
490{ OverrideProperty=Label_FontUnderLine DesignTime=False }
491{ OverrideProperty=Label_FontWeight DesignTime=False }
492{ OverrideProperty=Label_TextColor DesignTime=False }
493{ OverrideProperty=Label_TypeFace DesignTime=False }
494Class cSigCJTreeView is a cSigCjComTreeView
495 Import_Class_Protocol cSigCJMethods_Mixin
496
497 Procedure Construct_Object
498 Forward Send Construct_Object
499
500 { DesignTime=False }
501 Property Integer Private_peAppearance OLExtpAppearanceStandard
502
503 { DesignTime=False }
504 Property Integer Private_piBackColor clWindow
505
506 { DesignTime=False }
507 Property Integer Private_piForeColor clBlue
508
509 { DesignTime=False }
510 Property Integer Private_piSelectionBackColor clHighlight
511
512 { DesignTime=False }
513 Property Integer Private_piSelectionForeColor clHighlightText
514
515 { DesignTime=False }
516 Property Boolean Private_pbCheckboxes False
517
518 { DesignTime=False }
519 Property Boolean Private_pbEnabled True
520
521 { DesignTime=False }
522 Property Boolean Private_pbEnableMarkup False
523
524 { DesignTime=False }
525 Property Boolean Private_pbFullRowSelect False
526
527 { DesignTime=False }
528 Property Boolean Private_pbHideSelection True
529
530 { DesignTime=False }
531 Property Boolean Private_pbHotTracking True
532
533 { DesignTime=False }
534 Property Integer Private_piIconSize 16
535
536 { DesignTime=False }
537 Property Integer Private_piIndentation 0
538
539 { DesignTime=False }
540 Property Integer Private_peLabelEdit xtpTreeViewLabelManual
541
542 { DesignTime=False }
543 Property Integer Private_peOLEDropMode xtpOLEDropNone
544
545 { DesignTime=False }
546 Property String Private_psPathSeparator "\"
547
548 { DesignTime=False }
549 Property Boolean Private_pbRightToLeft False
550
551 { DesignTime=False }
552 Property Boolean Private_pbRightToLeftReading False
553
554 { DesignTime=False }
555 Property Boolean Private_pbScroll True
556
557 { DesignTime=False }
558 Property Boolean Private_pbShowBorder True
559
560 { DesignTime=False }
561 Property Integer Private_peShowLines xtpTreeViewShowLinesAtRoot
562
563 { DesignTime=False }
564 Property Boolean Private_pbShowPlusMinus True
565
566 { DesignTime=False }
567 Property Boolean Private_pbSingleSel False
568
569 { DesignTime=False }
570 Property Boolean Private_pbSorted False
571
572 { DesignTime=False }
573 Property Boolean Private_pbUseVisualStyle False
574
575 { DesignTime=False }
576 Property tdTreeviewNodeTag[] ptNodeTags
577
578 { Category="CodeJock" InitialValue=False }
579 Property Boolean pbActive_Track False
580
581 { Category="CodeJock" InitialValue=False }
582 Property Variant pvLast_Node
583
584 { Category="CodeJock" InitialValue=False }
585 Property Integer piLast_Node_Index
586
587 { DesignTime=False }
588 Property String psRootName "Root"
589
590 { DesignTime=False }
591 Property Integer piKey 0
592
593 { DesignTime=False }
594 Property Handle phoNodes (Create(Self, U_cSigCjComTreeViewNodes))
595
596 { DesignTime=False }
597 Property Handle phoNode (Create(Self, U_cSigCjTreeViewNode))
598
599 { DesignTime=False }
600 Property Handle phoChildNode (Create(Self, U_cSigCjTreeViewNode))
601
602 { Category="CodeJock" }
603 Property String psImage_FolderClose "Closetree.bmp"
604
605 { Category="CodeJock" }
606 Property String psImage_FolderOpen "Opentree.bmp"
607
608 { Category="CodeJock" }
609 Property String psImage_FolderItem1 "ActionClear.ico"
610
611 { Category="CodeJock" }
612 Property String psImage_FolderItem2 "ActionDeleteRecord.ico"
613
614 { Category="CodeJock" }
615 Property String[] pasImage_FolderItem
616
617
618 End_Procedure
619
620 //-------------------------------------------------------------------------
621
622 Procedure OnCreate
623 Variant vNodes vIcons
624 String[] asImage_FolderItem
625
626 Forward Send OnCreate
627
628 Set ComAppearance to (Private_peAppearance (Self))
629 Set ComBackColor to (Private_piBackColor (Self))
630 Set ComForeColor to (Private_piForeColor (Self))
631 Set ComCheckboxes to (Private_pbCheckboxes (Self))
632 Set ComEnabled to (Private_pbEnabled (Self))
633 Set ComEnableMarkup to (Private_pbEnableMarkup (Self))
634 Set ComFullRowSelect to (Private_pbFullRowSelect (Self))
635 Set ComHideSelection to (Private_pbHideSelection (Self))
636 Set ComHotTracking to (Private_pbHotTracking (Self))
637 Set ComIconSize to (Private_piIconSize (Self))
638 Set ComIndentation to (Private_piIndentation (Self))
639 Set ComLabelEdit to (Private_peLabelEdit (Self))
640 Set ComOLEDropMode to (Private_peOLEDropMode (Self))
641 Set ComPathSeparator to (Private_psPathSeparator (Self))
642 Set ComRightToLeft to (Private_pbRightToLeft (Self))
643 Set ComRightToLeftReading to (Private_pbRightToLeftReading(Self))
644 Set ComScroll to (Private_pbScroll (Self))
645 Set ComSelectionBackColor to (Private_piSelectionBackColor(Self))
646 Set ComSelectionForeColor to (Private_piSelectionForeColor(Self))
647 Set ComShowBorder to (Private_pbShowBorder (Self))
648 Set ComShowLines to (Private_peShowLines (Self))
649 Set ComShowPlusMinus to (Private_pbShowPlusMinus (Self))
650 Set ComSingleSel to (Private_pbSingleSel (Self))
651 Set ComSorted to (Private_pbSorted (Self))
652 Set ComUseVisualStyle to (Private_pbUseVisualStyle (Self))
653
654 Get ComNodes to vNodes
655 Set pvComObject of (phoNodes(Self)) to vNodes
656 Set ComIcons to (ComIcons(ghoSigCjGlobalSetting))
657
658 Get pasImage_FolderItem to asImage_FolderItem
659 Move (psImage_FolderItem1(Self)) to asImage_FolderItem[1]
660 Move (psImage_FolderItem2(Self)) to asImage_FolderItem[2]
661 Set pasImage_FolderItem to asImage_FolderItem
662
663 Send OnClearTreeview
664 Send OnCreateTree
665 End_Procedure
666
667 Procedure OnCreateTree // Hook
668 End_Procedure
669
670 Procedure OnClearTreeview
671 tdTreeviewNodeTag[] tNodeTags
672
673 Send ComClear of (phoNodes(Self))
674 Set piKey to 0
675 Set ptNodeTags to tNodeTags
676 End_Procedure
677
678 //=========================================================================
679
680 #IF (SigCj_Codejock_Version < 150001)
681 { MethodType=Property Category="CodeJock" InitialValue=OLExtpAppearanceStandard }
682 { EnumList="OLExtpAppearanceStandard, OLExtpAppearanceFlat, OLExtpAppearanceUltraFlat, OLExtpAppearanceOffice2000, OLExtpAppearanceOffice2000, OLExtpAppearanceOffice2003, OLExtpAppearanceOffice2007" }
683 #ELSE
684 { MethodType=Property Category="CodeJock" InitialValue=OLExtpAppearanceStandard }
685 { EnumList="OLExtpAppearanceStandard, OLExtpAppearanceFlat, OLExtpAppearanceUltraFlat, OLExtpAppearanceOffice2000, OLExtpAppearanceOffice2000, OLExtpAppearanceOffice2003, OLExtpAppearanceResource" }
686 #ENDIF
687 Procedure Set peAppearance Integer eAppearance
688 Set SigCJProperty Set_Private_peAppearance Set_ComAppearance to eAppearance
689 End_Procedure
690
691 Function peAppearance Returns Integer
692 Function_Return (SigCJProperty(Self, Get_Private_peAppearance, Get_ComAppearance ))
693 End_Function
694
695 //-------------------------------------------------------------------------
696
697 { MethodType=Property Category="CodeJock" PropertyType=Color InitialValue=clWindow }
698 Procedure Set piBackColor Integer iColour
699 Set SigCJProperty Set_Private_piBackColor Set_ComBackColor to iColour
700 End_Procedure
701
702 Function piBackColor Returns Integer
703 Function_Return (SigCJProperty(Self, Get_Private_piBackColor, Get_ComBackColor ))
704 End_Function
705
706 //-------------------------------------------------------------------------
707
708 { MethodType=Property Category="CodeJock" PropertyType=Color InitialValue=clBlue }
709 Procedure Set piForeColor Integer iColour
710 Set SigCJProperty Set_Private_piForeColor Set_ComForeColor to iColour
711 End_Procedure
712
713 Function piForeColor Returns Integer
714 Function_Return (SigCJProperty(Self, Get_Private_piForeColor, Get_ComForeColor ))
715 End_Function
716
717 //-------------------------------------------------------------------------
718
719 { MethodType=Property Category="CodeJock" InitialValue=False }
720 Procedure Set pbCheckboxes Boolean bState
721 Set SigCJProperty Set_Private_pbCheckboxes Set_ComCheckboxes to bState
722 End_Procedure
723
724 Function pbCheckboxes Returns Boolean
725 Function_Return (SigCJProperty(Self, Get_Private_pbCheckboxes, Get_ComCheckboxes ))
726 End_Function
727
728 //-------------------------------------------------------------------------
729
730 { MethodType=Property Category="CodeJock" InitialValue=True }
731 Procedure Set pbEnabled Boolean bState
732 Set SigCJProperty Set_Private_pbEnabled Set_ComEnabled to bState
733 End_Procedure
734
735 Function pbEnabled Returns Boolean
736 Function_Return (SigCJProperty(Self, Get_Private_pbEnabled, Get_ComEnabled ))
737 End_Function
738
739 //-------------------------------------------------------------------------
740
741 { MethodType=Property Category="CodeJock" InitialValue=False }
742 Procedure Set pbEnableMarkup Boolean bState
743 Set SigCJProperty Set_Private_pbEnableMarkup Set_ComEnableMarkup to bState
744 End_Procedure
745
746 Function pbEnableMarkup Returns Boolean
747 Function_Return (SigCJProperty(Self, Get_Private_pbEnableMarkup, Get_ComEnableMarkup ))
748 End_Function
749
750 //-------------------------------------------------------------------------
751
752 { MethodType=Property Category="CodeJock" InitialValue=False }
753 Procedure Set pbFullRowSelect Boolean bState
754 Set SigCJProperty Set_Private_pbFullRowSelect Set_ComFullRowSelect to bState
755 End_Procedure
756
757 Function pbFullRowSelect Returns Boolean
758 Function_Return (SigCJProperty(Self, Get_Private_pbFullRowSelect, Get_ComFullRowSelect ))
759 End_Function
760
761 //-------------------------------------------------------------------------
762
763 { MethodType=Property Category="CodeJock" InitialValue=True }
764 Procedure Set pbHideSelection Boolean bState
765 Set SigCJProperty Set_Private_pbHideSelection Set_ComHideSelection to bState
766 End_Procedure
767
768 Function pbHideSelection Returns Boolean
769 Function_Return (SigCJProperty(Self, Get_Private_pbHideSelection, Get_ComHideSelection ))
770 End_Function
771
772 //-------------------------------------------------------------------------
773
774 { MethodType=Property Category="CodeJock" InitialValue=False }
775 Procedure Set pbHotTracking Boolean bState
776 Set SigCJProperty Set_Private_pbHotTracking Set_ComHotTracking to bState
777 End_Procedure
778
779 Function pbHotTracking Returns Boolean
780 Function_Return (SigCJProperty(Self, Get_Private_pbHotTracking, Get_ComHotTracking ))
781 End_Function
782
783 //-------------------------------------------------------------------------
784
785 { MethodType=Property Category="CodeJock" PropertyType=Color InitialValue=0 }
786 Procedure Set piIconSize Integer iValue
787 Set SigCJProperty Set_Private_piIconSize Set_ComIconSize to iValue
788 End_Procedure
789
790 Function piIconSize Returns Integer
791 Function_Return (SigCJProperty(Self, Get_Private_piIconSize, Get_ComIconSize ))
792 End_Function
793
794 //-------------------------------------------------------------------------
795
796 { MethodType=Property Category="CodeJock" PropertyType=Color InitialValue=0 }
797 Procedure Set piIndentation Integer iValue
798 Set SigCJProperty Set_Private_piIndentation Set_ComIndentation to iValue
799 End_Procedure
800
801 Function piIndentation Returns Integer
802 Function_Return (SigCJProperty(Self, Get_Private_piIndentation, Get_ComIndentation ))
803 End_Function
804
805 //-------------------------------------------------------------------------
806
807 { MethodType=Property Category="CodeJock" InitialValue=xtpTreeViewLabelManual }
808 { EnumList="xtpTreeViewLabelAutomatic, xtpTreeViewLabelManual" }
809 Procedure Set peLabelEdit Integer eMode
810 Set SigCJProperty Set_Private_peLabelEdit Set_ComLabelEdit to eMode
811 End_Procedure
812
813 Function peLabelEdit Returns Integer
814 Function_Return (SigCJProperty(Self, Get_Private_peLabelEdit, Get_ComLabelEdit ))
815 End_Function
816
817 //-------------------------------------------------------------------------
818
819 { MethodType=Property Category="CodeJock" InitialValue=OLExtpOLEDropManual }
820 { EnumList="OLExtpOLEDropManual, OLExtpOLEDropAutomatic" }
821 Procedure Set peOLEDropMode Integer eMode
822 Set SigCJProperty Set_Private_peOLEDropMode Set_ComOLEDropMode to eMode
823 End_Procedure
824
825 Function peOLEDropMode Returns Integer
826 Function_Return (SigCJProperty(Self, Get_Private_peOLEDropMode, Get_ComOLEDropMode ))
827 End_Function
828
829 //-------------------------------------------------------------------------
830
831 { MethodType=Property Category="CodeJock" InitialValue="\" }
832 Procedure Set psPathSeparator String sValue
833 Set SigCJProperty Set_Private_psPathSeparator Set_ComPathSeparator to sValue
834 End_Procedure
835
836 Function psPathSeparator Returns String
837 Function_Return (SigCJProperty(Self, Get_Private_psPathSeparator, Get_ComPathSeparator ))
838 End_Function
839
840 //-------------------------------------------------------------------------
841
842 { MethodType=Property Category="CodeJock" InitialValue=False }
843 Procedure Set pbRightToLeft Boolean bState
844 Set SigCJProperty Set_Private_pbRightToLeft Set_ComRightToLeft to bState
845 End_Procedure
846
847 Function pbRightToLeft Returns Boolean
848 Function_Return (SigCJProperty(Self, Get_Private_pbRightToLeft, Get_ComRightToLeft ))
849 End_Function
850
851 //-------------------------------------------------------------------------
852
853 { MethodType=Property Category="CodeJock" InitialValue=False }
854 Procedure Set pbRightToLeftReading Boolean bState
855 Set SigCJProperty Set_Private_pbRightToLeftReading Set_ComRightToLeftReading to bState
856 End_Procedure
857
858 Function pbRightToLeftReading Returns Boolean
859 Function_Return (SigCJProperty(Self, Get_Private_pbRightToLeftReading, Get_ComRightToLeftReading ))
860 End_Function
861
862 //-------------------------------------------------------------------------
863
864 { MethodType=Property Category="CodeJock" InitialValue=True }
865 Procedure Set pbScroll Boolean bState
866 Set SigCJProperty Set_Private_pbScroll Set_ComScroll to bState
867 End_Procedure
868
869 Function pbScroll Returns Boolean
870 Function_Return (SigCJProperty(Self, Get_Private_pbScroll, Get_ComScroll ))
871 End_Function
872 //-------------------------------------------------------------------------
873
874 { MethodType=Property Category="CodeJock" PropertyType=Color InitialValue=clHighlight }
875 Procedure Set piSelectionBackColor Integer iColour
876 Set SigCJProperty Set_Private_piSelectionBackColor Set_ComSelectionBackColor to iColour
877 End_Procedure
878
879 Function piSelectionBackColor Returns Integer
880 Function_Return (SigCJProperty(Self, Get_Private_piSelectionBackColor, Get_ComSelectionBackColor ))
881 End_Function
882
883 //-------------------------------------------------------------------------
884
885 { MethodType=Property Category="CodeJock" PropertyType=Color InitialValue=clHighlightText }
886 Procedure Set piSelectionForeColor Integer iColour
887 Set SigCJProperty Set_Private_piSelectionForeColor Set_ComSelectionForeColor to iColour
888 End_Procedure
889
890 Function piSelectionForeColor Returns Integer
891 Function_Return (SigCJProperty(Self, Get_Private_piSelectionForeColor, Get_ComSelectionForeColor ))
892 End_Function
893
894 //-------------------------------------------------------------------------
895
896 { MethodType=Property Category="CodeJock" InitialValue=True }
897 Procedure Set pbShowBorder Boolean bState
898 Set SigCJProperty Set_Private_pbShowBorder Set_ComShowBorder to bState
899 End_Procedure
900
901 Function pbShowBorder Returns Boolean
902 Function_Return (SigCJProperty(Self, Get_Private_pbShowBorder, Get_ComShowBorder ))
903 End_Function
904
905 //-------------------------------------------------------------------------
906
907 { MethodType=Property Category="CodeJock" InitialValue=xtpTreeViewShowLinesAtRoot }
908 { EnumList="xtpTreeViewHideLines, xtpTreeViewShowLines, xtpTreeViewShowLinesAtRoot" }
909 Procedure Set peShowLines Integer eMode
910 Set SigCJProperty Set_Private_peShowLines Set_ComShowLines to eMode
911 End_Procedure
912
913 Function peShowLines Returns Integer
914 Function_Return (SigCJProperty(Self, Get_Private_peShowLines, Get_ComShowLines ))
915 End_Function
916
917 //-------------------------------------------------------------------------
918
919 { MethodType=Property Category="CodeJock" InitialValue=True }
920 Procedure Set pbShowPlusMinus Boolean bState
921 Set SigCJProperty Set_Private_pbShowPlusMinus Set_ComShowPlusMinus to bState
922 End_Procedure
923
924 Function pbShowPlusMinus Returns Boolean
925 Function_Return (SigCJProperty(Self, Get_Private_pbShowPlusMinus, Get_ComShowPlusMinus ))
926 End_Function
927
928 //-------------------------------------------------------------------------
929
930 { MethodType=Property Category="CodeJock" InitialValue=False }
931 Procedure Set pbSingleSel Boolean bState
932 Set SigCJProperty Set_Private_pbSingleSel Set_ComSingleSel to bState
933 End_Procedure
934
935 Function pbSingleSel Returns Boolean
936 Function_Return (SigCJProperty(Self, Get_Private_pbSingleSel, Get_ComSingleSel ))
937 End_Function
938
939 //-------------------------------------------------------------------------
940
941 { MethodType=Property Category="CodeJock" InitialValue=False }
942 Procedure Set pbSorted Boolean bState
943 Set SigCJProperty Set_Private_pbSorted Set_ComSorted to bState
944 End_Procedure
945
946 Function pbSorted Returns Boolean
947 Function_Return (SigCJProperty(Self, Get_Private_pbSorted, Get_ComSorted ))
948 End_Function
949
950 //-------------------------------------------------------------------------
951
952 { MethodType=Property Category="CodeJock" InitialValue=False }
953 Procedure Set pbUseVisualStyle Boolean bState
954 Set SigCJProperty Set_Private_pbUseVisualStyle Set_ComUseVisualStyle to bState
955 End_Procedure
956
957 Function pbUseVisualStyle Returns Boolean
958 Function_Return (SigCJProperty(Self, Get_Private_pbUseVisualStyle, Get_ComUseVisualStyle ))
959 End_Function
960
961 //-------------------------------------------------------------------------
962
963 { MethodType=Event Category="CodeJock" } // Hook
964 Procedure OnActive_Track Handle hoNode Integer iIndex
965 End_Procedure
966
967 { MethodType=Event Category="CodeJock" } // Hook
968 Procedure OnNodeChanging Handle hoNode Integer iIndex
969 // If you running with data aware components, then this is the hook to save the record before moving on.
970 // You will need to refind the Old node first
971 End_Procedure
972
973 { MethodType=Event Category="CodeJock" } // Hook
974 Procedure OnNodeClick Handle hoNode
975 End_Procedure
976
977 { DesignTime=False Visibility=Private }
978 Procedure OnComNodeClick Variant llNode
979 Handle hoNode
980 Integer iIndex iLast_Index
981 Variant vLast_Node
982
983 Get phoNode to hoNode
984 Set pvComObject of hoNode to llNode
985
986 If (pbActive_Track(Self)) Begin
987 Get ComIndex of hoNode to iIndex
988
989 Get piLast_Node_Index to iLast_Index
990 If ((iLast_Index > 0) and (iLast_Index <> iIndex)) Begin
991 Get pvLast_Node to vLast_Node
992 If (not(IsNullComObject(vLast_Node))) Begin
993 Set pvComObject of hoNode to vLast_Node
994 Get ComIndex of hoNode to iIndex
995 Send OnNodeChanging hoNode iIndex
996 // Refind the current node, in case its been changed by OnNodeChange
997 // If not refound then OnActive_Track may fail depending the developer code
998 Set pvComObject of hoNode to llNode
999 Get ComIndex of hoNode to iIndex
1000 End
1001 End
1002 Set pvLast_Node to llNode
1003 Set piLast_Node_Index to iIndex
1004
1005 Send OnActive_Track hoNode iIndex
1006 End
1007 Send OnNodeClick hoNode
1008 End_Procedure
1009
1010 //-------------------------------------------------------------------------
1011
1012 Procedure Load_NodeTags Handle hoNode Integer iLevel String sCargo Handle hoDDO String sRowId Integer iRecnum
1013 Integer iIndex
1014 tdTreeviewNodeTag[] tNodeTags
1015
1016 Get ptNodeTags to tNodeTags
1017 Get ComIndex of hoNode to iIndex
1018
1019 If (num_arguments = 6) Move iRecnum to tNodeTags[iIndex].iRecnum
1020 If (num_arguments >= 5) Move sRowId to tNodeTags[iIndex].sRowId
1021 If (num_arguments >= 6) Move hoDDO to tNodeTags[iIndex].hDDO
1022 If (num_arguments >= 3) Move sCargo to tNodeTags[iIndex].sCargo
1023 If (num_arguments >= 2) Move iLevel to tNodeTags[iIndex].iLevel
1024 Set ptNodeTags to tNodeTags
1025 End_Procedure
1026
1027 //-------------------------------------------------------------------------
1028
1029 Procedure Remove_Node Integer iIndex
1030 Integer iCurrent_Index iSize
1031
1032 Send ComRemove of (phoNodes(Self)) iIndex
1033
1034 tdTreeviewNodeTag[] tNodeTags
1035 Get ptNodeTags to tNodeTags
1036 Move ((SizeOfArray(tNodeTags))-1) to iSize
1037
1038 Move iIndex to iCurrent_Index
1039 Repeat
1040 If (iCurrent_Index = iSize) Begin
1041 Move (RemoveFromArray(tNodeTags, iCurrent_Index)) to tNodeTags
1042 End
1043 Else Begin
1044 Move tNodeTags[(iCurrent_Index+1)].iRecnum to tNodeTags[iCurrent_Index].iRecnum
1045 Move tNodeTags[(iCurrent_Index+1)].sRowId to tNodeTags[iCurrent_Index].sRowId
1046 Move tNodeTags[(iCurrent_Index+1)].hDDO to tNodeTags[iCurrent_Index].hDDO
1047 Move tNodeTags[(iCurrent_Index+1)].sCargo to tNodeTags[iCurrent_Index].sCargo
1048 Move tNodeTags[(iCurrent_Index+1)].iLevel to tNodeTags[iCurrent_Index].iLevel
1049 End
1050 Increment iCurrent_Index
1051 Until (iCurrent_Index >= iSize)
1052 Set ptNodeTags to tNodeTags
1053 End_Procedure
1054
1055 //-------------------------------------------------------------------------
1056
1057 Function Add_Root_Node String sText String sKey Returns Handle
1058 Variant vNode
1059 Handle hoNodes hoNode
1060 Integer iKey iIndex
1061 String sNewKey
1062 tdTreeviewNodeTag[] tNodeTags
1063
1064 Get ptNodeTags to tNodeTags
1065
1066 Get phoNodes to hoNodes
1067 Get phoNode to hoNode
1068
1069 If (num_arguments = 2) Begin
1070 Move sKey to sNewKey
1071 End
1072
1073 // If no Key has been supplied create one
1074 If (Trim(sNewKey) = '') Begin
1075 Set piKey to (piKey(Self)+1)
1076 Get piKey to sNewKey
1077 End
1078 Get ComAdd of hoNodes (psRootName(Self)) OLExtpTreeViewNext sNewKey sText Nothing to vNode
1079 Set pvComObject of hoNode to vNode
1080 Set psImage of hoNode to (psImage_FolderClose(Self))
1081 Get ComIndex of hoNode to iIndex
1082
1083 Move 1 to tNodeTags[iIndex].iLevel
1084
1085 Set ptNodeTags to tNodeTags
1086 Function_Return hoNode
1087 End_Function
1088
1089 Function Add_Child_Node String sText String sKey String sParent_Key Integer iLevel Integer iImage Returns Handle
1090 Variant vNode vParent
1091 Handle hoNodes hoNode
1092 Integer iKey iParent iIndex
1093 String sNewKey sNewParentKey
1094 String[] asImage_FolderItem
1095 tdTreeviewNodeTag[] tNodeTags
1096
1097 Get ptNodeTags to tNodeTags
1098
1099 Get phoNodes to hoNodes
1100 Get phoNode to hoNode
1101
1102 If (num_arguments >= 2) Begin
1103 Move sKey to sNewKey
1104 End
1105 If (num_arguments >= 3) Begin
1106 Move sParent_Key to sNewParentKey
1107 End
1108
1109 // If no Parent Key has been supplied presume its the last key
1110 If (Trim(sNewParentKey) = '') Begin
1111 Get piKey to sNewParentKey
1112 End
1113
1114 // If no Key has been supplied create one
1115 If (Trim(sNewKey) = '') Begin
1116 Set piKey to (piKey(Self)+1)
1117 Get piKey to sNewKey
1118 End
1119 // Debug code
1120 //Showln sNewParentKey " " sNewKey " " sText
1121 Get ComAdd of hoNodes sNewParentKey OLExtpTreeViewChild sNewKey sText Nothing to vNode
1122 Set pvComObject of hoNode to vNode
1123 Set psImage of hoNode to (psImage_FolderClose(Self))
1124 Get ComIndex of hoNode to iIndex
1125 Move "" to tNodeTags[iIndex].sCargo // force save of array
1126
1127 If (num_arguments = 4) Move iLevel to tNodeTags[iIndex].iLevel
1128 If (num_arguments = 5) Begin
1129 Get pasImage_FolderItem to asImage_FolderItem
1130 If ((iImage > 0) And (asImage_FolderItem[iImage] <> "")) Set psImage of hoNode to asImage_FolderItem[iImage]
1131 End
1132
1133 Set ptNodeTags to tNodeTags
1134
1135 Function_Return hoNode
1136 End_Function
1137
1138 //-------------------------------------------------------------------------
1139
1140 { MethodType=Event Category="CodeJock" }
1141 Procedure OnExpand Handle hoNode
1142 End_Procedure
1143
1144 { DesignTime=False Visibility=Private }
1145 Procedure OnComExpand Variant llNode
1146 Handle hoNode
1147 String sImage
1148 Integer iImage iClose iOpen
1149
1150 Get phoNode to hoNode
1151 Set pvComObject of hoNode to llNode
1152 Get ComImage of hoNode to iImage
1153
1154 Get Find_Image_Name of ghoSigCjGlobalSetting iImage to sImage
1155
1156 If (sImage = (Uppercase(psImage_FolderClose(Self)))) Begin
1157 Set psImage of hoNode to (psImage_FolderOpen(Self))
1158 End
1159 Send OnExpand hoNode
1160 End_Procedure
1161
1162 //-------------------------------------------------------------------------
1163
1164 { MethodType=Event Category="CodeJock" }
1165 Procedure OnCollapse Handle hoNode
1166 End_Procedure
1167
1168 { DesignTime=False Visibility=Private }
1169 Procedure OnComCollapse Variant llNode
1170 Handle hoNode
1171 String sImage
1172 Integer iImage iClose iOpen
1173
1174 Get phoNode to hoNode
1175 Set pvComObject of hoNode to llNode
1176 Get ComImage of hoNode to iImage
1177
1178 Get Find_Image_Name of ghoSigCjGlobalSetting iImage to sImage
1179
1180 If (sImage = (Uppercase(psImage_FolderOpen(Self)))) Begin
1181 Set psImage of hoNode to (psImage_FolderClose(Self))
1182 End
1183 Send OnCollapse hoNode
1184 End_Procedure
1185
1186End_Class // cSigCJTreeView
1187
1188//==============================================================================
1189//End of Package - cSigCJTreeView.pkg
1190//==============================================================================
1191