void t_File::OnUknButton(int i) { switch (i) { case BTN_EDIT+0: case BTN_EDIT+1: case BTN_EDIT+2: case BTN_EDIT+3: EditSettings(i-BTN_EDIT); break; case BTN_LABEL+0: case BTN_LABEL+1: case BTN_LABEL+2: case BTN_LABEL+3: EditLabel(i-BTN_LABEL); break; default: myFile::OnUknButton(i); break; } }
void CVistaSettingsPage::OnOK() { EditSettings(); CSettingsPage::OnOK(); }
void CMasterSettingsPage::OnOK() { EditSettings(); CSettingsPage::OnOK(); }
// protocol service function for adding a new contact onto contact list // lParam = PROTOSEARCHRESULT INT_PTR WeatherAddToList(WPARAM wParam, LPARAM lParam) { PROTOSEARCHRESULT *psr = (PROTOSEARCHRESULT*)lParam; if(!psr || !psr->email) return 0; // search for existing contact for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { // check if it is a weather contact if ( IsMyContact(hContact)) { DBVARIANT dbv; // check ID to see if the contact already exist in the database if ( !db_get_ts(hContact, WEATHERPROTONAME, "ID", &dbv)) { if ( !_tcsicmp(psr->email, dbv.ptszVal)) { // remove the flag for not on list and hidden, thus make the contact visible // and add them on the list if (db_get_b(hContact, "CList", "NotOnList", 1)) { db_unset(hContact, "CList", "NotOnList"); db_unset(hContact, "CList", "Hidden"); } db_free(&dbv); // contact is added, function quitting return (INT_PTR)hContact; } db_free(&dbv); } } } // if contact with the same ID was not found, add it if (psr->cbSize < sizeof(PROTOSEARCHRESULT)) return 0; MCONTACT hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0); CallService(MS_PROTO_ADDTOCONTACT, hContact, (LPARAM)WEATHERPROTONAME); // suppress online notification for the new contact CallService(MS_IGNORE_IGNORE, hContact, IGNOREEVENT_USERONLINE); // set contact info and settings TCHAR svc[256]; _tcsncpy(svc, psr->email, SIZEOF(svc)); svc[SIZEOF(svc)-1] = 0; GetSvc(svc); // set settings by obtaining the default for the service if (psr->lastName[0] != 0) { WIDATA *sData = GetWIData(svc); db_set_ts(hContact, WEATHERPROTONAME, "MapURL", sData->DefaultMap); db_set_s(hContact, WEATHERPROTONAME, "InfoURL", sData->DefaultURL); } else { // if no valid service is found, create empty strings for MapURL and InfoURL db_set_s(hContact, WEATHERPROTONAME, "MapURL", ""); db_set_s(hContact, WEATHERPROTONAME, "InfoURL", ""); } // write the other info and settings to the database db_set_ts(hContact, WEATHERPROTONAME, "ID", psr->email); db_set_ts(hContact, WEATHERPROTONAME, "Nick", psr->nick); db_set_w(hContact, WEATHERPROTONAME, "Status", ID_STATUS_OFFLINE); AvatarDownloaded(hContact); TCHAR str[256]; mir_sntprintf(str, SIZEOF(str), TranslateT("Current weather information for %s."), psr->nick); db_set_ts(hContact, WEATHERPROTONAME, "About", str); // make the last update tags to something invalid db_set_s(hContact, WEATHERPROTONAME, "LastLog", "never"); db_set_s(hContact, WEATHERPROTONAME, "LastCondition", "None"); db_set_s(hContact, WEATHERPROTONAME, "LastTemperature", "None"); // ignore status change db_set_dw(hContact, "Ignore", "Mask", 8); // if no default station is found, set the new contact as default station if (opt.Default[0] == 0) { DBVARIANT dbv; GetStationID(hContact, opt.Default, SIZEOF(opt.Default)); opt.DefStn = hContact; if ( !db_get_ts(hContact, WEATHERPROTONAME, "Nick", &dbv)) { // notification message box mir_sntprintf(str, SIZEOF(str), TranslateT("%s is now the default weather station"), dbv.ptszVal); db_free(&dbv); MessageBox(NULL, str, TranslateT("Weather Protocol"), MB_OK|MB_ICONINFORMATION); } db_set_ts(NULL, WEATHERPROTONAME, "Default", opt.Default); } // display the Edit Settings dialog box EditSettings(hContact, 0); return (INT_PTR)hContact; }
void CBlockSettingsPage::OnOK() { EditSettings(); CSettingsPage::OnOK(); }
void CCentricSettingsPage::OnOK() { EditSettings(); CSettingsPage::OnOK(); }
void CPlaySettingsPage::OnOK() { EditSettings(); CSettingsPage::OnOK(); }
void CSubSmSettingsPage::OnOK() { EditSettings(); CSettingsPage::OnOK(); }
void CGeneralSettingsPage::OnOK() { EditSettings(); CSettingsPage::OnOK(); }