Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Пользовательский интерфейс на Perl
Архитектура  «Globus Professional» Client App Server DB
Вход в  «Globus Professional»
Клиентское приложение
Класс приложения use Wx; # every program must have a Wx::App-derive class package MyApp; use strict; use warnings; our  @I...
Класс окна (1) package MyFrame; use strict; use warnings; our  @ISA=qw(Wx::Frame); use Wx::Event qw(EVT_MENU); use Wx qw(w...
Класс окна (2) my $mbar = Wx::MenuBar->new(); $mbar->Append( $mfile, "&File" ); $mbar->Append( $mhelp, "&He...
Обработчики # this is an addition to demonstrate virtual callbacks... # it ignores all parameters and creates a status bar...
Запуск приложения package main; # create an instance of the Wx::App-derived class my $app = MyApp->new(); # start processi...
Конструктор АРМ
АРМ регистратора заявок пользователей
Инструмент отладки перлового кода  ( KIT )
Регистрация  ActiveX- компонент perl -Mblib -MWx::ActiveX::Template -e"run_wxactivex_template();" Регистрация  A...
Работа с компонентом use Win32::OLE; use Win32::OLE::Const;  use Win32::OLE::Variant; use Wx::ActiveX::RolledCalendar; … $...
Common Language Runtime (CLR) use Win32::CLR; Win32::CLR->load_from( $path ); $ fineReaderWrapper  = Win32::CLR->create_in...
Ссылки 1.  презентация www.umnix.com/upload/perlGUI.ppt 2.  сайт компании www.eis.ru 3. www.wxwidgets.org 4. wxperl.source...
Upcoming SlideShare
Loading in …5
×

Perl gui

818 views

Published on

Using Perl for GUI in corporate software

Published in: Technology
  • Be the first to comment

Perl gui

  1. 1. Пользовательский интерфейс на Perl
  2. 2. Архитектура «Globus Professional» Client App Server DB
  3. 3. Вход в «Globus Professional»
  4. 4. Клиентское приложение
  5. 5. Класс приложения use Wx; # every program must have a Wx::App-derive class package MyApp; use strict; use warnings; our @ISA=qw(Wx::App); # this is called automatically on object creation sub OnInit { my( $this ) = @_; # create new MyFrame my $frame = MyFrame->new( "Minimal wxPerl app", [ 50, 50 ] , #position [ 450, 350 ] #size ); # set it as top window (so the app will automatically close when # the last top window is closed) $this->SetTopWindow( $frame ); # show the frame $frame->Show( 1 ); 1; }
  6. 6. Класс окна (1) package MyFrame; use strict; use warnings; our @ISA=qw(Wx::Frame); use Wx::Event qw(EVT_MENU); use Wx qw(wxBITMAP_TYPE_ICO wxMENU_TEAROFF); # Parameters: title, position, size sub new { my $class = shift; my $ self = $class->SUPER::new( undef, -1, $_[0], $_[1], $_[2] ); # load an icon and set it as frame icon $ self ->SetIcon( Wx::GetWxPerlIcon() ); # create the menus my $mfile = Wx::Menu->new( undef, wxMENU_TEAROFF ); my $mhelp = Wx::Menu->new(); my( $ID_ABOUT, $ID_EXIT ) = ( 1, 2 ); $mhelp->Append( $ID_ABOUT, "&About...tCtrl-A", "Show about dialog" ); $mfile->Append( $ID_EXIT, "E&xittAlt-X", "Quit this program" );
  7. 7. Класс окна (2) my $mbar = Wx::MenuBar->new(); $mbar->Append( $mfile, "&File" ); $mbar->Append( $mhelp, "&Help" ); $ self ->SetMenuBar( $mbar ); # declare that events coming from menu items with the given # id will be handled by these routines EVT_MENU( $ self , $ID_EXIT, &OnQuit ); EVT_MENU( $ self , $ID_ABOUT, &OnAbout ); # create a status bar (note that the status bar that gets created # has three panes, see the OnCreateStatusBar callback below $ self ->CreateStatusBar( 1 ); # and show a message $ self ->SetStatusText( "Welcome to wxPerl!", 1 ); $ self ; }
  8. 8. Обработчики # this is an addition to demonstrate virtual callbacks... # it ignores all parameters and creates a status bar with three fields sub OnCreateStatusBar { my $ self = shift; my $status = Wx::StatusBar->new( $ self , -1 ); $status->SetFieldsCount( 2 ); $status; } # called when the user selects the 'Exit' menu item sub OnQuit { my( $ self , $event ) = @_; # closes the frame $ self ->Close( 1 ); } use Wx qw(wxOK wxICON_INFORMATION wxVERSION_STRING); # called when the user selects the 'About' menu item sub OnAbout { my( $ self , $event ) = @_; # display a simple about box Wx::MessageBox( "This is the about dialog of minimal sample.n" . "Welcome to wxPerl " . $Wx::VERSION . "n" . wxVERSION_STRING, "About minimal", wxOK | wxICON_INFORMATION, $ self ); }
  9. 9. Запуск приложения package main; # create an instance of the Wx::App-derived class my $app = MyApp->new(); # start processing events $app->MainLoop();
  10. 10. Конструктор АРМ
  11. 11. АРМ регистратора заявок пользователей
  12. 12. Инструмент отладки перлового кода ( KIT )
  13. 13. Регистрация ActiveX- компонент perl -Mblib -MWx::ActiveX::Template -e"run_wxactivex_template();" Регистрация ActiveX- компонент
  14. 14. Работа с компонентом use Win32::OLE; use Win32::OLE::Const; use Win32::OLE::Variant; use Wx::ActiveX::RolledCalendar; … $dlg->{'_ X calendar'} = Wx::ActiveX::RolledCalendar->new( $dlg ); $main_sizer->Add( $dlg->{'_Xcalendar'}, 1, &Wx::wxGROW|&Wx::wxALL, 0 ); $dlg ->{'_calendar'} = $dlg->{'_Xcalendar'}->GetOLE(); $dlg->{' _calendar '}->SetDate( $date ); … $date = $dlg->{'_ c alendar'}->GetDate(); … . $dlg->{'_Xcalendar'}->Destroy();
  15. 15. Common Language Runtime (CLR) use Win32::CLR; Win32::CLR->load_from( $path ); $ fineReaderWrapper = Win32::CLR->create_instance( "EISFREWrapper.Wrapper" ); $ fineReaderWrapper->setOutputFormat( $format );
  16. 16. Ссылки 1. презентация www.umnix.com/upload/perlGUI.ppt 2. сайт компании www.eis.ru 3. www.wxwidgets.org 4. wxperl.sourceforge.net 5. cpan.org 6. email [email_address] [email_address]

×