static void OnSelChange_Combo(HWND hWnd) { // Store the previously used LibraryID int prevLibID = s_curLibrary->GetLibraryID(); // Get current LibraryID from the selected item int item = (int) SendDlgItemMessage(hWnd, IDC_NAME, CB_GETCURSEL, 0, 0L); s_curLibrary = (Library*) SendDlgItemMessage(hWnd, IDC_NAME, CB_GETITEMDATA, (WPARAM) item, 0); // Did the library ID really change? if (prevLibID == s_curLibrary->GetLibraryID()) return; // Open the database g_db->Open(); // Update the database char szSQL[MAX_PATH]; _snprintf(szSQL, MAX_PATH, "DELETE FROM LangLastUsed WHERE Lang = %d; INSERT INTO LangLastUsed(Lang,LibraryID) VALUES(%d,%d);", s_curLang, s_curLang, s_curLibrary->GetLibraryID()); g_db->Execute(szSQL); // Update the list with snippets ClearListItems(); AddListItems(); g_db->Close(); }
static void OnClose(HWND hWnd) { ClearComboItems(); ClearListItems(); if (s_hTabIcon != NULL) { DestroyIcon(s_hTabIcon); s_hTabIcon = NULL; } EndDialog(hWnd, 0); }
void UpdateSnippetsList() { if (!s_bConsoleVisible) return; WaitCursor wait; ClearComboItems(); ClearListItems(); g_db->Open(); AddComboItems(); AddListItems(); g_db->Close(); }
bool GUIDialogBase::Open() { // Load the Window as Dialog m_window = GUI->Window_create(m_xmlFileName.c_str(), m_defaultSkin.c_str(), false, true); m_window->m_cbhdl = this; m_window->CBOnInit = OnInitCB; m_window->CBOnFocus = OnFocusCB; m_window->CBOnClick = OnClickCB; m_window->CBOnAction= OnActionCB; m_window->DoModal(); m_window->ClearList(); m_window->ClearProperties(); ClearListItems(); GUI->Window_destroy(m_window); return true; }