home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / compsrcs / sun / volume01 / panele.dit < prev    next >
Encoding:
Internet Message Format  |  1991-08-27  |  20.5 KB

  1. From decwrl!sun-barr!cs.utexas.edu!uwm.edu!psuvax1!rutgers!aramis.rutgers.edu!dartagnan.rutgers.edu!mcgrew Sun Dec 10 15:26:03 PST 1989
  2. Article 84 of comp.sources.sun:
  3. Path: decwrl!sun-barr!cs.utexas.edu!uwm.edu!psuvax1!rutgers!aramis.rutgers.edu!dartagnan.rutgers.edu!mcgrew
  4. From: mcgrew@dartagnan.rutgers.edu (Charles Mcgrew)
  5. Newsgroups: comp.sources.sun
  6. Subject: v01i081:  Paneledit: interactive editor for SunView panels
  7. Message-ID: <Nov.28.12.23.28.1989.25647@dartagnan.rutgers.edu>
  8. Date: 28 Nov 89 17:23:31 GMT
  9. Organization: Rutgers Univ., New Brunswick, N.J.
  10. Lines: 610
  11. Approved: mcgrew@aramis.rutgers.edu
  12.  
  13. Submitted-by: mbp@lakisis.umd.edu (Mark Phillips)
  14. Posting-number: Volume 1, Issue 81
  15. Archive-name: paneledit
  16.  
  17.  
  18.      Here is a piece of code which I call "paneledit" that can save
  19. SunView programmers hours of development time.  It allows you to
  20. reposition any panel item in your program interactively.  It is not a
  21. standalone program, but rather can be incorporated into any SunView
  22. program at any time by simply adding one line to the program's source
  23. code and recompiling.  It allows you to switch between the program's
  24. normal operational mode and a special "editing" mode, in which you can
  25. use the mouse to drag panel items around and find out their new x,y
  26. coordinates.  You can switch modes as often as you like.
  27.  
  28.      Paneledit incorporates a procedure called "move_item" by Chuck
  29. Musciano (posted to Sun-Spots in July '88) in a way that frees you
  30. from having to explicitly change your code to reference move_item.
  31. You just add one line to your program, and poof!, you can drag panel
  32. items around to your heart's content, without interfering with the
  33. normal functionality of the program.
  34.  
  35.      The code, instructions, and a short example program are in
  36. the shar file below.  Enjoy!
  37.  
  38. Mark Phillips              mbp@lakisis.umd.edu
  39. Department of Mathematics         (301) 454-6550
  40. University of Maryland
  41. College Park, Maryland 20742
  42. USA            
  43. ----------------------------------------------------------------------
  44. #! /bin/sh
  45. # This is a shell archive.  Remove anything before this line, then unpack
  46. # it by saving it into a file and typing "sh file".  To overwrite existing
  47. # files, type "sh file -c".  You can also feed this as standard input via
  48. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  49. # will see the following message at the end:
  50. #        "End of archive 1 (of 1)."
  51. # Contents:  . ./Makefile ./README ./myprog.c ./paneledit.c MANIFEST
  52. # Wrapped by mbp@lakisis on Tue Oct 17 09:57:08 1989
  53. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  54. if test -f './Makefile' -a "${1}" != "-c" ; then 
  55.   echo shar: Will not clobber existing file \"'./Makefile'\"
  56. else
  57. echo shar: Extracting \"'./Makefile'\" \(411 characters\)
  58. sed "s/^X//" >'./Makefile' <<'END_OF_FILE'
  59. X# $Id: Makefile,v 1.0 89/10/01 17:00:22 mbp Exp $
  60. X#
  61. X#  makefile for "paneledit.o" and example program "myprog"
  62. X#
  63. X#  type "make" to just make paneledit.o
  64. X#
  65. X#  type "make myprog" to make myprog
  66. X#
  67. X
  68. Xpaneledit.o:        paneledit.c
  69. X    cc -c -o paneledit.o paneledit.c
  70. X
  71. Xmyprog:            myprog.o paneledit.o
  72. X    cc -o myprog myprog.o paneledit.o \
  73. X        -lm -lsuntool -lsunwindow -lpixrect
  74. X
  75. Xmyprog.o:        myprog.c
  76. X    cc -c -o myprog.o myprog.c
  77. END_OF_FILE
  78. if test 411 -ne `wc -c <'./Makefile'`; then
  79.     echo shar: \"'./Makefile'\" unpacked with wrong size!
  80. fi
  81. # end of './Makefile'
  82. fi
  83. if test -f './README' -a "${1}" != "-c" ; then 
  84.   echo shar: Will not clobber existing file \"'./README'\"
  85. else
  86. echo shar: Extracting \"'./README'\" \(5637 characters\)
  87. sed "s/^X//" >'./README' <<'END_OF_FILE'
  88. X                   PANELEDIT
  89. X
  90. X                  VERSION 1.0
  91. X                February 2, 1989
  92. X
  93. X     Mark Phillips                     Chuck Musciano
  94. X     Department of Mathematics         Advanced Technology Department
  95. X     University of Maryland            Harris Corporation
  96. X     College Park, Maryland 20742      PO Box 37, MS 3A/1912
  97. X     (301) 454-2693                    Melbourne, FL 32902
  98. X     ARPA: mbp@lakisis.umd.edu         (407) 727-6131
  99. X                                       ARPA: chuck@trantor.harris-atd.com
  100. X
  101. X     Everything except procedure "move_item":
  102. X    Copyright 1989 by Mark Phillips and the University of Maryland
  103. X
  104. X     Procedure "move_item":
  105. X    Copyright 1988 by Chuck Musciano and Harris Corporation
  106. X
  107. X     Permission to use, copy, modify, and distribute this software and
  108. X     its  documentation for  any  purpose and without   fee  is hereby
  109. X     granted, provided that the above copyright  notices appear in all
  110. X     copies and that both those copyright notices and  this permission
  111. X     notice appear in supporting documentation, and that the  names of
  112. X     Mark Phillips, the  University of Maryland,  Chuck Musciano,  and
  113. X     Harris   Corporation not  be  used in  advertising  or  publicity
  114. X     pertaining to  distribution  of the   software without  specific,
  115. X     written prior  permission.   Mark   Phillips, the  University  of
  116. X     Maryland, Chuck  Musciano,    and  Harris  Corporation  make   no
  117. X     representations about the suitability   of this software for  any
  118. X     purpose.   It  is   provided "as  is"  without express or implied
  119. X     warranty.
  120. X
  121. X*   *   *   *   *   *   *   *   *   *   *   *   *   *   *   *   *   *   *
  122. X
  123. X                  INSTRUCTIONS
  124. X
  125. X     Paneledit is a "module" which allows you to use the mouse to move
  126. Xpanel items (buttons, sliders, messages, text fields, etc) around in a
  127. XSunView panel.  It can be incorporated into any SunView program at any
  128. Xtime --- it requires a minimal amount of effort to install into or
  129. Xremove from a program, which makes it ideal for program development.
  130. XIt is very useful during the design stages of a program because it
  131. Xallows you to reposition panel items at any time, without having to
  132. Xmake lots of experimental changes to your source code.
  133. X
  134. X     Paneledit consists of the file "paneledit.c".  To use it, just add
  135. Xthe single line
  136. X
  137. X        paneledit_init(base_frame);
  138. X
  139. Xto you source code immediately before your window_main_loop(base_frame)
  140. Xcall (where base_frame is, of course, the handle of your program's main
  141. Xframe).  Then link paneledit.o in with your program.
  142. X
  143. X     When your program starts, a (very small) separate frame will appear
  144. Xalong with your program's frame(s).  This frame has one panel cycle item
  145. Xlabeled "Panel Editing".  Your program will function normally as long as
  146. Xthis cycle is "Off", which is its initial state.  Switching it to "On"
  147. Xputs your program in an "editing" mode.  While in editing mode, you can
  148. Xuse the mouse to reposition any panel item in your program.  To do this,
  149. Xsimply position the mouse cursor over the desired item, and hold down
  150. Xthe left mouse button to drag the item horizontally, or the middle mouse
  151. Xbutton to drag it vertically.  Clicking the right mouse button causes
  152. Xthe item to report it's x,y location (in the coordinate system of its
  153. Xpanel) on stdout.  To return to normal mode, switch the "Panel Editing"
  154. Xcycle back to "Off".  You can switch into and out of editing mode as
  155. Xoften as you like.
  156. X
  157. XSend all bugs, comments, questions, and suggestions to:
  158. X
  159. X            Mark Phillips
  160. X            Department of Mathematics
  161. X            University of Maryland
  162. X            College Park, Maryland 20742
  163. X            (301) 454-6550
  164. X            mbp@lakisis.umd.edu
  165. X
  166. X
  167. X                 NOTES
  168. X
  169. X  1. The program "myprog.c" is a do-nothing sample program which
  170. X     illustrates the use of paneledit.  To build it (and paneledit.o),
  171. X     type "make myprog".
  172. X  
  173. X  2. The paneledit frame is supposed to appear on the screen immediately
  174. X     below your program's main frame.  If your main frame is programmed
  175. X     to come up with its bottom edge close to the bottom of the screen,
  176. X     the paneledit frame may not be visible.
  177. X  
  178. X  3. If you close the paneledit frame by picking "Done" from it's frame
  179. X     menu, there is no way to get it back without restarting your
  180. X     program.
  181. X  
  182. X  4. You cannot "edit" the "Panel Editing" cycle in the paneledit frame.
  183. X
  184. X  5. Paneledit can edit only one "window tree".  If your program has
  185. X     multiple base frames, you can attach paneledit to only one of them
  186. X     at a time.
  187. X  
  188. X  6. Paneledit uses uses dynamically allocated memory to store the
  189. X     original event procs for all your panel items when in editing mode.
  190. X     If it runs out of memory when entering editing mode, it dies very
  191. X     ungracefully, taking your program with it.
  192. X  
  193. X  7. When you reposition an item with paneledit, the new position is not
  194. X     permanently part of your program.  In order for it to be permanent,
  195. X     you obviously have to change the x,y coordinates in your source
  196. X     code and recompile.  The right mouse button allows you to find out
  197. X     the item's new coordinates so that you can make this change easily.
  198. X     One way to enhance paneledit might be to have it record all your
  199. X     items' locations in a file which would be incorporated into your
  200. X     source code automatically.  If anyone has any suggestions of how to
  201. X     do this, I would appreciate hearing about them.
  202. X
  203. X  8. This version of paneledit was written on a Sun 3 running version
  204. X     3.5 of SunOS.  I have not tested it on other systems.
  205. X
  206. X                 FILES
  207. X
  208. X    README:        this file
  209. X    paneledit.c:    source code
  210. X    myprog.c:    example program
  211. X    Makefile:    makefile for paneledit.o and myprog
  212. END_OF_FILE
  213. if test 5637 -ne `wc -c <'./README'`; then
  214.     echo shar: \"'./README'\" unpacked with wrong size!
  215. fi
  216. # end of './README'
  217. fi
  218. if test -f './myprog.c' -a "${1}" != "-c" ; then 
  219.   echo shar: Will not clobber existing file \"'./myprog.c'\"
  220. else
  221. echo shar: Extracting \"'./myprog.c'\" \(1915 characters\)
  222. sed "s/^X//" >'./myprog.c' <<'END_OF_FILE'
  223. X/* $Id: myprog.c,v 1.0 89/10/01 17:00:27 mbp Exp $
  224. X *
  225. X * myprog.c: SunView program to illustrate use of paneledit
  226. X *
  227. X * usage: myprog [generic Suntools window arguments]
  228. X */
  229. X
  230. X#include <stdio.h>
  231. X#include <suntool/sunview.h>
  232. X#include <suntool/panel.h>
  233. X
  234. Xstatic Frame base_frame;
  235. Xstatic Panel_item button1,button2, message;
  236. Xstatic int button_event_proc(), quit_program();
  237. X
  238. Xmain(argc,argv)
  239. Xint argc;
  240. Xchar **argv;
  241. X{
  242. X  initialize_windows(argc,argv);
  243. X  paneledit_init(base_frame);
  244. X  window_main_loop(base_frame);
  245. X}
  246. X
  247. Xstatic int
  248. Xinitialize_windows(argc,argv)
  249. Xint argc;
  250. Xchar **argv;
  251. X{
  252. X  static Panel panel;
  253. X
  254. X  base_frame =
  255. X    window_create(NULL, FRAME,
  256. X          FRAME_LABEL, "Myprog",
  257. X          FRAME_ARGS, argc, argv,
  258. X          0);
  259. X
  260. X  panel =
  261. X    window_create(base_frame, PANEL,
  262. X          WIN_WIDTH, 300,
  263. X          WIN_HEIGHT, 300,
  264. X          0);
  265. X
  266. X  button1 = 
  267. X    panel_create_item(panel, PANEL_BUTTON,
  268. X              PANEL_LABEL_IMAGE,
  269. X                panel_button_image(panel, "Button 1", 0, 0),
  270. X              PANEL_NOTIFY_PROC, button_event_proc,
  271. X              0);
  272. X
  273. X  button2 =
  274. X    panel_create_item(panel, PANEL_BUTTON,
  275. X              PANEL_LABEL_IMAGE,
  276. X                panel_button_image(panel, "Button 2", 0, 0),
  277. X              PANEL_NOTIFY_PROC, button_event_proc,
  278. X              0);
  279. X
  280. X  panel_create_item(panel, PANEL_BUTTON,
  281. X            PANEL_LABEL_IMAGE,
  282. X              panel_button_image(panel, "Quit", 0, 0),
  283. X            PANEL_NOTIFY_PROC, quit_program,
  284. X            0);
  285. X
  286. X  message =
  287. X    panel_create_item(panel, PANEL_MESSAGE,
  288. X              PANEL_LABEL_STRING, "This is a messge item",
  289. X              0);
  290. X
  291. X  window_fit(base_frame);
  292. X}
  293. X
  294. Xstatic int
  295. Xbutton_event_proc(item, event)
  296. X     Panel_item item;
  297. X     Event *event;
  298. X{
  299. X  char buf[30];
  300. X
  301. X  if (item==button1) {
  302. X    sprintf(buf,"You picked Button 1");
  303. X  }
  304. X  else if (item==button2) {
  305. X    sprintf(buf,"You picked Button 2");
  306. X  }
  307. X  else {
  308. X    sprintf(buf,"Unknown button!!");
  309. X  }
  310. X
  311. X  panel_set(message, PANEL_LABEL_STRING, buf, 0);
  312. X}
  313. X
  314. Xstatic int
  315. Xquit_program()
  316. X{
  317. X  window_done(base_frame);
  318. X}
  319. END_OF_FILE
  320. if test 1915 -ne `wc -c <'./myprog.c'`; then
  321.     echo shar: \"'./myprog.c'\" unpacked with wrong size!
  322. fi
  323. # end of './myprog.c'
  324. fi
  325. if test -f './paneledit.c' -a "${1}" != "-c" ; then 
  326.   echo shar: Will not clobber existing file \"'./paneledit.c'\"
  327. else
  328. echo shar: Extracting \"'./paneledit.c'\" \(7473 characters\)
  329. sed "s/^X//" >'./paneledit.c' <<'END_OF_FILE'
  330. X/* $Id: paneledit.c,v 1.0 89/10/01 17:00:29 mbp Exp $
  331. X *
  332. X * paneledit.c               version 1.0             February 2, 1989
  333. X *
  334. X * Allows dynamic repositioning of all panel items in all panels
  335. X *
  336. X * Authors:
  337. X *                                      procedure move_item() by:
  338. X *     Mark Phillips                    Chuck Musciano
  339. X *     Department of Mathematics        Advanced Technology Department
  340. X *     University of Maryland           Harris Corporation
  341. X *     College Park, Maryland 20742     PO Box 37, MS 3A/1912
  342. X *     (301) 454-2693                   Melbourne, FL 32902
  343. X *     ARPA: mbp@lakisis.umd.edu        (407) 727-6131
  344. X *                                      ARPA: chuck@trantor.harris-atd.com
  345. X *
  346. X * Everything except procedure "move_item":
  347. X *      Copyright 1989 by Mark Phillips and the University of Maryland
  348. X *
  349. X * Procedure "move_item":
  350. X *      Copyright 1988 by Chuck Musciano and Harris Corporation
  351. X *
  352. X * Permission to use, copy, modify, and  distribute this software and
  353. X * its  documentation for  any purpose   and without   fee is  hereby
  354. X * granted, provided that  the above copyright  notices appear in all
  355. X * copies and that both  those  copyright notices and this permission
  356. X * notice appear in supporting  documentation, and  that the names of
  357. X * Mark Phillips, the  University  of Maryland,  Chuck Musciano,  and
  358. X * Harris  Corporation  not be   used  in advertising   or  publicity
  359. X * pertaining  to   distribution of   the software without  specific,
  360. X * written prior   permission.   Mark Phillips,   the   University of
  361. X * Maryland,  Chuck   Musciano,   and  Harris  Corporation  make   no
  362. X * representations about the  suitability  of  this software  for any
  363. X * purpose.   It is  provided  "as  is" without  express   or implied
  364. X * warranty.
  365. X */
  366. X
  367. X#include <stdio.h>
  368. X#include <suntool/sunview.h>
  369. X#include <suntool/panel.h>
  370. X
  371. Xtypedef    struct save_block_tag {
  372. X  caddr_t    client_data;
  373. X  caddr_t    event_proc;
  374. X} Save_block;
  375. X
  376. Xstatic Frame base_frame;
  377. Xstatic Frame edit_frame;
  378. Xstatic Panel edit_panel;
  379. Xstatic Panel_item edit_cycle;
  380. Xstatic int toggle_edit(), move_item();
  381. X
  382. X#define        NO_DRAG        0
  383. X#define        DRAG_X        1
  384. X#define        DRAG_Y        2
  385. Xstatic int dragging = NO_DRAG;
  386. X
  387. Xstatic int editing = 0;
  388. X
  389. X/*-----------------------------------------------------------------------
  390. X * Function:    paneledit_init
  391. X * Description:    Set up editing of SunView panels
  392. X * Args  IN:    frame: handle of frame
  393. X * Returns:    success status: 0 for success, 1 for failure
  394. X * Notes:    All panel items in all subwindows of frame can be edited.
  395. X */
  396. Xpaneledit_init(frame)
  397. XFrame frame;
  398. X{
  399. X  int h;
  400. X
  401. X  base_frame = frame;
  402. X
  403. X  edit_frame =
  404. X    window_create(base_frame, FRAME,
  405. X          FRAME_LABEL, "paneledit - 1.0",
  406. X          FRAME_SHOW_LABEL, TRUE,
  407. X          0);
  408. X
  409. X  edit_panel = window_create(edit_frame, PANEL,0);
  410. X  edit_cycle =
  411. X    panel_create_item(edit_panel, PANEL_CYCLE,
  412. X              PANEL_LABEL_STRING, "Panel Editing ",
  413. X              PANEL_CHOICE_STRINGS, "Off", "On", 0,
  414. X              PANEL_NOTIFY_PROC, toggle_edit,
  415. X              0);
  416. X  window_fit(edit_panel);
  417. X  window_fit(edit_frame);
  418. X  window_set(edit_frame,
  419. X         WIN_X, 0,
  420. X         WIN_Y, (int)window_get(base_frame, WIN_HEIGHT),
  421. X         WIN_SHOW, TRUE,
  422. X         0);
  423. X}
  424. X
  425. X/*-----------------------------------------------------------------------
  426. X * Function:    toggle_edit
  427. X * Description:    toggle whether panel items are being edited
  428. X * Notes:    this is the event procedure for the editing cycle item
  429. X */
  430. Xstatic int
  431. Xtoggle_edit()
  432. X{
  433. X  /* We toggle the editing state and apply new state to window tree */
  434. X  editing = !editing;
  435. X  set_editing_in_window(base_frame, editing);
  436. X}
  437. X
  438. X/*-----------------------------------------------------------------------
  439. X * Function:    set_editing_in_window
  440. X * Description:    turn editing on or off in a specific window
  441. X * Args  IN:    window: the window's handle
  442. X *        edit: 0 to turn editing off, 1 to turn it on
  443. X * Returns:    nothing
  444. X * Notes:    This procedure calls itself to operate on the entire
  445. X *        window tree with window as root
  446. X */
  447. Xstatic int
  448. Xset_editing_in_window(window, edit)
  449. X     Window window;
  450. X     int edit;
  451. X{
  452. X  int winno;
  453. X  Window subwindow;
  454. X
  455. X  winno = 0;
  456. X  do {
  457. X    /* Get next subwindow */
  458. X    subwindow = (Window)window_get(window, FRAME_NTH_WINDOW, winno);
  459. X    if (subwindow!=NULL) {
  460. X      /* Make sure this is not the edit frame! */
  461. X      if (subwindow != edit_frame) {
  462. X    switch ( (Window_type)(window_get(subwindow,WIN_TYPE)) ) {
  463. X    case FRAME_TYPE:
  464. X      set_editing_in_window(subwindow, edit);
  465. X      break;
  466. X    case PANEL_TYPE:
  467. X      set_editing_in_panel(subwindow, edit);
  468. X      break;
  469. X    default:
  470. X      /* do nothing */
  471. X      break;
  472. X    }
  473. X      }
  474. X    }
  475. X    ++winno;
  476. X  } while (subwindow != NULL);
  477. X}
  478. X
  479. X/*-----------------------------------------------------------------------
  480. X * Function:    set_editing_in_panel
  481. X * Description:    turn editing on or off for all items in a panel
  482. X * Args  IN:    panel: the panel's handle
  483. X *        edit: 0 to turn editing off, 1 to turn it on
  484. X * Returns:    nothing
  485. X */
  486. Xstatic int
  487. Xset_editing_in_panel(panel, edit)
  488. X     Panel panel;
  489. X     int edit;
  490. X{
  491. X  Panel_item item;
  492. X  Save_block *b;
  493. X
  494. X  /* Loop thru each item in this panel */
  495. X  panel_each_item(panel, item) {
  496. X
  497. X    if (edit) {
  498. X
  499. X      /* allocate a Save_block for item's current info */
  500. X      b = (Save_block*)malloc(sizeof(Save_block));
  501. X      if (b == NULL) {
  502. X    printf(stderr, "Sorry, no memory left for panel_edit !!\n");
  503. X    exit(1);
  504. X      }
  505. X      b->client_data = (caddr_t)panel_get(item, PANEL_CLIENT_DATA);
  506. X      b->event_proc = (caddr_t)panel_get(item, PANEL_EVENT_PROC);
  507. X
  508. X      /* Store pointer to this Save_block as item's new client data */
  509. X      panel_set(item, PANEL_CLIENT_DATA, b, 0);
  510. X
  511. X      /* For editing, use move_item as event proc */
  512. X      panel_set(item, PANEL_EVENT_PROC, move_item, 0);
  513. X    }
  514. X
  515. X    else {
  516. X
  517. X      /* restore previous event proc and client data */
  518. X      b = (Save_block*)panel_get(item, PANEL_CLIENT_DATA);
  519. X      panel_set(item, PANEL_EVENT_PROC, b->event_proc, 0);
  520. X      panel_set(item, PANEL_CLIENT_DATA, b->client_data, 0);
  521. X
  522. X      /* free up the Save_block */
  523. X      free(b);
  524. X    }
  525. X
  526. X  } panel_end_each;
  527. X
  528. X}
  529. X
  530. X/*-----------------------------------------------------------------------
  531. X * Function:    move_item
  532. X * Description:    A notify proc which allows items to move about and then
  533. X *          report their position.
  534. X * Args  IN:    item: item's handle
  535. X *        event: event which caused notification
  536. X * Returns:    nothing
  537. X * Notes:     Copyright 1988 by Chuck Musciano and Harris Corporation
  538. X */
  539. Xstatic int
  540. Xmove_item(item, event)
  541. X     Panel_item    item;
  542. X     Event    *event;
  543. X{
  544. X  static int old_x, old_y;
  545. X  static Panel_item old_item;
  546. X
  547. X  if (event_id(event) == MS_LEFT)
  548. X    if (event_is_down(event)) {
  549. X      dragging = DRAG_X;
  550. X      old_x = event_x(event);
  551. X      old_item = item;
  552. X    }
  553. X    else
  554. X      dragging = NO_DRAG;
  555. X  else if (event_id(event) == MS_MIDDLE)
  556. X    if (event_is_down(event)) {
  557. X      dragging = DRAG_Y;
  558. X      old_y = event_y(event);
  559. X      old_item = item;
  560. X    }
  561. X    else
  562. X      dragging = NO_DRAG;
  563. X  else if (event_id(event) == MS_RIGHT && event_is_down(event))
  564. X    printf("%5d %5d\n", panel_get(item, PANEL_ITEM_X),
  565. X       panel_get(item, PANEL_ITEM_Y));
  566. X  else if (event_id(event) == LOC_DRAG)
  567. X    if (dragging == DRAG_X) {
  568. X      panel_set(old_item, PANEL_ITEM_X,
  569. X        panel_get(item, PANEL_ITEM_X) + event_x(event) - old_x, 0);
  570. X      old_x = event_x(event);
  571. X    }
  572. X    else if (dragging == DRAG_Y) {
  573. X      panel_set(old_item, PANEL_ITEM_Y,
  574. X        panel_get(item, PANEL_ITEM_Y) + event_y(event) - old_y, 0);
  575. X      old_y = event_y(event);
  576. X    }
  577. X    else
  578. X      panel_default_handle_event(item, event);
  579. X}
  580. END_OF_FILE
  581. if test 7473 -ne `wc -c <'./paneledit.c'`; then
  582.     echo shar: \"'./paneledit.c'\" unpacked with wrong size!
  583. fi
  584. # end of './paneledit.c'
  585. fi
  586. if test -f 'MANIFEST' -a "${1}" != "-c" ; then 
  587.   echo shar: Will not clobber existing file \"'MANIFEST'\"
  588. else
  589. echo shar: Extracting \"'MANIFEST'\" \(300 characters\)
  590. sed "s/^X//" >'MANIFEST' <<'END_OF_FILE'
  591. X   File Name        Archive #    Description
  592. X-----------------------------------------------------------
  593. X .                          1    
  594. X ./Makefile                 1    
  595. X ./README                   1    
  596. X ./myprog.c                 1    
  597. X ./paneledit.c              1    
  598. X MANIFEST                   1    This shipping list
  599. END_OF_FILE
  600. if test 300 -ne `wc -c <'MANIFEST'`; then
  601.     echo shar: \"'MANIFEST'\" unpacked with wrong size!
  602. fi
  603. # end of 'MANIFEST'
  604. fi
  605. echo shar: End of archive 1 \(of 1\).
  606. cp /dev/null ark1isdone
  607. MISSING=""
  608. for I in 1 ; do
  609.     if test ! -f ark${I}isdone ; then
  610.     MISSING="${MISSING} ${I}"
  611.     fi
  612. done
  613. if test "${MISSING}" = "" ; then
  614.     echo You have the archive.
  615.     echo "Now read the file README"
  616.     rm -f ark[1-9]isdone
  617. else
  618.     echo You still need to unpack the following archives:
  619.     echo "        " ${MISSING}
  620. fi
  621. ##  End of shell archive.
  622. exit 0
  623.  
  624.  
  625.