55 lines
1.4 KiB
Plaintext
55 lines
1.4 KiB
Plaintext
_window = 1
|
|
|
|
void local fn BuildGrayBarWindow
|
|
NSInteger i
|
|
float gray
|
|
|
|
CGRect r = fn CGRectMake( 0, 0, 640, 400 )
|
|
window _window, @"Gray Scale Window", r
|
|
WindowSetBackgroundColor( _window, fn ColorBlack )
|
|
|
|
gray = 0.0
|
|
r = fn CGrectMake( 0, 300, 80, 100 )
|
|
for i = 1 to 8
|
|
textfield i, YES,,r,_window
|
|
TextFieldSetEditable( i, NO )
|
|
TextFieldSetBackgroundColor( i, fn ColorWithRGB( gray, gray, gray, 1.0 ) )
|
|
r = fn CGRectOffset( r, 80, 0 )
|
|
gray += 0.142857142857143 // 1/7
|
|
next
|
|
|
|
gray = 1.0
|
|
r = fn CGrectMake( 0, 200, 40, 100 )
|
|
for i = 11 to 26
|
|
textfield i, YES,,r,_window
|
|
TextFieldSetEditable( i, NO )
|
|
TextFieldSetBackgroundColor( i, fn ColorWithRGB( gray, gray, gray, 1.0 ) )
|
|
r = fn CGRectOffset( r, 40, 0 )
|
|
gray -= 0.066666666666667 // 1/5
|
|
next
|
|
|
|
gray = 0.0
|
|
r = fn CGrectMake( 0, 100, 20, 100 )
|
|
for i = 31 to 62
|
|
textfield i, YES,,r,_window
|
|
TextFieldSetEditable( i, NO )
|
|
TextFieldSetBackgroundColor( i, fn ColorWithRGB( gray, gray, gray, 1.0 ) )
|
|
r = fn CGRectOffset( r, 20, 0 )
|
|
gray += 0.032258064516129 // 1/31
|
|
next
|
|
|
|
gray = 1.0
|
|
r = fn CGrectMake( 0, 0, 10, 100 )
|
|
for i = 101 to 164
|
|
textfield i, YES,,r,_window
|
|
TextFieldSetEditable( i, NO )
|
|
TextFieldSetBackgroundColor( i, fn ColorWithRGB( gray, gray, gray, 1.0 ) )
|
|
r = fn CGRectOffset( r, 10, 0 )
|
|
gray -= 0.015873015873016 // 1/63
|
|
next
|
|
end fn
|
|
|
|
fn BuildGrayBarWindow
|
|
|
|
HandleEvents
|