#! perl

#-------------------------------------------------------------------------------
# CUSTOM STYLE SHEET GENERATOR by Chris Etzel 
# this is a project that a friend and I are working on for shits and giggles. 
# one of these days it will have a nice skinned gui, may have to use C of VB to
# get the gui the way we want it. But for now, it is a standard boring gray 
# window....
# feel free to edit, change, rewrite the code as needed to suit your purposes.
# just try and credit me for the original. Thanks - Chris
#-------------------------------------------------------------------------------

use Win32::GUI;


# declaring scalars to contain css properties - based off user input
my (
   #BODY SCALARS
   $bgcolor,
   $fontsize,
   $fontfam,
   $topmargin,
   $leftmargin,
   #LINK SCALARS
   $lcolor,
   $lfontsize,
   $lfontfam,
   $ltextdec,
   #ACTIVE LINK SCALARS
   $alcolor,
   $alfontsize,
   $alfontfam,
   $altextdec,
   #VISITED LINK SCALARS
   $vlcolor,
   $vlfontsize,
   $vlfontfam,
   $vltextdec,
   #HOVER (mouseOver) SCALARS
   $hcolor,
   $hfontsize,
   $hfontfam,
   $htextdec,
   #TABLE DATA FONT SCALARS
   $tdcolor,
   $tdfontsize,
   $tdfontfam,
   $tdtextdec
   );
# create the main window
$Win1 = Win32::GUI::DialogBox->new(
	-name=>"Win1",
	-size=>[640,480],
	-top=>50,
	-left=>50,
	-title=>"CSS Generator v (0)",
	-helpbutton=>0,
	);

$Win1->Show();

#testing menu
# still having trouble with a file - menu - need to work on my Win32-gui coding
# some more. lol

#$Menu = new Win32::GUI::Menu($Win1,
#            "&File"    => "File",
#            " > &Load" => "FileLoad",
#        );

# bgcolor text field
$bgcolortf=$Win1->AddTextfield(
	-name=>"bgcolortf",
	-width=>75,
	-height=>20,
	-top=>10,
	-left=>10,
	-tabstop=>1,
	-text=>"#FFFFFF",
	);


# body font color text field
$bfcolortf=$Win1->AddTextfield(
	-name=>"bfonttf",
	-width=>75,
	-height=>20,
	-top=>35,
	-left=>10,
	-tabstop=>1,
	-text=>"#000000",
	);


#link color text field
$lfontcolortf=$Win1->AddTextfield(
	-name=>"lfonttf",
	-width=>75,
	-height=>20,
	-top=>60,
	-left=>10,
	-tabstop=>1,
	-text=>"#FF0000",
	);


#visited link color text field
$vfontcolortf=$Win1->AddTextfield(
	-name=>"vfonttf",
	-width=>75,
	-height=>20,
	-top=>85,
	-left=>10,
	-tabstop=>1,
	-text=>"#0000FF",
	
	);


#active link color text field
$afontcolortf=$Win1->AddTextfield(
	-name=>"afonttf",
	-width=>75,
	-height=>20,
	-top=>110,
	-left=>10,
	-tabstop=>1,
	-text=>"#F0FF00",
	);
	

#hover (mouseover) link color text field
$hcolortf=$Win1->AddTextfield(
	-name=>"hcolortf",
	-width=>75,
	-height=>20,
	-top=>135,
	-left=>10,
	-tabstop=>1,
	-text=>"#FF00FF",
	);
	
	
# td font color text field
$tdcolortf=$Win1->AddTextfield(
	-name=>"tdcolortf",
	-width=>75,
	-height=>20,
	-text=>"#000000",
	-top=>160,
	-left=>10,
	-tabstop=>1,
	);


#bgcolor label
$bgcolorlb=$Win1->AddLabel(
		-name=>"bgcolorlb",
		-width=>75,
		-height=>20,
		-text=>"BGCOLOR",
		-top=>17,
		-left=>90,
		-tabstop=>0,
		);
		
		$Win1->bgcolorlb->Show();

#font color label
$bfcolorlbl=$Win1->AddLabel(
		-name=>"bfcolorlbl",
		-width=>75,
		-height=>20,
		-text=>"FONT COLOR",
		-top=>42,
		-left=>90,
		-tabstop=>0,
		);
		$Win1->bfcolorlbl->Show();
		
#link color label
$lfcolorlbl=$Win1->AddLabel(
		-name=>"lfcolorlbl",
		-width=>75,
		-height=>20,
		-text=>"LINK COLOR",
		-top=>67,
		-left=>90,
		-tabstop=>0,
		);
		$Win1->lfcolorlbl->Show();

# visited link color label
$vfcolorlbl=$Win1->AddLabel(
		-name=>"vfcolorlbl",
		-width=>75,
		-height=>20,
		-text=>"VLINK COLOR",
		-top=>92,
		-left=>90,
		-tabstop=>0,
		);
		$Win1->vfcolorlbl->Show();

#active link color label
$afcolorlbl=$Win1->AddLabel(
		-name=>"afcolorlbl",
		-width=>75,
		-height=>20,
		-text=>"ALINK COLOR",
		-top=>117,
		-left=>90,
		-tabstop=>0,
		);
		$Win1->afcolorlbl->Show();
		
# hover link color label
$hfcolorlbl=$Win1->AddLabel(
		-name=>"hfcolorlbl",
		-width=>75,
		-height=>20,
		-text=>"HLINK COLOR",
		-top=>142,
		-left=>90,
		-tabstop=>0,
		);
		$Win1->hfcolorlbl->Show();
		
# td color label
$tdcolorlbl=$Win1->AddLabel(
		-name=>"tdcolorlbl",
		-width=>90,
		-height=>20,
		-text=>"TDFONT COLOR",
		-top=>167,
		-left=>90,
		-tabstop=>0,
		);
		$Win1->tdcolorlbl->Show();

# this is the start of the font face selections for the stylesheet. they are 
# in a dropdown with option to enter custom font (not recommended...of course)

# body font face selection...
$bfontdd=$Win1->AddCombobox(
	-name=>"bfontdd",
	-width=>100,
	-height=>140,
	-tabstop=>1,
	-top=>242,
	-left=>80,
	-style=> WS_VISIBLE | WS_SCROLL | 3 | WS_TABSTOP
	);
	
	# create the actual font list
	$bfontdd->InsertItem("Arial, Helvetica, sans-serif");
	$bfontdd->InsertItem("Times New Roman, Times, serif");
	$bfontdd->InsertItem("Courier New, Courier, mono");
	$bfontdd->InsertItem("Georgia, Times New Roman, Times, serif");
	$bfontdd->InsertItem("Verdana, Arial, Helvetica, sans-serif");
	$bfontdd->InsertItem("Geneva, Arial, Helvetica, san-serif");
	$bfontdd->InsertItem("custom --->");
	$bfontdd->Select(1);
	
	
	  sub bfontdd_Change{
	  	  $bfontdd->Text($bfontdd->GetString($bfontdd->SelectedItem));
		  }
		  #if the font is a selected one, $bfontfam is the selected font,
		  #otherwise, you can enter a custom font and the $bfontfam is the
		  #text you enter in the field to the right
		  
			 # create the custom text field for the bfontfam variable
			   		  $bfcustom=$Win1->AddTextfield(
					  					-name=>"bfcustom",
										-width=>75,
										-height=>20,
										#-text=>
										-top=>242,
										-left=>180,
										-tabstop=>1,
										);
										
# link font face
$lfontdd=$Win1->AddCombobox(
	-name=>"lfontdd",
	-width=>100,
	-height=>140,
	-tabstop=>1,
	-top=>267,
	-left=>80,
	-style=> WS_VISIBLE | WS_SCROLL | 3 | WS_TABSTOP
	);
	
	# create the actual font list
	$lfontdd->InsertItem("Arial, Helvetica, sans-serif");
	$lfontdd->InsertItem("Times New Roman, Times, serif");
	$lfontdd->InsertItem("Courier New, Courier, mono");
	$lfontdd->InsertItem("Georgia, Times New Roman, Times, serif");
	$lfontdd->InsertItem("Verdana, Arial, Helvetica, sans-serif");
	$lfontdd->InsertItem("Geneva, Arial, Helvetica, san-serif");
	$lfontdd->InsertItem("custom --->");
	$lfontdd->Select(1);
	
	
	  sub lfontdd_Change{
	  	  $lfontdd->Text($lfontdd->GetString($lfontdd->SelectedItem));
		  }
		  #if the font is a selected one, $lfontfam is the selected font,
		  #otherwise, you can enter a custom font and the $lfontfam is the
		  #text you enter in the field to the right
		  
			 # create the custom text field for the bfontfam variable
			   		  $lfcustom=$Win1->AddTextfield(
					  					-name=>"lfcustom",
										-width=>75,
										-height=>20,
										#-text=>
										-top=>267,
										-left=>180,
										-tabstop=>1,
										);

# vlink font face
$vfontdd=$Win1->AddCombobox(
	-name=>"vfontdd",
	-width=>100,
	-height=>140,
	-tabstop=>1,
	-top=>292,
	-left=>80,
	-style=> WS_VISIBLE | WS_SCROLL | 3 | WS_TABSTOP
	);
	
	# create the actual font list
	$vfontdd->InsertItem("Arial, Helvetica, sans-serif");
	$vfontdd->InsertItem("Times New Roman, Times, serif");
	$vfontdd->InsertItem("Courier New, Courier, mono");
	$vfontdd->InsertItem("Georgia, Times New Roman, Times, serif");
	$vfontdd->InsertItem("Verdana, Arial, Helvetica, sans-serif");
	$vfontdd->InsertItem("Geneva, Arial, Helvetica, san-serif");
	$vfontdd->InsertItem("custom --->");
	$vfontdd->Select(1);
	
	
	  sub vfontdd_Change{
	  	  $vfontdd->Text($vfontdd->GetString($vfontdd->SelectedItem));
		  }
		  #if the font is a selected one, $vfontfam is the selected font,
		  #otherwise, you can enter a custom font and the $vfontfam is the
		  #text you enter in the field to the right
		  
			 # create the custom text field for the bfontfam variable
			   		  $vfcustom=$Win1->AddTextfield(
					  					-name=>"vfcustom",
										-width=>75,
										-height=>20,
										#-text=>
										-top=>292,
										-left=>180,
										-tabstop=>1,
										);

										
# alink font face
$afontdd=$Win1->AddCombobox(
	-name=>"afontdd",
	-width=>100,
	-height=>140,
	-tabstop=>1,
	-top=>317,
	-left=>80,
	-style=> WS_VISIBLE | WS_SCROLL | 3 | WS_TABSTOP
	);
	
	# create the actual font list
	$afontdd->InsertItem("Arial, Helvetica, sans-serif");
	$afontdd->InsertItem("Times New Roman, Times, serif");
	$afontdd->InsertItem("Courier New, Courier, mono");
	$afontdd->InsertItem("Georgia, Times New Roman, Times, serif");
	$afontdd->InsertItem("Verdana, Arial, Helvetica, sans-serif");
	$afontdd->InsertItem("Geneva, Arial, Helvetica, san-serif");
	$afontdd->InsertItem("custom --->");
	$afontdd->Select(1);
	
	
	  sub afontdd_Change{
	  	  $afontdd->Text($afontdd->GetString($afontdd->SelectedItem));
		  }
		  #if the font is a selected one, $afontfam is the selected font,
		  #otherwise, you can enter a custom font and the $afontfam is the
		  #text you enter in the field to the right
		  
			 # create the custom text field for the bfontfam variable
			   		  $afcustom=$Win1->AddTextfield(
					  					-name=>"afcustom",
										-width=>75,
										-height=>20,
										#-text=>
										-top=>317,
										-left=>180,
										-tabstop=>1,
										);

# hlink font 
$hfontdd=$Win1->AddCombobox(
	-name=>"hfontdd",
	-width=>100,
	-height=>140,
	-tabstop=>1,
	-top=>342,
	-left=>80,
	-style=> WS_VISIBLE | WS_SCROLL | 3 | WS_TABSTOP
	);
	
	# create the actual font list
	$hfontdd->InsertItem("Arial, Helvetica, sans-serif");
	$hfontdd->InsertItem("Times New Roman, Times, serif");
	$hfontdd->InsertItem("Courier New, Courier, mono");
	$hfontdd->InsertItem("Georgia, Times New Roman, Times, serif");
	$hfontdd->InsertItem("Verdana, Arial, Helvetica, sans-serif");
	$hfontdd->InsertItem("Geneva, Arial, Helvetica, san-serif");
	$hfontdd->InsertItem("custom --->");
	$hfontdd->Select(1);
	
	
	  sub afontdd_Change{
	  	  $hfontdd->Text($hfontdd->GetString($hfontdd->SelectedItem));
		  }
		  #if the font is a selected one, $hfontfam is the selected font,
		  #otherwise, you can enter a custom font and the $hfontfam is the
		  #text you enter in the field to the right
		  
			 # create the custom text field for the bfontfam variable
			   		  $hfcustom=$Win1->AddTextfield(
					  					-name=>"hfcustom",
										-width=>75,
										-height=>20,
										#-text=>
										-top=>342,
										-left=>180,
										-tabstop=>1,
										);

# td font face
$tdfontdd=$Win1->AddCombobox(
	-name=>"tdfontdd",
	-width=>100,
	-height=>140,
	-tabstop=>1,
	-top=>367,
	-left=>80,
	-style=> WS_VISIBLE | WS_SCROLL | 3 | WS_TABSTOP
	);
	
	# create the actual font list
	$tdfontdd->InsertItem("Arial, Helvetica, sans-serif");
	$tdfontdd->InsertItem("Times New Roman, Times, serif");
	$tdfontdd->InsertItem("Courier New, Courier, mono");
	$tdfontdd->InsertItem("Georgia, Times New Roman, Times, serif");
	$tdfontdd->InsertItem("Verdana, Arial, Helvetica, sans-serif");
	$tdfontdd->InsertItem("Geneva, Arial, Helvetica, san-serif");
	$tdfontdd->InsertItem("custom --->");
	$tdfontdd->Select(1);
	
	
	  sub tdfontdd_Change{
	  	  $tdfontdd->Text($tdfontdd->GetString($tdfontdd->SelectedItem));
		  }
		  #if the font is a selected one, $tdfontfam is the selected font,
		  #otherwise, you can enter a custom font and the $tdfontfam is the
		  #text you enter in the field to the right
		 
			 # create the custom text field for the bfontfam variable
			   		  $tdfcustom=$Win1->AddTextfield(
					  					-name=>"tdfcustom",
										-width=>75,
										-height=>20,
										#-text=>
										-top=>367,
										-left=>180,
										-tabstop=>1,
										);
#font face main label
$fontheaderlabel=$Win1->AddLabel(
		-name=>"fontheaderlabel",
		-width=>75,
		-height=>20,
		-text=>"FONT FACE",
		-top=>220,
		-left=>80,
		-tabstop=>0,
		);
		$Win1->fontheaderlabel->Show();
		
# custom font label
$customfontlabel=$Win1->AddLabel(
		-name=>"customfontlabel",
		-width=>90,
		-height=>20,
		-text=>"CUSTOM FONT",
		-top=>220,
		-left=>180,
		-tabstop=>0,
		);
		$Win1->customfontlabel->Show();
		
# body font face label
$bfontfamlbl=$Win1->AddLabel(
		-name=>"bfontfamlbl",
		-width=>70,
		-height=>20,
		-text=>"Body Font",
		-top=>242,
		-left=>10,
		-tabstop=>0,
		);
		$Win1->bfontfamlbl->Show();
		
# link font face label
$lfontfamlbl=$Win1->AddLabel(
		-name=>"lfontfamlbl",
		-width=>70,
		-height=>20,
		-text=>"LINK Font",
		-top=>267,
		-left=>10,
		-tabstop=>0,
		);
		$Win1->lfontfamlbl->Show();

# vlink font face label
$vfontfamlbl=$Win1->AddLabel(
		-name=>"vfontfamlbl",
		-width=>70,
		-height=>20,
		-text=>"VLINK Font",
		-top=>292,
		-left=>10,
		-tabstop=>0,
		);
		$Win1->vfontfamlbl->Show();
		
#alink font face label
$afontfamlbl=$Win1->AddLabel(
		-name=>"afontfamlbl",
		-width=>70,
		-height=>20,
		-text=>"ALINK Font",
		-top=>317,
		-left=>10,
		-tabstop=>0,
		);
		$Win1->afontfamlbl->Show();
		
#hlink font face label
$hfontfamlbl=$Win1->AddLabel(
		-name=>"hfontfamlbl",
		-width=>70,
		-height=>20,
		-text=>"HLINK Font",
		-top=>342,
		-left=>10,
		-tabstop=>0,
		);
		$Win1->hfontfamlbl->Show();
		
# td font face label
$tdfontfamlbl=$Win1->AddLabel(
		-name=>"tdfontfamlbl",
		-width=>70,
		-height=>20,
		-text=>"TD Font",
		-top=>367,
		-left=>10,
		-tabstop=>0,
		);
		$Win1->tdfontfamlbl->Show();
		
# create the font size text boxes 
# body font size text box
$bfsizetf=$Win1->AddTextfield(
	-name=>"bfsizetf",
	-width=>20,
	-height=>20,
	#-text=>
	-top=>242,
	-left=>300,
	-tabstop=>1,
	);
	
	
#link font size text box
$lfsizetf=$Win1->AddTextfield(
	-name=>"lfsizetf",
	-width=>20,
	-height=>20,
	#-text=>
	-top=>267,
	-left=>300,
	-tabstop=>1,
	);
	
		
# vlink font size text box
$vfsizetf=$Win1->AddTextfield(
	-name=>"vfsizetf",
	-width=>20,
	-height=>20,
	#-text=>
	-top=>292,
	-left=>300,
	-tabstop=>1,
	);
	
	
# alink font size text box
$afsizetf=$Win1->AddTextfield(
	-name=>"afsizetf",
	-width=>20,
	-height=>20,
	#-text=>
	-top=>317,
	-left=>300,
	-tabstop=>1,
	);
	
	
# hlink font size text box
$hfsizetf=$Win1->AddTextfield(
	-name=>"hfsizetf",
	-width=>20,
	-height=>20,
	#-text=>
	-top=>342,
	-left=>300,
	-tabstop=>1,
	);
	
	
# td font size text box
$tdfsizetf=$Win1->AddTextfield(
	-name=>"tdfsizetf",
	-width=>20,
	-height=>20,
	#-text=>
	-top=>367,
	-left=>300,
	-tabstop=>1,
	);
	
	
# font size label
$fsizeheaderlbl=$Win1->AddLabel(
		-name=>"fsizeheaderlbl",
		-width=>75,
		-height=>20,
		-text=>"FONT SIZE",
		-top=>220,
		-left=>280,
		-tabstop=>0,
		);
		$Win1->fsizeheaderlbl->Show();
		
# now create the text decoration textfields
# these are in a dropdown box that will list the different text decoration
# options, with a default of NONE.

$bftextdecdd=$Win1->AddCombobox(
	-name=>"bftextdecdd",
	-width=>100,
	-height=>100,
	-tabstop=>1,
	-top=>242,
	-left=>370,
	-style=> WS_VISIBLE | WS_SCROLL | 3 | WS_TABSTOP
	);
	
	  		 $bftextdecdd->InsertItem("none");
			 $bftextdecdd->InsertItem("blink");
			 $bftextdecdd->InsertItem("line-through");
			 $bftextdecdd->InsertItem("underline");
			 $bftextdecdd->InsertItem("overline");
			 $bftextdecdd->Select(0);
			 
			 
			 sub bftextdecdd_Change{
			 	 $bftextdecdd->Text($bftextdecdd->GetString($bftextdecdd->SelectedItem));
				 }
				 
			 
#link font decoration 
$lftextdecdd=$Win1->AddCombobox(
	-name=>"lftextdecdd",
	-width=>100,
	-height=>100,
	-tabstop=>1,
	-top=>267,
	-left=>370,
	-style=> WS_VISIBLE | WS_SCROLL | 3 | WS_TABSTOP
	);
	
	  		 $lftextdecdd->InsertItem("none");
			 $lftextdecdd->InsertItem("blink");
			 $lftextdecdd->InsertItem("line-through");
			 $lftextdecdd->InsertItem("underline");
			 $lftextdecdd->InsertItem("overline");
			 $lftextdecdd->Select(0);
			 
			 sub lftextdecdd_Change{
			 	 $lftextdecdd->Text($lftextdecdd->GetString($lftextdecdd->SelectedItem));
				 }
				 
				 
#vlink font decoration
$vftextdecdd=$Win1->AddCombobox(
	-name=>"vftextdecdd",
	-width=>100,
	-height=>100,
	-tabstop=>1,
	-top=>292,
	-left=>370,
	-style=> WS_VISIBLE | WS_SCROLL | 3 | WS_TABSTOP
	);
	
	  		 $vftextdecdd->InsertItem("none");
			 $vftextdecdd->InsertItem("blink");
			 $vftextdecdd->InsertItem("line-through");
			 $vftextdecdd->InsertItem("underline");
			 $vftextdecdd->InsertItem("overline");
			 $vftextdecdd->Select(0);
			 
			 sub vftextdecdd_Change{
			 	 $vftextdecdd->Text($vftextdecdd->GetString($vftextdecdd->SelectedItem));
				 }
				 

#alink text decoration
$aftextdecdd=$Win1->AddCombobox(
	-name=>"aftextdecdd",
	-width=>100,
	-height=>100,
	-tabstop=>1,
	-top=>317,
	-left=>370,
	-style=> WS_VISIBLE | WS_SCROLL | 3 | WS_TABSTOP
	);
	
	  		 $aftextdecdd->InsertItem("none");
			 $aftextdecdd->InsertItem("blink");
			 $aftextdecdd->InsertItem("line-through");
			 $aftextdecdd->InsertItem("underline");
			 $aftextdecdd->InsertItem("overline");
			 $aftextdecdd->Select(0);
			 
			 sub aftextdecdd_Change{
			 	 $aftextdecdd->Text($aftextdecdd->GetString($aftextdecdd->SelectedItem));
				 }
				 
				 
#hlink text decoration
$hftextdecdd=$Win1->AddCombobox(
	-name=>"hftextdecdd",
	-width=>100,
	-height=>100,
	-tabstop=>1,
	-top=>342,
	-left=>370,
	-style=> WS_VISIBLE | WS_SCROLL | 3 |WS_TABSTOP
	);
	
	  		 $hftextdecdd->InsertItem("none");
			 $hftextdecdd->InsertItem("blink");
			 $hftextdecdd->InsertItem("line-through");
			 $hftextdecdd->InsertItem("underline");
			 $hftextdecdd->InsertItem("overline");
			 $hftextdecdd->Select(0);
			 
			 sub hftextdecdd_Change{
			 	 $hftextdecdd->Text($hftextdecdd->GetString($hftextdecdd->SelectedItem));
				 }
				 
				 
#td text decoration
$tdftextdecdd=$Win1->AddCombobox(
	-name=>"tdftextdecdd",
	-width=>100,
	-height=>100,
	-tabstop=>1,
	-top=>367,
	-left=>370,
	-style=> WS_VISIBLE | WS_SCROLL | 3 | WS_TABSTOP
	);
	
	  		 $tdftextdecdd->InsertItem("none");
			 $tdftextdecdd->InsertItem("blink");
			 $tdftextdecdd->InsertItem("line-through");
			 $tdftextdecdd->InsertItem("underline");
			 $tdftextdecdd->InsertItem("overline");
			 $tdftextdecdd->Select(0);
			 			 
			 sub tdftextdecdd_Change{
			 	 $tdftextdecdd->Text($tdftextdecdd->GetString($tdftextdecdd->SelectedItem));
				 }
				 
				 
# text decoration header label
$textdecheaderlbl=$Win1->AddLabel(
		-name=>"textdecheaderlbl",
		-width=>120,
		-height=>20,
		-text=>"TEXT DECORATION",
		-top=>220,
		-left=>370,
		-tabstop=>0,
		);
		$Win1->textdecheaderlbl->Show();
		
# create margin settings text boxes

#top margin text box
$topmargintf=$Win1->AddTextfield(
	-name=>"topmargintf",
	-width=>20,
	-height=>20,
	#-text=>
	-top=>242,
	-left=>520,
	-tabstop=>1,
	);
	

#left margin text box
$leftmargintf=$Win1->AddTextfield(
	-name=>"leftmargintf",
	-width=>20,
	-height=>20,
	#-text=>
	-top=>267,
	-left=>520,
	-tabstop=>1,
	);
	
	
# margin width text box
$marginwidthtf=$Win1->AddTextfield(
	-name=>"marginwidthtf",
	-width=>20,
	-height=>20,
	#-text=>
	-top=>292,
	-left=>520,
	-tabstop=>1,
	);
	

# margin height text box
$marginheighttf=$Win1->AddTextfield(
	-name=>"marginheighttf",
	-width=>20,
	-height=>20,
	#-text=>
	-top=>317,
	-left=>520,
	-tabstop=>1,
	);
	
	
# margins header label
$marginheaderlbl=$Win1->AddLabel(
		-name=>"marginheaderlbl",
		-width=>75,
		-height=>20,
		-text=>"MARGINS",
		-top=>220,
		-left=>510,
		-tabstop=>0,
		);
		$Win1->marginheaderlbl->Show();
		
# margin top label
$margintoplbl=$Win1->AddLabel(
		-name=>"margintoplbl",
		-width=>50,
		-height=>20,
		-text=>"TOP",
		-top=>245,
		-left=>550,
		-tabstop=>0,
		);
		$Win1->margintoplbl->Show();
# margin left label		
$marginleftlbl=$Win1->AddLabel(
		-name=>"marginleftlbl",
		-width=>50,
		-height=>20,
		-text=>"LEFT",
		-top=>269,
		-left=>550,
		-tabstop=>0,
		);
		$Win1->marginleftlbl->Show();

# margin width label	
$marginwidthlbl=$Win1->AddLabel(
		-name=>"marginwidthlbl",
		-width=>50,
		-height=>20,
		-text=>"WIDTH",
		-top=>294,
		-left=>550,
		-tabstop=>0,
		);
		$Win1->marginwidthlbl->Show();
		
#margin height label
$marginheightlbl=$Win1->AddLabel(
		-name=>"marginheightlbl",
		-width=>50,
		-height=>20,
		-text=>"HEIGHT",
		-top=>320,
		-left=>550,
		-tabstop=>0,
		);
		$Win1->marginheightlbl->Show();
# here is where you name the css file for save....		
$filename=$Win1->AddTextfield(
	-name=>"filename",
	-width=>150,
	-height=>20,
	-text=>"YOURSTYLESHEET.css",
	-top=>425,
	-left=>100,
	-tabstop=>1,
	);

# this button will generate the file
$generatebutton=$Win1->AddButton(
		-name=>"generatebutton",	
		-width=>75,
		-height=>25,
		-top=>422,
		-left=>10,
		-text=>"Generate CSS",
		-tabstop=>1,
		);
		$Win1->generatebutton->Show();
		
# time to put our hard work to good use. This is the generation of the css file.		
		sub generatebutton_Click{
			$css=$filename->Text; # get the filename from user input
			$bgcolor=$bgcolortf->Text;
$bfontcolor=$bfcolortf->Text;
$lcolor=$lfontcolortf->Text;
$vlcolor=$vfontcolortf->Text;
$alcolor=$afontcolortf->Text;
$hcolor=$hcolortf->Text;
$tdcolor=$tdcolortf->Text;

if ($bfontdd->Text eq "custom --->"){
			 $fontfam=$bfcustom->Text;
			 }else{
			 $fontfam=$bfontdd->Text;
			 }

if ($lfontdd->Text eq "custom --->"){
			 $lfontfam=$lfcustom->Text;
			 }else{
			 $lfontfam=$lfontdd->Text;
			 }

if ($vfontdd->Text eq "custom --->"){
			 $vlfontfam=$vfcustom->Text;
			 }else{
			 $vlfontfam=$vfontdd->Text;
			 }

if ($afontdd->Text eq "custom --->"){
			 $alfontfam=$afcustom->Text;
			 }else{
			 $alfontfam=$afontdd->Text;
			 }

if ($hfontdd->Text eq "custom --->"){
			 $hfontfam=$hfcustom->Text;
			 }else{
			 $hfontfam=$hfontdd->Text;
			 }

 if ($tdfontdd->Text eq "custom --->"){
			 $tdfontfam=$tdfcustom->Text;
			 }else{
			 $tdfontfam=$tdfontdd->Text;
			 }

$fontsize=$bfsizetf->Text;
$lfontsize=$lfsizetf->Text;
$vlfontsize=$vfsizetf->Text;
$alfontsize=$afsizetf->Text;
$hfontsize=$hfsizetf->Text;
$tdfontsize=$tdfsizetf->Text;
$bfonttextdec=$bftextdecdd->GetString($bftextdecdd->SelectedItem);
$ltextdec=$lftextdecdd->GetString($lftextdecdd->SelectedItem);
$vltextdec=$vftextdecdd->GetString($vftextdecdd->SelectedItem);
$altextdec=$aftextdecdd->GetString($aftextdecdd->SelectedItem);
$htextdec=$hftextdecdd->GetString($hftextdecdd->SelectedItem);
$tdtextdec=$tdftextdecdd->GetString($tdftextdecdd->SelectedItem);
$topmargin=$topmargintf->Text;
$leftmargin=$leftmargintf->Text;
$marginwidth=$marginwidthtf->Text;
$marginheight=$marginheighttf->Text;
			
			open (OUT, ">$css") or die "Cannot open $css for write :$!";
# style tag
   print OUT "<!--Stylesheet generator- You can either copy and paste directly into \n";
   print OUT "your HTML code, or create a rel link to this css sheet in your meta tag--> \n";
   print OUT "<style type=\"text/css\"> \n";
   print OUT "\n";
# body properties
   print OUT "body { \n";
   print OUT "bgcolor: $bgcolor; \n";
   print OUT "font-size: $fontsize px; \n";
   print OUT "font-family: $fontfam; \n";
   print OUT "top-margin: $topmargin; \n";
   print OUT "left-margin: $leftmargin; \n";
   print OUT "margin-width: $marginwidth; \n";
   print OUT "margin-height: $marginheight; \n";
   print OUT "} \n";
   print OUT "\n";
# end body props
# begin link properties

   print OUT "a:link{ \n";
   print OUT "color: $lcolor; \n";
   print OUT "font-size: $lfontsize px; \n";
   print OUT "font-family: $lfontfam; \n";
   print OUT "text-decoration: $ltextdec; \n";
   print OUT "} \n";
   print OUT "\n";
   
# end link props
# begin alink properties

  print OUT "a:active{ \n";
  print OUT "color: $alcolor; \n";
  print OUT "font-size: $alfontsize px; \n";
  print OUT "font-family: $alfontfam; \n";
  print OUT "text-decoration: $altextdec; \n";
  print OUT "} \n";
  print OUT "\n";

# end alink props
# begin vlink properties

  print OUT "a:visited{ \n";
  print OUT "color: $vlcolor; \n";
  print OUT "font-size: $vlfontsize px; \n";
  print OUT "font-family: $vlfontfam; \n";
  print OUT "text-decoration: $vltextdec; \n";
  print OUT "} \n";
  print OUT "\n";
  
# end vlink props
# begin hover properties

  print OUT "a:hover{ \n";
  print OUT "color: $hcolor; \n";
  print OUT "font-size: $hfontsize px; \n";
  print OUT "font-family: $hfontfam; \n";
  print OUT "text-decoration: $htextdec; \n";
  print OUT "} \n";
  print OUT "\n";
  
# end hover props
# begin td properties

  print OUT "td{ \n";
  print OUT "color: $tdcolor; \n";
  print OUT "font-size: $tdfontsize px; \n";
  print OUT "font-family: $tdfontfam; \n";
  print OUT "text-decoration: $tdtextdec; \n";
  print OUT "} \n";
  print OUT "\n";
  
# end td props
# close style tag
  print OUT "</style> \n";
 
  


   close $css;
			
			system("notepad.exe $css");
			}
			
		
			
			


Win32::GUI::Dialog();

	sub Win1_Terminate{
	-1;
}
