Mercurial > emacs
comparison src/w32term.c @ 33766:3488141db749
(x_tool_bar_item, w32_handle_tool_bar_click)
(note_tool_bar_highlight): Change references to mambers deleted
from struct frame to use the new ones.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Wed, 22 Nov 2000 16:33:16 +0000 |
parents | c85b44e97e73 |
children | d554a3ac3039 |
comparison
equal
deleted
inserted
replaced
33765:d67ce1c9c62b | 33766:3488141db749 |
---|---|
6604 | 6604 |
6605 /* Get information about the tool-bar item at position X/Y on frame F. | 6605 /* Get information about the tool-bar item at position X/Y on frame F. |
6606 Return in *GLYPH a pointer to the glyph of the tool-bar item in | 6606 Return in *GLYPH a pointer to the glyph of the tool-bar item in |
6607 the current matrix of the tool-bar window of F, or NULL if not | 6607 the current matrix of the tool-bar window of F, or NULL if not |
6608 on a tool-bar item. Return in *PROP_IDX the index of the tool-bar | 6608 on a tool-bar item. Return in *PROP_IDX the index of the tool-bar |
6609 item in F->current_tool_bar_items. Value is | 6609 item in F->tool_bar_items. Value is |
6610 | 6610 |
6611 -1 if X/Y is not on a tool-bar item | 6611 -1 if X/Y is not on a tool-bar item |
6612 0 if X/Y is on the same item that was highlighted before. | 6612 0 if X/Y is on the same item that was highlighted before. |
6613 1 otherwise. */ | 6613 1 otherwise. */ |
6614 | 6614 |
6627 *glyph = x_y_to_hpos_vpos (w, x, y, hpos, vpos, &area); | 6627 *glyph = x_y_to_hpos_vpos (w, x, y, hpos, vpos, &area); |
6628 if (*glyph == NULL) | 6628 if (*glyph == NULL) |
6629 return -1; | 6629 return -1; |
6630 | 6630 |
6631 /* Get the start of this tool-bar item's properties in | 6631 /* Get the start of this tool-bar item's properties in |
6632 f->current_tool_bar_items. */ | 6632 f->tool_bar_items. */ |
6633 if (!tool_bar_item_info (f, *glyph, prop_idx)) | 6633 if (!tool_bar_item_info (f, *glyph, prop_idx)) |
6634 return -1; | 6634 return -1; |
6635 | 6635 |
6636 /* Is mouse on the highlighted item? */ | 6636 /* Is mouse on the highlighted item? */ |
6637 if (EQ (f->tool_bar_window, dpyinfo->mouse_face_window) | 6637 if (EQ (f->tool_bar_window, dpyinfo->mouse_face_window) |
6669 frame_to_window_pixel_xy (w, &x, &y); | 6669 frame_to_window_pixel_xy (w, &x, &y); |
6670 if (x_tool_bar_item (f, x, y, &glyph, &hpos, &vpos, &prop_idx) != 0) | 6670 if (x_tool_bar_item (f, x, y, &glyph, &hpos, &vpos, &prop_idx) != 0) |
6671 return; | 6671 return; |
6672 | 6672 |
6673 /* If item is disabled, do nothing. */ | 6673 /* If item is disabled, do nothing. */ |
6674 enabled_p = (XVECTOR (f->current_tool_bar_items) | 6674 enabled_p = AREF (f->tool_bar_items, prop_idx + TOOL_BAR_ITEM_ENABLED_P); |
6675 ->contents[prop_idx + TOOL_BAR_ITEM_ENABLED_P]); | |
6676 if (NILP (enabled_p)) | 6675 if (NILP (enabled_p)) |
6677 return; | 6676 return; |
6678 | 6677 |
6679 if (button_event->kind == mouse_click) | 6678 if (button_event->kind == mouse_click) |
6680 { | 6679 { |
6690 | 6689 |
6691 /* Show item in released state. */ | 6690 /* Show item in released state. */ |
6692 show_mouse_face (dpyinfo, DRAW_IMAGE_RAISED); | 6691 show_mouse_face (dpyinfo, DRAW_IMAGE_RAISED); |
6693 dpyinfo->mouse_face_image_state = DRAW_IMAGE_RAISED; | 6692 dpyinfo->mouse_face_image_state = DRAW_IMAGE_RAISED; |
6694 | 6693 |
6695 key = (XVECTOR (f->current_tool_bar_items) | 6694 key = AREF (f->tool_bar_items, prop_idx + TOOL_BAR_ITEM_KEY); |
6696 ->contents[prop_idx + TOOL_BAR_ITEM_KEY]); | |
6697 | 6695 |
6698 XSETFRAME (frame, f); | 6696 XSETFRAME (frame, f); |
6699 event.kind = TOOL_BAR_EVENT; | 6697 event.kind = TOOL_BAR_EVENT; |
6700 event.frame_or_window = frame; | 6698 event.frame_or_window = frame; |
6701 event.arg = frame; | 6699 event.arg = frame; |
6763 | 6761 |
6764 dpyinfo->mouse_face_image_state = DRAW_NORMAL_TEXT; | 6762 dpyinfo->mouse_face_image_state = DRAW_NORMAL_TEXT; |
6765 draw = mouse_down_p ? DRAW_IMAGE_SUNKEN : DRAW_IMAGE_RAISED; | 6763 draw = mouse_down_p ? DRAW_IMAGE_SUNKEN : DRAW_IMAGE_RAISED; |
6766 | 6764 |
6767 /* If tool-bar item is not enabled, don't highlight it. */ | 6765 /* If tool-bar item is not enabled, don't highlight it. */ |
6768 enabled_p = (XVECTOR (f->current_tool_bar_items) | 6766 enabled_p = AREF (f->tool_bar_items, prop_idx + TOOL_BAR_ITEM_ENABLED_P); |
6769 ->contents[prop_idx + TOOL_BAR_ITEM_ENABLED_P]); | |
6770 if (!NILP (enabled_p)) | 6767 if (!NILP (enabled_p)) |
6771 { | 6768 { |
6772 /* Compute the x-position of the glyph. In front and past the | 6769 /* Compute the x-position of the glyph. In front and past the |
6773 image is a space. We include this is the highlighted area. */ | 6770 image is a space. We include this is the highlighted area. */ |
6774 row = MATRIX_ROW (w->current_matrix, vpos); | 6771 row = MATRIX_ROW (w->current_matrix, vpos); |
6798 | 6795 |
6799 /* Set help_echo to a help string.to display for this tool-bar item. | 6796 /* Set help_echo to a help string.to display for this tool-bar item. |
6800 w32_read_socket does the rest. */ | 6797 w32_read_socket does the rest. */ |
6801 help_echo_object = help_echo_window = Qnil; | 6798 help_echo_object = help_echo_window = Qnil; |
6802 help_echo_pos = -1; | 6799 help_echo_pos = -1; |
6803 help_echo = (XVECTOR (f->current_tool_bar_items) | 6800 help_echo = AREF (f->tool_bar_items, prop_idx + TOOL_BAR_ITEM_HELP); |
6804 ->contents[prop_idx + TOOL_BAR_ITEM_HELP]); | |
6805 if (NILP (help_echo)) | 6801 if (NILP (help_echo)) |
6806 help_echo = (XVECTOR (f->current_tool_bar_items) | 6802 help_echo = AREF (f->tool_bar_items, prop_idx + TOOL_BAR_ITEM_CAPTION); |
6807 ->contents[prop_idx + TOOL_BAR_ITEM_CAPTION]); | |
6808 } | 6803 } |
6809 | 6804 |
6810 | 6805 |
6811 | 6806 |
6812 /* Find the glyph matrix position of buffer position POS in window W. | 6807 /* Find the glyph matrix position of buffer position POS in window W. |