void TraceWindow::Init() { ListWindowBase::Init(IDD_CALLSTACK, (DLGPROC)ListWindowBase::DlgProc, kViewX, kViewY, kViewW, kViewH); SetScrollMax(0); clearColumns(); AddCol("addr", 52, true, NULL); AddCol("from", 52, true, NULL); AddCol("label", 120, false, NULL); if (m_small_font == NULL) { LOGFONT lf; memset(&lf, 0, sizeof(LOGFONT)); lf.lfHeight = kFontSize - 2; lf.lfWidth = 0; lf.lfEscapement = 0; lf.lfOrientation = 0; lf.lfWeight = FW_NORMAL; lf.lfItalic = FALSE; lf.lfUnderline = FALSE; lf.lfStrikeOut = FALSE; lf.lfCharSet = SHIFTJIS_CHARSET; lf.lfOutPrecision = OUT_DEFAULT_PRECIS; lf.lfClipPrecision = CLIP_DEFAULT_PRECIS; lf.lfQuality = DEFAULT_QUALITY; lf.lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE; strcpy(lf.lfFaceName, "MS ゴシック"); m_small_font = CreateFontIndirect(&lf); } }
//------------------------------------------------------------------------------------------------- // event handler void TraceWindow::OnCommand(int p_ctrlID, int p_notify) { switch (p_ctrlID) { case IDC_CMB_CATEGORY: switch (p_notify) { case CBN_SELCHANGE: HWND cmb = GetDlgItem(m_dlg->getHwnd(), IDC_CMB_CATEGORY); m_category = SendMessage(cmb, CB_GETCURSEL, 0L, 0L); clearColumns(); switch (m_category) { case TraceWindow::kCat_CallStack: AddCol("addr", 52, true, NULL); AddCol("from", 52, true, NULL); AddCol("label", 120, false, NULL); break; case TraceWindow::kCat_JumpLog: AddCol("addr", 52, true, NULL); AddCol("count", 170, true, NULL); break; } SetScrollMax(GetAllLine()); m_head = 0; SetScrollPos(m_dlg->getHwnd(), SB_VERT, m_head, true); Draw(); break; } break; } }
void cRedirects::AddFields() { AddCol("address", "varchar(125)", "", false, mModel.mAddress); AddPrimaryKey("address"); AddCol("flag", "smallint(5)", "", false, mModel.mFlag); AddCol("enable", "tinyint(1)", "1", true, mModel.mEnable); mMySQLTable.mExtra = "PRIMARY KEY(address)"; SetBaseTo(&mModel); }
void cForbidden::AddFields() { AddCol("word","varchar(100)","", false,mModel.mWord); AddPrimaryKey("word"); AddCol("check_mask","tinyint(4)","1",true,mModel.mCheckMask); // mask 1 -> public, mask 2 -> private AddCol("afclass","tinyint(4)", "4", true, mModel.mAfClass); // affected class. normal=1, vip=2, cheef=3, op=4, admin=5, master=10 AddCol("banreason", "varchar(50)", "", true, mModel.mReason);// reason of kick mMySQLTable.mExtra =" PRIMARY KEY(word)"; }
void cIPLog::AddFields() { // this is useful for the parent class mMySQLTable.mName = "pi_iplog"; AddCol("date","int(11)","",true, mModel.mDate ); AddCol("action","smallint(6)","0",true, mModel.mType); AddCol("ip", "bigint(20)","",true, mModel.mIP); AddCol("nick", "varchar(64)","",true, mModel.mNick); AddCol("info","int(11)","",true, mModel.mInfo); mMySQLTable.mExtra="id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY," "index ind_ip(ip), index ind_nick(nick)"; SetBaseTo(&mModel); }
long GenModelCplex::AddSolverColumn(int count, int* ind, double* val, double obj, double lb, double ub, string name, char type) { AddModelColumn(count, ind, val, obj, lb, ub, name, type); AddCol(ind, val, count, obj, lb, ub, name.c_str(), type); return 0; }
void MultiViewerMain::OnPopupClick(wxCommandEvent &evt) { switch(evt.GetId()) { case eSelectAllOnPage: m_pTableDBDataGrid->SelectAll(); break; case eDeleteAll: m_pTableDBDataGrid->SelectAll(); break; case eAddRow: AddRow(); break; case eDeleteCurrentRow: DeleteRow(); break; case eModifyCurrentCol: ModifyCol(); break; case eDeleteCurrentCol: DeleteCol(); break; case eAddCol: AddCol(); break; default: break; } }
void cPlugs::AddFields() { AddCol("nick","varchar(10)","",false,mModel.mNick); AddPrimaryKey("nick"); AddCol("path","varchar(128)","",false,mModel.mPath); AddCol("dest","varchar(10)","",true,mModel.mDest); AddCol("detail","text","",true,mModel.mDesc); AddCol("autoload","tinyint(1)","1",true,mModel.mLoadOnStartup); AddCol( "reload","tinyint(1)","0",true,mModel.mReloadNext); AddCol( "unload","tinyint(1)","0",true,mModel.mUnloadNext); AddCol("error","text","",true,mModel.mLastError); AddCol("lastload","int(11)","",true,mModel.mLoadTime); mMySQLTable.mExtra = "PRIMARY KEY(nick)"; }
long GenModelCplex::AddSolverCol(vector<int>& ind, vector<double>& val, double obj, double lb, double ub, string name, char type) { if(!bcreated) return ThrowError("AddSolverCol() not available : Problem not created yet"); AddModelCol(ind, val, obj, lb, ub, name, type); AddCol(&ind[0], &val[0], int(ind.size()), obj, lb, ub, name.c_str(), type); return 0; }
void C4Scoreboard::SetCell(int32_t iColKey, int32_t iRowKey, const char *szValue, int32_t iValue) { // ensure primary row/col exists if (!iCols || !iRows) { if (!iCols) AddCol(0); if (!iRows) AddRow(0); GetCell(0, 0)->iVal = TitleKey; } // get row/col; create new if not yet existing int32_t iCol = GetColByKey(iColKey); if (iCol<0) { AddCol(iCol=iCols); GetCell(iCol, 0)->iVal = iColKey; } int32_t iRow = GetRowByKey(iRowKey); if (iRow<0) { AddRow(iRow=iRows); GetCell(0, iRow)->iVal = iRowKey; } // now set values Entry *pCell = GetCell(iCol, iRow); pCell->Text.Copy(szValue); if (iCol && iRow) pCell->iVal = iValue; // do NOT overwrite index keys! // if an empty value was set, prune empty if (!szValue || !*szValue) { // prune empty row (not label row) int32_t i; if (iRow) { for (i=1; i<iCols; ++i) if (GetCell(i, iRow)->Text) break; if (i == iCols) DelRow(iRow); } // prune empty col (not label col) if (iCol) { for (i=1; i<iRows; ++i) if (GetCell(iCol, i)->Text) break; if (i == iRows) DelCol(iCol); } } /* // prune empty board? but this would prevent boards that just sort if (iRows == 1 && iCols == 1) Clear(); // must not do this, because it will del pDlg else*/ // recalc row widths in display (else done by clear) InvalidateRows(); }
void cTriggers::AddFields() { AddCol("command", "varchar(30)", "", false, mModel.mCommand); AddPrimaryKey("command"); AddCol("send_as", "varchar(128)", "", true, mModel.mSendAs); AddCol("def", "text", "", true, mModel.mDefinition); AddCol("descr", "text", "", true, mModel.mDescription); AddCol("min_class", "int(2)", "", true, mModel.mMinClass); AddCol("max_class", "int(2)", "10", true, mModel.mMaxClass); AddCol("flags", "int(2)", "0", true, mModel.mFlags); AddCol("seconds", "int(15)", "0", true, mModel.mSeconds); mMySQLTable.mExtra = "PRIMARY KEY(command)"; SetBaseTo(&mModel); }
void cMsgList::AddFields() { // this is useful for the parent class mMySQLTable.mName = "pi_messages"; // add every field you want to be able to load simply // add also primary key fields // the string constans here must correspont to field names AddCol("sender","varchar(32)","",false,mModel.mSender); AddPrimaryKey("sender"); AddCol("date_sent","int(11)","",false, mModel.mDateSent); AddPrimaryKey("date_sent"); AddCol("sender_ip","varchar(15)","",true, mModel.mSenderIP); AddCol("receiver","varchar(32)","",false, mModel.mReceiver ); AddCol("date_expires","int(11)","0",true, mModel.mDateExpires ); AddCol("subject","varchar(128)","",true, mModel.mSubject ); AddCol("body","text","",true, mModel.mBody ); mMySQLTable.mExtra="PRIMARY KEY (sender, date_sent)"; SetBaseTo(&mModel); }
cPenaltyList::cPenaltyList(cMySQL &mysql) : cConfMySQL(mysql), mCache(mysql, "temp_rights", "nick") { mMySQLTable.mName = "temp_rights"; AddCol("nick", "varchar(64)", "", false, mModel.mNick); AddPrimaryKey("nick"); AddCol("op", "varchar(64)", "", true, mModel.mOpNick); AddCol("since", "int(11)", "", true, mModel.mSince); AddCol("st_chat", "int(11)", "1", true, mModel.mStartChat); AddCol("st_search", "int(11)", "1", true, mModel.mStartSearch); AddCol("st_ctm", "int(11)", "1", true, mModel.mStartCTM); AddCol("st_pm", "int(11)", "1", true, mModel.mStartPM); AddCol("st_kick", "int(11)", "1", true,mModel.mStopKick); AddCol("st_share0", "int(11)", "1", true, mModel.mStopShare0); AddCol("st_reg", "int(11)", "1", true, mModel.mStopReg); AddCol("st_opchat", "int(11)", "1", true, mModel.mStopOpchat); mMySQLTable.mExtra = "PRIMARY KEY(nick), "; mMySQLTable.mExtra = "INDEX creation_index(since)"; SetBaseTo(&mModel); }
void cStats::AddFields() { mMySQLTable.mName = "pi_stats"; int i; ostringstream field_name; AddCol("realtime","int(11)","",false, mTime); AddPrimaryKey("realtime"); AddCol("uptime", "int(11)","",true,mUptimeSec); AddCol("users_total","int(11)","0",true, mS->mUserCountTot); for(i=0; i <= USER_ZONES; i++) { field_name.str(""); field_name << "users_zone" << i; AddCol(field_name.str().data(),"int(11)","0",true, mS->mUserCount[i]); } AddCol("upload_total","double","0",true, mUploadTotalBps); for(i=0; i <= USER_ZONES; i++) { field_name.str(""); field_name << "upload_zone" << i; AddCol (field_name.str().data(),"double","0",true, mUploadInZonesBps[i]); } AddCol("share_total_gb","int(11)","0",true, mShareTotalGB); AddCol("freq_search_active","double","0",true, mFreqSearchA); AddCol("freq_search_passive","double","0",true, mFreqSearchP); AddCol("freq_user_login","double","0",true, mFreqUserLogin); AddCol("freq_user_logout","double","0",true, mFreqUserLogout); mMySQLTable.mExtra ="PRIMARY KEY (realtime)"; SetBaseTo(this); }
cRegList::cRegList(cMySQL &mysql, cServerDC *server): cConfMySQL(mysql) ,mCache(mysql,"reglist", "nick", "reg_date"), mS (server) { //cTime now; SetClassName("nDC::cRegList"); mMySQLTable.mName="reglist"; ostringstream nickDomain; nickDomain << "varchar("; nickDomain << mS->mC.max_nick; nickDomain << ")"; AddCol("nick", nickDomain.str().c_str(), "", false, mModel.mNick); AddPrimaryKey("nick"); AddCol("class", "int(2)", "1", true, mModel.mClass); AddCol("class_protect", "int(2)", "0", true, mModel.mClassProtect); AddCol("class_hidekick", "int(2)", "0", true, mModel.mClassHideKick); AddCol("hide_kick", "tinyint(1)", "0", true, mModel.mHideKick); AddCol("hide_keys", "tinyint(1)", "0", true, mModel.mHideKeys); AddCol("hide_share", "tinyint(1)", "0", true, mModel.mHideShare); AddCol("hide_ctmmsg", "tinyint(1)", "0", true, mModel.mHideCtmMsg); AddCol("reg_date", "int(11)", "", true, mModel.mRegDate); AddCol("reg_op", "varchar(64)", "", true, mModel.mRegOp); AddCol("pwd_change", "tinyint(1)", "1", true, mModel.mPwdChange); AddCol("pwd_crypt", "tinyint(1)", "1", true, mModel.mPWCrypt); AddCol("login_pwd", "varchar(60)", "", true, mModel.mPasswd); AddCol("login_last", "int(11)", "0", true, mModel.mLoginLast); AddCol("logout_last", "int(11)", "0", true, mModel.mLogoutLast); AddCol("login_cnt", "int(11)", "0", true, mModel.mLoginCount); AddCol("login_ip", "varchar(16)", "", true, mModel.mLoginIP); AddCol("error_last", "int(11)", "", true, mModel.mErrorLast); AddCol("error_cnt", "int(11)", "0", true, mModel.mErrorCount); AddCol("error_ip", "varchar(16)", "", true, mModel.mErrorIP); AddCol("enabled", "tinyint(1)", "1", true, mModel.mEnabled); AddCol("email", "varchar(60)", "", true, mModel.mEmail); AddCol("note_op", "text", "", true, mModel.mNoteOp); AddCol("note_usr", "text", "", true, mModel.mNoteUsr); AddCol("auth_ip", "varchar(15)", "", true, mModel.mAuthIP); AddCol("alternate_ip", "varchar(16)", "", true, mModel.mAlternateIP); mMySQLTable.mExtra = "PRIMARY KEY(nick), "; mMySQLTable.mExtra+= "INDEX login_index (login_last), "; mMySQLTable.mExtra+= "INDEX logout_index (logout_last)"; SetBaseTo(&mModel); }