Presentation is loading. Please wait.

Presentation is loading. Please wait.

Пользовательский интерфейс на Perl. Архитектура «Globus Professional» ClientApp Server DB.

Similar presentations


Presentation on theme: "Пользовательский интерфейс на Perl. Архитектура «Globus Professional» ClientApp Server DB."— Presentation transcript:

1 Пользовательский интерфейс на Perl

2 Архитектура «Globus Professional» ClientApp Server DB

3 Вход в «Globus Professional»

4 Клиентское приложение

5 Класс приложения use Wx; # every program must have a Wx::App-derive class package MyApp; use strict; use warnings; # 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 Класс окна (1) package MyFrame; use strict; use warnings; 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&xit\tAlt-X", "Quit this program" );

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 Обработчики # 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 Запуск приложения package main; # create an instance of the Wx::App-derived class my $app = MyApp->new(); # start processing events $app->MainLoop();

10 Конструктор АРМ

11 АРМ регистратора заявок пользователей

12 Инструмент отладки перлового кода ( KIT )

13 Регистрация ActiveX-компонент perl -Mblib -MWx::ActiveX::Template -e"run_wxactivex_template();" Регистрация ActiveX-компонент

14 Работа с компонентом use Win32::OLE; use Win32::OLE::Const; use Win32::OLE::Variant; use Wx::ActiveX::RolledCalendar; … $dlg->{'_Xcalendar'} = 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->{'_calendar'}->GetDate(); …. $dlg->{'_Xcalendar'}->Destroy();

15 Common Language Runtime (CLR) use Win32::CLR; Win32::CLR->load_from( $path ); $fineReaderWrapper = Win32::CLR->create_instance( "EISFREWrapper.Wrapper" ); $fineReaderWrapper->setOutputFormat( $format );

16 Ссылки 1. презентация 2. сайт компании wxperl.sourceforge.net 5. cpan.org 6.


Download ppt "Пользовательский интерфейс на Perl. Архитектура «Globus Professional» ClientApp Server DB."

Similar presentations


Ads by Google