Changeset 41
- Timestamp:
- 05/13/07 18:18:59 (2 years ago)
- Files:
-
- branches/bughunt/minwin/listbox.d (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/bughunt/minwin/listbox.d
r40 r41 32 32 this.name = name; 33 33 HINSTANCE hInst = GetModuleHandleA(null); 34 DWORD dwStyle = (vscroll?WS_VSCROLL:0) | (hscroll?WS_HSCROLL:0); 34 35 peer = CreateWindowA("LISTBOX","", 35 WS_CHILD | WS_VISIBLE ,36 WS_CHILD | WS_VISIBLE | dwStyle, 36 37 0,0,10,10,parentp, 37 38 cast(HMENU)0,hInst,null); … … 48 49 Point preferredSize() { 49 50 // width = SendMessageA(peer,CB_GETDROPPEDWIDTH,0,0); 50 int height = SendMessageA(peer,LB_GETITEMHEIGHT,cast(WPARAM)-1,0)* 51 SendMessageA(peer,LB_GETCOUNT,0,0); 52 int width = 75; 51 int width = (userPreferredWidth > 0) ? userPreferredWidth : 75; // TODO this is arbitrary 52 int height = (userPreferredHeight > 0) ? userPreferredHeight : 53 SendMessageA(peer,LB_GETITEMHEIGHT,cast(WPARAM)-1,0) 54 * SendMessageA(peer,LB_GETCOUNT,0,0); 53 55 return XY(width,height); 54 56 }
