home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / C / OTL-MC7.DMS / in.adf / classsource.lha / ClassSource / Layouter / BoopsiGadgets / LBoopsiGadgets.c
Encoding:
C/C++ Source or Header  |  1995-02-12  |  22.8 KB  |  1,098 lines

  1.  
  2. #include <classes/Layouter/BoopsiGadgets.h>
  3.  
  4. LBButtonC::LBButtonC(GadgetEventC *ev, WindowC &w,
  5.         WORD Width, WORD Height, Tag tag1type, ...)
  6.     : BButtonC(ev,w,
  7.         GA_Width, Width,
  8.         GA_Height, Height,
  9.         TAG_MORE, (struct TagItem *) &tag1type),
  10.       LGButtonC()
  11. {
  12.     aWidth = (Width == LAYOUT_AUTOSIZE);
  13.     aHeight = (Height == LAYOUT_AUTOSIZE);
  14. }
  15.  
  16. LBButtonC::LBButtonC(GadgetEventC *ev, WindowC &w,
  17.         WORD Width, WORD Height, struct TagItem *tags)
  18.     : BButtonC(ev,w,
  19.         GA_Width, Width,
  20.         GA_Height, Height,
  21.         TAG_MORE, tags),
  22.       LGButtonC()
  23. {
  24.     aWidth = (Width == LAYOUT_AUTOSIZE);
  25.     aHeight = (Height == LAYOUT_AUTOSIZE);
  26. }
  27.  
  28. BOOL LBButtonC::layoutWidth()
  29. {
  30.     return FALSE;
  31. }
  32.  
  33. BOOL LBButtonC::layoutHeight()
  34. {
  35.     return FALSE;
  36. }
  37.  
  38. VOID LBButtonC::setWidth(WORD w)
  39. {
  40.     setAttrs(GA_Width,(ULONG) w, TAG_END);
  41.     if (w == LAYOUT_AUTOSIZE)
  42.         aWidth = TRUE;
  43. }
  44.  
  45. VOID LBButtonC::setHeight(WORD h)
  46. {
  47.     setAttrs(GA_Height,(ULONG) h, TAG_END);
  48.     if (h == LAYOUT_AUTOSIZE)
  49.         aHeight = TRUE;
  50. }
  51.  
  52. // *************************************************************
  53.  
  54. LBFrButtonC::LBFrButtonC(GadgetEventC *ev, WindowC &w,
  55.         WORD Width, WORD Height, Tag tag1type, ...)
  56.     : BFrbuttonC(ev,w,
  57.         GA_Width, Width,
  58.         GA_Height, Height,
  59.         TAG_MORE, (struct TagItem *) &tag1type),
  60.       LGButtonC()
  61. {
  62.     aWidth = (Width == LAYOUT_AUTOSIZE);
  63.     aHeight = (Height == LAYOUT_AUTOSIZE);
  64. }
  65.  
  66. LBFrButtonC::LBFrButtonC(GadgetEventC *ev, WindowC &w,
  67.         WORD Width, WORD Height, struct TagItem *tags)
  68.     : BFrbuttonC(ev,w,
  69.         GA_Width, Width,
  70.         GA_Height, Height,
  71.         TAG_MORE, tags),
  72.       LGButtonC()
  73. {
  74.     aWidth = (Width == LAYOUT_AUTOSIZE);
  75.     aHeight = (Height == LAYOUT_AUTOSIZE);
  76. }
  77.  
  78. BOOL LBFrButtonC::layoutWidth()
  79. {
  80.     return FALSE;
  81. }
  82.  
  83. BOOL LBFrButtonC::layoutHeight()
  84. {
  85.     return FALSE;
  86. }
  87.  
  88. VOID LBFrButtonC::setWidth(WORD w)
  89. {
  90.     setAttrs(GA_Width,(ULONG) w, TAG_END);
  91.     if (w == LAYOUT_AUTOSIZE)
  92.         aWidth = TRUE;
  93. }
  94.  
  95. VOID LBFrButtonC::setHeight(WORD h)
  96. {
  97.     setAttrs(GA_Height,(ULONG) h, TAG_END);
  98.     if (h == LAYOUT_AUTOSIZE)
  99.         aHeight = TRUE;
  100. }
  101.  
  102. // *************************************************************
  103.  
  104. LBIButtonC::LBIButtonC(GadgetEventC *ev, WindowC &w,
  105.         WORD Width, WORD Height, Tag tag1type, ...)
  106.     : BIButtonC(ev,w,
  107.         GA_Width, Width,
  108.         GA_Height, Height,
  109.         TAG_MORE, (struct TagItem *) &tag1type),
  110.       LGButtonC()
  111. {
  112.     aWidth = (Width == LAYOUT_AUTOSIZE);
  113.     aHeight = (Height == LAYOUT_AUTOSIZE);
  114. }
  115.  
  116. LBIButtonC::LBIButtonC(GadgetEventC *ev, WindowC &w,
  117.         WORD Width, WORD Height, struct TagItem *tags)
  118.     : BIButtonC(ev,w,
  119.         GA_Width, Width,
  120.         GA_Height, Height,
  121.         TAG_MORE, tags),
  122.       LGButtonC()
  123. {
  124.     aWidth = (Width == LAYOUT_AUTOSIZE);
  125.     aHeight = (Height == LAYOUT_AUTOSIZE);
  126. }
  127.  
  128. BOOL LBIButtonC::layoutWidth()
  129. {
  130.     if (autoWidth())
  131.     {
  132.         setWidth(getAttr(IBTA_AutoWidth));
  133.     };
  134.     return TRUE;
  135. }
  136.  
  137. BOOL LBIButtonC::layoutHeight()
  138. {
  139.     if (autoHeight())
  140.     {
  141.         setHeight(getAttr(IBTA_AutoHeight));
  142.     };
  143.     return TRUE;
  144. }
  145.  
  146. VOID LBIButtonC::setWidth(WORD w)
  147. {
  148.     setAttrs(GA_Width,(ULONG) w, TAG_END);
  149.     if (w == LAYOUT_AUTOSIZE)
  150.         aWidth = TRUE;
  151. }
  152.  
  153. VOID LBIButtonC::setHeight(WORD h)
  154. {
  155.     setAttrs(GA_Height,(ULONG) h, TAG_END);
  156.     if (h == LAYOUT_AUTOSIZE)
  157.         aHeight = TRUE;
  158. }
  159.  
  160. // *************************************************************
  161.  
  162. LBStringC::LBStringC(GadgetEventC *ev, WindowC &w,
  163.         WORD Width, WORD Height, Tag tag1type, ...)
  164.     : BStringC(ev,w,
  165.         GA_Width, Width,
  166.         GA_Height, Height,
  167.         TAG_MORE, (struct TagItem *) &tag1type),
  168.       LGStringC()
  169. {
  170.     aWidth = (Width == LAYOUT_AUTOSIZE);
  171.     aHeight = (Height == LAYOUT_AUTOSIZE);
  172. }
  173.  
  174. LBStringC::LBStringC(GadgetEventC *ev, WindowC &w,
  175.         WORD Width, WORD Height, struct TagItem *tags)
  176.     : BStringC(ev,w,
  177.         GA_Width, Width,
  178.         GA_Height, Height,
  179.         TAG_MORE, tags),
  180.       LGStringC()
  181. {
  182.     aWidth = (Width == LAYOUT_AUTOSIZE);
  183.     aHeight = (Height == LAYOUT_AUTOSIZE);
  184. }
  185.  
  186. BOOL LBStringC::layoutWidth()
  187. {
  188.     if (autoWidth())
  189.     {
  190.         setWidth(getAttr(STRA_AutoWidth));
  191.     };
  192.     return TRUE;
  193. }
  194.  
  195. BOOL LBStringC::layoutHeight()
  196. {
  197.     if (autoHeight())
  198.     {
  199.         setHeight(getAttr(STRA_AutoHeight));
  200.     };
  201.     return TRUE;
  202. }
  203.  
  204. VOID LBStringC::setWidth(WORD w)
  205. {
  206.     setAttrs(GA_Width,(ULONG) w, TAG_END);
  207.     if (w == LAYOUT_AUTOSIZE)
  208.         aWidth = TRUE;
  209. }
  210.  
  211. VOID LBStringC::setHeight(WORD h)
  212. {
  213.     setAttrs(GA_Height,(ULONG) h, TAG_END);
  214.     if (h == LAYOUT_AUTOSIZE)
  215.         aHeight = TRUE;
  216. }
  217.  
  218. // *************************************************************
  219.  
  220. LBIntegerC::LBIntegerC(GadgetEventC *ev, WindowC &w,
  221.         WORD Width, WORD Height, Tag tag1type, ...)
  222.     : BIntegerC(ev,w,
  223.         GA_Width, Width,
  224.         GA_Height, Height,
  225.         TAG_MORE, (struct TagItem *) &tag1type),
  226.       LGIntegerC()
  227. {
  228.     aWidth = (Width == LAYOUT_AUTOSIZE);
  229.     aHeight = (Height == LAYOUT_AUTOSIZE);
  230. }
  231.  
  232. LBIntegerC::LBIntegerC(GadgetEventC *ev, WindowC &w,
  233.         WORD Width, WORD Height, struct TagItem *tags)
  234.     : BIntegerC(ev,w,
  235.         GA_Width, Width,
  236.         GA_Height, Height,
  237.         TAG_MORE, tags),
  238.       LGIntegerC()
  239. {
  240.     aWidth = (Width == LAYOUT_AUTOSIZE);
  241.     aHeight = (Height == LAYOUT_AUTOSIZE);
  242. }
  243.  
  244. BOOL LBIntegerC::layoutWidth()
  245. {
  246.     if (autoWidth())
  247.     {
  248.         setWidth(getAttr(STRA_AutoWidth));
  249.     };
  250.     return TRUE;
  251. }
  252.  
  253. BOOL LBIntegerC::layoutHeight()
  254. {
  255.     if (autoHeight())
  256.     {
  257.         setHeight(getAttr(STRA_AutoHeight));
  258.     };
  259.     return TRUE;
  260. }
  261.  
  262. VOID LBIntegerC::setWidth(WORD w)
  263. {
  264.     setAttrs(GA_Width,(ULONG) w, TAG_END);
  265.     if (w == LAYOUT_AUTOSIZE)
  266.         aWidth = TRUE;
  267. }
  268.  
  269. VOID LBIntegerC::setHeight(WORD h)
  270. {
  271.     setAttrs(GA_Height,(ULONG) h, TAG_END);
  272.     if (h == LAYOUT_AUTOSIZE)
  273.         aHeight = TRUE;
  274. }
  275.  
  276. // *************************************************************
  277.  
  278. LBCheckboxC::LBCheckboxC(GadgetEventC *ev, WindowC &w,
  279.         WORD Width, WORD Height, Tag tag1type, ...)
  280.     : BCheckboxC(ev,w,
  281.         GA_Width, Width,
  282.         GA_Height, Height,
  283.         TAG_MORE, (struct TagItem *) &tag1type),
  284.       LGCheckboxC()
  285. {
  286.     aWidth = (Width == LAYOUT_AUTOSIZE);
  287.     aHeight = (Height == LAYOUT_AUTOSIZE);
  288. }
  289.  
  290. LBCheckboxC::LBCheckboxC(GadgetEventC *ev, WindowC &w,
  291.         WORD Width, WORD Height, struct TagItem *tags)
  292.     : BCheckboxC(ev,w,
  293.         GA_Width, Width,
  294.         GA_Height, Height,
  295.         TAG_MORE, tags),
  296.       LGCheckboxC()
  297. {
  298.     aWidth = (Width == LAYOUT_AUTOSIZE);
  299.     aHeight = (Height == LAYOUT_AUTOSIZE);
  300. }
  301.  
  302. BOOL LBCheckboxC::layoutWidth()
  303. {
  304.     if (autoWidth())
  305.     {
  306.         setWidth(getAttr(CBA_AutoWidth));
  307.     };
  308.     return TRUE;
  309. }
  310.  
  311. BOOL LBCheckboxC::layoutHeight()
  312. {
  313.     if (autoHeight())
  314.     {
  315.         setHeight(getAttr(CBA_AutoHeight));
  316.     };
  317.     return TRUE;
  318. }
  319.  
  320. VOID LBCheckboxC::setWidth(WORD w)
  321. {
  322.     setAttrs(GA_Width,(ULONG) w, TAG_END);
  323.     if (w == LAYOUT_AUTOSIZE)
  324.         aWidth = TRUE;
  325. }
  326.  
  327. VOID LBCheckboxC::setHeight(WORD h)
  328. {
  329.     setAttrs(GA_Height,(ULONG) h, TAG_END);
  330.     if (h == LAYOUT_AUTOSIZE)
  331.         aHeight = TRUE;
  332. }
  333.  
  334. // *************************************************************
  335.  
  336. LBRadioC::LBRadioC(GadgetEventC *ev, WindowC &w,
  337.         WORD Width, WORD Height, Tag tag1type, ...)
  338.     : BRadioC(ev,w,
  339.         GA_Width, Width,
  340.         GA_Height, Height,
  341.         TAG_MORE, (struct TagItem *) &tag1type),
  342.       LGRadioC()
  343. {
  344.     aWidth = (Width == LAYOUT_AUTOSIZE);
  345.     aHeight = (Height == LAYOUT_AUTOSIZE);
  346. }
  347.  
  348. LBRadioC::LBRadioC(GadgetEventC *ev, WindowC &w,
  349.         WORD Width, WORD Height, struct TagItem *tags)
  350.     : BRadioC(ev,w,
  351.         GA_Width, Width,
  352.         GA_Height, Height,
  353.         TAG_MORE, tags),
  354.       LGRadioC()
  355. {
  356.     aWidth = (Width == LAYOUT_AUTOSIZE);
  357.     aHeight = (Height == LAYOUT_AUTOSIZE);
  358. }
  359.  
  360. BOOL LBRadioC::layoutWidth()
  361. {
  362.     if (autoWidth())
  363.     {
  364.         setWidth(getAttr(RDA_AutoWidth));
  365.     };
  366.     return TRUE;
  367. }
  368.  
  369. BOOL LBRadioC::layoutHeight()
  370. {
  371.     if (autoHeight())
  372.     {
  373.         setHeight(getAttr(RDA_AutoHeight));
  374.     };
  375.     return TRUE;
  376. }
  377.  
  378. VOID LBRadioC::setWidth(WORD w)
  379. {
  380.     setAttrs(GA_Width,(ULONG) w, TAG_END);
  381.     if (w == LAYOUT_AUTOSIZE)
  382.         aWidth = TRUE;
  383. }
  384.  
  385. VOID LBRadioC::setHeight(WORD h)
  386. {
  387.     setAttrs(GA_Height,(ULONG) h, TAG_END);
  388.     if (h == LAYOUT_AUTOSIZE)
  389.         aHeight = TRUE;
  390. }
  391.  
  392. // *************************************************************
  393.  
  394. LBCycleC::LBCycleC(GadgetEventC *ev, WindowC &w, stringarray &l,
  395.         WORD Width, WORD Height, Tag tag1type, ...)
  396.     : BCycleC(ev,w,l,
  397.         GA_Width, Width,
  398.         GA_Height, Height,
  399.         TAG_MORE, (struct TagItem *) &tag1type),
  400.       LGCycleC()
  401. {
  402.     aWidth = (Width == LAYOUT_AUTOSIZE);
  403.     aHeight = (Height == LAYOUT_AUTOSIZE);
  404. }
  405.  
  406. LBCycleC::LBCycleC(GadgetEventC *ev, WindowC &w, stringarray &l,
  407.         WORD Width, WORD Height, struct TagItem *tags)
  408.     : BCycleC(ev,w,l,
  409.         GA_Width, Width,
  410.         GA_Height, Height,
  411.         TAG_MORE, tags),
  412.       LGCycleC()
  413. {
  414.     aWidth = (Width == LAYOUT_AUTOSIZE);
  415.     aHeight = (Height == LAYOUT_AUTOSIZE);
  416. }
  417.  
  418. BOOL LBCycleC::layoutWidth()
  419. {
  420.     if (autoWidth())
  421.     {
  422.         setWidth(getAttr(CYA_AutoWidth));
  423.     };
  424.     return TRUE;
  425. }
  426.  
  427. BOOL LBCycleC::layoutHeight()
  428. {
  429.     if (autoHeight())
  430.     {
  431.         setHeight(getAttr(CYA_AutoHeight));
  432.     };
  433.     return TRUE;
  434. }
  435.  
  436. VOID LBCycleC::setWidth(WORD w)
  437. {
  438.     setAttrs(GA_Width,(ULONG) w, TAG_END);
  439.     if (w == LAYOUT_AUTOSIZE)
  440.         aWidth = TRUE;
  441. }
  442.  
  443. VOID LBCycleC::setHeight(WORD h)
  444. {
  445.     setAttrs(GA_Height,(ULONG) h, TAG_END);
  446.     if (h == LAYOUT_AUTOSIZE)
  447.         aHeight = TRUE;
  448. }
  449.  
  450. // *************************************************************
  451.  
  452. LBSliderC::LBSliderC(GadgetEventC *ev, WindowC &w,
  453.         WORD Width, WORD Height, Tag tag1type, ...)
  454.     : BSliderC(ev,w,
  455.         GA_Width, Width,
  456.         GA_Height, Height,
  457.         TAG_MORE, (struct TagItem *) &tag1type),
  458.       LGSliderC()
  459. {
  460.     aWidth = (Width == LAYOUT_AUTOSIZE);
  461.     aHeight = (Height == LAYOUT_AUTOSIZE);
  462. }
  463.  
  464. LBSliderC::LBSliderC(GadgetEventC *ev, WindowC &w,
  465.         WORD Width, WORD Height, struct TagItem *tags)
  466.     : BSliderC(ev,w,
  467.         GA_Width, Width,
  468.         GA_Height, Height,
  469.         TAG_MORE, tags),
  470.       LGSliderC()
  471. {
  472.     aWidth = (Width == LAYOUT_AUTOSIZE);
  473.     aHeight = (Height == LAYOUT_AUTOSIZE);
  474. }
  475.  
  476. BOOL LBSliderC::layoutWidth()
  477. {
  478.     if (autoWidth())
  479.     {
  480.         setWidth(getAttr(SLA_AutoWidth));
  481.     };
  482.     return TRUE;
  483. }
  484.  
  485. BOOL LBSliderC::layoutHeight()
  486. {
  487.     if (autoHeight())
  488.     {
  489.         setHeight(getAttr(SLA_AutoHeight));
  490.     };
  491.     return TRUE;
  492. }
  493.  
  494. VOID LBSliderC::setWidth(WORD w)
  495. {
  496.     setAttrs(GA_Width,(ULONG) w, TAG_END);
  497.     if (w == LAYOUT_AUTOSIZE)
  498.         aWidth = TRUE;
  499. }
  500.  
  501. VOID LBSliderC::setHeight(WORD h)
  502. {
  503.     setAttrs(GA_Height,(ULONG) h, TAG_END);
  504.     if (h == LAYOUT_AUTOSIZE)
  505.         aHeight = TRUE;
  506. }
  507.  
  508. // *************************************************************
  509.  
  510. LBScrollerC::LBScrollerC(GadgetEventC *ev, WindowC &w,
  511.         WORD Width, WORD Height, Tag tag1type, ...)
  512.     : BScrollerC(ev,w,
  513.         GA_Width, Width,
  514.         GA_Height, Height,
  515.         TAG_MORE, (struct TagItem *) &tag1type),
  516.       LGScrollerC()
  517. {
  518.     aWidth = (Width == LAYOUT_AUTOSIZE);
  519.     aHeight = (Height == LAYOUT_AUTOSIZE);
  520. }
  521.  
  522. LBScrollerC::LBScrollerC(GadgetEventC *ev, WindowC &w,
  523.         WORD Width, WORD Height, struct TagItem *tags)
  524.     : BScrollerC(ev,w,
  525.         GA_Width, Width,
  526.         GA_Height, Height,
  527.         TAG_MORE, tags),
  528.       LGScrollerC()
  529. {
  530.     aWidth = (Width == LAYOUT_AUTOSIZE);
  531.     aHeight = (Height == LAYOUT_AUTOSIZE);
  532. }
  533.  
  534. BOOL LBScrollerC::layoutWidth()
  535. {
  536.     if (autoWidth())
  537.     {
  538.         setWidth(12);
  539.     };
  540.     return TRUE;
  541. }
  542.  
  543. BOOL LBScrollerC::layoutHeight()
  544. {
  545.     if (autoHeight())
  546.     {
  547.         setHeight(12);
  548.     };
  549.     return TRUE;
  550. }
  551.  
  552. VOID LBScrollerC::setWidth(WORD w)
  553. {
  554.     BScrollerC::setWidth(w);
  555.     if (w == LAYOUT_AUTOSIZE)
  556.         aWidth = TRUE;
  557. }
  558.  
  559. VOID LBScrollerC::setHeight(WORD h)
  560. {
  561.     BScrollerC::setHeight(h);
  562.     if (h == LAYOUT_AUTOSIZE)
  563.         aHeight = TRUE;
  564. }
  565.  
  566. // *************************************************************
  567.  
  568. LBArrowScrollerC::LBArrowScrollerC(GadgetEventC *ev, WindowC &w,
  569.         WORD Width, WORD Height, Tag tag1type, ...)
  570.     : BArrowScrollerC(ev,w,
  571.         GA_Width, Width,
  572.         GA_Height, Height,
  573.         TAG_MORE, (struct TagItem *) &tag1type),
  574.       LGScrollerC()
  575. {
  576.     aWidth = (Width == LAYOUT_AUTOSIZE);
  577.     aHeight = (Height == LAYOUT_AUTOSIZE);
  578. }
  579.  
  580. LBArrowScrollerC::LBArrowScrollerC(GadgetEventC *ev, WindowC &w,
  581.         WORD Width, WORD Height, struct TagItem *tags)
  582.     : BArrowScrollerC(ev,w,
  583.         GA_Width, Width,
  584.         GA_Height, Height,
  585.         TAG_MORE, tags),
  586.       LGScrollerC()
  587. {
  588.     aWidth = (Width == LAYOUT_AUTOSIZE);
  589.     aHeight = (Height == LAYOUT_AUTOSIZE);
  590. }
  591.  
  592. BOOL LBArrowScrollerC::layoutWidth()
  593. {
  594.     if (autoWidth())
  595.     {
  596.         setWidth(getAttr(ASCA_AutoWidth));
  597.     };
  598.     return TRUE;
  599. }
  600.  
  601. BOOL LBArrowScrollerC::layoutHeight()
  602. {
  603.     if (autoHeight())
  604.     {
  605.         setHeight(getAttr(ASCA_AutoHeight));
  606.     };
  607.     return TRUE;
  608. }
  609.  
  610. VOID LBArrowScrollerC::setWidth(WORD w)
  611. {
  612.     setAttrs(GA_Width,(ULONG) w, TAG_END);
  613.     if (w == LAYOUT_AUTOSIZE)
  614.         aWidth = TRUE;
  615. }
  616.  
  617. VOID LBArrowScrollerC::setHeight(WORD h)
  618. {
  619.     setAttrs(GA_Height,(ULONG) h, TAG_END);
  620.     if (h == LAYOUT_AUTOSIZE)
  621.         aHeight = TRUE;
  622. }
  623.  
  624. // *************************************************************
  625.  
  626. LBListC::LBListC(GadgetEventC *ev, WindowC &w,
  627.         WORD Width, WORD Height, Tag tag1type, ...)
  628.     : BListC(ev,w,
  629.         GA_Width, Width,
  630.         GA_Height, Height,
  631.         TAG_MORE, (struct TagItem *) &tag1type),
  632.       LGListviewC()
  633. {
  634.     aWidth = (Width == LAYOUT_AUTOSIZE);
  635.     aHeight = (Height == LAYOUT_AUTOSIZE);
  636. }
  637.  
  638. LBListC::LBListC(GadgetEventC *ev, WindowC &w,
  639.     WORD Width, WORD Height, struct TagItem *tags)
  640.     : BListC(ev,w,
  641.         GA_Width, Width,
  642.         GA_Height, Height,
  643.         TAG_MORE, tags),
  644.       LGListviewC()
  645. {
  646.     aWidth = (Width == LAYOUT_AUTOSIZE);
  647.     aHeight = (Height == LAYOUT_AUTOSIZE);
  648. }
  649.  
  650. BOOL LBListC::layoutWidth()
  651. {
  652.     if (autoWidth())
  653.     {
  654.         setWidth(getAttr(LSA_AutoWidth));
  655.     };
  656.     return TRUE;
  657. }
  658.  
  659. BOOL LBListC::layoutHeight()
  660. {
  661.     if (autoHeight())
  662.     {
  663.         setHeight(getAttr(LSA_AutoHeight));
  664.     };
  665.     return TRUE;
  666. }
  667.  
  668. VOID LBListC::setWidth(WORD w)
  669. {
  670.     setAttrs(GA_Width,(ULONG) w, TAG_END);
  671.     if (w == LAYOUT_AUTOSIZE)
  672.         aWidth = TRUE;
  673. }
  674.  
  675. VOID LBListC::setHeight(WORD h)
  676. {
  677.     setAttrs(GA_Height,(ULONG) h, TAG_END);
  678.     if (h == LAYOUT_AUTOSIZE)
  679.         aHeight = TRUE;
  680. }
  681.  
  682. // *************************************************************
  683.  
  684. LBListviewC::LBListviewC(GadgetEventC *ev, WindowC &w,
  685.         WORD Width, WORD Height, Tag tag1type, ...)
  686.     : BListviewC(ev,w,
  687.         GA_Width, Width,
  688.         GA_Height, Height,
  689.         TAG_MORE, (struct TagItem *) &tag1type),
  690.       LGListviewC()
  691. {
  692.     aWidth = (Width == LAYOUT_AUTOSIZE);
  693.     aHeight = (Height == LAYOUT_AUTOSIZE);
  694. }
  695.  
  696. LBListviewC::LBListviewC(GadgetEventC *ev, WindowC &w,
  697.         WORD Width, WORD Height, struct TagItem *tags)
  698.     : BListviewC(ev,w,
  699.         GA_Width, Width,
  700.         GA_Height, Height,
  701.         TAG_MORE, tags),
  702.       LGListviewC()
  703. {
  704.     aWidth = (Width == LAYOUT_AUTOSIZE);
  705.     aHeight = (Height == LAYOUT_AUTOSIZE);
  706. }
  707.  
  708. BOOL LBListviewC::layoutWidth()
  709. {
  710.     if (autoWidth())
  711.     {
  712.         setWidth(getAttr(LSA_AutoWidth));
  713.     };
  714.     return TRUE;
  715. }
  716.  
  717. BOOL LBListviewC::layoutHeight()
  718. {
  719.     if (autoHeight())
  720.     {
  721.         setHeight(getAttr(LSA_AutoHeight));
  722.     };
  723.     return TRUE;
  724. }
  725.  
  726. VOID LBListviewC::setWidth(WORD w)
  727. {
  728.     setAttrs(GA_Width,(ULONG) w, TAG_END);
  729.     if (w == LAYOUT_AUTOSIZE)
  730.         aWidth = TRUE;
  731. }
  732.  
  733. VOID LBListviewC::setHeight(WORD h)
  734. {
  735.     setAttrs(GA_Height,(ULONG) h, TAG_END);
  736.     if (h == LAYOUT_AUTOSIZE)
  737.         aHeight = TRUE;
  738. }
  739.  
  740. // *************************************************************
  741.  
  742. LBTextC::LBTextC(GadgetEventC *ev, WindowC &w,
  743.         WORD Width, WORD Height, Tag tag1type, ...)
  744.     : BTextC(ev,w,
  745.         GA_Width, Width,
  746.         GA_Height, Height,
  747.         TAG_MORE, (struct TagItem *) &tag1type),
  748.       LGTextC()
  749. {
  750.     aWidth = (Width == LAYOUT_AUTOSIZE);
  751.     aHeight = (Height == LAYOUT_AUTOSIZE);
  752. }
  753.  
  754. LBTextC::LBTextC(GadgetEventC *ev, WindowC &w,
  755.         WORD Width, WORD Height, struct TagItem *tags)
  756.     : BTextC(ev,w,
  757.         GA_Width, Width,
  758.         GA_Height, Height,
  759.         TAG_MORE, tags),
  760.       LGTextC()
  761. {
  762.     aWidth = (Width == LAYOUT_AUTOSIZE);
  763.     aHeight = (Height == LAYOUT_AUTOSIZE);
  764. }
  765.  
  766. BOOL LBTextC::layoutWidth()
  767. {
  768.     if (autoWidth())
  769.     {
  770.         setWidth(getAttr(LBA_AutoWidth));
  771.     };
  772.     return TRUE;
  773. }
  774.  
  775. BOOL LBTextC::layoutHeight()
  776. {
  777.     if (autoHeight())
  778.     {
  779.         setHeight(getAttr(LBA_AutoHeight));
  780.     };
  781.     return TRUE;
  782. }
  783.  
  784. VOID LBTextC::setWidth(WORD w)
  785. {
  786.     setAttrs(GA_Width,(ULONG) w, TAG_END);
  787.     if (w == LAYOUT_AUTOSIZE)
  788.         aWidth = TRUE;
  789. }
  790.  
  791. VOID LBTextC::setHeight(WORD h)
  792. {
  793.     setAttrs(GA_Height,(ULONG) h, TAG_END);
  794.     if (h == LAYOUT_AUTOSIZE)
  795.         aHeight = TRUE;
  796. }
  797.  
  798. // *************************************************************
  799.  
  800. LBNumberC::LBNumberC(GadgetEventC *ev, WindowC &w,
  801.         WORD Width, WORD Height, Tag tag1type, ...)
  802.     : BNumberC(ev,w,
  803.         GA_Width, Width,
  804.         GA_Height, Height,
  805.         TAG_MORE, (struct TagItem *) &tag1type),
  806.       LGNumberC()
  807. {
  808.     aWidth = (Width == LAYOUT_AUTOSIZE);
  809.     aHeight = (Height == LAYOUT_AUTOSIZE);
  810. }
  811.  
  812. LBNumberC::LBNumberC(GadgetEventC *ev, WindowC &w,
  813.         WORD Width, WORD Height, struct TagItem *tags)
  814.     : BNumberC(ev,w,
  815.         GA_Width, Width,
  816.         GA_Height, Height,
  817.         TAG_MORE, tags),
  818.       LGNumberC()
  819. {
  820.     aWidth = (Width == LAYOUT_AUTOSIZE);
  821.     aHeight = (Height == LAYOUT_AUTOSIZE);
  822. }
  823.  
  824. BOOL LBNumberC::layoutWidth()
  825. {
  826.     if (autoWidth())
  827.     {
  828.         setWidth(getAttr(LBA_AutoWidth));
  829.     };
  830.     return TRUE;
  831. }
  832.  
  833. BOOL LBNumberC::layoutHeight()
  834. {
  835.     if (autoHeight())
  836.     {
  837.         setHeight(getAttr(LBA_AutoHeight));
  838.     };
  839.     return TRUE;
  840. }
  841.  
  842. VOID LBNumberC::setWidth(WORD w)
  843. {
  844.     setAttrs(GA_Width,(ULONG) w, TAG_END);
  845.     if (w == LAYOUT_AUTOSIZE)
  846.         aWidth = TRUE;
  847. }
  848.  
  849. VOID LBNumberC::setHeight(WORD h)
  850. {
  851.     setAttrs(GA_Height,(ULONG) h, TAG_END);
  852.     if (h == LAYOUT_AUTOSIZE)
  853.         aHeight = TRUE;
  854. }
  855.  
  856. // *************************************************************
  857.  
  858. LBWBIconDropC::LBWBIconDropC(GadgetEventC *ev, WindowC &w,
  859.         WORD Width, WORD Height, Tag tag1type, ...)
  860.     : BWBIconDropC(ev,w,
  861.         GA_Width, Width,
  862.         GA_Height, Height,
  863.         TAG_MORE, (struct TagItem *) &tag1type),
  864.       LayoutC()
  865. {
  866.     aWidth = (Width == LAYOUT_AUTOSIZE);
  867.     aHeight = (Height == LAYOUT_AUTOSIZE);
  868. }
  869.  
  870. LBWBIconDropC::LBWBIconDropC(GadgetEventC *ev, WindowC &w,
  871.     WORD Width, WORD Height, struct TagItem *tags)
  872.     : BWBIconDropC(ev,w,
  873.         GA_Width, Width,
  874.         GA_Height, Height,
  875.         TAG_MORE, tags),
  876.       LayoutC()
  877. {
  878.     aWidth = (Width == LAYOUT_AUTOSIZE);
  879.     aHeight = (Height == LAYOUT_AUTOSIZE);
  880. }
  881.  
  882. BOOL LBWBIconDropC::layoutWidth()
  883. {
  884.     if (autoWidth())
  885.     {
  886.         setWidth(getAttr(WBIDA_AutoWidth));
  887.     };
  888.     return TRUE;
  889. }
  890.  
  891. BOOL LBWBIconDropC::layoutHeight()
  892. {
  893.     if (autoHeight())
  894.     {
  895.         setHeight(getAttr(WBIDA_AutoHeight));
  896.     };
  897.     return TRUE;
  898. }
  899.  
  900. VOID LBWBIconDropC::setWidth(WORD w)
  901. {
  902.     setAttrs(GA_Width,(ULONG) w, TAG_END);
  903.     if (w == LAYOUT_AUTOSIZE)
  904.         aWidth = TRUE;
  905. }
  906.  
  907. VOID LBWBIconDropC::setHeight(WORD h)
  908. {
  909.     setAttrs(GA_Height,(ULONG) h, TAG_END);
  910.     if (h == LAYOUT_AUTOSIZE)
  911.         aHeight = TRUE;
  912. }
  913.  
  914. // *************************************************************
  915.  
  916. LBSplitviewC::LBSplitviewC(GadgetEventC *ev, WindowC &w,
  917.         WORD Width, WORD Height, Tag tag1type, ...)
  918.     : BSplitviewC(ev,w,
  919.         GA_Width, Width,
  920.         GA_Height, Height,
  921.         TAG_MORE, (struct TagItem *) &tag1type),
  922.       LayoutC()
  923. {
  924.     aWidth = (Width == LAYOUT_AUTOSIZE);
  925.     aHeight = (Height == LAYOUT_AUTOSIZE);
  926. }
  927.  
  928. LBSplitviewC::LBSplitviewC(GadgetEventC *ev, WindowC &w,
  929.     WORD Width, WORD Height, struct TagItem *tags)
  930.     : BSplitviewC(ev,w,
  931.         GA_Width, Width,
  932.         GA_Height, Height,
  933.         TAG_MORE, tags),
  934.       LayoutC()
  935. {
  936.     aWidth = (Width == LAYOUT_AUTOSIZE);
  937.     aHeight = (Height == LAYOUT_AUTOSIZE);
  938. }
  939.  
  940. BOOL LBSplitviewC::layoutWidth()
  941. {
  942.     if (autoWidth())
  943.     {
  944.         setWidth(4);
  945.     };
  946.     return TRUE;
  947. }
  948.  
  949. BOOL LBSplitviewC::layoutHeight()
  950. {
  951.     if (autoHeight())
  952.     {
  953.         setHeight(4);
  954.     };
  955.     return TRUE;
  956. }
  957.  
  958. VOID LBSplitviewC::setWidth(WORD w)
  959. {
  960.     setAttrs(GA_Width,(ULONG) w, TAG_END);
  961.     if (w == LAYOUT_AUTOSIZE)
  962.         aWidth = TRUE;
  963. }
  964.  
  965. VOID LBSplitviewC::setHeight(WORD h)
  966. {
  967.     setAttrs(GA_Height,(ULONG) h, TAG_END);
  968.     if (h == LAYOUT_AUTOSIZE)
  969.         aHeight = TRUE;
  970. }
  971.  
  972. // *************************************************************
  973.  
  974. SplitviewHookC::SplitviewHookC(GeometryC &splitview)
  975.     : GeometryHookC(),
  976.       splitviewGeo(splitview)
  977. {
  978. }
  979.  
  980. ULONG SplitviewHookC::layout(GeometryC *object, struct LayoutParamPkt *param)
  981. {
  982.     switch (param->command)
  983.     {
  984.         case LAYOUTC_PRELEFT:
  985.         {
  986.             if (!splitviewGeo.preLayoutX(param->count))
  987.                 return LAYOUTR_ERROR;
  988.             UWORD level = ((LBSplitviewC *) splitviewGeo.layoutObject())->getAttr(SVA_Level);
  989.             UWORD width = object->leftBorder() + object->layoutObject()->width() + object->rightBorder() + param->offset + 2;
  990.             param->coor_result = (width * level) / (65536 - level);
  991.             return LAYOUTR_OK;
  992.             break;
  993.         };
  994.         case LAYOUTC_PRERIGHT:
  995.         {
  996.             if (!splitviewGeo.preLayoutX(param->count))
  997.                 return LAYOUTR_ERROR;
  998.             UWORD level = ((LBSplitviewC *) splitviewGeo.layoutObject())->getAttr(SVA_Level);
  999.             if (level == 0)
  1000.                 return LAYOUTR_ERROR;
  1001.             UWORD width = object->leftBorder() + object->layoutObject()->width() + object->rightBorder() + param->offset + 2;
  1002.             param->coor_result = (width * (65536 - level)) / level;
  1003.             return LAYOUTR_OK;
  1004.             break;
  1005.         };
  1006.         case LAYOUTC_PRETOP:
  1007.         {
  1008.             if (!splitviewGeo.preLayoutY(param->count))
  1009.                 return LAYOUTR_ERROR;
  1010.             UWORD level = ((LBSplitviewC *) splitviewGeo.layoutObject())->getAttr(SVA_Level);
  1011.             UWORD height = object->topBorder() + object->layoutObject()->height() + object->bottomBorder() + param->offset + 2;
  1012.             param->coor_result = (height * level) / (65536 - level);
  1013.             return LAYOUTR_OK;
  1014.             break;
  1015.         };
  1016.         case LAYOUTC_PREBOTTOM:
  1017.         {
  1018.             if (!splitviewGeo.preLayoutY(param->count))
  1019.                 return LAYOUTR_ERROR;
  1020.             UWORD level = ((LBSplitviewC *) splitviewGeo.layoutObject())->getAttr(SVA_Level);
  1021.             if (level == 0)
  1022.                 return LAYOUTR_ERROR;
  1023.             UWORD height = object->topBorder() + object->layoutObject()->height() + object->bottomBorder() + param->offset + 2;
  1024.             param->coor_result = (height * (65536 - level)) / level;
  1025.             return LAYOUTR_OK;
  1026.             break;
  1027.         };
  1028.         case LAYOUTC_LEFT:
  1029.         {
  1030.             if (!splitviewGeo.layoutX(param->parentPosition,
  1031.                     param->parentSize,param->count))
  1032.                 return LAYOUTR_ERROR;
  1033.             param->coor_result = param->parentPosition +
  1034.                 ((LBSplitviewC *) splitviewGeo.layoutObject())->getAttr(SVA_RBPosition) +
  1035.                 object->layoutObject()->leftBorder() + param->offset;
  1036.             WORD margin = object->leftBorder() + object->pWidth() + object->rightBorder();
  1037.             if (margin > ((LBSplitviewC *) splitviewGeo.layoutObject())->getAttr(SVA_RBMargin))
  1038.                 ((LBSplitviewC *) splitviewGeo.layoutObject())->setAttrs(
  1039.                     SVA_RBMargin, margin,
  1040.                     TAG_END);
  1041.             return LAYOUTR_OK;
  1042.             break;
  1043.         };
  1044.         case LAYOUTC_RIGHT:
  1045.         {
  1046.             if (!splitviewGeo.layoutX(param->parentPosition,
  1047.                     param->parentSize,param->count))
  1048.                 return LAYOUTR_ERROR;
  1049.             param->coor_result = param->parentPosition +
  1050.                 ((LBSplitviewC *) splitviewGeo.layoutObject())->getAttr(SVA_LUSize) -
  1051.                 object->layoutObject()->rightBorder() + 1 + param->offset;
  1052.             WORD margin = object->leftBorder() + object->pWidth() + object->rightBorder();
  1053.             if (margin > ((LBSplitviewC *) splitviewGeo.layoutObject())->getAttr(SVA_LUMargin))
  1054.                 ((LBSplitviewC *) splitviewGeo.layoutObject())->setAttrs(
  1055.                     SVA_LUMargin, margin,
  1056.                     TAG_END);
  1057.             return LAYOUTR_OK;
  1058.             break;
  1059.         };
  1060.         case LAYOUTC_TOP:
  1061.         {
  1062.             if (!splitviewGeo.layoutY(param->parentPosition,
  1063.                     param->parentSize,param->count))
  1064.                 return LAYOUTR_ERROR;
  1065.             param->coor_result = param->parentPosition +
  1066.                 ((LBSplitviewC *) splitviewGeo.layoutObject())->getAttr(SVA_RBPosition) +
  1067.                 object->layoutObject()->topBorder() + param->offset;
  1068.             WORD margin = object->topBorder() + object->pHeight() + object->bottomBorder();
  1069.             if (margin > ((LBSplitviewC *) splitviewGeo.layoutObject())->getAttr(SVA_RBMargin))
  1070.                 ((LBSplitviewC *) splitviewGeo.layoutObject())->setAttrs(
  1071.                     SVA_RBMargin, margin,
  1072.                     TAG_END);
  1073.             return LAYOUTR_OK;
  1074.             break;
  1075.         };
  1076.         case LAYOUTC_BOTTOM:
  1077.         {
  1078.             if (!splitviewGeo.layoutY(param->parentPosition,
  1079.                     param->parentSize,param->count))
  1080.                 return LAYOUTR_ERROR;
  1081.             param->coor_result = param->parentPosition +
  1082.                 ((LBSplitviewC *) splitviewGeo.layoutObject())->getAttr(SVA_LUSize) -
  1083.                 object->layoutObject()->bottomBorder() + 1 + param->offset;
  1084.             WORD margin = object->topBorder() + object->pHeight() + object->bottomBorder();
  1085.             if (margin > ((LBSplitviewC *) splitviewGeo.layoutObject())->getAttr(SVA_LUMargin))
  1086.                 ((LBSplitviewC *) splitviewGeo.layoutObject())->setAttrs(
  1087.                     SVA_LUMargin, margin,
  1088.                     TAG_END);
  1089.             return LAYOUTR_OK;
  1090.             break;
  1091.         };
  1092.     };
  1093.     return LAYOUTR_UNKNOWN;
  1094. }
  1095.  
  1096. // *************************************************************
  1097.  
  1098.