#
# Copyright (C) 1996-2001, Thomas Andrews
#
# $Id: okb 255 2008-09-15 12:43:02Z thomasoa $
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#
#
# This is set up to make output look like an okbridge screen.
#
set okrow(east) 5
set okcol(east) 50
set okrow(west) 5
set okcol(west) 15
set okrow(south) 10
set okcol(south) 36
set okrow(north) 0
set okcol(north) 36


proc okputhand {hand} {
        okbox.$hand clear
	set rowhand 0
	foreach suit {spades hearts diamonds clubs} letter {S H D C} {
		okbox.$hand write $rowhand 0 "$letter [$hand -void --- $suit]"
		incr rowhand
	}
}

proc okinit {} {
    global okrow
    global okcol
    stringbox okbox 14 70
    
    okbox subbox okbox.center 4 30 6 18
    okbox.center write  0 0 "------------------"
    okbox.center write  1 0 "|                |"
    okbox.center write  2 0 "|                |"
    okbox.center write  3 0 "|                |"
    okbox.center write  4 0 "|                |"
    okbox.center write  5 0 "------------------"
    okbox write  4 15 "West"
    okbox write  4 50 "East"
    okbox write  0 30 "North"
    okbox write 10 30 "South" 

    foreach hand {north east west south} {
    	okbox subbox okbox.$hand $okrow($hand) $okcol($hand) 4 14
    }
}

okinit

proc write_deal {} {
	foreach hand {west south north east} {
		okputhand $hand
	}
	puts "[okbox compact]"
        puts "---------------------------------------------------------------------------"
}


