# Filename: gui_begin_same_line.py
# Purpose:  Create a panel showing 4 frame blocks side-by-side.
# Results:  Messagebox showing selected results.

from maptek import vulcan_gui

pan = vulcan_gui.panel(title="Basic Panel")

pan.begin_same_line()


# additional spaces were added to prompt one to increase the width
pan.begin_block(border=True, title='First Block')
pan.radiobutton(tag='rad_1', prompt='One            ', initial=True, bank=0)
pan.radiobutton(tag='rad_2', prompt='Two', initial=False, bank=0)
pan.end_block()

pan.begin_block(border=True, title='Second Block')
pan.radiobutton(tag='rad_3', prompt='One            ', initial=True, bank=1)
pan.radiobutton(tag='rad_4', prompt='Two', initial=False, bank=1)
pan.end_block()

pan.begin_block(border=True, title='Third Block')
pan.radiobutton(tag='rad_5', prompt='One            ', initial=True, bank=2)
pan.radiobutton(tag='rad_6', prompt='Two', initial=False, bank=2)
pan.end_block()

pan.begin_block(border=True, title='Fourth Block')
pan.radiobutton(tag='rad_7', prompt='One            ', initial=True, bank=3)
pan.radiobutton(tag='rad_8', prompt='Two', initial=False, bank=3)
pan.end_block()

pan.end_same_line()

pan.display()

if pan['rad_1']:
    r1 = 'First Block: One'
else:
    r1 = 'First Block: Two'

if pan['rad_3']:
    r2 = 'Second Block: One'
else:
    r2 = 'Second Block: Two'

if pan['rad_5']:
    r3 = 'Third Block: One'
else:
    r3 = 'Third Block: Two'

if pan['rad_7']:
    r4 = 'Fourth Block: One'
else:
    r4 = 'Fourth Block: Two'

message = (r1 + '\n' + r2 + '\n' + r3 + '\n' + r4)
vulcan_gui.message(message)