From: Steve Brokenshire Date: Wed, 24 Feb 2016 17:14:30 +0000 (+0000) Subject: Added check if there more than SEARCHSETTING_MAX settings, disable minus. X-Git-Tag: release-0.09~6 X-Git-Url: http://Server1/repobrowser/?p=xestiaab%2F.git;a=commitdiff_plain;h=7d39a3bc455be1d64f151727fbb6a2a55f9ac8bb Added check if there more than SEARCHSETTING_MAX settings, disable minus. --- diff --git a/source/search/frmSearch.cpp b/source/search/frmSearch.cpp index 56ae1ed..46d7d1e 100644 --- a/source/search/frmSearch.cpp +++ b/source/search/frmSearch.cpp @@ -382,7 +382,7 @@ void frmSearch::SearchFinished( wxCommandEvent& event ){ void frmSearch::DisableAllSearchSettings(bool Enable){ // Check if there is only one search value. If there is, only enable - // the add button. + // the add button if this is the case. if (SearchFrames.size() == 1){ @@ -392,6 +392,22 @@ void frmSearch::DisableAllSearchSettings(bool Enable){ } + // Check if there is SEARCHSETTINGS_MAX controls set or more, only + // enable the remove button if this is the case. + + if (SearchFrames.size() >= SEARCHSETTINGS_MAX){ + + for (std::map::iterator siter = SearchFrames.begin(); + siter != SearchFrames.end(); siter++){ + + XABSearchPanel *XABSPPtr = static_cast(SearchFrames.begin()->second); + XABSPPtr->EnableButtons(FALSE, TRUE); + + } + return; + + } + // More than one control, so process them. for (std::map::iterator siter = SearchFrames.begin();