The R Project SVN R

Rev

Rev 13710 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 13710 Rev 17533
Line 964... Line 964...
964
		settext(obj, text);
964
		settext(obj, text);
965
	}
965
	}
966
	return obj;
966
	return obj;
967
}
967
}
968
 
968
 
969
SCROLLINFO si;
969
static SCROLLINFO si;
970
 
970
 
971
scrollbar newscrollbar(rect r, int max, int pagesize, scrollfn fn)
971
scrollbar newscrollbar(rect r, int max, int pagesize, scrollfn fn)
972
{
972
{
973
	scrollbar obj;
973
	scrollbar obj;
974
	HWND hwnd;
974
	HWND hwnd;
Line 1014... Line 1014...
1014
	si.nPage = pagesize;
1014
	si.nPage = pagesize;
1015
	si.nPos = where;
1015
	si.nPos = where;
1016
	SetScrollInfo(hwnd, SB_CTL, &si, 1);
1016
	SetScrollInfo(hwnd, SB_CTL, &si, 1);
1017
}
1017
}
1018
 
1018
 
1019
#ifdef OLD
-
 
1020
scrollbar newscrollbar(rect r, int max, int pagesize, scrollfn fn)
-
 
1021
{
-
 
1022
	scrollbar obj;
-
 
1023
	HWND hwnd;
-
 
1024
 
-
 
1025
	r = rcanon(r);
-
 
1026
 
-
 
1027
	obj = newchildwin("scrollbar", NULL,
-
 
1028
			(r.width > r.height) ? SBS_HORZ : SBS_VERT,
-
 
1029
			r, NULL);
-
 
1030
	if (obj) {
-
 
1031
		obj->kind = ScrollbarObject;
-
 
1032
		obj->hit = fn;
-
 
1033
		obj->value = 0;
-
 
1034
		obj->max = max;
-
 
1035
		obj->size = pagesize;
-
 
1036
 
-
 
1037
		hwnd = obj->handle;
-
 
1038
		SetScrollRange(hwnd, SB_CTL, 0, max, 0);
-
 
1039
		SetScrollPos(hwnd, SB_CTL, 0, 1);
-
 
1040
	}
-
 
1041
	return obj;
-
 
1042
}
-
 
1043
 
-
 
1044
void changescrollbar(scrollbar obj, int where, int max, int pagesize)
-
 
1045
{
-
 
1046
	HWND hwnd;
-
 
1047
 
-
 
1048
	if (! obj)
-
 
1049
		return;
-
 
1050
	hwnd = obj->handle;
-
 
1051
	obj->max = max;
-
 
1052
	obj->size = pagesize;
-
 
1053
	SetScrollRange(hwnd, SB_CTL, 0, max, 0);
-
 
1054
	SetScrollPos(hwnd, SB_CTL, where, 1);
-
 
1055
}
-
 
1056
#endif
-
 
1057
 
-
 
1058
listbox newlistbox(char *list[], rect r, scrollfn fn)
1019
listbox newlistbox(char *list[], rect r, scrollfn fn)
1059
{
1020
{
1060
	listbox obj;
1021
	listbox obj;
1061
 
1022
 
1062
	obj = newchildwin("listbox", NULL,
1023
	obj = newchildwin("listbox", NULL,