PCM: Make version grid only selectable by rows, not individual cells

And select the first row from the top by default.
This commit is contained in:
Mikolaj Wielgus 2021-11-13 04:10:37 +01:00 committed by Jeff Young
parent 00aa4f3393
commit 0e4e9206ff
1 changed files with 6 additions and 0 deletions

View File

@ -84,6 +84,9 @@ PANEL_PACKAGES_VIEW::PANEL_PACKAGES_VIEW( wxWindow*
false ) ); false ) );
} }
// Most likely should be changed to wxGridSelectNone once WxWidgets>=3.1.5 is mandatory.
m_gridVersions->SetSelectionMode( WX_GRID::wxGridSelectRows );
m_packageListWindow->SetBackgroundColour( wxStaticText::GetClassDefaultAttributes().colBg ); m_packageListWindow->SetBackgroundColour( wxStaticText::GetClassDefaultAttributes().colBg );
m_infoScrollWindow->SetBackgroundColour( wxStaticText::GetClassDefaultAttributes().colBg ); m_infoScrollWindow->SetBackgroundColour( wxStaticText::GetClassDefaultAttributes().colBg );
m_infoScrollWindow->EnableScrolling( false, true ); m_infoScrollWindow->EnableScrolling( false, true );
@ -314,6 +317,9 @@ void PANEL_PACKAGES_VIEW::setPackageDetails( const PACKAGE_VIEW_DATA& aPackageDa
false ) ); false ) );
} }
if( m_gridVersions->GetNumberRows() >= 1 )
m_gridVersions->SelectRow( 0 );
m_gridVersions->Thaw(); m_gridVersions->Thaw();
updateDetailsButtons(); updateDetailsButtons();