
sub Label_Property_Win {
   
   $CWin->Disable();
   $DWin->Disable();

   $parms{bgcolor} = 12632256;  # Gray
   $parms{fgcolor} = 0;         # Black

   local ($w_left,$w_top) = $CWin->GetWindowRect();
  
   $Prop = new Win32::GUI::DialogBox(
       -left   => $w_left + $PROP_WIN_X_OFFSET,
       -top    => $w_top + $PROP_WIN_Y_OFFSET,
       -width  => 300,
       -height => 200,
       -title  => "Label Properties",
       -name   => "Prop",
   );

   $Prop->AddLabel(
       -left => 10,
       -top  => 10,
       -text => "Text:",
   );

   $Prop->AddTextfield(
       -left   => 50,
       -top    => 8,
       -width  => 200,
       -height => 20,
       -name   => "OBJText",
   );

   $Prop->AddButton(
       -text     => "FG Color",
       -left     => 170,
       -top      => 30,
       -width    => 60,
       -name     => "FGColor",
   );

   $Prop->AddButton(
       -text     => "BG Color",
       -left     => 170,
       -top      => 55,
       -width    => 60,
       -name     => "BGColor",
   );

   $Prop->AddButton(
       -text     => "Font",
       -left     => 170,
       -top      => 80,
       -width    => 60,
       -name     => "Font",
   );

   $samp = $Prop->AddLabel(
       -text       => "Sample",
       -left       => 100,
       -top        => 57,
       -background => $parms{bgcolor},
       -foreground => $parms{fgcolor},
       -name       => "Sample",
   );

   $Prop->AddButton(
       -left     => $Prop->Width / 2 - 65,
       -top      => $Prop->Height - 60,
       -width    => 60,
       -text     => "OK",
       -name     => "LP_OK",
       -default  => 1,
       -ok       => 1,
       -tabstop  => 1,
   );

   $Prop->AddButton(
       -left     => $Prop->Width / 2 + 5,
       -top      => $Prop->Height() - 60,
       -width    => 60,
       -text     => "Cancel",
       -name     => "LP_Cancel",
       -cancel   => 1,
       -tabstop  => 1,
   );

   $Prop->Show();

   sub Prop_Terminate {
      &Prop_Win_Done;
   } 

   sub Prop_Win_Done {
     $Prop->Hide();
     $CWin->Enable();
     $CWin->SetForegroundWindow();
     $DWin->Enable();
     $DWin->SetForegroundWindow();
     $DWin->SetFocus();
   }

   sub LP_OK_Click {
      &Prop_Win_Done;
      $parms{text} = $Prop->OBJText->Text;
      &New_Label(%parms);
   }
       
   sub LP_Cancel_Click {
      &Prop_Win_Done;
      &New_Label(undef);
   }

   sub FGColor_Click {
      $parms{fgcolor} = $Prop->ChooseColor();
      $Prop->Sample->Change(-foreground => $parms{fgcolor});
      $Prop->Sample->Text($Prop->Sample->Text); # Updates color of text ???
   }

   sub BGColor_Click {
      $parms{bgcolor} = $Prop->ChooseColor();
      $Prop->Sample->Change(-background => $parms{bgcolor});
      $Prop->Sample->Text($Prop->Sample->Text);  # Updates color of text ???
   }

   sub Font_Click {
      (%font_stuff) = $Prop->ChooseFont();
   }

#   sub OBJText_Change {
#      print "You type:", $Prop->OBJText->Text,"\n";
#   }
}

1;

