//---------------------------------------------------------------------------------------------- // wmInitDialog //---------------------------------------------------------------------------------------------- VOID CStickPage::wmInitDialog( HWND Wnd ) { // ウィンドウ ハンドル this->Wnd = Wnd; // スティックのファンクション WORD StickFunction[] = { IDS_NONE ,IDS_X_AXIS_Y_AXIS ,IDS_X_AXIS_NONE ,IDS_NONE_X_AXIS ,IDS_Y_AXIS_X_AXIS ,IDS_Y_AXIS_NONE ,IDS_NONE_Y_AXIS ,IDS_X_ROTATION_Y_ROTATION ,IDS_X_ROTATION_NONE ,IDS_NONE_X_ROTATION ,IDS_Y_ROTATION_X_ROTATION ,IDS_Y_ROTATION_NONE ,IDS_NONE_Y_ROTATION ,IDS_Z_AXIS_ROTATION ,IDS_Z_AXIS_SLIDER1 ,IDS_Z_AXIS_SLIDER2 ,IDS_Z_AXIS_NONE ,IDS_NONE_Z_AXIS ,IDS_Z_ROTATION_AXIS ,IDS_Z_ROTATION_SLIDER1 ,IDS_Z_ROTATION_SLIDER2 ,IDS_Z_ROTATION_NONE ,IDS_NONE_Z_ROTATION ,IDS_SLIDER1_Z_AXIS ,IDS_SLIDER1_Z_ROTATION ,IDS_SLIDER1_SLIDER2 ,IDS_SLIDER1_NONE ,IDS_NONE_SLIDER1 ,IDS_SLIDER2_Z_AXIS ,IDS_SLIDER2_Z_ROTATION ,IDS_SLIDER2_SLIDER1 ,IDS_SLIDER2_NONE ,IDS_NONE_SLIDER2 ,IDS_HAT_SWITCH1 ,IDS_HAT_SWITCH2 ,IDS_HAT_SWITCH3 ,IDS_HAT_SWITCH4 }; WORD StickFunctionCount = sizeof( StickFunction ) / sizeof( WORD ) ; // 「スティックの機能(左)」 InitComboBox( IDC_LEFT_STICK_USAGE, StickFunction, StickFunctionCount ); // 「スティックの機能(右)」 InitComboBox( IDC_RIGHT_STICK_USAGE, StickFunction, StickFunctionCount ); // 「有効範囲」 InitTrackBar( IDC_STICK_THRESHOLD, 0, 100, 10, 10 ); // 「スティックの入力閾値」 InitTrackBar( IDC_STICK_HAT_SWITCH_THRESHOLD, 0, 100, 10, 10 ); }
INT_PTR CALLBACK TlenAdvSearchDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) { switch(msg) { case WM_INITDIALOG: TranslateDialogDefault(hwndDlg); InitComboBox(GetDlgItem(hwndDlg, IDC_GENDER), tlenFieldGender); InitComboBox(GetDlgItem(hwndDlg, IDC_LOOKFOR), tlenFieldLookfor); InitComboBox(GetDlgItem(hwndDlg, IDC_STATUS), tlenFieldStatus); InitComboBox(GetDlgItem(hwndDlg, IDC_OCCUPATION), tlenFieldOccupation); InitComboBox(GetDlgItem(hwndDlg, IDC_PLAN), tlenFieldPlan); return TRUE; } return FALSE; }
BOOL CDlgTBTSameRunway::OnInitDialog() { CPropertyPage::OnInitDialog(); m_pClsNone->ReadData(); m_pClsWakeVortexWightBased->ReadData(); m_pClsWingspanBased->ReadData(); m_pClsSurfaceBearingWeightBased->ReadData(); m_pClsApproachSpeedBased->ReadData(); InitListCtrl(); InitComboBox(); InitEditBox(); ((CSpinButtonCtrl *)GetDlgItem(IDC_SPIN1))->SetRange(0,1000); ((CSpinButtonCtrl *)GetDlgItem(IDC_SPIN2))->SetRange(0,1000); ((CSpinButtonCtrl *)GetDlgItem(IDC_SPIN3))->SetRange(0,1000); ((CSpinButtonCtrl *)GetDlgItem(IDC_SPIN4))->SetRange(0,1000); ((CSpinButtonCtrl *)GetDlgItem(IDC_SPIN5))->SetRange(0,1000); ResetListCtrl(); return TRUE; }
RepCompetitionBased::RepCompetitionBased(QWidget *aParent, BaseReport *report, const QString &title): Report(aParent, report, title) { CreateWidgets(); InitComboBox(cbCompetition, vecId, "select id, strftime('%d.%m.%Y',date) || ' ' || name from competitions; ", 0); btnExport->setEnabled(!!cbCompetition->count()); }
void RepSert::ChangeTbl(int aIndex) { if (!aIndex) { InitComboBox(cb, vecId, "SELECT * FROM coaches", 0); btnClub->setVisible(false); btnCoach->setVisible(true); } else { InitComboBox(cb, vecId, "SELECT * FROM clubs", 0); btnClub->setVisible(true); btnCoach->setVisible(false); } lbl->setText(cbTbl->currentText() + ":"); }
INT_PTR CALLBACK AdvancedSearchDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam) { switch(message) { case WM_INITDIALOG: TranslateDialogDefault(hwndDlg); InitComboBox(GetDlgItem(hwndDlg, IDC_GENDER), genderField); InitComboBox(GetDlgItem(hwndDlg, IDC_AGERANGE), agesField); InitComboBox(GetDlgItem(hwndDlg, IDC_MARITALSTATUS), maritalField); InitComboBox(GetDlgItem(hwndDlg, IDC_WORKFIELD), occupationField); InitComboBox(GetDlgItem(hwndDlg, IDC_ORGANISATION), affiliationField); InitComboBox(GetDlgItem(hwndDlg, IDC_LANGUAGE), languageField); InitComboBox(GetDlgItem(hwndDlg, IDC_COUNTRY), countryField); InitComboBox(GetDlgItem(hwndDlg, IDC_INTERESTSCAT), interestsField); InitComboBox(GetDlgItem(hwndDlg, IDC_PASTCAT), pastField); return TRUE; } return FALSE; }
BOOL CNewFilterGroupDlg::OnInitDialog() { CDialog::OnInitDialog(); SetWindowText(m_szTitle); InitGUI(); m_pLangRuleDlg->AddMsgReceiver(m_hWnd); InitComboBox(); InitData(); return TRUE; }
void ReshapeDialog::OnInitDialog(wxInitDialogEvent &e) { wxDialog::OnInitDialog(e); wxSizer* sizer = ReshapeDlg(this, true, true); /// 获取各控件的引用 mCmbTexture = wxDynamicCast(this->FindWindow(ID_TEXTURENAME), wxComboBox); mLeftCtrl = wxDynamicCast(this->FindWindow(ID_LEFTVALUE),wxTextCtrl); mTopCtrl = wxDynamicCast(this->FindWindow(ID_TOPVALUE),wxTextCtrl); mRightCtrl = wxDynamicCast(this->FindWindow(ID_RIGHTVALUE ),wxTextCtrl); mBottomCtrl = wxDynamicCast(this->FindWindow(ID_BOTTOMVALUE),wxTextCtrl); InitComboBox(); }
void Widget::SetUI() { bDrag=false; setupUi(this); setWindowFlags (Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint); this->move( (QApplication::desktop()->width()-this->width())/2 , (QApplication::desktop()->height()-this->height())/2 ); m_Calendar->setMinimumDate(QDate(BEGIN_YEAR,1,1)); m_Calendar->setMaximumDate(QDate(END_YEAR,12,31)); m_Calendar->setVerticalHeaderFormat(QCalendarWidget::NoVerticalHeader); m_Today = m_Calendar->selectedDate().currentDate(); SetUpContextMenu(); QTextCharFormat format; format.setBackground(Qt::yellow); m_Calendar->setDateTextFormat(m_Today,format); InitComboBox(); m_timer = new QTimer(this); m_timer->start(1000); }
void CPage1::OnMouseUpDatagridAColor(short Button, short Shift, long X, long Y) { m_conComboBox.ShowWindow(SW_HIDE); CRect dbRc, //DataGrid的坐标。 comRc, //ComBox 在对话框里的坐标 dlgRc; //格式对话框在屏幕上的坐标 m_lastCol=m_a_colorGrid.GetCol(); POINT m_point; HWND m_hWnd; ::GetCursorPos(&m_point); //获得光标在屏幕上的坐标。 m_hWnd = ::WindowFromPoint(m_point); //得到该坐标所在的窗口的名柄。 ::GetWindowRect(m_hWnd, &comRc); this->ScreenToClient(&comRc); // comRc.bottom += 100; CString str; str=m_a_colorGrid.GetColumns().GetItem((_variant_t)m_lastCol).GetDataField(); //10/26 _variant_t key; CString str1; short indexCombo; //10/26 if( (m_hWnd != m_a_colorGrid.m_hWnd)&&(str=="COLR_FACE"||str=="COLR_RING"||str=="COLR_ARROW") ) { m_conComboBox.MoveWindow(&comRc); m_conComboBox.SetFocus(); m_conComboBox.ShowWindow(SW_SHOW); InitComboBox(); key=m_a_colorSet->GetCollect(_variant_t(m_lastCol)); str1=(key.vt==VT_NULL||key.vt==VT_EMPTY)?"N":(CString)key.bstrVal; indexCombo=m_conComboBox.FindString(0,str1); m_conComboBox.SetCurSel(indexCombo); } }
static BOOL CALLBACK TlenUserInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) { switch (msg) { case WM_INITDIALOG: // lParam is hContact TranslateDialogDefault(hwndDlg); SetWindowLong(hwndDlg, GWL_USERDATA, (LONG)(HANDLE) lParam); InitComboBox(GetDlgItem(hwndDlg, IDC_GENDER), tlenFieldGender); InitComboBox(GetDlgItem(hwndDlg, IDC_OCCUPATION), tlenFieldOccupation); InitComboBox(GetDlgItem(hwndDlg, IDC_LOOKFOR), tlenFieldLookfor); SendMessage(hwndDlg, WM_JABBER_REFRESH, 0, 0); return TRUE; case WM_JABBER_REFRESH: { DBVARIANT dbv; HANDLE hContact; char *jid; int i; JABBER_LIST_ITEM *item; JabberLog("refresh"); SetDlgItemText(hwndDlg, IDC_INFO_JID, ""); SetDlgItemText(hwndDlg, IDC_SUBSCRIPTION, ""); SetFocus(GetDlgItem(hwndDlg, IDC_STATIC)); hContact = (HANDLE) GetWindowLong(hwndDlg, GWL_USERDATA); if (!DBGetContactSetting(hContact, jabberProtoName, "FirstName", &dbv)) { SetDlgItemText(hwndDlg, IDC_FIRSTNAME, dbv.pszVal); DBFreeVariant(&dbv); } else SetDlgItemText(hwndDlg, IDC_FIRSTNAME, ""); if (!DBGetContactSetting(hContact, jabberProtoName, "LastName", &dbv)) { SetDlgItemText(hwndDlg, IDC_LASTNAME, dbv.pszVal); DBFreeVariant(&dbv); } else SetDlgItemText(hwndDlg, IDC_LASTNAME, ""); if (!DBGetContactSetting(hContact, jabberProtoName, "Nick", &dbv)) { SetDlgItemText(hwndDlg, IDC_NICKNAME, dbv.pszVal); DBFreeVariant(&dbv); } else SetDlgItemText(hwndDlg, IDC_NICKNAME, ""); if (!DBGetContactSetting(hContact, jabberProtoName, "e-mail", &dbv)) { SetDlgItemText(hwndDlg, IDC_EMAIL, dbv.pszVal); DBFreeVariant(&dbv); } else SetDlgItemText(hwndDlg, IDC_EMAIL, ""); if (!DBGetContactSetting(hContact, jabberProtoName, "Age", &dbv)) { SetDlgItemInt(hwndDlg, IDC_AGE, dbv.wVal, FALSE); DBFreeVariant(&dbv); } else SetDlgItemText(hwndDlg, IDC_AGE, ""); if (!DBGetContactSetting(hContact, jabberProtoName, "City", &dbv)) { SetDlgItemText(hwndDlg, IDC_CITY, dbv.pszVal); DBFreeVariant(&dbv); } else SetDlgItemText(hwndDlg, IDC_CITY, ""); if (!DBGetContactSetting(hContact, jabberProtoName, "School", &dbv)) { SetDlgItemText(hwndDlg, IDC_SCHOOL, dbv.pszVal); DBFreeVariant(&dbv); } else SetDlgItemText(hwndDlg, IDC_SCHOOL, ""); switch (DBGetContactSettingByte(hContact, jabberProtoName, "Gender", '?')) { case 'M': SendDlgItemMessage(hwndDlg, IDC_GENDER, CB_SETCURSEL, 1, 0); SetDlgItemText(hwndDlg, IDC_GENDER_TEXT, Translate(tlenFieldGender[0].name)); break; case 'F': SendDlgItemMessage(hwndDlg, IDC_GENDER, CB_SETCURSEL, 2, 0); SetDlgItemText(hwndDlg, IDC_GENDER_TEXT, Translate(tlenFieldGender[1].name)); break; default: SendDlgItemMessage(hwndDlg, IDC_GENDER, CB_SETCURSEL, 0, 0); SetDlgItemText(hwndDlg, IDC_GENDER_TEXT, ""); break; } i = DBGetContactSettingWord(hContact, jabberProtoName, "Occupation", 0); if (i>0 && i<13) { SetDlgItemText(hwndDlg, IDC_OCCUPATION_TEXT, Translate(tlenFieldOccupation[i-1].name)); SendDlgItemMessage(hwndDlg, IDC_OCCUPATION, CB_SETCURSEL, i, 0); } else { SetDlgItemText(hwndDlg, IDC_OCCUPATION_TEXT, ""); SendDlgItemMessage(hwndDlg, IDC_OCCUPATION, CB_SETCURSEL, 0, 0); } i = DBGetContactSettingWord(hContact, jabberProtoName, "LookingFor", 0); if (i>0 && i<6) { SetDlgItemText(hwndDlg, IDC_LOOKFOR_TEXT, Translate(tlenFieldLookfor[i-1].name)); SendDlgItemMessage(hwndDlg, IDC_LOOKFOR, CB_SETCURSEL, i, 0); } else { SetDlgItemText(hwndDlg, IDC_LOOKFOR_TEXT, ""); SendDlgItemMessage(hwndDlg, IDC_LOOKFOR, CB_SETCURSEL, 0, 0); } i = DBGetContactSettingWord(hContact, jabberProtoName, "VoiceChat", 0); CheckDlgButton(hwndDlg, IDC_VOICECONVERSATIONS, i); i = DBGetContactSettingWord(hContact, jabberProtoName, "PublicStatus", 0); CheckDlgButton(hwndDlg, IDC_PUBLICSTATUS, i); if (!DBGetContactSetting(hContact, jabberProtoName, "jid", &dbv)) { jid = JabberTextDecode(dbv.pszVal); SetDlgItemText(hwndDlg, IDC_INFO_JID, jid); free(jid); jid = dbv.pszVal; if (jabberOnline) { if ((item=JabberListGetItemPtr(LIST_ROSTER, jid)) != NULL) { switch (item->subscription) { case SUB_BOTH: SetDlgItemText(hwndDlg, IDC_SUBSCRIPTION, Translate("both")); break; case SUB_TO: SetDlgItemText(hwndDlg, IDC_SUBSCRIPTION, Translate("to")); break; case SUB_FROM: SetDlgItemText(hwndDlg, IDC_SUBSCRIPTION, Translate("from")); break; default: SetDlgItemText(hwndDlg, IDC_SUBSCRIPTION, Translate("none")); break; } SetDlgItemTextA(hwndDlg, IDC_SOFTWARE, item->software); SetDlgItemTextA(hwndDlg, IDC_VERSION, item->version); SetDlgItemTextA(hwndDlg, IDC_SYSTEM, item->system); } else { SetDlgItemText(hwndDlg, IDC_SUBSCRIPTION, Translate("not on roster")); } } DBFreeVariant(&dbv); } } break; case WM_NOTIFY: switch (((LPNMHDR)lParam)->idFrom) { case 0: switch (((LPNMHDR)lParam)->code) { case PSN_INFOCHANGED: { HANDLE hContact = (HANDLE) ((LPPSHNOTIFY) lParam)->lParam; SendMessage(hwndDlg, WM_JABBER_REFRESH, 0, (LPARAM) hContact); } break; } break; } break; case WM_COMMAND: if (LOWORD(wParam)==IDC_SAVE && HIWORD(wParam)==BN_CLICKED) { char *str = NULL; int strSize; CCSDATA ccs = {0}; JabberStringAppend(&str, &strSize, "<iq type='set' id='"JABBER_IQID"%d' to='tuba'><query xmlns='jabber:iq:register'>", JabberSerialNext()); FetchField(hwndDlg, IDC_FIRSTNAME, "first", &str, &strSize); FetchField(hwndDlg, IDC_LASTNAME, "last", &str, &strSize); FetchField(hwndDlg, IDC_NICKNAME, "nick", &str, &strSize); FetchField(hwndDlg, IDC_EMAIL, "email", &str, &strSize); FetchCombo(hwndDlg, IDC_GENDER, "s", &str, &strSize); FetchField(hwndDlg, IDC_AGE, "b", &str, &strSize); FetchField(hwndDlg, IDC_CITY, "c", &str, &strSize); FetchCombo(hwndDlg, IDC_OCCUPATION, "j", &str, &strSize); FetchField(hwndDlg, IDC_SCHOOL, "e", &str, &strSize); FetchCombo(hwndDlg, IDC_LOOKFOR, "r", &str, &strSize); JabberStringAppend(&str, &strSize, "<g>%d</g>", IsDlgButtonChecked(hwndDlg, IDC_VOICECONVERSATIONS) ? 1 : 0); JabberStringAppend(&str, &strSize, "<v>%d</v>", IsDlgButtonChecked(hwndDlg, IDC_PUBLICSTATUS) ? 1 : 0); JabberStringAppend(&str, &strSize, "</query></iq>"); JabberLog(str); JabberSend(jabberThreadInfo->s, "%s", str); free(str); JabberGetInfo(0, (LPARAM) &ccs); } break; } return FALSE; }
INT_PTR CALLBACK AdvancedSearchDlgProc(HWND hWndDlg,UINT message,WPARAM wParam,LPARAM lParam) { switch(message){ case WM_INITDIALOG: { HWND hWndCombo; DWORD dwItem; WCHAR wszBuff[MAX_PATH]; SYSTEMTIME stTime; GetLocalTime(&stTime); //InitComboBox(GetDlgItem(hWndDlg,IDC_EMAIL_DOMAIN),(FieldNames*)DomainField); { hWndCombo=GetDlgItem(hWndDlg,IDC_EMAIL_DOMAIN); ResetComboBox(hWndCombo); for (SIZE_T i=0;lpcszMailRuDomains[i];i++) { MultiByteToWideChar(MRA_CODE_PAGE,0,lpcszMailRuDomains[i],-1,wszBuff,SIZEOF(wszBuff)); SendMessage(hWndCombo,CB_ADDSTRING,0,(LPARAM)wszBuff); } } InitComboBox(GetDlgItem(hWndDlg,IDC_GENDER),(FieldNames*)GenderField); InitComboBoxNumders(GetDlgItem(hWndDlg,IDC_AGERANGE_FROM),1,100); InitComboBoxNumders(GetDlgItem(hWndDlg,IDC_AGERANGE_TO),1,100); InitComboBoxNumders(GetDlgItem(hWndDlg,IDC_BIRTHDAY_DAY),1,31); InitComboBox(GetDlgItem(hWndDlg,IDC_BIRTHDAY_MONTH),(FieldNames*)MonthField); InitComboBoxNumders(GetDlgItem(hWndDlg,IDC_BIRTHDAY_YEAR),1900,(DWORD)stTime.wYear); InitComboBox(GetDlgItem(hWndDlg,IDC_ZODIAK),(FieldNames*)ZodiakField); hWndCombo=GetDlgItem(hWndDlg,IDC_COUNTRY); ResetComboBox(hWndCombo); for(SIZE_T i=0;mrapPlaces[i].lpszData;i++) { if (mrapPlaces[i].dwCityID==0 && mrapPlaces[i].dwPlaceID==0) { dwItem=SendMessage(hWndCombo,CB_ADDSTRING,0,(LPARAM)mrapPlaces[i].lpszData); SendMessage(hWndCombo,CB_SETITEMDATA,dwItem,mrapPlaces[i].dwCountryID); } } ResetComboBox(GetDlgItem(hWndDlg,IDC_CITY)); if (DB_Mra_GetByte(NULL,"AdvancedSearchRemember",MRA_DEFAULT_SEARCH_REMEMBER)) { SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_GENDER,CB_SETCURSEL,DB_Mra_GetWord(NULL,"AdvancedSearchGender",0),0); SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_AGERANGE_FROM,CB_SETCURSEL,DB_Mra_GetWord(NULL,"AdvancedSearchAgeFrom",0),0); SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_AGERANGE_TO,CB_SETCURSEL,DB_Mra_GetWord(NULL,"AdvancedSearchAgeTo",0),0); SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_BIRTHDAY_MONTH,CB_SETCURSEL,DB_Mra_GetWord(NULL,"AdvancedSearchBirthDayMonth",0),0); SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_BIRTHDAY_DAY,CB_SETCURSEL,DB_Mra_GetWord(NULL,"AdvancedSearchBirthDayDay",0),0); SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_ZODIAK,CB_SETCURSEL,DB_Mra_GetWord(NULL,"AdvancedSearchZodiakID",0),0); SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_COUNTRY,CB_SETCURSEL,DB_Mra_GetWord(NULL,"AdvancedSearchCountryID",0),0); SendMessageW(hWndDlg,WM_COMMAND,(WPARAM)MAKELONG(IDC_COUNTRY,CBN_SELCHANGE),(LPARAM)GetDlgItem(hWndDlg,IDC_COUNTRY)); SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_STATE,CB_SETCURSEL,DB_Mra_GetWord(NULL,"AdvancedSearchStateID",0),0); SendMessageW(hWndDlg,WM_COMMAND,(WPARAM)MAKELONG(IDC_STATE,CBN_SELCHANGE),(LPARAM)GetDlgItem(hWndDlg,IDC_STATE)); SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_CITY,CB_SETCURSEL,DB_Mra_GetWord(NULL,"AdvancedSearchCityID",0),0); CHECK_DLG_BUTTON(hWndDlg,IDC_ONLINEONLY,DB_Mra_GetByte(NULL,"AdvancedSearchOnlineOnly",FALSE)); CHECK_DLG_BUTTON(hWndDlg,IDC_CHK_REMEMBER,TRUE); } TranslateDialogDefault(hWndDlg); } return(TRUE); case WM_DESTROY: { /*dwUserSize=GET_DLG_ITEM_TEXTA(hWndDlg,IDC_EMAIL_USER,szUser,SIZEOF(szUser)); dwDomainSize=GET_DLG_ITEM_TEXTA(hWndDlg,IDC_EMAIL_DOMAIN,szDomain,SIZEOF(szDomain)); dwNickNameSize=GET_DLG_ITEM_TEXT(hWndDlg,IDC_NICK,wszNickName,SIZEOF(wszNickName)); dwFirstNameSize=GET_DLG_ITEM_TEXT(hWndDlg,IDC_FIRSTNAME,wszFirstName,SIZEOF(wszFirstName)); dwLastNameSize=GET_DLG_ITEM_TEXT(hWndDlg,IDC_LASTNAME,wszLastName,SIZEOF(wszLastName));*/ DB_Mra_SetWord(NULL,"AdvancedSearchGender",SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_GENDER,CB_GETCURSEL,0,0)); DB_Mra_SetWord(NULL,"AdvancedSearchAgeFrom",SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_AGERANGE_FROM,CB_GETCURSEL,0,0)); DB_Mra_SetWord(NULL,"AdvancedSearchAgeTo",SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_AGERANGE_TO,CB_GETCURSEL,0,0)); DB_Mra_SetWord(NULL,"AdvancedSearchBirthDayMonth",SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_BIRTHDAY_MONTH,CB_GETCURSEL,0,0)); DB_Mra_SetWord(NULL,"AdvancedSearchBirthDayDay",SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_BIRTHDAY_DAY,CB_GETCURSEL,0,0)); DB_Mra_SetWord(NULL,"AdvancedSearchZodiakID",SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_ZODIAK,CB_GETCURSEL,0,0)); DB_Mra_SetWord(NULL,"AdvancedSearchCityID",SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_CITY,CB_GETCURSEL,0,0)); DB_Mra_SetWord(NULL,"AdvancedSearchStateID",SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_STATE,CB_GETCURSEL,0,0)); DB_Mra_SetWord(NULL,"AdvancedSearchCountryID",SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_COUNTRY,CB_GETCURSEL,0,0)); DB_Mra_SetByte(NULL,"AdvancedSearchOnlineOnly",IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_ONLINEONLY)); DB_Mra_SetByte(NULL,"AdvancedSearchRemember",IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_CHK_REMEMBER)); } break; case WM_COMMAND: switch(LOWORD(wParam)){ case IDOK: SendMessage(GetParent(hWndDlg),WM_COMMAND,MAKEWPARAM(IDOK,BN_CLICKED),(LPARAM)GetDlgItem(GetParent(hWndDlg),IDOK)); break; case IDC_AGERANGE_FROM: case IDC_AGERANGE_TO: if (HIWORD(wParam)==CBN_SELCHANGE) { if (LOWORD(wParam)==IDC_AGERANGE_FROM) { DWORD dwAgeFrom,dwAgeTo; dwAgeFrom=GET_CURRENT_COMBO_DATA(hWndDlg,IDC_AGERANGE_FROM); dwAgeTo=GET_CURRENT_COMBO_DATA(hWndDlg,IDC_AGERANGE_TO); if (dwAgeFrom==0) dwAgeFrom++; InitComboBoxNumders(GetDlgItem(hWndDlg,IDC_AGERANGE_TO),dwAgeFrom,100); SendMessage(GetDlgItem(hWndDlg,IDC_AGERANGE_TO),CB_SETCURSEL,((dwAgeTo-dwAgeFrom)+1),0); } SendMessage(GetDlgItem(hWndDlg,IDC_BIRTHDAY_YEAR),CB_SETCURSEL,0,0); } break; case IDC_BIRTHDAY_DAY: case IDC_BIRTHDAY_MONTH: case IDC_BIRTHDAY_YEAR: if (HIWORD(wParam)==CBN_SELCHANGE) { DWORD dwAge; SYSTEMTIME stTime={0}; stTime.wYear=(WORD)GET_CURRENT_COMBO_DATA(hWndDlg,IDC_BIRTHDAY_YEAR); stTime.wMonth=(WORD)GET_CURRENT_COMBO_DATA(hWndDlg,IDC_BIRTHDAY_MONTH); stTime.wDay=(WORD)GET_CURRENT_COMBO_DATA(hWndDlg,IDC_BIRTHDAY_DAY); dwAge=GetYears(&stTime); SendMessage(GetDlgItem(hWndDlg,IDC_AGERANGE_FROM),CB_SETCURSEL,dwAge,0); SendMessage(GetDlgItem(hWndDlg,IDC_AGERANGE_TO),CB_SETCURSEL,dwAge,0); SendMessage(GetDlgItem(hWndDlg,IDC_ZODIAK),CB_SETCURSEL,0,0); } break; case IDC_ZODIAK: if (HIWORD(wParam)==CBN_SELCHANGE) { SendMessage(GetDlgItem(hWndDlg,IDC_BIRTHDAY_DAY),CB_SETCURSEL,0,0); SendMessage(GetDlgItem(hWndDlg,IDC_BIRTHDAY_MONTH),CB_SETCURSEL,0,0); //SendMessage(GetDlgItem(hWndDlg,IDC_BIRTHDAY_YEAR),CB_SETCURSEL,0,0); } break; case IDC_COUNTRY: if (HIWORD(wParam)==CBN_SELCHANGE) { HWND hWndCombo; DWORD dwItem,dwCountryID; dwCountryID=GET_CURRENT_COMBO_DATA(hWndDlg,IDC_COUNTRY); hWndCombo=GetDlgItem(hWndDlg,IDC_STATE); SendMessage(hWndCombo,CB_RESETCONTENT,0,0); ResetComboBox(GetDlgItem(hWndDlg,IDC_CITY)); dwItem=SendMessage(hWndCombo,CB_ADDSTRING,0,(LPARAM)L""); SendMessage(hWndCombo,CB_SETITEMDATA,dwItem,0); SendMessage(hWndCombo,CB_SETCURSEL,dwItem,0); for(SIZE_T i=0;mrapPlaces[i].lpszData;i++) { if (mrapPlaces[i].dwCountryID==dwCountryID && mrapPlaces[i].dwCityID && mrapPlaces[i].dwPlaceID==0) { dwItem=SendMessage(hWndCombo,CB_ADDSTRING,0,(LPARAM)mrapPlaces[i].lpszData); SendMessage(hWndCombo,CB_SETITEMDATA,dwItem,mrapPlaces[i].dwCityID); } } } break; case IDC_STATE: if (HIWORD(wParam)==CBN_SELCHANGE) { HWND hWndCombo; DWORD dwItem,dwCountryID,dwStateID; dwCountryID=GET_CURRENT_COMBO_DATA(hWndDlg,IDC_COUNTRY); dwStateID=GET_CURRENT_COMBO_DATA(hWndDlg,IDC_STATE); hWndCombo=GetDlgItem(hWndDlg,IDC_CITY); SendMessage(hWndCombo,CB_RESETCONTENT,0,0); dwItem=SendMessage(hWndCombo,CB_ADDSTRING,0,(LPARAM)L""); SendMessage(hWndCombo,CB_SETITEMDATA,dwItem,0); SendMessage(hWndCombo,CB_SETCURSEL,dwItem,0); for(SIZE_T i=0;mrapPlaces[i].lpszData;i++) { if (mrapPlaces[i].dwCountryID==dwCountryID && mrapPlaces[i].dwCityID==dwStateID && mrapPlaces[i].dwPlaceID) { dwItem=SendMessage(hWndCombo,CB_ADDSTRING,0,(LPARAM)mrapPlaces[i].lpszData); SendMessage(hWndCombo,CB_SETITEMDATA,dwItem,mrapPlaces[i].dwPlaceID); } } } break; default: break; } break; default: break; } return(FALSE); }
RepSert::RepSert(QWidget *aParent): Report(aParent, new CertificationReport, tr("Аттестации")) { CreateWidgets(); InitComboBox(cb, vecId, "SELECT * FROM coaches", 0); }
bool InitSystem(void) { RetCode_t r; char MsgStr[160]; pdlg = (CXMSApi_TestDlg *)theApp.m_pMainWnd; // Read From "Config.TXT" ReadFromConfig(); // Init Combo Box InitComboBox(); // Init m_ListMsg InitListMsg(); // Init Conifg's text box InitTextBox(); // init variable used by XMSApi_Test_Func.cpp InitVar_Func(); #ifdef DEBUG_IN_HOME_NOTEBOOK // ----- for-test----- typedef struct { Acs_Dev_List_Head_t head; DeviceID_t dev[32]; } My_Struct; My_Struct mmm; mmm.head.m_s32DeviceNum = 4; mmm.dev[0].m_s16DeviceMain = XMS_DEVMAIN_VOICE; mmm.dev[0].m_s8ModuleID = 1; mmm.dev[0].m_s16ChannelID = 1; mmm.dev[1].m_s16DeviceMain = XMS_DEVMAIN_VOICE; mmm.dev[1].m_s8ModuleID = 1; mmm.dev[1].m_s16ChannelID = 2; mmm.dev[2].m_s16DeviceMain = XMS_DEVMAIN_INTERFACE_CH; mmm.dev[2].m_s16DeviceSub = XMS_DEVSUB_E1_SS7_ISUP; mmm.dev[2].m_s8ModuleID = 1; mmm.dev[2].m_s16ChannelID = 8; mmm.dev[3].m_s16DeviceMain = XMS_DEVMAIN_INTERFACE_CH; mmm.dev[3].m_s16DeviceSub = XMS_DEVSUB_E1_SS7_ISUP; mmm.dev[3].m_s8ModuleID = 1; mmm.dev[3].m_s16ChannelID = 9; void AddDeviceRes ( Acs_Dev_List_Head_t *pAcsDevList ); AddDeviceRes ( &mmm.head ); InitDeviceInfo(); bStartWorkFlag = true; return true; // ----- end of for-test ----- #endif // now open ACS Server /*Invoke the acsOpenStream routine to create a connect to server*/ r = XMS_acsOpenStream ( &g_acsHandle, &cfg_ServerID, g_u8UnitID, // App Unit ID 32, // sendQSize, in K Bytes 32, // recvQSize, in K Bytes //cfg_s32DebugOn, // Debug On/Off 1, NULL); if ( r < 0 ) { sprintf ( MsgStr, "X(%d) XMS_acsOpenStream(IP Addr : %s, port : %d) FAIL.", r, cfg_ServerID.m_s8ServerIp, cfg_ServerID.m_u32ServerPort ); MessageBox(NULL, MsgStr, "Init System", MB_OK ) ; AddMsg ( MSG_TYPE_FUNCTION, MsgStr ); } else { sprintf ( MsgStr, "XMS_acsOpenStream(%s,%d) OK!", cfg_ServerID.m_s8ServerIp, cfg_ServerID.m_u32ServerPort ); AddMsg ( MSG_TYPE_FUNCTION, MsgStr ); } r = XMS_acsSetESR ( g_acsHandle, (EsrFunc)EvtHandler, 0, 1 ); if ( r < 0 ) { sprintf ( MsgStr, "X(%d) XMS_acsSetESR() FAIL!", r ); AddMsg ( MSG_TYPE_FUNCTION, MsgStr ); return false; } else { sprintf ( MsgStr, "XMS_acsSetESR() OK!" ); AddMsg ( MSG_TYPE_FUNCTION, MsgStr ); } XMS_acsGetDeviceList ( g_acsHandle, NULL ); bStartWorkFlag = false; return true; }
BOOL CPage1::OnInitDialog() { CDialog::OnInitDialog(); m_a_colorSet.CreateInstance(__uuidof(Recordset)); m_a_colorSet->CursorLocation =adUseClient; m_a_colr_lSet.CreateInstance(__uuidof(Recordset)); m_a_colr_lSet->CursorLocation = adUseClient; CString strSQL; strSQL="select * from a_colr_l"; m_a_colr_lSet->Open(_bstr_t(strSQL),(IDispatch*)(theApp.m_pConnectionCODE),adOpenStatic,adLockOptimistic,adCmdText); m_a_colr_lGrid.SetRefDataSource(NULL); m_a_colr_lGrid.SetAllowAddNew(TRUE); m_a_colr_lGrid.SetAllowUpdate(TRUE); m_a_colr_lGrid.SetAllowDelete(TRUE); m_a_colr_lGrid.SetRefDataSource(m_a_colr_lSet->GetDataSource()); m_a_colr_lGrid.InitMouseWheel();//滚动功能 //设置字段名称和宽度。 SetFieldCaptionAndWidth(&m_a_colr_lGrid, theApp.m_pConIPEDsort, "a_colr_l"); strSQL="select * from a_color where enginid='"+EDIBgbl::SelPrjID+"'"; m_a_colorSet->Open(_bstr_t(strSQL),(IDispatch*)theApp.m_pConnection,adOpenStatic,adLockOptimistic,adCmdText); m_a_colorGrid.SetRefDataSource(m_a_colorSet->GetDataSource()); m_a_colorGrid.GetColumns().GetItem(_variant_t("enginid")).SetVisible(false); m_a_colorGrid.InitMouseWheel();//滚动功能 m_a_colorGrid.SetAllowAddNew(true); m_a_colorGrid.SetAllowUpdate(true); m_a_colorGrid.SetAllowDelete(true); //设置字段名称和宽度。 SetFieldCaptionAndWidth(&m_a_colorGrid, theApp.m_pConIPEDsort, "a_color"); /* RECT rect; float fRect; m_a_colorGrid.GetWindowRect(&rect); fRect=rect.right-rect.left; int i; int ii; i=fRect/7; ii=fRect/6; m_a_colorGrid.GetColumns().GetItem(_variant_t("colr_media")).SetWidth(i*2); m_a_colorGrid.GetColumns().GetItem(_variant_t("colr_face")).SetWidth(ii); m_a_colorGrid.GetColumns().GetItem(_variant_t("colr_ring")).SetWidth(ii); m_a_colorGrid.GetColumns().GetItem(_variant_t("colr_arrow")).SetWidth(ii); m_a_colorGrid.GetColumns().GetItem(_variant_t("colr_code")).SetWidth(ii*0.8); */ if(!InitA_pai()) { return false; } InitComboBox(); m_conComboBox.SetCurSel(0); m_conComboBox.ShowWindow(SW_HIDE); m_a_colr_lDeleteState=false; m_a_colorDeleteState=false; return true; }
static INT_PTR CALLBACK TlenUserInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) { TLENUSERINFODLGDATA *data = (TLENUSERINFODLGDATA *) GetWindowLongPtr(hwndDlg, GWLP_USERDATA); switch (msg) { case WM_INITDIALOG: data = (TLENUSERINFODLGDATA*)mir_alloc(sizeof(TLENUSERINFODLGDATA)); data->hContact = (MCONTACT) lParam; SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)data); // lParam is hContact TranslateDialogDefault(hwndDlg); InitComboBox(GetDlgItem(hwndDlg, IDC_GENDER), tlenFieldGender); InitComboBox(GetDlgItem(hwndDlg, IDC_OCCUPATION), tlenFieldOccupation); InitComboBox(GetDlgItem(hwndDlg, IDC_LOOKFOR), tlenFieldLookfor); return TRUE; case WM_TLEN_REFRESH: { DBVARIANT dbv; char *jid; int i; TLEN_LIST_ITEM *item; SetDlgItemText(hwndDlg, IDC_INFO_JID, _T("")); SetDlgItemText(hwndDlg, IDC_SUBSCRIPTION, _T("")); SetFocus(GetDlgItem(hwndDlg, IDC_STATIC)); if (!db_get_ts(data->hContact, data->proto->m_szModuleName, "FirstName", &dbv)) { SetDlgItemText(hwndDlg, IDC_FIRSTNAME, dbv.ptszVal); db_free(&dbv); } else SetDlgItemText(hwndDlg, IDC_FIRSTNAME, _T("")); if (!db_get_ts(data->hContact, data->proto->m_szModuleName, "LastName", &dbv)) { SetDlgItemText(hwndDlg, IDC_LASTNAME, dbv.ptszVal); db_free(&dbv); } else SetDlgItemText(hwndDlg, IDC_LASTNAME, _T("")); if (!db_get_ts(data->hContact, data->proto->m_szModuleName, "Nick", &dbv)) { SetDlgItemText(hwndDlg, IDC_NICKNAME, dbv.ptszVal); db_free(&dbv); } else SetDlgItemText(hwndDlg, IDC_NICKNAME, _T("")); if (!db_get_ts(data->hContact, data->proto->m_szModuleName, "e-mail", &dbv)) { SetDlgItemText(hwndDlg, IDC_EMAIL, dbv.ptszVal); db_free(&dbv); } else SetDlgItemText(hwndDlg, IDC_EMAIL, _T("")); if (!db_get(data->hContact, data->proto->m_szModuleName, "Age", &dbv)) { SetDlgItemInt(hwndDlg, IDC_AGE, dbv.wVal, FALSE); db_free(&dbv); } else SetDlgItemText(hwndDlg, IDC_AGE, _T("")); if (!db_get_ts(data->hContact, data->proto->m_szModuleName, "City", &dbv)) { SetDlgItemText(hwndDlg, IDC_CITY, dbv.ptszVal); db_free(&dbv); } else SetDlgItemText(hwndDlg, IDC_CITY, _T("")); if (!db_get_ts(data->hContact, data->proto->m_szModuleName, "School", &dbv)) { SetDlgItemText(hwndDlg, IDC_SCHOOL, dbv.ptszVal); db_free(&dbv); } else SetDlgItemText(hwndDlg, IDC_SCHOOL, _T("")); switch (db_get_b(data->hContact, data->proto->m_szModuleName, "Gender", '?')) { case 'M': SendDlgItemMessage(hwndDlg, IDC_GENDER, CB_SETCURSEL, 1, 0); SetDlgItemText(hwndDlg, IDC_GENDER_TEXT, TranslateTS(tlenFieldGender[0].name)); break; case 'F': SendDlgItemMessage(hwndDlg, IDC_GENDER, CB_SETCURSEL, 2, 0); SetDlgItemText(hwndDlg, IDC_GENDER_TEXT, TranslateTS(tlenFieldGender[1].name)); break; default: SendDlgItemMessage(hwndDlg, IDC_GENDER, CB_SETCURSEL, 0, 0); SetDlgItemText(hwndDlg, IDC_GENDER_TEXT, _T("")); break; } i = db_get_w(data->hContact, data->proto->m_szModuleName, "Occupation", 0); if (i>0 && i<13) { SetDlgItemText(hwndDlg, IDC_OCCUPATION_TEXT, TranslateTS(tlenFieldOccupation[i-1].name)); SendDlgItemMessage(hwndDlg, IDC_OCCUPATION, CB_SETCURSEL, i, 0); } else { SetDlgItemText(hwndDlg, IDC_OCCUPATION_TEXT, _T("")); SendDlgItemMessage(hwndDlg, IDC_OCCUPATION, CB_SETCURSEL, 0, 0); } i = db_get_w(data->hContact, data->proto->m_szModuleName, "LookingFor", 0); if (i>0 && i<6) { SetDlgItemText(hwndDlg, IDC_LOOKFOR_TEXT, TranslateTS(tlenFieldLookfor[i-1].name)); SendDlgItemMessage(hwndDlg, IDC_LOOKFOR, CB_SETCURSEL, i, 0); } else { SetDlgItemText(hwndDlg, IDC_LOOKFOR_TEXT, _T("")); SendDlgItemMessage(hwndDlg, IDC_LOOKFOR, CB_SETCURSEL, 0, 0); } i = db_get_w(data->hContact, data->proto->m_szModuleName, "VoiceChat", 0); CheckDlgButton(hwndDlg, IDC_VOICECONVERSATIONS, i ? BST_CHECKED : BST_UNCHECKED); i = db_get_w(data->hContact, data->proto->m_szModuleName, "PublicStatus", 0); CheckDlgButton(hwndDlg, IDC_PUBLICSTATUS, i ? BST_CHECKED : BST_UNCHECKED); if (!db_get(data->hContact, data->proto->m_szModuleName, "jid", &dbv)) { jid = TlenTextDecode(dbv.pszVal); SetDlgItemTextA(hwndDlg, IDC_INFO_JID, jid); mir_free(jid); jid = dbv.pszVal; if (data->proto->isOnline) { if ((item=TlenListGetItemPtr(data->proto, LIST_ROSTER, jid)) != NULL) { switch (item->subscription) { case SUB_BOTH: SetDlgItemText(hwndDlg, IDC_SUBSCRIPTION, TranslateT("both")); break; case SUB_TO: SetDlgItemText(hwndDlg, IDC_SUBSCRIPTION, TranslateT("to")); break; case SUB_FROM: SetDlgItemText(hwndDlg, IDC_SUBSCRIPTION, TranslateT("from")); break; default: SetDlgItemText(hwndDlg, IDC_SUBSCRIPTION, TranslateT("none")); break; } SetDlgItemTextA(hwndDlg, IDC_SOFTWARE, item->software); SetDlgItemTextA(hwndDlg, IDC_VERSION, item->version); SetDlgItemTextA(hwndDlg, IDC_SYSTEM, item->system); } else { SetDlgItemText(hwndDlg, IDC_SUBSCRIPTION, TranslateT("not on roster")); } } db_free(&dbv); } } break; case WM_NOTIFY: switch (((LPNMHDR)lParam)->idFrom) { case 0: switch (((LPNMHDR)lParam)->code) { case PSN_INFOCHANGED: { MCONTACT hContact = (MCONTACT) ((LPPSHNOTIFY) lParam)->lParam; SendMessage(hwndDlg, WM_TLEN_REFRESH, 0, (LPARAM) hContact); } break; case PSN_PARAMCHANGED: { data->proto = ( TlenProtocol* )(( LPPSHNOTIFY )lParam )->lParam; SendMessage(hwndDlg, WM_TLEN_REFRESH, 0, 0); } } break; } break; case WM_COMMAND: if (LOWORD(wParam) == IDC_SAVE && HIWORD(wParam) == BN_CLICKED) { char *str = NULL; int strSize; TlenStringAppend(&str, &strSize, "<iq type='set' id='" TLEN_IQID "%d' to='tuba'><query xmlns='jabber:iq:register'>", TlenSerialNext(data->proto)); FetchField(hwndDlg, IDC_FIRSTNAME, "first", &str, &strSize); FetchField(hwndDlg, IDC_LASTNAME, "last", &str, &strSize); FetchField(hwndDlg, IDC_NICKNAME, "nick", &str, &strSize); FetchField(hwndDlg, IDC_EMAIL, "email", &str, &strSize); FetchCombo(hwndDlg, IDC_GENDER, "s", &str, &strSize); FetchField(hwndDlg, IDC_AGE, "b", &str, &strSize); FetchField(hwndDlg, IDC_CITY, "c", &str, &strSize); FetchCombo(hwndDlg, IDC_OCCUPATION, "j", &str, &strSize); FetchField(hwndDlg, IDC_SCHOOL, "e", &str, &strSize); FetchCombo(hwndDlg, IDC_LOOKFOR, "r", &str, &strSize); TlenStringAppend(&str, &strSize, "<g>%d</g>", IsDlgButtonChecked(hwndDlg, IDC_VOICECONVERSATIONS) ? 1 : 0); TlenStringAppend(&str, &strSize, "<v>%d</v>", IsDlgButtonChecked(hwndDlg, IDC_PUBLICSTATUS) ? 1 : 0); TlenStringAppend(&str, &strSize, "</query></iq>"); TlenSend(data->proto, "%s", str); mir_free(str); data->proto->GetInfo(NULL, 0); } break; case WM_DESTROY: mir_free(data); break; } return FALSE; }
RepSport::RepSport(QWidget *aParent): Report(aParent, new SportsmenReport, tr("Спортсмены")) { CreateWidgets(); InitComboBox(cbCoach, vecId, "SELECT * FROM coaches", 0); }