
sub Border_Property_Win {

   $CWin->Disable();
   $DWin->Disable();

   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  => 200,
       -height => 200,
       -title  => "Border Properties",
       -name   => "Prop",
   );

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

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

   $Prop->AddCheckbox(
       -left   => 10,
       -top    => 40,
       -text   => ($text = "Use set Width and Height"),
       -width  => length($text) * 7,
       -name   => "SetWH_CB",
   );


      $Prop->AddLabel(
          -left => 10,
          -top  => 67,
          -text => "Width",
      );

      $Prop->AddTextfield(
          -left   => 55,
          -top    => 64,
          -width  => 30,
          -height => 20,
          -name   => "Width_TF",
      );

      $Prop->AddLabel(
          -left => 90,
          -top  => 67,
          -text => "Pixels",
      );

      $Prop->AddLabel(
          -left => 10,
          -top  => 86,
          -text => "Height",
      );

      $Prop->AddTextfield(
          -left   => 55,
          -top    => 84,
          -width  => 30,
          -height => 20,
          -name   => "Height_TF",
      );

      $Prop->AddLabel(
          -left => 90,
          -top  => 86,
          -text => "Pixels",
      );


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

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

   if ($Prop->SetWH_CB->Checked()) {
      $Prop->Width_TF->Enable();
      $Prop->Height_TF->Enable();
   }
   else {
      $Prop->Width_TF->Disable();
      $Prop->Height_TF->Disable();
   }

   $Prop->Width_TF->Text("$Width_TF");
   $Prop->Height_TF->Text("$Height_TF");

   $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 SetWH_CB_Click {
      if ($Prop->SetWH_CB->Checked()) {
         $Prop->Width_TF->Enable();
         $Prop->Height_TF->Enable();
      }
      else {
         $Prop->Width_TF->Disable();
         $Prop->Height_TF->Disable();
      }
   }

   sub BordP_OK_Click {
      &Prop_Win_Done;

      if ($Prop->SetWH_CB->Checked()) {
         $Width_TF = $Prop->Width_TF->Text;
         $Height_TF = $Prop->Height_TF->Text;
      }
      else {
         $Width_TF = $Height_TF = undef;
      }

      &New_Border($Prop->Text_TF->Text,$Width_TF,$Heigh_TF);
   }
       
   sub BordP_Cancel_Click {
      &Prop_Win_Done;
      &New_Border(undef);
   }
}

1;
