[futurebasic] Paper Maker

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : March 2002 : Group Archive : Group : All Groups

From: Robert Covington <artlythere@...>
Date: Sun, 24 Mar 2002 22:06:18 -0500
/*

Cheap OS X type window maker for FB3 (or FBII) v0.1

Written as FB3 Program

Robert Covington
<artlythere@...>

*/


Begin Globals
DIM gx as long
DIM gy as long
DIM gQuit
End Globals

// To make a wallpaper use these 4 in sequence all along the window.
Local FN MakePaper(wWidth as long,wHeight as long)
DIM diff,x,y

Diff = wHeight mod 4

If diff then wHeight -= diff

DIM colp as long
DIM colm as long
DIM colr as long
DIM colw as long

// Colors are in sequence:
/*
RGBs of

242,242,242
236,235,235 // Note warmer red, not completely neutral
242,242,242
255,255,255

Repeat...

Note:  For other than title bar or fixtures,
extreme ends of rows are left white.

*/

// derived by multiplying above by 256

colp  = 61952
colm  = 60160
colr  = 60416
colw  = 65535

Dec(wWidth)

// vary starting sequence to suit
For y = 0 to wHeight step 4

For x = 0 to wWidth
long color colp,colp,colp
Plot 1,y to wWidth,y
long color colw,colw,colw
Plot 1,y+1 to wWidth,y+1
long color colp,colp,colp
Plot 1,y+2 to wWidth,y+2
long color colm,colm,colr
Plot 1,y+3 to wWidth,y+3
Next x

next Y
'~'2

Long if Diff
Select Diff
case 1
long color colp,colp,colp
Plot 1,wHeight+1 to wWidth,wHeight+1
case 2
long color colp,colp,colp
Plot 1,wHeight+1 to wWidth,wHeight+1
long color colw,colw,colw
Plot 1,wHeight+2 to wWidth,wHeight+2
case 3
long color colp,colp,colp
Plot 1,wHeight+1 to wWidth,wHeight+1
long color colw,colw,colw
Plot 1,wHeight+2 to wWidth,wHeight+2
long color colp,colp,colp
Plot 1,wHeight+3 to wWidth,wHeight+3
End Select
end if

End FN

Local FN DoDialog
DIM evnt,id

evnt = Dialog(0)
id   = Dialog(evnt)

Select evnt
case _wndRefresh
FN MakePaper(gx,gy)
End Select

End fn

Local FN DoMenu
DIM menuID,itemID

menuID = Menu(_menuID)
itemID = Menu(_itemID)

Select MenuID
case 1
Select ItemID
case 1
gQuit = _True
end Select
End Select

End FN
'~'2
gQuit = _False

DIM mx,my
DIM wRect as Rect

gx = 300
gy = 200

setRect(wRect,0,0,gx,gy)

Window 1,"Paper Me",@wRect,_DocNoGrow

Menu 1,0,_enable, "File"
Menu 1,1,_enable, "Quit/Q"

on dialog FN doDialog
on Menu FN DoMenu



do
handleEvents // Take your screenshot.
until gQuit