//--------------------------------------------------------------------------- void __fastcall TFrmAlterPwd::BtnOKClick(TObject *Sender) { AnsiString sqltxt = "update T_en_user set ur_Password=%s where ur_UserID=%s"; if (Lguser.sPwd !=EdtOldPwd->Text) { ShowDlg("原密码有误",DLG_ERROR); EdtOldPwd->SetFocus(); return ; } if (EdtNewPwd->Text!=EdtComfirPwd->Text) { ShowDlg("新密码与确认密码不一致!",DLG_ERROR); EdtNewPwd->SetFocus(); return ; } sqltxt = Format(sqltxt,ARRAYOFCONST((QuotedStr(EdtNewPwd->Text),QuotedStr(Lguser.sLoginNo)))); dmMain->FindBySql(sqltxt,false,NULL); Lguser.sPwd = EdtNewPwd->Text; ShowDlg("密码修改成功",DLG_INFORMATION); ModalResult =mrOk; }
void __fastcall TFrmCustomBill::CdsmasterBeforeScroll(TDataSet *DataSet) { int I; if ((!IsInternalDelete) && (!IsInternalEdit)&& (IsModified())) { if ( ShowDlg("数据未保存,是否真放弃?",DLG_CONFIRMATION) == false) Abort(); else { try { Cdsmaster->BeforeScroll = NULL; for (int i=0;i< FDataSetArr.Length;i++) { if (FDataSetArr[i]->Active) { FDataSetArr[i]->Cancel(); FDataSetArr[i]->CancelUpdates(); } } } __finally { Cdsmaster->BeforeScroll = CdsmasterBeforeScroll; } } } }
void show_mb(t_gmx *gmx,int mb) { if (mb >=0 && mb < emNR) { gmx->which_mb=mb; ShowDlg(gmx->mboxes[mb]); } }
bool NetHttpClient::sendHttpRequest(unsigned int unMsgType,unsigned int unMsgCode,CSJson::Value* msgBady,int nPlayerId) { //是否游客登入 // if (CPlayerInfoMan::sharedInstance().getLoinStatus()) // return false; CCString strUrl = URL_REQUEST; #ifdef GAME_TEST strUrl = URL_REQUEST_TEST; #endif //if(strcmp(GET_STRING_CSV(999999997),"1") == 0) CCTransitionScene* pScene = dynamic_cast<CCTransitionScene*>(CCDirector::sharedDirector()->getRunningScene()); if(pScene == NULL) ShowDlg(CGameLayerLoading,CCDirector::sharedDirector()->getRunningScene(),10000); if(msgBady) { CSJson::Value& body = (*msgBady); if(nPlayerId == -1) nPlayerId = (CPlayerInfoMan::sharedInstance().getPlayerInfo().nId); body["playerid"] = CSJson::Value(nPlayerId); return sendHttpRequest(new CRequestPacket(unMsgType,unMsgCode,*msgBady),strUrl.getCString()); } else { CSJson::Value tempNull; if(nPlayerId == -1) nPlayerId = (CPlayerInfoMan::sharedInstance().getPlayerInfo().nId); tempNull["playerid"] = CSJson::Value(nPlayerId); return sendHttpRequest(new CRequestPacket(unMsgType,unMsgCode,tempNull),strUrl.getCString()); } }
bool cgILoveShootingGame::GotoDlgPanel() { cgUIWidgetPtr ptr = cgUIManager::Get()->FindComponent("root.dlg"); if (!ptr) return false; // 记录当前播放到第几个了。 ptr->SetCustomValue(0); ShowDlg(); return true; }
// DoSurface will always try to show the surface inspector // or update it because something new has been selected void DoSurface( void ){ #ifdef DBG_SI Sys_Printf( "DoSurface\n" ); #endif if ( !SurfaceInspector ) { create_SurfaceInspector(); } ShowDlg(); SetTexMods(); }
bool cgILoveShootingGame::OnClick( cgUIWidgetPtr spComponent, unsigned wparam, unsigned lparam ) { if (!spComponent) return false; string strPath; spComponent->GetPath(strPath); if (strPath == "root.dlg.okbtn") { if (!ShowDlg()) GotoSelPanel(); } return true; }
void CDbgDlg::Push( ISAXHandler *pHandler ) { // push in the list g_ptr_array_add( m_pFeedbackElements, (void *)pHandler ); if ( m_pWidget == NULL ) { Create(); } // put stuff in the list gtk_list_store_clear( m_clist ); unsigned int i; for ( i = 0; i < m_pFeedbackElements->len; i++ ) { GtkTreeIter iter; gtk_list_store_append( m_clist, &iter ); gtk_list_store_set( m_clist, &iter, 0, GetElement( i )->getName(), -1 ); } ShowDlg(); }
int main(int argc, char *argv[]) { t_x11 *x11; t_dlg *dlg; if ((x11=GetX11(&argc,argv))==NULL) { fprintf(stderr,"No X!\n"); exit(1); } if (argc > 1) { dlg=ReadDlg(x11,0,x11->title,x11->fg,x11->bg,argv[1],100,100,TRUE, TRUE,NULL,NULL); ShowDlg(dlg); x11->MainLoop(x11); } else fprintf(stderr,"Usage: %s [ X options ] infile\n",argv[0]); x11->CleanUp(x11); return 0; }
void __fastcall TFrmCustomBill::CdsmasterBeforeDelete(TDataSet *DataSet) { if ( ShowDlg("真的删除当前记录吗?",DLG_CONFIRMATION) == false) { // ShowDlg("真的删除当前记录吗?",DLG_CONFIRMATION); Abort() ; } IsInternalDelete = true; if (CdsDetail->IsEmpty()) return; try { CdsDetail->DisableControls(); CdsDetail->First(); while (! CdsDetail->Eof) CdsDetail->Delete(); } __finally { CdsDetail->EnableControls(); }; }
//²Ù×÷Ô±µÇ¼ bool __fastcall TfrmLogin::LoginSys(AnsiString sLginNo, AnsiString sLginPwd) { AnsiString strSQL,strInfo; int iRet; Screen->Cursor = crHourGlass; #if 0 Lguser.IsAdmin = true; Lguser.bLoginOk = true; Screen->Cursor = crDefault; return true; #endif if (sLginPwd.IsEmpty()) { strSQL = "select * from T_en_user where UR_USERID ='"+sLginNo +"' and user_pwd is null"; } else { strSQL = "select * from T_en_user where UR_USERID ='"+sLginNo +"' and UR_PASSWORD=\'"+ sLginPwd +"\'"; } char tmp; //tmp = PAY_USER_ACTIVE ; //strSQL = strSQL+ " and UR_STATUS="+QuotedStr(atoi(&tmp)); try { iRet = ExecSQL(strSQL,true,dmMain->cDataSetQry); } catch(...) { strInfo = "µÇ¼ʧ°Ü¡£"; ShowDlg(strInfo, DLG_ICONWARNING); return false; } if (iRet == -1) { strInfo = "µÇ¼ʧ°Ü "; strInfo += StrPas(GetLastSQLError()); ShowDlg(strInfo, DLG_ICONWARNING); return false; } else if (iRet == -2) { strInfo = "²ÎÊý´íÎó¡£"; ShowDlg(strInfo, DLG_ICONWARNING); return false; } if (dmMain->cDataSetQry->RecordCount < 1) { strInfo = "Î޴˲Ù×÷Ô±»òÃÜÂë´íÎó¡£"; ShowDlg(strInfo, DLG_ICONWARNING); dmMain->cDataSetQry->Close(); return false;; } else { Lguser.sLoginNo = dmMain->cDataSetQry->FieldByName("UR_USERID")->AsString; Lguser.sLoginName = dmMain->cDataSetQry->FieldByName("UR_USERNAME")->AsString; Lguser.sPwd = dmMain->cDataSetQry->FieldByName("UR_PASSWORD")->AsString; Lguser.MenuRigth = dmMain->cDataSetQry->FieldByName("ur_MenuRight")->AsString; AnsiString tmpstr = dmMain->cDataSetQry->FieldByName("ur_isAdmin")->AsString; Lguser.IsAdmin = (tmpstr =="1"); //Lguser.uProp = dmMain->cDataSetQry->FieldByName("user_prop")->AsInteger; Lguser.sMemo = dmMain->cDataSetQry->FieldByName("user_memo")->AsString; Lguser.IsAdmin = true; Lguser.bLoginOk = true; } Screen->Cursor = crDefault; return true; }
void KCBTDialogManager::RequreCurrentSource() { ShowDlg(m_eCurrentDlgType); }
HCBluetoothBaseDlg* KCBTDialogManager::ShowPreDlg() { return ShowDlg(m_ePreDlgType); }
t_dlg *MessageBox(t_x11 *x11, Window Parent, char *title, int nlines, char *lines[], unsigned long Flags, DlgCallback *cb, void *data) { t_dlg *dlg; int width,nicon; int x,y,x0; unsigned long nFlag; unsigned long bg; /* Check flags for inconsistencies */ if (((Flags & MB_OK) && (Flags & MB_YES)) || ((Flags & MB_NO) && (Flags & MB_CANCEL)) || (!(Flags & MB_OK) && !(Flags & MB_YES))) { fprintf(stderr,"Invalid button selection in MessageBox\n"); exit(1); } nicon=0; if (Flags & MB_ICONSTOP) nicon++; if (Flags & MB_ICONINFORMATION) nicon++; if (Flags & MB_ICONEXCLAMATION) nicon++; if (Flags & MB_ICONGMX) nicon++; if (nicon > 1) gmx_fatal(FARGS,"More than one (%d) icon selected in MessageBox",nicon); /* Input seems ok */ bg=x11->bg; if (nicon > 0) { if (Flags & MB_ICONSTOP) SetIcon(stop_bits,stop_width,stop_height,RED,bg); if (Flags & MB_ICONINFORMATION) SetIcon(info_bits,info_width,info_height,BLUE,bg); if (Flags & MB_ICONEXCLAMATION) SetIcon(alert_bits,alert_width,alert_height,GREEN,bg); if (Flags & MB_ICONGMX) SetIcon(gromacs_bits,gromacs_width,gromacs_height,BLUE,bg); } dlg=CreateDlg(x11,Parent,title,0,0,0,0,3,x11->fg,bg,cb,data); x=2*OFFS_X; if (nicon > 0) { AddDlgItem(dlg,CreatePixmap (x11,XCreatePixmapFromBitmapData (x11->disp,dlg->win.self,icon_bits,icon_width,icon_height, icon_fg,icon_bg,x11->depth), ID_ICON,ID_BOX,2*OFFS_X,2*OFFS_Y,icon_width,icon_height,0)); x+=QueryDlgItemW(dlg,ID_ICON)+2*OFFS_X; } AddDlgItem(dlg,CreateStaticText(x11,nlines,lines,ID_TEXT,ID_BOX, x,2*OFFS_Y,0,0,0)); y=QueryDlgItemY(dlg,ID_TEXT)+QueryDlgItemH(dlg,ID_TEXT); if (nicon > 0) { int yi; yi=QueryDlgItemY(dlg,ID_ICON)+QueryDlgItemH(dlg,ID_ICON); if (yi > y) SetDlgItemPos(dlg,ID_TEXT,x,2*OFFS_Y+(yi-y)/2); else SetDlgItemPos(dlg,ID_ICON,2*OFFS_X,2*OFFS_Y+(y-yi)/2); y=max(y,yi); } x+=QueryDlgItemW(dlg,ID_TEXT)+2*OFFS_X; y+=2*OFFS_Y; width=(x-8*OFFS_X)/2; if (((Flags & MB_OKCANCEL) == MB_OKCANCEL) || ((Flags & MB_YESNO) == MB_YESNO)) x0=2*OFFS_X; else x0=(x-width)/2; #define CB(name,butx,id) AddDlgItem(dlg,CreateButton(x11,name,\ TRUE,id,ID_BOX,\ butx,y,width,0,0)) if (Flags & MB_OK) CB("OK",x0,MB_OK); if (Flags & MB_CANCEL) CB("Cancel",x/2+2*OFFS_X,MB_CANCEL); if (Flags & MB_YES) CB("Yes",x0,MB_YES); if (Flags & MB_NO) CB("No",x/2+2*OFFS_X,MB_NO); SetDlgSize(dlg,x,y+2*OFFS_Y+ QueryDlgItemH(dlg,(Flags & MB_OK) ? MB_OK : MB_YES),TRUE); if (Flags & MB_SYSTEMMODAL) nFlag=DLG_SYSTEMMODAL; else if (Flags & MB_APPLMODAL) nFlag=DLG_APPLMODAL; else nFlag=0; nFlag=nFlag | DLG_FREEONBUTTON; dlg->flags=nFlag; if (!(Flags & MB_DONTSHOW)) ShowDlg(dlg); return dlg; }
static void init_gmx(t_x11 *x11, char *program, int nfile, t_filenm fnm[], const output_env_t oenv) { Pixmap pm; t_gmx *gmx; XSizeHints hints; int w0, h0; int natom, natom_trx; t_topology top; int ePBC; matrix box; t_trxframe fr; t_trxstatus *status; char quote[256]; snew(gmx, 1); snew(gmx->wd, 1); ePBC = read_tpx_top(ftp2fn(efTPR, nfile, fnm), NULL, box, &natom, NULL, NULL, &top); read_first_frame(oenv, &status, ftp2fn(efTRX, nfile, fnm), &fr, TRX_DONT_SKIP); close_trx(status); natom_trx = fr.natoms; /* Creates a simple window */ w0 = DisplayWidth(x11->disp, x11->screen)-132; h0 = DisplayHeight(x11->disp, x11->screen)-140; bromacs(quote, 255); InitWin(gmx->wd, 0, 0, w0, h0, 3, quote); gmx->wd->self = XCreateSimpleWindow(x11->disp, x11->root, gmx->wd->x, gmx->wd->y, gmx->wd->width, gmx->wd->height, gmx->wd->bwidth, WHITE, BLACK); pm = XCreatePixmapFromBitmapData(x11->disp, x11->root, (char *)gromacs_bits, gromacs_width, gromacs_height, WHITE, BLACK, 1); hints.flags = PMinSize; hints.min_width = 2*EWIDTH+40; hints.min_height = EHEIGHT+LDHEIGHT+LEGHEIGHT+40; XSetStandardProperties(x11->disp, gmx->wd->self, gmx->wd->text, program, pm, NULL, 0, &hints); x11->RegisterCallback(x11, gmx->wd->self, x11->root, MainCallBack, gmx); x11->SetInputMask(x11, gmx->wd->self, ButtonPressMask | ButtonReleaseMask | OwnerGrabButtonMask | ExposureMask | StructureNotifyMask); /* The order of creating windows is important here! */ /* Manager */ gmx->man = init_man(x11, gmx->wd->self, 0, 0, 1, 1, WHITE, BLACK, ePBC, box, oenv); gmx->logo = init_logo(x11, gmx->wd->self, false); /* Now put all windows in the proper place */ move_gmx(x11, gmx, w0, h0, false); XMapWindow(x11->disp, gmx->wd->self); map_man(x11, gmx->man); /* Pull Down menu */ gmx->pd = init_pd(x11, gmx->wd->self, gmx->wd->width, x11->fg, x11->bg, MSIZE, gmx_pd_size, gmx_pd, MenuTitle); /* Dialogs & Filters */ gmx->filter = init_filter(&(top.atoms), ftp2fn_null(efNDX, nfile, fnm), natom_trx); init_dlgs(x11, gmx); /* Now do file operations */ set_file(x11, gmx->man, ftp2fn(efTRX, nfile, fnm), ftp2fn(efTPR, nfile, fnm)); ShowDlg(gmx->dlgs[edFilter]); }
static bool HandleClient(t_x11 *x11, int ID, t_gmx *gmx) { t_pulldown *pd; pd = gmx->pd; switch (ID) { /* File Menu */ case IDDUMPWIN: write_gmx(x11, gmx, IDDODUMP); break; case IDDODUMP: if (gmx->man->bAnimate) { hide_but(x11, gmx->man->vbox); } dump_it(gmx->man); if (gmx->man->bAnimate) { show_but(x11, gmx->man->vbox); } break; case IDCLOSE: case IDIMPORT: case IDEXPORT: ShowDlg(gmx->dlgs[edExport]); break; case IDDOEXPORT: write_sto_conf(gmx->confout, *gmx->man->top.name, &(gmx->man->top.atoms), gmx->man->x, NULL, gmx->man->molw->ePBC, gmx->man->box); break; case IDQUIT: show_mb(gmx, emQuit); break; case IDTERM: done_gmx(x11, gmx); return true; /* Edit Menu */ case IDEDITTOP: edit_file("topol.gmx"); break; case IDEDITCOORDS: edit_file("confin.gmx"); break; case IDEDITPARAMS: edit_file("mdparin.gmx"); break; /* Display Menu */ case IDFILTER: if (gmx->filter) { ShowDlg(gmx->dlgs[edFilter]); } break; case IDDOFILTER: do_filter(x11, gmx->man, gmx->filter); break; case IDANIMATE: check_pd_item(pd, IDANIMATE, toggle_animate(x11, gmx->man)); break; case IDLABELSOFF: no_labels(x11, gmx->man); break; case IDRESETVIEW: reset_view(gmx->man->view); ExposeWin(x11->disp, gmx->man->molw->wd.self); break; case IDPHOTO: show_mb(gmx, emNotImplemented); break; case IDBONDOPTS: ShowDlg(gmx->dlgs[edBonds]); break; case IDTHIN: set_bond_type(x11, gmx->man->molw, eBThin); break; case IDFAT: set_bond_type(x11, gmx->man->molw, eBFat); break; case IDVERYFAT: set_bond_type(x11, gmx->man->molw, eBVeryFat); break; case IDBALLS: set_bond_type(x11, gmx->man->molw, eBSpheres); break; case IDNOBOX: set_box_type(x11, gmx->man->molw, esbNone); break; case IDRECTBOX: set_box_type(x11, gmx->man->molw, esbRect); break; case IDTRIBOX: set_box_type(x11, gmx->man->molw, esbTri); break; case IDTOBOX: set_box_type(x11, gmx->man->molw, esbTrunc); break; /* Analysis Menu */ case IDBOND: case IDANGLE: case IDDIH: case IDRMS: case IDRDF: case IDENERGIES: case IDCORR: show_mb(gmx, emNotImplemented); break; /* Help Menu */ case IDHELP: show_mb(gmx, emHelp); break; case IDABOUT: show_logo(x11, gmx->logo); break; default: break; } return false; }