Mercurial > dwindows
comparison os2/dw.c @ 1035:31dc5b4f6cfc
Ok... better fix for the OS/2 spinbutton issue
This one actually works.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Thu, 26 May 2011 06:08:14 +0000 |
parents | af2c93f78ae9 |
children | 59343c7493a3 |
comparison
equal
deleted
inserted
replaced
1034:af2c93f78ae9 | 1035:31dc5b4f6cfc |
---|---|
5342 blah = calloc(sizeof(WindowData), 1); | 5342 blah = calloc(sizeof(WindowData), 1); |
5343 blah->oldproc = WinSubclassWindow(entry, _spinentryproc); | 5343 blah->oldproc = WinSubclassWindow(entry, _spinentryproc); |
5344 WinSetWindowPtr(entry, QWP_USER, blah); | 5344 WinSetWindowPtr(entry, QWP_USER, blah); |
5345 dw_window_set_font(tmp, DefaultFont); | 5345 dw_window_set_font(tmp, DefaultFont); |
5346 dw_window_set_color(entry, DW_CLR_BLACK, DW_CLR_WHITE); | 5346 dw_window_set_color(entry, DW_CLR_BLACK, DW_CLR_WHITE); |
5347 dw_window_set_data(tmp, "_dw_entry", (void *)entry); | |
5347 return tmp; | 5348 return tmp; |
5348 } | 5349 } |
5349 | 5350 |
5350 /* | 5351 /* |
5351 * Create a new radiobutton window (widget) to be packed. | 5352 * Create a new radiobutton window (widget) to be packed. |
5765 * handle: Handle to the window. | 5766 * handle: Handle to the window. |
5766 * text: The text associsated with a given window. | 5767 * text: The text associsated with a given window. |
5767 */ | 5768 */ |
5768 void API dw_window_set_text(HWND handle, char *text) | 5769 void API dw_window_set_text(HWND handle, char *text) |
5769 { | 5770 { |
5770 HWND entryfield = WinWindowFromID(handle, 1703); | 5771 HWND entryfield = (HWND)dw_window_get_data(handle, "_dw_entry"); |
5771 WinSetWindowText(entryfield ? entryfield : handle, text); | 5772 WinSetWindowText(entryfield ? entryfield : handle, text); |
5772 } | 5773 } |
5773 | 5774 |
5774 /* | 5775 /* |
5775 * Gets the text used for a given window. | 5776 * Gets the text used for a given window. |
5778 * Returns: | 5779 * Returns: |
5779 * text: The text associsated with a given window. | 5780 * text: The text associsated with a given window. |
5780 */ | 5781 */ |
5781 char * API dw_window_get_text(HWND handle) | 5782 char * API dw_window_get_text(HWND handle) |
5782 { | 5783 { |
5783 HWND entryfield = WinWindowFromID(handle, 1703); | 5784 HWND entryfield = (HWND)dw_window_get_data(handle, "_dw_entry"); |
5784 int len = WinQueryWindowTextLength(entryfield ? entryfield : handle); | 5785 int len = WinQueryWindowTextLength(entryfield ? entryfield : handle); |
5785 char *tempbuf = calloc(1, len + 2); | 5786 char *tempbuf = calloc(1, len + 2); |
5786 | 5787 |
5787 WinQueryWindowText(entryfield ? entryfield : handle, len + 1, tempbuf); | 5788 WinQueryWindowText(entryfield ? entryfield : handle, len + 1, tempbuf); |
5788 | 5789 |