PluginWizardBase::~PluginWizardBase() { this->Disconnect(wxEVT_WIZARD_PAGE_CHANGING, wxWizardEventHandler(PluginWizardBase::OnPageChanging), NULL, this); this->Disconnect(wxEVT_WIZARD_FINISHED, wxWizardEventHandler(PluginWizardBase::OnFinish), NULL, this); m_dirPickerPluginPath->Disconnect(wxEVT_COMMAND_DIRPICKER_CHANGED, wxFileDirPickerEventHandler(PluginWizardBase::OnProjectPathChanged), NULL, this); }
NewProjectWizardBase::~NewProjectWizardBase() { this->Disconnect(wxEVT_WIZARD_PAGE_CHANGING, wxWizardEventHandler(NewProjectWizardBase::OnPageChanging), NULL, this); this->Disconnect(wxEVT_WIZARD_FINISHED, wxWizardEventHandler(NewProjectWizardBase::OnFinish), NULL, this); m_dataviewTemplates->Disconnect(wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED, wxDataViewEventHandler(NewProjectWizardBase::OnItemSelected), NULL, this); m_txtProjName->Disconnect(wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler(NewProjectWizardBase::OnProjectNameChanged), NULL, this); m_textCtrlProjectPath->Disconnect(wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler(NewProjectWizardBase::OnProjectPathUpdated), NULL, this); m_buttonBrowse->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(NewProjectWizardBase::OnBrowseProjectPath), NULL, this); m_cbSeparateDir->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(NewProjectWizardBase::OnProjectNameChanged), NULL, this); }
WIZARD_3DSHAPE_LIBS_DOWNLOADER_BASE::~WIZARD_3DSHAPE_LIBS_DOWNLOADER_BASE() { // Disconnect Events this->Disconnect( wxID_ANY, wxEVT_WIZARD_FINISHED, wxWizardEventHandler( WIZARD_3DSHAPE_LIBS_DOWNLOADER_BASE::OnWizardFinished ) ); this->Disconnect( wxID_ANY, wxEVT_WIZARD_PAGE_CHANGED, wxWizardEventHandler( WIZARD_3DSHAPE_LIBS_DOWNLOADER_BASE::OnPageChanged ) ); this->Disconnect( wxID_ANY, wxEVT_WIZARD_PAGE_CHANGING, wxWizardEventHandler( WIZARD_3DSHAPE_LIBS_DOWNLOADER_BASE::OnPageChanging ) ); m_downloadDir->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( WIZARD_3DSHAPE_LIBS_DOWNLOADER_BASE::OnLocalFolderChange ), NULL, this ); m_btnBrowse->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( WIZARD_3DSHAPE_LIBS_DOWNLOADER_BASE::OnBrowseButtonClick ), NULL, this ); m_buttonDefault3DPath->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( WIZARD_3DSHAPE_LIBS_DOWNLOADER_BASE::OnDefault3DPathButtonClick ), NULL, this ); m_btnSelectAll3Dlibs->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( WIZARD_3DSHAPE_LIBS_DOWNLOADER_BASE::OnSelectAll3Dlibs ), NULL, this ); m_btnUnselectAll3Dlibs->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( WIZARD_3DSHAPE_LIBS_DOWNLOADER_BASE::OnUnselectAll3Dlibs ), NULL, this ); m_searchCtrl3Dlibs->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( WIZARD_3DSHAPE_LIBS_DOWNLOADER_BASE::OnChangeSearch ), NULL, this ); m_gridLibReview->Disconnect( wxEVT_SIZE, wxSizeEventHandler( WIZARD_3DSHAPE_LIBS_DOWNLOADER_BASE::OnGridLibReviewSize ), NULL, this ); m_pages.Clear(); }
RuleWizardAlfClientPage::RuleWizardAlfClientPage(wxWindow *parent, RuleWizardHistory *history) : RuleWizardAlfPermissionPageBase(parent) { history->get(); history_ = history; switch (history_->getAlfClientPermission()) { case RuleWizardHistory::PERM_ALLOW_ALL: yesRadioButton->SetValue(true); break; case RuleWizardHistory::PERM_RESTRICT_DEFAULT: defaultRadioButton->SetValue(true); break; case RuleWizardHistory::PERM_RESTRICT_USER: restrictedRadioButton->SetValue(true); break; case RuleWizardHistory::PERM_DENY_ALL: /* FALLTHROUGH */ default: noRadioButton->SetValue(true); break; } ServiceList *serviceList = history_->getAlfClientPortList(); defaultRadioButton->Enable(serviceList->canHaveDefaultServices()); defaultLabel->Enable(serviceList->canHaveDefaultServices()); parent->Connect(wxEVT_WIZARD_PAGE_CHANGED, wxWizardEventHandler(RuleWizardAlfClientPage::onPageChanged), NULL, this); }
RuleWizardFinalPage::RuleWizardFinalPage(wxWindow *parent, RuleWizardHistory *history) : RuleWizardFinalPageBase(parent) { history->get(); history_ = history; parent->Connect(wxEVT_WIZARD_PAGE_CHANGED, wxWizardEventHandler(RuleWizardFinalPage::onPageChanged), NULL, this); }
RuleWizardContextExceptionPage::RuleWizardContextExceptionPage(wxWindow *parent, RuleWizardHistory *history) : RuleWizardContextExceptionPageBase(parent) { history->get(); history_ = history; /* List has one column, expanded over complete list */ exceptionList->addColumn(new ContextExceptionProperty(), exceptionList->GetSize().GetWidth()); /* Row-provider is context-exception-model */ exceptionList->setRowProvider(history->getContextExceptions()); parent->Connect(wxEVT_WIZARD_PAGE_CHANGING, wxWizardEventHandler( RuleWizardContextExceptionPage::onPageChanging), NULL, this); parent->Connect(wxEVT_WIZARD_PAGE_CHANGED, wxWizardEventHandler(RuleWizardContextExceptionPage::onPageChanged), NULL, this); }
GitImportDialogProto::~GitImportDialogProto() { // Disconnect Events this->Disconnect( wxID_ANY, wxEVT_WIZARD_PAGE_CHANGED, wxWizardEventHandler( GitImportDialogProto::OnPageChanged ) ); localDir->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( GitImportDialogProto::OnLocalDirectoryChange ), NULL, this ); selectLocalDirButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( GitImportDialogProto::OnLocalDirClick ), NULL, this ); remoteDir->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( GitImportDialogProto::OnRemoteDirectoryChange ), NULL, this ); selectRemoteDirButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( GitImportDialogProto::OnRemoteDirClick ), NULL, this ); m_pages.Clear(); }
WIZARD_3DSHAPE_LIBS_DOWNLOADER_BASE::WIZARD_3DSHAPE_LIBS_DOWNLOADER_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxBitmap& bitmap, const wxPoint& pos, long style ) { this->Create( parent, id, title, bitmap, pos, style ); this->SetSizeHints( wxSize( -1,-1 ), wxDefaultSize ); wxWizardPageSimple* m_wizPage1 = new wxWizardPageSimple( this, NULL, NULL, wxArtProvider::GetBitmap( wxART_HELP_BOOK, wxART_FRAME_ICON ) ); m_pages.Add( m_wizPage1 ); m_wizPage1->SetMinSize( wxSize( 720,480 ) ); wxBoxSizer* bSizer1; bSizer1 = new wxBoxSizer( wxVERTICAL ); m_staticTextWelcome = new wxStaticText( m_wizPage1, wxID_ANY, _("Welcome to the 3D shape Libraries downloader Wizard!"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextWelcome->Wrap( -1 ); bSizer1->Add( m_staticTextWelcome, 0, wxALL|wxEXPAND, 5 ); bSizer1->Add( 0, 20, 0, 0, 5 ); wxBoxSizer* bSizer19; bSizer19 = new wxBoxSizer( wxVERTICAL ); m_staticText8 = new wxStaticText( m_wizPage1, wxID_ANY, _("Please select the URL for the 3D libraries to download"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText8->Wrap( -1 ); bSizer19->Add( m_staticText8, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); m_textCtrlGithubURL = new wxTextCtrl( m_wizPage1, wxID_ANY, _("http://github.com/KiCad"), wxDefaultPosition, wxDefaultSize, 0 ); m_textCtrlGithubURL->SetMinSize( wxSize( 300,-1 ) ); bSizer19->Add( m_textCtrlGithubURL, 0, wxALL|wxEXPAND, 5 ); bSizer19->Add( 0, 10, 0, 0, 5 ); wxFlexGridSizer* fgSizerLocalFolder; fgSizerLocalFolder = new wxFlexGridSizer( 0, 2, 0, 0 ); fgSizerLocalFolder->AddGrowableCol( 0 ); fgSizerLocalFolder->SetFlexibleDirection( wxBOTH ); fgSizerLocalFolder->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); wxBoxSizer* bSizerDinname; bSizerDinname = new wxBoxSizer( wxVERTICAL ); m_staticText9 = new wxStaticText( m_wizPage1, wxID_ANY, _("3D shape local folder:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText9->Wrap( -1 ); bSizerDinname->Add( m_staticText9, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); m_downloadDir = new wxTextCtrl( m_wizPage1, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); bSizerDinname->Add( m_downloadDir, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); fgSizerLocalFolder->Add( bSizerDinname, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); wxBoxSizer* bSizerButts; bSizerButts = new wxBoxSizer( wxVERTICAL ); m_btnBrowse = new wxButton( m_wizPage1, wxID_ANY, _("Browse"), wxDefaultPosition, wxDefaultSize, 0 ); bSizerButts->Add( m_btnBrowse, 0, wxEXPAND|wxALL, 5 ); m_buttonDefault3DPath = new wxButton( m_wizPage1, wxID_ANY, _("Default 3D Path"), wxDefaultPosition, wxDefaultSize, 0 ); bSizerButts->Add( m_buttonDefault3DPath, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); fgSizerLocalFolder->Add( bSizerButts, 0, wxEXPAND, 5 ); wxBoxSizer* bSizerWarnMsg; bSizerWarnMsg = new wxBoxSizer( wxHORIZONTAL ); m_bitmapDirWarn = new wxStaticBitmap( m_wizPage1, wxID_ANY, wxArtProvider::GetBitmap( wxART_ERROR, wxART_OTHER ), wxDefaultPosition, wxDefaultSize, 0 ); bSizerWarnMsg->Add( m_bitmapDirWarn, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); m_invalidDirWarningText = new wxStaticText( m_wizPage1, wxID_ANY, _("It is not possible to write in the selected directory.\nPlease choose another one."), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE ); m_invalidDirWarningText->Wrap( -1 ); m_invalidDirWarningText->SetForegroundColour( wxColour( 255, 0, 0 ) ); bSizerWarnMsg->Add( m_invalidDirWarningText, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); fgSizerLocalFolder->Add( bSizerWarnMsg, 1, wxEXPAND, 5 ); fgSizerLocalFolder->Add( 10, 40, 0, 0, 5 ); bSizer19->Add( fgSizerLocalFolder, 1, wxEXPAND, 5 ); bSizer1->Add( bSizer19, 1, wxEXPAND, 5 ); wxBoxSizer* bSizerOfficialRepo; bSizerOfficialRepo = new wxBoxSizer( wxHORIZONTAL ); m_bitmapRepo = new wxStaticBitmap( m_wizPage1, wxID_ANY, wxArtProvider::GetBitmap( wxART_INFORMATION, wxART_OTHER ), wxDefaultPosition, wxDefaultSize, 0 ); bSizerOfficialRepo->Add( m_bitmapRepo, 0, wxALL, 5 ); bSizerOfficialRepo->Add( 0, 0, 0, wxRIGHT|wxLEFT, 10 ); m_hyperlinkGithubKicad = new wxHyperlinkCtrl( m_wizPage1, wxID_ANY, _("Visit our official Kicad repository on Github and get more libraries"), wxT("https://github.com/KiCad"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); bSizerOfficialRepo->Add( m_hyperlinkGithubKicad, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); bSizer1->Add( bSizerOfficialRepo, 0, wxEXPAND, 5 ); m_wizPage1->SetSizer( bSizer1 ); m_wizPage1->Layout(); wxWizardPageSimple* m_wizPage2_Github = new wxWizardPageSimple( this, NULL, NULL, wxArtProvider::GetBitmap( wxART_HELP_BOOK, wxART_FRAME_ICON ) ); m_pages.Add( m_wizPage2_Github ); wxBoxSizer* bSizer111; bSizer111 = new wxBoxSizer( wxVERTICAL ); m_staticText112 = new wxStaticText( m_wizPage2_Github, wxID_ANY, _("Select Github libraries to add:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText112->Wrap( -1 ); bSizer111->Add( m_staticText112, 0, wxALL|wxEXPAND, 5 ); wxArrayString m_checkList3DlibnamesChoices; m_checkList3Dlibnames = new wxCheckListBox( m_wizPage2_Github, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_checkList3DlibnamesChoices, wxLB_MULTIPLE|wxLB_NEEDED_SB ); bSizer111->Add( m_checkList3Dlibnames, 1, wxALL|wxEXPAND, 5 ); wxBoxSizer* bSizer7; bSizer7 = new wxBoxSizer( wxHORIZONTAL ); m_btnSelectAll3Dlibs = new wxButton( m_wizPage2_Github, wxID_ANY, _("Select all"), wxDefaultPosition, wxDefaultSize, 0 ); bSizer7->Add( m_btnSelectAll3Dlibs, 1, wxALL, 5 ); m_btnUnselectAll3Dlibs = new wxButton( m_wizPage2_Github, wxID_ANY, _("Unselect all"), wxDefaultPosition, wxDefaultSize, 0 ); bSizer7->Add( m_btnUnselectAll3Dlibs, 1, wxALL, 5 ); bSizer7->Add( 0, 0, 1, wxEXPAND, 5 ); m_searchCtrl3Dlibs = new wxSearchCtrl( m_wizPage2_Github, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); #ifndef __WXMAC__ m_searchCtrl3Dlibs->ShowSearchButton( true ); #endif m_searchCtrl3Dlibs->ShowCancelButton( false ); bSizer7->Add( m_searchCtrl3Dlibs, 2, wxALL, 5 ); bSizer111->Add( bSizer7, 0, wxEXPAND, 5 ); m_wizPage2_Github->SetSizer( bSizer111 ); m_wizPage2_Github->Layout(); bSizer111->Fit( m_wizPage2_Github ); wxWizardPageSimple* m_wizPage3_SelectTarget = new wxWizardPageSimple( this, NULL, NULL, wxArtProvider::GetBitmap( wxART_HELP_BOOK, wxART_FRAME_ICON ) ); m_pages.Add( m_wizPage3_SelectTarget ); wxBoxSizer* bSizer12; bSizer12 = new wxBoxSizer( wxVERTICAL ); m_staticTextlocalfolder = new wxStaticText( m_wizPage3_SelectTarget, wxID_ANY, _("Local library folder:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextlocalfolder->Wrap( -1 ); bSizer12->Add( m_staticTextlocalfolder, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); m_LocalFolderInfo = new wxStaticText( m_wizPage3_SelectTarget, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); m_LocalFolderInfo->Wrap( -1 ); bSizer12->Add( m_LocalFolderInfo, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); m_staticText12 = new wxStaticText( m_wizPage3_SelectTarget, wxID_ANY, _("3D shape libraries to be downloaded:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText12->Wrap( -1 ); bSizer12->Add( m_staticText12, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); m_gridLibReview = new wxGrid( m_wizPage3_SelectTarget, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); // Grid m_gridLibReview->CreateGrid( 1, 2 ); m_gridLibReview->EnableEditing( false ); m_gridLibReview->EnableGridLines( true ); m_gridLibReview->EnableDragGridSize( false ); m_gridLibReview->SetMargins( 5, 0 ); // Columns m_gridLibReview->EnableDragColMove( false ); m_gridLibReview->EnableDragColSize( true ); m_gridLibReview->SetColLabelSize( 30 ); m_gridLibReview->SetColLabelValue( 0, _("Status") ); m_gridLibReview->SetColLabelValue( 1, _("Libraries") ); m_gridLibReview->SetColLabelValue( 2, wxEmptyString ); m_gridLibReview->SetColLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE ); // Rows m_gridLibReview->AutoSizeRows(); m_gridLibReview->EnableDragRowSize( true ); m_gridLibReview->SetRowLabelSize( 30 ); m_gridLibReview->SetRowLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE ); // Label Appearance // Cell Defaults m_gridLibReview->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP ); bSizer12->Add( m_gridLibReview, 1, wxALL|wxEXPAND, 5 ); m_wizPage3_SelectTarget->SetSizer( bSizer12 ); m_wizPage3_SelectTarget->Layout(); bSizer12->Fit( m_wizPage3_SelectTarget ); this->Centre( wxBOTH ); for ( unsigned int i = 1; i < m_pages.GetCount(); i++ ) { m_pages.Item( i )->SetPrev( m_pages.Item( i - 1 ) ); m_pages.Item( i - 1 )->SetNext( m_pages.Item( i ) ); } // Connect Events this->Connect( wxID_ANY, wxEVT_WIZARD_FINISHED, wxWizardEventHandler( WIZARD_3DSHAPE_LIBS_DOWNLOADER_BASE::OnWizardFinished ) ); this->Connect( wxID_ANY, wxEVT_WIZARD_PAGE_CHANGED, wxWizardEventHandler( WIZARD_3DSHAPE_LIBS_DOWNLOADER_BASE::OnPageChanged ) ); this->Connect( wxID_ANY, wxEVT_WIZARD_PAGE_CHANGING, wxWizardEventHandler( WIZARD_3DSHAPE_LIBS_DOWNLOADER_BASE::OnPageChanging ) ); m_downloadDir->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( WIZARD_3DSHAPE_LIBS_DOWNLOADER_BASE::OnLocalFolderChange ), NULL, this ); m_btnBrowse->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( WIZARD_3DSHAPE_LIBS_DOWNLOADER_BASE::OnBrowseButtonClick ), NULL, this ); m_buttonDefault3DPath->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( WIZARD_3DSHAPE_LIBS_DOWNLOADER_BASE::OnDefault3DPathButtonClick ), NULL, this ); m_btnSelectAll3Dlibs->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( WIZARD_3DSHAPE_LIBS_DOWNLOADER_BASE::OnSelectAll3Dlibs ), NULL, this ); m_btnUnselectAll3Dlibs->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( WIZARD_3DSHAPE_LIBS_DOWNLOADER_BASE::OnUnselectAll3Dlibs ), NULL, this ); m_searchCtrl3Dlibs->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( WIZARD_3DSHAPE_LIBS_DOWNLOADER_BASE::OnChangeSearch ), NULL, this ); m_gridLibReview->Connect( wxEVT_SIZE, wxSizeEventHandler( WIZARD_3DSHAPE_LIBS_DOWNLOADER_BASE::OnGridLibReviewSize ), NULL, this ); }
NewProjectWizardBase::NewProjectWizardBase(wxWindow* parent, wxWindowID id, const wxString& title, const wxBitmap& bmp, const wxPoint& pos, long style) { if ( !bBitmapLoaded ) { // We need to initialise the default bitmap handler wxXmlResource::Get()->AddHandler(new wxBitmapXmlHandler); wxC3F25InitBitmapResources(); bBitmapLoaded = true; } Create(parent, id, title, wxNullBitmap, pos, style); m_wizardPageTemplate = new wxWizardPageSimple(this, NULL, NULL, wxNullBitmap); m_pages.push_back(m_wizardPageTemplate); wxBoxSizer* boxSizer383 = new wxBoxSizer(wxVERTICAL); m_wizardPageTemplate->SetSizer(boxSizer383); m_banner386 = new wxBannerWindow(m_wizardPageTemplate, wxID_ANY, wxTOP, wxDefaultPosition, wxSize(-1,-1), 0); m_banner386->SetBitmap(wxNullBitmap); m_banner386->SetText(_("New Project"), _("Select the project template from the list below")); m_banner386->SetGradient(wxColour(wxT("rgb(0,128,0)")), wxColour(wxT("rgb(0,128,64)"))); m_banner386->SetForegroundColour(wxColour(wxT("rgb(255,255,255)"))); boxSizer383->Add(m_banner386, 0, wxALL|wxEXPAND, 2); m_dataviewTemplates = new wxDataViewCtrl(m_wizardPageTemplate, wxID_ANY, wxDefaultPosition, wxSize(500,300), wxDV_ROW_LINES|wxDV_SINGLE); m_dataviewTemplates->SetFocus(); m_dataviewTemplatesModel = new DVTemplatesModel; m_dataviewTemplatesModel->SetColCount( 1 ); m_dataviewTemplates->AssociateModel(m_dataviewTemplatesModel.get() ); boxSizer383->Add(m_dataviewTemplates, 1, wxALL|wxEXPAND, 2); m_dataviewTemplates->AppendIconTextColumn(_("Template"), m_dataviewTemplates->GetColumnCount(), wxDATAVIEW_CELL_INERT, 450, wxALIGN_LEFT); m_wizardPageDetails = new wxWizardPageSimple(this, NULL, NULL, wxNullBitmap); m_pages.push_back(m_wizardPageDetails); wxBoxSizer* boxSizer396 = new wxBoxSizer(wxVERTICAL); m_wizardPageDetails->SetSizer(boxSizer396); m_banner398 = new wxBannerWindow(m_wizardPageDetails, wxID_ANY, wxTOP, wxDefaultPosition, wxSize(-1,-1), 0); m_banner398->SetBitmap(wxNullBitmap); m_banner398->SetText(_("New Project"), _("Set the project path and name")); m_banner398->SetGradient(wxColour(wxT("rgb(0,128,0)")), wxColour(wxT("rgb(0,128,64)"))); m_banner398->SetForegroundColour(wxColour(wxT("rgb(255,255,255)"))); boxSizer396->Add(m_banner398, 0, wxALL|wxEXPAND, 2); wxFlexGridSizer* flexGridSizer15 = new wxFlexGridSizer(0, 2, 0, 0); flexGridSizer15->SetFlexibleDirection( wxBOTH ); flexGridSizer15->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); flexGridSizer15->AddGrowableCol(1); boxSizer396->Add(flexGridSizer15, 1, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND, 2); m_staticText16 = new wxStaticText(m_wizardPageDetails, wxID_ANY, _("Project name:"), wxDefaultPosition, wxSize(-1,-1), 0); flexGridSizer15->Add(m_staticText16, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5); m_txtProjName = new wxTextCtrl(m_wizardPageDetails, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(-1,-1), 0); m_txtProjName->SetToolTip(_("Set the project name. A project name can contains A-Z, 0-9 and _ characters only")); m_txtProjName->SetFocus(); #if wxVERSION_NUMBER >= 3000 m_txtProjName->SetHint(wxT("")); #endif flexGridSizer15->Add(m_txtProjName, 0, wxLEFT|wxTOP|wxBOTTOM|wxEXPAND, 5); m_staticText18 = new wxStaticText(m_wizardPageDetails, wxID_ANY, _("Project path:"), wxDefaultPosition, wxSize(-1,-1), 0); flexGridSizer15->Add(m_staticText18, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5); wxBoxSizer* boxSizer30 = new wxBoxSizer(wxHORIZONTAL); flexGridSizer15->Add(boxSizer30, 0, wxEXPAND, 5); m_textCtrlProjectPath = new wxTextCtrl(m_wizardPageDetails, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(-1,-1), 0); m_textCtrlProjectPath->SetToolTip(_("Select the location of the project. The location must exist.")); #if wxVERSION_NUMBER >= 3000 m_textCtrlProjectPath->SetHint(wxT("")); #endif boxSizer30->Add(m_textCtrlProjectPath, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); m_buttonBrowse = new wxButton(m_wizardPageDetails, wxID_ANY, _("Browse..."), wxDefaultPosition, wxSize(-1,-1), wxBU_EXACTFIT); m_buttonBrowse->SetToolTip(_("Browse for folder")); boxSizer30->Add(m_buttonBrowse, 0, wxTOP|wxBOTTOM|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); flexGridSizer15->Add(0, 0, 0, wxALL, 5); m_cbSeparateDir = new wxCheckBox(m_wizardPageDetails, wxID_ANY, _("Create the project under a separate directory"), wxDefaultPosition, wxSize(-1,-1), 0); m_cbSeparateDir->SetValue(false); m_cbSeparateDir->SetToolTip(_("When checked, codelite will place the project under a separate directory. The full path of the project file is displayed below")); flexGridSizer15->Add(m_cbSeparateDir, 0, wxALL|wxEXPAND, 5); m_stxtFullFileName = new wxStaticText(m_wizardPageDetails, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(-1,-1), 0); boxSizer396->Add(m_stxtFullFileName, 0, wxALL|wxEXPAND|wxALIGN_LEFT, 2); m_wizardPageToolchain = new wxWizardPageSimple(this, NULL, NULL, wxNullBitmap); m_pages.push_back(m_wizardPageToolchain); if (m_pages.size() > 1) { for(size_t i=1; i<m_pages.size(); i++) { wxWizardPageSimple::Chain(m_pages.at(i-1), m_pages.at(i)); } } GetPageAreaSizer()->Add(m_pages.at(0)); wxBoxSizer* boxSizer388 = new wxBoxSizer(wxVERTICAL); m_wizardPageToolchain->SetSizer(boxSizer388); m_banner390 = new wxBannerWindow(m_wizardPageToolchain, wxID_ANY, wxTOP, wxDefaultPosition, wxSize(-1,-1), 0); m_banner390->SetBitmap(wxNullBitmap); m_banner390->SetText(_("New Project"), _("Select the project toolchain")); m_banner390->SetGradient(wxColour(wxT("rgb(0,128,0)")), wxColour(wxT("rgb(0,128,64)"))); m_banner390->SetForegroundColour(wxColour(wxT("rgb(255,255,255)"))); boxSizer388->Add(m_banner390, 0, wxALL|wxEXPAND, 2); wxFlexGridSizer* flexGridSizer412 = new wxFlexGridSizer(0, 2, 0, 0); flexGridSizer412->SetFlexibleDirection( wxBOTH ); flexGridSizer412->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); flexGridSizer412->AddGrowableCol(1); boxSizer388->Add(flexGridSizer412, 1, wxALL|wxEXPAND, 5); m_staticText414 = new wxStaticText(m_wizardPageToolchain, wxID_ANY, _("Compiler:"), wxDefaultPosition, wxSize(-1,-1), 0); flexGridSizer412->Add(m_staticText414, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5); wxArrayString m_choiceCompilerArr; m_choiceCompiler = new wxChoice(m_wizardPageToolchain, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), m_choiceCompilerArr, 0); flexGridSizer412->Add(m_choiceCompiler, 0, wxALL|wxEXPAND|wxALIGN_CENTER_VERTICAL, 5); m_staticText418 = new wxStaticText(m_wizardPageToolchain, wxID_ANY, _("Debugger:"), wxDefaultPosition, wxSize(-1,-1), 0); flexGridSizer412->Add(m_staticText418, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5); wxArrayString m_choiceDebuggerArr; m_choiceDebugger = new wxChoice(m_wizardPageToolchain, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), m_choiceDebuggerArr, 0); flexGridSizer412->Add(m_choiceDebugger, 0, wxALL|wxEXPAND|wxALIGN_CENTER_VERTICAL, 5); SetSizeHints(500,400); if ( GetSizer() ) { GetSizer()->Fit(this); } Centre(wxBOTH); // Connect events this->Connect(wxEVT_WIZARD_PAGE_CHANGING, wxWizardEventHandler(NewProjectWizardBase::OnPageChanging), NULL, this); this->Connect(wxEVT_WIZARD_FINISHED, wxWizardEventHandler(NewProjectWizardBase::OnFinish), NULL, this); m_dataviewTemplates->Connect(wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED, wxDataViewEventHandler(NewProjectWizardBase::OnItemSelected), NULL, this); m_txtProjName->Connect(wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler(NewProjectWizardBase::OnProjectNameChanged), NULL, this); m_textCtrlProjectPath->Connect(wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler(NewProjectWizardBase::OnProjectPathUpdated), NULL, this); m_buttonBrowse->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(NewProjectWizardBase::OnBrowseProjectPath), NULL, this); m_cbSeparateDir->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(NewProjectWizardBase::OnProjectNameChanged), NULL, this); }
PluginWizardBase::PluginWizardBase(wxWindow* parent, wxWindowID id, const wxString& title, const wxBitmap& bmp, const wxPoint& pos, long style) { if ( !bBitmapLoaded ) { // We need to initialise the default bitmap handler wxXmlResource::Get()->AddHandler(new wxBitmapXmlHandler); wxC8028InitBitmapResources(); bBitmapLoaded = true; } Create(parent, id, title, wxXmlResource::Get()->LoadBitmap(wxT("plugin")), pos, style); m_wizardPage1 = new wxWizardPageSimple(this, NULL, NULL, wxNullBitmap); m_pages.push_back(m_wizardPage1); wxBoxSizer* boxSizer10 = new wxBoxSizer(wxVERTICAL); m_wizardPage1->SetSizer(boxSizer10); wxFlexGridSizer* flexGridSizer12 = new wxFlexGridSizer(0, 2, 0, 0); flexGridSizer12->SetFlexibleDirection( wxBOTH ); flexGridSizer12->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); flexGridSizer12->AddGrowableCol(1); boxSizer10->Add(flexGridSizer12, 1, wxALL|wxEXPAND, 5); m_staticText14 = new wxStaticText(m_wizardPage1, wxID_ANY, _("Plugin name:"), wxDefaultPosition, wxSize(-1,-1), 0); flexGridSizer12->Add(m_staticText14, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5); m_textCtrlName = new wxTextCtrl(m_wizardPage1, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(-1,-1), 0); m_textCtrlName->SetToolTip(_("Set the plugin name.\nThe name should be a valid C++ variable name")); m_textCtrlName->SetFocus(); #if wxVERSION_NUMBER >= 3000 m_textCtrlName->SetHint(wxT("")); #endif flexGridSizer12->Add(m_textCtrlName, 0, wxALL|wxEXPAND, 5); m_staticText18 = new wxStaticText(m_wizardPage1, wxID_ANY, _("Description:"), wxDefaultPosition, wxSize(-1,-1), 0); flexGridSizer12->Add(m_staticText18, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5); m_textCtrlDescription = new wxTextCtrl(m_wizardPage1, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(-1,-1), 0); m_textCtrlDescription->SetToolTip(_("Provide the plugin a short description")); #if wxVERSION_NUMBER >= 3000 m_textCtrlDescription->SetHint(wxT("")); #endif flexGridSizer12->Add(m_textCtrlDescription, 0, wxALL|wxEXPAND, 5); m_wizardPage2 = new wxWizardPageSimple(this, NULL, NULL, wxNullBitmap); m_pages.push_back(m_wizardPage2); if (m_pages.size() > 1) { for(size_t i=1; i<m_pages.size(); i++) { wxWizardPageSimple::Chain(m_pages.at(i-1), m_pages.at(i)); } } GetPageAreaSizer()->Add(m_pages.at(0)); wxBoxSizer* boxSizer22 = new wxBoxSizer(wxVERTICAL); m_wizardPage2->SetSizer(boxSizer22); wxFlexGridSizer* flexGridSizer24 = new wxFlexGridSizer(0, 2, 0, 0); flexGridSizer24->SetFlexibleDirection( wxBOTH ); flexGridSizer24->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); flexGridSizer24->AddGrowableCol(1); boxSizer22->Add(flexGridSizer24, 1, wxALL|wxEXPAND, 5); m_staticText42 = new wxStaticText(m_wizardPage2, wxID_ANY, _("codelite root dir:"), wxDefaultPosition, wxSize(-1,-1), 0); flexGridSizer24->Add(m_staticText42, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5); m_dirPickerCodeliteDir = new wxDirPickerCtrl(m_wizardPage2, wxID_ANY, wxEmptyString, _("Select a folder"), wxDefaultPosition, wxSize(-1,-1), wxDIRP_DEFAULT_STYLE|wxDIRP_USE_TEXTCTRL|wxDIRP_DIR_MUST_EXIST); m_dirPickerCodeliteDir->SetToolTip(_("Select the location of codelite's source tree")); flexGridSizer24->Add(m_dirPickerCodeliteDir, 0, wxALL|wxEXPAND, 5); m_staticText26 = new wxStaticText(m_wizardPage2, wxID_ANY, _("Project path:"), wxDefaultPosition, wxSize(-1,-1), 0); flexGridSizer24->Add(m_staticText26, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5); m_dirPickerPluginPath = new wxDirPickerCtrl(m_wizardPage2, wxID_ANY, wxEmptyString, _("Select a folder"), wxDefaultPosition, wxSize(350,-1), wxDIRP_DEFAULT_STYLE|wxDIRP_USE_TEXTCTRL|wxDIRP_DIR_MUST_EXIST); m_dirPickerPluginPath->SetToolTip(_("Select the plugin project path")); flexGridSizer24->Add(m_dirPickerPluginPath, 0, wxALL|wxEXPAND, 5); flexGridSizer24->Add(0, 0, 1, wxALL, 5); m_textCtrlPreview = new wxTextCtrl(m_wizardPage2, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(-1,-1), wxTE_READONLY); #if wxVERSION_NUMBER >= 3000 m_textCtrlPreview->SetHint(wxT("")); #endif flexGridSizer24->Add(m_textCtrlPreview, 0, wxALL|wxEXPAND, 5); SetName(wxT("PluginWizardBase")); SetSizeHints(-1,-1); if ( GetSizer() ) { GetSizer()->Fit(this); } CentreOnParent(wxBOTH); #if wxVERSION_NUMBER >= 2900 if(!wxPersistenceManager::Get().Find(this)) { wxPersistenceManager::Get().RegisterAndRestore(this); } else { wxPersistenceManager::Get().Restore(this); } #endif // Connect events this->Connect(wxEVT_WIZARD_PAGE_CHANGING, wxWizardEventHandler(PluginWizardBase::OnPageChanging), NULL, this); this->Connect(wxEVT_WIZARD_FINISHED, wxWizardEventHandler(PluginWizardBase::OnFinish), NULL, this); m_dirPickerPluginPath->Connect(wxEVT_COMMAND_DIRPICKER_CHANGED, wxFileDirPickerEventHandler(PluginWizardBase::OnProjectPathChanged), NULL, this); }
GitImportDialogProto::GitImportDialogProto( wxWindow* parent, wxWindowID id, const wxString& title, const wxBitmap& bitmap, const wxPoint& pos, long style ) { this->Create( parent, id, title, bitmap, pos, style ); this->SetSizeHints( wxSize( 500,350 ), wxDefaultSize ); wxWizardPageSimple* pathPage = new wxWizardPageSimple( this ); m_pages.Add( pathPage ); pathPage->SetMinSize( wxSize( 500,350 ) ); pathPage->SetMaxSize( wxSize( 500,350 ) ); wxFlexGridSizer* pathBaseSizer; pathBaseSizer = new wxFlexGridSizer( 4, 1, 0, 0 ); pathBaseSizer->AddGrowableCol( 0 ); pathBaseSizer->AddGrowableRow( 3 ); pathBaseSizer->SetFlexibleDirection( wxBOTH ); pathBaseSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); wxStaticText* cloneInfoText; cloneInfoText = new wxStaticText( pathPage, wxID_ANY, wxT("For clone operation, the following information is required."), wxDefaultPosition, wxDefaultSize, 0 ); cloneInfoText->Wrap( -1 ); pathBaseSizer->Add( cloneInfoText, 0, wxALL, 5 ); wxStaticBoxSizer* dsPathInfo; dsPathInfo = new wxStaticBoxSizer( new wxStaticBox( pathPage, wxID_ANY, wxT("Local Directory") ), wxHORIZONTAL ); localDir = new wxTextCtrl( pathPage, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); dsPathInfo->Add( localDir, 1, wxALL, 5 ); selectLocalDirButton = new wxButton( pathPage, wxID_ANY, wxT("Select ..."), wxDefaultPosition, wxDefaultSize, 0 ); dsPathInfo->Add( selectLocalDirButton, 0, wxALL, 5 ); pathBaseSizer->Add( dsPathInfo, 1, wxEXPAND, 5 ); wxStaticBoxSizer* usPathInfo; usPathInfo = new wxStaticBoxSizer( new wxStaticBox( pathPage, wxID_ANY, wxT("Remote Directory") ), wxHORIZONTAL ); remoteDir = new wxTextCtrl( pathPage, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); usPathInfo->Add( remoteDir, 1, wxALL, 5 ); selectRemoteDirButton = new wxButton( pathPage, wxID_ANY, wxT("Select ..."), wxDefaultPosition, wxDefaultSize, 0 ); usPathInfo->Add( selectRemoteDirButton, 0, wxALL, 5 ); pathBaseSizer->Add( usPathInfo, 1, wxEXPAND, 5 ); pathBaseSizer->Add( 0, 0, 1, wxEXPAND, 5 ); pathPage->SetSizer( pathBaseSizer ); pathPage->Layout(); pathBaseSizer->Fit( pathPage ); wxWizardPageSimple* importPage = new wxWizardPageSimple( this ); m_pages.Add( importPage ); wxFlexGridSizer* importPageSizer; importPageSizer = new wxFlexGridSizer( 3, 1, 0, 0 ); importPageSizer->AddGrowableCol( 0 ); importPageSizer->AddGrowableRow( 2 ); importPageSizer->SetFlexibleDirection( wxBOTH ); importPageSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); wxStaticText* cloneHelpText; cloneHelpText = new wxStaticText( importPage, wxID_ANY, wxT("Cloning repository, please wait ..."), wxDefaultPosition, wxDefaultSize, 0 ); cloneHelpText->Wrap( -1 ); importPageSizer->Add( cloneHelpText, 0, wxALL, 5 ); cloneProgress = new wxGauge( importPage, wxID_ANY, 100, wxDefaultPosition, wxSize( -1,25 ), wxGA_HORIZONTAL ); importPageSizer->Add( cloneProgress, 0, wxALL|wxEXPAND, 5 ); wxScrolledWindow* importScroller; importScroller = new wxScrolledWindow( importPage, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxSUNKEN_BORDER|wxVSCROLL ); importScroller->SetScrollRate( 5, 5 ); wxBoxSizer* importScrollerSizer; importScrollerSizer = new wxBoxSizer( wxVERTICAL ); importLog = new wxRichTextCtrl( importScroller, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0|wxVSCROLL|wxHSCROLL|wxNO_BORDER|wxWANTS_CHARS ); importScrollerSizer->Add( importLog, 1, wxEXPAND | wxALL, 0 ); importScroller->SetSizer( importScrollerSizer ); importScroller->Layout(); importScrollerSizer->Fit( importScroller ); importPageSizer->Add( importScroller, 1, wxEXPAND | wxALL, 5 ); importPage->SetSizer( importPageSizer ); importPage->Layout(); importPageSizer->Fit( importPage ); wxWizardPageSimple* projectPage = new wxWizardPageSimple( this ); m_pages.Add( projectPage ); wxFlexGridSizer* fgSizer6; fgSizer6 = new wxFlexGridSizer( 0, 2, 0, 0 ); fgSizer6->SetFlexibleDirection( wxBOTH ); fgSizer6->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); tempText = new wxStaticText( projectPage, wxID_ANY, wxT("On this page, we shouild check whether there already is a project file or not."), wxDefaultPosition, wxDefaultSize, 0 ); tempText->Wrap( -1 ); fgSizer6->Add( tempText, 0, wxALL, 5 ); projectPage->SetSizer( fgSizer6 ); projectPage->Layout(); fgSizer6->Fit( projectPage ); this->Centre( wxBOTH ); for ( unsigned int i = 1; i < m_pages.GetCount(); i++ ) { m_pages.Item( i )->SetPrev( m_pages.Item( i - 1 ) ); m_pages.Item( i - 1 )->SetNext( m_pages.Item( i ) ); } // Connect Events this->Connect( wxID_ANY, wxEVT_WIZARD_PAGE_CHANGED, wxWizardEventHandler( GitImportDialogProto::OnPageChanged ) ); localDir->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( GitImportDialogProto::OnLocalDirectoryChange ), NULL, this ); selectLocalDirButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( GitImportDialogProto::OnLocalDirClick ), NULL, this ); remoteDir->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( GitImportDialogProto::OnRemoteDirectoryChange ), NULL, this ); selectRemoteDirButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( GitImportDialogProto::OnRemoteDirClick ), NULL, this ); }