v11i001: xrolo -- an XView rolodex, Patch2, Part01/01

Luis Soltero luis at rice.edu
Mon Jan 28 07:10:08 AEST 1991


Submitted-by: luis at rice.edu (Luis Soltero)
Posting-number: Volume 11, Issue 1
Archive-name: xrolo/patch2
Patch-To: xrolo: Volume 9, Issue 84-86
Patch-To: xrolo: Volume 10, Issue 71

included in this mesg you will find the second set of patches of xrolo.
to apply the patches unshar this file in the xrolo source tree, and
use Larry Walls patch program to apply the patch.

	cd XROLO_DIR; patch < xrolo.patch2; xmkmf ; make

here is some info on the new release of xrolo.

    Added rudimentary field sort. Each line in the rolo card is
    considered to be a separate field.  A filed sort can be acomplished by
    pointing and clicking on the desired field before invoking the sort.

    Added Mail to Author menu entry to Help button.  This menu entry
    allows users to mail comments to me directly.

    Exchanged location of Find and End button to reduce the amount of
    mouse travel needed execute a find.

    fixed bug which caused xrolo to core when setting the default print
    command from the menu selection with out having previously set the
    xrolo.PrintCommand resource.

    Added case [in]sensitive sorting.  There is a new menu item which
    allows you to set the sort mode.  The xrolo.CaseInsensitive resource
    can be used to set the default search mode.

    Added the xrolo.TextWidth resource which allows setting the
    default text window width in pixels.

#! /bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of archive 1 (of 1)."
# Contents:  patchlevel.h send_mail.c xrolo.patch2
# Wrapped by luis at oort on Mon Jan  7 11:25:01 1991
#
# This file includes patches to xrolo.  Sources to xrolo can be found in
# the comp.sources.x archive under volume9.  Patches to xrolo can be
# found in volume10.
#
# after unsharing this archive apply the patch by using Larry Walls
# patch program.
#
#	cd XROLO_SOURCES; patch < xrolo.patch2
#
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'patchlevel.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'patchlevel.h'\"
else
echo shar: Extracting \"'patchlevel.h'\" \(21 characters\)
sed "s/^X//" >'patchlevel.h' <<'END_OF_FILE'
X#define PATCHLEVEL 3
END_OF_FILE
if test 21 -ne `wc -c <'patchlevel.h'`; then
    echo shar: \"'patchlevel.h'\" unpacked with wrong size!
fi
# end of 'patchlevel.h'
fi
if test -f 'send_mail.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'send_mail.c'\"
else
echo shar: Extracting \"'send_mail.c'\" \(12988 characters\)
sed "s/^X//" >'send_mail.c' <<'END_OF_FILE'
X/************************************************************************/
X/*	Copyright 1990 by Chuck Musciano and Harris Corporation		*/
X/*									*/
X/*	Permission to use, copy, modify, and distribute this software	*/
X/*	and its documentation for any purpose and without fee is	*/
X/*	hereby granted, provided that the above copyright notice	*/
X/*	appear in all copies and that both that copyright notice and	*/
X/*	this permission notice appear in supporting documentation, and	*/
X/*	that the name of Chuck Musciano and Harris Corporation not be	*/
X/*	used in advertising or publicity pertaining to distribution	*/
X/*	of the software without specific, written prior permission.	*/
X/*	Chuck Musciano and Harris Corporation make no representations	*/
X/*	about the suitability of this software for any purpose.  It is	*/
X/*	provided "as is" without express or implied warranty.		*/
X/*									*/
X/*	This code contains data and information that is proprietary	*/
X/*	to Casio Corporation.  You may be subject to legal action if	*/
X/*	this information is released without explicit permission from	*/
X/*	Casio.								*/
X/************************************************************************/
X
X/************************************************************************/
X/*									*/
X/*	send_mail.c	display a little information window		*/
X/*									*/
X/************************************************************************/
X
X#include	<stdio.h>
X#include    "patchlevel.h"
X#include	<sys/param.h>
X#include	<sys/types.h>
X#include	<xview/xview.h>
X#include	<xview/panel.h>
X#include	<xview/textsw.h>
X#include    <xview/notice.h>
X#include	<X11/Xutil.h>
X
Xtypedef struct {
X	Xv_opaque	mail;
X	Xv_opaque	mail_controls;
X	Xv_opaque	msg_21;
X	Xv_opaque	msg_22;
X	Xv_opaque	address;
X	Xv_opaque	other_address;
X	Xv_opaque	message;
X	Xv_opaque	mail_controls1;
X	Xv_opaque	accept_send;
X	Xv_opaque	cancel_mail;
X} xrolo_mail_objects;
X
Xint INSTANCE = 101;
X
Xextern xrolo_mail_objects	*xrolo_mail_objects_initialize();
Xextern Xv_opaque	xrolo_mail_mail_create();
Xextern Xv_opaque	xrolo_mail_mail_controls_create();
Xextern Xv_opaque	xrolo_mail_msg_21_create();
Xextern Xv_opaque	xrolo_mail_msg_22_create();
Xextern Xv_opaque	xrolo_mail_address_create();
Xextern Xv_opaque	xrolo_mail_other_address_create();
Xextern Xv_opaque	xrolo_mail_message_create();
Xextern Xv_opaque	xrolo_mail_mail_controls1_create();
Xextern Xv_opaque	xrolo_mail_accept_send_create();
Xextern Xv_opaque	xrolo_mail_cancel_mail_create();
X
Xstatic xrolo_mail_objects	*dialog = NULL;
X
X/*
X * Initialize an instance of object `mail'.
X */
Xxrolo_mail_objects *
Xxrolo_mail_objects_initialize(ip, owner)
X	xrolo_mail_objects	*ip;
X	Xv_opaque	owner;
X{
X	if (!ip && !(ip = (xrolo_mail_objects *) calloc(1, sizeof (xrolo_mail_objects))))
X		return (xrolo_mail_objects *) NULL;
X	if (!ip->mail)
X		ip->mail = xrolo_mail_mail_create(ip, owner);
X	if (!ip->mail_controls)
X		ip->mail_controls = xrolo_mail_mail_controls_create(ip, ip->mail);
X	if (!ip->msg_21)
X		ip->msg_21 = xrolo_mail_msg_21_create(ip, ip->mail_controls);
X	if (!ip->msg_22)
X		ip->msg_22 = xrolo_mail_msg_22_create(ip, ip->mail_controls);
X	if (!ip->address)
X		ip->address = xrolo_mail_address_create(ip, ip->mail_controls);
X	if (!ip->other_address)
X		ip->other_address = xrolo_mail_other_address_create(ip, ip->mail_controls);
X	if (!ip->message)
X		ip->message = xrolo_mail_message_create(ip, ip->mail);
X	if (!ip->mail_controls1)
X		ip->mail_controls1 = xrolo_mail_mail_controls1_create(ip, ip->mail);
X	if (!ip->accept_send)
X		ip->accept_send = xrolo_mail_accept_send_create(ip, ip->mail_controls1);
X	if (!ip->cancel_mail)
X		ip->cancel_mail = xrolo_mail_cancel_mail_create(ip, ip->mail_controls1);
X	return ip;
X}
X
X/*
X * Create object `mail' in the specified instance.
X
X */
XXv_opaque
Xxrolo_mail_mail_create(ip, owner)
X	caddr_t		ip;
X	Xv_opaque	owner;
X{
X	extern void	done_mail();
X	Xv_opaque	obj;
X	
X	obj = xv_create(owner, FRAME_CMD,
X		XV_KEY_DATA, INSTANCE, ip,
X		XV_WIDTH, 506,
X		XV_HEIGHT, 338,
X		XV_LABEL, "Xrolo: Send mail",
X		XV_SHOW, FALSE,
X		FRAME_SHOW_FOOTER, FALSE,
X		FRAME_SHOW_RESIZE_CORNER, FALSE,
X		FRAME_CMD_PUSHPIN_IN, FALSE,
X		FRAME_DONE_PROC, done_mail,
X		NULL);
X	xv_set(xv_get(obj, FRAME_CMD_PANEL), WIN_SHOW, FALSE, NULL);
X	return obj;
X}
X
X/*
X * Create object `mail_controls' in the specified instance.
X
X */
XXv_opaque
Xxrolo_mail_mail_controls_create(ip, owner)
X	caddr_t		ip;
X	Xv_opaque	owner;
X{
X	Xv_opaque	obj;
X	
X	obj = xv_create(owner, PANEL,
X		XV_KEY_DATA, INSTANCE, ip,
X		XV_HELP_DATA, "xrolo:mail_controls",
X		XV_X, 0,
X		XV_Y, 0,
X		XV_WIDTH, WIN_EXTEND_TO_EDGE,
X		XV_HEIGHT, 92,
X		WIN_BORDER, FALSE,
X		NULL);
X	return obj;
X}
X
X/*
X * Create object `msg_21' in the specified instance.
X
X */
XXv_opaque
Xxrolo_mail_msg_21_create(ip, owner)
X	caddr_t		ip;
X	Xv_opaque	owner;
X{
X	Xv_opaque	obj;
X	
X	obj = xv_create(owner, PANEL_MESSAGE,
X		XV_KEY_DATA, INSTANCE, ip,
X		XV_HELP_DATA, "xrolo:msg_21",
X		XV_X, 14,
X		XV_Y, 14,
X		XV_WIDTH, 478,
X		XV_HEIGHT, 13,
X		PANEL_LABEL_STRING, "Your feedback is appreciated.  To ensure that your message reaches me, check",
X		PANEL_LABEL_BOLD, FALSE,
X		NULL);
X	return obj;
X}
X
X/*
X * Create object `msg_22' in the specified instance.
X
X */
XXv_opaque
Xxrolo_mail_msg_22_create(ip, owner)
X	caddr_t		ip;
X	Xv_opaque	owner;
X{
X	Xv_opaque	obj;
X	
X	obj = xv_create(owner, PANEL_MESSAGE,
X		XV_KEY_DATA, INSTANCE, ip,
X		XV_HELP_DATA, "xrolo:msg_22",
X		XV_X, 14,
X		XV_Y, 30,
X		XV_WIDTH, 395,
X		XV_HEIGHT, 13,
X		PANEL_LABEL_STRING, "that the \"To\" address is valid for your site before clicking \"Send\".",
X		PANEL_LABEL_BOLD, FALSE,
X		NULL);
X	return obj;
X}
X
X/*
X * Create object `address' in the specified instance.
X
X */
XXv_opaque
Xxrolo_mail_address_create(ip, owner)
X	caddr_t		ip;
X	Xv_opaque	owner;
X{
X	extern void		handle_address();
X	Xv_opaque	obj;
X	
X	obj = xv_create(owner, PANEL_CHOICE, PANEL_DISPLAY_LEVEL, PANEL_CURRENT,
X		XV_KEY_DATA, INSTANCE, ip,
X		XV_HELP_DATA, "xrolo:address",
X		XV_X, 14,
X		XV_Y, 64,
X		XV_WIDTH, 278,
X		XV_HEIGHT, 23,
X		PANEL_VALUE_X, 43,
X		PANEL_VALUE_Y, 64,
X		PANEL_LAYOUT, PANEL_HORIZONTAL,
X		PANEL_CHOICE_NROWS, 1,
X		PANEL_LABEL_STRING, "To:",
X		PANEL_NOTIFY_PROC, handle_address,
X		PANEL_CHOICE_STRINGS,
X			"luis at rice.edu",
X			"ronbo at vixen.uucp",
X			"Other:",
X			0,
X		NULL);
X	return obj;
X}
X
X/*
X * Create object `other_address' in the specified instance.
X
X */
XXv_opaque
Xxrolo_mail_other_address_create(ip, owner)
X	caddr_t		ip;
X	Xv_opaque	owner;
X{
X	Xv_opaque	obj;
X	
X	obj = xv_create(owner, PANEL_TEXT,
X		XV_KEY_DATA, INSTANCE, ip,
X		XV_HELP_DATA, "xrolo:other_address",
X		XV_X, 105,
X		XV_Y, 69,
X		XV_WIDTH, 385,
X		XV_HEIGHT, 15,
X		PANEL_VALUE_X, 114,
X		PANEL_VALUE_Y, 69,
X		PANEL_LAYOUT, PANEL_HORIZONTAL,
X		PANEL_VALUE_DISPLAY_LENGTH, 47,
X		PANEL_VALUE_STORED_LENGTH, 256,
X		PANEL_READ_ONLY, FALSE,
X		NULL);
X	return obj;
X}
X
X/*
X * Create object `message' in the specified instance.
X
X */
XXv_opaque
Xxrolo_mail_message_create(ip, owner)
X	caddr_t		ip;
X	Xv_opaque	owner;
X{
X	Xv_opaque	obj;
X	
X	obj = xv_create(owner, TEXTSW,
X		XV_KEY_DATA, INSTANCE, ip,
X		XV_X, 0,
X		XV_Y, 92,
X		XV_WIDTH, WIN_EXTEND_TO_EDGE,
X		XV_HEIGHT, 188,
X		OPENWIN_SHOW_BORDERS, TRUE,
X		NULL);
X	return obj;
X}
X
X/*
X * Create object `mail_controls1' in the specified instance.
X
X */
XXv_opaque
Xxrolo_mail_mail_controls1_create(ip, owner)
X	caddr_t		ip;
X	Xv_opaque	owner;
X{
X	Xv_opaque	obj;
X	
X	obj = xv_create(owner, PANEL,
X		XV_KEY_DATA, INSTANCE, ip,
X		XV_HELP_DATA, "xrolo:mail_controls1",
X		XV_X, 0,
X		XV_Y, 280,
X		XV_WIDTH, WIN_EXTEND_TO_EDGE,
X		XV_HEIGHT, WIN_EXTEND_TO_EDGE,
X		WIN_BORDER, FALSE,
X		NULL);
X	return obj;
X}
X
X/*
X * Create object `accept_send' in the specified instance.
X
X */
XXv_opaque
Xxrolo_mail_accept_send_create(ip, owner)
X	caddr_t		ip;
X	Xv_opaque	owner;
X{
X	extern void		send_mail();
X	Xv_opaque	obj;
X	
X	obj = xv_create(owner, PANEL_BUTTON,
X		XV_KEY_DATA, INSTANCE, ip,
X		XV_HELP_DATA, "xrolo:accept_send",
X		XV_X, 193,
X		XV_Y, 18,
X		XV_WIDTH, 48,
X		XV_HEIGHT, 20,
X		PANEL_LABEL_STRING, "Send",
X		PANEL_NOTIFY_PROC, send_mail,
X		NULL);
X	return obj;
X}
X
X/*
X * Create object `cancel_mail' in the specified instance.
X
X */
XXv_opaque
Xxrolo_mail_cancel_mail_create(ip, owner)
X	caddr_t		ip;
X	Xv_opaque	owner;
X{
X	extern void		cancel_mail();
X	Xv_opaque	obj;
X	
X	obj = xv_create(owner, PANEL_BUTTON,
X		XV_KEY_DATA, INSTANCE, ip,
X		XV_HELP_DATA, "xrolo:cancel_mail",
X		XV_X, 253,
X		XV_Y, 18,
X		XV_WIDTH, 59,
X		XV_HEIGHT, 20,
X		PANEL_LABEL_STRING, "Cancel",
X		PANEL_NOTIFY_PROC, cancel_mail,
X		NULL);
X	return obj;
X}
X
X/************************************************************************/
Xextern Frame frame;
Xpopup_send_mail(item, event)
XPanel_item	item;
XEvent		*event;
X{
X	if (dialog == NULL) {
X	   dialog = xrolo_mail_objects_initialize(NULL, frame);
X	   place_dialog(frame, dialog->mail);
X	   xv_set(dialog->other_address, WIN_SHOW, FALSE, NULL);
X	   }
X	xv_set(dialog->mail, XV_SHOW, TRUE, NULL);
X	xv_set(item, PANEL_NOTIFY_STATUS, XV_OK, 0);
X}
X
X/************************************************************************/
Xvoid	handle_address(item, value, event)
X
XPanel_item	item;
Xint		value;
XEvent		*event;
X
X{
X	if (value == 2) {
X	   xv_set(dialog->other_address, WIN_SHOW, TRUE, NULL);
X	   panel_paint(dialog->address, PANEL_NO_CLEAR);
X	   panel_paint(dialog->other_address, PANEL_NO_CLEAR);
X	   }
X	else {
X	   xv_set(dialog->other_address, WIN_SHOW, FALSE, NULL);
X	   panel_paint(dialog->address, PANEL_NO_CLEAR);
X	   }
X}
X
X/************************************************************************/
Xvoid	done_mail(frame)
X
XFrame		frame;
X
X{
X	textsw_reset(dialog->message, 0, 0);
X	xv_set(frame, XV_SHOW, FALSE, 0);
X}
X
X/************************************************************************/
X	void	send_mail(item, event)
X
XPanel_item	item;
XEvent		*event;
X
X{	char	cmd[1024], *buf;
X	int	val, size;
X	FILE	*pipe;
X
X	xv_set(item, PANEL_NOTIFY_STATUS, XV_ERROR, 0);
X	val = (int) xv_get(dialog->address, PANEL_VALUE);
X	if (val != 2)
X	   sprintf(cmd, "%s %s", MAILER, xv_get(dialog->address, PANEL_CHOICE_STRING, val));
X	else {
X	   buf = (char *) xv_get(dialog->other_address, PANEL_VALUE);
X	   if (is_empty(buf)) {
X	      error("You must specify an alternate address before sending your message");
X	      return;
X	      }
X	   else
X	      sprintf(cmd, "%s %s", MAILER, buf);
X	   }
X	size = (int) xv_get(dialog->message, TEXTSW_LENGTH);
X	if (size == 0) {
X	   error("Please type a message before sending the mail");
X	   return;
X	   }
X	if ((pipe = popen(cmd, "w")) == NULL) {
X	   error("Could not invoke \"%s\" to send mail", cmd);
X	   return;
X	   }
X	lets_get_busy(frame, TRUE, NULL);
X	buf = (char *) malloc(size);
X	xv_get(dialog->message, TEXTSW_CONTENTS, 0, buf, size);
X	fprintf(pipe, "Subject: Xrolo %s patch level %d comment\n\n",
X			VERSION, PATCHLEVEL);
X	if (fwrite(buf, 1, size, pipe) != size) {
X	   error("Could not write message to the mailer");
X	   free(buf);
X	   return;
X	   }
X	pclose(pipe);
X	free(buf);
X	textsw_reset(dialog->message, 0, 0);
X	lets_get_busy(frame, FALSE, NULL);
X	xv_set(item, PANEL_NOTIFY_STATUS, XV_OK, 0);
X}
X
X/************************************************************************/
Xvoid	cancel_mail(item, event)
X
XPanel_item	item;
XEvent		*event;
X
X{
X	textsw_reset(dialog->message, 0, 0);
X	xv_set(item, PANEL_NOTIFY_STATUS, XV_OK, 0);
X}
X
Xplace_dialog(base, dialog)
XXv_opaque	base;
XXv_opaque	dialog;
X{	
X	Rect		br, dr, sr;
X	XWMHints	*hints;
X
X	sr = *((Rect *) xv_get(base, WIN_SCREEN_RECT));
X	frame_get_rect(base, &br);
X	frame_get_rect(dialog, &dr);
X	if (rect_right(&br) + dr.r_width < sr.r_width) {
X	   dr.r_left = rect_right(&br);
X	   dr.r_top = br.r_top;
X	   }
X	else if (dr.r_width <= br.r_left) {
X	   dr.r_left = br.r_left - dr.r_width;
X	   dr.r_top = br.r_top;
X	   }
X	else {
X	   dr.r_left = br.r_left + 32;
X	   dr.r_top = br.r_top + 32;
X	   }
X	if (dr.r_top + dr.r_height > sr.r_height)
X	   dr.r_top = sr.r_height - dr.r_height;
X	if (dr.r_top < 0)
X	   dr.r_top = 0;
X	frame_set_rect(dialog, &dr);
X
X	hints = XGetWMHints(xv_get(dialog, XV_DISPLAY), xv_get(dialog, XV_XID));
X	hints->flags |= StateHint;
X	hints->initial_state = NormalState;
X	XSetWMHints(xv_get(dialog, XV_DISPLAY), xv_get(dialog, XV_XID), hints);
X	XFree(hints);
X}
X
Xerror(a, b, c, d, e, f)
Xchar	*a, *b, *c, *d, *e, *f;
X{	char	buf[512];
X
X	sprintf(buf, a, b, c, d, e, f);
X	notice_prompt(frame, NULL,
X		         NOTICE_MESSAGE_STRINGS, buf, 0,
X		         NOTICE_BUTTON_YES, "OK",
X		      0);
X}
X
Xint	is_empty(s)
Xchar	*s;
X{
X	if (s == NULL)
X	   return(TRUE);
X	for (; *s; s++)
X	   if (!isspace(*s))
X	      return(FALSE); 
X	return(TRUE);
X}
X
Xstatic set_busy(base, busy, skip)
XFrame	base;
Xint	busy;
XFrame	skip;
X{	Frame	subframe;
X	int	i;
X
X	for (i = 1; subframe = (Frame) xv_get(base, FRAME_NTH_SUBFRAME, i); i++)
X	   if (subframe != skip)
X	      if (xv_get(subframe, XV_SHOW))
X	         xv_set(subframe, FRAME_BUSY, busy, NULL);
X	xv_set(base, FRAME_BUSY, busy, NULL);
X}
X
Xlets_get_busy(base, busy, skip)
XFrame	base;
Xint	busy;
XFrame	skip;
X{	static	int	depth = 0;
X
X	if (busy) {
X	   if (depth == 0)
X	      set_busy(base, TRUE, skip);
X	   depth++;
X	   }
X	else if (depth > 0)
X	   if (--depth == 0)
X	      set_busy(base, FALSE, NULL);
X}
END_OF_FILE
if test 12988 -ne `wc -c <'send_mail.c'`; then
    echo shar: \"'send_mail.c'\" unpacked with wrong size!
fi
# end of 'send_mail.c'
fi
if test -f 'xrolo.patch2' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'xrolo.patch2'\"
else
echo shar: Extracting \"'xrolo.patch2'\" \(26657 characters\)
sed "s/^X//" >'xrolo.patch2' <<'END_OF_FILE'
X*** ../v2.2/Imakefile	Thu Nov 15 13:59:23 1990
X--- Imakefile	Mon Jan  7 11:05:04 1991
X***************
X*** 4,9 ****
X--- 4,12 ----
X  # --Luis Soltero (luis at rice.edu), 10/10/90
X  #
X  
X+ MAILER = /usr/ucb/mail
X+ VERSION = 2.0
X+ 
X  #
X  # linking against openlook libraries on suns after patching ol_button.c. 
X  # see README for details.
X***************
X*** 15,24 ****
X  # LOCAL_LIBRARIES = -lxview -lolgx
X  
X  		CDEBUGFLAGS = -g
X!            SRCS = main.c panel.c cards.c popup.c
X!            OBJS = main.o panel.o cards.o popup.o 
X         INCLUDES = -I$$OPENWINHOME/include
X!         DEFINES = -DSTANDALONE
X  
X  AllTarget(xrolo)
X  NormalProgramTarget(xrolo,$(OBJS),$(DEPLIBS), $(LOCAL_LIBRARIES), $(XLIB))
X--- 18,27 ----
X  # LOCAL_LIBRARIES = -lxview -lolgx
X  
X  		CDEBUGFLAGS = -O
X!            SRCS = main.c panel.c cards.c popup.c send_mail.c
X!            OBJS = main.o panel.o cards.o popup.o send_mail.o
X         INCLUDES = -I$$OPENWINHOME/include
X!         DEFINES = -DSTANDALONE -DMAILER=\"$(MAILER)\" -DVERSION=\"$(VERSION)\"
X  
X  AllTarget(xrolo)
X  NormalProgramTarget(xrolo,$(OBJS),$(DEPLIBS), $(LOCAL_LIBRARIES), $(XLIB))
X*** ../v2.2/Patchlevel	Thu Nov 15 13:01:10 1990
X--- Patchlevel	Mon Jan  7 11:04:11 1991
X***************
X*** 1,39 ****
X! Rolo, release 2.0, patch level 2
X  
X  Patch 2:
X! 	this version only runs under X and the XView toolkit or
X! 	OpenWindows version 1.1 and up.
X  
X! 	Added print button and X resource to set default print command.
X  
X! 	Fixed problems with selection service.
X  
X! 	Added file name query panel for Save/Load to/from named file.
X! 	The old method of using the selection service to enter file
X! 	names is still supported.  Query Panel only appears if there is
X! 	no text in the selection service.
X  
X! 	Added ability to go to selection in list by clicking on the
X! 	entry and <SHIFT>-click on listbutton.
X  
X! 	Added capital insensitive search and X resource to set the
X! 	default search mode.
X  
X! 	Changed the find button icon.
X  
X! 	Changed panel layout to be more space efficient.
X  
X  Patch 1:
X    main.c:
X! 	Add missing 0 to end of icon_create() attribute list, caused a
X! 	seg fault on SPARC systems.
X  
X! 	Break card text subwindow setup into two parts to avoid SunView
X! 	bug which causes a seg fault if user has selected retained text
X! 	subwindows in the Defaults database.
X  
X! 	Re-organize the method windows are setup and the way command line args
X! 	are handled so that user-specified window parms are handled properly.
X  
X    README:
X! 	Update info about which systems Rolo will run on.
X--- 1,61 ----
X! Rolo, release 2.0, patch level 3
X  
X+ Patch 3:
X+     Added rudimentary field sort. Each line in the rolo card is
X+     considered to be a separate field.  A filed sort can be acomplished by
X+     pointing and clicking on the desired field before invoking the sort. 
X+ 
X+     Added Mail to Author menu entry to Help button.  This menu entry
X+     allows users to mail comments to me directly.
X+ 
X+     Exchanged location of Find and End button to reduce the amount of
X+     mouse travel needed execute a find.
X+ 
X+     fixed bug which caused xrolo to core when setting the default print
X+     command from the menu selection with out having previously set the
X+     xrolo.PrintCommand resource.
X+ 
X+     Added case [in]sensitive sorting.  There is a new menu item which
X+     allows you to set the sort mode.  The xrolo.CaseInsensitive resource
X+     can be used to set the default search mode.
X+ 
X+     Added the xrolo.TextWidth resource which allows setting the
X+     default text window width in pixels.
X+ 
X  Patch 2:
X!     this version only runs under X and the XView toolkit or
X!     OpenWindows version 1.1 and up.
X  
X!     Added print button and X resource to set default print command.
X  
X!     Fixed problems with selection service.
X  
X!     Added file name query panel for Save/Load to/from named file.
X!     The old method of using the selection service to enter file
X!     names is still supported.  Query Panel only appears if there is
X!     no text in the selection service.
X  
X!     Added ability to go to selection in list by clicking on the
X!     entry and <SHIFT>-click on listbutton.
X  
X!     Added capital insensitive search and X resource to set the
X!     default search mode.
X  
X!     Changed the find button icon.
X  
X!     Changed panel layout to be more space efficient.
X  
X  Patch 1:
X    main.c:
X!     Add missing 0 to end of icon_create() attribute list, caused a
X!     seg fault on SPARC systems.
X  
X!     Break card text subwindow setup into two parts to avoid SunView
X!     bug which causes a seg fault if user has selected retained text
X!     subwindows in the Defaults database.
X  
X!     Re-organize the method windows are setup and the way command line args
X!     are handled so that user-specified window parms are handled properly.
X  
X    README:
X!     Update info about which systems Rolo will run on.
X*** ../v2.2/cards.c	Fri Nov  2 13:19:16 1990
X--- cards.c	Mon Jan  7 11:04:14 1991
X***************
X*** 41,46 ****
X--- 41,47 ----
X  #include <xview/xview.h>
X  #include <sys/file.h>
X  #include <ctype.h>
X+ #include <alloca.h>
X  
X  #include "defs.h"
X  
X***************
X*** 658,670 ****
X   *	with the first non-blank character in the card.
X   */
X  
X! static
X! int
X! sort_up (pp1, pp2)
X  	struct card	**pp1, **pp2;
X  {
X! 	return (strcmp (first_char ((*pp1)->c_text),
X! 		first_char ((*pp2)->c_text)));
X  }
X  
X  
X--- 659,720 ----
X   *	with the first non-blank character in the card.
X   */
X  
X! static int case_insensitive_sort;
X! static int sort_on_field;
X! 
X! static void tolowerstr(s1, s2)
X! char *s1, *s2;
X! {
X! 	while ( *s2 != '\0' ) {
X! 		*s1 = isupper(*s2) ? tolower(*s2) : *s2;
X! 		s1++;
X! 		s2++;
X! 	}
X! }
X! 
X! static int strcasecmp(s1,s2)
X! char *s1, *s2;
X! {
X! 	char *alloca();
X! 	char *p1;
X! 	char *p2;
X! 
X! 	if ( *s2 == '\0' && *s1 == '\0') 
X! 	  return(0);
X! 	if (*s1 == '\0' )
X! 	  return(-1);
X! 	if (*s2 == '\0' )
X! 	  return(1);
X! 	p1 = alloca(strlen(s1)+1);
X! 	p2 = alloca(strlen(s2)+1);
X! 	tolowerstr(p1, s1);
X! 	tolowerstr(p2, s2);
X! 	return( strcmp(p1, p2) );
X! }
X! 
X! char *find_field(c)
X! char *c;
X! {
X! 	int field_no = 0;
X!     char *tp = c;
X! 	while( field_no != sort_on_field && *tp != '\0' ) {
X! 		if ( *tp++ == '\n' ) field_no++;
X! 	}
X! 	return( first_char(tp) );
X! }
X! 
X! static int sort_up (pp1, pp2)
X  	struct card	**pp1, **pp2;
X  {
X! 	char *p1 = (*pp1)->c_text;
X! 	char *p2 = (*pp2)->c_text;
X! 	char *c1 = find_field (p1);
X! 	char *c2 = find_field(p2);
X! 	if ( case_insensitive_sort )
X! 	  return (strcasecmp (c1, c2) ); 
X! 	else
X! 	  return (strcmp ( c1, c2)); 
X! 
X  }
X  
X  
X***************
X*** 674,686 ****
X   *	comparison.
X   */
X  
X! static
X! int
X! sort_down (pp1, pp2)
X  	struct card	**pp1, **pp2;
X  {
X! 	return (strcmp (first_char ((*pp2)->c_text),
X! 		first_char ((*pp1)->c_text)));
X  }
X  
X  
X--- 724,741 ----
X   *	comparison.
X   */
X  
X! static int sort_down (pp1, pp2)
X  	struct card	**pp1, **pp2;
X  {
X! 	char *p1 = (*pp1)->c_text;
X! 	char *p2 = (*pp2)->c_text;
X! 	char *c1 = find_field (p1);
X! 	char *c2 = find_field(p2);
X! 	if ( case_insensitive_sort )
X! 	  return (strcasecmp (c2,c1));
X! 	else
X! 	  return (strcmp (c2,c1));
X! 
X  }
X  
X  
X***************
X*** 696,703 ****
X   */
X  
X  void
X! sort_cards (descend)
X! 	int		descend;
X  {
X  	struct	card	**a, *p;
X  	int		i, cards = last->c_num;
X--- 751,760 ----
X   */
X  
X  void
X! sort_cards (descend, file_menu, field)
X! int		descend;
X! Menu_item file_menu;
X! int field;
X  {
X  	struct	card	**a, *p;
X  	int		i, cards = last->c_num;
X***************
X*** 707,712 ****
X--- 764,771 ----
X  		return;
X  	}
X  
X+ 	sort_on_field = field;
X+ 	case_insensitive_sort = xv_get(file_menu, MENU_CLIENT_DATA);
X  	a = (struct card **) calloc (cards, sizeof (struct card *));
X  	for (p = first, i = 0; p != NULL_CARD; p = p->c_next, i++)
X  		a [i] = p;
X*** ../v2.2/help.h	Thu Nov 15 13:22:25 1990
X--- help.h	Mon Jan  7 11:04:15 1991
X***************
X*** 107,117 ****
X  they were saved.  There are also items on\n\
X  this menu which will sort your cards into\n\
X  alphabetical order according to their first\n\
X! lines.  The last two items on the menu, which\n\
X! can only be selected from the menu, will load\n\
X! from or save to a named file.  You must select\n\
X! a string in some window to provide the file\n\
X! name, similar to the way the TextEdit tool\n\
X  works.  The path you give must be relative to\n\
X  your home directory (Rolo does a cd to $HOME\n\
X  when it starts up).  Saving to or loading from\n\
X--- 107,128 ----
X  they were saved.  There are also items on\n\
X  this menu which will sort your cards into\n\
X  alphabetical order according to their first\n\
X! lines.  By default, sorting is done in a case\n\
X! insensitive manner. The sort mode may be set\n\
X! by selecting the case [In]Sensitive pullright\n\
X! menu or by setting the \n\
X!        \"xrolo.CaseInsensitiveSort\"\n\
X! resource to 0 or 1. Xrolo implements a very \n\
X! rudimentary field sort. each line in the card\n\
X! is considered to be a field. Pointing and\n\
X! clicking on a selected field before invoking \n\
X! the sort will cause xrolo to sort the cards\n\
X! by the selected field. The last two items on\n\
X! the menu, which can only be selected from\n\
X! the menu, will load from or save to a named\n\
X! file.  You must select a string in some\n\
X! window to provide the file name, similar\n\
X! to the way the TextEdit tool\n\
X  works.  The path you give must be relative to\n\
X  your home directory (Rolo does a cd to $HOME\n\
X  when it starts up).  Saving to or loading from\n\
X***************
X*** 185,190 ****
X--- 196,214 ----
X  may be entered directly by typing in the\n\
X  current record field\n\
X  \n\
X+ \n",
X+ 
X+ "\
X+ RESOURCES\n\
X+    Xrolo supports a number of resources which\n\
X+ include:\n\
X+     xrolo.TextWidth - set width of text window\n\
X+                       in pixels.\n\
X+     xrolo.CaseInsensitive - 1 causes xrolo to\n\
X+          ignore case when sorting. 0 turns on\n\
X+          case sensitive sorts.\n\
X+     xrolo.PrintCommand - text string used to\n\
X+          set the default print command.\n\
X  \n",
X  
X  "\
X*** ../v2.2/main.c	Thu Nov  8 17:24:57 1990
X--- main.c	Mon Jan  7 11:04:15 1991
X***************
X*** 68,74 ****
X  
X  /* ------------------------------ Locals ----------------------------------- */
X  
X! static Frame		frame;
X  
X  static Textsw		init_card ();
X  
X--- 68,74 ----
X  
X  /* ------------------------------ Locals ----------------------------------- */
X  
X! Frame		frame;
X  
X  static Textsw		init_card ();
X  
X***************
X*** 105,110 ****
X--- 105,111 ----
X  	char	**Argv, *p;
X  	Server_image roloicon_image;
X  	Icon roloicon;
X+ 	int text_width;
X  
X  	for (i = 3; i < j; i++)	{	/* free up all the fd's */
X  		(void) close (i);
X***************
X*** 115,120 ****
X--- 116,125 ----
X  			0);
X  	Argc = scan_args (argc, argv, &Argv);
X  
X+ 	text_width = defaults_get_integer("xrolo.textwidth",
X+ 									  "xrolo.TextWidth",
X+ 									  WIN_EXTEND_TO_EDGE); 
X+ 
X  	frame = xv_create (XV_NULL, FRAME,
X  		WIN_ERROR_MSG,			"Couldn't create base window",
X  		NULL);
X***************
X*** 136,144 ****
X  		WIN_X,			0,
X  		WIN_BELOW,		panel,
X  		XV_HEIGHT,		200,
X! 		XV_WIDTH,		WIN_EXTEND_TO_EDGE,
X  		TEXTSW_CONTENTS,	"Rolo - by Ron Hitchens",
X  		0);
X  
X  	/* clear the X cut buffer */
X  	textsw_set_selection(rolocard, 0, 0, 1);
X--- 141,151 ----
X  		WIN_X,			0,
X  		WIN_BELOW,		panel,
X  		XV_HEIGHT,		200,
X! 		XV_WIDTH,		text_width,
X  		TEXTSW_CONTENTS,	"Rolo - by Ron Hitchens",
X  		0);
X+ 
X+ 	window_fit_width(panel);
X  
X  	/* clear the X cut buffer */
X  	textsw_set_selection(rolocard, 0, 0, 1);
X*** ../v2.2/panel.c	Thu Nov 15 12:40:52 1990
X--- panel.c	Mon Jan  7 11:04:16 1991
X***************
X*** 41,46 ****
X--- 41,47 ----
X  #include <xview/textsw.h>
X  #include <xview/seln.h>
X  #include <xview/notice.h>
X+ #include <xview/defaults.h>
X  #include <sys/param.h>
X  #include <ctype.h>
X  #include <alloca.h>
X***************
X*** 102,108 ****
X    delete_button_undelete_before(), 
X    file_button (), file_button_save(), file_button_reload(), file_button_sort(),
X    file_button_sort_backwards(), file_button_load(),
X!   file_button_save_to_file(),
X  
X    done_button (), done_n_save(), done_n_save_exit(), done_n_exit(),
X    find_button (), find_button_forward(), find_button_reverse(),
X--- 103,110 ----
X    delete_button_undelete_before(), 
X    file_button (), file_button_save(), file_button_reload(), file_button_sort(),
X    file_button_sort_backwards(), file_button_load(),
X!   file_button_save_to_file(), turn_on_case_insensitive_sort(),
X!   turn_off_case_insensitive_sort(), 
X  
X    done_button (), done_n_save(), done_n_save_exit(), done_n_exit(),
X    find_button (), find_button_forward(), find_button_reverse(),
X***************
X*** 110,120 ****
X  
X    print_button(), print_entry(), print_all(), set_print_command(),
X  
X!   list_button_main(), list_goto_button(), list_button (), help_button (),
X    slider_proc (), button_event(), goto_card (),
X    no_comprendo ();
X  
X! static Menu_item list_menu, find_menu;
X  static char		*get_selection ();
X  
X  
X--- 112,124 ----
X  
X    print_button(), print_entry(), print_all(), set_print_command(),
X  
X!   list_button_main(), list_goto_button(), list_button (),
X!   help_button(), popup_send_mail(),
X! 
X    slider_proc (), button_event(), goto_card (),
X    no_comprendo ();
X  
X! static Menu_item list_menu, find_menu, file_menu;
X  static char		*get_selection ();
X  
X  
X***************
X*** 272,313 ****
X          XV_Y, xv_row(panel, 0),
X  		0);
X  
X! 	tmpmenu = menu_create (
X! 						   MENU_ACTION_ITEM,
X! 						   "      Save Cards to Disk  ",
X! 						   file_button_save,
X  
X! 						   MENU_ACTION_ITEM,
X! 						   "  (S) Reload From Disk    ",
X! 						   file_button_reload,
X  
X! 						   MENU_ACTION_ITEM,
X! 						   "  (C) Sort Cards          ",
X! 						   file_button_sort,
X  
X! 						   MENU_ACTION_ITEM,
X! 						   "(S+C) Sort Backwards      ",
X! 						   file_button_sort_backwards,
X  
X! 						   MENU_ACTION_ITEM,
X! 						   "      Load From Named File",
X! 						   file_button_load,
X  
X! 						   MENU_ACTION_ITEM,
X! 						   "      Save To Named File  ",
X! 						   file_button_save_to_file,
X! 						   NULL);
X  
X  	(void) xv_create (panel, PANEL_BUTTON,
X  					  PANEL_LABEL_IMAGE,	pr_region(buttons2_image, 64, 0, 0, 32, 32),
X  					  PANEL_NOTIFY_PROC,	file_button,
X! 					  PANEL_ITEM_MENU, tmpmenu,
X  					  XV_X, xv_col(panel, 0),
X  					  XV_Y, xv_row(panel, 1),
X  					  0);
X  
X  	tmpmenu = menu_create (
X! 						   MENU_ACTION_ITEM, "Display Help Message", help_button, 
X  						   NULL);
X  
X  	(void) xv_create (panel, PANEL_BUTTON,
X--- 276,356 ----
X          XV_Y, xv_row(panel, 0),
X  		0);
X  
X! #define CASE_INSENSITIVE_SORT_STR "Case Insensitive Sort"
X! #define CASE_SORT_STR             "Case Sensitive Sort"
X  
X! 	tmpmenu = menu_create(
X! 						  MENU_ITEM,
X! 						  MENU_STRING,
X! 						  CASE_INSENSITIVE_SORT_STR,
X! 						  MENU_NOTIFY_PROC,
X! 						  turn_on_case_insensitive_sort,
X! 						  NULL,
X! 						  
X! 						  MENU_ITEM,
X! 						  MENU_STRING,
X! 						  CASE_SORT_STR,
X! 						  MENU_NOTIFY_PROC,
X! 						  turn_off_case_insensitive_sort,
X! 						  NULL,
X  
X! 						  NULL);
X  
X! 	file_menu = menu_create (
X! 							 MENU_ACTION_ITEM,
X! 							 "      Save Cards to Disk  ",
X! 							 file_button_save,
X  
X! 							 MENU_ACTION_ITEM,
X! 							 "  (S) Reload From Disk    ",
X! 							 file_button_reload,
X  
X! 							 MENU_ACTION_ITEM,
X! 							 "  (C) Sort Cards          ",
X! 							 file_button_sort,
X  
X+ 							 MENU_ACTION_ITEM,
X+ 							 "(S+C) Sort Backwards      ",
X+ 							 file_button_sort_backwards,
X+ 
X+ 							 MENU_CLIENT_DATA, 
X+ 							 defaults_get_integer("xrolo.caseinsensitivesort",
X+ 												  "xrolo.CaseInsensitiveSort",
X+ 												  1), /* sloppy regex by */
X+ 							                          /* default */
X+ 
X+ 							 MENU_ITEM,
X+ 							 MENU_STRING, 
X+ 							 defaults_get_integer("xrolo.caseinsensitivesort",
X+ 												  "xrolo.CaseInsensitiveSort",
X+ 												  1) 
X+ 							 ? CASE_INSENSITIVE_SORT_STR : CASE_SORT_STR,
X+ 							 MENU_CLIENT_DATA, 1, 
X+ 							 MENU_PULLRIGHT, tmpmenu,
X+ 							 NULL,
X+ 						   
X+ 							 MENU_ACTION_ITEM,
X+ 							 "      Load From Named File",
X+ 							 file_button_load,
X+ 
X+ 							 MENU_ACTION_ITEM,
X+ 							 "      Save To Named File  ",
X+ 							 file_button_save_to_file,
X+ 							 NULL);
X+ 
X  	(void) xv_create (panel, PANEL_BUTTON,
X  					  PANEL_LABEL_IMAGE,	pr_region(buttons2_image, 64, 0, 0, 32, 32),
X  					  PANEL_NOTIFY_PROC,	file_button,
X! 					  PANEL_ITEM_MENU, file_menu,
X  					  XV_X, xv_col(panel, 0),
X  					  XV_Y, xv_row(panel, 1),
X  					  0);
X  
X  	tmpmenu = menu_create (
X! 						   MENU_ACTION_ITEM, "Display Help Message",
X! 						   help_button, 
X! 						   MENU_ACTION_ITEM, "Send Mail to Author",
X! 						   popup_send_mail, 
X  						   NULL);
X  
X  	(void) xv_create (panel, PANEL_BUTTON,
X***************
X*** 316,383 ****
X          XV_Y, xv_row(panel, 1),
X  		0);
X  
X- 	tmpmenu = menu_create (
X- 						   MENU_ACTION_ITEM, 
X- 						   "   Save Changes and Close  ", 
X- 						   done_n_save,
X- 
X- 						   MENU_ACTION_ITEM,
X- 						   "(S) Exit Rolo, Save Changes ",
X- 						   done_n_save_exit,
X- 						   
X- 						   MENU_ACTION_ITEM,
X- 						   "(C) Exit, Don't Save Changes", 
X- 						   done_n_exit,
X- 						   NULL);
X- 	(void) xv_create (panel, PANEL_BUTTON,
X- 		PANEL_LABEL_IMAGE,	pr_region(buttons2_image, 64, 0, 32, 32, 32),
X- 		PANEL_NOTIFY_PROC,	done_button,
X- 		PANEL_ITEM_MENU,	tmpmenu,
X-         XV_Y, xv_row(panel, 1),
X- 		0);
X- 
X- 	tmpmenu = menu_create(
X- 						  MENU_ACTION_ITEM, 
X- 						  "Print Entry",
X- 						  print_entry,
X- 
X- 						  MENU_ACTION_ITEM, 
X- 						  "Print All",
X- 						  print_all,
X- 
X- 						  MENU_ACTION_ITEM,
X- 						  "Set Print Command",
X- 						  set_print_command,
X- 						  NULL);
X- 
X- 	(void) xv_create(panel, PANEL_BUTTON,
X- 					 PANEL_LABEL_IMAGE, xv_create(NULL, SERVER_IMAGE,
X- 												  XV_WIDTH, 32,
X- 												  XV_HEIGHT, 32,
X- 												  SERVER_IMAGE_BITS,
X- 												  printer_image,
X- 												  NULL),
X- 					 PANEL_NOTIFY_PROC, print_button,
X- 					 PANEL_ITEM_MENU, tmpmenu,
X- 					 XV_Y, xv_row(panel, 1),
X- 
X- 					 NULL);
X- 	/*
X- 	 * Tighten up the window around the buttons in the first row, this
X- 	 * will be the width of the panel window, so we save that size for
X- 	 * later reference.  We also ask for the width of the panel in
X- 	 * columns for computing the width of the find pattern text item.
X- 	 */
X- 	window_fit_width (panel); 
X- 	panel_width = (int) xv_get (panel, XV_WIDTH);
X- 	panel_columns = (int) xv_get (panel, WIN_COLUMNS);
X- 
X- 	/*
X- 	 * Begin second row, set the inter-item gap so the Find button and
X- 	 * the text item following it are placed nicely.
X- 	 */
X- 	xv_set (panel, PANEL_ITEM_X_GAP, 8, 0);
X- 
X  #define SLOPPY_EXPR_STR	  "Sloppy Regex Match"
X  #define EGREP_EXPR_STR	  "Egrep(1) Regex Match"
X  
X--- 359,364 ----
X***************
X*** 436,441 ****
X--- 417,485 ----
X  					  PANEL_NOTIFY_PROC,	find_button,
X  					  NULL);
X  
X+ 	tmpmenu = menu_create(
X+ 						  MENU_ACTION_ITEM, 
X+ 						  "Print Entry",
X+ 						  print_entry,
X+ 
X+ 						  MENU_ACTION_ITEM, 
X+ 						  "Print All",
X+ 						  print_all,
X+ 
X+ 						  MENU_ACTION_ITEM,
X+ 						  "Set Print Command",
X+ 						  set_print_command,
X+ 						  NULL);
X+ 
X+ 	(void) xv_create(panel, PANEL_BUTTON,
X+ 					 PANEL_LABEL_IMAGE, xv_create(NULL, SERVER_IMAGE,
X+ 												  XV_WIDTH, 32,
X+ 												  XV_HEIGHT, 32,
X+ 												  SERVER_IMAGE_BITS,
X+ 												  printer_image,
X+ 												  NULL),
X+ 					 PANEL_NOTIFY_PROC, print_button,
X+ 					 PANEL_ITEM_MENU, tmpmenu,
X+ 					 XV_Y, xv_row(panel, 1),
X+ 
X+ 					 NULL);
X+ 
X+ 	tmpmenu = menu_create (
X+ 						   MENU_ACTION_ITEM, 
X+ 						   "   Save Changes and Close  ", 
X+ 						   done_n_save,
X+ 
X+ 						   MENU_ACTION_ITEM,
X+ 						   "(S) Exit Rolo, Save Changes ",
X+ 						   done_n_save_exit,
X+ 						   
X+ 						   MENU_ACTION_ITEM,
X+ 						   "(C) Exit, Don't Save Changes", 
X+ 						   done_n_exit,
X+ 						   NULL);
X+ 	(void) xv_create (panel, PANEL_BUTTON,
X+ 		PANEL_LABEL_IMAGE,	pr_region(buttons2_image, 64, 0, 32, 32, 32),
X+ 		PANEL_NOTIFY_PROC,	done_button,
X+ 		PANEL_ITEM_MENU,	tmpmenu,
X+         XV_Y, xv_row(panel, 1),
X+ 		0);
X+ 
X+ 	/*
X+ 	 * Tighten up the window around the buttons in the first row, this
X+ 	 * will be the width of the panel window, so we save that size for
X+ 	 * later reference.  We also ask for the width of the panel in
X+ 	 * columns for computing the width of the find pattern text item.
X+ 	 */
X+ 	window_fit_width (panel); 
X+ 	panel_width = (int) xv_get (panel, XV_WIDTH);
X+ 	panel_columns = (int) xv_get (panel, WIN_COLUMNS);
X+ 
X+ 	/*
X+ 	 * Begin second row, set the inter-item gap so the Find button and
X+ 	 * the text item following it are placed nicely.
X+ 	 */
X+ 	xv_set (panel, PANEL_ITEM_X_GAP, 8, 0);
X+ 
X  	regex_item = xv_create (panel, PANEL_TEXT,
X  							PANEL_BLINK_CARET,		TRUE,
X  							PANEL_LABEL_STRING,		"Find Expression:",
X***************
X*** 829,834 ****
X--- 873,894 ----
X  	init_rolo (rolofile);
X  }
X  
X+ find_field_no()
X+ {
X+ 	int i = xv_get(rolocard, TEXTSW_INSERTION_POINT);
X+ 	int len = xv_get(rolocard, TEXTSW_LENGTH);
X+ 	char *c = (char *)alloca(len+1);
X+ 	char *tp = c+i;
X+ 	int field_cnt = 0;
X+ 	xv_get(rolocard, TEXTSW_CONTENTS, 0, c, len);
X+ 	if ( *tp == '\n' ) tp--;
X+ 	do {
X+ 		if ( *tp == '\n' ) 
X+ 		  field_cnt++;
X+ 	} while ( tp-- != c );
X+ 	return(field_cnt);
X+ }
X+ 
X  static void file_button_sort (item, event)
X  Panel_item	item;
X  Event		*event;
X***************
X*** 838,844 ****
X  		return;
X  	}
X  	save_card (current);
X! 	sort_cards (FALSE);
X  	need_save = TRUE;
X  }
X  
X--- 898,904 ----
X  		return;
X  	}
X  	save_card (current);
X! 	sort_cards (FALSE, file_menu, find_field_no());
X  	need_save = TRUE;
X  }
X  
X***************
X*** 851,857 ****
X  		return;
X  	}
X  	save_card (current);
X! 	sort_cards (TRUE);
X  	need_save = TRUE;
X  }
X  
X--- 911,917 ----
X  		return;
X  	}
X  	save_card (current);
X! 	sort_cards (TRUE, file_menu, find_field_no());
X  	need_save = TRUE;
X  }
X  
X***************
X*** 1026,1032 ****
X--- 1086,1120 ----
X  	in_file_button = 1;
X  }
X  
X+ static void turn_on_case_insensitive_sort(item, event)
X+ Panel_item	item;
X+ Event		*event;
X+ {
X+ 	Menu_item file_item = xv_find(file_menu, MENUITEM, 
X+ 								  MENU_CLIENT_DATA, 1, NULL);
X+ 	if ( file_item == NULL ) {
X+ 		confirm("turn_on_case_insensitive_sort: Bad news!");
X+ 		return;
X+ 	}
X+ 	xv_set(file_item, MENU_STRING, CASE_INSENSITIVE_SORT_STR, NULL);
X+ 	xv_set(file_menu, MENU_CLIENT_DATA, 1);
X+ }
X  
X+ static void turn_off_case_insensitive_sort(item, event)
X+ Panel_item	item;
X+ Event		*event;
X+ {
X+ 	Menu_item file_item = xv_find(file_menu, MENUITEM, 
X+ 								  MENU_CLIENT_DATA, 1, NULL);
X+ 	if ( file_item == NULL ) {
X+ 		confirm("turn_off_case_insensitive_sort: Bad news!");
X+ 		return;
X+ 	}
X+ 	xv_set(file_item, MENU_STRING, CASE_SORT_STR, NULL);
X+ 	xv_set(file_menu, MENU_CLIENT_DATA, 0);
X+ }
X+ 
X+ 
X  /*
X   *	Notification proc for the "Done" button.  This covers both closing
X   *	the tool and exiting.  (The checkered flag button is supposed to
X***************
X*** 1114,1121 ****
X  
X  get_print_resource()
X  {
X! 	strcpy(Print_Command, 
X! 		   defaults_get_string("xrolo.printcommand","xrolo.PrintCommand", Print_Command));
X  	First_Print_Call = 0;
X  }
X  
X--- 1202,1211 ----
X  
X  get_print_resource()
X  {
X!  	char *p = defaults_get_string("xrolo.printcommand",
X!  		"xrolo.PrintCommand", Print_Command);
X!  	if (p != NULL)
X!  		strcpy(Print_Command, p);
X  	First_Print_Call = 0;
X  }
X  
X*** ../v2.2/popup.c	Fri Nov  2 13:19:20 1990
X--- popup.c	Mon Jan  7 11:04:17 1991
X***************
X*** 16,23 ****
X--- 16,27 ----
X  #define X_GAP		25
X  #define Y_GAP		30
X  
X+ #ifndef MAX
X  #define MAX(a,b)	(((a)>(b))?(a):(b))
X+ #endif
X+ #ifndef MIN
X  #define MIN(a,b)	(((a)<(b))?(a):(b))
X+ #endif
X  
X  
X  /* ---------------------------- Imports -------------------------------- */
X*** ../v2.2/xrolo.man	Thu Nov 15 13:25:44 1990
X--- xrolo.man	Mon Jan  7 11:04:10 1991
X***************
X*** 1,7 ****
X  \" @(#)rolo.1	2.2 8/14/88
X  .TH ROLO 1 "August 1988"
X  .SH NAME
X! rolo \- SunView tool to manage notes like a Rolodex
X  .SH SYNOPSIS
X  .B rolo [file]
X  .SH DESCRIPTION
X--- 1,7 ----
X  \" @(#)rolo.1	2.2 8/14/88
X  .TH ROLO 1 "August 1988"
X  .SH NAME
X! xrolo \- OpenWindows tool to manage notes like a Rolodex
X  .SH SYNOPSIS
X  .B rolo [file]
X  .SH DESCRIPTION
X***************
X*** 61,67 ****
X  on this button deletes the card which is
X  currently displayed.  Deleted cards are not
X  lost, they are saved on a stack of deleted
X! cards and may be retreived any time before
X  .I Rolo
X  exits.  The alternate selections on the
X  menu for the Trash button may be used to
X--- 61,67 ----
X  on this button deletes the card which is
X  currently displayed.  Deleted cards are not
X  lost, they are saved on a stack of deleted
X! cards and may be retrieved any time before
X  .I Rolo
X  exits.  The alternate selections on the
X  menu for the Trash button may be used to
X***************
X*** 111,117 ****
X  they were saved.  There are also items on
X  this menu which will sort your cards into
X  alphabetical order according to their first
X! lines.  The last two items on the menu, which
X  can only be selected from the menu, will load
X  from or save to a named file.  You must select
X  a string in some window to provide the file
X--- 111,126 ----
X  they were saved.  There are also items on
X  this menu which will sort your cards into
X  alphabetical order according to their first
X! lines.  By default, sorting is done in a case
X! insensitive manner. The sort mode may be set
X! by selecting the case [In]Sensitive pullright
X! menu or by setting the xrolo.CaseInsensitiveSort
X! resource to 0 or 1. Xrolo implements a very 
X! rudimentary field sort. each line in the card
X!  is considered to be a field. Pointing and
X! clicking on a selected field before invoking
X! the sort will cause xrolo to sort the cards
X! by the selected field. The last two items on the menu, which
X  can only be selected from the menu, will load
X  from or save to a named file.  You must select
X  a string in some window to provide the file
X***************
X*** 201,206 ****
X--- 210,225 ----
X  of the card you wish to see is displayed to
X  the left of the slider, then release the
X  mouse button.
X+ .TP
X+ RESOURCES
X+ Xrolo supports a number of resources which include:
X+ 
X+ xrolo.TextWidth - set width of text window in pixels.
X+ 
X+ xrolo.CaseInsensitive - 1 causes xrolo to ignore case when sorting. 
X+ 0 turns on case sensitive sorts.
X+ 
X+ xrolo.PrintCommand - text string used to set the default print command.
X  .SH FILES
X  .TP
X  $HOME/.rolo
END_OF_FILE
if test 26657 -ne `wc -c <'xrolo.patch2'`; then
    echo shar: \"'xrolo.patch2'\" unpacked with wrong size!
fi
# end of 'xrolo.patch2'
fi
echo shar: End of archive 1 \(of 1\).
cp /dev/null ark1isdone
MISSING=""
for I in 1 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have the archive.
    rm -f ark[1-9]isdone
else
    echo You still need to unpack the following archives:
    echo "        " ${MISSING}
fi
##  End of shell archive.
exit 0

--
dan
----------------------------------------------------
O'Reilly && Associates   argv at sun.com / argv at ora.com
Opinions expressed reflect those of the author only.



More information about the Comp.sources.x mailing list