frmSearchADT( parent )
{
+ // Setup the search window.
+
XABSearchPanel *InitPanel = new XABSearchPanel( tabSearch );
InitPanel->EnableButtons(TRUE, FALSE);
InitPanel->SetupPointers(this);
NewPanel->SetupPointers(this);
NewPanel->SetupInteger(ScrollGen);
szrSearch->Add(NewPanel, 1, wxEXPAND|wxGROW, 5);
- //szrSearch->Fit(tabSearch);
szrSearch->FitInside(tabSearch);
szrSearch->Layout();
szrSearch->RecalcSizes();
void frmSearch::RemoveSearchSetting( wxCommandEvent& event )
{
+ // Remove a search setting frame from the list.
+
// Get the integer from the event.
std::map<int,void*>::iterator iter;
iter = SearchFrames.find(event.GetInt());
- // Remove a search setting frame from the list.
-
XABSearchPanel *XABSPPtr;
XABSPPtr = static_cast<XABSearchPanel*>(iter->second);
delete XABSPPtr;
XABSPPtr = NULL;
- //szrSearch->Fit(tabSearch);
-
if (SearchFrames.size() < SEARCHSETTINGS_MAX && SearchFrames.size() > 1){
for (std::map<int,void*>::iterator iter = SearchFrames.begin();
}
void frmSearch::SearchBarUpdate( wxCommandEvent& event ){
-
+
+ // Update the status bar.
+
wxString *SBData = (wxString*)event.GetClientData();
stbBottom->SetStatusText(*SBData, 0);
void frmSearch::SearchFinished( wxCommandEvent& event ){
+ // Reset the search button and unlock the search
+ // panel buttons.
+
StopMode = FALSE;
btnSearch->SetLabel(_("Search"));
DisableAllSearchSettings(FALSE);
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){
}
+ // 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();
void frmSearch::CloseWindow( wxCommandEvent& event ){
+ // Close this window.
+
this->Close();
}
void frmSearch::SetUID(int UID){
+ // Set the UID of the search window.
+
SearchUID = UID;
}
void frmSearch::SetSearchMode(bool SearchModeIn){
+ // Set the search mode of the window.
+
SearchMode = SearchModeIn;
if (SearchMode == TRUE){