|
Revision 4220, 2.0 kB
(checked in by miyoshi, 9 months ago)
|
Sync up with Emacs22.2.
|
- Property svn:eol-style set to
native
|
| Line | |
|---|
| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
#include "copyright.h" |
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
#include <config.h> |
|---|
| 17 |
#include "XMenuInt.h" |
|---|
| 18 |
|
|---|
| 19 |
int |
|---|
| 20 |
XMenuChangeSelection(display, menu, p_num, s_num, data, data_sw, label, label_sw) |
|---|
| 21 |
Display *display; |
|---|
| 22 |
register XMenu *menu; |
|---|
| 23 |
register int p_num; |
|---|
| 24 |
register int s_num; |
|---|
| 25 |
char *data; |
|---|
| 26 |
int data_sw; |
|---|
| 27 |
char *label; |
|---|
| 28 |
int label_sw; |
|---|
| 29 |
{ |
|---|
| 30 |
register XMPane *p_ptr; |
|---|
| 31 |
register XMSelect *s_ptr; |
|---|
| 32 |
|
|---|
| 33 |
int label_length; |
|---|
| 34 |
int label_width; |
|---|
| 35 |
|
|---|
| 36 |
|
|---|
| 37 |
|
|---|
| 38 |
|
|---|
| 39 |
if (label == NULL) { |
|---|
| 40 |
_XMErrorCode = XME_ARG_BOUNDS; |
|---|
| 41 |
return(XM_FAILURE); |
|---|
| 42 |
} |
|---|
| 43 |
|
|---|
| 44 |
|
|---|
| 45 |
|
|---|
| 46 |
|
|---|
| 47 |
p_ptr = _XMGetPanePtr(menu, p_num); |
|---|
| 48 |
if (p_ptr == NULL) return(XM_FAILURE); |
|---|
| 49 |
|
|---|
| 50 |
|
|---|
| 51 |
|
|---|
| 52 |
|
|---|
| 53 |
s_ptr = _XMGetSelectionPtr(p_ptr, s_num); |
|---|
| 54 |
if (s_ptr == NULL) return(XM_FAILURE); |
|---|
| 55 |
|
|---|
| 56 |
|
|---|
| 57 |
|
|---|
| 58 |
|
|---|
| 59 |
if (label_sw) { |
|---|
| 60 |
|
|---|
| 61 |
|
|---|
| 62 |
|
|---|
| 63 |
label_length = strlen(label); |
|---|
| 64 |
label_width = XTextWidth(menu->s_fnt_info, label, label_length); |
|---|
| 65 |
|
|---|
| 66 |
|
|---|
| 67 |
|
|---|
| 68 |
|
|---|
| 69 |
s_ptr->label = label; |
|---|
| 70 |
s_ptr->label_width = label_width; |
|---|
| 71 |
s_ptr->label_length = label_length; |
|---|
| 72 |
|
|---|
| 73 |
|
|---|
| 74 |
|
|---|
| 75 |
|
|---|
| 76 |
menu->recompute = 1; |
|---|
| 77 |
} |
|---|
| 78 |
|
|---|
| 79 |
|
|---|
| 80 |
|
|---|
| 81 |
|
|---|
| 82 |
if (data_sw) s_ptr->data = data; |
|---|
| 83 |
|
|---|
| 84 |
|
|---|
| 85 |
|
|---|
| 86 |
|
|---|
| 87 |
_XMErrorCode = XME_NO_ERROR; |
|---|
| 88 |
return(s_num); |
|---|
| 89 |
} |
|---|
| 90 |
|
|---|
| 91 |
|
|---|
| 92 |
|
|---|