"Fossies" - the Fresh Open Source Software Archive

Member "namefix.pl/libs/gui/undo.pm" (13 Dec 2008, 1729 Bytes) of package /linux/privat/old/namefix.pl_4.0.2.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Perl source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "undo.pm" see the Fossies "Dox" file reference documentation.

    1 
    2 sub undo_gui
    3 {
    4     &plog(3, "sub undo_gui:");
    5     my $title = "Undo GUI";
    6     my @a = @main::undo_cur;
    7     my @b = @main::undo_pre;
    8     my $row = 0;
    9     my $col = 0;
   10     my $c = 0;
   11     
   12     # -----------------------
   13     # start drawing gui
   14     
   15         my $top = $main::mw -> Toplevel();
   16         $top -> title("$title");
   17 
   18     # hlist here
   19     
   20         my $hlist = $top -> Scrolled
   21         (
   22         "HList",
   23         -scrollbars=>"osoe",
   24         -header => 1,
   25         -columns=>3,
   26         -selectbackground => 'Cyan',
   27         -width=>80,
   28         
   29     )
   30         -> grid
   31     (
   32             -row => $row++,
   33             -column => 1,
   34             -columnspan => 2
   35         );
   36 
   37         $top -> Button
   38     (
   39             -text=>"Preform Undo",
   40             -activebackground => "white",
   41             -command => sub 
   42         {
   43                 &undo_rename;
   44                 destroy $top;
   45                 &ls_dir;
   46             }
   47         )
   48         -> grid
   49     (
   50             -row => $row,
   51             -column => 1,
   52             -columnspan => 1
   53         );
   54 
   55         $top -> Button
   56     (
   57             -text=>"Close",
   58             -activebackground => "white",
   59             -command => sub 
   60         {
   61                 destroy $top;
   62             }
   63         )
   64         -> grid
   65     (
   66             -row => $row++,
   67             -column => 2,
   68             -columnspan => 1
   69         );
   70 
   71 #   $top->resizable(0,0);
   72 
   73     # --------------------------------
   74     # Gui drawn, add contents
   75     
   76     $hlist->header('create', 0, -text =>'Current Filename');
   77     $hlist->header('create', 1, -text =>'->');
   78     $hlist->header('create', 2, -text =>'Previous Filename');
   79 
   80 
   81     $c = 0;
   82     for(@a)
   83     {
   84         $hlist->add
   85         (
   86             $c
   87         );
   88         $hlist->itemCreate($c, 0, -text => "$_");
   89         $hlist->itemCreate($c, 1, -text => " -> ");
   90         $hlist->itemCreate($c, 2, -text => "$b[$c]");
   91         $c++;
   92     }
   93     return 1;
   94 }
   95 
   96 
   97 
   98 1;