Perl GUI (未完待续)

Perl GUI (未完待续),第1张

概述  use Win32::GUI;   use Win32::GUI qw(CW_USEDEFAULT);   use Win32::GUI::DIBitmap;   use Win32::GUI::DropFiles;   my $size = 20;     $W = new Win32::GUI::Window (               -title    => "lis文件分析",

  use Win32::GUI;
  use Win32::GUI qw(CW_USEDEFAulT);
  use Win32::GUI::DIBitmap;
  use Win32::GUI::Dropfiles;
  my $size = 20;
 
  $W = new Win32::GUI::Window (
              -Title    => "lis文件分析",
              -pos      => [100,100],
              -size     => [400,400],
              -name     => "Window",
              );

$W->AddTextfIEld(
    -name => 'inputsize',
    -text => 25,
    -prompt => [ "RAM/ROM值(k):",80],
    -pos => [10,10],
    -size => [40,20],
    -align => 'right',
    -number => 1,
);

#得到当前选的那个选项
print $W->inputsize->Getline(0),"\n";
 
$W->AddLabel(
    -name => 'chooselabel',
    -left => 10,
    -top  => $W->inputsize->top()+33,
    -text => "选择类型:"
);
 
$W->AddComboBox(
    -name => 'tpyechoose',
    -dropdownList => 1,
    -left => $W->chooselabel->left()+ $W->chooselabel->WIDth()+5,
    -top  => $W->inputsize->top()+30,
    -wIDth => 60,
    -height => 100,
);
$W->tpyechoose->Add('ROM','RAM');
$W->tpyechoose->Select(0);  
  
#得到当前选的那个选项
#print $W->tpyechoose->GetCurSel(),"\n";
    
    
# Add a load button.
$W->Addbutton (
    -name    => "Load",
    -left => $W->chooselabel->left(),
    -top  => $W->chooselabel->top() + $W->chooselabel->Height +30,
    -text    => "&Load...",
    -default => 1,
    -tabstop => 1,
    -group   => 1,                        # You can use :
    #-onClick => \&Loadlisfile,            #  a reference sub
    -onClick  => 'Loadlisfile',           #  a string name sub
);  

sub Loadlisfile {
  # Use Getopenfile for search a avi file
  my $file = Win32::GUI::Getopenfilename(
                   -owner  => $Window,                    # Main window for modal dialog
                   -Title  => "Open a lis file",          # Dialog Title
                   -filter => [                           # Filter file
                       'lis file (*.lis)' => '*.lis',
                       'All files' => '*.*',
                    ],
                   -directory => ".",                     # Use current directory
                   );
a
  # Have select a file ?
  if ($file) {
     # Load file to animation control   do what u want

      &Listfile($file);
  }
  # Or an error messageBox with error.
  elsif (Win32::GUI::CommDlgExtendedError()) {
     Win32::GUI::MessageBox (0,"ERROR : ".Win32::GUI::CommDlgExtendedError(),
                            "Getopenfilename Error");
  }
}
  

sub Listfile{
 my $file = @_[0];
 
 my $value = $W->inputsize->Getline(0)*1024;
 my $type  = $W->tpyechoose->GetCurSel();

  #省去

}      $W->Show();   Win32::GUI::Dialog();   sub Window_Terminate { -1 }

总结

以上是内存溢出为你收集整理的Perl GUI (未完待续)全部内容,希望文章能够帮你解决Perl GUI (未完待续)所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://www.outofmemory.cn/langs/1293055.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-10
下一篇 2022-06-10

发表评论

登录后才能评论

评论列表(0条)

保存