Mercurial > emacs
annotate oldXMenu/AddSel.c @ 87170:e50a2e215441
* erc-stamp.el (erc-echo-timestamp):
* erc-lang.el (language):
* erc-backend.el (erc-server-connect): Fix buggy call to `message'.
* gnus-sum.el (gnus-summary-simplify-subject-query):
* ecomplete.el (ecomplete-display-matches): Fix buggy call to
`message'.
* textmodes/reftex.el (reftex-select-with-char):
* textmodes/reftex-toc.el (reftex-toc-do-promote)
(reftex-toc-visit-location, reftex-toc-find-section):
* textmodes/reftex-index.el (reftex-index-show-entry):
* textmodes/org.el (org-cycle-hide-archived-subtrees)
(org-table-rotate-recalc-marks, org-mark-ring-push)
(org-follow-info-link, org-mhe-get-message-folder-from-index)
(org-auto-repeat-maybe, org-store-log-note, org-delete-property)
(org-evaluate-time-range, org-edit-agenda-file-list):
* textmodes/artist.el (artist-select-next-op-in-list)
(artist-select-prev-op-in-list):
* term/mac-win.el (mac-service-insert-text):
* startup.el (fancy-about-screen):
* progmodes/vhdl-mode.el (vhdl-decision-query):
* progmodes/idlwave.el (idlwave-template)
(idlwave-scroll-completions, idlwave-display-completion-list):
* progmodes/ebrowse.el (ebrowse-show-progress):
* progmodes/cperl-mode.el (cperl-find-pods-heres):
* progmodes/antlr-mode.el (antlr-insert-option-do):
* play/mpuz.el (mpuz-close-game):
* net/rcirc.el (rcirc-next-active-buffer):
* mail/reporter.el (reporter-update-status):
* kmacro.el (kmacro-display):
* international/ja-dic-cnv.el (skkdic-set-okuri-nasi):
* emulation/viper-util.el (viper-save-setting):
* emacs-lisp/lisp-mnt.el (lm-verify):
* emacs-lisp/edebug.el (edebug-set-mode):
* emacs-lisp/checkdoc.el (checkdoc-rogue-spaces, checkdoc-defun):
* calendar/calendar.el (calendar-print-day-of-year):
* calc/calcalg3.el (calc-curve-fit):
* calc/calcalg2.el (math-integral):
* calc/calc.el (calc-read-key-sequence, calc-version):
* calc/calc-mode.el (calc-set-simplify-mode):
* calc/calc-ext.el (calc-fancy-prefix): Fix buggy call to
`message'.
author | David Kastrup <dak@gnu.org> |
---|---|
date | Sat, 08 Dec 2007 01:02:29 +0000 |
parents | fec5e03aaf59 |
children | edf631bdbb7a ec58e5c426ef 5cc91198ffb2 |
rev | line source |
---|---|
76174
fec5e03aaf59
Remove FSF copyright since file does not differ significantly from X11
Glenn Morris <rgm@gnu.org>
parents:
75348
diff
changeset
|
1 /* Copyright Massachusetts Institute of Technology 1985 */ |
fec5e03aaf59
Remove FSF copyright since file does not differ significantly from X11
Glenn Morris <rgm@gnu.org>
parents:
75348
diff
changeset
|
2 |
25858 | 3 #include "copyright.h" |
4 | |
5 | |
6 /* | |
7 * XMenu: MIT Project Athena, X Window system menu package | |
8 * | |
9 * XMenuAddSelection - Adds a selection to an XMenu object. | |
10 * | |
11 * Author: Tony Della Fera, DEC | |
12 * August, 1985 | |
13 * | |
14 */ | |
15 | |
16 #include <config.h> | |
17 #include "XMenuInt.h" | |
18 | |
19 int | |
27455
d93b1a9c3c96
(XMenuAddSelection): Add parameter HELP.
Gerd Moellmann <gerd@gnu.org>
parents:
25858
diff
changeset
|
20 XMenuAddSelection(display, menu, p_num, data, label, active, help) |
25858 | 21 Display *display; |
22 register XMenu *menu; /* Menu object to be modified. */ | |
23 register int p_num; /* Pane number to be modified. */ | |
24 char *data; /* Data value. */ | |
25 char *label; /* Selection label. */ | |
26 int active; /* Make selection active? */ | |
27455
d93b1a9c3c96
(XMenuAddSelection): Add parameter HELP.
Gerd Moellmann <gerd@gnu.org>
parents:
25858
diff
changeset
|
27 char *help; /* Help string */ |
25858 | 28 { |
29 register XMPane *pane; /* Pane containing the new selection. */ | |
30 register XMSelect *select; /* Newly created selection. */ | |
31 | |
32 | |
33 int label_length; /* Label lenght in characters. */ | |
34 int label_width; /* Label width in pixels. */ | |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
27455
diff
changeset
|
35 |
25858 | 36 /* |
37 * Check for NULL pointers! | |
38 */ | |
39 if (label == NULL) { | |
40 _XMErrorCode = XME_ARG_BOUNDS; | |
41 return(XM_FAILURE); | |
42 } | |
43 /* | |
44 * Find the right pane. | |
45 */ | |
46 pane = _XMGetPanePtr(menu, p_num); | |
47 if (pane == NULL) return(XM_FAILURE); | |
48 | |
49 /* | |
50 * Calloc the XMSelect structure. | |
51 */ | |
52 select = (XMSelect *)calloc(1, sizeof(XMSelect)); | |
53 if (select == NULL) { | |
54 _XMErrorCode = XME_CALLOC; | |
55 return(XM_FAILURE); | |
56 } | |
57 /* | |
58 * Determine label size. | |
59 */ | |
60 label_length = strlen(label); | |
61 label_width = XTextWidth(menu->s_fnt_info, label, label_length); | |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
27455
diff
changeset
|
62 |
25858 | 63 /* |
64 * Fill the XMSelect structure. | |
65 */ | |
66 if (!strcmp (label, "--") || !strcmp (label, "---")) | |
67 { | |
68 select->type = SEPARATOR; | |
69 select->active = 0; | |
70 } | |
71 else | |
72 { | |
73 select->type = SELECTION; | |
74 select->active = active; | |
75 } | |
76 | |
77 select->serial = -1; | |
78 select->label = label; | |
79 select->label_width = label_width; | |
80 select->label_length = label_length; | |
81 select->data = data; | |
82 select->parent_p = pane; | |
27455
d93b1a9c3c96
(XMenuAddSelection): Add parameter HELP.
Gerd Moellmann <gerd@gnu.org>
parents:
25858
diff
changeset
|
83 select->help_string = help; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
27455
diff
changeset
|
84 |
25858 | 85 /* |
86 * Insert the selection at the end of the selection list. | |
87 */ | |
88 emacs_insque(select, pane->s_list->prev); | |
89 | |
90 /* | |
91 * Update the selection count. | |
92 */ | |
93 pane->s_count++; | |
94 | |
95 /* | |
96 * Schedule a recompute. | |
97 */ | |
98 menu->recompute = 1; | |
99 | |
100 /* | |
101 * Return the selection number just added. | |
102 */ | |
103 _XMErrorCode = XME_NO_ERROR; | |
104 return((pane->s_count - 1)); | |
105 } | |
52401 | 106 |
107 /* arch-tag: 0161f024-c739-440d-9498-050280c6c355 | |
108 (do not change this comment) */ |