home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ool.zip / OOL / source / xcont.cpp < prev    next >
C/C++ Source or Header  |  1997-04-04  |  21KB  |  640 lines

  1. #include "XContInf.h"
  2. #include "XContObj.h"
  3. #include "XString.h"
  4. #include "XContain.h"
  5. #include "XContCol.h"
  6. #include "XDate.h"
  7. #include "XTime.h"
  8. #include "XBitmap.h"
  9. #include "XIcon.h"
  10. #include "xsize.h"
  11.  
  12. #include <string.h>
  13.  
  14.  
  15. XContainerColumn :: ~XContainerColumn()
  16. {
  17.     if (owner && info)
  18.         WinSendMsg(owner->GetHandle(), CM_FREEDETAILFIELDINFO, MPARAM(info), MPFROMSHORT(1));
  19. }
  20.  
  21.  
  22. /*@ XContainerColumn::XContainerColumn( XContainerControl * ow, void * titleData, SHORT dataColumn, LONG dataSettings, LONG titleSettings, LONG width)
  23. @group constructors/destructors
  24. @remarks If a container should be displayed in detail-mode you must add columns to it. Therfore
  25. you construct one or more XContainerColums, add these with XContainerControll::AddColumn
  26. and finaly call XContainerControll::UpdateColumns.
  27. @parameters    <t '°' c=2>
  28.                     °XContainerControl  * theOwner   °the owner of the column
  29.                °void * theTitle                 °the title of the column, the parameter can be a
  30.                                                pointer to a string or contain a handle for a
  31.                                                bitmap or icon
  32.                °SHORT dataColumn                °a zero-based index which points to the data-column
  33.                                                which will be used in XContainerObject::SetColumnData()
  34.                     °LONG dataSettings               °Information about the datas in the column
  35.                                                <t '°' c=2>
  36.                                                    °COL_LEFT            °field is left-justified
  37.                                                    °COL_RIGHT           °field is right-justified
  38.                                                    °COL_CENTER          °field is horizontal centered
  39.                                                    °COL_TOP             °field is top-justified
  40.                                                    °COL_VCENTER         °field is vertictal centered
  41.                                                    °COL_BOTTOM          °field is bottom-justified
  42.                                                    °COL_INVISIBLE       °the column is invisible
  43.                                                    °COL_SEPARATOR       °vertical separator
  44.                                                    °COL_HORZSEPARATOR   °horizontal separator
  45.                                                    °COL_BITMAPORICON    °the data contain a handle to a bitmap/icon
  46.                                                    °COL_STRING          °the data contain a string
  47.                                                    °COL_DATE            °the data contain a date
  48.                                                    °COL_TIME            °the data contain a time-value
  49.                                                    °COL_ULONG           °the data contain a ULONG value
  50.                                                    °COL_FIREADONLY      °datas are readonly
  51.                                                </t>
  52.                                                Can be or-ed;
  53.                °LONG titleSettings              °Information about the title of the column
  54.                                                                 <t '°' c=2>
  55.                                                    °COL_LEFT            °title is left-justified
  56.                                                    °COL_RIGHT           °title is right-justified
  57.                                                    °COL_CENTER          °title is horizontal centered
  58.                                                    °COL_TOP             °title is top-justified
  59.                                                    °COL_VCENTER         °title is vertictal centered
  60.                                                    °COL_BOTTOM          °title is bottom-justified
  61.                                                    °COL_SEPARATOR       °vertical separator
  62.                                                    °COL_HORZSEPARATOR   °horizontal separator
  63.                                                    °COL_BITMAPORICON    °the title contain is a bitmap/icon
  64.                                                    °COL_FTITLEREADONLY  °title is readonly
  65.                                                                 </t>
  66.                                                Can be or-ed;
  67.                °LONG widthOfColumn              °the width of the column in window-pixel. If zero
  68.                                                the width of the column is set dynamicaly.<BR>
  69.                                             Default is zero.
  70.                </t>
  71. */
  72.  
  73. XContainerColumn :: XContainerColumn(XContainerControl * ow, void *titleData, SHORT dataColumn, LONG dataSettings, LONG titleSettings, LONG width)
  74. {
  75.     owner = ow;
  76.     info = (FIELDINFO *) WinSendMsg(owner->GetHandle(), CM_ALLOCDETAILFIELDINFO, MPFROMSHORT(1), 0);
  77.  
  78.     info->flData = dataSettings;
  79.     info->flTitle = titleSettings;
  80.     info->offStruct = sizeof(RECORDCORE) + dataColumn * 4 + sizeof(void *);
  81.     info->pUserData = this;
  82.     col = dataColumn;
  83.     if (width > 0)
  84.         info->cxWidth = width;
  85.     info->pTitleData = titleData;
  86. }
  87.  
  88.  
  89. /*@ XContainerColumn::GetColumnNumber()
  90. @group misc
  91. @remarks Returns the number of the column in the container
  92. @returns SHORT number
  93. */
  94.  
  95.  
  96. /*@ XContainerColumn::SetTitle()
  97. @group title
  98. @remarks Set the title
  99. @parameters char * title
  100. */
  101.  
  102.  
  103. /*@ XContainerColumn::SetTitle()
  104. @group title
  105. @remarks Set the title
  106. @parameters XBitmap * bitmap for the title (tilt-attributes must have COL_BITMAPORICON)
  107. */
  108.  
  109.  
  110. /*@ XContainerColumn::SetTitle()
  111. @group title
  112. @remarks Set the title
  113. @parameters XIcon * bitmap for the title (tilt-attributes must have COL_BITMAPORICON)
  114. */
  115.  
  116.  
  117. /*@ XContainerColumn::SetTitleAttributes()
  118. @group title
  119. @remarks Set attributes for the title
  120. @parameters LONG attruibute (see constructor for details)
  121. */
  122.  
  123.  
  124. /*@ XContainerColumn::SetDataAttributes()
  125. @group data
  126. @remarks Set attributes for the datas
  127. @parameters LONG attruibute (see constructor for details)
  128. */
  129.  
  130.  
  131. /*@ XContainerColumn::GetDataAttributes()
  132. @group data
  133. @remarks Query attributes for the datas
  134. @returns LONG attruibute (see constructor for details)
  135. */
  136.  
  137.  
  138. /*@ XContainerColumn::GetTitleAttributes()
  139. @group title
  140. @remarks Query attributes for the title
  141. @returns LONG attruibute (see constructor for details)
  142. */
  143.  
  144.  
  145. /*@ XContainerColumn::GetTitle()
  146. @group title
  147. @remarks Query the title of a column
  148. @parameters   XString * buffer   buffer to hold the data
  149. */
  150. void XContainerColumn::GetTitle(XString * buffer)
  151. {
  152.     strcpy(buffer->GetBuffer(100), (char *) info->pTitleData);
  153.     buffer->ReleaseBuffer();
  154. }
  155.  
  156.  
  157. /*@ XContainerColumn::GetNextColumn()
  158. @group misc
  159. @remarks Returns a pointer to the next column of the container
  160. @returns XContainerColumn * column
  161. */
  162.  
  163.  
  164. /*@ XContainerObject::GetIcon( XIcon * icon )
  165. @group icon/bitmap
  166. @remarks Querry the icon of the object
  167. @parameters XIcon * buffer
  168. */
  169. void XContainerObject::GetIcon(XIcon * icon)
  170. {
  171.     if (icon->handle && icon->loaded)
  172.     {
  173.         WinFreeFileIcon(icon->handle);
  174.         icon->loaded = FALSE;
  175.     }
  176.     icon->handle = core->hptrIcon;
  177. }
  178.  
  179.  
  180. /*@ XContainerObject :: GetBitmap( XBitmap * bitmap )
  181. @group icon/bitmap
  182. @remarks Get the bitmap of the object
  183. @parameters XBitmap * buffer
  184. */
  185. void XContainerObject::GetBitmap(XBitmap * bitmap)
  186. {
  187.     if (bitmap->hbm)
  188.         GpiDeleteBitmap(bitmap->hbm);
  189.     bitmap->hbm = core->hbmBitmap;
  190. }
  191.  
  192.  
  193. /*@ XContainerObject::XContainerObject( XContainerControl * owner, SHORT columns, LONG emphasis)
  194. @group constructors/destructors
  195. @remarks Construct a container-item
  196. @parameters XContainerControl * owner<BR>
  197.             SHORT columns       count of columns in detail-view (default is NULL)
  198. */
  199. XContainerObject :: XContainerObject(XContainerControl * owner, SHORT columns, LONG emphasis)
  200. {
  201.     core = (RECORDCORE *) WinSendMsg(owner->GetHandle(), CM_ALLOCRECORD, MPFROMLONG(sizeof(void *) + columns * sizeof(void *)), MPFROMSHORT(1));
  202.     core->flRecordAttr = emphasis;
  203.     RECORDCORE *pr = (RECORDCORE *) ((PBYTE) core + sizeof(RECORDCORE));
  204.     void *pp = this;
  205.  
  206.     memcpy(pr, &pp, sizeof(void *));
  207. }
  208.  
  209.  
  210. /*@ XContainerObject::SetColumnData()
  211. @group columns
  212. @remarks Set data for an column for detail-view
  213. @parameters SHORT column   column-number (zero-based index)
  214.             char * data
  215. */
  216.  
  217. /*@ XContainerObject::SetColumnData()
  218. @group columns
  219. @remarks Set data for an column for detail-view
  220. @parameters SHORT column   column-number (zero-based index)
  221.             LONG data
  222. */
  223.  
  224. /*@ XContainerObject::SetColumnData()
  225. @group columns
  226. @remarks Set data for an column for detail-view
  227. @parameters SHORT column   column-number (zero-based index)
  228.             XBitmap * data
  229. */
  230.  
  231. /*@ XContainerObject::SetColumnData()
  232. @group columns
  233. @remarks Set data for an column for detail-view
  234. @parameters SHORT column   column-number (zero-based index)
  235.             XIcon * data
  236. */
  237.  
  238. /*@ XContainerObject::SetColumnData()
  239. @group columns
  240. @remarks Set data for an column for detail-view
  241. @parameters SHORT column   column-number (zero-based index)
  242.             XDate * data
  243. */
  244.  
  245.  
  246. /*@ XContainerObject::SetColumnData()
  247. @group columns
  248. @remarks Set data for an column for detail-view
  249. @parameters SHORT column   column-number (zero-based index)
  250.             XTime * data
  251. */
  252.  
  253.  
  254. /*@ XContainerObject::SetIcon()
  255. @group icon/bitmap
  256. @remarks Set object-icon
  257. @parameters XIcon * icon
  258. */
  259.  
  260.  
  261. /*@ XContainerObject::SetMiniIcon()
  262. @group icon/bitmap
  263. @remarks Set object mini-icon
  264. @parameters XIcon * icon
  265. */
  266.  
  267. /*@ XContainerObject::SetBitmap()
  268. @group icon/bitmap
  269. @remarks Set object-bitmap.
  270. @parameters XBitmap * bitmap
  271. */
  272.  
  273. /*@ XContainerObject::SetMiniBitmap()
  274. @group icon/bitmap
  275. @remarks Set the mini-bitmap of the object 
  276. @parameters XBitmap * bitmap
  277. */
  278.  
  279. /*@ XContainerObject::SetTitle()
  280. @group title
  281. @remarks Set the title of the object. Memory for the title is allocated by the object.
  282. @parameters char * title
  283. */
  284.  
  285. /*@ XContainerObject::GetEmphasis()
  286. @group emphasis
  287. @remarks Query emphasis of the object.
  288. @returns LONG emphasis (see XContainer::SetObjectEmphasis() for details)
  289. */
  290.  
  291.  
  292. /*@ XContainerObject :: GetTitle( XString * s)
  293. @group title
  294. @remarks Query the title of the object;
  295. @parameters XString * buffer
  296. */
  297. void XContainerObject::GetTitle(XString * s)
  298. {
  299.    *s = title;
  300. /*
  301.     char *b = s->GetBuffer((int) strlen((char *) core->pszIcon) + 1);
  302.  
  303.     strcpy(b, (char *) core->pszIcon);
  304.     s->ReleaseBuffer();
  305. */
  306. }
  307.  
  308.  
  309. SHORT EXPENTRY SortRecord(const PRECORDCORE p1, const PRECORDCORE p2, const void *)
  310. {
  311.     XContainerObject *obj1, *obj2;
  312.  
  313.     PRECORDCORE pr = (PRECORDCORE) ((PBYTE) p1 + sizeof(RECORDCORE));
  314.  
  315.     memcpy(&obj1, pr, 4);
  316.  
  317.     pr = (PRECORDCORE) ((PBYTE) p2 + sizeof(RECORDCORE));
  318.     memcpy(&obj2, pr, 4);
  319.  
  320.     return obj1->Sort(obj2);
  321. }
  322.  
  323.  
  324. /*@ 
  325. @class XContainerInfo
  326. @type overview
  327. @symbol _
  328. @remarks XContainerInfo is a class to set/query general attributes for a XContainerControl.
  329. To make changes to the settings:
  330. <OL COMPACT>
  331. <LI>query the current setting via XContainerControl::GetInfo()
  332. <LI>make the changes in the used instance of XContainerInfo
  333. <LI>call XContainerControl::SetInfo() with the used instance of XContainerInfo
  334. </OL>
  335. */
  336.  
  337.  
  338. /*@ XContainerInfo::XContainerInfo( char * title, LONG style)
  339. @group constructors/destructors
  340. @remarks Constructor of XContainerInfo
  341. @parameters    <t '°' c=2>
  342.                     °char * theTitle           °The title of the container.
  343.                                          Default is empty.
  344.                °LONG theStyle             °style of the container. Valid styles are:
  345.                                                         <t '°' c=2>
  346.                                              °CO_TEXT                  °the container is in text-mode
  347.                                              °CO_NAME                  °the container is in name-mode
  348.                                              °CO_ICON                  °the container is in icon-mode
  349.                                              °CO_DETAIL                °the container is in detail-mode
  350.                                              °CO_FLOW                  °arrange objects dynamicaly (text and
  351.                                                                       name mode only)
  352.                                              °CO_MINI                  °the container use small icons
  353.                                              °CO_TREE                  °the container is in tree-mode
  354.                                              °CO_OWNERPAINTBACKGROUND  °the owner will draw the background
  355.                                                                       (see XBackgroundDrawEvent and
  356.                                                                        XBackgroundDrawHandler)
  357.                                              °CO_TREELINE              °draw the tree-line in tree-mode
  358.                                              °CO_DRAWBITMAP            °draw icons
  359.                                              °CO_DRAWICON              °draw bitmaps
  360.                                              °CO_TITLE                 °show the container-title
  361.                                              °CO_TITLELEFT             °title is left-justified
  362.                                              °CO_TITLERIGHT            °title is right-justified
  363.                                              °CO_TITLECENTER           °title is centered
  364.                                              °CO_TITLESEPARATOR        °the title is drawn with a separator
  365.                                              °CO_TITLEREADONLY         °the title cannot been edited by the user
  366.                                              °CO_DETAILTITLES          °in detail-mode the titles of XContainerColumn
  367.                                                                       are shown
  368.                                                            </t>
  369.                                          The attributes can be or-ed<BR>
  370.                                       Default is CO_ICON.                                             
  371.                         </t>
  372. */
  373. XContainerInfo :: XContainerInfo(char *title, LONG style)
  374. {
  375.     memset(&cnrinfo, 0, sizeof(cnrinfo));
  376.     changes = 0;
  377.  
  378.     if (title)
  379.         SetTitle(title);
  380.     if (style)
  381.         SetAttributes(style);
  382. }
  383.  
  384.  
  385. /*@ XContainerInfo :: EnableSorting( const BOOL enable)
  386. @group misc
  387. @remarks Enables sorting records when they are inserted.
  388. @parameters    BOOL sort                 Set TRUE if the container items should be sorted
  389.                                          when they are inserted. Therefor you must override the
  390.                                          method XContainerObject::Sort.
  391.                                          Default is TRUE.
  392. */
  393. void XContainerInfo::EnableSorting(const BOOL enable)
  394. {
  395.     if (enable)
  396.         cnrinfo.pSortRecord = (void *) SortRecord;
  397.     else
  398.         cnrinfo.pSortRecord = NULL;
  399.     changes |= CMA_PSORTRECORD;
  400. }
  401.  
  402.  
  403. /*@ XContainerInfo :: SetAttributes( const LONG attribute )
  404. @group set/query attributes
  405. @remarks Specify here how the container should be displayed. After you have set
  406. up the XContainerInfo use XContainerColumn::SetInfo()
  407. @parameters   LONG newAttributes         attributes how the container should be displayed ( see XContainerInfo() )
  408. */
  409. void XContainerInfo::SetAttributes(const LONG attribute)
  410. {
  411.     cnrinfo.flWindowAttr = attribute;
  412.     changes |= CMA_FLWINDOWATTR;
  413. }
  414.  
  415.  
  416. /*@ XContainerInfo :: SetTitle( const char * t )
  417. @group set/query container title
  418. @remarks Set the title of the container.
  419. @parameters    char * theTitle
  420. */
  421. void XContainerInfo::SetTitle(const char *t)
  422. {
  423.     cnrinfo.pszCnrTitle = (PSZ) t;
  424.     changes |= CMA_CNRTITLE;
  425. }
  426.  
  427.  
  428. /*@ XContainerInfo :: EnableBackgroundPainting( const BOOL enable)
  429. @group set/query attributes
  430. @remarks Enable/disable background drawing by the application. To draw the background you must install
  431. a XBackgroundDrawHandler
  432. @parameters    BOOL enable    TRUE=enable, FALSE=disable
  433. */
  434. void XContainerInfo::EnableBackgroundPainting(const BOOL enable)
  435. {
  436.     if (enable)
  437.         cnrinfo.flWindowAttr |= CA_OWNERPAINTBACKGROUND;
  438.     else
  439.     {
  440.         if (cnrinfo.flWindowAttr & CA_OWNERPAINTBACKGROUND)
  441.             cnrinfo.flWindowAttr ^= CA_OWNERPAINTBACKGROUND;
  442.     }
  443.     changes |= CMA_FLWINDOWATTR;
  444. }
  445.  
  446.  
  447. /*@ XContainerInfo :: IsBackgroundPaintingEnabled()
  448. @group set/query attributes
  449. @remarks Query if owner-draw for the background is enabled or not.
  450. @returns BOOL  result
  451. */
  452. BOOL XContainerInfo::IsBackgroundPaintingEnabled() const
  453. {
  454.     return (cnrinfo.flWindowAttr & CA_OWNERPAINTBACKGROUND ? TRUE : FALSE);
  455. }
  456.  
  457.  
  458. /*@ XContainerInfo :: SetSplitbarColumn( const XContainerColumn * col)
  459. @group splitbar
  460. @remarks Set a splitbar in a container.
  461. @parameters    XContainerColumn * theColumn    the XContainerColumn after that the splitbar will be displayed
  462. */
  463. void XContainerInfo::SetSplitbarColumn(const XContainerColumn * col)
  464. {
  465.     cnrinfo.pFieldInfoLast = col->info;
  466.     changes |= CMA_PFIELDINFOLAST;
  467. }
  468.  
  469.  
  470. /*@ XContainerInfo :: GetAttributes( void )
  471. @group set/query container title
  472. @remarks Query the attributes of the container.
  473. @returns       LONG  theAttributes       the attributes which are set for the container (can be or-ed). See XContainerInfo()
  474. */
  475. LONG XContainerInfo::GetAttributes(void) const
  476. {
  477.     return cnrinfo.flWindowAttr;
  478. }
  479.  
  480.  
  481. /*@ XContainerInfo :: GetTitle( XString * s )
  482. @group set/query container title
  483. @remarks Query the containers title
  484. @parameters    XString * theTitleBuffer    here the title will be stored
  485. */
  486. void XContainerInfo::GetTitle(XString * s)
  487. {
  488.     char *b = s->GetBuffer((int) strlen((char *) cnrinfo.pszCnrTitle) + 1);
  489.  
  490.     strcpy(b, (char *) cnrinfo.pszCnrTitle);
  491. }
  492.  
  493.  
  494. /*@ XContainerInfo :: SetSplitbarPos( const LONG pos )
  495. @group splitbar
  496. @remarks Set the position of the splitbar of a container.
  497. @parameters    LONG position             the position in window-pixels
  498. */
  499. void XContainerInfo::SetSplitbarPos(const LONG pos)
  500. {
  501.     changes |= CMA_XVERTSPLITBAR;
  502.     cnrinfo.xVertSplitbar = pos;
  503. }
  504.  
  505.  
  506. /*@ XContainerInfo::GetSplitbarPos()
  507. @group splitbar
  508. @remarks Query the position of the splitbar of a container.
  509. @returns       LONG         the position in window-pixels
  510. */
  511.  
  512.  
  513. /*@ XContainerInfo::SetTreeBitmapSize(const XSize * size)
  514. @group misc
  515. @remarks Set the size of the expanded and collapsed bitmaps/icons in tree-view
  516. @parameters XSize * size
  517. */
  518. void XContainerInfo::SetTreeBitmapSize(const XSize * size)
  519. {
  520.     changes |= CMA_SLTREEBITMAPORICON;
  521.     cnrinfo.slTreeBitmapOrIcon.cx = size->GetWidth();
  522.     cnrinfo.slTreeBitmapOrIcon.cy = size->GetHeight();
  523. }
  524.  
  525.  
  526. /*@ XContainerInfo::SetBitmapSize(const XSize * size)
  527. @group misc
  528. @remarks Set the size of bitmaps/icons
  529. @parameters XSize * size
  530. */
  531. void XContainerInfo::SetBitmapSize(const XSize * size)
  532. {
  533.     changes |= CMA_SLBITMAPORICON;
  534.     cnrinfo.slBitmapOrIcon.cx = size->GetWidth();
  535.     cnrinfo.slBitmapOrIcon.cy = size->GetHeight();
  536. }
  537.  
  538.  
  539. /*@ XContainerInfo :: GetBitmapSize( XSize * )
  540. @group misc
  541. @remarks Query the size of bitmaps/icons
  542. @parameters XSize * size    buffer to hold the size
  543. */
  544. void XContainerInfo::GetBitmapSize( XSize * s)
  545. {
  546.     s->SetWidth( cnrinfo.slBitmapOrIcon.cx );
  547.     s->SetHeight( cnrinfo.slBitmapOrIcon.cy );
  548. }
  549.  
  550.  
  551. /*@ XContainerInfo :: SetExpandedBitmap( const XBitmap * bmp)
  552. @group misc
  553. @remarks Replace the expanded-bitmap.
  554. @parameters XBitmap * the new bitmap
  555. */
  556. void XContainerInfo::SetExpandedBitmap(const XBitmap * bmp)
  557. {
  558.     changes |= CMA_TREEBITMAP;
  559.     cnrinfo.hbmExpanded = bmp->GetHandle();
  560. }
  561.  
  562.  
  563. /*@ XContainerInfo :: SetExpandedBitmap( const XIcon * ico)
  564. @group misc
  565. @remarks Replace the expanded-icon.
  566. @parameters XIcon * the new icon
  567. */
  568. void XContainerInfo::SetExpandedBitmap(const XIcon * ico)
  569. {
  570.     changes |= CMA_TREEICON;
  571.     cnrinfo.hptrExpanded = ico->GetHandle();
  572. }
  573.  
  574.  
  575. /*@ XContainerInfo :: SetCollapsedBitmap( const XBitmap * bmp)
  576. @group misc
  577. @remarks Replace the collapsed-bitmap.
  578. @parameters XBitmap * the new bitmap
  579. */
  580. void XContainerInfo::SetCollapsedBitmap(const XBitmap * bmp)
  581. {
  582.     changes |= CMA_TREEBITMAP;
  583.     cnrinfo.hbmCollapsed = bmp->GetHandle();
  584. }
  585.  
  586.  
  587. /*@ XContainerInfo :: SetCollapsedBitmap( const XIcon * ico)
  588. @group misc
  589. @remarks Replace the collapsed-icon.
  590. @parameters XIcon * the new icon
  591. */
  592. void XContainerInfo::SetCollapsedBitmap(const XIcon * ico)
  593. {
  594.     changes |= CMA_TREEICON;
  595.     cnrinfo.hptrCollapsed = ico->GetHandle();
  596. }
  597.  
  598.  
  599. /*@ XContainerInfo::GetObjectCount()
  600. @group misc
  601. @remarks Query the count of objects in the container.
  602. @returns LONG objectCount
  603. */
  604.  
  605.  
  606. /*@ XContainerInfo :: SetTreeLineWidth( const SHORT w)
  607. @group misc
  608. @remarks Set the width of the trees line in tree-view.
  609. @parameters SHORT width (in pixels)
  610. */
  611. void XContainerInfo::SetTreeLineWidth(const SHORT w)
  612. {
  613.     changes |= CMA_CXTREELINE;
  614.     cnrinfo.cxTreeLine = w;
  615. }
  616.  
  617.  
  618. /*@ XContainerInfo :: SetTreeLineSpacing( const SHORT w)
  619. @group misc
  620. @remarks Set the horizontal spacing between two levels in tree-view.
  621. @parameters SHORT width (in pixels)
  622. */
  623. void XContainerInfo::SetTreeLineSpacing(const SHORT w)
  624. {
  625.     changes |= CMA_CXTREEINDENT;
  626.     cnrinfo.cxTreeIndent = w;
  627. }
  628.  
  629.  
  630. /*@ XContainerInfo :: SetSpacing( const SHORT w)
  631. @group misc
  632. @remarks Set the vertical spacing between two objects.
  633. @parameters SHORT spacing (in pixels)
  634. */
  635. void XContainerInfo::SetSpacing(const SHORT w)
  636. {
  637.     changes |= CMA_LINESPACING;
  638.     cnrinfo.cyLineSpacing = w;
  639. }
  640.