Mercurial > dwindows
comparison win/dw.c @ 1399:8e569dd09d94
On Windows get the buddy from the child window data when creating a combobox.
Also set the tooltip on buddy controls for full coverage.
Fixes the tooltip only showing for the down arrow on comboboxes.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Sun, 27 Nov 2011 12:08:05 +0000 |
parents | 2ccf7eacedf5 |
children | ccd383e11ff8 |
comparison
equal
deleted
inserted
replaced
1398:152e3c8916de | 1399:8e569dd09d94 |
---|---|
5565 | 5565 |
5566 cinfo2->fore = cinfo->fore = -1; | 5566 cinfo2->fore = cinfo->fore = -1; |
5567 cinfo2->back = cinfo->back = -1; | 5567 cinfo2->back = cinfo->back = -1; |
5568 cinfo2->combo = cinfo->combo = tmp; | 5568 cinfo2->combo = cinfo->combo = tmp; |
5569 EnumChildWindows(tmp, _subclass_child, (LPARAM)cinfo2); | 5569 EnumChildWindows(tmp, _subclass_child, (LPARAM)cinfo2); |
5570 | 5570 cinfo->buddy = cinfo2->buddy; |
5571 | |
5571 SetWindowLongPtr(tmp, GWLP_USERDATA, (LONG_PTR)cinfo); | 5572 SetWindowLongPtr(tmp, GWLP_USERDATA, (LONG_PTR)cinfo); |
5572 dw_window_set_font(tmp, DefaultFont); | 5573 dw_window_set_font(tmp, DefaultFont); |
5573 SetWindowText(tmp, text); | 5574 SetWindowText(tmp, text); |
5574 return tmp; | 5575 return tmp; |
5575 } | 5576 } |
6199 * handle: Handle to the window (widget). | 6200 * handle: Handle to the window (widget). |
6200 * bubbletext: The text in the floating bubble tooltip. | 6201 * bubbletext: The text in the floating bubble tooltip. |
6201 */ | 6202 */ |
6202 void API dw_window_set_tooltip(HWND handle, char *bubbletext) | 6203 void API dw_window_set_tooltip(HWND handle, char *bubbletext) |
6203 { | 6204 { |
6205 ColorInfo *cinfo = (ColorInfo *)GetWindowLongPtr(handle, GWLP_USERDATA); | |
6206 | |
6207 if(cinfo && cinfo->buddy) | |
6208 _create_tooltip(cinfo->buddy, bubbletext); | |
6204 _create_tooltip(handle, bubbletext); | 6209 _create_tooltip(handle, bubbletext); |
6205 } | 6210 } |
6206 | 6211 |
6207 /* | 6212 /* |
6208 * Gets the text used for a given window. | 6213 * Gets the text used for a given window. |