? 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 }