#include <thread>
+#define SEARCHSETTINGS_MAX 15
+
DEFINE_EVENT_TYPE(SE_ADDSEARCHSETTING);
DEFINE_EVENT_TYPE(SE_REMOVESEARCHSETTING);
DEFINE_EVENT_TYPE(SE_RELOADACCOUNTS);
SearchFrames.insert(std::make_pair(ScrollGen, NewPanel));
ScrollGen++;
- // Check if number of search settings is 15 (or over).
+ // Check if number of search settings is SEARCHSETTINGS_MAX (or over).
// If it is, disable the option of adding extra settings
// for all frames until one is removed.
XABSearchPanel *XABSPPtr;
- if (SearchFrames.size() >= 15){
+ if (SearchFrames.size() >= SEARCHSETTINGS_MAX){
for (std::map<int,void*>::iterator iter = SearchFrames.begin();
iter != SearchFrames.end(); ++iter){
//szrSearch->Fit(tabSearch);
- if (SearchFrames.size() < 15 && SearchFrames.size() > 1){
+ if (SearchFrames.size() < SEARCHSETTINGS_MAX && SearchFrames.size() > 1){
for (std::map<int,void*>::iterator iter = SearchFrames.begin();
iter != SearchFrames.end(); ++iter){
void frmSearch::DisableAllSearchSettings(bool Enable){
+ // Check if there is only one search value. If there is, only enable
+ // the add button.
+
+ if (SearchFrames.size() == 1){
+
+ XABSearchPanel *XABSPPtr = static_cast<XABSearchPanel*>(SearchFrames.begin()->second);
+ XABSPPtr->EnableButtons(TRUE, FALSE);
+ return;
+
+ }
+
+ // More than one control, so process them.
+
for (std::map<int, void*>::iterator siter = SearchFrames.begin();
siter != SearchFrames.end(); siter++){