/*
  webuse

  VERSION 1.0.0  23feb2005

*/

VERSION 9.0

INCLUDE _std_medium

INCLUDE header

HELP hlp1, view("help webdescribe")
RESET res1

DIALOG main, label("webdescribe - Describe dataset from web") /*
           */tabtitle("Main")
BEGIN
  GROUPBOX gb_opt           _lft      _top       _iwd      _ht8,	  /*
           */ label("Options")
  RADIO    rb_file          _indent   _ss        _inwd      .,            /*
           */ first                                                       /*
           */ label("Describe file")                                      /*
           */ clickon(script rb_file_on)
  RADIO    rb_query            @      _ss         @         .,            /*
           */ label("Query URL")                                          /*
           */ clickon(script rb_query_on)    
  RADIO    rb_url              @      _ss         @         .,            /*
           */ label("Set URL")                                            /*
           */ clickon(script rb_url_on)
  RADIO    rb_reset            @      _ss         @         .,            /*
           */ last                                                        /*
           */ label("Reset URL to default")                               /*
           */ clickon(script rb_query_on)  
  GROUPBOX gb_file          _lft      _xxls      _iwd      _ht5h,        
  EDIT     ed_file          _indent   _ms        _inwd      .,            /*
           */ label("File ")
  DEFINE   holdy @y 
  CHECKBOX ck_short            @      _ms        _inwd      .,            /*
           */ label("Show only dataset summary information")              /*
           */ option(short)
  EDIT     ed_url              @     holdy       _inwd      .,            /*
           */ label("URL ")
END

SCRIPT rb_file_on
BEGIN
  main.gb_file.show
  main.gb_file.setlabel "File to describe "
  main.ed_url.hide
  main.ed_file.show
  main.ck_short.show
  
END

SCRIPT rb_url_on
BEGIN
  main.gb_file.show
  main.gb_file.setlabel "New URL to select "
  main.ed_url.show
  main.ed_file.hide
  main.ck_short.hide
END

SCRIPT rb_query_on
BEGIN
  main.ed_url.hide
  main.gb_file.hide
  main.ed_file.hide
  main.ck_short.hide
END

PROGRAM command
BEGIN
	put "webdescribe "
        if main.rb_file {
           require main.ed_file
           put `"""'
           put main.ed_file
           put `"""'
        }
        if main.rb_url {
           require main.ed_url
           put "set "
           put main.ed_url
        }
        if main.rb_query {
           put "query "
        }
        if main.rb_reset {
           put "set "
        }
        beginoptions
           option main.ck_short
        endoptions
END

