dboxquery 7.74 KB
Newer Older
Neil Turton's avatar
Neil Turton committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175
/* Copyright 1996 Acorn Computers Ltd
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/****************************************************************************
 * This source file was written by Acorn Computers Limited. It is part of   *
 * the RISCOS library for writing applications in C for RISC OS. It may be  *
 * used freely in the creation of programs for Archimedes. It should be     *
 * used with Acorn's C Compiler Release 3 or later.                         *
 *                                                                          *
 ***************************************************************************/

/*
 * Title:   dboxquery.h
 * Purpose: display a dialogue box to ask a question, and get reply.
 *
 */

#ifndef __dboxquery_h
#define __dboxquery_h

/* ----------------------------- dboxquery --------------------------------
 * Description:   Displays a dialogue box, with YES and NO buttons, and a
 *                question, and gets reply.
 *
 * Parameters:    char *question -- the question to be asked
 * Returns:       reply by user.
 * Other Info:    Question can be up to 120 chars long, 3 lines of 40 chars
 *                RETURN will reply "yes"; ESCAPE or CLOSE event will
 *                reply "cancel". Note: a call of dbox_query(0), will
 *                reserve space for the dbox and return with no display
 *                This will mean that space is always available for
 *                important things like asking to quit!!
 *                The template for the dialogue box should have the following
 *                attributes:
 *                   window flags -- moveable, auto-redraw
 *                                   Also advisable to have a title icon
 *                                   containing the name of your program
 *                                   (or other suitable text)
 *                   icon #1 -- the message icon -- should have indirected
 *                                                  text flag set, with
 *                                                  buton type "never"
 *                   icon #0 -- the "YES" icon --   should be text icon
 *                                                  with text string set to
 *                                                  "YES"; button type should
 *                                                  be "menu icon"
 *                   icon #2 -- the "NO" icon  --   should be text icon
 *                                                  with text string set to
 *                                                  "NO"; button type should
 *                                                  be "menu icon"
 *
 *                See "query" dialogue box in !Edit for an example.
 *
 */


/* return type for dboxquery */

typedef enum
{
    dboxquery_YES = 1,
    dboxquery_NO = 2,
    dboxquery_CANCEL = 3
} dboxquery_REPLY;


dboxquery_REPLY dboxquery(char *question);



/* ----------------------------- dboxquery_close --------------------------
 * Description:   Displays a dialogue box, with SAVE, DISCARD and CANCEL
 *                buttons, and a question, and gets reply.
 *
 * Parameters:    char *question -- the question to be asked
 * Returns:       reply by user.
 * Other Info:    Question can be up to 120 chars long, 3 lines of 40 chars
 *                RETURN will reply SAVE; ESCAPE or CLOSE event will
 *                reply CANCEL. Note: a call of dboxquery_close(0), will
 *                reserve space for the dbox and return with no display
 *                The template for the dialogue box should have the following
 *                attributes:
 *                   window flags -- moveable, auto-redraw
 *                                   Also advisable to have a title icon
 *                                   containing the name of your program
 *                                   (or other suitable text)
 *                   icon #1 -- the message icon -- should have indirected
 *                                                  text flag set, with
 *                                                  buton type "never"
 *                   icon #0 -- the SAVE icon --    should be text icon
 *                                                  with text string set to
 *                                                  "SAVE"; button type should
 *                                                  be "menu icon"
 *                   icon #2 -- the "DISCARD" icon  --   should be text icon
 *                                                  with text string set to
 *                                                  "DISCARD"; button type
 *                                                  should be "menu icon"
 *                   icon #3 -- the "CANCEL" icon   -- should be text icon
 *                                                  with text string set to
 *                                                  "CANCEL"; button type should
 *                                                  be "menu icon"
 *
 *                See "close" dialogue box in !Edit for an example.
 *
 */


/* return type for dboxquery_close */

typedef enum
{
    dboxquery_close_SAVE = 1,
    dboxquery_close_DISCARD = 2,
    dboxquery_close_CANCEL = 3
} dboxquery_close_REPLY;

dboxquery_close_REPLY dboxquery_close(char *question);


/* ----------------------------- dboxquery_quit ---------------------------
 * Description:   Displays a dialogue box, with DISCARD and CANCEL buttons,
 *                and a question, and gets reply.
 *
 * Parameters:    char *question -- the question to be asked
 * Returns:       reply by user.
 * Other Info:    Question can be up to 120 chars long, 3 lines of 40 chars
 *                RETURN will reply "discard"; ESCAPE or CLOSE event will
 *                reply "cancel". Note: a call of dbox_query(0), will
 *                reserve space for the dbox and return with no display
 *                The template for the dialogue box should have the following
 *                attributes:
 *                   window flags -- moveable, auto-redraw
 *                                   Also advisable to have a title icon
 *                                   containing the name of your program
 *                                   (or other suitable text)
 *                   icon #1 -- the message icon -- should have indirected
 *                                                  text flag set, with
 *                                                  buton type "never"
 *                   icon #0 -- the DISCARD icon --   should be text icon
 *                                                  with text string set to
 *                                                  "DISCARD"; button type
 *                                                  should be "menu icon"
 *                   icon #2 -- the CANCEL icon  --   should be text icon
 *                                                  with text string set to
 *                                                  "CANCEL"; button type
 *                                                  should be "menu icon"
 *
 *                See "quit" dialogue box in !Edit for an example.
 *
 */


/* return type for dboxquery_quit */

typedef enum
{
    dboxquery_quit_DISCARD = 1,
    dboxquery_quit_CANCEL = 2
} dboxquery_quit_REPLY;

dboxquery_quit_REPLY dboxquery_quit(char *question);

#endif

/* end dboxquery.h */