Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added check if there more than SEARCHSETTING_MAX settings, disable minus.
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Wed, 24 Feb 2016 17:14:30 +0000 (17:14 +0000)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Wed, 24 Feb 2016 17:14:30 +0000 (17:14 +0000)
source/search/frmSearch.cpp

index 56ae1ed..46d7d1e 100644 (file)
@@ -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<int, void*>::iterator siter = SearchFrames.begin();
+                       siter != SearchFrames.end(); siter++){
+                       
+                       XABSearchPanel *XABSPPtr = static_cast<XABSearchPanel*>(SearchFrames.begin()->second);
+                       XABSPPtr->EnableButtons(FALSE, TRUE);
+                               
+               }
+               return;
+               
+       }
+       
        // More than one control, so process them.
        
        for (std::map<int, void*>::iterator siter = SearchFrames.begin();
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy