/////////////////////////////////////////////////////////////////////////////
// Name:        proppanel.cpp
// Purpose:     wxPackagePropertiesPanel
//              (construct code generated by DialogBlocks and few other things)
// Author:      Francesco Montorsi
// Modified by:
// Created:     28/06/2006 19:22:47
// RCS-ID:      $Id: proppanel.cpp,v 1.22 2007/01/31 11:59:42 frm Exp $
// Copyright:   (c) 2006 Francesco Montorsi
// Licence:     wxWidgets license
/////////////////////////////////////////////////////////////////////////////


// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"

#ifdef __BORLANDC__
#pragma hdrstop
#endif

#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif

#include <wx/datectrl.h>
#include <wx/artprov.h>
#include <wx/spinctrl.h>
#include <wx/filepicker.h>
#include <wx/sstream.h>
#include <wx/splitter.h>

#include "guipkg/proppanel.h"
#include "guipkg/sourceeditctrl.h"
#include "guipkg/optlistctrl.h"

#include "guicmn/guiutils.h"
#include "guicmn/commandlistbox.h"

#include "wxp/package.h"
#include "wxp/wxp.h"
#include "wxp/packagewxp.h"

#include "wx/miscutils.h"
#include "wx/explorertreectrl.h"

// NB: on GTK we will use some GTK stock icons
#include "bitmaps/new.xpm"
#include "bitmaps/dots.xpm"
#include "bitmaps/delete.xpm"
#include "bitmaps/preset.xpm"
#include "bitmaps/refresh.xpm"
#include "bitmaps/expand.xpm"
#include "bitmaps/collapse.xpm"
#include "bitmaps/valid.xpm"
#include "bitmaps/invalid.xpm"



// ----------------------------------------------------------------------------
// wxPackagePropertiesPanel
// ----------------------------------------------------------------------------

IMPLEMENT_DYNAMIC_CLASS( wxPackagePropertiesPanel, wxPanel )
DEFINE_EVENT_TYPE(wxEVT_COMMAND_PROPPANEL_USER_CHANGE)

BEGIN_EVENT_TABLE( wxPackagePropertiesPanel, wxPanel )

        // PACKAGING

    EVT_DIRPICKER_CHANGED( ID_PROP_PROJECT_DIR,
                           wxPackagePropertiesPanel::OnProjectRootChange )
    EVT_DIRPICKER_CHANGED( ID_PROP_WXP_DIR,
                           wxPackagePropertiesPanel::OnWXPDirChange )

    EVT_EXPLORER_TREE_CHECK( ID_PROP_INCLUDED_TREE,
                             wxPackagePropertiesPanel::OnIncludedTreeCheck )

    EVT_UPDATE_UI( ID_PROP_PACKAGING_PAGE, 
                   wxPackagePropertiesPanel::OnPackagingPageUpdateUI )


        // LICENSING

    EVT_COMBOBOX( ID_PROP_LICENSE,
                  wxPackagePropertiesPanel::OnLicenseSelected )

    EVT_UPDATE_UI( ID_PROP_LICENSING_PAGE, 
                   wxPackagePropertiesPanel::OnLicensingPageUpdateUI )


        // BUILD SYSTEM

    EVT_CHOICE( ID_PROP_BUILDSYS_TYPE,
                wxPackagePropertiesPanel::OnBuildSystemType )
    EVT_CHECKLISTBOX( ID_PROP_BUILDSYS_FORMATS,
                      wxPackagePropertiesPanel::OnBuildSystemFormatCheck )
    EVT_CHOICE( ID_PROP_STAGE,
                wxPackagePropertiesPanel::OnBuildSystemStage )
    EVT_OPTION_DCLICK( ID_PROP_BUILDSYS_OPTIONS,
                       wxPackagePropertiesPanel::OnOptionDClick )

    EVT_UPDATE_UI( ID_PROP_BUILDSYSTEM_PAGE, 
                   wxPackagePropertiesPanel::OnBuildSystemPageUpdateUI )


        // DEPENDENCIES

    EVT_LIST_ITEM_ACTIVATED( ID_PROP_DEPENDENCIES,
                             wxPackagePropertiesPanel::OnDepDClick )

    EVT_UPDATE_UI( ID_PROP_DEPENDENCIES_PAGE, 
                   wxPackagePropertiesPanel::OnDependenciesPageUpdateUI )


        // DETAILS

    EVT_UPDATE_UI( ID_PROP_DETAILS_PAGE, 
                   wxPackagePropertiesPanel::OnDetailsPageUpdateUI )


        // event handlers for wxID_ANY

    EVT_BUTTON( wxID_ANY,
                wxPackagePropertiesPanel::OnButton )
    EVT_LISTBOX_DCLICK( wxID_ANY,
                        wxPackagePropertiesPanel::OnListBoxDClick )
    EVT_TEXT( wxID_ANY, wxPackagePropertiesPanel::OnText )

    EVT_NOTEBOOK_PAGE_CHANGED( wxID_ANY, wxPackagePropertiesPanel::OnPageChanged )

END_EVENT_TABLE()

wxPackagePropertiesPanel::wxPackagePropertiesPanel( )
{
}

wxPackagePropertiesPanel::wxPackagePropertiesPanel( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style )
{
    Create(parent, id, pos, size, style);
}

wxPackagePropertiesPanel::~wxPackagePropertiesPanel( )
{
    // delete all wxPackageDependencies in the listctrl's item data
    wxDeletePackageDependencyFromListctrl(m_pDepList, -1);

    // delete all wxPackageDataWithRef objects
    wxDeletePackageDataWithRefFromListbox(m_pDocs, -1);
    wxDeletePackageDataWithRefFromListbox(m_pScreenshots, -1);
}

bool wxPackagePropertiesPanel::Create( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style )
{
    m_bModified = false;

////@begin wxPackagePropertiesPanel member initialisation
    m_pUncompressedSize = NULL;
    m_pTar = NULL;
    m_pZip = NULL;
    m_pFileName = NULL;
    m_pUpload = NULL;
    m_pProjectDir = NULL;
    m_pWXPDir = NULL;
    m_pRelativeRoot = NULL;
    m_pRootBitmap = NULL;
    m_pRootCheckLabel = NULL;
    m_pIncludedTree = NULL;
    m_pExcluded = NULL;
    m_pName = NULL;
    m_pVersion = NULL;
    m_pDescription = NULL;
    m_pKeywords = NULL;
    m_pPrimaryCat = NULL;
    m_pSecondaryCat = NULL;
    m_pLicense = NULL;
    m_pLicenseType = NULL;
    m_pOrganization = NULL;
    m_pOrganizationWebsite = NULL;
    m_pCost = NULL;
    m_pCopyright = NULL;
    m_pCredits = NULL;
    m_pAuthors = NULL;
    m_pMaintainers = NULL;
    m_pStatus = NULL;
    m_pCreationDate = NULL;
    m_pProgLang = NULL;
    m_pWebsite = NULL;
    m_pRSS = NULL;
    m_pNumSamples = NULL;
    m_pDownloadLinks = NULL;
    m_pDocs = NULL;
    m_pScreenshots = NULL;
    m_pSplitter = NULL;
    m_pTopPanel = NULL;
    m_pSupportedPorts = NULL;
    m_pTestedPorts = NULL;
    m_pBottomPanel = NULL;
    m_pDepList = NULL;
    m_pBuildSystemType = NULL;
    m_pFormats = NULL;
    m_pOptionPresets = NULL;
    m_pBuildSysOptions = NULL;
    m_pBuildSystemStage = NULL;
    m_pTargets = NULL;
    m_pCommandPresets = NULL;
    m_pBuildSysCommands = NULL;
    m_pXMLPanel = NULL;
    m_pXMLSizer = NULL;
////@end wxPackagePropertiesPanel member initialisation

////@begin wxPackagePropertiesPanel creation
    SetExtraStyle(wxWS_EX_VALIDATE_RECURSIVELY|wxWS_EX_BLOCK_EVENTS|wxDIALOG_EX_CONTEXTHELP);
    wxPanel::Create( parent, id, pos, size, style );

    CreateControls();
    if (GetSizer())
    {
        GetSizer()->SetSizeHints(this);
    }
    Centre();
////@end wxPackagePropertiesPanel creation
    return true;
}

void wxPackagePropertiesPanel::CreateControls()
{
////@begin wxPackagePropertiesPanel content construction
    wxPackagePropertiesPanel* itemPanel1 = this;

    wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
    itemPanel1->SetSizer(itemBoxSizer2);

    wxNotebook* itemNotebook3 = new wxNotebook( itemPanel1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxNB_DEFAULT|wxNB_TOP );

    wxPanel* itemPanel4 = new wxPanel( itemNotebook3, ID_PROP_PACKAGING_PAGE, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
    wxBoxSizer* itemBoxSizer5 = new wxBoxSizer(wxVERTICAL);
    itemPanel4->SetSizer(itemBoxSizer5);

    wxBoxSizer* itemBoxSizer6 = new wxBoxSizer(wxHORIZONTAL);
    itemBoxSizer5->Add(itemBoxSizer6, 0, wxGROW|wxLEFT|wxRIGHT|wxTOP, 5);
    wxStaticText* itemStaticText7 = new wxStaticText( itemPanel4, wxID_STATIC, _("Uncompressed size (total / only included):"), wxDefaultPosition, wxDefaultSize, 0 );
    itemBoxSizer6->Add(itemStaticText7, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

    m_pUncompressedSize = new wxStaticText( itemPanel4, wxID_STATIC, _("SIZE SIZE SIZE"), wxDefaultPosition, wxDefaultSize, 0 );
    if (ShowToolTips())
        m_pUncompressedSize->SetToolTip(_("This size is the sum of the sizes of all files / only-included shown in the tree below"));
    itemBoxSizer6->Add(m_pUncompressedSize, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxBoxSizer* itemBoxSizer9 = new wxBoxSizer(wxHORIZONTAL);
    itemBoxSizer5->Add(itemBoxSizer9, 0, wxGROW|wxLEFT|wxRIGHT, 5);
    wxStaticText* itemStaticText10 = new wxStaticText( itemPanel4, wxID_STATIC, _("Compression system:"), wxDefaultPosition, wxDefaultSize, 0 );
    itemBoxSizer9->Add(itemStaticText10, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

    m_pTar = new wxRadioButton( itemPanel4, ID_PROP_TAR, _("Gzipped tarball (.tar.gz)"), wxDefaultPosition, wxDefaultSize, 0 );
    m_pTar->SetValue(false);
    itemBoxSizer9->Add(m_pTar, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

    m_pZip = new wxRadioButton( itemPanel4, ID_PROP_ZIP, _("Zip (.zip)"), wxDefaultPosition, wxDefaultSize, 0 );
    m_pZip->SetValue(true);
    itemBoxSizer9->Add(m_pZip, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxTOP|wxBOTTOM, 5);

    wxFlexGridSizer* itemFlexGridSizer13 = new wxFlexGridSizer(2, 2, 0, 0);
    itemFlexGridSizer13->AddGrowableCol(1);
    itemBoxSizer5->Add(itemFlexGridSizer13, 0, wxGROW|wxLEFT|wxRIGHT, 5);
    wxStaticText* itemStaticText14 = new wxStaticText( itemPanel4, wxID_STATIC, _("Output filename for the package:"), wxDefaultPosition, wxDefaultSize, 0 );
    itemFlexGridSizer13->Add(itemStaticText14, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    m_pFileName = new wxTextCtrl( itemPanel4, ID_PROP_FILENAME, _T(""), wxDefaultPosition, wxDefaultSize, 0 );
    m_pFileName->SetHelpText(_("The compressed package will include only files listed below and will be generated in the parent folder of the project root directory"));
    if (ShowToolTips())
        m_pFileName->SetToolTip(_("The compressed package will include only files listed below and will be generated in the parent folder of the project root directory"));
    itemFlexGridSizer13->Add(m_pFileName, 2, wxGROW|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxTOP|wxBOTTOM, 5);

    wxStaticText* itemStaticText16 = new wxStaticText( itemPanel4, wxID_STATIC, _("Upload to the destination:"), wxDefaultPosition, wxDefaultSize, 0 );
    itemFlexGridSizer13->Add(itemStaticText16, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxBOTTOM, 5);

    m_pUpload = new wxTextCtrl( itemPanel4, ID_PROP_UPLOAD, _T(""), wxDefaultPosition, wxDefaultSize, 0 );
    m_pUpload->SetHelpText(_("This should be an URL in the form \"ftp://<user>:<password>@mysite.com/mypath\" where both \"user\" and \"password\" are optionals!"));
    if (ShowToolTips())
        m_pUpload->SetToolTip(_("This should be an URL in the form \"ftp://<user>:<password>@mysite.com/mypath\" where both \"user\" and \"password\" are optionals!"));
    itemFlexGridSizer13->Add(m_pUpload, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxBOTTOM, 5);

    wxStaticBox* itemStaticBoxSizer18Static = new wxStaticBox(itemPanel4, wxID_ANY, _("Relative root"));
    wxStaticBoxSizer* itemStaticBoxSizer18 = new wxStaticBoxSizer(itemStaticBoxSizer18Static, wxHORIZONTAL);
    itemBoxSizer5->Add(itemStaticBoxSizer18, 0, wxGROW|wxALL, 5);
    wxFlexGridSizer* itemFlexGridSizer19 = new wxFlexGridSizer(2, 2, 0, 0);
    itemFlexGridSizer19->AddGrowableCol(1);
    itemStaticBoxSizer18->Add(itemFlexGridSizer19, 1, wxGROW|wxBOTTOM, 5);
    wxStaticText* itemStaticText20 = new wxStaticText( itemPanel4, wxID_STATIC, _("Project root directory:"), wxDefaultPosition, wxDefaultSize, 0 );
    itemFlexGridSizer19->Add(itemStaticText20, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5);

    m_pProjectDir = new wxDirPickerCtrl( itemPanel4, ID_PROP_PROJECT_DIR );
    m_pProjectDir->SetHelpText(_("Note that the path of your project is not stored in the package description file; it's used just to compute the relative root below."));
    if (ShowToolTips())
        m_pProjectDir->SetToolTip(_("Note that the path of your project is not stored in the package description file; it's used just to compute the relative root below."));
    itemFlexGridSizer19->Add(m_pProjectDir, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxTOP, 5);

    wxStaticText* itemStaticText22 = new wxStaticText( itemPanel4, wxID_STATIC, _("Location of the WXP:"), wxDefaultPosition, wxDefaultSize, 0 );
    itemFlexGridSizer19->Add(itemStaticText22, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5);

    m_pWXPDir = new wxDirPickerCtrl( itemPanel4, ID_PROP_WXP_DIR );
    m_pWXPDir->SetHelpText(_("Note that the path to the WXP file is not stored in the package description file (i.e. in the WXP itself); it's used just to compute the relative root below."));
    if (ShowToolTips())
        m_pWXPDir->SetToolTip(_("Note that the path to the WXP file is not stored in the package description file (i.e. in the WXP itself); it's used just to compute the relative root below."));
    itemFlexGridSizer19->Add(m_pWXPDir, 0, wxALIGN_CENTER_HORIZONTAL|wxGROW|wxRIGHT|wxTOP, 5);

    wxStaticText* itemStaticText24 = new wxStaticText( itemPanel4, wxID_STATIC, _("Root relative to WXP:"), wxDefaultPosition, wxDefaultSize, 0 );
    itemFlexGridSizer19->Add(itemStaticText24, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5);

    wxBoxSizer* itemBoxSizer25 = new wxBoxSizer(wxHORIZONTAL);
    itemFlexGridSizer19->Add(itemBoxSizer25, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5);
    m_pRelativeRoot = new wxTextCtrl( itemPanel4, ID_PROP_RELATIVE_ROOT, _T(""), wxDefaultPosition, wxDefaultSize, wxTE_READONLY|wxTE_CENTRE );
    if (ShowToolTips())
        m_pRelativeRoot->SetToolTip(_("This is the root of the package, as a path relative to the WXP absolute path given above"));
    m_pRelativeRoot->SetBackgroundColour(wxColour(206, 206, 206));
    itemBoxSizer25->Add(m_pRelativeRoot, 2, wxALIGN_CENTER_VERTICAL|wxTOP, 5);

    wxBitmap m_pRootBitmapBitmap(itemPanel1->GetBitmapResource(wxT("invalid")));
    m_pRootBitmap = new wxStaticBitmap( itemPanel4, wxID_STATIC, m_pRootBitmapBitmap, wxDefaultPosition, wxDefaultSize, 0 );
    itemBoxSizer25->Add(m_pRootBitmap, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5);

    m_pRootCheckLabel = new wxStaticText( itemPanel4, wxID_STATIC, _("Invalid paths"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT );
    itemBoxSizer25->Add(m_pRootCheckLabel, 1, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5);

    wxStaticText* itemStaticText29 = new wxStaticText( itemPanel4, wxID_STATIC, _("Files included in the WXZ:"), wxDefaultPosition, wxDefaultSize, 0 );
    itemBoxSizer5->Add(itemStaticText29, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 10);

    wxBoxSizer* itemBoxSizer30 = new wxBoxSizer(wxHORIZONTAL);
    itemBoxSizer5->Add(itemBoxSizer30, 3, wxGROW|wxALL, 5);
    m_pIncludedTree = new wxExplorerTreeCtrl( itemPanel4, ID_PROP_INCLUDED_TREE, wxDefaultPosition, wxDefaultSize, wxETC_DEFAULT_STYLE );
    itemBoxSizer30->Add(m_pIncludedTree, 1, wxGROW|wxLEFT, 5);

    wxBoxSizer* itemBoxSizer32 = new wxBoxSizer(wxVERTICAL);
    itemBoxSizer30->Add(itemBoxSizer32, 0, wxALIGN_BOTTOM, 5);
    wxBitmap itemBitmapButton33Bitmap(itemPanel1->GetBitmapResource(wxT("refresh")));
    wxBitmapButton* itemBitmapButton33 = new wxBitmapButton( itemPanel4, ID_PROP_REFRESH_INCLUDED, itemBitmapButton33Bitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxBU_EXACTFIT );
    if (ShowToolTips())
        itemBitmapButton33->SetToolTip(_("Refresh the tree"));
    itemBoxSizer32->Add(itemBitmapButton33, 0, wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT|wxTOP, 5);

    wxBitmap itemBitmapButton34Bitmap(itemPanel1->GetBitmapResource(wxT("expand")));
    wxBitmapButton* itemBitmapButton34 = new wxBitmapButton( itemPanel4, ID_PROP_EXPAND_INCLUDED, itemBitmapButton34Bitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxBU_EXACTFIT );
    if (ShowToolTips())
        itemBitmapButton34->SetToolTip(_("Expand all branches of the tree"));
    itemBoxSizer32->Add(itemBitmapButton34, 0, wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT|wxTOP, 5);

    wxBitmap itemBitmapButton35Bitmap(itemPanel1->GetBitmapResource(wxT("collapse")));
    wxBitmapButton* itemBitmapButton35 = new wxBitmapButton( itemPanel4, ID_PROP_COLLAPSE_INCLUDED, itemBitmapButton35Bitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxBU_EXACTFIT );
    if (ShowToolTips())
        itemBitmapButton35->SetToolTip(_("Collapse all branches of the tree"));
    itemBoxSizer32->Add(itemBitmapButton35, 0, wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT|wxTOP, 5);

    wxStaticText* itemStaticText36 = new wxStaticText( itemPanel4, wxID_STATIC, _("Excluded files, directories and patterns:"), wxDefaultPosition, wxDefaultSize, 0 );
    itemBoxSizer5->Add(itemStaticText36, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 10);

    wxBoxSizer* itemBoxSizer37 = new wxBoxSizer(wxHORIZONTAL);
    itemBoxSizer5->Add(itemBoxSizer37, 2, wxGROW|wxALL, 5);
    m_pExcluded = new wxPackageExcludeListBox( itemPanel4, ID_PROP_EXCLUDED, wxDefaultPosition, wxDefaultSize, 0 );
    itemBoxSizer37->Add(m_pExcluded, 1, wxGROW|wxLEFT|wxBOTTOM, 5);

    wxBoxSizer* itemBoxSizer39 = new wxBoxSizer(wxVERTICAL);
    itemBoxSizer37->Add(itemBoxSizer39, 0, wxALIGN_BOTTOM, 5);
    wxBitmap itemBitmapButton40Bitmap(itemPanel1->GetBitmapResource(wxT("dots")));
    wxBitmapButton* itemBitmapButton40 = new wxBitmapButton( itemPanel4, ID_PROP_NEW_EXCLUDED, itemBitmapButton40Bitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxBU_EXACTFIT );
    if (ShowToolTips())
        itemBitmapButton40->SetToolTip(_("Add new directories, files or patterns to exclude"));
    itemBoxSizer39->Add(itemBitmapButton40, 0, wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT|wxTOP, 5);

    wxBitmap itemBitmapButton41Bitmap(itemPanel1->GetBitmapResource(wxT("delete")));
    wxBitmapButton* itemBitmapButton41 = new wxBitmapButton( itemPanel4, ID_PROP_DELETE_EXCLUDED, itemBitmapButton41Bitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxBU_EXACTFIT );
    if (ShowToolTips())
        itemBitmapButton41->SetToolTip(_("Remove selected directory, file or pattern from exclusion list"));
    itemBoxSizer39->Add(itemBitmapButton41, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);

    itemNotebook3->AddPage(itemPanel4, _("Packaging"));

    wxPanel* itemPanel42 = new wxPanel( itemNotebook3, ID_PROP_BASICS_PAGE, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
    wxBoxSizer* itemBoxSizer43 = new wxBoxSizer(wxVERTICAL);
    itemPanel42->SetSizer(itemBoxSizer43);

    wxFlexGridSizer* itemFlexGridSizer44 = new wxFlexGridSizer(0, 2, 0, 0);
    itemFlexGridSizer44->AddGrowableRow(2);
    itemFlexGridSizer44->AddGrowableCol(1);
    itemBoxSizer43->Add(itemFlexGridSizer44, 1, wxGROW|wxALL, 5);
    wxStaticText* itemStaticText45 = new wxStaticText( itemPanel42, wxID_STATIC, _("Package \nname:"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE );
    itemFlexGridSizer44->Add(itemStaticText45, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    m_pName = new wxTextCtrl( itemPanel42, ID_PROP_NAME, _T(""), wxDefaultPosition, wxDefaultSize, 0 );
    m_pName->SetHelpText(_("You can mix lowercase and uppercase characters but you cannot use spaces.\nKeep the name short but informative."));
    if (ShowToolTips())
        m_pName->SetToolTip(_("You can mix lowercase and uppercase characters but you cannot use spaces.\nKeep the name short but informative."));
    itemFlexGridSizer44->Add(m_pName, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxStaticText* itemStaticText47 = new wxStaticText( itemPanel42, wxID_STATIC, _("&Version:"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE );
    itemFlexGridSizer44->Add(itemStaticText47, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    m_pVersion = new wxTextCtrl( itemPanel42, ID_PROP_VERSION, _T(""), wxDefaultPosition, wxDefaultSize, 0 );
    m_pVersion->SetHelpText(_("Should be in form \"MAJOR.MINOR.RELEASE\" with MINOR and RELEASE digits optionals but all comprised in range [0-9]"));
    if (ShowToolTips())
        m_pVersion->SetToolTip(_("Should be in form \"MAJOR.MINOR.RELEASE\" with MINOR and RELEASE digits optionals but all comprised in range [0-9]"));
    itemFlexGridSizer44->Add(m_pVersion, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxStaticText* itemStaticText49 = new wxStaticText( itemPanel42, wxID_STATIC, _("&Description:"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE );
    itemFlexGridSizer44->Add(itemStaticText49, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    m_pDescription = new wxTextCtrl( itemPanel42, ID_PROP_DESCRIPTION, _T(""), wxDefaultPosition, wxSize(-1, 100), wxTE_MULTILINE|wxTE_RICH );
    m_pDescription->SetHelpText(_("You can use the HTML tags recognized by wxHTML for this field: <b>, <i>, <a>, <font>, <br>, etc"));
    if (ShowToolTips())
        m_pDescription->SetToolTip(_("You can use the HTML tags recognized by wxHTML for this field: <b>, <i>, <a>, <font>, <br>, etc"));
    itemFlexGridSizer44->Add(m_pDescription, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxStaticText* itemStaticText51 = new wxStaticText( itemPanel42, wxID_STATIC, _("&Keywords:"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE );
    itemFlexGridSizer44->Add(itemStaticText51, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    m_pKeywords = new wxTextCtrl( itemPanel42, ID_PROP_KEYWORDS, _T(""), wxDefaultPosition, wxDefaultSize, 0 );
    m_pKeywords->SetHelpText(_("Comma-separed list of \"keywords\" for this package."));
    if (ShowToolTips())
        m_pKeywords->SetToolTip(_("Comma-separed list of \"keywords\" for this package."));
    itemFlexGridSizer44->Add(m_pKeywords, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    itemBoxSizer43->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);

    wxStaticBox* itemStaticBoxSizer54Static = new wxStaticBox(itemPanel42, wxID_ANY, _("Categories"));
    wxStaticBoxSizer* itemStaticBoxSizer54 = new wxStaticBoxSizer(itemStaticBoxSizer54Static, wxVERTICAL);
    itemBoxSizer43->Add(itemStaticBoxSizer54, 0, wxGROW|wxALL, 5);
    itemStaticBoxSizer54->Add(5, 3, 0, wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT, 5);

    wxStaticText* itemStaticText56 = new wxStaticText( itemPanel42, wxID_STATIC, _("Remember that a correct categorization of the package is very important!"), wxDefaultPosition, wxDefaultSize, 0 );
    itemStaticBoxSizer54->Add(itemStaticText56, 0, wxGROW|wxLEFT|wxRIGHT|wxTOP, 5);

    wxFlexGridSizer* itemFlexGridSizer57 = new wxFlexGridSizer(2, 2, 0, 0);
    itemFlexGridSizer57->AddGrowableCol(1);
    itemStaticBoxSizer54->Add(itemFlexGridSizer57, 0, wxGROW|wxALL, 5);
    wxStaticText* itemStaticText58 = new wxStaticText( itemPanel42, wxID_STATIC, _("Primary:"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE );
    itemFlexGridSizer57->Add(itemStaticText58, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxString* m_pPrimaryCatStrings = NULL;
    m_pPrimaryCat = new wxChoice( itemPanel42, ID_PROP_CATEGORY1, wxDefaultPosition, wxDefaultSize, 0, m_pPrimaryCatStrings, 0 );
    itemFlexGridSizer57->Add(m_pPrimaryCat, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxStaticText* itemStaticText60 = new wxStaticText( itemPanel42, wxID_STATIC, _("Secondary:"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE );
    itemFlexGridSizer57->Add(itemStaticText60, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxString* m_pSecondaryCatStrings = NULL;
    m_pSecondaryCat = new wxChoice( itemPanel42, ID_PROP_CATEGORY2, wxDefaultPosition, wxDefaultSize, 0, m_pSecondaryCatStrings, 0 );
    itemFlexGridSizer57->Add(m_pSecondaryCat, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    itemNotebook3->AddPage(itemPanel42, _("Basics"));

    wxPanel* itemPanel62 = new wxPanel( itemNotebook3, ID_PROP_LICENSING_PAGE, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
    wxBoxSizer* itemBoxSizer63 = new wxBoxSizer(wxVERTICAL);
    itemPanel62->SetSizer(itemBoxSizer63);

    wxFlexGridSizer* itemFlexGridSizer64 = new wxFlexGridSizer(0, 2, 0, 0);
    itemFlexGridSizer64->AddGrowableRow(6);
    itemFlexGridSizer64->AddGrowableCol(1);
    itemBoxSizer63->Add(itemFlexGridSizer64, 3, wxGROW|wxALL, 5);
    wxStaticText* itemStaticText65 = new wxStaticText( itemPanel62, wxID_STATIC, _("&License:"), wxDefaultPosition, wxDefaultSize, 0 );
    itemFlexGridSizer64->Add(itemStaticText65, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxBoxSizer* itemBoxSizer66 = new wxBoxSizer(wxHORIZONTAL);
    itemFlexGridSizer64->Add(itemBoxSizer66, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5);
    wxString* m_pLicenseStrings = NULL;
    m_pLicense = new wxComboBox( itemPanel62, ID_PROP_LICENSE, _T(""), wxDefaultPosition, wxDefaultSize, 0, m_pLicenseStrings, wxCB_DROPDOWN );
    itemBoxSizer66->Add(m_pLicense, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxButton* itemButton68 = new wxButton( itemPanel62, ID_PROP_LICENSE_REF, _("..."), wxDefaultPosition, wxDefaultSize, 0 );
    itemBoxSizer66->Add(itemButton68, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxStaticText* itemStaticText69 = new wxStaticText( itemPanel62, wxID_STATIC, _("License &type:"), wxDefaultPosition, wxDefaultSize, 0 );
    itemFlexGridSizer64->Add(itemStaticText69, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxString* m_pLicenseTypeStrings = NULL;
    m_pLicenseType = new wxChoice( itemPanel62, ID_PROP_LICENSETYPE, wxDefaultPosition, wxDefaultSize, 0, m_pLicenseTypeStrings, 0 );
    itemFlexGridSizer64->Add(m_pLicenseType, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxStaticText* itemStaticText71 = new wxStaticText( itemPanel62, wxID_STATIC, _("&Organisation:"), wxDefaultPosition, wxDefaultSize, 0 );
    itemFlexGridSizer64->Add(itemStaticText71, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    m_pOrganization = new wxTextCtrl( itemPanel62, ID_PROP_ORGANISATION, _T(""), wxDefaultPosition, wxDefaultSize, 0 );
    m_pOrganization->SetHelpText(_("The name of the organization which created this package (if any)"));
    if (ShowToolTips())
        m_pOrganization->SetToolTip(_("The name of the organization which created this package (if any)"));
    itemFlexGridSizer64->Add(m_pOrganization, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxStaticText* itemStaticText73 = new wxStaticText( itemPanel62, wxID_STATIC, _("&Organisation\nwebsite:"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE );
    itemFlexGridSizer64->Add(itemStaticText73, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    m_pOrganizationWebsite = new wxTextCtrl( itemPanel62, ID_PROP_ORGANISATION_WEBSITE, _T(""), wxDefaultPosition, wxDefaultSize, 0 );
    m_pOrganizationWebsite->SetHelpText(_("An URL to the website of the organization which created this package"));
    if (ShowToolTips())
        m_pOrganizationWebsite->SetToolTip(_("An URL to the website of the organization which created this package"));
    itemFlexGridSizer64->Add(m_pOrganizationWebsite, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxStaticText* itemStaticText75 = new wxStaticText( itemPanel62, wxID_STATIC, _("&Cost:"), wxDefaultPosition, wxDefaultSize, 0 );
    itemFlexGridSizer64->Add(itemStaticText75, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    m_pCost = new wxTextCtrl( itemPanel62, ID_PROP_COST, _T(""), wxDefaultPosition, wxDefaultSize, 0 );
    m_pCost->SetHelpText(_("Some free-form text about the price of this package (if any).\nCan be an URL to a page with detailed pricing."));
    if (ShowToolTips())
        m_pCost->SetToolTip(_("Some free-form text about the price of this package (if any).\nCan be an URL to a page with detailed pricing."));
    itemFlexGridSizer64->Add(m_pCost, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxStaticText* itemStaticText77 = new wxStaticText( itemPanel62, wxID_STATIC, _("Copyright:"), wxDefaultPosition, wxDefaultSize, 0 );
    itemFlexGridSizer64->Add(itemStaticText77, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    m_pCopyright = new wxTextCtrl( itemPanel62, ID_PROP_COPYRIGHT, _T(""), wxDefaultPosition, wxDefaultSize, 0 );
    m_pCopyright->SetHelpText(_("Typically a string in the form \"(c) Year AuthorName AuthorSurname\""));
    if (ShowToolTips())
        m_pCopyright->SetToolTip(_("Typically a string in the form \"(c) Year AuthorName AuthorSurname\""));
    itemFlexGridSizer64->Add(m_pCopyright, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxStaticText* itemStaticText79 = new wxStaticText( itemPanel62, wxID_STATIC, _("Credits:"), wxDefaultPosition, wxDefaultSize, 0 );
    itemFlexGridSizer64->Add(itemStaticText79, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    m_pCredits = new wxTextCtrl( itemPanel62, ID_PROP_CREDITS, _T(""), wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE );
    m_pCredits->SetHelpText(_("You can give credits to the people which does not qualify as \"author\" nor as \"maintainer\" using this field."));
    if (ShowToolTips())
        m_pCredits->SetToolTip(_("You can give credits to the people which does not qualify as \"author\" nor as \"maintainer\" using this field."));
    itemFlexGridSizer64->Add(m_pCredits, 1, wxGROW|wxGROW|wxALL, 5);

    wxFlexGridSizer* itemFlexGridSizer81 = new wxFlexGridSizer(2, 4, 0, 0);
    itemFlexGridSizer81->AddGrowableRow(1);
    itemFlexGridSizer81->AddGrowableCol(0);
    itemFlexGridSizer81->AddGrowableCol(2);
    itemBoxSizer63->Add(itemFlexGridSizer81, 2, wxGROW|wxLEFT|wxBOTTOM, 5);
    wxStaticText* itemStaticText82 = new wxStaticText( itemPanel62, wxID_STATIC, _("&Authors:"), wxDefaultPosition, wxDefaultSize, 0 );
    itemFlexGridSizer81->Add(itemStaticText82, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5);

    itemFlexGridSizer81->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);

    wxStaticText* itemStaticText84 = new wxStaticText( itemPanel62, wxID_STATIC, _("Maintainers:"), wxDefaultPosition, wxDefaultSize, 0 );
    itemFlexGridSizer81->Add(itemStaticText84, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5);

    itemFlexGridSizer81->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);

    wxString* m_pAuthorsStrings = NULL;
    m_pAuthors = new wxListBox( itemPanel62, ID_PROP_AUTHORS, wxDefaultPosition, wxDefaultSize, 0, m_pAuthorsStrings, wxLB_SINGLE|wxLB_HSCROLL );
    m_pAuthors->SetHelpText(_("People which have written/contributed major parts can be listed here"));
    if (ShowToolTips())
        m_pAuthors->SetToolTip(_("People which have written/contributed major parts can be listed here"));
    itemFlexGridSizer81->Add(m_pAuthors, 1, wxGROW|wxGROW|wxLEFT|wxTOP|wxBOTTOM, 5);

    wxBoxSizer* itemBoxSizer87 = new wxBoxSizer(wxVERTICAL);
    itemFlexGridSizer81->Add(itemBoxSizer87, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_BOTTOM, 5);
    wxBitmap itemBitmapButton88Bitmap(itemPanel1->GetBitmapResource(wxT("new")));
    wxBitmapButton* itemBitmapButton88 = new wxBitmapButton( itemPanel62, ID_PROP_NEW_AUTHOR, itemBitmapButton88Bitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW );
    if (ShowToolTips())
        itemBitmapButton88->SetToolTip(_("Add new author"));
    itemBoxSizer87->Add(itemBitmapButton88, 0, wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT, 5);

    wxBitmap itemBitmapButton89Bitmap(itemPanel1->GetBitmapResource(wxT("delete")));
    wxBitmapButton* itemBitmapButton89 = new wxBitmapButton( itemPanel62, ID_PROP_DELETE_AUTHOR, itemBitmapButton89Bitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxBU_EXACTFIT );
    if (ShowToolTips())
        itemBitmapButton89->SetToolTip(_("Delete selected author"));
    itemBoxSizer87->Add(itemBitmapButton89, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);

    wxString* m_pMaintainersStrings = NULL;
    m_pMaintainers = new wxListBox( itemPanel62, ID_PROP_MAINTAINERS, wxDefaultPosition, wxDefaultSize, 0, m_pMaintainersStrings, wxLB_SINGLE|wxLB_HSCROLL );
    m_pMaintainers->SetHelpText(_("People which are maintaining the component and this package can be listed here"));
    if (ShowToolTips())
        m_pMaintainers->SetToolTip(_("People which are maintaining the component and this package can be listed here"));
    itemFlexGridSizer81->Add(m_pMaintainers, 1, wxGROW|wxGROW|wxLEFT|wxTOP|wxBOTTOM, 5);

    wxBoxSizer* itemBoxSizer91 = new wxBoxSizer(wxVERTICAL);
    itemFlexGridSizer81->Add(itemBoxSizer91, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_BOTTOM, 5);
    wxBitmap itemBitmapButton92Bitmap(itemPanel1->GetBitmapResource(wxT("new")));
    wxBitmapButton* itemBitmapButton92 = new wxBitmapButton( itemPanel62, ID_PROP_NEW_MAINTAINER, itemBitmapButton92Bitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW );
    if (ShowToolTips())
        itemBitmapButton92->SetToolTip(_("Add new maintainer"));
    itemBoxSizer91->Add(itemBitmapButton92, 0, wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT|wxTOP, 5);

    wxBitmap itemBitmapButton93Bitmap(itemPanel1->GetBitmapResource(wxT("delete")));
    wxBitmapButton* itemBitmapButton93 = new wxBitmapButton( itemPanel62, ID_PROP_DELETE_MAINTAINER, itemBitmapButton93Bitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxBU_EXACTFIT );
    if (ShowToolTips())
        itemBitmapButton93->SetToolTip(_("Delete selected maintainer"));
    itemBoxSizer91->Add(itemBitmapButton93, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);

    itemNotebook3->AddPage(itemPanel62, _("Licensing"));

    wxPanel* itemPanel94 = new wxPanel( itemNotebook3, ID_PROP_DETAILS_PAGE, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
    wxBoxSizer* itemBoxSizer95 = new wxBoxSizer(wxVERTICAL);
    itemPanel94->SetSizer(itemBoxSizer95);

    wxFlexGridSizer* itemFlexGridSizer96 = new wxFlexGridSizer(2, 2, 0, 0);
    itemFlexGridSizer96->AddGrowableCol(1);
    itemBoxSizer95->Add(itemFlexGridSizer96, 0, wxGROW|wxALL, 5);
    wxStaticText* itemStaticText97 = new wxStaticText( itemPanel94, wxID_STATIC, _("&Status:"), wxDefaultPosition, wxDefaultSize, 0 );
    itemFlexGridSizer96->Add(itemStaticText97, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxString* m_pStatusStrings = NULL;
    m_pStatus = new wxChoice( itemPanel94, ID_PROP_STATUS, wxDefaultPosition, wxDefaultSize, 0, m_pStatusStrings, 0 );
    itemFlexGridSizer96->Add(m_pStatus, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxStaticText* itemStaticText99 = new wxStaticText( itemPanel94, wxID_STATIC, _("Creation date:"), wxDefaultPosition, wxDefaultSize, 0 );
    itemFlexGridSizer96->Add(itemStaticText99, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    m_pCreationDate = new wxDatePickerCtrl( itemPanel94, ID_PROP_CREATIONDATE, wxDateTime(), wxDefaultPosition, wxDefaultSize, wxDP_DEFAULT );
    m_pCreationDate->SetHelpText(_("This should be the creation date of the packaged software, not the creation date of the package itself..."));
    if (ShowToolTips())
        m_pCreationDate->SetToolTip(_("This should be the creation date of the packaged software, not the creation date of the package itself..."));
    itemFlexGridSizer96->Add(m_pCreationDate, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxStaticText* itemStaticText101 = new wxStaticText( itemPanel94, wxID_STATIC, _("Programming\nlanguage:"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE );
    itemFlexGridSizer96->Add(itemStaticText101, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxString* m_pProgLangStrings = NULL;
    m_pProgLang = new wxChoice( itemPanel94, ID_PROP_PROGLANGUAGE, wxDefaultPosition, wxDefaultSize, 0, m_pProgLangStrings, 0 );
    itemFlexGridSizer96->Add(m_pProgLang, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxStaticText* itemStaticText103 = new wxStaticText( itemPanel94, wxID_STATIC, _("&Website:"), wxDefaultPosition, wxDefaultSize, 0 );
    itemFlexGridSizer96->Add(itemStaticText103, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    m_pWebsite = new wxTextCtrl( itemPanel94, ID_PROP_WEBSITE, _T(""), wxDefaultPosition, wxDefaultSize, 0 );
    m_pWebsite->SetHelpText(_("URL of the homepage of the software contained in this package"));
    if (ShowToolTips())
        m_pWebsite->SetToolTip(_("URL of the homepage of the software contained in this package"));
    itemFlexGridSizer96->Add(m_pWebsite, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxStaticText* itemStaticText105 = new wxStaticText( itemPanel94, wxID_STATIC, _("&RSS feed:"), wxDefaultPosition, wxDefaultSize, 0 );
    itemFlexGridSizer96->Add(itemStaticText105, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    m_pRSS = new wxTextCtrl( itemPanel94, ID_PROP_RSSFEED, _T(""), wxDefaultPosition, wxDefaultSize, 0 );
    m_pRSS->SetHelpText(_("RSS feed for this package"));
    if (ShowToolTips())
        m_pRSS->SetToolTip(_("RSS feed for this package"));
    itemFlexGridSizer96->Add(m_pRSS, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxBoxSizer* itemBoxSizer107 = new wxBoxSizer(wxHORIZONTAL);
    itemBoxSizer95->Add(itemBoxSizer107, 0, wxGROW|wxALL, 5);
    wxStaticText* itemStaticText108 = new wxStaticText( itemPanel94, wxID_STATIC, _("Number of samples provided:"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE );
    itemBoxSizer107->Add(itemStaticText108, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

    m_pNumSamples = new wxSpinCtrl( itemPanel94, ID_PROP_NUMSAMPLES, _T("0"), wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 100, 0 );
    m_pNumSamples->SetHelpText(_("How many samples are contained in this package (only meaningful if the package contains a library)?"));
    if (ShowToolTips())
        m_pNumSamples->SetToolTip(_("How many samples are contained in this package (only meaningful if the package contains a library)?"));
    itemBoxSizer107->Add(m_pNumSamples, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

    itemBoxSizer107->Add(5, 5, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxStaticText* itemStaticText111 = new wxStaticText( itemPanel94, wxID_STATIC, _("Logo:"), wxDefaultPosition, wxDefaultSize, 0 );
    itemBoxSizer107->Add(itemStaticText111, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxButton* itemButton112 = new wxButton( itemPanel94, ID_PROP_LOGO_REF, _("..."), wxDefaultPosition, wxDefaultSize, 0 );
    itemBoxSizer107->Add(itemButton112, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

    itemBoxSizer107->Add(5, 5, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxFlexGridSizer* itemFlexGridSizer114 = new wxFlexGridSizer(2, 3, 0, 0);
    itemFlexGridSizer114->AddGrowableRow(0);
    itemFlexGridSizer114->AddGrowableRow(1);
    itemFlexGridSizer114->AddGrowableRow(2);
    itemFlexGridSizer114->AddGrowableCol(1);
    itemBoxSizer95->Add(itemFlexGridSizer114, 1, wxGROW|wxALL, 5);
    wxStaticText* itemStaticText115 = new wxStaticText( itemPanel94, wxID_STATIC, _("Direct\ndownload links:"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE );
    itemFlexGridSizer114->Add(itemStaticText115, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxString* m_pDownloadLinksStrings = NULL;
    m_pDownloadLinks = new wxListBox( itemPanel94, ID_PROP_DOWNLOADLINKS, wxDefaultPosition, wxDefaultSize, 0, m_pDownloadLinksStrings, wxLB_SINGLE|wxLB_HSCROLL );
    m_pDownloadLinks->SetHelpText(_("A set of URLs which can be used for the user to get the latest release of this package.\nE.g. \"http://mesh.dl.sourceforge.net/sourceforge/myproj/myproj-1.0.0.tar.gz\""));
    if (ShowToolTips())
        m_pDownloadLinks->SetToolTip(_("A set of URLs which can be used for the user to get the latest release of this package.\nE.g. \"http://mesh.dl.sourceforge.net/sourceforge/myproj/myproj-1.0.0.tar.gz\""));
    itemFlexGridSizer114->Add(m_pDownloadLinks, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxBoxSizer* itemBoxSizer117 = new wxBoxSizer(wxVERTICAL);
    itemFlexGridSizer114->Add(itemBoxSizer117, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_BOTTOM, 5);
    wxBitmap itemBitmapButton118Bitmap(itemPanel1->GetBitmapResource(wxT("new")));
    wxBitmapButton* itemBitmapButton118 = new wxBitmapButton( itemPanel94, ID_PROP_NEW_DOWNLOADLINK, itemBitmapButton118Bitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxBU_EXACTFIT );
    if (ShowToolTips())
        itemBitmapButton118->SetToolTip(_("Add new download link"));
    itemBoxSizer117->Add(itemBitmapButton118, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxTOP, 5);

    wxBitmap itemBitmapButton119Bitmap(itemPanel1->GetBitmapResource(wxT("delete")));
    wxBitmapButton* itemBitmapButton119 = new wxBitmapButton( itemPanel94, ID_PROP_DELETE_DOWNLOADLINK, itemBitmapButton119Bitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxBU_EXACTFIT );
    if (ShowToolTips())
        itemBitmapButton119->SetToolTip(_("Delete selected download link"));
    itemBoxSizer117->Add(itemBitmapButton119, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxTOP|wxBOTTOM, 5);

    wxStaticText* itemStaticText120 = new wxStaticText( itemPanel94, wxID_STATIC, _("Documentation:"), wxDefaultPosition, wxDefaultSize, 0 );
    itemFlexGridSizer114->Add(itemStaticText120, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxString* m_pDocsStrings = NULL;
    m_pDocs = new wxListBox( itemPanel94, ID_PROP_DOCS, wxDefaultPosition, wxDefaultSize, 0, m_pDocsStrings, wxLB_SINGLE|wxLB_HSCROLL );
    m_pDocs->SetHelpText(_("Remote and local references to the documentation for the packaged software"));
    if (ShowToolTips())
        m_pDocs->SetToolTip(_("Remote and local references to the documentation for the packaged software"));
    itemFlexGridSizer114->Add(m_pDocs, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxBoxSizer* itemBoxSizer122 = new wxBoxSizer(wxVERTICAL);
    itemFlexGridSizer114->Add(itemBoxSizer122, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_BOTTOM, 5);
    wxBitmap itemBitmapButton123Bitmap(itemPanel1->GetBitmapResource(wxT("new")));
    wxBitmapButton* itemBitmapButton123 = new wxBitmapButton( itemPanel94, ID_PROP_NEW_DOC, itemBitmapButton123Bitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxBU_EXACTFIT );
    if (ShowToolTips())
        itemBitmapButton123->SetToolTip(_("Add new documentation"));
    itemBoxSizer122->Add(itemBitmapButton123, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxTOP, 5);

    wxBitmap itemBitmapButton124Bitmap(itemPanel1->GetBitmapResource(wxT("delete")));
    wxBitmapButton* itemBitmapButton124 = new wxBitmapButton( itemPanel94, ID_PROP_DELETE_DOC, itemBitmapButton124Bitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxBU_EXACTFIT );
    if (ShowToolTips())
        itemBitmapButton124->SetToolTip(_("Delete selected document"));
    itemBoxSizer122->Add(itemBitmapButton124, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxTOP|wxBOTTOM, 5);

    wxStaticText* itemStaticText125 = new wxStaticText( itemPanel94, wxID_STATIC, _("Screenshots:"), wxDefaultPosition, wxDefaultSize, 0 );
    itemFlexGridSizer114->Add(itemStaticText125, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxString* m_pScreenshotsStrings = NULL;
    m_pScreenshots = new wxListBox( itemPanel94, ID_PROP_SCREENSHOTS, wxDefaultPosition, wxDefaultSize, 0, m_pScreenshotsStrings, wxLB_SINGLE|wxLB_HSCROLL );
    m_pScreenshots->SetHelpText(_("Remote and local references to the packaged software's screenshots"));
    if (ShowToolTips())
        m_pScreenshots->SetToolTip(_("Remote and local references to the packaged software's screenshots"));
    itemFlexGridSizer114->Add(m_pScreenshots, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxBoxSizer* itemBoxSizer127 = new wxBoxSizer(wxVERTICAL);
    itemFlexGridSizer114->Add(itemBoxSizer127, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_BOTTOM, 5);
    wxBitmap itemBitmapButton128Bitmap(itemPanel1->GetBitmapResource(wxT("new")));
    wxBitmapButton* itemBitmapButton128 = new wxBitmapButton( itemPanel94, ID_PROP_NEW_SCREENSHOT, itemBitmapButton128Bitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxBU_EXACTFIT );
    if (ShowToolTips())
        itemBitmapButton128->SetToolTip(_("Add new screenshot"));
    itemBoxSizer127->Add(itemBitmapButton128, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxTOP, 5);

    wxBitmap itemBitmapButton129Bitmap(itemPanel1->GetBitmapResource(wxT("delete")));
    wxBitmapButton* itemBitmapButton129 = new wxBitmapButton( itemPanel94, ID_PROP_DELETE_SCREENSHOT, itemBitmapButton129Bitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxBU_EXACTFIT );
    if (ShowToolTips())
        itemBitmapButton129->SetToolTip(_("Delete selected screenshot"));
    itemBoxSizer127->Add(itemBitmapButton129, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxTOP|wxBOTTOM, 5);

    itemNotebook3->AddPage(itemPanel94, _("Details"));

    wxPanel* itemPanel130 = new wxPanel( itemNotebook3, ID_PROP_DEPENDENCIES_PAGE, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
    wxBoxSizer* itemBoxSizer131 = new wxBoxSizer(wxVERTICAL);
    itemPanel130->SetSizer(itemBoxSizer131);

    m_pSplitter = new wxSplitterWindow( itemPanel130, wxID_ANY, wxDefaultPosition, wxSize(100, 100), wxNO_BORDER|wxSP_BORDER|wxSP_LIVE_UPDATE );
    itemBoxSizer131->Add(m_pSplitter, 1, wxGROW|wxALL, 5);
    m_pTopPanel = new wxPanel( m_pSplitter, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxNO_BORDER|wxTAB_TRAVERSAL );
    wxBoxSizer* itemBoxSizer134 = new wxBoxSizer(wxVERTICAL);
    m_pTopPanel->SetSizer(itemBoxSizer134);

    wxStaticBox* itemStaticBoxSizer135Static = new wxStaticBox(m_pTopPanel, wxID_ANY, _("...from wxWidgets"));
    wxStaticBoxSizer* itemStaticBoxSizer135 = new wxStaticBoxSizer(itemStaticBoxSizer135Static, wxVERTICAL);
    itemBoxSizer134->Add(itemStaticBoxSizer135, 1, wxGROW|wxALL, 8);
    wxStaticText* itemStaticText136 = new wxStaticText( m_pTopPanel, wxID_STATIC, _("Double click on the port names to edit the relative supported/tested versions."), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT );
    itemStaticText136->SetFont(wxFont(8, wxSWISS, wxNORMAL, wxBOLD, false, _T("Tahoma")));
    itemStaticBoxSizer135->Add(itemStaticText136, 0, wxGROW|wxALL, 10);

    wxStaticText* itemStaticText137 = new wxStaticText( m_pTopPanel, wxID_STATIC, _("You can specify the supported/tested versions in two forms:\n- using the hyphen to separe two version number (e.g. \"2.4-2.6\")\n- using the 'x' as wildcard (e.g. \"2.6.x\")"), wxDefaultPosition, wxDefaultSize, 0 );
    itemStaticBoxSizer135->Add(itemStaticText137, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5);

    wxFlexGridSizer* itemFlexGridSizer138 = new wxFlexGridSizer(2, 4, 0, 0);
    itemFlexGridSizer138->AddGrowableRow(1);
    itemFlexGridSizer138->AddGrowableCol(0);
    itemFlexGridSizer138->AddGrowableCol(1);
    itemFlexGridSizer138->AddGrowableCol(2);
    itemFlexGridSizer138->AddGrowableCol(3);
    itemStaticBoxSizer135->Add(itemFlexGridSizer138, 1, wxGROW, 5);
    wxStaticText* itemStaticText139 = new wxStaticText( m_pTopPanel, wxID_STATIC, _("Supported ports:"), wxDefaultPosition, wxDefaultSize, 0 );
    itemFlexGridSizer138->Add(itemStaticText139, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5);

    itemFlexGridSizer138->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxStaticText* itemStaticText141 = new wxStaticText( m_pTopPanel, wxID_STATIC, _("Tested ports:"), wxDefaultPosition, wxDefaultSize, 0 );
    itemFlexGridSizer138->Add(itemStaticText141, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5);

    itemFlexGridSizer138->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxString* m_pSupportedPortsStrings = NULL;
    m_pSupportedPorts = new wxCheckListBox( m_pTopPanel, ID_PROP_SUPPORTEDPORTS, wxDefaultPosition, wxSize(-1, 100), 0, m_pSupportedPortsStrings, wxLB_EXTENDED|wxLB_NEEDED_SB );
    m_pSupportedPorts->SetHelpText(_("The wxWidgets ports that this package *theorically* supports"));
    if (ShowToolTips())
        m_pSupportedPorts->SetToolTip(_("The wxWidgets ports that this package *theorically* supports"));
    itemFlexGridSizer138->Add(m_pSupportedPorts, 1, wxGROW|wxGROW|wxLEFT|wxTOP|wxBOTTOM, 5);

    wxButton* itemButton144 = new wxButton( m_pTopPanel, ID_PROP_QUICKSET_SUPPORTED_VERSIONS, _(" Quick\n  set \nversion"), wxDefaultPosition, wxSize(15, -1), 0 );
    itemFlexGridSizer138->Add(itemButton144, 1, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL|wxFIXED_MINSIZE, 5);

    wxString* m_pTestedPortsStrings = NULL;
    m_pTestedPorts = new wxCheckListBox( m_pTopPanel, ID_PROP_TESTEDPORTS, wxDefaultPosition, wxSize(-1, 100), 0, m_pTestedPortsStrings, wxLB_EXTENDED|wxLB_NEEDED_SB );
    m_pTestedPorts->SetHelpText(_("The wxWidgets ports where this package has been tested and found successfully working"));
    if (ShowToolTips())
        m_pTestedPorts->SetToolTip(_("The wxWidgets ports where this package has been tested and found successfully working"));
    itemFlexGridSizer138->Add(m_pTestedPorts, 1, wxGROW|wxGROW|wxLEFT|wxTOP|wxBOTTOM, 5);

    wxButton* itemButton146 = new wxButton( m_pTopPanel, ID_PROP_QUICKSET_TESTED_VERSIONS, _(" Quick\n  set \nversion\n"), wxDefaultPosition, wxSize(15, -1), 0 );
    itemFlexGridSizer138->Add(itemButton146, 1, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL|wxFIXED_MINSIZE, 5);

    m_pBottomPanel = new wxPanel( m_pSplitter, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxNO_BORDER|wxTAB_TRAVERSAL );
    wxBoxSizer* itemBoxSizer148 = new wxBoxSizer(wxVERTICAL);
    m_pBottomPanel->SetSizer(itemBoxSizer148);

    wxStaticBox* itemStaticBoxSizer149Static = new wxStaticBox(m_pBottomPanel, wxID_ANY, _("...from other packages"));
    wxStaticBoxSizer* itemStaticBoxSizer149 = new wxStaticBoxSizer(itemStaticBoxSizer149Static, wxHORIZONTAL);
    itemBoxSizer148->Add(itemStaticBoxSizer149, 1, wxGROW|wxTOP, 5);
    m_pDepList = new wxListCtrl( m_pBottomPanel, ID_PROP_DEPENDENCIES, wxDefaultPosition, wxSize(100, 100), wxLC_REPORT );
    m_pDepList->SetHelpText(_("Dependencies of this package from other packages."));
    if (ShowToolTips())
        m_pDepList->SetToolTip(_("Dependencies of this package from other packages."));
    itemStaticBoxSizer149->Add(m_pDepList, 1, wxGROW|wxALL, 5);

    wxBoxSizer* itemBoxSizer151 = new wxBoxSizer(wxVERTICAL);
    itemStaticBoxSizer149->Add(itemBoxSizer151, 0, wxALIGN_BOTTOM, 5);
    wxBitmap itemBitmapButton152Bitmap(itemPanel1->GetBitmapResource(wxT("new")));
    wxBitmapButton* itemBitmapButton152 = new wxBitmapButton( m_pBottomPanel, ID_PROP_NEW_DEP, itemBitmapButton152Bitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxBU_EXACTFIT );
    if (ShowToolTips())
        itemBitmapButton152->SetToolTip(_("Add new package dependency"));
    itemBoxSizer151->Add(itemBitmapButton152, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxTOP, 5);

    wxBitmap itemBitmapButton153Bitmap(itemPanel1->GetBitmapResource(wxT("delete")));
    wxBitmapButton* itemBitmapButton153 = new wxBitmapButton( m_pBottomPanel, ID_PROP_DELETE_DEP, itemBitmapButton153Bitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxBU_EXACTFIT );
    if (ShowToolTips())
        itemBitmapButton153->SetToolTip(_("Delete selected dependency"));
    itemBoxSizer151->Add(itemBitmapButton153, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxTOP|wxBOTTOM, 5);

    itemNotebook3->AddPage(itemPanel130, _("Dependencies"));

    wxPanel* itemPanel154 = new wxPanel( itemNotebook3, ID_PROP_BUILDSYSTEM_PAGE, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
    wxBoxSizer* itemBoxSizer155 = new wxBoxSizer(wxVERTICAL);
    itemPanel154->SetSizer(itemBoxSizer155);

    wxFlexGridSizer* itemFlexGridSizer156 = new wxFlexGridSizer(2, 2, 0, 0);
    itemFlexGridSizer156->AddGrowableRow(1);
    itemFlexGridSizer156->AddGrowableCol(1);
    itemBoxSizer155->Add(itemFlexGridSizer156, 2, wxGROW, 5);
    wxStaticText* itemStaticText157 = new wxStaticText( itemPanel154, wxID_STATIC, _("Build system type:"), wxDefaultPosition, wxDefaultSize, 0 );
    itemFlexGridSizer156->Add(itemStaticText157, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxString* m_pBuildSystemTypeStrings = NULL;
    m_pBuildSystemType = new wxChoice( itemPanel154, ID_PROP_BUILDSYS_TYPE, wxDefaultPosition, wxDefaultSize, 0, m_pBuildSystemTypeStrings, 0 );
    itemFlexGridSizer156->Add(m_pBuildSystemType, 1, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxStaticText* itemStaticText159 = new wxStaticText( itemPanel154, wxID_STATIC, _("Formats supported:"), wxDefaultPosition, wxDefaultSize, 0 );
    itemFlexGridSizer156->Add(itemStaticText159, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxString* m_pFormatsStrings = NULL;
    m_pFormats = new wxCheckListBox( itemPanel154, ID_PROP_BUILDSYS_FORMATS, wxDefaultPosition, wxSize(-1, 60), 0, m_pFormatsStrings, wxLB_SINGLE );
    itemFlexGridSizer156->Add(m_pFormats, 2, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL|wxFIXED_MINSIZE, 5);

    wxNotebook* itemNotebook161 = new wxNotebook( itemPanel154, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxNB_DEFAULT|wxNB_TOP );

    wxPanel* itemPanel162 = new wxPanel( itemNotebook161, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
    wxBoxSizer* itemBoxSizer163 = new wxBoxSizer(wxVERTICAL);
    itemPanel162->SetSizer(itemBoxSizer163);

    wxBoxSizer* itemBoxSizer164 = new wxBoxSizer(wxHORIZONTAL);
    itemBoxSizer163->Add(itemBoxSizer164, 0, wxGROW|wxLEFT|wxTOP|wxBOTTOM, 5);
    wxStaticText* itemStaticText165 = new wxStaticText( itemPanel162, wxID_STATIC, _("Option presets in use:"), wxDefaultPosition, wxDefaultSize, 0 );
    itemBoxSizer164->Add(itemStaticText165, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

    m_pOptionPresets = new wxStaticText( itemPanel162, wxID_STATIC, _T(""), wxDefaultPosition, wxDefaultSize, wxST_NO_AUTORESIZE );
    m_pOptionPresets->SetFont(wxFont(10, wxSWISS, wxNORMAL, wxBOLD, false, _T("DejaVu Sans")));
    itemBoxSizer164->Add(m_pOptionPresets, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxBoxSizer* itemBoxSizer167 = new wxBoxSizer(wxHORIZONTAL);
    itemBoxSizer163->Add(itemBoxSizer167, 1, wxGROW, 5);
    m_pBuildSysOptions = new wxOptionListCtrl( itemPanel162, ID_PROP_BUILDSYS_OPTIONS, wxDefaultPosition, wxDefaultSize, 0 );
    m_pBuildSysOptions->SetHelpText(_("These are the options which will be user-editable when building the package and which will be passed to the MAKE process"));
    if (ShowToolTips())
        m_pBuildSysOptions->SetToolTip(_("These are the options which will be user-editable when building the package and which will be passed to the MAKE process"));
    itemBoxSizer167->Add(m_pBuildSysOptions, 1, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5);

    wxBoxSizer* itemBoxSizer169 = new wxBoxSizer(wxVERTICAL);
    itemBoxSizer167->Add(itemBoxSizer169, 0, wxALIGN_BOTTOM, 5);
    wxBitmap itemBitmapButton170Bitmap(itemPanel1->GetBitmapResource(wxT("new")));
    wxBitmapButton* itemBitmapButton170 = new wxBitmapButton( itemPanel162, ID_PROP_NEW_OPTION, itemBitmapButton170Bitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW );
    if (ShowToolTips())
        itemBitmapButton170->SetToolTip(_("Add new option"));
    itemBoxSizer169->Add(itemBitmapButton170, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxTOP, 5);

    wxBitmap itemBitmapButton171Bitmap(itemPanel1->GetBitmapResource(wxT("delete")));
    wxBitmapButton* itemBitmapButton171 = new wxBitmapButton( itemPanel162, ID_PROP_DELETE_OPTION, itemBitmapButton171Bitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW );
    if (ShowToolTips())
        itemBitmapButton171->SetToolTip(_("Delete selected option"));
    itemBoxSizer169->Add(itemBitmapButton171, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxTOP, 5);

    wxBitmap itemBitmapButton172Bitmap(itemPanel1->GetBitmapResource(wxT("preset")));
    wxBitmapButton* itemBitmapButton172 = new wxBitmapButton( itemPanel162, ID_PROP_ADD_OPTPRESET, itemBitmapButton172Bitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxBU_EXACTFIT );
    if (ShowToolTips())
        itemBitmapButton172->SetToolTip(_("Add option preset"));
    itemBoxSizer169->Add(itemBitmapButton172, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxTOP|wxBOTTOM, 5);

    itemNotebook161->AddPage(itemPanel162, _("Options"));

    wxPanel* itemPanel173 = new wxPanel( itemNotebook161, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
    wxBoxSizer* itemBoxSizer174 = new wxBoxSizer(wxHORIZONTAL);
    itemPanel173->SetSizer(itemBoxSizer174);

    wxBoxSizer* itemBoxSizer175 = new wxBoxSizer(wxVERTICAL);
    itemBoxSizer174->Add(itemBoxSizer175, 1, wxGROW|wxTOP, 5);
    wxBoxSizer* itemBoxSizer176 = new wxBoxSizer(wxHORIZONTAL);
    itemBoxSizer175->Add(itemBoxSizer176, 0, wxGROW|wxALL, 5);
    wxStaticText* itemStaticText177 = new wxStaticText( itemPanel173, wxID_STATIC, _("Stage:"), wxDefaultPosition, wxDefaultSize, 0 );
    itemBoxSizer176->Add(itemStaticText177, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxString* m_pBuildSystemStageStrings = NULL;
    m_pBuildSystemStage = new wxChoice( itemPanel173, ID_PROP_STAGE, wxDefaultPosition, wxDefaultSize, 0, m_pBuildSystemStageStrings, 0 );
    itemBoxSizer176->Add(m_pBuildSystemStage, 2, wxALIGN_CENTER_VERTICAL|wxALL, 5);

    itemBoxSizer176->Add(5, 5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxStaticText* itemStaticText180 = new wxStaticText( itemPanel173, wxID_STATIC, _("Targets for this stage:"), wxDefaultPosition, wxDefaultSize, 0 );
    itemBoxSizer176->Add(itemStaticText180, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

    m_pTargets = new wxTextCtrl( itemPanel173, ID_PROP_TARGETS, _T(""), wxDefaultPosition, wxDefaultSize, 0 );
    m_pTargets->SetHelpText(_("A comma-separed list of the targets supported by the package's build system (e.g. \"all,docs\")"));
    if (ShowToolTips())
        m_pTargets->SetToolTip(_("A comma-separed list of the targets supported by the package's build system (e.g. \"all,docs\")"));
    itemBoxSizer176->Add(m_pTargets, 3, wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxBoxSizer* itemBoxSizer182 = new wxBoxSizer(wxHORIZONTAL);
    itemBoxSizer175->Add(itemBoxSizer182, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5);
    wxStaticText* itemStaticText183 = new wxStaticText( itemPanel173, wxID_STATIC, _("Command presets in use:"), wxDefaultPosition, wxDefaultSize, 0 );
    itemBoxSizer182->Add(itemStaticText183, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

    m_pCommandPresets = new wxStaticText( itemPanel173, wxID_STATIC, _T(""), wxDefaultPosition, wxDefaultSize, wxST_NO_AUTORESIZE );
    m_pCommandPresets->SetFont(wxFont(10, wxSWISS, wxNORMAL, wxBOLD, false, _T("DejaVu Sans")));
    itemBoxSizer182->Add(m_pCommandPresets, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5);

    m_pBuildSysCommands = new wxCommandListBox( itemPanel173, ID_PROP_BUILDSYS_COMMANDS, wxDefaultPosition, wxSize(-1, 40), 0 );
    m_pBuildSysCommands->SetHelpText(_("The commands executed for the different build formats"));
    if (ShowToolTips())
        m_pBuildSysCommands->SetToolTip(_("The commands executed for the different build formats"));
    itemBoxSizer175->Add(m_pBuildSysCommands, 1, wxGROW|wxALL|wxFIXED_MINSIZE, 5);

    wxBoxSizer* itemBoxSizer186 = new wxBoxSizer(wxVERTICAL);
    itemBoxSizer174->Add(itemBoxSizer186, 0, wxALIGN_BOTTOM, 5);
    wxBitmap itemBitmapButton187Bitmap(itemPanel1->GetBitmapResource(wxT("new")));
    wxBitmapButton* itemBitmapButton187 = new wxBitmapButton( itemPanel173, ID_PROP_NEW_COMMAND, itemBitmapButton187Bitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW );
    if (ShowToolTips())
        itemBitmapButton187->SetToolTip(_("Add new command"));
    itemBoxSizer186->Add(itemBitmapButton187, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxTOP, 5);

    wxBitmap itemBitmapButton188Bitmap(itemPanel1->GetBitmapResource(wxT("delete")));
    wxBitmapButton* itemBitmapButton188 = new wxBitmapButton( itemPanel173, ID_PROP_DELETE_COMMAND, itemBitmapButton188Bitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW );
    if (ShowToolTips())
        itemBitmapButton188->SetToolTip(_("Delete selected command"));
    itemBoxSizer186->Add(itemBitmapButton188, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxTOP, 5);

    wxBitmap itemBitmapButton189Bitmap(itemPanel1->GetBitmapResource(wxT("preset")));
    wxBitmapButton* itemBitmapButton189 = new wxBitmapButton( itemPanel173, ID_PROP_RESET_COMMANDS, itemBitmapButton189Bitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW );
    if (ShowToolTips())
        itemBitmapButton189->SetToolTip(_("Use command preset"));
    itemBoxSizer186->Add(itemBitmapButton189, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxTOP|wxBOTTOM, 5);

    itemNotebook161->AddPage(itemPanel173, _("Commands"));

    itemBoxSizer155->Add(itemNotebook161, 4, wxGROW|wxALL, 5);

    itemNotebook3->AddPage(itemPanel154, _("Build system"));

    m_pXMLPanel = new wxPanel( itemNotebook3, ID_PROP_XMLSOURCE_PAGE, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
    m_pXMLSizer = new wxBoxSizer(wxVERTICAL);
    m_pXMLPanel->SetSizer(m_pXMLSizer);

    itemNotebook3->AddPage(m_pXMLPanel, _("XML source"));

    itemBoxSizer2->Add(itemNotebook3, 1, wxGROW|wxALL, 5);

////@end wxPackagePropertiesPanel content construction

    // complete initialization of the splitter window _after_ setting the
    // minsize for both panels it contains !
    // Otherwise the splitter won't work correctly:
    m_pTopPanel->SetMinSize(m_pTopPanel->GetSizer()->GetMinSize());
    m_pBottomPanel->SetMinSize(m_pBottomPanel->GetSizer()->GetMinSize());
    m_pSplitter->SplitHorizontally(m_pTopPanel, m_pBottomPanel);

    InitBasicsPage();
    InitPackagingPage();
    InitLicensingPage();
    InitDetailsPage();
    InitDependenciesPage();
    InitBuildSystemPage();
    InitXMLSourcePage();

    m_nLastStage = 0;

    // after all fake events, reset the modified flag
    m_bModified = false;
}

bool wxPackagePropertiesPanel::ShowToolTips()
{
    return true;
}

wxBitmap wxPackagePropertiesPanel::GetBitmapResource( const wxString& name )
{
    wxImage bitmap;

    if (name == _T("new"))
        bitmap = wxGetImageFromXPM_or_GTK2Stock(new_xpm, "gtk-add");
    else if (name == _T("delete"))
        bitmap = wxGetImageFromXPM_or_GTK2Stock(delete_xpm, "gtk-remove");
    else if (name == _T("preset"))
        bitmap = wxGetImageFromXPM_or_GTK2Stock(preset_xpm, "gtk-preferences");
    else if (name == _T("refresh"))
        bitmap = wxGetImageFromXPM_or_GTK2Stock(refresh_xpm, "gtk-refresh");
    else if (name == _T("collapse"))
        bitmap = wxImage(collapse_xpm);
    else if (name == wxT("expand"))
        bitmap = wxImage(expand_xpm);
    else if (name == wxT("invalid"))
        bitmap = wxGetImageFromXPM_or_GTK2Stock(invalid_xpm, "gtk-close");
    else if (name == wxT("valid"))
        bitmap = wxGetImageFromXPM_or_GTK2Stock(valid_xpm, "gtk-apply");
    else if (name == wxT("dots"))
        bitmap = wxImage(dots_xpm);

    if (bitmap.IsOk())
        bitmap.Rescale(ID_PROPPANEL_BITMAP_SIZE.GetWidth(),
                       ID_PROPPANEL_BITMAP_SIZE.GetHeight());
    return wxBitmap(bitmap);
}

wxPackageInfo wxPackagePropertiesPanel::GetPackageInfo() const
{
    wxPackageInfo ret;

    GetBasicsPackageInfo(ret);
    GetPackagingPackageInfo(ret);
    GetLicensingPackageInfo(ret);
    GetDetailsPackageInfo(ret);
    GetDependenciesPackageInfo(ret);
    GetBuildSystemPackageInfo(ret);

    return ret;
}

void wxPackagePropertiesPanel::SetPackageInfo(const wxPackageXMLDescriptor &p,
                                              const wxString &filename)
{
    DoSetPackageInfo(p.GetPackageInfo(), filename);

    // now it's safe to store user XML & update it
    m_xmlDescriptor = p;
    UpdateXML();
}

void wxPackagePropertiesPanel::SetPackageInfo(const wxPackageInfo &p,
                                              const wxString &filename)
{
    DoSetPackageInfo(p, filename);

    // invalidate previous user XML source & update it
    m_xmlDescriptor = wxEmptyPackageXMLDescriptor;
    UpdateXML();
}

void wxPackagePropertiesPanel::DoSetPackageInfo(const wxPackageInfo &p,
                                                const wxString &filename)
{
    // NB: we don't require the given wxPackageInfo to be valid.
    //     This allows to use this function with wxEmptyPackageInfo 
    //     to reset this panel.

    DoSetBasicsPackageInfo(p);
    DoSetPackagingPackageInfo(p, filename);
    DoSetLicensingPackageInfo(p);
    DoSetDetailsPackageInfo(p);
    DoSetDependenciesPackageInfo(p);
    DoSetBuildSystemPackageInfo(p);
}

bool wxPackagePropertiesPanel::IsOk() const
{
    // NB: we don't want to use here something like:
    //      return IsBasicsPageOk() &&
    //             IsPackagingPageOk() &&
    //             IsLicensingPageOk() &&
    //             IsDetailsPageOk() &&
    //             IsDependenciesPageOk() &&
    //             IsBuildSystemPageOk();
    //     as otherwise the log warnings/errors coming from e.g. the packaging
    //     page would be shown only after all warnings/errors from the basics
    //     page have been fixed. We want to show all warnings/errors immediately.
    bool ok1, ok2, ok3, ok4, ok5, ok6;

    ok1 = IsBasicsPageOk();
    ok2 = IsPackagingPageOk();
    ok3 = IsLicensingPageOk();
    ok4 = IsDetailsPageOk();
    ok5 = IsDependenciesPageOk();
    ok6 = IsBuildSystemPageOk();

    return ok1 && ok2 && ok3 && ok4 && ok5 && ok6;
}

bool wxPackagePropertiesPanel::TransferDataFromWindow()
{
    if (!wxPanel::TransferDataFromWindow())
        return false;

    // save current contents of the list/textctrl of the BUILD-SYSTEM panel
    // in the appropriate array for the currently selected stage
    m_targets[m_nLastStage] = m_pTargets->GetValue();
    m_commands[m_nLastStage] = m_pBuildSysCommands->GetCommands();

    return true;
}

void wxPackagePropertiesPanel::OnUserChange()
{
    // mark this panel as user-modified
    m_bModified = true;

    // send an event to the event handler
    wxCommandEvent ev(wxEVT_COMMAND_PROPPANEL_USER_CHANGE, GetId());
    if (GetParent())
        GetParent()->ProcessEvent(ev);
}



// ----------------------------------------------------------------------------
// wxPackagePropertiesPanel - event handlers
// ----------------------------------------------------------------------------

void wxPackagePropertiesPanel::OnText(wxCommandEvent &WXUNUSED(ev))
{
    OnUserChange();
}

void wxPackagePropertiesPanel::OnButton(wxCommandEvent &ev)
{
    OnUserChange();

    switch (ev.GetId())
    {
    case ID_PROP_REFRESH_INCLUDED:
    case ID_PROP_EXPAND_INCLUDED:
    case ID_PROP_COLLAPSE_INCLUDED:
    case ID_PROP_NEW_EXCLUDED:
    case ID_PROP_DELETE_EXCLUDED:
        OnPackagingButton(ev);
        break;

    case ID_PROP_NEW_AUTHOR:
    case ID_PROP_NEW_MAINTAINER:
    case ID_PROP_LICENSE_REF:
    case ID_PROP_DELETE_AUTHOR:
    case ID_PROP_DELETE_MAINTAINER:
        OnLicensingButton(ev);
        break;

    case ID_PROP_NEW_DOWNLOADLINK:
    case ID_PROP_NEW_DOC:
    case ID_PROP_NEW_SCREENSHOT:
    case ID_PROP_LOGO_REF:
    case ID_PROP_DELETE_DOWNLOADLINK:
    case ID_PROP_DELETE_DOC:
    case ID_PROP_DELETE_SCREENSHOT:
        OnDetailsButton(ev);
        break;

    case ID_PROP_NEW_DEP:
    case ID_PROP_DELETE_DEP:
    case ID_PROP_QUICKSET_SUPPORTED_VERSIONS:
    case ID_PROP_QUICKSET_TESTED_VERSIONS:
        OnDependenciesButton(ev);
        break;

    case ID_PROP_NEW_OPTION:
    case ID_PROP_NEW_COMMAND:
    case ID_PROP_RESET_COMMANDS:
    case ID_PROP_ADD_OPTPRESET:
    case ID_PROP_DELETE_OPTION:
    case ID_PROP_DELETE_COMMAND:
        OnBuildSystemButton(ev);
        break;
    }
}

void wxPackagePropertiesPanel::OnListBoxDClick(wxCommandEvent &ev)
{
    OnUserChange();

    switch (ev.GetId())
    {
    case ID_PROP_AUTHORS:
    case ID_PROP_MAINTAINERS:
        OnLicensingListBoxDClick(ev);
        break;

    case ID_PROP_SUPPORTEDPORTS:
    case ID_PROP_TESTEDPORTS:
        OnDependenciesListBoxDClick(ev);
        break;

    case ID_PROP_DOWNLOADLINKS:
    case ID_PROP_DOCS:
    case ID_PROP_SCREENSHOTS:
        OnDetailsListBoxDClick(ev);
        break;

    case ID_PROP_BUILDSYS_COMMANDS:
        OnBuildSystemListBoxDClick(ev);
        break;
    }
}

/*

wxIcon wxPackagePropertiesPanel::GetIconResource( const wxString& name )
{
    // Icon retrieval
////@begin wxPackagePropertiesPanel icon retrieval
    wxUnusedVar(name);
    return wxNullIcon;
////@end wxPackagePropertiesPanel icon retrieval
}

*/

