Imported Upstream version 5.0.20060507

parent 0c054c52
Cdk Version Change List
Copyright Mike Glover, 1995, 1996, 1997, 1998, 1999
Modifications copyright Thomas E. Dickey 1999-2004, 2005
Modifications copyright Thomas E. Dickey 1999-2005, 2006
-------------------------------------------------------------------------------
This file outlines all of the changes/additions from one release to another.
2006/05/07
+ reduce the number of calls on touchwin(), which is used mainly for
cleanup after moving a window.
+ improve focus in alphalist.c and fselect.c to ensure that the
dependent scroll widget highlights data after losing focus to the
entry widget (report by Harry Brueckner).
+ add getCDKScrollCurrentItem(), setCDKScrollCurrentItem(),
getCDKScrollCurrentTop() and setCDKScrollCurrentTop().
+ add getCDKFselectCurrentItem(), setCDKFselectCurrentItem(), use these
in fselect_ex.c to illustrate how to modify list displayed by
the fselect widget.
+ add getCDKAlphalistCurrentItem(), setCDKAlphalistCurrentItem(), use
these in alphalist_ex.c to illustrate how to modify list displayed by
the alphalist widget.
+ add copyCharList(), copyChtypeList(), lenCharList(), lenChtypeList().
+ fix misformatted cdk_display manpage, which did not show vINT
and some other data properly (report by Dominik Douville-Belanger).
+ split-out cdk_display.c to eliminate repeated logic in entry.c,
matrix.c and mentry.c, and implement hidden fields for the matrix
widget.
+ correct box-height for marquee widget. The box parameter was
previously ignored; this correction will make some applications no
longer show a box (report by Michael White).
+ modify logic for KEY_DC and KEY_BACKSPACE so the former only deletes
the current character, and the latter only deletes the previous,
rather than equating them. This affects alphalist, entry, mentry,
template (request by Harry Brueckner).
+ suppress conversion of control characters in getcCDKObject() if the
character is bound to another. This was last changed in 2004/8/24
(report by Harry Brueckner).
+ add check in adjustAlphalistCB() in case the list is empty (report by
Harry Brueckner).
2006/02/20
+ correct makefile dependency so $(MAN_DIR) and $(INCLUDE_DIR) are
created before headers.sed and manpage.sed, since headers.sh
relies on the existence of the destination directory (reports
by Marek Lipovean, Marcelo Goes, also Gentoo #123374).
2005/12/30
+ add some redundant pointer checks, e.g., to entry.c, to avoid core
dump if one tries building Cdk with NetBSD curses (see lib/32417).
+ split up traverseCDKScreen() to allow customized flavors of that to
be written in a calling application using the pieces:
traverseCDKOnce(), setCDKFocusFirst() (request by Jorgen Lundman).
+ restore assignment of selectedItem in setCDKRadioCurrentItem() which
was dropped in 2005/04/24 (report by Fu Steve X).
+ modify refreshCDKScreen() to ensure that only one widget will have
focus, i.e., the first which currently has focus, or if none, then
the first visible one (report by Fu Steve X).
+ use cleanCDKTemplate() consistently in the template widget, ensuring
that the editing position is updated, and that the proper length is
used when clearing memory (report by Fu Steve X).
+ modify calendar, radio, scroll, selection widgets so the cursor is
shown at the beginning of the selected item's row for better
accessibility (report by Fu Steve X).
+ add null-pointer check in setCDKViewerInfo() in case caller gives
too-large value for list size (report by Jorgen Lundman).
+ improve traverseCDKScreen() by updating curobj from the
getCDKFocusCurrent() function (patch by Jorgen Lundman).
+ add setCDKFocusCurrent() (patch by Jorgen Lundman).
+ add configure script option allowing manpage section to be changed
from "3" to other values such as "3CDK", e.g., for Debian.
+ modify getCDKRadioItems(), getCDKScrollItems() and
getCDKSelectionItems() to return just the list-size if the list
pointer is null.
+ correct highlighting of selected line in CDKSelection window when
the window is scrolled left/right (patch by Jorgen Lundman).
+ various manpage fixes (report by Jorgen Lundman).
+ change manpages to use ".XX" macro to indicate aliases, to make
the manpage more readable.
+ eliminate duplication between cdk_util.3 and cdk_misc.3 manpages
(dialogs belong in the former, for instance).
+ modify alphalist, itemlist, radio, selection and swindow to allow
creating a widget with an empty list (request by Harry Brueckner).
+ modify mentry.c case for KEY_RIGHT so one can move the cursor past
the end of the string to add new text (report by Harry Brueckner).
+ modify cdk_params.c to use strtol() rather than atoi() to allow
command-line parameters such as -h 0xffff for the slider examples.
+ modify gen-slider.c to use sprintf/strlen to obtain length of
formatted integer types since intlen() does not give correct result
for maximum value of unsigned type. Modify increment/decrement logic
to take into account unsigned types (report by Keith J Outwater).
+ modify cli examples to exit with 255 when reporting an error rather
than a -1 which is generally not portable.
+ fix several memory leaks exposed by valgrind in the example programs.
+ add configure --disable-leaks option to look for ncurses' debug
function _nc_free_and_exit(), using that to help with memory leak
checking. This uses a new header <cdk_test.h> which will not be
installed, since it is used only for testing in the build tree.
> patches by Phuah Yee Keat:
+ add an IsVisibleObj attribute to all CDK objects so the caller can
set some object to be invisible, and calling refreshCDKScreen
after that won't display it again, it enables one to dynamically
show or hide a particular widget based on user actions.
Note: this changes alignments in many of the structs from 5.0,
requiring an ABI bump.
+ improve string length-computation in entry.c, allowing a 1-char
field, and also allowing movement past end of text with KEY_END.
+ add setCDKRadioSelectedItem() and getCDKRadioSelectedItem().
+ fix some memory leaks by adding cleanCDKObjBindings() into all of
the _destroyXXX() functions, modify cleanCDKObjBindings() to free
and null (obj)->bindingList.
+ fix makefile for installing manpages when building outside of the
source directory (patch by Mike Castle).
+ remove obsolete lsm file
+ review/correct some functions listed in manpages but not implemented,
and the reverse (report by Rajat Das).
+ add setCDKMatrixCB() (report by 'zam).
+ update configure script (mostly fixes related to CF_XOPEN_SOURCE).
+ update config.guess, config.sub
2005/04/24 - T.E.Dickey <dickey@his.com>
+ bump major version to 5 (overdue).
+ add built-in bindings for '<' and '>' to KEY_HOME and KEY_END
......
# $Id: Makefile.in,v 1.66 2005/04/24 23:06:20 tom Exp $
# $Id: Makefile.in,v 1.74 2006/04/17 23:13:49 tom Exp $
#
# Copyright 2001-2004,2005 Thomas Dickey
# Copyright 2001-2005,2006 Thomas Dickey
# Copyright 1999, Mike Glover
# All rights reserved.
#
......@@ -64,7 +64,8 @@ mandir = $(DESTDIR)@mandir@
DOCUMENT_DIR = @prefix@/doc/cdk
INCLUDE_DIR = $(includedir)/cdk
LIB_DIR = $(libdir)
MAN_DIR = $(mandir)/man3
MAN_DIR = $(mandir)/man@MAN_DIR@
MANSECT = @MANSECT@
CC = @CC@
CPP = @CPP@
......@@ -95,7 +96,7 @@ UNINSTALL_LIB = $(LIBTOOL_UNINSTALL) $(RM)
.SUFFIXES: .c .o .os .i
DEFAULT = $(CDKLIB) headers.sed
DEFAULT = $(CDKLIB)
default :: $(DEFAULT)
......@@ -176,6 +177,7 @@ CDKSRC = \
calendar.c \
cdk.c \
cdk_compat.c \
cdk_display.c \
cdk_objs.c \
cdk_params.c \
cdkscreen.c \
......@@ -219,6 +221,7 @@ CDKMAN = \
cdk_compat.3 \
cdk_dialog.3 \
cdk_display.3 \
cdk_draw.3 \
cdk_entry.3 \
cdk_fscale.3 \
cdk_fselect.3 \
......@@ -265,7 +268,7 @@ $(CDKLIB) :: $(OBJECTS)
@echo creating $@; $(LIBTOOL_CREATE) $@ $(LIB_OBJECT)
@$(RANLIB) $@
cdkshlib $(CDKSHLIB) :: $(CDKSHOBJS) headers.sed
cdkshlib $(CDKSHLIB) :: $(CDKSHOBJS)
gcc -shared -Wl,-soname=$(SONAME) $(LDFLAGS) -o $(CDKSHLIB) $(CDKSHOBJS)
#
......@@ -320,34 +323,42 @@ uninstallCDKReadme ::
# This installs the CDK man pages.
#
install \
installCDKManPages :: headers.sed $(AUTO_MAN) $(MAN_DIR)
installCDKManPages :: $(INCLUDE_DIR) headers.sed $(MAN_DIR) manpage.sed $(AUTO_MAN)
@echo "Installing the CDK man pages in $(MAN_DIR) ..."
@for i in $(AUTO_MAN); do \
$(SHELL) $(srcdir)/headers.sh -x "$(INSTALL_DATA)" -d $(MAN_DIR) -s . $$i; \
$(SHELL) $(srcdir)/manlinks.sh installing $(srcdir) $(MAN_DIR) $$i; \
$(SHELL) $(srcdir)/headers.sh \
-x "$(INSTALL_DATA)" \
-d $(MAN_DIR) \
-s . \
-t $(MANSECT) \
-e manpage.sed $$i; \
$(SHELL) $(srcdir)/manlinks.sh installing $(srcdir) $(MAN_DIR) $(MANSECT) $$i; \
done
@for i in $(CDKMAN); do \
$(SHELL) $(srcdir)/headers.sh -x "$(INSTALL_DATA)" -d $(MAN_DIR) -s . $(srcdir)/man/$$i; \
$(SHELL) $(srcdir)/manlinks.sh installing $(srcdir) $(MAN_DIR) $(srcdir)/man/$$i; \
$(SHELL) $(srcdir)/headers.sh \
-x "$(INSTALL_DATA)" \
-d $(MAN_DIR) \
-s . \
-t $(MANSECT) \
-e manpage.sed $(srcdir)/man/$$i; \
$(SHELL) $(srcdir)/manlinks.sh installing $(srcdir) $(MAN_DIR) $(MANSECT) $(srcdir)/man/$$i; \
done
uninstall \
uninstallCDKManPages ::
@echo "Uninstalling the CDK man pages from $(MAN_DIR) ..."
@- for i in $(AUTO_MAN); do \
$(RM) $(MAN_DIR)/`basename $$i`; \
$(SHELL) $(srcdir)/manlinks.sh removing $(srcdir) $(MAN_DIR) $(srcdir)/$$i; \
$(SHELL) $(srcdir)/manlinks.sh removing $(srcdir) $(MAN_DIR) $(MANSECT) $(srcdir)/$$i; \
done
@- for i in $(CDKMAN); do \
$(RM) $(MAN_DIR)/$$i; \
$(SHELL) $(srcdir)/manlinks.sh removing $(srcdir) $(MAN_DIR) $(srcdir)/man/$$i; \
$(SHELL) $(srcdir)/manlinks.sh removing $(srcdir) $(MAN_DIR) $(MANSECT) $(srcdir)/man/$$i; \
done
#
# This installs the header files.
#
install \
installCDKHeaderFiles :: headers.sed $(MY_HDR) $(INCLUDE_DIR)
installCDKHeaderFiles :: $(INCLUDE_DIR) headers.sed $(MY_HDR)
@echo "Installing CDK header files in $(INCLUDE_DIR)..."
$(SHELL) $(srcdir)/headers.sh -x "$(INSTALL_DATA)" -d $(INCLUDE_DIR) -s $(srcdir) $(MY_HDR)
@for i in $(CDKHDR); do \
......@@ -396,6 +407,11 @@ uninstallCDKSHLibrary ::
headers.sed : $(srcdir)/headers.sh
$(SHELL) $(srcdir)/headers.sh -p CDK -c include/cdk_config.h -d $(INCLUDE_DIR) -s $(srcdir)/include -i -s include -i
manpage.sed :
@echo "creating $@"
@echo "s/(3)/($(MANSECT))/g" >$@
@echo "/^\.TH/s/\<3\>/$(MANSECT)/" >>$@
@MAKE_LOWER_TAGS@tags :
@MAKE_LOWER_TAGS@ ctags *.[ch] */*.[ch]
......@@ -409,7 +425,7 @@ clean ::
@- $(RM) -r autom4te.cache
- $(LIBTOOL_CLEAN) $(RM) $(LIB_OBJECT) $(CDKLIB)
- $(RM) *.i *.os $(CDKSHLIB)
- $(RM) headers.sed core tags *~
- $(RM) headers.sed manpage.sed core tags *~
$(RM) $(AUTO_HDR)
$(RM) $(AUTO_SRC)
$(RM) $(AUTO_MAN)
......@@ -467,11 +483,14 @@ SCALE_H = $(srcdir)/include/gen-scale.h
SCALE_C = $(srcdir)/gen-scale.c
SCALE_M = $(srcdir)/man/gen-scale.3
MKDIR_MAN = test -d man || mkdir man
include/dscale.h : $(SCALE_H)
$(GEN_SCALE) DSCALE DScale Double double $(SCALE_H) >$@
dscale.c : $(SCALE_C) $(AUTO_HDR)
$(GEN_SCALE) DSCALE DScale Double double $(SCALE_C) >$@
man/cdk_dscale.3 : $(SCALE_M) man
-$(MKDIR_MAN)
$(GEN_SCALE) DSCALE DScale Double double $(SCALE_M) >$@
include/fscale.h : $(SCALE_H)
......@@ -479,6 +498,7 @@ include/fscale.h : $(SCALE_H)
fscale.c : $(SCALE_C) $(AUTO_HDR)
$(GEN_SCALE) FSCALE FScale Float float $(SCALE_C) >$@
man/cdk_fscale.3 : $(SCALE_M) man
-$(MKDIR_MAN)
$(GEN_SCALE) FSCALE FScale Float float $(SCALE_M) >$@
include/scale.h : $(SCALE_H)
......@@ -486,6 +506,7 @@ include/scale.h : $(SCALE_H)
scale.c : $(SCALE_C) $(AUTO_HDR)
$(GEN_SCALE) SCALE Scale Int int $(SCALE_C) >$@
man/cdk_scale.3 : $(SCALE_M) man
-$(MKDIR_MAN)
$(GEN_SCALE) SCALE Scale Int int $(SCALE_M) >$@
include/uscale.h : $(SCALE_H)
......@@ -493,6 +514,7 @@ include/uscale.h : $(SCALE_H)
uscale.c : $(SCALE_C) $(AUTO_HDR)
$(GEN_SCALE) USCALE UScale Unsigned unsigned $(SCALE_C) >$@
man/cdk_uscale.3 : $(SCALE_M) man
-$(MKDIR_MAN)
$(GEN_SCALE) USCALE UScale Unsigned unsigned $(SCALE_M) >$@
SLIDER_H = $(srcdir)/include/gen-slider.h
......@@ -504,6 +526,7 @@ include/fslider.h : $(SLIDER_H)
fslider.c : $(SLIDER_C) $(AUTO_HDR)
$(GEN_SCALE) FSLIDER FSlider Float float $(SLIDER_C) >$@
man/cdk_fslider.3 : $(SLIDER_M) man
-$(MKDIR_MAN)
$(GEN_SCALE) FSLIDER FSlider Float float $(SLIDER_M) >$@
include/slider.h : $(SLIDER_H)
......@@ -511,6 +534,7 @@ include/slider.h : $(SLIDER_H)
slider.c : $(SLIDER_C) $(AUTO_HDR)
$(GEN_SCALE) SLIDER Slider Int int $(SLIDER_C) >$@
man/cdk_slider.3 : $(SLIDER_M) man
-$(MKDIR_MAN)
$(GEN_SCALE) SLIDER Slider Int int $(SLIDER_M) >$@
include/uslider.h : $(SLIDER_H)
......@@ -518,4 +542,5 @@ include/uslider.h : $(SLIDER_H)
uslider.c : $(SLIDER_C) $(AUTO_HDR)
$(GEN_SCALE) USLIDER USlider Unsigned unsigned $(SLIDER_C) >$@
man/cdk_uslider.3 : $(SLIDER_M) man
-$(MKDIR_MAN)
$(GEN_SCALE) USLIDER USlider Unsigned unsigned $(SLIDER_M) >$@
-- $Id: README,v 1.5 2005/03/26 13:05:33 tom Exp $
-- $Id: README,v 1.6 2006/05/07 23:19:21 tom Exp $
-------------------------------------------------------------------------------
Copyright Thomas Dickey 1999, 2000, 2001, 2002, 2003, 2004, 2005
Copyright Thomas Dickey 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
This is a modified/enhanced version of Cdk. The original README contents are
given below.
......
2:4:1 5.0 20050424
4:0:3 5.0 20060507
This diff is collapsed.
This diff is collapsed.
......@@ -2,8 +2,8 @@
/*
* $Author: tom $
* $Date: 2005/03/08 23:25:41 $
* $Revision: 1.50 $
* $Date: 2006/04/06 19:59:29 $
* $Revision: 1.54 $
*
* Notes:
*
......@@ -25,19 +25,19 @@ static CDKOBJS *bindableObject (EObjectType * cdktype, void *object)
if (*cdktype == vFSELECT)
{
*cdktype = vENTRY;
object = ((CDKFSELECT *) object)->entryField;
object = ((CDKFSELECT *)object)->entryField;
}
else if (*cdktype == vALPHALIST)
{
*cdktype = vENTRY;
object = ((CDKALPHALIST *) object)->entryField;
object = ((CDKALPHALIST *)object)->entryField;
}
}
else
{
object = 0;
}
return object;
return (CDKOBJS *)object;
}
/*
......@@ -96,7 +96,7 @@ void cleanCDKObjectBindings (EObjectType cdktype, void *object)
{
CDKOBJS *obj = bindableObject (&cdktype, object);
if (obj != 0)
if (obj != 0 && obj->bindingList != 0)
{
unsigned x;
......@@ -105,6 +105,7 @@ void cleanCDKObjectBindings (EObjectType cdktype, void *object)
(obj)->bindingList[x].bindFunction = 0;
(obj)->bindingList[x].bindData = 0;
}
freeAndNull ((obj)->bindingList);
}
}
......@@ -175,7 +176,9 @@ int getcCDKObject (CDKOBJS *obj)
{
result = (int)(long)test->bindingList[result].bindData;
}
else
else if (test == 0
|| (unsigned)result > test->bindingCount
|| test->bindingList[result].bindFunction == 0)
{
switch (result)
{
......@@ -214,3 +217,14 @@ int getcCDKObject (CDKOBJS *obj)
}
return result;
}
/*
* Use this function rather than getcCDKObject(), since we can extend it to
* handle wide-characters.
*/
int getchCDKObject (CDKOBJS *obj, boolean *functionKey)
{
int key = getcCDKObject (obj);
*functionKey = (key >= KEY_MIN && key <= KEY_MAX);
return key;
}
......@@ -4,8 +4,8 @@
/*
* $Author: tom $
* $Date: 2004/08/30 00:11:34 $
* $Revision: 1.29 $
* $Date: 2006/05/05 00:27:45 $
* $Revision: 1.32 $
*/
DeclareCDKObjects (BUTTON, Button, setCdk, Int);
......@@ -91,17 +91,16 @@ CDKBUTTON *newCDKButton (CDKSCREEN * cdkscreen, int xplace, int yplace, char
int activateCDKButton (CDKBUTTON * button, chtype * actions)
{
chtype input = 0;
boolean functionKey;
int ret;
drawCDKButton (button, ObjOf (button)->box);
/* Check if actions is null. */
if (actions == 0)
{
for (;;)
{
/* Get the input. */
input = getcCDKObject (ObjOf(button));
input = getchCDKObject (ObjOf(button), &functionKey);
/* Inject the character into the widget. */
ret = injectCDKButton(button, input);
......@@ -240,7 +239,7 @@ static void _drawCDKButton (CDKOBJS * object, boolean Box GCC_UNUSED)
drawObjBox (button->win, ObjOf(button));
}
drawCDKButtonText (button);
refreshCDKWindow (button->win);
wrefresh (button->win);
}
/*
......@@ -315,12 +314,13 @@ void positionCDKButton (CDKBUTTON * button)
/* Declare some variables. */
int origX = getbegx (button->win);
int origY = getbegy (button->win);
chtype key = (chtype) NULL;
chtype key = (chtype) 0;
boolean functionKey;
/* Let them move the widget around until they hit return. */
while (key != KEY_ENTER)
{
key = getcCDKObject (ObjOf(button));
key = getchCDKObject (ObjOf(button), &functionKey);
if (key == KEY_UP || key == '8')
{
if (getbegy (button->win) > 0)
......@@ -477,6 +477,9 @@ static void _destroyCDKButton (CDKOBJS * object)
deleteCursesWindow (button->shadowWin);
deleteCursesWindow (button->win);
/* Clean the key bindings. */
cleanCDKObjectBindings (vBUTTON, button);
/* Unregister the object. */
unregisterCDKObject (vBUTTON, button);
}
......
......@@ -2,8 +2,8 @@
/*
* $Author: tom $
* $Date: 2004/08/30 00:12:09 $
* $Revision: 1.59 $
* $Date: 2006/05/05 00:27:45 $
* $Revision: 1.62 $
*/
DeclareCDKObjects(BUTTONBOX, Buttonbox, setCdk, Int);
......@@ -138,9 +138,6 @@ CDKBUTTONBOX *newCDKButtonbox (CDKSCREEN *cdkscreen, int xPos, int yPos, int hei
buttonbox->shadowWin = newwin (boxHeight, boxWidth, ypos + 1, xpos + 1);
}
/* Empty the key bindings. */
cleanCDKObjectBindings (vBUTTONBOX, buttonbox);
/* Register this baby. */
registerCDKObject (cdkscreen, vBUTTONBOX, buttonbox);
......@@ -154,18 +151,17 @@ CDKBUTTONBOX *newCDKButtonbox (CDKSCREEN *cdkscreen, int xPos, int yPos, int hei
int activateCDKButtonbox (CDKBUTTONBOX *buttonbox, chtype *actions)
{
chtype input = 0;
boolean functionKey;
int ret;
/* Draw the buttonbox box. */
drawCDKButtonbox (buttonbox, ObjOf(buttonbox)->box);
/* Check if actions is null. */
if (actions == 0)
{
for (;;)
{
/* Get the input. */
input = getcCDKObject (ObjOf(buttonbox));
input = getchCDKObject (ObjOf(buttonbox), &functionKey);
/* Inject the character into the widget. */
ret = injectCDKButtonbox (buttonbox, input);
......@@ -426,7 +422,7 @@ void drawCDKButtonboxButtons (CDKBUTTONBOX *buttonbox)
}
if (cur_row >= 0 && cur_col >= 0)
wmove(buttonbox->win, cur_row, cur_col);
refreshCDKWindow (buttonbox->win);
wrefresh (buttonbox->win);
}
/*
......@@ -506,6 +502,9 @@ static void _destroyCDKButtonbox (CDKOBJS *object)
deleteCursesWindow (buttonbox->shadowWin);
deleteCursesWindow (buttonbox->win);
/* Clean the key bindings. */
cleanCDKObjectBindings (vBUTTONBOX, buttonbox);
/* Unregister this object. */
unregisterCDKObject (vBUTTONBOX, buttonbox);
}
......
......@@ -2,8 +2,8 @@
/*
* $Author: tom $
* $Date: 2004/12/23 22:24:08 $
* $Revision: 1.80 $
* $Date: 2006/05/05 00:27:45 $
* $Revision: 1.84 $
*/
#define YEAR2INDEX(year) (((year) >= 1900) ? ((year) - 1900) : (year))
......@@ -204,10 +204,8 @@ CDKCALENDAR *newCDKCalendar(CDKSCREEN *cdkscreen, int xplace, int yplace, char *
for (x = 0; x < (int) SIZEOF(bindings); ++x)
bindCDKObject (vCALENDAR, calendar, bindings[x].from, getcCDKBind, (void *)(long)bindings[x].to);
/* Register this baby. */
registerCDKObject (cdkscreen, vCALENDAR, calendar);
/* Return the calendar pointer. */
return (calendar);
}
......@@ -216,20 +214,18 @@ CDKCALENDAR *newCDKCalendar(CDKSCREEN *cdkscreen, int xplace, int yplace, char *
*/
time_t activateCDKCalendar (CDKCALENDAR *calendar, chtype *actions)
{
/* Declare local variables. */
chtype input = 0;
boolean functionKey;
time_t ret = -1;
/* Draw the widget. */
drawCDKCalendar (calendar, ObjOf(calendar)->box);
/* Check if 'actions' is null. */
if (actions == 0)
{
for (;;)
{
/* Get the input. */
input = getcCDKObject (ObjOf(calendar));
input = getchCDKObject (ObjOf(calendar), &functionKey);
/* Inject the character into the widget. */
ret = injectCDKCalendar (calendar, input);
......@@ -366,6 +362,7 @@ static int _injectCDKCalendar (CDKOBJS *object, chtype input)
if (!complete) {
setExitType(calendar, 0);
}
ResultOf(calendar).valueInt = ret;
return (ret != unknownInt);
}
......@@ -444,10 +441,8 @@ static void _drawCDKCalendar (CDKOBJS *object, boolean Box)
calendar->xOffset, TitleLinesOf(calendar) + 2,
calendar->DayName, HORIZONTAL, 0, headerLen);
/* Refresh the main window. */
refreshCDKWindow (calendar->win);
wrefresh (calendar->win);
/* Draw in the calendar field. */
drawCDKCalendarField (calendar);
}
......@@ -458,12 +453,12 @@ static void drawCDKCalendarField (CDKCALENDAR *calendar)
{
/* Declare local variables. */
char *monthName = calendar->MonthName[calendar->month];
int monthNameLength = (int)strlen (monthName);
int monthLength = getMonthLength (calendar->year, calendar->month);
int yearIndex = YEAR2INDEX(calendar->year);
int yearLen = 0;
int day = 1;
int x, y;
int save_y = -1, save_x = -1;
char temp[10];
for (x = 1; x <= 6; x++)
......@@ -472,6 +467,9 @@ static void drawCDKCalendarField (CDKCALENDAR *calendar)
{
if (day <= monthLength)
{
int ypos = y * 3;
int xpos = x;
chtype marker = calendar->dayAttrib;
sprintf(temp, "%02d", day);
......@@ -479,24 +477,28 @@ static void drawCDKCalendarField (CDKCALENDAR *calendar)
if (calendar->day == day)
{
marker = calendar->highlight;
save_y = xpos + getbegy(calendar->fieldWin) - getbegy(InputWindowOf(calendar));
save_x = 1;
}
else
{
marker |= getCDKCalendarMarker(calendar, day, calendar->month, yearIndex);
}
writeCharAttrib (calendar->fieldWin, y*3, x,
writeCharAttrib (calendar->fieldWin, ypos, xpos,
temp, marker, HORIZONTAL, 0, 2);
}
day++;
}
}
refreshCDKWindow (calendar->fieldWin);
wrefresh (calendar->fieldWin);
/* Draw the month in. */
if (calendar->labelWin != 0)
{
sprintf (temp, "%s %d,", monthName, calendar->day);
writeChar (calendar->labelWin, 0, 0,
monthName, HORIZONTAL, 0, monthNameLength);
temp, HORIZONTAL, 0, strlen(temp));
wclrtoeol (calendar->labelWin);
/* Draw the year in. */
sprintf (temp, "%d", calendar->year);
......@@ -505,7 +507,11 @@ static void drawCDKCalendarField (CDKCALENDAR *calendar)
calendar->fieldWidth - yearLen, 0,
temp, HORIZONTAL, 0, yearLen);
refreshCDKWindow (calendar->labelWin);
wmove (calendar->labelWin, 0, 0);
wrefresh (calendar->labelWin);
} else if (save_y >= 0) {
wmove (InputWindowOf(calendar), save_y, save_x);
wrefresh (InputWindowOf(calendar));
}
}
......@@ -682,6 +688,9 @@ static void _destroyCDKCalendar (CDKOBJS *object)
deleteCursesWindow (calendar->shadowWin);
deleteCursesWindow (calendar->win);
/* Clean the key bindings. */
cleanCDKObjectBindings (vCALENDAR, calendar);
/* Unregister the object. */
unregisterCDKObject (vCALENDAR, calendar);
}
......
Begin3
Title: Curses Development Kit
Version: 4.9.11
Entered-date: 14JULY2003
Description: CDK is a widget set developed on top of the basic curses
library. It contains 21 ready to use widgets. Some which
are a text entry field, a scrolling list, a selection list,
a alphalist, pull-down menu, radio list, viewer widget,
dialog box, and many more.
Keywords: Curses, Library, Widget Set
Author: mike@vexus.ca (Vexus Consulting Group)
Maintained-by: mike@vexus.ca (Vexus Consulting Group)
Primary-site: http://www.vexus.ca/CDK.html
Alternate-site:
Original-site:
Platforms: Linux, Solaris. AIX, BSD, SGI, HPUX, NT,
Copying-policy: BSD License.
End
This diff is collapsed.
# $Id: cdk.spec,v 1.14 2005/04/24 22:32:47 tom Exp $
# $Id: cdk.spec,v 1.15 2005/12/30 02:06:06 tom Exp $
# Note that this is NOT a relocatable package
%define ver 5.0
%define subver 20050424
%define subver 20051230
%define rel 1
%define prefix /usr
......
/*
* $Id: cdk_compat.c,v 1.4 2004/08/31 19:44:14 tom Exp $
* $Id: cdk_compat.c,v 1.5 2005/12/28 21:43:35 tom Exp $
* These are functions that are obsolete, but provided as a porting aid.
* The obsolete functions use fixed limits, and inconsistent data handling.
*/
......@@ -52,7 +52,7 @@ int readFile (char *filename, char **array, int maxlines)
/*
* This splits a string into X parts given the split character.
*/
int splitString (char *string, char *items[], char splitChar)