comparison os2/dw.c @ 408:fecd529ba9d4

Use dW_box_new() instead of WinCreateWindow() to make the container window for the comboboxes so that the owner message are correctly handled.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Mon, 12 May 2003 21:19:15 +0000
parents 765ec42ee2e4
children a4197ddfc50d
comparison
equal deleted inserted replaced
407:a8124a9561c7 408:fecd529ba9d4
3479 } 3479 }
3480 3480
3481 thisbox->items = tmpitem; 3481 thisbox->items = tmpitem;
3482 free(thisitem); 3482 free(thisitem);
3483 thisbox->count--; 3483 thisbox->count--;
3484 _free_window_memory(handle); 3484 _free_window_memory(frame ? frame : handle);
3485 } 3485 }
3486 return WinDestroyWindow(frame ? frame : handle); 3486 return WinDestroyWindow(frame ? frame : handle);
3487 } 3487 }
3488 3488
3489 /* Causes entire window to be invalidated and redrawn. 3489 /* Causes entire window to be invalidated and redrawn.
4204 * id: An ID to be used with dw_window_from_id() or 0L. 4204 * id: An ID to be used with dw_window_from_id() or 0L.
4205 */ 4205 */
4206 HWND API dw_combobox_new(char *text, ULONG id) 4206 HWND API dw_combobox_new(char *text, ULONG id)
4207 { 4207 {
4208 WindowData *blah = calloc(1, sizeof(WindowData)); 4208 WindowData *blah = calloc(1, sizeof(WindowData));
4209 HWND frame = WinCreateWindow(HWND_OBJECT, 4209 HWND frame = dw_box_new(DW_HORZ, 0);
4210 WC_FRAME,
4211 NULL,
4212 WS_VISIBLE | WS_CLIPCHILDREN |
4213 FS_NOBYTEALIGN,
4214 0,0,2000,1000,
4215 NULLHANDLE,
4216 HWND_TOP,
4217 0L,
4218 NULL,
4219 NULL);
4220 HWND tmp = WinCreateWindow(frame, 4210 HWND tmp = WinCreateWindow(frame,
4221 WC_COMBOBOX, 4211 WC_COMBOBOX,
4222 text, 4212 text,
4223 WS_VISIBLE | CBS_DROPDOWN | WS_GROUP, 4213 WS_VISIBLE | CBS_DROPDOWN | WS_GROUP,
4224 0,0,2000,1000, 4214 0,0,2000,1000,
4243 WinSetWindowPtr(tmp, QWP_USER, blah); 4233 WinSetWindowPtr(tmp, QWP_USER, blah);
4244 dw_window_set_font(tmp, DefaultFont); 4234 dw_window_set_font(tmp, DefaultFont);
4245 dw_window_set_color(tmp, DW_CLR_BLACK, DW_CLR_WHITE); 4235 dw_window_set_color(tmp, DW_CLR_BLACK, DW_CLR_WHITE);
4246 dw_window_set_data(tmp, "_dw_comboentry", (void *)last); 4236 dw_window_set_data(tmp, "_dw_comboentry", (void *)last);
4247 dw_window_set_data(tmp, "_dw_combo_box", (void *)frame); 4237 dw_window_set_data(tmp, "_dw_combo_box", (void *)frame);
4238 WinSetOwner(tmp, frame);
4248 return tmp; 4239 return tmp;
4249 } 4240 }
4250 4241
4251 /* 4242 /*
4252 * Create a new button window (widget) to be packed. 4243 * Create a new button window (widget) to be packed.
5037 5028
5038 thisbox->count++; 5029 thisbox->count++;
5039 5030
5040 /* Don't set the ownership if it's an entryfield or spinbutton */ 5031 /* Don't set the ownership if it's an entryfield or spinbutton */
5041 WinQueryClassName(item, 99, tmpbuf); 5032 WinQueryClassName(item, 99, tmpbuf);
5042 if(strncmp(tmpbuf, "#6", 3)!=0 && strncmp(tmpbuf, "#32", 4)!=0) 5033 if(strncmp(tmpbuf, "#6", 3)!=0 && strncmp(tmpbuf, "#32", 4)!=0 && strncmp(tmpbuf, "#2", 3)!=0)
5043 WinSetOwner(item, box); 5034 WinSetOwner(item, box);
5044 WinSetParent(frame ? frame : item, box, FALSE); 5035 WinSetParent(frame ? frame : item, box, FALSE);
5045 } 5036 }
5046 } 5037 }
5047 5038
7666 7657
7667 thisbox->count++; 7658 thisbox->count++;
7668 7659
7669 WinQueryClassName(item, 99, tmpbuf); 7660 WinQueryClassName(item, 99, tmpbuf);
7670 /* Don't set the ownership if it's an entryfield or spinbutton */ 7661 /* Don't set the ownership if it's an entryfield or spinbutton */
7671 if(strncmp(tmpbuf, "#6", 3)!=0 && strncmp(tmpbuf, "#32", 4)!=0) 7662 if(strncmp(tmpbuf, "#6", 3)!=0 && strncmp(tmpbuf, "#32", 4)!=0 && strncmp(tmpbuf, "#2", 3)!=0)
7672 WinSetOwner(item, box); 7663 WinSetOwner(item, box);
7673 WinSetParent(frame ? frame : item, box, FALSE); 7664 WinSetParent(frame ? frame : item, box, FALSE);
7674 } 7665 }
7675 } 7666 }
7676 7667