comparison template/dw.c @ 985:cfc0777aceb5

Changes so the template will actually compile... and more comment completeness.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sat, 07 May 2011 02:15:50 +0000
parents 57cb9edb8944
children 87dc0f5f96d0
comparison
equal deleted inserted replaced
984:57cb9edb8944 985:cfc0777aceb5
5 * (C) 2011 Brian Smith <brian@dbsoft.org> 5 * (C) 2011 Brian Smith <brian@dbsoft.org>
6 * (C) 2011 Mark Hessling <mark@rexx.org> 6 * (C) 2011 Mark Hessling <mark@rexx.org>
7 * 7 *
8 */ 8 */
9 9
10 #include "dw.h"
11 #include <stdlib.h>
12 #include <string.h>
13
10 /* Implement these to get and set the Box* pointer on the widget handle */ 14 /* Implement these to get and set the Box* pointer on the widget handle */
11 void *_dw_get_window_pointer(HWND handle) 15 void *_dw_get_window_pointer(HWND handle)
12 { 16 {
13 return NULL; 17 return NULL;
14 } 18 }
15 19
16 void _dw_set_window_pointer(HWND handle, Box *) 20 void _dw_set_window_pointer(HWND handle, Box *box)
17 { 21 {
18 } 22 }
19 23
20 /* This function calculates how much space the widgets and boxes require 24 /* This function calculates how much space the widgets and boxes require
21 * and does expansion as necessary. 25 * and does expansion as necessary.
1083 * Returns: 1087 * Returns:
1084 * State of checkbox (TRUE or FALSE). 1088 * State of checkbox (TRUE or FALSE).
1085 */ 1089 */
1086 int API dw_checkbox_get(HWND handle) 1090 int API dw_checkbox_get(HWND handle)
1087 { 1091 {
1088 DWButton *button = handle;
1089 if([button state])
1090 {
1091 return TRUE;
1092 }
1093 return FALSE; 1092 return FALSE;
1094 } 1093 }
1095 1094
1096 /* 1095 /*
1097 * Sets the state of the checkbox. 1096 * Sets the state of the checkbox.
1648 /* 1647 /*
1649 * Gets the item data of a tree item. 1648 * Gets the item data of a tree item.
1650 * Parameters: 1649 * Parameters:
1651 * handle: Handle to the tree containing the item. 1650 * handle: Handle to the tree containing the item.
1652 * item: Handle of the item to be modified. 1651 * item: Handle of the item to be modified.
1652 * Returns:
1653 * A pointer to tree item data or NULL on failure.
1653 */ 1654 */
1654 void * API dw_tree_item_get_data(HWND handle, HTREEITEM item) 1655 void * API dw_tree_item_get_data(HWND handle, HTREEITEM item)
1655 { 1656 {
1657 return NULL;
1656 } 1658 }
1657 1659
1658 /* 1660 /*
1659 * Sets this item as the active selection. 1661 * Sets this item as the active selection.
1660 * Parameters: 1662 * Parameters:
2928 * freq: Frequency. 2930 * freq: Frequency.
2929 * dur: Duration. 2931 * dur: Duration.
2930 */ 2932 */
2931 void API dw_beep(int freq, int dur) 2933 void API dw_beep(int freq, int dur)
2932 { 2934 {
2933 NSBeep();
2934 } 2935 }
2935 2936
2936 /* Call this after drawing to the screen to make sure 2937 /* Call this after drawing to the screen to make sure
2937 * anything you have drawn is visible. 2938 * anything you have drawn is visible.
2938 */ 2939 */
3006 * window: Window handle of callback to be removed. 3007 * window: Window handle of callback to be removed.
3007 * signame: Signal name to be matched on window. 3008 * signame: Signal name to be matched on window.
3008 */ 3009 */
3009 void API dw_signal_disconnect_by_name(HWND window, char *signame) 3010 void API dw_signal_disconnect_by_name(HWND window, char *signame)
3010 { 3011 {
3011 SignalHandler *prev = NULL, *tmp = Root;
3012 ULONG message;
3013
3014 if(!window || !signame || (message = _findsigmessage(signame)) == 0)
3015 return;
3016
3017 while(tmp)
3018 {
3019 if(tmp->window == window && tmp->message == message)
3020 {
3021 if(prev)
3022 {
3023 prev->next = tmp->next;
3024 free(tmp);
3025 tmp = prev->next;
3026 }
3027 else
3028 {
3029 Root = tmp->next;
3030 free(tmp);
3031 tmp = Root;
3032 }
3033 }
3034 else
3035 {
3036 prev = tmp;
3037 tmp = tmp->next;
3038 }
3039 }
3040 } 3012 }
3041 3013
3042 /* 3014 /*
3043 * Removes all callbacks for a given window. 3015 * Removes all callbacks for a given window.
3044 * Parameters: 3016 * Parameters: