123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256 |
- /*
- * CDE - Common Desktop Environment
- *
- * Copyright (c) 1993-2012, The Open Group. All rights reserved.
- *
- * These libraries and programs are free software; you can
- * redistribute them and/or modify them under the terms of the GNU
- * Lesser General Public License as published by the Free Software
- * Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * These libraries and programs are distributed in the hope that
- * they will be useful, but WITHOUT ANY WARRANTY; without even the
- * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU Lesser General Public License for more
- * details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with these libraries and programs; if not, write
- * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
- * Floor, Boston, MA 02110-1301 USA
- */
- /* $XConsortium: ComboBoxP.h /main/3 1995/10/26 09:29:58 rswiston $ */
- /*
- * DtWidget/ComboBoxP.h
- */
- /*
- * (c) Copyright 1993, 1994 Hewlett-Packard Company
- * (c) Copyright 1993, 1994 International Business Machines Corp.
- * (c) Copyright 1993, 1994 Novell, Inc.
- * (c) Copyright 1993, 1994 Sun Microsystems, Inc.
- */
- /***********************************************************
- Copyright 1993 Interleaf, Inc.
- Permission to use, copy, modify, and distribute this software
- and its documentation for any purpose without fee is granted,
- provided that the above copyright notice appear in all copies
- and that both copyright notice and this permission notice appear
- in supporting documentation, and that the name of Interleaf not
- be used in advertising or publicly pertaining to distribution of
- the software without specific written prior permission.
- Interleaf makes no representation about the suitability of this
- software for any purpose. It is provided "AS IS" without any
- express or implied warranty.
- ******************************************************************/
- /*
- * (C) Copyright 1991,1992, 1993
- * Interleaf, Inc.
- * Nine Hillside Avenue, Waltham, MA 02154
- *
- * ComboBoxP.h:
- *
- * Private header file for DtComboBoxWidget.
- */
- #ifndef _ComboBoxP_h
- #define _ComboBoxP_h
- #include <X11/IntrinsicP.h>
- #include <X11/ShellP.h>
- #include <Xm/DrawnB.h>
- #include <Xm/ArrowB.h>
- #undef USE_XFT
- #include <Xm/TextFP.h>
- #include <Xm/Label.h>
- #include <Xm/Frame.h>
- #include <Xm/ListP.h>
- #include <Xm/Separator.h>
- #include <Xm/ScrolledWP.h>
- #include <Xm/ScrollBarP.h>
- #include <Xm/ManagerP.h>
- #include "ComboBox.h"
- #ifdef __cplusplus
- extern "C" {
- #endif
- /*
- * External definitions of syn_resources for our list widget.
- */
- #define SYN_RESOURCE_AA (Widget w, int resource_offset, XtArgVal *value)
- extern void _DtComboBoxGetArrowSize SYN_RESOURCE_AA;
- extern void _DtComboBoxGetLabelString SYN_RESOURCE_AA;
- extern void _DtComboBoxGetListItemCount SYN_RESOURCE_AA;
- extern void _DtComboBoxGetListItems SYN_RESOURCE_AA;
- extern void _DtComboBoxGetListFontList SYN_RESOURCE_AA;
- extern void _DtComboBoxGetListMarginHeight SYN_RESOURCE_AA;
- extern void _DtComboBoxGetListMarginWidth SYN_RESOURCE_AA;
- extern void _DtComboBoxGetListSpacing SYN_RESOURCE_AA;
- extern void _DtComboBoxGetListTopItemPosition SYN_RESOURCE_AA;
- extern void _DtComboBoxGetListVisibleItemCount SYN_RESOURCE_AA;
- #define ARROW_MULT .45
- #define ARROW_MIN 13
- #define MARGIN 2
- #define LABEL_PADDING 2
- #define LABEL_SHADOW 2
- #define TEXT_FIELD_SHADOW 1
- #define TEXT_CONTEXT_MARGIN 4
- /****************************************************************
- *
- * Message Defines
- *
- ****************************************************************/
- #define CB_ALIGNMENT DTWIDGET_GETMESSAGE( \
- MS_ComboBox, COMBO_ALIGNMENT, _DtMsgComboBox_0000)
- #define CB_MARGIN_HEIGHT DTWIDGET_GETMESSAGE( \
- MS_ComboBox, COMBO_MARGIN_HEIGHT, _DtMsgComboBox_0001)
- #define CB_MARGIN_WIDTH DTWIDGET_GETMESSAGE( \
- MS_ComboBox, COMBO_MARGIN_WIDTH, _DtMsgComboBox_0002)
- #define CB_HORIZONTAL_SPACING DTWIDGET_GETMESSAGE( \
- MS_ComboBox, COMBO_HORIZONTAL_SPACING, _DtMsgComboBox_0003)
- #define CB_VERTICAL_SPACING DTWIDGET_GETMESSAGE( \
- MS_ComboBox, COMBO_VERTICAL_SPACING, _DtMsgComboBox_0004)
- #define CB_ORIENTATION DTWIDGET_GETMESSAGE( \
- MS_ComboBox, COMBO_ORIENTATION, _DtMsgComboBox_0005)
- #define CB_ITEM_COUNT DTWIDGET_GETMESSAGE( \
- MS_ComboBox, COMBO_ITEM_COUNT, _DtMsgComboBox_0006)
- #define CB_VISIBLE_ITEM DTWIDGET_GETMESSAGE( \
- MS_ComboBox, COMBO_VISIBLE_ITEM, _DtMsgComboBox_0007)
- #define CB_TEXT DTWIDGET_GETMESSAGE( \
- MS_ComboBox, COMBO_TEXT, _DtMsgComboBox_0008)
- #define CB_SET_ITEM DTWIDGET_GETMESSAGE( \
- MS_ComboBox, COMBO_SET_ITEM, _DtMsgComboBox_0009)
- #define CB_SELECT_ITEM DTWIDGET_GETMESSAGE( \
- MS_ComboBox, COMBO_SELECT_ITEM, _DtMsgComboBox_0010)
- #define CB_RESIZE DTWIDGET_GETMESSAGE( \
- MS_ComboBox, COMBO_RESIZE, _DtMsgComboBox_0011)
- #define CB_LABEL DTWIDGET_GETMESSAGE( \
- MS_ComboBox, COMBO_LABEL, _DtMsgComboBox_0012)
- #define CB_CVTSTRING DTWIDGET_GETMESSAGE( \
- MS_ComboBox, COMBO_CVTSTRING, _DtMsgComboBox_0013)
- #define CB_DEL_POS DTWIDGET_GETMESSAGE( \
- MS_ComboBox, COMBO_DEL_POS, _DtMsgComboBox_0014)
- /*
- * Class Records
- */
- typedef struct {
- Boolean junk; /* Need something */
- } DtComboBoxClassPart;
- typedef struct _DtComboBoxClassRec {
- CoreClassPart core_class;
- CompositeClassPart composite_class;
- ConstraintClassPart constraint_class;
- XmManagerClassPart manager_class;
- DtComboBoxClassPart combo_box_class;
- } DtComboBoxClassRec;
- extern DtComboBoxClassRec dtComboBoxClassRec;
- /*
- * Instance Record.
- */
- typedef struct _DtComboBoxPart {
- /* Private data */
- Widget arrow;
- Widget shell;
- Widget frame;
- Widget label;
- Widget sep;
- Dimension old_width;
- Dimension old_height;
- Dimension label_max_length;
- Dimension label_max_height;
- /*
- * max_shell_width is the width that is needed to hold the
- * list if the longest item was visible. We then use this
- * width to figure out if the shell is not wide enough,
- * when it gets popped on the screen. This is needed in case the
- * combo-box resizes, or if items changes (list will resize).
- * Sometimes we change the size of the shell to fit on the screen, or
- * to make it at least as large as the combo_box. The next time we pop
- * the shell up the size may be different; therefore, we set the shell
- * size to the maximum everytime it gets popped up, then we will
- * make adjustments, only if needed.
- * This value gets saved every time the user updates DtNitems.
- */
- Dimension max_shell_width;
- Dimension max_shell_height;
- /* ComboBox specific public resources */
- Dimension margin_height;
- Dimension margin_width;
- XmString selected_item;
- int selected_position;
- XtCallbackList selection_callback;
- unsigned char type;
- Dimension arrow_spacing;
- /* ComboBox specific private resources */
- Dimension arrow_size;
- XtCallbackList activate_callback;
- unsigned char alignment;
- unsigned char arrow_type;
- short text_columns;
- XtCallbackList focus_callback;
- Dimension horizontal_spacing;
- int item_count;
- XmStringTable items;
- XmStringTable list_items;
- XmString label_string;
- Widget list;
- XmFontList list_font_list;
- Dimension list_margin_height;
- Dimension list_margin_width;
- Dimension list_spacing;
- XtCallbackList losing_focus_callback;
- unsigned int text_max_length;
- XtCallbackList menu_post_callback;
- unsigned char orientation;
- Boolean popped_up;
- Boolean recompute_size;
- Widget text;
- int top_item_position;
- Boolean update_label;
- Dimension vertical_spacing;
- int visible_item_count;
- } DtComboBoxPart;
- typedef struct _DtComboBoxRec {
- CorePart core;
- CompositePart composite;
- ConstraintPart constraint;
- XmManagerPart manager;
- DtComboBoxPart combo_box;
- } DtComboBoxRec;
- #ifdef __cplusplus
- } /* Close scope of 'extern "C"' declaration which encloses file. */
- #endif
- #endif /* _XmComboBoxP_h */
|