home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / x / volume17 / xbae / part10 < prev    next >
Encoding:
Text File  |  1992-03-22  |  50.3 KB  |  1,785 lines

  1. Newsgroups: comp.sources.x
  2. Path: uunet!cis.ohio-state.edu!zaphod.mps.ohio-state.edu!mips!msi!dcmartin
  3. From: Andrew Wason <aw@bae.bellcore.com>
  4. Subject: v17i037: Xbae widgets (MOTIF), Part10/12
  5. Message-ID: <1992Mar23.180401.16340@msi.com>
  6. Originator: dcmartin@fascet
  7. Sender: dcmartin@msi.com (David C. Martin - Moderator)
  8. Organization: Molecular Simulations, Inc.
  9. References: <csx-17i028-xbae@uunet.UU.NET>
  10. Date: Mon, 23 Mar 1992 18:04:01 GMT
  11. Approved: dcmartin@msi.com
  12.  
  13. Submitted-by: Andrew Wason <aw@bae.bellcore.com>
  14. Posting-number: Volume 17, Issue 37
  15. Archive-name: xbae/part10
  16.  
  17. ---- Cut Here and feed the following to sh ----
  18. #!/bin/sh
  19. # this is Xbae.shar.10 (part 10 of Xbae)
  20. # do not concatenate these parts, unpack them in order with /bin/sh
  21. # file Xbae/src/ClipP.h continued
  22. #
  23. if test ! -r _shar_seq_.tmp; then
  24.     echo 'Please unpack part 1 first!'
  25.     exit 1
  26. fi
  27. (read Scheck
  28.  if test "$Scheck" != 10; then
  29.     echo Please unpack part "$Scheck" next!
  30.     exit 1
  31.  else
  32.     exit 0
  33.  fi
  34. ) < _shar_seq_.tmp || exit 1
  35. if test ! -f _shar_wnt_.tmp; then
  36.     echo 'x - still skipping Xbae/src/ClipP.h'
  37. else
  38. echo 'x - continuing file Xbae/src/ClipP.h'
  39. sed 's/^X//' << 'SHAR_EOF' >> 'Xbae/src/ClipP.h' &&
  40. X */
  41. X
  42. /*
  43. X * ClipP.h - Private definitions for Clip widget
  44. X */
  45. X
  46. #ifndef _ClipP_h
  47. #define _ClipP_h
  48. X
  49. /*
  50. X *  "@(#)ClipP.h    3.3 2/18/92"
  51. X */
  52. X
  53. #include <Xm/XmP.h>
  54. #include <Xbae/Clip.h>
  55. X
  56. /*
  57. X * New type for class method
  58. X */
  59. X
  60. #if defined (__cplusplus) || defined(c_plusplus)
  61. extern "C" {
  62. #endif
  63. X
  64. typedef void (*XbaeClipRedrawProc)(
  65. #if NeedFunctionPrototypes
  66. X                   Widget    /* w */
  67. #endif
  68. X                   );
  69. X
  70. #if defined (__cplusplus) || defined(c_plusplus)
  71. }
  72. #endif
  73. X
  74. /*
  75. X * New fields for the Clip widget class record
  76. X */
  77. typedef struct {
  78. X    XbaeClipRedrawProc    redraw;
  79. X    XtPointer        extension;
  80. } XbaeClipClassPart;
  81. X
  82. /*
  83. X * Full class record declaration
  84. X */
  85. typedef struct _XbaeClipClassRec {
  86. X    CoreClassPart        core_class;
  87. X    XmPrimitiveClassPart    primitive_class;
  88. X    XbaeClipClassPart        clip_class;
  89. } XbaeClipClassRec;
  90. X
  91. extern XbaeClipClassRec xbaeClipClassRec;
  92. X
  93. /*
  94. X * New inheritance constant
  95. X */
  96. #define XbaeInheritRedraw ((XbaeClipRedrawProc) _XtInherit)
  97. X
  98. /*
  99. X * New fields for the Clip widget record
  100. X */
  101. typedef struct {
  102. X    /* resources */
  103. X    XtExposeProc    expose_proc;    /* function to call on expose */
  104. X    XtCallbackList    focus_callback;    /* callbacks for when we get focus */
  105. } XbaeClipPart;
  106. X
  107. /*
  108. X * Full instance record declaration
  109. X */
  110. typedef struct _XbaeClipRec {
  111. X    CorePart        core;
  112. X    XmPrimitivePart    primitive;
  113. X    XbaeClipPart    clip;
  114. } XbaeClipRec;
  115. X
  116. #endif /* _ClipP_h */
  117. SHAR_EOF
  118. echo 'File Xbae/src/ClipP.h is complete' &&
  119. chmod 0444 Xbae/src/ClipP.h ||
  120. echo 'restore of Xbae/src/ClipP.h failed'
  121. Wc_c="`wc -c < 'Xbae/src/ClipP.h'`"
  122. test 2526 -eq "$Wc_c" ||
  123.     echo 'Xbae/src/ClipP.h: original size 2526, current size' "$Wc_c"
  124. rm -f _shar_wnt_.tmp
  125. fi
  126. # ============= Xbae/src/Matrix.h ==============
  127. if test -f 'Xbae/src/Matrix.h' -a X"$1" != X"-c"; then
  128.     echo 'x - skipping Xbae/src/Matrix.h (File already exists)'
  129.     rm -f _shar_wnt_.tmp
  130. else
  131. > _shar_wnt_.tmp
  132. echo 'x - extracting Xbae/src/Matrix.h (Text)'
  133. sed 's/^X//' << 'SHAR_EOF' > 'Xbae/src/Matrix.h' &&
  134. /*
  135. X * Copyright(c) 1992 Bell Communications Research, Inc. (Bellcore)
  136. X *                        All rights reserved
  137. X * Permission to use, copy, modify and distribute this material for
  138. X * any purpose and without fee is hereby granted, provided that the
  139. X * above copyright notice and this permission notice appear in all
  140. X * copies, and that the name of Bellcore not be used in advertising
  141. X * or publicity pertaining to this material without the specific,
  142. X * prior written permission of an authorized representative of
  143. X * Bellcore.
  144. X *
  145. X * BELLCORE MAKES NO REPRESENTATIONS AND EXTENDS NO WARRANTIES, EX-
  146. X * PRESS OR IMPLIED, WITH RESPECT TO THE SOFTWARE, INCLUDING, BUT
  147. X * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  148. X * FITNESS FOR ANY PARTICULAR PURPOSE, AND THE WARRANTY AGAINST IN-
  149. X * FRINGEMENT OF PATENTS OR OTHER INTELLECTUAL PROPERTY RIGHTS.  THE
  150. X * SOFTWARE IS PROVIDED "AS IS", AND IN NO EVENT SHALL BELLCORE OR
  151. X * ANY OF ITS AFFILIATES BE LIABLE FOR ANY DAMAGES, INCLUDING ANY
  152. X * LOST PROFITS OR OTHER INCIDENTAL OR CONSEQUENTIAL DAMAGES RELAT-
  153. X * ING TO THE SOFTWARE.
  154. X *
  155. X * MatrixWidget Author: Andrew Wason, Bellcore, aw@bae.bellcore.com
  156. X */
  157. X
  158. #ifndef _Matrix_h
  159. #define _Matrix_h
  160. X
  161. /*
  162. X *  "@(#)Matrix.h    3.7 3/11/92"
  163. X */
  164. X
  165. /*
  166. X * Matrix Widget public include file
  167. X */
  168. X
  169. #include <Xm/Xm.h>
  170. #include <X11/Core.h>
  171. X
  172. X
  173. /* Resources:
  174. X * Name            Class            RepType        Default Value
  175. X * ----            -----            -------        -------------
  176. X * boldLabels        BoldLabels        Boolean        False
  177. X * cellHighlightThickness HighlightThickness    HorizontalDimension 2
  178. X * cellMarginHeight    MarginHeight        VerticalDimension   5
  179. X * cellMarginWidth    MarginWidth        HorizontalDimension 5
  180. X * cells        Cells            StringTable    NULL
  181. X * cellShadowThickness    ShadowThickness        HorizontalDimension 2
  182. X * colors        Colors            PixelTable    NULL
  183. X * columnAlignments    Alignments        AlignmentArray    dynamic
  184. X * columnLabelAlignmentsAlignments        AlignmentArray    dynamic
  185. X * columnLabels        Labels            StringArray    NULL
  186. X * columnMaxLengths    ColumnMaxLengths    MaxLengthArray    NULL
  187. X * columnWidths        ColumnWidths        WidthArray    NULL
  188. X * columns        Columns            int        0
  189. X * enterCellCallback    Callback        Callback    NULL
  190. X * fixedColumns        FixedColumns        Dimension    0
  191. X * fixedRows        FixedRows        Dimension    0
  192. X * fontList        FontList        FontList    fixed
  193. X * leaveCellCallback    Callback        Callback    NULL
  194. X * modifyVerifyCallback    Callback        Callback    NULL
  195. X * rowLabelAlignment    Alignment        Alignment    XmALIGNMENT_END
  196. X * rowLabelWidth    RowLabelWidth        Short        dynamic
  197. X * rowLabels        Labels            StringArray    NULL
  198. X * rows            Rows            int        0
  199. X * selectCellCallback    Callback        Callback    NULL
  200. X * selectedCells    SelectedCells        BooleanTable    dynamic
  201. X * space        Space            Dimension    6
  202. X * textTranslations    Translations        TranslationTable    dynamic
  203. X * topRow        TopRow            int        0
  204. X * traverseCellCallback    Callback        Callback    NULL
  205. X * visibleColumns    VisibleColumns        Dimension    0
  206. X * visibleRows        VisibleRows        Dimension    0
  207. X */
  208. X
  209. #define XmNboldLabels "boldLabels"
  210. #define XmNcellHighlightThickness "cellHighlightThickness"
  211. #define XmNcellMarginHeight "cellMarginHeight"
  212. #define XmNcellMarginWidth "cellMarginWidth"
  213. #define XmNcellShadowThickness "cellShadowThickness"
  214. #define XmNcells "cells"
  215. #define XmNcolors "colors"
  216. #define XmNcolumnAlignments "columnAlignments"
  217. #define XmNcolumnLabelAlignments "columnLabelAlignments"
  218. #define XmNcolumnLabels "columnLabels"
  219. #define XmNcolumnMaxLengths "columnMaxLengths"
  220. #define XmNcolumnWidths "columnWidths"
  221. #define XmNeditVerifyCallback "editVerifyCallback"
  222. #define XmNenterCellCallback "enterCellCallback"
  223. #define XmNfixedColumns "fixedColumns"
  224. #define XmNfixedRows "fixedRows"
  225. #define XmNleaveCellCallback "leaveCellCallback"
  226. #define XmNrowLabelAlignment "rowLabelAlignment"
  227. #define XmNrowLabelWidth "rowLabelWidth"
  228. #define XmNrowLabels "rowLabels"
  229. #define XmNselectedCells "selectedCells"
  230. #define XmNselectCellCallback "selectCellCallback"
  231. #define XmNtopRow "topRow"
  232. #define XmNtraverseCellCallback "traverseCellCallback"
  233. #define XmNvisibleColumns "visibleColumns"
  234. #define XmNvisibleRows "visibleRows"
  235. X
  236. #define XmCAlignments "Alignments"
  237. #define XmCBoldLabels "BoldLabels"
  238. #define XmCCells "Cells"
  239. #define XmCColors "Colors"
  240. #define XmCColumnMaxLengths "ColumnMaxLengths"
  241. #define XmCColumnWidths "ColumnWidths"
  242. #define XmCFixedColumns "FixedColumns"
  243. #define XmCFixedRows "FixedRows"
  244. #define XmCLabels "Labels"
  245. #define XmCRowLabelWidth "RowLabelWidth"
  246. #define XmCSelectedCells "SelectedCells"
  247. #define XmCTopRow "TopRow"
  248. #define XmCVisibleColumns "VisibleColumns"
  249. #define XmCVisibleRows "VisibleRows"
  250. X
  251. #define XmRStringArray "StringArray"
  252. #define XmRWidthArray "WidthArray"
  253. #define XmRMaxLengthArray "MaxLengthArray"
  254. #define XmRAlignmentArray "AlignmentArray"
  255. #define XmRPixelTable "PixelTable"
  256. #define XmRBooleanTable "BooleanTable"
  257. X
  258. X
  259. /* Class record constants */
  260. X
  261. extern WidgetClass xbaeMatrixWidgetClass;
  262. X
  263. typedef struct _XbaeMatrixClassRec *XbaeMatrixWidgetClass;
  264. typedef struct _XbaeMatrixRec *XbaeMatrixWidget;
  265. X
  266. /*
  267. X * External interfaces to class methods
  268. X */
  269. X
  270. #if defined (__cplusplus) || defined(c_plusplus)
  271. #define CONST const
  272. extern "C" {
  273. #else
  274. #define CONST
  275. #endif
  276. X
  277. extern void XbaeMatrixSetCell(
  278. #if NeedFunctionPrototypes
  279. X                  Widget        /* w */,
  280. X                  int        /* row */,
  281. X                  int        /* column */,
  282. X                  CONST String    /* value */
  283. #endif
  284. X                  );
  285. X
  286. extern void XbaeMatrixEditCell(
  287. #if NeedFunctionPrototypes
  288. X                   Widget    /* w */,
  289. X                   int    /* row */,
  290. X                   int    /* column */
  291. #endif
  292. X                   );
  293. X
  294. extern void XbaeMatrixSelectCell(
  295. #if NeedFunctionPrototypes
  296. X                 Widget    /* w */,
  297. X                 int    /* row */,
  298. X                 int    /* column */
  299. #endif
  300. X                 );
  301. X
  302. extern void XbaeMatrixSelectRow(
  303. #if NeedFunctionPrototypes
  304. X                Widget    /* w */,
  305. X                int    /* row */
  306. #endif
  307. X                );
  308. X
  309. extern void XbaeMatrixSelectColumn(
  310. #if NeedFunctionPrototypes
  311. X                   Widget    /* w */,
  312. X                   int        /* column */
  313. #endif
  314. X                 );
  315. X
  316. extern void XbaeMatrixDeselectAll(
  317. #if NeedFunctionPrototypes
  318. X                 Widget    /* w */
  319. #endif
  320. X                 );
  321. X
  322. extern void XbaeMatrixDeselectCell(
  323. #if NeedFunctionPrototypes
  324. X                   Widget/* w */,
  325. X                   int    /* row */,
  326. X                   int    /* column */
  327. #endif
  328. X                 );
  329. X
  330. extern void XbaeMatrixDeselectRow(
  331. #if NeedFunctionPrototypes
  332. X                   Widget/* w */,
  333. X                   int    /* row */
  334. #endif
  335. X                 );
  336. X
  337. extern void XbaeMatrixDeselectColumn(
  338. #if NeedFunctionPrototypes
  339. X                   Widget/* w */,
  340. X                   int    /* column */
  341. #endif
  342. X                 );
  343. X
  344. extern String XbaeMatrixGetCell(
  345. #if NeedFunctionPrototypes
  346. X                Widget    /* w */,
  347. X                int    /* row */,
  348. X                int    /* column */
  349. #endif
  350. X                );
  351. X
  352. extern Boolean XbaeMatrixCommitEdit(
  353. #if NeedFunctionPrototypes
  354. X                    Widget    /* w */,
  355. X                    Boolean    /* unmap */
  356. #endif
  357. X                    );
  358. X
  359. extern void XbaeMatrixCancelEdit(
  360. #if NeedFunctionPrototypes
  361. X                 Widget        /* w */,
  362. X                 Boolean    /* unmap */
  363. #endif
  364. X                 );
  365. X
  366. X
  367. extern void XbaeMatrixAddRows(
  368. #if NeedFunctionPrototypes
  369. X                  Widget    /* w */,
  370. X                  int    /* position */,
  371. X                  String *    /* rows */,
  372. X                  String *    /* labels */,
  373. X                  Pixel *    /* colors */,
  374. X                  int    /* num_colors */
  375. #endif
  376. X                  );
  377. X
  378. extern void XbaeMatrixDeleteRows(
  379. #if NeedFunctionPrototypes
  380. X                 Widget    /* w */,
  381. X                 int    /* position */,
  382. X                 int    /* num_rows */
  383. #endif
  384. X                 );
  385. X
  386. extern void XbaeMatrixAddColumns(
  387. #if NeedFunctionPrototypes
  388. X                 Widget        /* w */,
  389. X                 int        /* position */,
  390. X                 String *    /* columns */,
  391. X                 String *    /* labels */,
  392. X                 short *    /* widths */,
  393. X                 int *        /* max_lengths */,
  394. X                 unsigned char * /* alignments */,
  395. X                 unsigned char * /* label_alignments */,
  396. X                 Pixel *    /* colors */,
  397. X                 int        /* num_columns */
  398. #endif
  399. X                 );
  400. X
  401. extern void XbaeMatrixDeleteColumns(
  402. #if NeedFunctionPrototypes
  403. X                    Widget    /* w */,
  404. X                    int        /* position */,
  405. X                    int        /* num_columns */
  406. #endif
  407. X                    );
  408. X
  409. extern void XbaeMatrixSetRowColors(
  410. #if NeedFunctionPrototypes
  411. X                   Widget    /* w */,
  412. X                   int        /* position */,
  413. X                   Pixel *    /* colors */,
  414. X                   int        /* num_colors */
  415. #endif
  416. X                   );
  417. X
  418. extern void XbaeMatrixSetColumnColors(
  419. #if NeedFunctionPrototypes
  420. X                      Widget    /* w */,
  421. X                      int    /* position */,
  422. X                      Pixel *    /* colors */,
  423. X                      int    /* num_colors */
  424. #endif
  425. X                      );
  426. X
  427. extern void XbaeMatrixSetCellColor(
  428. #if NeedFunctionPrototypes
  429. X                      Widget    /* w */,
  430. X                      int    /* row */,
  431. X                      int    /* column */,
  432. X                      Pixel    /* color */
  433. #endif
  434. X                      );
  435. X
  436. #if defined (__cplusplus) || defined(c_plusplus)
  437. }
  438. #endif
  439. #undef CONST
  440. X
  441. /*
  442. X * Callback reasons.  Try to stay out of range of the Motif XmCR_* reasons.
  443. X */
  444. typedef enum _XbaeReasonType {
  445. X    XbaeModifyVerifyReason = 102,
  446. X    XbaeEnterCellReason,
  447. X    XbaeLeaveCellReason,
  448. X    XbaeTraverseCellReason,
  449. X    XbaeSelectCellReason,
  450. } XbaeReasonType;
  451. X
  452. /*
  453. X * Struct passed to modifyVerifyCallback
  454. X */
  455. typedef struct _XbaeMatrixModifyVerifyCallbackStruct {
  456. X    XbaeReasonType reason;
  457. X    int row, column;
  458. X    XmTextVerifyCallbackStruct *verify;
  459. } XbaeMatrixModifyVerifyCallbackStruct;
  460. X
  461. /*
  462. X * Struct passed to enterCellCallback
  463. X */
  464. typedef struct _XbaeMatrixEnterCellCallbackStruct {
  465. X    XbaeReasonType reason;
  466. X    int row, column;
  467. X    Boolean doit;
  468. } XbaeMatrixEnterCellCallbackStruct;
  469. X
  470. /*
  471. X * Struct passed to leaveCellCallback
  472. X */
  473. typedef struct _XbaeMatrixLeaveCellCallbackStruct {
  474. X    XbaeReasonType reason;
  475. X    int row, column;
  476. X    String value;
  477. X    Boolean doit;
  478. } XbaeMatrixLeaveCellCallbackStruct;
  479. X
  480. /*
  481. X * Struct passed to traverseCellCallback
  482. X */
  483. typedef struct _XbaeMatrixTraverseCellCallbackStruct {
  484. X    XbaeReasonType reason;
  485. X    int row, column;
  486. X    int next_row, next_column;
  487. X    int fixed_rows, fixed_columns;
  488. X    int num_rows, num_columns;
  489. X    String param;
  490. X    XrmQuark qparam;
  491. } XbaeMatrixTraverseCellCallbackStruct;
  492. X
  493. /*
  494. X * Struct passed to selectCellCallback
  495. X */
  496. typedef struct _XbaeMatrixSelectCellCallbackStruct {
  497. X    XbaeReasonType reason;
  498. X    int row, column;
  499. X    Boolean **selected_cells;
  500. X    String **cells;
  501. X    Cardinal num_params;
  502. X    String *params;
  503. X    XEvent *event;
  504. } XbaeMatrixSelectCellCallbackStruct;
  505. X
  506. X
  507. #endif /* _Matrix_h */
  508. /* DON'T ADD STUFF AFTER THIS #endif */
  509. X
  510. SHAR_EOF
  511. chmod 0444 Xbae/src/Matrix.h ||
  512. echo 'restore of Xbae/src/Matrix.h failed'
  513. Wc_c="`wc -c < 'Xbae/src/Matrix.h'`"
  514. test 9884 -eq "$Wc_c" ||
  515.     echo 'Xbae/src/Matrix.h: original size 9884, current size' "$Wc_c"
  516. rm -f _shar_wnt_.tmp
  517. fi
  518. # ============= Xbae/src/MatrixP.h ==============
  519. if test -f 'Xbae/src/MatrixP.h' -a X"$1" != X"-c"; then
  520.     echo 'x - skipping Xbae/src/MatrixP.h (File already exists)'
  521.     rm -f _shar_wnt_.tmp
  522. else
  523. > _shar_wnt_.tmp
  524. echo 'x - extracting Xbae/src/MatrixP.h (Text)'
  525. sed 's/^X//' << 'SHAR_EOF' > 'Xbae/src/MatrixP.h' &&
  526. /*
  527. X * Copyright(c) 1992 Bell Communications Research, Inc. (Bellcore)
  528. X *                        All rights reserved
  529. X * Permission to use, copy, modify and distribute this material for
  530. X * any purpose and without fee is hereby granted, provided that the
  531. X * above copyright notice and this permission notice appear in all
  532. X * copies, and that the name of Bellcore not be used in advertising
  533. X * or publicity pertaining to this material without the specific,
  534. X * prior written permission of an authorized representative of
  535. X * Bellcore.
  536. X *
  537. X * BELLCORE MAKES NO REPRESENTATIONS AND EXTENDS NO WARRANTIES, EX-
  538. X * PRESS OR IMPLIED, WITH RESPECT TO THE SOFTWARE, INCLUDING, BUT
  539. X * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  540. X * FITNESS FOR ANY PARTICULAR PURPOSE, AND THE WARRANTY AGAINST IN-
  541. X * FRINGEMENT OF PATENTS OR OTHER INTELLECTUAL PROPERTY RIGHTS.  THE
  542. X * SOFTWARE IS PROVIDED "AS IS", AND IN NO EVENT SHALL BELLCORE OR
  543. X * ANY OF ITS AFFILIATES BE LIABLE FOR ANY DAMAGES, INCLUDING ANY
  544. X * LOST PROFITS OR OTHER INCIDENTAL OR CONSEQUENTIAL DAMAGES RELAT-
  545. X * ING TO THE SOFTWARE.
  546. X *
  547. X * MatrixWidget Author: Andrew Wason, Bellcore, aw@bae.bellcore.com
  548. X */
  549. X
  550. /*
  551. X * MatrixP.h - Private definitions for Matrix widget
  552. X */
  553. X
  554. #ifndef _MatrixP_h
  555. #define _MatrixP_h
  556. X
  557. /*
  558. X *  "@(#)MatrixP.h    3.7 3/11/92"
  559. X */
  560. X
  561. #include <Xm/XmP.h>
  562. #include <Xbae/Matrix.h>
  563. X
  564. X
  565. /*
  566. X * New types for the class methods
  567. X */
  568. X
  569. #if defined (__cplusplus) || defined(c_plusplus)
  570. #define CONST const
  571. extern "C" {
  572. #else
  573. #define CONST
  574. #endif
  575. X
  576. typedef void (*XbaeMatrixSetCellProc)(
  577. #if NeedFunctionPrototypes
  578. X                      Widget        /* w */,
  579. X                      int        /* row */,
  580. X                      int        /* column */,
  581. X                      CONST String    /* value */
  582. #endif
  583. X                      );
  584. X
  585. typedef String (*XbaeMatrixGetCellProc)(
  586. #if NeedFunctionPrototypes
  587. X                    Widget    /* w */,
  588. X                    int    /* row */,
  589. X                    int    /* column */
  590. #endif
  591. X                    );
  592. X
  593. typedef void (*XbaeMatrixEditCellProc)(
  594. #if NeedFunctionPrototypes
  595. X                       Widget    /* w */,
  596. X                       int    /* row */,
  597. X                       int    /* column */
  598. #endif
  599. X                       );
  600. X
  601. typedef void (*XbaeMatrixSelectCellProc)(
  602. #if NeedFunctionPrototypes
  603. X                     Widget    /* w */,
  604. X                     int    /* row */,
  605. X                     int    /* column */
  606. #endif
  607. X                     );
  608. X
  609. typedef void (*XbaeMatrixSelectRowProc)(
  610. #if NeedFunctionPrototypes
  611. X                     Widget    /* w */,
  612. X                     int    /* row */
  613. #endif
  614. X                     );
  615. X
  616. typedef void (*XbaeMatrixSelectColumnProc)(
  617. #if NeedFunctionPrototypes
  618. X                     Widget    /* w */,
  619. X                     int    /* column */
  620. #endif
  621. X                     );
  622. X
  623. typedef void (*XbaeMatrixDeselectAllProc)(
  624. #if NeedFunctionPrototypes
  625. X                     Widget    /* w */
  626. #endif
  627. X                     );
  628. X
  629. typedef void (*XbaeMatrixDeselectCellProc)(
  630. #if NeedFunctionPrototypes
  631. X                       Widget/* w */,
  632. X                       int    /* row */,
  633. X                       int    /* column */
  634. #endif
  635. X                     );
  636. X
  637. typedef void (*XbaeMatrixDeselectRowProc)(
  638. #if NeedFunctionPrototypes
  639. X                       Widget/* w */,
  640. X                       int    /* row */
  641. #endif
  642. X                     );
  643. X
  644. typedef void (*XbaeMatrixDeselectColumnProc)(
  645. #if NeedFunctionPrototypes
  646. X                       Widget/* w */,
  647. X                       int    /* column */
  648. #endif
  649. X                     );
  650. X
  651. typedef Boolean (*XbaeMatrixCommitEditProc)(
  652. #if NeedFunctionPrototypes
  653. X                        Widget    /* w */,
  654. X                        Boolean    /* unmap */
  655. #endif
  656. X                        );
  657. X
  658. typedef void (*XbaeMatrixCancelEditProc)(
  659. #if NeedFunctionPrototypes
  660. X                     Widget    /* w */,
  661. X                     Boolean/* unmap */
  662. #endif
  663. X                     );
  664. X
  665. typedef void (*XbaeMatrixAddRowsProc)(
  666. #if NeedFunctionPrototypes
  667. X                      Widget    /* w */,
  668. X                      int    /* position */,
  669. X                      String *     /* rows */,
  670. X                      String *     /* labels */,
  671. X                      Pixel *     /* colors */,
  672. X                      int     /* num_rows */
  673. #endif
  674. X                      );
  675. X
  676. typedef void (*XbaeMatrixDeleteRowsProc)(
  677. #if NeedFunctionPrototypes
  678. X                     Widget    /* w */,
  679. X                     int    /* position */,
  680. X                     int    /* num_rows */
  681. #endif
  682. X                     );
  683. X
  684. typedef void (*XbaeMatrixAddColumnsProc)(
  685. #if NeedFunctionPrototypes
  686. X                     Widget        /* w */,
  687. X                     int        /* position */,
  688. X                     String *    /* columns */,
  689. X                     String *    /* labels */,
  690. X                     short *    /* widths */,
  691. X                     int *        /* max_lengths */,
  692. X                     unsigned char* /* alignments */,
  693. X                     unsigned char* /* label_alignments */,
  694. X                     Pixel *    /* colors */,
  695. X                     int        /* num_columns */
  696. #endif
  697. X                     );
  698. X
  699. typedef void (*XbaeMatrixDeleteColumnsProc)(
  700. #if NeedFunctionPrototypes
  701. X                        Widget    /* w */,
  702. X                        int        /* position */,
  703. X                        int        /* num_columns */
  704. #endif
  705. X                        );
  706. X
  707. typedef void (*XbaeMatrixSetRowColorsProc)(
  708. #if NeedFunctionPrototypes
  709. X                       Widget    /* w */,
  710. X                       int        /* position */,
  711. X                       Pixel *    /* colors */,
  712. X                       int        /* num_colors */
  713. #endif
  714. X                       );
  715. X
  716. typedef void (*XbaeMatrixSetColumnColorsProc)(
  717. #if NeedFunctionPrototypes
  718. X                          Widget    /* w */,
  719. X                          int    /* position */,
  720. X                          Pixel *    /* colors */,
  721. X                          int    /* num_colors */
  722. #endif
  723. X                          );
  724. X
  725. typedef void (*XbaeMatrixSetCellColorProc)(
  726. #if NeedFunctionPrototypes
  727. X                          Widget    /* w */,
  728. X                          int    /* row */,
  729. X                          int    /* column */,
  730. X                          Pixel     /* color */
  731. #endif
  732. X                          );
  733. X
  734. #if defined (__cplusplus) || defined(c_plusplus)
  735. }
  736. #endif
  737. #undef CONST
  738. X
  739. /*
  740. X * Different than the traversal directions in Xm.h
  741. X */
  742. #define NOT_TRAVERSING    -1
  743. X
  744. /*
  745. X * New fields for the Matrix widget class record
  746. X */
  747. typedef struct {
  748. X    XbaeMatrixSetCellProc        set_cell;
  749. X    XbaeMatrixGetCellProc        get_cell;
  750. X    XbaeMatrixEditCellProc        edit_cell;
  751. X    XbaeMatrixSelectCellProc        select_cell;
  752. X    XbaeMatrixSelectRowProc        select_row;
  753. X    XbaeMatrixSelectColumnProc        select_column;
  754. X    XbaeMatrixDeselectAllProc        deselect_all;
  755. X    XbaeMatrixDeselectCellProc        deselect_cell;
  756. X    XbaeMatrixDeselectRowProc        deselect_row;
  757. X    XbaeMatrixDeselectColumnProc    deselect_column;
  758. X    XbaeMatrixCommitEditProc        commit_edit;
  759. X    XbaeMatrixCancelEditProc        cancel_edit;
  760. X    XbaeMatrixAddRowsProc        add_rows;
  761. X    XbaeMatrixDeleteRowsProc        delete_rows;
  762. X    XbaeMatrixAddColumnsProc        add_columns;
  763. X    XbaeMatrixDeleteColumnsProc        delete_columns;
  764. X    XbaeMatrixSetRowColorsProc        set_row_colors;
  765. X    XbaeMatrixSetColumnColorsProc    set_column_colors;
  766. X    XbaeMatrixSetCellColorProc        set_cell_color;
  767. X    XtPointer                extension;
  768. } XbaeMatrixClassPart;
  769. X
  770. /*
  771. X * Full class record declaration
  772. X */
  773. typedef struct _XbaeMatrixClassRec {
  774. X    CoreClassPart        core_class;
  775. X    CompositeClassPart        composite_class;
  776. X    ConstraintClassPart        constraint_class;
  777. X    XmManagerClassPart        manager_class;
  778. X    XbaeMatrixClassPart        matrix_class;
  779. } XbaeMatrixClassRec;
  780. X
  781. extern XbaeMatrixClassRec xbaeMatrixClassRec;
  782. X
  783. X
  784. /*
  785. X * Inheritance constants for set/get/edit methods
  786. X */
  787. #define XbaeInheritGetCell ((XbaeMatrixGetCellProc) _XtInherit)
  788. #define XbaeInheritSetCell ((XbaeMatrixSetCellProc) _XtInherit)
  789. #define XbaeInheritEditCell ((XbaeMatrixEditCellProc) _XtInherit)
  790. #define XbaeInheritSelectCell ((XbaeMatrixSelectCellProc) _XtInherit)
  791. #define XbaeInheritSelectRow ((XbaeMatrixSelectRowProc) _XtInherit)
  792. #define XbaeInheritSelectColumn ((XbaeMatrixSelectColumnProc) _XtInherit)
  793. #define XbaeInheritDeselectAll ((XbaeMatrixDeselectAllProc) _XtInherit)
  794. #define XbaeInheritDeselectCell ((XbaeMatrixDeselectCellProc) _XtInherit)
  795. #define XbaeInheritDeselectRow ((XbaeMatrixDeselectRowProc) _XtInherit)
  796. #define XbaeInheritDeselectColumn ((XbaeMatrixDeselectColumnProc) _XtInherit)
  797. #define XbaeInheritCommitEdit ((XbaeMatrixCommitEditProc) _XtInherit)
  798. #define XbaeInheritCancelEdit ((XbaeMatrixCancelEditProc) _XtInherit)
  799. #define XbaeInheritAddRows ((XbaeMatrixAddRowsProc) _XtInherit)
  800. #define XbaeInheritDeleteRows ((XbaeMatrixDeleteRowsProc) _XtInherit)
  801. #define XbaeInheritAddColumns ((XbaeMatrixAddColumnsProc) _XtInherit)
  802. #define XbaeInheritDeleteColumns ((XbaeMatrixDeleteColumnsProc)_XtInherit)
  803. #define XbaeInheritSetRowColors ((XbaeMatrixSetRowColorsProc)_XtInherit)
  804. #define XbaeInheritSetColumnColors ((XbaeMatrixSetColumnColorsProc)_XtInherit)
  805. #define XbaeInheritSetCellColor ((XbaeMatrixSetCellColorProc)_XtInherit)
  806. X
  807. X
  808. /*
  809. X * New data structures for the ScrollMgr code
  810. X */
  811. typedef struct _SmScrollNode {
  812. X    int x;
  813. X    int y;
  814. X    struct _SmScrollNode *next;
  815. X    struct _SmScrollNode *prev;
  816. } SmScrollNodeRec, *SmScrollNode;
  817. X
  818. typedef struct _SmScrollMgr {
  819. X    int offset_x;
  820. X    int offset_y;
  821. X    int scroll_count;
  822. X    SmScrollNode scroll_queue;
  823. X    Boolean scrolling;
  824. } SmScrollMgrRec, *SmScrollMgr;
  825. X
  826. X
  827. /*
  828. X * Data structure for column labels
  829. X */
  830. typedef struct _ColumnLabelLines {
  831. X    int lines;
  832. X    int *lengths;
  833. } ColumnLabelLinesRec, *ColumnLabelLines;
  834. X
  835. X
  836. /*
  837. X * New fields for the Matrix widget record
  838. X */
  839. typedef struct {
  840. X    /* resources */
  841. X    int        rows, columns;        /* number of cells per row/column */
  842. X    Dimension    fixed_rows,        /* number of fixed rows OR columns */
  843. X        fixed_columns;
  844. X    Pixel    **colors;        /* 2D array of Pixels */
  845. X    Dimension    visible_columns;    /* number of columns to make visible */
  846. X    Dimension    visible_rows;        /* number of rows to make visible */
  847. X    short    *column_widths;        /* width of each column in chars */
  848. X    int        *column_max_lengths;/* max length of each column in chars */
  849. X    short    row_label_width;    /* max width of row labels in chars */
  850. X
  851. X    String    **cells;        /* 2D array of strings */
  852. X    String    *row_labels;        /* array of labels next to each row */
  853. X    String    *column_labels;        /* array of labels above each column */
  854. X    unsigned char
  855. X        *column_alignments; /* alignment of each column */
  856. X    unsigned char
  857. X        *column_label_alignments; /* alignment of each column label */
  858. X    unsigned char
  859. X        row_label_alignment;/* alignment of row labels */
  860. X
  861. X    XmFontList    font_list;        /* fontList of widget and textField */
  862. X
  863. X    Dimension    space;            /* spacing for scrollbars */
  864. X    Boolean    bold_labels;        /* draw bold row/column labels */
  865. X
  866. X    Boolean    **selected_cells;   /* 2D array indicating selected cells */
  867. X
  868. X    Dimension    cell_margin_width,  /* margin resources for textField */
  869. X        cell_margin_height;
  870. X    Dimension    cell_shadow_thickness; /* shadow thickness for textField */
  871. X    Dimension    cell_highlight_thickness; /* highlight thickness for
  872. X                       * textField */
  873. X    XtTranslations
  874. X        text_translations;  /* translations for textField widget */
  875. X
  876. X    XtCallbackList
  877. X        modify_verify_callback; /* verify change to textField */
  878. X    XtCallbackList
  879. X        enter_cell_callback;/* called when a cell is entered */
  880. X    XtCallbackList
  881. X        leave_cell_callback;/* called when a cell is left */
  882. X    XtCallbackList
  883. X        traverse_cell_callback; /* determines the next cell to
  884. X                       traverse to */
  885. X    XtCallbackList
  886. X        select_cell_callback;/* called when cells are selected */
  887. X
  888. X    int        top_row;        /* vertical origin (in row space) */
  889. X
  890. X
  891. X    /* private state */
  892. X    int        horiz_origin;        /* horizontal origin (in pixel space) */
  893. X
  894. X    int        current_row,        /* row/column we are editing */
  895. X        current_column;
  896. X
  897. X    int        text_baseline;        /* baseline of text in each cell */
  898. X
  899. X    GC        draw_gc;        /* GC for drawing cells/labels */
  900. X    GC        inverse_gc;        /* GC for drawing selected cells */
  901. X    GC        draw_clip_gc;        /* GC for clipped cells/labels */
  902. X    GC        inverse_clip_gc;    /* GC for clipped selected cells */
  903. X    GC        cell_top_shadow_clip_gc; /* GC for clipped top shadow */
  904. X    GC        cell_bottom_shadow_clip_gc; /* GC for clipped bottom shadow */
  905. X
  906. X    XFontStruct    *font;            /* fontStruct from fontList */
  907. X    int        char_width;        /* average character width for font */
  908. X
  909. X    int        *column_positions;  /* pixel position of each column */
  910. X
  911. X    unsigned int cell_total_width;  /* width of cell area in pixels */
  912. X
  913. X    int        cell_visible_height; /* height of visible cell area in pixels
  914. X                    (not truncated to nearest row) */
  915. X
  916. X    Dimension    desired_width,        /* width/height widget wants to be */
  917. X        desired_height;
  918. X
  919. X    SmScrollMgr matrix_scroll_mgr,  /* ScrollMgrs for Matrix and Clip */
  920. X        clip_scroll_mgr;
  921. X
  922. X    int        traversing;        /* set to direction we are traversing,
  923. X                     * or NOT_TRAVERSING */
  924. X
  925. X    ColumnLabelLines
  926. X        column_label_lines; /* structs to handle multi line column
  927. X                     * labels */
  928. X    int        column_label_maxlines;
  929. X                    /* max # lines in column labels */
  930. X
  931. } XbaeMatrixPart;
  932. X
  933. /*
  934. X * Full instance record declaration
  935. X */
  936. typedef struct _XbaeMatrixRec {
  937. X    CorePart        core;
  938. X    CompositePart    composite;
  939. X    ConstraintPart    constraint;
  940. X    XmManagerPart    manager;
  941. X    XbaeMatrixPart    matrix;
  942. } XbaeMatrixRec;
  943. X
  944. #endif /* _MatrixP_h */
  945. SHAR_EOF
  946. chmod 0444 Xbae/src/MatrixP.h ||
  947. echo 'restore of Xbae/src/MatrixP.h failed'
  948. Wc_c="`wc -c < 'Xbae/src/MatrixP.h'`"
  949. test 12125 -eq "$Wc_c" ||
  950.     echo 'Xbae/src/MatrixP.h: original size 12125, current size' "$Wc_c"
  951. rm -f _shar_wnt_.tmp
  952. fi
  953. # ============= Xbae/src/Imakefile ==============
  954. if test -f 'Xbae/src/Imakefile' -a X"$1" != X"-c"; then
  955.     echo 'x - skipping Xbae/src/Imakefile (File already exists)'
  956.     rm -f _shar_wnt_.tmp
  957. else
  958. > _shar_wnt_.tmp
  959. echo 'x - extracting Xbae/src/Imakefile (Text)'
  960. sed 's/^X//' << 'SHAR_EOF' > 'Xbae/src/Imakefile' &&
  961. #include "../Xbae.tmpl"
  962. X
  963. X             SRCS = Matrix.c Clip.c Caption.c version.c
  964. X             OBJS = Matrix.o Clip.o Caption.o version.o
  965. X          HEADERS = Matrix.h MatrixP.h Clip.h ClipP.h Caption.h CaptionP.h
  966. X
  967. #if ProjectX < 5
  968. # We need to override this in R4 so we don't pick up system Xbae includes
  969. # due to R4 imake bug
  970. ALLINCLUDES = $(INCLUDES) $(STD_INCLUDES) $(TOP_INCLUDES) $(EXTRA_INCLUDES)
  971. #endif
  972. X
  973. X          DEFINES = -D_NO_PROTO
  974. X         INCLUDES = -I.
  975. X
  976. all::
  977. X    $(RM) Xbae
  978. X    $(LN) . Xbae
  979. X    NormalLibraryObjectRule()
  980. X
  981. NormalLibraryTarget(Xbae,$(OBJS))
  982. InstallLibrary(Xbae,$(USRLIBDIR))
  983. InstallMultiple($(HEADERS),$(INCROOT)/Xbae)
  984. X
  985. DependTarget()
  986. X
  987. clean::
  988. X    $(RM) Xbae
  989. SHAR_EOF
  990. chmod 0644 Xbae/src/Imakefile ||
  991. echo 'restore of Xbae/src/Imakefile failed'
  992. Wc_c="`wc -c < 'Xbae/src/Imakefile'`"
  993. test 676 -eq "$Wc_c" ||
  994.     echo 'Xbae/src/Imakefile: original size 676, current size' "$Wc_c"
  995. rm -f _shar_wnt_.tmp
  996. fi
  997. # ============= Xbae/examples/Mri/Mri.c ==============
  998. if test ! -d 'Xbae/examples'; then
  999.     echo 'x - creating directory Xbae/examples'
  1000.     mkdir 'Xbae/examples'
  1001. fi
  1002. if test ! -d 'Xbae/examples/Mri'; then
  1003.     echo 'x - creating directory Xbae/examples/Mri'
  1004.     mkdir 'Xbae/examples/Mri'
  1005. fi
  1006. if test -f 'Xbae/examples/Mri/Mri.c' -a X"$1" != X"-c"; then
  1007.     echo 'x - skipping Xbae/examples/Mri/Mri.c (File already exists)'
  1008.     rm -f _shar_wnt_.tmp
  1009. else
  1010. > _shar_wnt_.tmp
  1011. echo 'x - extracting Xbae/examples/Mri/Mri.c (Text)'
  1012. sed 's/^X//' << 'SHAR_EOF' > 'Xbae/examples/Mri/Mri.c' &&
  1013. /*
  1014. X * Copyright(c) 1992 Bell Communications Research, Inc. (Bellcore)
  1015. X *                        All rights reserved
  1016. X * Permission to use, copy, modify and distribute this material for
  1017. X * any purpose and without fee is hereby granted, provided that the
  1018. X * above copyright notice and this permission notice appear in all
  1019. X * copies, and that the name of Bellcore not be used in advertising
  1020. X * or publicity pertaining to this material without the specific,
  1021. X * prior written permission of an authorized representative of
  1022. X * Bellcore.
  1023. X *
  1024. X * BELLCORE MAKES NO REPRESENTATIONS AND EXTENDS NO WARRANTIES, EX-
  1025. X * PRESS OR IMPLIED, WITH RESPECT TO THE SOFTWARE, INCLUDING, BUT
  1026. X * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  1027. X * FITNESS FOR ANY PARTICULAR PURPOSE, AND THE WARRANTY AGAINST IN-
  1028. X * FRINGEMENT OF PATENTS OR OTHER INTELLECTUAL PROPERTY RIGHTS.  THE
  1029. X * SOFTWARE IS PROVIDED "AS IS", AND IN NO EVENT SHALL BELLCORE OR
  1030. X * ANY OF ITS AFFILIATES BE LIABLE FOR ANY DAMAGES, INCLUDING ANY
  1031. X * LOST PROFITS OR OTHER INCIDENTAL OR CONSEQUENTIAL DAMAGES RELAT-
  1032. X * ING TO THE SOFTWARE.
  1033. X */
  1034. X
  1035. #include <Xm/Xm.h>
  1036. #include <Wc/WcCreate.h>
  1037. #include <Xbae/Matrix.h>
  1038. #include <Xbae/Caption.h>
  1039. X
  1040. #define RCO(name, func)        WcRegisterConstructor(app, name, func)
  1041. #define RCN(name, class)    WcRegisterClassName(app, name, class)
  1042. #define RCP(name, class)    WcRegisterClassPtr(app, name, class)
  1043. X
  1044. extern void MriRegisterMotif();
  1045. X
  1046. void
  1047. main(argc, argv)
  1048. int argc;
  1049. char *argv[];
  1050. {
  1051. X    Widget toplevel;
  1052. X    XtAppContext app;
  1053. X
  1054. X    toplevel = XtAppInitialize(&app, "Mri",
  1055. X                   NULL, 0,
  1056. X                   &argc, argv,
  1057. X                   NULL,
  1058. X                   NULL, 0);
  1059. X
  1060. X    MriRegisterMotif(app);
  1061. X    
  1062. X    RCN("XbaeMatrix", xbaeMatrixWidgetClass);
  1063. X    RCP("xbaeMatrixWidgetClass", xbaeMatrixWidgetClass);
  1064. X    RCN("XbaeCaption", xbaeCaptionWidgetClass);
  1065. X    RCP("xbaeCaptionWidgetClass", xbaeCaptionWidgetClass);
  1066. X
  1067. X    WcWidgetCreation(toplevel);
  1068. X    XtRealizeWidget(toplevel);
  1069. X    XtAppMainLoop(app);
  1070. }
  1071. SHAR_EOF
  1072. chmod 0644 Xbae/examples/Mri/Mri.c ||
  1073. echo 'restore of Xbae/examples/Mri/Mri.c failed'
  1074. Wc_c="`wc -c < 'Xbae/examples/Mri/Mri.c'`"
  1075. test 1964 -eq "$Wc_c" ||
  1076.     echo 'Xbae/examples/Mri/Mri.c: original size 1964, current size' "$Wc_c"
  1077. rm -f _shar_wnt_.tmp
  1078. fi
  1079. # ============= Xbae/examples/Mri/Caption.ad ==============
  1080. if test -f 'Xbae/examples/Mri/Caption.ad' -a X"$1" != X"-c"; then
  1081.     echo 'x - skipping Xbae/examples/Mri/Caption.ad (File already exists)'
  1082.     rm -f _shar_wnt_.tmp
  1083. else
  1084. > _shar_wnt_.tmp
  1085. echo 'x - extracting Xbae/examples/Mri/Caption.ad (Text)'
  1086. sed 's/^X//' << 'SHAR_EOF' > 'Xbae/examples/Mri/Caption.ad' &&
  1087. Mri.wcChildren:        cw
  1088. X
  1089. *cw.wcClassName:    XbaeCaption
  1090. *cw.labelString:    List\nWidget\nCaption
  1091. *cw.labelAlignment:    top
  1092. *cw.labelTextAlignment:    alignment_end
  1093. *cw.wcChildren:        list
  1094. X
  1095. *list.wcConstructor:    XmCreateScrolledList
  1096. *list.itemCount:    5
  1097. *list.items:        Item one, Item two, Item three, Item four, Item five
  1098. *list.visibleItemCount:    10
  1099. SHAR_EOF
  1100. chmod 0644 Xbae/examples/Mri/Caption.ad ||
  1101. echo 'restore of Xbae/examples/Mri/Caption.ad failed'
  1102. Wc_c="`wc -c < 'Xbae/examples/Mri/Caption.ad'`"
  1103. test 329 -eq "$Wc_c" ||
  1104.     echo 'Xbae/examples/Mri/Caption.ad: original size 329, current size' "$Wc_c"
  1105. rm -f _shar_wnt_.tmp
  1106. fi
  1107. # ============= Xbae/examples/Mri/Imakefile ==============
  1108. if test -f 'Xbae/examples/Mri/Imakefile' -a X"$1" != X"-c"; then
  1109.     echo 'x - skipping Xbae/examples/Mri/Imakefile (File already exists)'
  1110.     rm -f _shar_wnt_.tmp
  1111. else
  1112. > _shar_wnt_.tmp
  1113. echo 'x - extracting Xbae/examples/Mri/Imakefile (Text)'
  1114. sed 's/^X//' << 'SHAR_EOF' > 'Xbae/examples/Mri/Imakefile' &&
  1115. #include "../../Xbae.tmpl"
  1116. X
  1117. X   LOCAL_LDFLAGS = -L../../src
  1118. X LOCAL_LIBRARIES = -lXbae -lXmp -lXm -lWc -lXt -lX11
  1119. X         DEPLIBS =
  1120. X        INCLUDES = -I../../src
  1121. X         DEFINES = -D_NO_PROTO
  1122. X
  1123. UninstalledSimpleProgramTarget(Mri)
  1124. SHAR_EOF
  1125. chmod 0644 Xbae/examples/Mri/Imakefile ||
  1126. echo 'restore of Xbae/examples/Mri/Imakefile failed'
  1127. Wc_c="`wc -c < 'Xbae/examples/Mri/Imakefile'`"
  1128. test 230 -eq "$Wc_c" ||
  1129.     echo 'Xbae/examples/Mri/Imakefile: original size 230, current size' "$Wc_c"
  1130. rm -f _shar_wnt_.tmp
  1131. fi
  1132. # ============= Xbae/examples/Mri/Matrix.ad ==============
  1133. if test -f 'Xbae/examples/Mri/Matrix.ad' -a X"$1" != X"-c"; then
  1134.     echo 'x - skipping Xbae/examples/Mri/Matrix.ad (File already exists)'
  1135.     rm -f _shar_wnt_.tmp
  1136. else
  1137. > _shar_wnt_.tmp
  1138. echo 'x - extracting Xbae/examples/Mri/Matrix.ad (Text)'
  1139. sed 's/^X//' << 'SHAR_EOF' > 'Xbae/examples/Mri/Matrix.ad' &&
  1140. Mri.wcChildren:        mw
  1141. X
  1142. *mw.wcClassName:    XbaeMatrix
  1143. *mw.rows:        5
  1144. *mw.columns:        10
  1145. *mw.visibleRows:    3
  1146. *mw.visibleColumns:    5
  1147. *mw.columnLabels:    Col1,Col2,Col3,Col4,Col5,\
  1148. X            Col6,Col7,Col8,Col9,Last\nCol10
  1149. *mw.columnWidths:    10,5,10,5,15,10,5,10,5,25
  1150. *mw.rowLabels:        Row1,Row2,Row3,Row4,Row5
  1151. X
  1152. *mw.rowLabelAlignment:         alignment_center
  1153. *mw.columnLabelAlignments:    alignment_center,\
  1154. X                alignment_beginning,\
  1155. X                alignment_beginning,\
  1156. X                alignment_end,\
  1157. X                alignment_beginning,\
  1158. X                alignment_center,\
  1159. X                alignment_end,\
  1160. X                alignment_beginning,\
  1161. X                alignment_end,\
  1162. X                alignment_center
  1163. X
  1164. *mw.columnAlignments:        alignment_center,\
  1165. X                alignment_end,\
  1166. X                alignment_beginning,\
  1167. X                alignment_center,\
  1168. X                alignment_end,\
  1169. X                alignment_beginning,\
  1170. X                alignment_beginning,\
  1171. X                alignment_end,\
  1172. X                alignment_end,\
  1173. X                alignment_center
  1174. SHAR_EOF
  1175. chmod 0644 Xbae/examples/Mri/Matrix.ad ||
  1176. echo 'restore of Xbae/examples/Mri/Matrix.ad failed'
  1177. Wc_c="`wc -c < 'Xbae/examples/Mri/Matrix.ad'`"
  1178. test 827 -eq "$Wc_c" ||
  1179.     echo 'Xbae/examples/Mri/Matrix.ad: original size 827, current size' "$Wc_c"
  1180. rm -f _shar_wnt_.tmp
  1181. fi
  1182. # ============= Xbae/examples/add/add.c ==============
  1183. if test ! -d 'Xbae/examples/add'; then
  1184.     echo 'x - creating directory Xbae/examples/add'
  1185.     mkdir 'Xbae/examples/add'
  1186. fi
  1187. if test -f 'Xbae/examples/add/add.c' -a X"$1" != X"-c"; then
  1188.     echo 'x - skipping Xbae/examples/add/add.c (File already exists)'
  1189.     rm -f _shar_wnt_.tmp
  1190. else
  1191. > _shar_wnt_.tmp
  1192. echo 'x - extracting Xbae/examples/add/add.c (Text)'
  1193. sed 's/^X//' << 'SHAR_EOF' > 'Xbae/examples/add/add.c' &&
  1194. /*
  1195. X * Copyright(c) 1992 Bell Communications Research, Inc. (Bellcore)
  1196. X *                        All rights reserved
  1197. X * Permission to use, copy, modify and distribute this material for
  1198. X * any purpose and without fee is hereby granted, provided that the
  1199. X * above copyright notice and this permission notice appear in all
  1200. X * copies, and that the name of Bellcore not be used in advertising
  1201. X * or publicity pertaining to this material without the specific,
  1202. X * prior written permission of an authorized representative of
  1203. X * Bellcore.
  1204. X *
  1205. X * BELLCORE MAKES NO REPRESENTATIONS AND EXTENDS NO WARRANTIES, EX-
  1206. X * PRESS OR IMPLIED, WITH RESPECT TO THE SOFTWARE, INCLUDING, BUT
  1207. X * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  1208. X * FITNESS FOR ANY PARTICULAR PURPOSE, AND THE WARRANTY AGAINST IN-
  1209. X * FRINGEMENT OF PATENTS OR OTHER INTELLECTUAL PROPERTY RIGHTS.  THE
  1210. X * SOFTWARE IS PROVIDED "AS IS", AND IN NO EVENT SHALL BELLCORE OR
  1211. X * ANY OF ITS AFFILIATES BE LIABLE FOR ANY DAMAGES, INCLUDING ANY
  1212. X * LOST PROFITS OR OTHER INCIDENTAL OR CONSEQUENTIAL DAMAGES RELAT-
  1213. X * ING TO THE SOFTWARE.
  1214. X */
  1215. X
  1216. #include <stdio.h>
  1217. #include <Xm/Form.h>
  1218. #include <Xm/RowColumn.h>
  1219. #include <Xm/PushB.h>
  1220. #include <Xm/Scale.h>
  1221. #include <Xbae/Matrix.h>
  1222. X
  1223. /*
  1224. X * Add multiple rows or columns at a time.
  1225. X * Use option menu to choose whether to add rows or columns.
  1226. X * Use the scale to choose how many to add.
  1227. X * Select a cell with Shift-Button1 to select the row or column to add after.
  1228. X */
  1229. X
  1230. void LoadMatrix();
  1231. void RowOrientationCB(), ColumnOrientationCB(), AddCB(), SetNumberCB();
  1232. void SetPositionCB();
  1233. X
  1234. typedef enum {
  1235. X    RowOrientation,
  1236. X    ColumnOrientation
  1237. } Orientation;
  1238. typedef struct {
  1239. X    Widget matrix;
  1240. X    Orientation orientation;
  1241. X    int number;
  1242. X    int row, column;
  1243. X    int num_rows, num_columns;
  1244. } AddDataRec, *AddData;
  1245. X
  1246. main(argc, argv)
  1247. int argc;
  1248. char *argv[];
  1249. {
  1250. X    Widget toplevel, form, rc, menu, row, column, option, number, add;
  1251. X    AddDataRec addData;
  1252. X    XtAppContext app;
  1253. X    Arg args[2];
  1254. X    int n;
  1255. X
  1256. X    toplevel = XtVaAppInitialize(&app, "Add",
  1257. X                 NULL, 0,
  1258. X                 &argc, argv,
  1259. X                 NULL,
  1260. X                 NULL);
  1261. X
  1262. X    /*
  1263. X     * Create a Form to hold everything
  1264. X     */
  1265. X    form = XtCreateManagedWidget("form",
  1266. X                                 xmFormWidgetClass,     toplevel,
  1267. X                                 NULL, 0);
  1268. X
  1269. X    rc = XtCreateManagedWidget("rc",
  1270. X                   xmRowColumnWidgetClass,     form,
  1271. X                   NULL, 0);
  1272. X
  1273. X    /*
  1274. X     * Create a menu for use in an OptionMenu
  1275. X     */
  1276. X    menu = XmCreatePulldownMenu(rc, "menu", NULL, 0);
  1277. X
  1278. X    /*
  1279. X     * Create a menu button to select row orientation
  1280. X     */
  1281. X    row = XtVaCreateManagedWidget("row",
  1282. X                  xmPushButtonWidgetClass,    menu,
  1283. X                  NULL);
  1284. X    XtAddCallback(row, XmNactivateCallback, RowOrientationCB,
  1285. X          (XtPointer)&addData);
  1286. X
  1287. X    /*
  1288. X     * Create a menu button to select column orientation
  1289. X     */
  1290. X    column = XtVaCreateManagedWidget("column",
  1291. X                     xmPushButtonWidgetClass,   menu,
  1292. X                     NULL);
  1293. X    XtAddCallback(column, XmNactivateCallback, ColumnOrientationCB,
  1294. X          (XtPointer)&addData);
  1295. X
  1296. X    /*
  1297. X     * Setup and create the option menu
  1298. X     */
  1299. X    n = 0;
  1300. X    XtSetArg(args[n], XmNsubMenuId, menu);        n++;
  1301. X    XtSetArg(args[n], XmNmenuHistory, row);        n++;
  1302. X    option = XmCreateOptionMenu(rc, "option", args, n);
  1303. X    XtManageChild(option);
  1304. X
  1305. X    addData.orientation = RowOrientation;
  1306. X
  1307. X    /*
  1308. X     * Create a scale to determine how many to add
  1309. X     */
  1310. X    number = XtVaCreateManagedWidget("number",
  1311. X                     xmScaleWidgetClass,rc,
  1312. X                     XmNvalue,        1,
  1313. X                     XmNleftAttachment,    XmATTACH_WIDGET,
  1314. X                     XmNleftWidget,    option,
  1315. X                     XmNbottomAttachment,XmATTACH_OPPOSITE_WIDGET,
  1316. X                     XmNbottomWidget,    option,
  1317. X                     NULL);
  1318. X    XtAddCallback(number, XmNvalueChangedCallback, SetNumberCB,
  1319. X          (XtPointer)&addData);
  1320. X    addData.number = 1;
  1321. X
  1322. X    /*
  1323. X     * Create a button to do the adding
  1324. X     */
  1325. X    add = XtVaCreateManagedWidget("add",
  1326. X                  xmPushButtonWidgetClass,rc,
  1327. X                  XmNleftAttachment,    XmATTACH_WIDGET,
  1328. X                  XmNleftWidget,    number,
  1329. X                  XmNbottomAttachment,XmATTACH_OPPOSITE_WIDGET,
  1330. X                  XmNbottomWidget,    number,
  1331. X                  NULL);
  1332. X    XtAddCallback(add, XmNactivateCallback, AddCB, (XtPointer)&addData);
  1333. X
  1334. X    /*
  1335. X     * Create a Matrix widget.
  1336. X     */
  1337. X    addData.matrix =
  1338. X    XtVaCreateManagedWidget("mw",
  1339. X                xbaeMatrixWidgetClass,    form,
  1340. X                XmNleftAttachment,    XmATTACH_FORM,
  1341. X                XmNrightAttachment,    XmATTACH_FORM,
  1342. X                XmNbottomAttachment,    XmATTACH_FORM,
  1343. X                  XmNtopAttachment,    XmATTACH_WIDGET,
  1344. X                  XmNtopWidget,        rc,
  1345. X                NULL);
  1346. X    XtAddCallback(addData.matrix, XmNselectCellCallback, SetPositionCB,
  1347. X          (XtPointer)&addData);
  1348. X    XtVaGetValues(addData.matrix,
  1349. X          XmNrows, &addData.num_rows,
  1350. X          XmNcolumns, &addData.num_columns,
  1351. X          NULL);
  1352. X    addData.row = 0;
  1353. X    addData.column = 0;
  1354. X
  1355. X    /*
  1356. X     * Load the matrix with default values
  1357. X     */
  1358. X    LoadMatrix(&addData);
  1359. X
  1360. X    XtRealizeWidget(toplevel);
  1361. X    XtAppMainLoop(app);
  1362. }
  1363. X
  1364. /* ARGSUSED */
  1365. void
  1366. RowOrientationCB(w, addData, call_data)
  1367. Widget w;
  1368. AddData addData;
  1369. XXtPointer call_data;
  1370. {
  1371. X    if (addData->orientation != RowOrientation) {
  1372. X    addData->orientation = RowOrientation;
  1373. X    XbaeMatrixDeselectColumn(addData->matrix, addData->column);
  1374. X    }
  1375. }
  1376. X
  1377. /* ARGSUSED */
  1378. void
  1379. ColumnOrientationCB(w, addData, call_data)
  1380. Widget w;
  1381. AddData addData;
  1382. XXtPointer call_data;
  1383. {
  1384. X    if (addData->orientation != ColumnOrientation) {
  1385. X    addData->orientation = ColumnOrientation;
  1386. X    XbaeMatrixDeselectRow(addData->matrix, addData->row);
  1387. X    }
  1388. }
  1389. X
  1390. /* ARGSUSED */
  1391. void
  1392. AddCB(w, addData, call_data)
  1393. Widget w;
  1394. AddData addData;
  1395. XXtPointer call_data;
  1396. {
  1397. X    String *rows, *columns;
  1398. X    short *widths;
  1399. X    char buf[BUFSIZ];
  1400. X    int i, j, length;
  1401. X
  1402. X    /*
  1403. X     * Add rows or columns
  1404. X     */
  1405. X    switch (addData->orientation) {
  1406. X
  1407. X    case RowOrientation:
  1408. X    rows = (String *) XtMalloc(addData->num_columns * addData->number *
  1409. X                   sizeof(String));
  1410. X    for (i = 0; i < addData->number; i++)
  1411. X        for (j = 0; j < addData->num_columns; j++) {
  1412. X        sprintf(buf, "addrow %d, %d", i, j);
  1413. X        rows[i * addData->num_columns + j] = XtNewString(buf);
  1414. X        }
  1415. X
  1416. X    XbaeMatrixAddRows(addData->matrix, addData->row + 1, rows, NULL, NULL,
  1417. X              addData->number);
  1418. X
  1419. X    length = addData->num_columns * addData->number;
  1420. X    for (i = 0; i < length; i++)
  1421. X        XtFree(rows[i]);
  1422. X    XtFree((XtPointer)rows);
  1423. X
  1424. X    addData->num_rows += addData->number;
  1425. X    break;
  1426. X
  1427. X    case ColumnOrientation:
  1428. X    widths = (short *) XtMalloc(addData->number * sizeof(short));
  1429. X    for (i = 0; i < addData->number; i++)
  1430. X        widths[i] = 15;
  1431. X    
  1432. X    columns = (String *) XtMalloc(addData->num_rows * addData->number *
  1433. X                      sizeof(String));
  1434. X    for (i = 0; i < addData->num_rows; i++)
  1435. X        for (j = 0; j < addData->number; j++) {
  1436. X        sprintf(buf, "addcol %d, %d", i, j);
  1437. X        columns[i * addData->number + j] = XtNewString(buf);
  1438. X        }
  1439. X
  1440. X    XbaeMatrixAddColumns(addData->matrix, addData->column + 1, columns,
  1441. X                 NULL, widths, NULL, NULL, NULL, NULL,
  1442. X                 addData->number);
  1443. X
  1444. X    XtFree((XtPointer)widths);
  1445. X    length = addData->num_rows * addData->number;
  1446. X    for (i = 0; i < length; i++)
  1447. X        XtFree(columns[i]);
  1448. X    XtFree((XtPointer)columns);
  1449. X
  1450. X    addData->num_columns += addData->number;
  1451. X    break;
  1452. X    }
  1453. }
  1454. X
  1455. /* ARGSUSED */
  1456. void
  1457. SetNumberCB(w, addData, call_data)
  1458. Widget w;
  1459. AddData addData;
  1460. XXmScaleCallbackStruct *call_data;
  1461. {
  1462. X    addData->number = call_data->value;
  1463. }
  1464. X
  1465. /* ARGSUSED */
  1466. void
  1467. SetPositionCB(w, addData, call_data)
  1468. Widget w;
  1469. AddData addData;
  1470. XXbaeMatrixSelectCellCallbackStruct *call_data;
  1471. {
  1472. X    switch (addData->orientation) {
  1473. X    case RowOrientation:
  1474. X    XbaeMatrixDeselectRow(addData->matrix, addData->row);
  1475. X    addData->row = call_data->row;
  1476. X    addData->column = call_data->column;
  1477. X    XbaeMatrixSelectRow(addData->matrix, addData->row);
  1478. X    break;
  1479. X    case ColumnOrientation:
  1480. X    XbaeMatrixDeselectColumn(addData->matrix, addData->column);
  1481. X    addData->row = call_data->row;
  1482. X    addData->column = call_data->column;
  1483. X    XbaeMatrixSelectColumn(addData->matrix, addData->column);
  1484. X    break;
  1485. X    }
  1486. }
  1487. X
  1488. void
  1489. LoadMatrix(addData)
  1490. AddData addData;
  1491. {
  1492. X    int i, j;
  1493. X    char buf[BUFSIZ];
  1494. X    String *rowArrays, **cells;
  1495. X
  1496. X    cells = (String **)XtMalloc(addData->num_rows * sizeof(String *));
  1497. X    rowArrays = (String *)XtMalloc(addData->num_rows * addData->num_columns *
  1498. X                   sizeof(String));
  1499. X
  1500. X    for (i = 0; i < addData->num_rows; i++) {
  1501. X    cells[i] = &rowArrays[i * addData->num_columns];
  1502. X        for (j = 0; j < addData->num_columns; j++) {
  1503. X        sprintf(buf, "%d, %d", i, j);
  1504. X        rowArrays[i * addData->num_columns + j] = XtNewString(buf);
  1505. X        }
  1506. X    }
  1507. X
  1508. X    XtVaSetValues(addData->matrix,
  1509. X          XmNcells,    cells,
  1510. X          NULL);
  1511. X
  1512. X    for (i = 0; i < addData->num_rows; i++)
  1513. X    for (j = 0; j < addData->num_columns; j++)
  1514. X        XtFree(rowArrays[i * addData->num_columns + j]);
  1515. X
  1516. X    XtFree((XtPointer) rowArrays);
  1517. X    XtFree((XtPointer) cells);
  1518. }
  1519. SHAR_EOF
  1520. chmod 0644 Xbae/examples/add/add.c ||
  1521. echo 'restore of Xbae/examples/add/add.c failed'
  1522. Wc_c="`wc -c < 'Xbae/examples/add/add.c'`"
  1523. test 8694 -eq "$Wc_c" ||
  1524.     echo 'Xbae/examples/add/add.c: original size 8694, current size' "$Wc_c"
  1525. rm -f _shar_wnt_.tmp
  1526. fi
  1527. # ============= Xbae/examples/add/Add.ad ==============
  1528. if test -f 'Xbae/examples/add/Add.ad' -a X"$1" != X"-c"; then
  1529.     echo 'x - skipping Xbae/examples/add/Add.ad (File already exists)'
  1530.     rm -f _shar_wnt_.tmp
  1531. else
  1532. > _shar_wnt_.tmp
  1533. echo 'x - extracting Xbae/examples/add/Add.ad (Text)'
  1534. sed 's/^X//' << 'SHAR_EOF' > 'Xbae/examples/add/Add.ad' &&
  1535. *rc.orientation:    horizontal
  1536. X
  1537. *number.showValue:    True
  1538. *number.orientation:    horizontal
  1539. *number.maximum:    10
  1540. X
  1541. *add.labelString:    Add
  1542. *row.labelString:    Add rows
  1543. *column.labelString:    Add columns
  1544. X
  1545. *mw.rows:        7
  1546. *mw.columns:        5
  1547. *mw.columnWidths:    15, 15, 15, 15, 15
  1548. *mw.translations:    #override\n\
  1549. X            Shift <Btn1Down>:    SelectCell()
  1550. SHAR_EOF
  1551. chmod 0644 Xbae/examples/add/Add.ad ||
  1552. echo 'restore of Xbae/examples/add/Add.ad failed'
  1553. Wc_c="`wc -c < 'Xbae/examples/add/Add.ad'`"
  1554. test 320 -eq "$Wc_c" ||
  1555.     echo 'Xbae/examples/add/Add.ad: original size 320, current size' "$Wc_c"
  1556. rm -f _shar_wnt_.tmp
  1557. fi
  1558. # ============= Xbae/examples/add/Imakefile ==============
  1559. if test -f 'Xbae/examples/add/Imakefile' -a X"$1" != X"-c"; then
  1560.     echo 'x - skipping Xbae/examples/add/Imakefile (File already exists)'
  1561.     rm -f _shar_wnt_.tmp
  1562. else
  1563. > _shar_wnt_.tmp
  1564. echo 'x - extracting Xbae/examples/add/Imakefile (Text)'
  1565. sed 's/^X//' << 'SHAR_EOF' > 'Xbae/examples/add/Imakefile' &&
  1566. #include "../../Xbae.tmpl"
  1567. X
  1568. X   LOCAL_LDFLAGS = -L../../src
  1569. X LOCAL_LIBRARIES = -lXbae -lXm -lXt -lX11
  1570. X         DEPLIBS =
  1571. X        INCLUDES = -I../../src
  1572. X         DEFINES = -D_NO_PROTO
  1573. X
  1574. UninstalledSimpleProgramTarget(add)
  1575. SHAR_EOF
  1576. chmod 0644 Xbae/examples/add/Imakefile ||
  1577. echo 'restore of Xbae/examples/add/Imakefile failed'
  1578. Wc_c="`wc -c < 'Xbae/examples/add/Imakefile'`"
  1579. test 219 -eq "$Wc_c" ||
  1580.     echo 'Xbae/examples/add/Imakefile: original size 219, current size' "$Wc_c"
  1581. rm -f _shar_wnt_.tmp
  1582. fi
  1583. # ============= Xbae/examples/caption/Caption.ad ==============
  1584. if test ! -d 'Xbae/examples/caption'; then
  1585.     echo 'x - creating directory Xbae/examples/caption'
  1586.     mkdir 'Xbae/examples/caption'
  1587. fi
  1588. if test -f 'Xbae/examples/caption/Caption.ad' -a X"$1" != X"-c"; then
  1589.     echo 'x - skipping Xbae/examples/caption/Caption.ad (File already exists)'
  1590.     rm -f _shar_wnt_.tmp
  1591. else
  1592. > _shar_wnt_.tmp
  1593. echo 'x - extracting Xbae/examples/caption/Caption.ad (Text)'
  1594. sed 's/^X//' << 'SHAR_EOF' > 'Xbae/examples/caption/Caption.ad' &&
  1595. *button1.labelString:        Text, caption right
  1596. *button2.labelString:        ButtonBox, caption top center
  1597. *button3.labelString:        ButtonBox, multiline caption left
  1598. *button4.labelString:        Text, caption left
  1599. *button5.labelString:        Double toggle boxes
  1600. X
  1601. !
  1602. ! Caption 1 example
  1603. !
  1604. X
  1605. *caption1.allowShellResize:    True
  1606. *caption1*fontList:        -adobe-helvetica-*-r-*-*-*-180-*-*-*-*-*-*
  1607. *caption1*text.resizeWidth:    True
  1608. X
  1609. *caption1*cw.labelString:    Caption
  1610. *caption1*cw.labelPosition:    right
  1611. *caption1*cw.labelAlignment:    center
  1612. *caption1*cw.spacing:        30
  1613. X
  1614. X
  1615. X
  1616. !
  1617. ! Caption 2 example
  1618. !
  1619. X
  1620. *caption2*fontList:        -adobe-helvetica-*-r-*-*-*-180-*-*-*-*-*-*
  1621. X
  1622. ! Position the caption at the to center of the Frame and offset it
  1623. ! so that it overlaps slightly.
  1624. *caption2*cw.wcClassName:    XbaeCaption
  1625. *caption2*cw.labelString:    Caption
  1626. *caption2*cw.labelPosition:    top
  1627. *caption2*cw.labelAlignment:    center
  1628. *caption2*cw.labelOffset:    -15
  1629. X
  1630. *caption2*cw.Offset:        10
  1631. *caption2*cw.leftAttachment:    attach_form
  1632. *caption2*cw.rightAttachment:    attach_form
  1633. *caption2*cw.bottomAttachment:    attach_form
  1634. *caption2*cw.topAttachment:    attach_form
  1635. X
  1636. *caption2*frame.marginWidth:    15
  1637. *caption2*frame.marginHeight:    15
  1638. *caption2*frame.shadowThickness:4
  1639. X
  1640. *caption2*rc.orientation:    vertical
  1641. X
  1642. *caption2*button.labelString:    PushButton
  1643. X
  1644. X
  1645. X
  1646. !
  1647. ! Caption 3 example
  1648. !
  1649. X
  1650. *caption3*fontList:        -adobe-helvetica-*-r-*-*-*-180-*-*-*-*-*-*
  1651. X
  1652. *caption3*cw.wcClassName:    XbaeCaption
  1653. *caption3*cw.labelString:    Multi\nLine\nCaption
  1654. *caption3*cw.labelPosition:    left
  1655. *caption3*cw.labelAlignment:    top
  1656. *caption3*cw.labelOffset:    5
  1657. *caption3*cw.labelTextAlignment:alignment_end
  1658. X
  1659. *caption3*cw.Offset:        10
  1660. *caption3*cw.leftAttachment:    attach_form
  1661. *caption3*cw.rightAttachment:    attach_form
  1662. *caption3*cw.bottomAttachment:    attach_form
  1663. *caption3*cw.topAttachment:    attach_form
  1664. X
  1665. *caption3*frame.marginWidth:    15
  1666. *caption3*frame.marginHeight:    15
  1667. *caption3*frame.shadowThickness:4
  1668. X
  1669. *caption3*rc.orientation:    vertical
  1670. X
  1671. *caption3*button.labelString:    PushButton
  1672. X
  1673. X
  1674. X
  1675. !
  1676. ! Caption 4 example
  1677. !
  1678. X
  1679. *caption4*fontList:        -adobe-helvetica-*-r-*-*-*-180-*-*-*-*-*-*
  1680. *caption4*cw.labelString:    Caption:
  1681. *caption4*cw.labelOffset:    5
  1682. *caption4*text.columns:        10
  1683. X
  1684. X
  1685. X
  1686. !
  1687. ! Caption 5 example
  1688. !
  1689. X
  1690. *caption5*fontList:        -adobe-helvetica-*-r-*-*-*-180-*-*-*-*-*-*
  1691. X
  1692. *caption5*cw1.labelString:    ToggleBox 1
  1693. *caption5*cw1.labelPosition:top
  1694. *caption5*cw1.labelAlignment:left
  1695. *caption5*cw1.labelOffset:    -15
  1696. X
  1697. *caption5*cw1.Offset:        10
  1698. *caption5*cw1.leftAttachment:    attach_form
  1699. *caption5*cw1.rightAttachment:    attach_form
  1700. *caption5*cw1.topAttachment:    attach_form
  1701. *caption5*cw1.bottomAttachment:    attach_position
  1702. *caption5*cw1.bottomPosition:    50
  1703. X
  1704. *caption5*cw2.labelString:    ToggleBox 2
  1705. *caption5*cw2.labelPosition:    top
  1706. *caption5*cw2.labelAlignment:    left
  1707. *caption5*cw2.labelOffset:    -15
  1708. X
  1709. *caption5*cw2.Offset:        10
  1710. *caption5*cw2.leftAttachment:    attach_form
  1711. *caption5*cw2.rightAttachment:    attach_form
  1712. *caption5*cw2.bottomAttachment:    attach_form
  1713. *caption5*cw2.topAttachment:    attach_position
  1714. *caption5*cw2.topPosition:    50
  1715. X
  1716. *caption5*frame.marginWidth:    15
  1717. *caption5*frame.marginHeight:    15
  1718. *caption5*frame.shadowThickness:4
  1719. X
  1720. *caption5*button.labelString:    Toggle
  1721. SHAR_EOF
  1722. chmod 0644 Xbae/examples/caption/Caption.ad ||
  1723. echo 'restore of Xbae/examples/caption/Caption.ad failed'
  1724. Wc_c="`wc -c < 'Xbae/examples/caption/Caption.ad'`"
  1725. test 3099 -eq "$Wc_c" ||
  1726.     echo 'Xbae/examples/caption/Caption.ad: original size 3099, current size' "$Wc_c"
  1727. rm -f _shar_wnt_.tmp
  1728. fi
  1729. # ============= Xbae/examples/caption/caption.c ==============
  1730. if test -f 'Xbae/examples/caption/caption.c' -a X"$1" != X"-c"; then
  1731.     echo 'x - skipping Xbae/examples/caption/caption.c (File already exists)'
  1732.     rm -f _shar_wnt_.tmp
  1733. else
  1734. > _shar_wnt_.tmp
  1735. echo 'x - extracting Xbae/examples/caption/caption.c (Text)'
  1736. sed 's/^X//' << 'SHAR_EOF' > 'Xbae/examples/caption/caption.c' &&
  1737. /*
  1738. X * Copyright(c) 1992 Bell Communications Research, Inc. (Bellcore)
  1739. X *                        All rights reserved
  1740. X * Permission to use, copy, modify and distribute this material for
  1741. X * any purpose and without fee is hereby granted, provided that the
  1742. X * above copyright notice and this permission notice appear in all
  1743. X * copies, and that the name of Bellcore not be used in advertising
  1744. X * or publicity pertaining to this material without the specific,
  1745. X * prior written permission of an authorized representative of
  1746. X * Bellcore.
  1747. X *
  1748. X * BELLCORE MAKES NO REPRESENTATIONS AND EXTENDS NO WARRANTIES, EX-
  1749. X * PRESS OR IMPLIED, WITH RESPECT TO THE SOFTWARE, INCLUDING, BUT
  1750. X * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  1751. X * FITNESS FOR ANY PARTICULAR PURPOSE, AND THE WARRANTY AGAINST IN-
  1752. X * FRINGEMENT OF PATENTS OR OTHER INTELLECTUAL PROPERTY RIGHTS.  THE
  1753. X * SOFTWARE IS PROVIDED "AS IS", AND IN NO EVENT SHALL BELLCORE OR
  1754. X * ANY OF ITS AFFILIATES BE LIABLE FOR ANY DAMAGES, INCLUDING ANY
  1755. X * LOST PROFITS OR OTHER INCIDENTAL OR CONSEQUENTIAL DAMAGES RELAT-
  1756. X * ING TO THE SOFTWARE.
  1757. X */
  1758. X
  1759. #include <Xbae/Caption.h>
  1760. #include <Xm/DialogS.h>
  1761. #include <Xm/TextF.h>
  1762. #include <Xm/Form.h>
  1763. #include <Xm/Frame.h>
  1764. #include <Xm/RowColumn.h>
  1765. #include <Xm/PushB.h>
  1766. #include <Xm/ToggleB.h>
  1767. X
  1768. /*
  1769. X * Some examples of Captions use
  1770. X */
  1771. X
  1772. void popupCaptionTextF(), popupCaptionFrame(), popupCaptionToggle();
  1773. SHAR_EOF
  1774. true || echo 'restore of Xbae/examples/caption/caption.c failed'
  1775. fi
  1776. echo 'End of Xbae part 10'
  1777. echo 'File Xbae/examples/caption/caption.c is continued in part 11'
  1778. echo 11 > _shar_seq_.tmp
  1779. exit 0
  1780. -- 
  1781. --
  1782. Molecular Simulations, Inc.            mail: dcmartin@msi.com
  1783. 796 N. Pastoria Avenue                uucp: uunet!dcmartin
  1784. Sunnyvale, California 94086            at&t: 408/522-9236
  1785.