diff --git a/3d-viewer/3d_cache/3d_filename_resolver.cpp b/3d-viewer/3d_cache/3d_filename_resolver.cpp index 65a52580a7..8770a0fa60 100644 --- a/3d-viewer/3d_cache/3d_filename_resolver.cpp +++ b/3d-viewer/3d_cache/3d_filename_resolver.cpp @@ -109,7 +109,6 @@ bool S3D_FILENAME_RESOLVER::SetProjectDir( const wxString& aProjDir, bool* flgCh al.m_pathvar = "${KIPRJMOD}"; al.m_pathexp = m_curProjDir; m_Paths.push_back( al ); - m_NameMap.clear(); if( flgChanged ) *flgChanged = true; @@ -120,7 +119,6 @@ bool S3D_FILENAME_RESOLVER::SetProjectDir( const wxString& aProjDir, bool* flgCh if( m_Paths.front().m_pathexp.Cmp( m_curProjDir ) ) { m_Paths.front().m_pathexp = m_curProjDir; - m_NameMap.clear(); if( flgChanged ) *flgChanged = true; @@ -185,85 +183,35 @@ bool S3D_FILENAME_RESOLVER::createPathList( void ) m_Paths.push_back( lpath ); wxFileName fndummy; wxUniChar psep = fndummy.GetPathSeparator(); - bool hasKISYS3DMOD = false; + std::list< wxString > epaths; - // iterate over the list of internally defined ENV VARs - // and add existing paths to the resolver - if( m_pgm ) + if( GetKicadPaths( epaths ) ) { - ENV_VAR_MAP_CITER mS = m_pgm->GetLocalEnvVariables().begin(); - ENV_VAR_MAP_CITER mE = m_pgm->GetLocalEnvVariables().end(); - - while( mS != mE ) + for( auto i : epaths ) { - // filter out URLs, template directories, and known system paths - if( mS->first == wxString( "KICAD_PTEMPLATES" ) - || mS->first == wxString( "KIGITHUB" ) - || mS->first == wxString( "KISYSMOD" ) ) - { - ++mS; - continue; - } + wxString pathVal = ExpandEnvVarSubstitutions( i ); - if( wxString::npos != mS->second.GetValue().find( wxString( "://" ) ) ) + if( pathVal.empty() ) { - ++mS; - continue; + lpath.m_pathexp.clear(); } - - // ensure system ENV VARs supercede internally defined vars - wxString tmp( "${" ); - tmp.Append( mS->first ); - tmp.Append( "}" ); - wxString pathVal = ExpandEnvVarSubstitutions( tmp ); - - if( pathVal.empty() ) + else { - pathVal = mS->second.GetValue(); - - if( pathVal.StartsWith( "${" ) || pathVal.StartsWith( "$(" ) ) - pathVal = ExpandEnvVarSubstitutions( pathVal ); + fndummy.Assign( pathVal, "" ); + fndummy.Normalize(); + lpath.m_pathexp = fndummy.GetFullPath(); } - fndummy.Assign( pathVal, "" ); - fndummy.Normalize(); - - if( tmp == "${KISYS3DMOD}" ) - hasKISYS3DMOD = true; - - lpath.m_alias = tmp; - lpath.m_pathvar = tmp; - lpath.m_pathexp = fndummy.GetFullPath(); + lpath.m_alias = i; + lpath.m_pathvar = i; if( !lpath.m_pathexp.empty() && psep == *lpath.m_pathexp.rbegin() ) lpath.m_pathexp.erase( --lpath.m_pathexp.end() ); m_Paths.push_back( lpath ); - - ++mS; } } - // special case: if KISYSMOD is not internally defined but is defined by - // the system, then create an entry here - wxString envar = ExpandEnvVarSubstitutions( "${KISYS3DMOD}" ); - - if( !hasKISYS3DMOD && !envar.empty() ) - { - lpath.m_alias = "${KISYS3DMOD}"; - lpath.m_pathvar = "${KISYS3DMOD}"; - fndummy.Assign( envar, "" ); - fndummy.Normalize(); - lpath.m_pathexp = fndummy.GetFullPath(); - - if( !lpath.m_pathexp.empty() && psep == *lpath.m_pathexp.rbegin() ) - lpath.m_pathexp.erase( --lpath.m_pathexp.end() ); - - if( !lpath.m_pathexp.empty() ) - m_Paths.push_back( lpath ); - - } - if( !m_ConfigDir.empty() ) readPathList(); @@ -277,7 +225,8 @@ bool S3D_FILENAME_RESOLVER::createPathList( void ) while( sPL != ePL ) { - wxLogTrace( MASK_3D_RESOLVER, " + '%s'\n", (*sPL).m_pathexp.ToUTF8() ); + wxLogTrace( MASK_3D_RESOLVER, " + %s : '%s'\n", (*sPL).m_alias.ToUTF8(), + (*sPL).m_pathexp.ToUTF8() ); ++sPL; } #endif @@ -312,13 +261,6 @@ wxString S3D_FILENAME_RESOLVER::ResolvePath( const wxString& aFileName ) if( m_Paths.empty() ) createPathList(); - // look up the filename in the internal filename map - std::map< wxString, wxString, S3D::rsort_wxString >::iterator mi; - mi = m_NameMap.find( aFileName ); - - if( mi != m_NameMap.end() ) - return mi->second; - // first attempt to use the name as specified: wxString tname = aFileName; @@ -332,7 +274,7 @@ wxString S3D_FILENAME_RESOLVER::ResolvePath( const wxString& aFileName ) // wxFileName::Normalize() routine to perform expansion then // we will have a race condition since wxWidgets does not assure // a threadsafe wrapper for getenv(). - if( tname.StartsWith( wxT( "${" ) ) || tname.StartsWith( wxT( "$(" ) ) ) + if( tname.StartsWith( "${" ) || tname.StartsWith( "$(" ) ) tname = ExpandEnvVarSubstitutions( tname ); wxFileName tmpFN( tname ); @@ -356,10 +298,9 @@ wxString S3D_FILENAME_RESOLVER::ResolvePath( const wxString& aFileName ) { tmpFN.Normalize(); tname = tmpFN.GetFullPath(); - m_NameMap.insert( std::pair< wxString, wxString > ( aFileName, tname ) ); // special case: if a path begins with ${ENV_VAR} but is not in the - // resolver's path list then add it + // resolver's path list then add it. if( aFileName.StartsWith( "${" ) || aFileName.StartsWith( "$(" ) ) checkEnvVarPath( aFileName ); @@ -409,8 +350,6 @@ wxString S3D_FILENAME_RESOLVER::ResolvePath( const wxString& aFileName ) tmpFN.Assign( fullPath ); tmpFN.Normalize(); tname = tmpFN.GetFullPath(); - m_NameMap.insert( std::pair< wxString, wxString > ( aFileName, tname ) ); - return tname; } @@ -429,7 +368,6 @@ wxString S3D_FILENAME_RESOLVER::ResolvePath( const wxString& aFileName ) if( fpath.Normalize() && fpath.FileExists() ) { tname = fpath.GetFullPath(); - m_NameMap.insert( std::pair< wxString, wxString > ( aFileName, tname ) ); return tname; } @@ -477,7 +415,6 @@ wxString S3D_FILENAME_RESOLVER::ResolvePath( const wxString& aFileName ) if( tmp.Normalize() ) tname = tmp.GetFullPath(); - m_NameMap.insert( std::pair< wxString, wxString > ( aFileName, tname ) ); return tname; } } @@ -869,7 +806,26 @@ wxString S3D_FILENAME_RESOLVER::ShortenPath( const wxString& aFullPathName ) continue; } - wxFileName fpath( sL->m_pathexp, wxT( "" ) ); + wxFileName fpath; + + // in the case of aliases, ensure that we use the most recent definition + if( sL->m_alias.StartsWith( "${" ) || sL->m_alias.StartsWith( "$(" ) ) + { + wxString tpath = ExpandEnvVarSubstitutions( sL->m_alias ); + + if( tpath.empty() ) + { + ++sL; + continue; + } + + fpath.Assign( tpath, wxT( "" ) ); + } + else + { + fpath.Assign( sL->m_pathexp, wxT( "" ) ); + } + wxString fps = fpath.GetPathWithSep(); wxString tname; @@ -1100,3 +1056,53 @@ bool S3D_FILENAME_RESOLVER::ValidateFileName( const wxString& aFileName, bool& h return true; } + + +bool S3D_FILENAME_RESOLVER::GetKicadPaths( std::list< wxString >& paths ) +{ + paths.clear(); + + if( !m_pgm ) + return false; + + bool hasKisys3D = false; + + + // iterate over the list of internally defined ENV VARs + // and add them to the paths list + ENV_VAR_MAP_CITER mS = m_pgm->GetLocalEnvVariables().begin(); + ENV_VAR_MAP_CITER mE = m_pgm->GetLocalEnvVariables().end(); + + while( mS != mE ) + { + // filter out URLs, template directories, and known system paths + if( mS->first == wxString( "KICAD_PTEMPLATES" ) + || mS->first == wxString( "KIGITHUB" ) + || mS->first == wxString( "KISYSMOD" ) ) + { + ++mS; + continue; + } + + if( wxString::npos != mS->second.GetValue().find( wxString( "://" ) ) ) + { + ++mS; + continue; + } + + wxString tmp( "${" ); + tmp.Append( mS->first ); + tmp.Append( "}" ); + paths.push_back( tmp ); + + if( tmp == "${KISYS3DMOD}" ) + hasKisys3D = true; + + ++mS; + } + + if( !hasKisys3D ) + paths.push_back( "${KISYS3DMOD}" ); + + return true; +} diff --git a/3d-viewer/3d_cache/3d_filename_resolver.h b/3d-viewer/3d_cache/3d_filename_resolver.h index 14f1536c53..4c5e4a8769 100644 --- a/3d-viewer/3d_cache/3d_filename_resolver.h +++ b/3d-viewer/3d_cache/3d_filename_resolver.h @@ -54,8 +54,6 @@ class S3D_FILENAME_RESOLVER private: wxString m_ConfigDir; // 3D configuration directory std::list< S3D_ALIAS > m_Paths; // list of base paths to search from - // mapping of (short) file names to resolved names - std::map< wxString, wxString, S3D::rsort_wxString > m_NameMap; int m_errflags; PGM_BASE* m_pgm; wxString m_curProjDir; @@ -192,6 +190,14 @@ public: * If the path contains an alias then hasAlias is set true. */ bool ValidateFileName( const wxString& aFileName, bool& hasAlias ); + + /** + * Function GetKicadPaths + * returns a list of path environment variables local to Kicad; + * this list always includes KISYS3DMOD even if it is not + * defined locally. + */ + bool GetKicadPaths( std::list< wxString >& paths ); }; #endif // FILENAME_RESOLVER_3D_H diff --git a/3d-viewer/3d_cache/dialogs/dlg_3d_pathconfig.cpp b/3d-viewer/3d_cache/dialogs/dlg_3d_pathconfig.cpp index 0552281af3..3589520cdd 100644 --- a/3d-viewer/3d_cache/dialogs/dlg_3d_pathconfig.cpp +++ b/3d-viewer/3d_cache/dialogs/dlg_3d_pathconfig.cpp @@ -23,6 +23,8 @@ #include +#include +#include #include "3d_cache/dialogs/dlg_3d_pathconfig.h" #include "3d_cache/3d_filename_resolver.h" @@ -42,8 +44,16 @@ DLG_3D_PATH_CONFIG::DLG_3D_PATH_CONFIG( wxWindow* aParent, S3D_FILENAME_RESOLVER m_Aliases->SetColSize( 1, 300 ); m_Aliases->SetColSize( 2, 120 ); + m_EnvVars->SetColMinimalWidth( 0, 80 ); + m_EnvVars->SetColMinimalWidth( 1, 300 ); + m_EnvVars->SetColMinimalAcceptableWidth( 80 ); + m_EnvVars->SetColSize( 0, 80 ); + m_EnvVars->SetColSize( 1, 300 ); + if( m_resolver ) { + updateEnvVars(); + // prohibit these characters in the alias names: []{}()%~<>"='`;:.,&?/\|$ m_aliasValidator.SetStyle( wxFILTER_EXCLUDE_CHAR_LIST ); m_aliasValidator.SetCharExcludes( wxT( "{}[]()%~<>\"='`;:.,&?/\\|$" ) ); @@ -290,3 +300,73 @@ void DLG_3D_PATH_CONFIG::OnAliasMoveDown( wxCommandEvent& event ) event.Skip(); } + + +void DLG_3D_PATH_CONFIG::OnConfigEnvVar( wxCommandEvent& event ) +{ + Pgm().ConfigurePaths( this ); + updateEnvVars(); + event.Skip(); +} + + +void DLG_3D_PATH_CONFIG::updateEnvVars( void ) +{ + if( !m_resolver ) + return; + + std::list< wxString > epaths; + + m_resolver->GetKicadPaths( epaths ); + size_t nitems = epaths.size(); + size_t nrows = m_EnvVars->GetNumberRows(); + + if( nrows > nitems ) + { + size_t ni = nrows - nitems; + m_EnvVars->DeleteRows( 0, ni ); + } + else if( nrows < nitems ) + { + size_t ni = nitems - nrows; + m_EnvVars->InsertRows( 0, ni ); + } + + int j = 0; + + for( auto i : epaths ) + { + wxString val = ExpandEnvVarSubstitutions( i ); + m_EnvVars->SetCellValue( j, 0, i ); + m_EnvVars->SetCellValue( j, 1, val ); + m_EnvVars->SetReadOnly( j, 0, true ); + m_EnvVars->SetReadOnly( j, 1, true ); + wxGridCellAttr* ap = m_EnvVars->GetOrCreateCellAttr( j, 0 ); + ap->SetReadOnly( true ); + ap->SetBackgroundColour( *wxLIGHT_GREY ); + m_EnvVars->SetRowAttr( j, ap ); + ++j; + } + + m_EnvVars->AutoSize(); + + return; +} + + +void DLG_3D_PATH_CONFIG::OnHelp( wxCommandEvent& event ) +{ + wxString msg = _( "Enter the name and path for each 3D alias variable. KiCad " + "environment variables and their values are shown for " + "reference only and cannot be edited. " ); + msg << "

"; + msg << _( "Alias names may not contain any of the characters " ); + msg << "{}[]()%~<>\"='`;:.,&?/\\|$"; + msg << ""; + + HTML_MESSAGE_BOX dlg( GetParent(), _( "Environment Variable Help" ) ); + dlg.AddHTML_Text( msg ); + dlg.ShowModal(); + + event.Skip(); +} diff --git a/3d-viewer/3d_cache/dialogs/dlg_3d_pathconfig.h b/3d-viewer/3d_cache/dialogs/dlg_3d_pathconfig.h index 74e5491424..e4bfc0b03d 100644 --- a/3d-viewer/3d_cache/dialogs/dlg_3d_pathconfig.h +++ b/3d-viewer/3d_cache/dialogs/dlg_3d_pathconfig.h @@ -41,10 +41,15 @@ private: void OnDelAlias( wxCommandEvent& event ); void OnAliasMoveUp( wxCommandEvent& event ); void OnAliasMoveDown( wxCommandEvent& event ); + void OnConfigEnvVar( wxCommandEvent& event ); + void OnHelp( wxCommandEvent& event ); public: DLG_3D_PATH_CONFIG( wxWindow* aParent, S3D_FILENAME_RESOLVER* aResolver ); bool TransferDataFromWindow(); + +private: + void updateEnvVars( void ); }; #endif // DLG_3D_PATHCONFIG_H diff --git a/3d-viewer/3d_cache/dialogs/dlg_3d_pathconfig_base.cpp b/3d-viewer/3d_cache/dialogs/dlg_3d_pathconfig_base.cpp index 6c04ced794..0a86beca19 100644 --- a/3d-viewer/3d_cache/dialogs/dlg_3d_pathconfig_base.cpp +++ b/3d-viewer/3d_cache/dialogs/dlg_3d_pathconfig_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version May 21 2016) +// C++ code generated with wxFormBuilder (version Mar 2 2016) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -12,22 +12,56 @@ DLG_3D_PATH_CONFIG_BASE::DLG_3D_PATH_CONFIG_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style ) { this->SetSizeHints( wxSize( 600,150 ), wxDefaultSize ); - + wxBoxSizer* bSizerMain; bSizerMain = new wxBoxSizer( wxVERTICAL ); - + + wxBoxSizer* bSizer5; + bSizer5 = new wxBoxSizer( wxHORIZONTAL ); + + m_EnvVars = new wxGrid( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); + + // Grid + m_EnvVars->CreateGrid( 0, 2 ); + m_EnvVars->EnableEditing( true ); + m_EnvVars->EnableGridLines( true ); + m_EnvVars->EnableDragGridSize( false ); + m_EnvVars->SetMargins( 0, 0 ); + + // Columns + m_EnvVars->EnableDragColMove( false ); + m_EnvVars->EnableDragColSize( true ); + m_EnvVars->SetColLabelSize( 30 ); + m_EnvVars->SetColLabelValue( 0, _("Env Var") ); + m_EnvVars->SetColLabelValue( 1, _("Path") ); + m_EnvVars->SetColLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE ); + + // Rows + m_EnvVars->EnableDragRowSize( true ); + m_EnvVars->SetRowLabelSize( 80 ); + m_EnvVars->SetRowLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE ); + + // Label Appearance + + // Cell Defaults + m_EnvVars->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP ); + bSizer5->Add( m_EnvVars, 0, wxALL, 5 ); + + + bSizerMain->Add( bSizer5, 1, wxEXPAND, 5 ); + wxBoxSizer* bSizerGrid; bSizerGrid = new wxBoxSizer( wxHORIZONTAL ); - + m_Aliases = new wxGrid( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); - + // Grid m_Aliases->CreateGrid( 1, 3 ); m_Aliases->EnableEditing( true ); m_Aliases->EnableGridLines( true ); m_Aliases->EnableDragGridSize( false ); m_Aliases->SetMargins( 0, 0 ); - + // Columns m_Aliases->SetColSize( 0, 80 ); m_Aliases->SetColSize( 1, 300 ); @@ -39,60 +73,70 @@ DLG_3D_PATH_CONFIG_BASE::DLG_3D_PATH_CONFIG_BASE( wxWindow* parent, wxWindowID i m_Aliases->SetColLabelValue( 1, _("Path") ); m_Aliases->SetColLabelValue( 2, _("Description") ); m_Aliases->SetColLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE ); - + // Rows m_Aliases->AutoSizeRows(); m_Aliases->EnableDragRowSize( false ); m_Aliases->SetRowLabelSize( 80 ); m_Aliases->SetRowLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE ); - + // Label Appearance - + // Cell Defaults m_Aliases->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP ); bSizerGrid->Add( m_Aliases, 1, wxALL|wxEXPAND, 5 ); - - + + bSizerMain->Add( bSizerGrid, 1, wxEXPAND, 5 ); - + m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); bSizerMain->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 ); - + wxBoxSizer* bSizerButtons; bSizerButtons = new wxBoxSizer( wxHORIZONTAL ); - + m_btnAddAlias = new wxButton( this, wxID_ANY, _("Add Alias"), wxDefaultPosition, wxDefaultSize, 0 ); bSizerButtons->Add( m_btnAddAlias, 0, wxALL, 5 ); - + m_btnDelAlias = new wxButton( this, wxID_ANY, _("Remove Alias"), wxDefaultPosition, wxDefaultSize, 0 ); bSizerButtons->Add( m_btnDelAlias, 0, wxALL, 5 ); - + m_btnMoveUp = new wxButton( this, wxID_ANY, _("Move Up"), wxDefaultPosition, wxDefaultSize, 0 ); bSizerButtons->Add( m_btnMoveUp, 0, wxALL, 5 ); - + m_btnMoveDown = new wxButton( this, wxID_ANY, _("Move Down"), wxDefaultPosition, wxDefaultSize, 0 ); bSizerButtons->Add( m_btnMoveDown, 0, wxALL, 5 ); - - m_btnOK = new wxButton( this, wxID_OK, _("OK"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizerButtons->Add( m_btnOK, 0, wxALL, 5 ); - - m_btnCancel = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizerButtons->Add( m_btnCancel, 0, wxALL, 5 ); - - - bSizerMain->Add( bSizerButtons, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT, 5 ); - - + + m_btnEnvCfg = new wxButton( this, wxID_ANY, _("Config Env"), wxDefaultPosition, wxDefaultSize, 0 ); + bSizerButtons->Add( m_btnEnvCfg, 0, wxALL, 5 ); + + + bSizerMain->Add( bSizerButtons, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_sdbSizer2 = new wxStdDialogButtonSizer(); + m_sdbSizer2OK = new wxButton( this, wxID_OK ); + m_sdbSizer2->AddButton( m_sdbSizer2OK ); + m_sdbSizer2Cancel = new wxButton( this, wxID_CANCEL ); + m_sdbSizer2->AddButton( m_sdbSizer2Cancel ); + m_sdbSizer2Help = new wxButton( this, wxID_HELP ); + m_sdbSizer2->AddButton( m_sdbSizer2Help ); + m_sdbSizer2->Realize(); + + bSizerMain->Add( m_sdbSizer2, 1, wxALIGN_CENTER, 5 ); + + this->SetSizer( bSizerMain ); this->Layout(); - + this->Centre( wxBOTH ); - + // Connect Events m_btnAddAlias->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DLG_3D_PATH_CONFIG_BASE::OnAddAlias ), NULL, this ); m_btnDelAlias->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DLG_3D_PATH_CONFIG_BASE::OnDelAlias ), NULL, this ); m_btnMoveUp->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DLG_3D_PATH_CONFIG_BASE::OnAliasMoveUp ), NULL, this ); m_btnMoveDown->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DLG_3D_PATH_CONFIG_BASE::OnAliasMoveDown ), NULL, this ); + m_btnEnvCfg->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DLG_3D_PATH_CONFIG_BASE::OnConfigEnvVar ), NULL, this ); + m_sdbSizer2Help->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DLG_3D_PATH_CONFIG_BASE::OnHelp ), NULL, this ); } DLG_3D_PATH_CONFIG_BASE::~DLG_3D_PATH_CONFIG_BASE() @@ -102,5 +146,7 @@ DLG_3D_PATH_CONFIG_BASE::~DLG_3D_PATH_CONFIG_BASE() m_btnDelAlias->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DLG_3D_PATH_CONFIG_BASE::OnDelAlias ), NULL, this ); m_btnMoveUp->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DLG_3D_PATH_CONFIG_BASE::OnAliasMoveUp ), NULL, this ); m_btnMoveDown->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DLG_3D_PATH_CONFIG_BASE::OnAliasMoveDown ), NULL, this ); - + m_btnEnvCfg->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DLG_3D_PATH_CONFIG_BASE::OnConfigEnvVar ), NULL, this ); + m_sdbSizer2Help->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DLG_3D_PATH_CONFIG_BASE::OnHelp ), NULL, this ); + } diff --git a/3d-viewer/3d_cache/dialogs/dlg_3d_pathconfig_base.fbp b/3d-viewer/3d_cache/dialogs/dlg_3d_pathconfig_base.fbp index 9fd693090e..7f9800ea54 100644 --- a/3d-viewer/3d_cache/dialogs/dlg_3d_pathconfig_base.fbp +++ b/3d-viewer/3d_cache/dialogs/dlg_3d_pathconfig_base.fbp @@ -44,7 +44,7 @@ 600,150 DLG_3D_PATH_CONFIG_BASE - 619,160 + 619,319 wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER DIALOG_SHIM; dialog_shim.h 3D Search Path Configuration @@ -93,6 +93,160 @@ bSizerMain wxVERTICAL none + + 5 + wxEXPAND + 1 + + + bSizer5 + wxHORIZONTAL + none + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + 0 + 0 + + + + 1 + + + wxALIGN_LEFT + + wxALIGN_TOP + 0 + 1 + wxALIGN_CENTRE + 30 + "Env Var" "Path" + wxALIGN_CENTRE + 2 + + + 1 + 0 + Dock + 0 + Left + 0 + 1 + 0 + 1 + 1 + 1 + + 1 + + + 1 + 0 + 0 + wxID_ANY + + + + 0 + 0 + + 0 + + + 0 + + 1 + m_EnvVars + 1 + + + protected + 1 + + Resizable + wxALIGN_CENTRE + 80 + + wxALIGN_CENTRE + + 0 + 1 + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 wxEXPAND @@ -330,7 +484,7 @@ 5 - wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT + wxALIGN_CENTER_HORIZONTAL 0 @@ -721,96 +875,8 @@ 0 0 - wxID_OK - OK - - 0 - - - 0 - - 1 - m_btnOK - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_CANCEL - Cancel + wxID_ANY + Config Env 0 @@ -818,7 +884,7 @@ 0 1 - m_btnCancel + m_btnEnvCfg 1 @@ -839,7 +905,7 @@ - + OnConfigEnvVar @@ -867,6 +933,32 @@ + + 5 + wxALIGN_CENTER + 1 + + 0 + 1 + 0 + 1 + 0 + 1 + 0 + 0 + + m_sdbSizer2 + protected + + + + OnHelp + + + + + + diff --git a/3d-viewer/3d_cache/dialogs/dlg_3d_pathconfig_base.h b/3d-viewer/3d_cache/dialogs/dlg_3d_pathconfig_base.h index f624801c87..71ded5ffed 100644 --- a/3d-viewer/3d_cache/dialogs/dlg_3d_pathconfig_base.h +++ b/3d-viewer/3d_cache/dialogs/dlg_3d_pathconfig_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version May 21 2016) +// C++ code generated with wxFormBuilder (version Mar 2 2016) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -36,25 +36,31 @@ class DLG_3D_PATH_CONFIG_BASE : public DIALOG_SHIM private: protected: + wxGrid* m_EnvVars; wxGrid* m_Aliases; wxStaticLine* m_staticline1; wxButton* m_btnAddAlias; wxButton* m_btnDelAlias; wxButton* m_btnMoveUp; wxButton* m_btnMoveDown; - wxButton* m_btnOK; - wxButton* m_btnCancel; + wxButton* m_btnEnvCfg; + wxStdDialogButtonSizer* m_sdbSizer2; + wxButton* m_sdbSizer2OK; + wxButton* m_sdbSizer2Cancel; + wxButton* m_sdbSizer2Help; // Virtual event handlers, overide them in your derived class virtual void OnAddAlias( wxCommandEvent& event ) { event.Skip(); } virtual void OnDelAlias( wxCommandEvent& event ) { event.Skip(); } virtual void OnAliasMoveUp( wxCommandEvent& event ) { event.Skip(); } virtual void OnAliasMoveDown( wxCommandEvent& event ) { event.Skip(); } + virtual void OnConfigEnvVar( wxCommandEvent& event ) { event.Skip(); } + virtual void OnHelp( wxCommandEvent& event ) { event.Skip(); } public: - DLG_3D_PATH_CONFIG_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("3D Search Path Configuration"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 619,160 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + DLG_3D_PATH_CONFIG_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("3D Search Path Configuration"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 619,319 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); ~DLG_3D_PATH_CONFIG_BASE(); };