view release on metacpan or search on metacpan
lib/CPANPLUS/Shell/Wx/Frame.pm view on Meta::CPAN
$panel->SetModuleTree(Wx::Window::FindWindowByName('tree_modules'));
# print "Setting Image list...\n";
$panel->SetCPP($self->{cpan});
$panel->SetImageList($self->{status_icons});
$panel->SetStatusBar(Wx::Window::FindWindowByName('main_window_status'));
$panel->SetPODReader($self->{podReader});
print "Initializing ModulePanel...\n";
$panel->Init();
$panel->SetDblClickHandler(sub{$self->ShowPODReader(@_)});
$panel->SetInstallMenuHandler(sub{$self->SetAction(@_,_T('Install'))});
$panel->SetUpdateMenuHandler(sub{$self->SetAction(@_,_T('Update'))});
$panel->SetUninstallMenuHandler(sub{$self->SetAction(@_,_T('Uninstall'))});
$panel->SetFetchMenuHandler(sub{$self->SetAction(@_,_T('Fetch'))});
$panel->SetPrepareMenuHandler(sub{$self->SetAction(@_,_T('Prepare'))});
$panel->SetBuildMenuHandler(sub{$self->SetAction(@_,_T('Build'))});
$panel->SetTestMenuHandler(sub{$self->SetAction(@_,_T('Test'))});
}
#this method shows the PODReader tab and displays the documentation for the selected module
sub ShowPODReader{
my $self = shift;
my ($event) = @_;
print "Showing POD Reader\n";
# $self->{podReader}=CPANPLUS::Shell::Wx::PODReader::Frame->new($self) unless $self->{podReader};
# $self->{podReader}->Show(1) if ($self->{podReader} && $self->{podReader}->isa('Wx::Frame'));
$self->{podReader}->Search($self->{panel}->{thisName});
lib/CPANPLUS/Shell/Wx/ModulePanel.pm view on Meta::CPAN
#print Dumper $self->{mod_tree};
#for testing purposes, insert test values
my @testMods=qw/Alter CPAN Cache::BerkeleyDB CPANPLUS Module::NoExist Muck Acme::Time::Baby Wx/;
foreach $item (sort(@testMods)){
$self->{mod_tree}->AppendItem($self->{mod_tree}->GetRootItem(),$item,$self->{mod_tree}->_get_status_icon($item));
}
$self->_setup_search();
$self->_setup_info_tabs();
#my $cMenu=$self->{mod_tree}->GetContextMenu();
# $self->{mod_tree}->SetCPP(\&HandleContextInfo);
$self->{mod_tree}->SetInfoHandler(\&HandleContextInfo);
$self->{mod_tree}->SetClickHandler( sub{$self->HandleTreeClick(@_)});
#$self->{mod_tree}->SetDblClickHandler( sub{$self->ShowPODReader(@_)});
_uShowErr;
}
#set up the search bar.
sub _setup_search{
$self=shift;
lib/CPANPLUS/Shell/Wx/ModuleTree.pm view on Meta::CPAN
_T("Documentation"), _T("Pragma"),
_T("Perl6")];
#add the root item.It is hidden.
$self->AddRoot(_T('Modules'));
#create links to events
# EVT_WINDOW_CREATE( $self, $self, \&OnCreate ); #when the tree is created
EVT_TREE_SEL_CHANGED( $self, $self, \&OnSelChanged); #when a user changes the selection
EVT_TREE_ITEM_ACTIVATED($self, $self, \&OnDblClick); #When the user double-clicks an item
EVT_TREE_ITEM_RIGHT_CLICK( $self, $self, \&ShowPopupMenu );#when the user wants a pop-up menu
$self->SetWindowStyleFlag($self->GetWindowStyleFlag()|wxVSCROLL);
return $self;
}
#this is called when the control is created.
#sub OnCreate {
sub Init {
my $self = shift;
my ($event)=@_;
lib/CPANPLUS/Shell/Wx/ModuleTree.pm view on Meta::CPAN
sub ShowUpdated{shift->_switch_show(UPDATES)}
sub ShowNew{shift->_switch_show(NEW)}
sub ShowAll{shift->_switch_show(ALL)}
sub SortByAuthor{shift->_switch_sort(AUTHOR)}
sub SortByName{shift->_switch_sort(NAME)}
sub SortByCategory{shift->_switch_sort(CATEGORY)}
#the following methods are for setting the event handlers for the various
# menu items in the context menu. They all take one parameter:a code ref
#The code ref is then executed with three parameters:
# the menu [Wx::Menu], the event [Wx::CommandEvent], and the name of the selected module
sub SetInfoHandler{$_[0]->{_minfoHandler}=$_[1];}
sub SetInstallMenuHandler{print "Install: ",@_;$_[0]->{_minstallHandler}=$_[1];}
sub SetUpdateMenuHandler{$_[0]->{_mupdateHandler}=$_[1];}
sub SetUninstallMenuHandler{$_[0]->{_muninstallHandler}=$_[1];}
sub SetFetchMenuHandler{$_[0]->{_mfetchHandler}=$_[1];}
sub SetPrepareMenuHandler{$_[0]->{_mprepareHandler}=$_[1];}
sub SetBuildMenuHandler{$_[0]->{_mbuildHandler}=$_[1];}
sub SetTestMenuHandler{$_[0]->{_mtestHandler}=$_[1];}
sub SetExtractMenuHandler{$_[0]->{_mextractHandler}=$_[1];}
sub SetClickHandler{$_[0]->{_clickHandler}=$_[1];}
sub SetDblClickHandler{print "DblClick:",@_,"\n";$_[0]->{_dblClickHandler}=$_[1];}
sub SetStatusBar{$_[0]->{statusBar}=$_[1];}
sub SetMenu{$_[0]->{menu}=$_[1];}
sub GetName{return $_[0]->{thisName}}
sub GetMod{return $_[0]->{thisMod}}
sub SetCPP{$_[0]->{cpan}=$_[1];$_[0]->{config}=$_[1]->configure_object();}
#this is called when the user right-clicks on an item in the tree
sub ShowPopupMenu{
my $self = shift;
my ($event)=@_;
#we can't do any actions on unknown modules
return if $self->GetItemImage($event->GetItem()) == 4;
#create the menu
$menu = CPANPLUS::Shell::Wx::ModuleTree::Menu->new($self,$event->GetItem());
#show the menu
$self->PopupMenu($menu,$event->GetPoint());
}
#this is called when the user double-clicks on an item in the tree
sub OnDblClick{
my $self = shift;
my ($event)=@_;
#we can't do any actions on unknown modules
my $img=$self->GetItemImage($event->GetItem());
print "Double Click!:".$self->{_dblClickHandler}." img = $img\n";
lib/CPANPLUS/Shell/Wx/ModuleTree.pm view on Meta::CPAN
_uShowErr;
}
sub SetImageList{ #must be a Wx::ImageList
my ($self,$list)=@_;
$self->{iconList}=$list;
$self->AssignImageList($list->imageList);
}
########################################
########### Context Menu ##############
########################################
package CPANPLUS::Shell::Wx::ModuleTree::Menu;
use base 'Wx::Menu';
use Wx::Event qw/EVT_WINDOW_CREATE EVT_MENU/;
use Data::Dumper;
use Wx::Locale gettext => '_T';
sub new {
my $class = shift;
my $parent=shift;
my $item=shift;
my $self = $class->SUPER::new(); # create an 'empty' menu object
#get image so we can determine what the status is
$img=$parent->GetItemImage($item);
$actions=new Wx::Menu();
$install=$actions->Append(1000,_T("Install")) if $img == 3;
$update=$actions->Append(1001,_T("Update")) if $img == 1;
$uninstall=$actions->Append(1002,_T("Uninstall")) if ($img==0 or $img==1);
$actions->AppendSeparator();
$fetch=$actions->Append(1003,_T("Fetch"));
$extract=$actions->Append(1004,_T("Extract"));
$prepare=$actions->Append(1005,_T("Prepare"));
$build=$actions->Append(1006,_T("Build"));
$test=$actions->Append(1007,_T("Test"));
$self->AppendSubMenu($actions,_T("Actions"));
$info=$self->Append(1008,_T("Get All Information"));
my $modName=$parent->GetItemText($item);
EVT_MENU( $self, $info, sub{&{$parent->{_minfoHandler}}(@_,$modName)} ) if $parent->{_minfoHandler};
EVT_MENU( $actions, $install, sub{&{$parent->{_minstallHandler}}(@_,$modName)} ) if ($img == 3 && $parent->{_minstallHandler});
EVT_MENU( $actions, $update, sub{&{$parent->{_mupdateHandler}}(@_,$modName)} ) if ($img == 1 && $parent->{_mupdateHandler});
EVT_MENU( $actions, $uninstall, sub{&{$parent->{_muninstallHandler}}(@_,$modName)} )if (($img==0 or $img==1) && $parent->{_muninstallHandler});
EVT_MENU( $actions, $fetch, sub{&{$parent->{_mfetchHandler}}(@_,$modName)} ) if $parent->{_mfetchHandler};
lib/CPANPLUS/Shell/Wx/help/contents.hhc view on Meta::CPAN
<meta name="GENERATOR" content="Microsoft® HTML Help Workshop 4.1">
<!-- Sitemap 1.0 -->
</HEAD><BODY>
<UL>
<LI> <OBJECT type="text/sitemap">
<param name="Name" value="Main Window">
<param name="Local" value="index.html">
</OBJECT>
<UL>
<LI> <OBJECT type="text/sitemap">
<param name="Name" value="Menu Bar">
<param name="Local" value="menubar.html">
</OBJECT>
<UL>
<LI> <OBJECT type="text/sitemap">
<param name="Name" value="File menu">
<param name="Local" value="menu_file.html">
</OBJECT>
<LI> <OBJECT type="text/sitemap">
<param name="Name" value="Edit Menu">
<param name="Local" value="menu_edit.html">
</OBJECT>
<LI> <OBJECT type="text/sitemap">
<param name="Name" value="Help menu">
<param name="Local" value="menu_help.html">
</OBJECT>
</UL>
<LI> <OBJECT type="text/sitemap">
<param name="Name" value="Tool Bar">
<param name="Local" value="toolbar.html">
lib/CPANPLUS/Shell/Wx/help/index.html view on Meta::CPAN
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>wxCPAN Help</title>
</head>
<body>
<h1>wxCPAN Help</h1>
<h2>Contents</h2>
<h3><a href="menubar.html">Menus</a></h3>
<img src="images/menubar.png"/>
<ul>
<li><a href="menu_file.html">File</a></li>
<li><a href="menu_edit.html">Edit</a></li>
<li><a href="menu_help.html">Help</a></li>
</ul>
<h3><a href="toolbar.html">Toolbar</a></h3>
<img src="images/toolbar.png"/>
lib/CPANPLUS/Shell/Wx/help/menu_edit.html view on Meta::CPAN
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>wxCPAN :: Menu Bar :: Edit</title>
</head>
<body>
<h1>wxCPAN Edit Menu</h1>
<img src="images/edit_menu.png"/>
<p>The edit menu has only one entry, "Preferences...", which displays the
Preferences dialog. See the <a href="preferences.html">Preferences</a>
section for more information.All other common Edit menu features can
be accessed via right-clicking inside an editable field or by the
common keyboard shortcuts:</p>
<ul>
<li>Ctrl+c : Copy</li>
<li>Ctrl+x : Cut</li>
<li>Ctrl+v : Paste</li>
lib/CPANPLUS/Shell/Wx/help/menu_file.html view on Meta::CPAN
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>wxCPAN :: Menu Bar :: File Menu</title>
</head>
<body>
<h1>wxCPAN File Menu</h1>
<img src="images/file_menu.png"/>
<p>The File menu has three items:</p>
<ul>
<li><a href="#open">Open Actions...</a></li>
<li><a href="#save">Save Actions...</a></li>
<li><a href="#quit">Quit</a></li>
</ul>
<h2 id="open">Open Actions...</h2>
<p>This menu item opens a previously saved batch-process file, which contains
lib/CPANPLUS/Shell/Wx/help/menu_help.html view on Meta::CPAN
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>wxCPAN :: Menu Bar :: Help Menu</title>
</head>
<body>
<h1>wxCPAN Help Menu</h1>
<img src="images/file_menu.png"/>
<p>The File menu has four items:</p>
<ul>
<li><a href="#dump">Dump Config to Console</a></li>
<li><a href="#show">Show POD Reader</a></li>
<li><a href="#help">Help</a></li>
<li><a href="#about">About</a></li>
</ul>
<h2 id="dump">Dump Config to Console</h2>
lib/CPANPLUS/Shell/Wx/help/menubar.html view on Meta::CPAN
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>wxCPAN :: Menu Bar</title>
</head>
<body>
<h1>wxCPAN Menu Bar</h1>
<p>The menubar has the following layout:</p>
<ul>
<li><a href="menu_file.html">File</a>
<ul>
<li><a href="menu_file.html#open">Open Actions...</a></li>
<li><a href="menu_file.html#save">Save Actions...</a></li>
<li><a href="menu_file.html#quit">Quit</a></li>
</ul>
</li>
<li><a href="menu_edit.html">Edit</a>
lib/CPANPLUS/Shell/Wx/help/searchbar.html view on Meta::CPAN
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>wxCPAN :: Menu Bar</title>
<style type="text/css">
p{
text-indent:5em;
}
</style>
</head>
<body>
<h1>wxCPAN Menu Bar</h1>
<p>The menubar has three menus:</p>
</body>
</html>
lib/CPANPLUS/Shell/Wx/help/searching.html view on Meta::CPAN
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>wxCPAN :: Menu Bar</title>
<style type="text/css">
p{
text-indent:5em;
}
</style>
</head>
<body>
<h1>wxCPAN Menu Bar</h1>
<p>The menubar has three menus:</p>
</body>
</html>
lib/CPANPLUS/Shell/Wx/help/toolbar.html view on Meta::CPAN
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>wxCPAN :: Menu Bar</title>
<style type="text/css">
p{
text-indent:5em;
}
</style>
</head>
<body>
<h1>wxCPAN Menu Bar</h1>
<p>The menubar has three menus:</p>
</body>
</html>
lib/CPANPLUS/Shell/Wx/res/MainWin.wxg view on Meta::CPAN
<!-- generated by wxGlade 0.6.1 on Thu Aug 7 10:38:11 2008 -->
<application path="/mnt/development/wxCPANPLUS/CPANPLUS-Shell-Wx/lib/CPANPLUS/Shell/Wx/res/MainWin.xrc" name="" class="" option="0" language="XRC" top_window="main_window" encoding="UTF-8" use_gettext="1" overwrite="1" use_new_namespace="1" for_versi...
<object class="CPANPLUS::Shell::Wx::Frame" name="main_window" base="EditFrame">
<style>wxDEFAULT_FRAME_STYLE</style>
<title>wxCPAN</title>
<menubar>1</menubar>
<statusbar>1</statusbar>
<toolbar>1</toolbar>
<size>672, 600</size>
<object class="wxMenuBar" name="main_window_menubar" base="EditMenuBar">
<menus>
<menu name="mnu_file" itemid="mnu_File" label="&File">
<item>
<label>&Open Actions... Ctrl+O</label>
<id>mnu_file_open</id>
<name>mnu_file_open</name>
<help_str>Open Actions</help_str>
</item>
<item>
<label>&Save Actions... Ctrl+S</label>
lib/CPANPLUS/Shell/Wx/res/MainWin.wxg~ view on Meta::CPAN
<!-- generated by wxGlade 0.6.1 on Sat Aug 2 18:30:31 2008 -->
<application path="/mnt/development/wxCPANPLUS/CPANPLUS-Shell-Wx-0.01/lib/CPANPLUS/Shell/Wx/res/MainWin.xrc" name="" class="" option="0" language="XRC" top_window="main_window" encoding="UTF-8" use_gettext="1" overwrite="1" use_new_namespace="1" for_...
<object class="CPANPLUS::Shell::Wx::Frame" name="main_window" base="EditFrame">
<style>wxDEFAULT_FRAME_STYLE</style>
<title>wxCPAN</title>
<menubar>1</menubar>
<statusbar>1</statusbar>
<toolbar>1</toolbar>
<size>672, 600</size>
<object class="wxMenuBar" name="main_window_menubar" base="EditMenuBar">
<menus>
<menu name="mnu_file" itemid="mnu_File" label="&File">
<item>
<label>&Open Actions... Ctrl+O</label>
<id>mnu_file_open</id>
<name>mnu_file_open</name>
<help_str>Open Actions</help_str>
</item>
<item>
<label>&Save Actions... Ctrl+S</label>
lib/CPANPLUS/Shell/Wx/res/MainWin.xrc view on Meta::CPAN
<?xml version="1.0" encoding="UTF-8"?>
<!-- generated by wxGlade 0.6.1 on Thu Aug 7 10:38:14 2008 -->
<resource version="2.3.0.1">
<object class="wxFrame" name="main_window" subclass="CPANPLUS::Shell::Wx::Frame">
<style>wxDEFAULT_FRAME_STYLE</style>
<title>wxCPAN</title>
<size>672, 600</size>
<object class="wxMenuBar" name="main_window_menubar">
<object class="wxMenu" name="mnu_file">
<label>_File</label>
<object class="wxMenuItem" name="mnu_file_open">
<label>_Open Actions... Ctrl+O</label>
<help>Open Actions</help>
</object>
<object class="wxMenuItem" name="mnu_file_save">
<label>_Save Actions... Ctrl+S</label>
<help>Save Actions</help>
</object>
<object class="separator"/>
<object class="wxMenuItem" name="mnu_file_quit">
<label>_Quit Ctrl+Q</label>
<help>Quit wxCPAN</help>
</object>
</object>
<object class="wxMenu" name="mnu_edit">
<label>_Edit</label>
<object class="wxMenuItem" name="mnu_edit_prefs">
<label>_Preferences... Ctrl+/</label>
<help>Show Preferences</help>
</object>
</object>
<object class="wxMenu" name="mnu_help">
<label>_Help</label>
<object class="wxMenuItem" name="mnu_show_config_dump">
<label>_Dump Config to Console Ctrl+D</label>
<help>Dumps Conguration information to Log</help>
</object>
<object class="wxMenuItem" name="mnu_help_updatewizard">
<label>_Run Update Wizard... Ctrl+U</label>
<help>Run the CPANPLUS Update Wizard</help>
</object>
<object class="separator"/>
<object class="wxMenuItem" name="mnu_help_pod_reader">
<label>Show _Pod Reader Ctrl+H</label>
<help>Show perldoc Interface</help>
</object>
<object class="separator"/>
<object class="wxMenuItem" name="mnu_help_help">
<label>_Help F1</label>
<help>How to use wxCPAN</help>
</object>
<object class="wxMenuItem" name="mnu_help_about">
<label>_About F2</label>
<help>About wxCPAN</help>
</object>
</object>
</object>
<object class="wxStatusBar" name="main_window_status">
<fields>1</fields>
<style>wxST_SIZEGRIP</style>
<widths>-1</widths>
</object>
lib/CPANPLUS/Shell/Wx/res/MainWin.xrc~ view on Meta::CPAN
<?xml version="1.0" encoding="UTF-8"?>
<!-- generated by wxGlade 0.6.1 on Sat Aug 2 18:30:36 2008 -->
<resource version="2.3.0.1">
<object class="wxFrame" name="main_window" subclass="CPANPLUS::Shell::Wx::Frame">
<style>wxDEFAULT_FRAME_STYLE</style>
<title>wxCPAN</title>
<size>672, 600</size>
<object class="wxMenuBar" name="main_window_menubar">
<object class="wxMenu" name="mnu_file">
<label>_File</label>
<object class="wxMenuItem" name="mnu_file_open">
<label>_Open Actions... Ctrl+O</label>
<help>Open Actions</help>
</object>
<object class="wxMenuItem" name="mnu_file_save">
<label>_Save Actions... Ctrl+S</label>
<help>Save Actions</help>
</object>
<object class="separator"/>
<object class="wxMenuItem" name="mnu_file_quit">
<label>_Quit Ctrl+Q</label>
<help>Quit wxCPAN</help>
</object>
</object>
<object class="wxMenu" name="mnu_edit">
<label>_Edit</label>
<object class="wxMenuItem" name="mnu_edit_prefs">
<label>_Preferences... Ctrl+/</label>
<help>Show Preferences</help>
</object>
</object>
<object class="wxMenu" name="mnu_help">
<label>_Help</label>
<object class="wxMenuItem" name="mnu_show_config_dump">
<label>_Dump Config to Console Ctrl+D</label>
<help>Dumps Conguration information to Log</help>
</object>
<object class="wxMenuItem" name="mnu_help_updatewizard">
<label>_Run Update Wizard... Ctrl+U</label>
<help>Run the CPANPLUS Update Wizard</help>
</object>
<object class="separator"/>
<object class="wxMenuItem" name="mnu_help_pod_reader">
<label>Show _Pod Reader Ctrl+H</label>
<help>Show perldoc Interface</help>
</object>
<object class="separator"/>
<object class="wxMenuItem" name="mnu_help_help">
<label>_Help F1</label>
<help>How to use wxCPAN</help>
</object>
<object class="wxMenuItem" name="mnu_help_about">
<label>_About F2</label>
<help>About wxCPAN</help>
</object>
</object>
</object>
<object class="wxStatusBar" name="main_window_status">
<fields>1</fields>
<style>wxST_SIZEGRIP</style>
<widths>-1</widths>
</object>