Greyscale bars/Display: Difference between revisions
Content added Content deleted
Line 641: | Line 641: | ||
void local fn BuildGrayBarWindow |
void local fn BuildGrayBarWindow |
||
NSInteger i |
NSInteger i |
||
float gray |
float gray |
||
CGRect r = fn CGRectMake( 0, 0, 640, 400 ) |
CGRect r = fn CGRectMake( 0, 0, 640, 400 ) |
||
window _window, @"Gray Scale Window", r |
window _window, @"Gray Scale Window", r |
||
WindowSetBackgroundColor( _window, fn ColorBlack ) |
WindowSetBackgroundColor( _window, fn ColorBlack ) |
||
gray = 0.0 |
gray = 0.0 |
||
r = fn CGrectMake( 0, 300, 80, 100 ) |
r = fn CGrectMake( 0, 300, 80, 100 ) |
||
for i = 1 to 8 |
for i = 1 to 8 |
||
textfield i, YES,,r,_window |
textfield i, YES,,r,_window |
||
TextFieldSetEditable( i, NO ) |
TextFieldSetEditable( i, NO ) |
||
TextFieldSetBackgroundColor( i, fn ColorWithRGB( gray, gray, gray, 1.0 ) ) |
TextFieldSetBackgroundColor( i, fn ColorWithRGB( gray, gray, gray, 1.0 ) ) |
||
r = fn CGRectOffset( r, 80, 0 ) |
r = fn CGRectOffset( r, 80, 0 ) |
||
gray += 0.142857142857143 // 1/7 |
gray += 0.142857142857143 // 1/7 |
||
next |
next |
||
gray = 1.0 |
gray = 1.0 |
||
r = fn CGrectMake( 0, 200, 40, 100 ) |
r = fn CGrectMake( 0, 200, 40, 100 ) |
||
for i = 11 to 26 |
for i = 11 to 26 |
||
textfield i, YES,,r,_window |
textfield i, YES,,r,_window |
||
TextFieldSetEditable( i, NO ) |
TextFieldSetEditable( i, NO ) |
||
TextFieldSetBackgroundColor( i, fn ColorWithRGB( gray, gray, gray, 1.0 ) ) |
TextFieldSetBackgroundColor( i, fn ColorWithRGB( gray, gray, gray, 1.0 ) ) |
||
r = fn CGRectOffset( r, 40, 0 ) |
r = fn CGRectOffset( r, 40, 0 ) |
||
gray -= 0.066666666666667 // 1/5 |
gray -= 0.066666666666667 // 1/5 |
||
next |
next |
||
gray = 0.0 |
gray = 0.0 |
||
r = fn CGrectMake( 0, 100, 20, 100 ) |
r = fn CGrectMake( 0, 100, 20, 100 ) |
||
for i = 31 to 62 |
for i = 31 to 62 |
||
textfield i, YES,,r,_window |
textfield i, YES,,r,_window |
||
TextFieldSetEditable( i, NO ) |
TextFieldSetEditable( i, NO ) |
||
TextFieldSetBackgroundColor( i, fn ColorWithRGB( gray, gray, gray, 1.0 ) ) |
TextFieldSetBackgroundColor( i, fn ColorWithRGB( gray, gray, gray, 1.0 ) ) |
||
r = fn CGRectOffset( r, 20, 0 ) |
r = fn CGRectOffset( r, 20, 0 ) |
||
gray += 0.032258064516129 // 1/31 |
gray += 0.032258064516129 // 1/31 |
||
next |
next |
||
gray = 1.0 |
gray = 1.0 |
||
r = fn CGrectMake( 0, 0, 10, 100 ) |
r = fn CGrectMake( 0, 0, 10, 100 ) |
||
for i = 101 to 164 |
for i = 101 to 164 |
||
textfield i, YES,,r,_window |
textfield i, YES,,r,_window |
||
TextFieldSetEditable( i, NO ) |
TextFieldSetEditable( i, NO ) |
||
TextFieldSetBackgroundColor( i, fn ColorWithRGB( gray, gray, gray, 1.0 ) ) |
TextFieldSetBackgroundColor( i, fn ColorWithRGB( gray, gray, gray, 1.0 ) ) |
||
r = fn CGRectOffset( r, 10, 0 ) |
r = fn CGRectOffset( r, 10, 0 ) |
||
gray -= 0.015873015873016 // 1/63 |
gray -= 0.015873015873016 // 1/63 |
||
next |
next |
||
end fn |
end fn |
||