~ubuntu-branches/ubuntu/trusty/libcdk5/trusty

« back to all changes in this revision

Viewing changes to cli/cdkcalendar.c

  • Committer: Bazaar Package Importer
  • Author(s): John Goerzen
  • Date: 2007-06-06 03:54:31 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20070606035431-ba4gdvw0h6ybffsu
Tags: 5.0.20060507-1
* New upstream release.
* Fixed header patching.  Patch from Robert Schiele.
  Closes: #402978, #416336.
* Update widget count in description.  Closes: #294709.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $Id: cdkcalendar.c,v 1.9 2005/03/08 19:54:04 tom Exp $ */
 
1
/* $Id: cdkcalendar.c,v 1.11 2005/12/27 16:11:09 tom Exp $ */
2
2
 
3
 
#include <cdk.h>
 
3
#include <cdk_test.h>
4
4
 
5
5
#ifdef XCURSES
6
6
char *XCursesProgramName="cdkcalendar";
73
73
      if ((fp = fopen (outputFile, "w")) == 0)
74
74
      {
75
75
         fprintf (stderr, "%s: Can not open output file %s\n", argv[0], outputFile);
76
 
         exit (-1);
 
76
         ExitProgram (CLI_ERROR);
77
77
      }
78
78
   }
79
79
 
108
108
   /* Check to make sure we created the dialog box. */
109
109
   if (widget == 0)
110
110
   {
111
 
      /* Shut down curses and CDK. */
112
111
      destroyCDKScreen (cdkScreen);
113
112
      endCDK();
114
113
 
115
 
      /* Spit out the message. */
116
114
      fprintf (stderr, "Error: Could not create the calendar. Is the window too small?\n");
117
115
 
118
 
      /* Exit with an error. */
119
 
      exit (-1);
 
116
      ExitProgram (CLI_ERROR);
120
117
   }
121
118
 
122
119
   /* Split the buttons if they supplied some. */
159
156
      drawCDKButtonbox (buttonWidget, boxWidget);
160
157
   }
161
158
 
162
 
  /*
163
 
   * If the user asked for a shadow, we need to create one.
164
 
   * I do this instead of using the shadow parameter because
165
 
   * the button widget sin't part of the main widget and if
166
 
   * the user asks for both buttons and a shadow, we need to
167
 
   * create a shadow big enough for both widgets. We'll create
168
 
   * the shadow window using the widgets shadowWin element, so
169
 
   * screen refreshes will draw them as well.
170
 
   */
 
159
   /*
 
160
    * If the user asked for a shadow, we need to create one.  Do this instead
 
161
    * of using the shadow parameter because the button widget is not part of
 
162
    * the main widget and if the user asks for both buttons and a shadow, we
 
163
    * need to create a shadow big enough for both widgets.  Create the shadow
 
164
    * window using the widgets shadowWin element, so screen refreshes will draw
 
165
    * them as well.
 
166
    */
171
167
   if (shadowWidget == TRUE)
172
168
   {
173
169
      /* Determine the height of the shadow window. */
210
206
      destroyCDKButtonbox (buttonWidget);
211
207
   }
212
208
 
213
 
   /* End CDK. */
 
209
   CDKfreeStrings(buttonList);
 
210
 
214
211
   destroyCDKCalendar (widget);
215
212
   destroyCDKScreen (cdkScreen);
216
213
   endCDK();
217
214
 
218
215
   /* Print out the date selected. D/M/Y format. */
219
216
   dateInfo = localtime (&selected);
220
 
 
221
 
   /* Print out the date selected. */
222
217
   fprintf (fp, "%02d/%02d/%d\n", dateInfo->tm_mday, (dateInfo->tm_mon+1), (dateInfo->tm_year+1900));
223
 
   exit (selection);
 
218
   fclose (fp);
 
219
 
 
220
   ExitProgram (selection);
224
221
}
225
222
 
226
223
/*