Mercurial > dwindows
comparison os2/dw.c @ 1537:a4ecef1980db
Added code for returning a size for scrolled widgets on OS/2, Windows and Mac...
They get 500x200 because this is what GTK seems to recommend.
It occurs to me that listboxes may not currently be handled... will have to look into that.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Thu, 12 Jan 2012 18:21:54 +0000 |
parents | ad8181f70f31 |
children | 1fd3a9635c4d |
comparison
equal
deleted
inserted
replaced
1536:a71ec02f3b70 | 1537:a4ecef1980db |
---|---|
4632 } | 4632 } |
4633 | 4633 |
4634 /* Internal function to calculate the widget's required size.. | 4634 /* Internal function to calculate the widget's required size.. |
4635 * These are the general rules for widget sizes: | 4635 * These are the general rules for widget sizes: |
4636 * | 4636 * |
4637 * Scrolled(Container,Tree,MLE)/Render/Unspecified: 1x1 | 4637 * Render/Unspecified: 1x1 |
4638 * Scrolled(Container,Tree,MLE): 500x200 | |
4638 * Entryfield/Combobox/Spinbutton: 150x(maxfontheight) | 4639 * Entryfield/Combobox/Spinbutton: 150x(maxfontheight) |
4639 * Spinbutton: 50x(maxfontheight) | 4640 * Spinbutton: 50x(maxfontheight) |
4640 * Text/Status: (textwidth)x(textheight) | 4641 * Text/Status: (textwidth)x(textheight) |
4642 * Ranged: 100x14 or 14x100 for vertical. | |
4643 * Buttons/Bitmaps: Size of text or image and border. | |
4641 */ | 4644 */ |
4642 void _control_size(HWND handle, int *width, int *height) | 4645 void _control_size(HWND handle, int *width, int *height) |
4643 { | 4646 { |
4644 int thiswidth = 1, thisheight = 1, extrawidth = 0, extraheight = 0; | 4647 int thiswidth = 1, thisheight = 1, extrawidth = 0, extraheight = 0; |
4645 char tmpbuf[100] = {0}, *buf = dw_window_get_text(handle); | 4648 char tmpbuf[100] = {0}, *buf = dw_window_get_text(handle); |
4726 else if(strncmp(tmpbuf, "#6", 3)==0) | 4729 else if(strncmp(tmpbuf, "#6", 3)==0) |
4727 { | 4730 { |
4728 dw_font_text_extents_get(handle, NULL, testtext, NULL, &thisheight); | 4731 dw_font_text_extents_get(handle, NULL, testtext, NULL, &thisheight); |
4729 thiswidth = 150; | 4732 thiswidth = 150; |
4730 extraheight = 6; | 4733 extraheight = 6; |
4734 } | |
4735 /* MLE, Container and Tree */ | |
4736 else if(strncmp(tmpbuf, "#10", 4)==0 || strncmp(tmpbuf, "#37", 4)==0) | |
4737 { | |
4738 thiswidth = 500; | |
4739 thisheight = 200; | |
4731 } | 4740 } |
4732 /* Button */ | 4741 /* Button */ |
4733 else if(strncmp(tmpbuf, "#3", 3)==0) | 4742 else if(strncmp(tmpbuf, "#3", 3)==0) |
4734 { | 4743 { |
4735 ULONG style = WinQueryWindowULong(handle, QWL_STYLE); | 4744 ULONG style = WinQueryWindowULong(handle, QWL_STYLE); |