Greyscale bars/Display: Difference between revisions

no edit summary
(→‎{{header|J}}: J9 revision)
No edit summary
Line 634:
}
</lang>
 
=={{header|FutureBasic}}==
[[File:GrayscalesR.png|thumb|right]]
<lang futurebasic>
_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.125
next
 
gray = 1.0
r = fn CGrectMake( 0, 200, 40, 100 )
for i = 10 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.0625
next
 
gray = 0.0
r = fn CGrectMake( 0, 100, 20, 100 )
for i = 30 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.03125
next
 
gray = 1.0
r = fn CGrectMake( 0, 0, 10, 100 )
for i = 100 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.015625
next
end fn
 
fn BuildGrayBarWindow
 
HandleEvents
</lang>
 
 
 
=={{header|Gambas}}==
717

edits