void LayoutsConfigWidget::FillModels () { if (auto rc = AvailableModel_->rowCount ()) AvailableModel_->removeRows (0, rc); if (auto rc = EnabledModel_->rowCount ()) EnabledModel_->removeRows (0, rc); auto layouts = KBCtl::Instance ().GetRulesStorage ()->GetLayoutsN2D (); const auto& enabledGroups = KBCtl::Instance ().GetEnabledGroups (); QList<QStringList> enabled; for (const auto& name : enabledGroups) { const QStringList enabledRow { name, layouts.take (name), KBCtl::Instance ().GetGroupVariant (name) }; enabled << enabledRow; } SetList (ToSortedList (layouts), AvailableModel_); SetList (enabled, EnabledModel_); }
void CMcCurvePage2::OnBnClickedButton2()//提交 { if (editindex==-1) { AfxMessageBox("请选择要提交的曲线"); return; } UpdateData(); TCurve newcurve; memset(&newcurve,0,sizeof(TCurve)); newcurve.BcurvechannelNO=m_BchannelNO; newcurve.Bdot=m_BDot; newcurve.Bprecision=m_BPrecision+1; CString fa; fa.Format("%0.3f",m_fRatio); newcurve.fcurveratio=atof(fa); m_staticcolor.GetColor(&m_nColor); newcurve.ncurvecolor=m_nColor; newcurve.nlinenode=m_nlinenode; newcurve.nlineline=m_nlineline; newcurve.nlinertu=m_nlinertu; if (m_unit.GetLength()>0) strcpy(newcurve.unit,m_unit); switch (nCurveSel) { case 0: pmccurvedata->gtIcurvearray.SetAt(editindex,newcurve); SetList(&pmccurvedata->gtIcurvearray); break; case 1: pmccurvedata->gtVcurvearray.SetAt(editindex,newcurve); SetList(&pmccurvedata->gtVcurvearray); break; case 2: pmccurvedata->zbIcurvearray.SetAt(editindex,newcurve); SetList(&pmccurvedata->zbIcurvearray); break; case 3: pmccurvedata->zbVcurvearray.SetAt(editindex,newcurve); SetList(&pmccurvedata->zbVcurvearray); break; default: break; } }
void ODSItemState :: SetState (PropertyHandle *ph ) { SetValue(ph); SetList(ph); }
XCefValue& XCefValue::operator=(CefRefPtr<CefListValue> & lst) { if (reinterpret_cast<XCefValue*>(&lst) == this) return *this; SetList(lst); return *this; }
void AddToBlockedRunner::AddToList (const QString& name, PrivacyList list, bool activate) { deleteLater (); if (list.GetName ().isEmpty ()) list.SetName (name); auto items = list.GetItems (); const auto& presentIds = QSet<QString>::fromList (Util::Map (items, &PrivacyListItem::GetValue)); bool modified = false; for (const auto& id : Ids_) { if (presentIds.contains (id)) continue; items.prepend ({ id, PrivacyListItem::Type::Jid }); modified = true; } if (!modified) return; list.SetItems (items); const auto plm = Conn_->GetPrivacyListsManager (); plm->SetList (list); if (activate) plm->ActivateList (list.GetName (), PrivacyListsManager::ListType::Default); }
bool CSMTP_Logic::HandleCommand(CMessage *pMsg) { if(!pMsg->sCmd.Compare("spam.setlist")) { m_sListURL.Assign(pMsg->sChatString.Token(1, " ")); g_pMainCtrl->m_cIRC.SendMsg(pMsg->bSilent, pMsg->bNotice, \ "Downloading new email list.", pMsg->sReplyTo.Str()); SetList(m_sListURL); g_pMainCtrl->m_cIRC.SendMsg(pMsg->bSilent, pMsg->bNotice, \ "Finished downloading new email list.", pMsg->sReplyTo.Str()); return true; } else if(!pMsg->sCmd.Compare("spam.settemplate")) { m_sTemplateURL.Assign(pMsg->sChatString.Token(1, " ")); g_pMainCtrl->m_cIRC.SendMsg(pMsg->bSilent, pMsg->bNotice, \ "Downloading new email template.", pMsg->sReplyTo.Str()); SetTemplate(m_sTemplateURL); g_pMainCtrl->m_cIRC.SendMsg(pMsg->bSilent, pMsg->bNotice, \ "Finished downloading new email template.", pMsg->sReplyTo.Str()); return true; } else if(!pMsg->sCmd.Compare("spam.start")) { m_bSpamming=true; g_pMainCtrl->m_cIRC.SendMsg(pMsg->bSilent, pMsg->bNotice, \ "Started spamming.", pMsg->sReplyTo.Str()); return true; } else if(!pMsg->sCmd.Compare("spam.stop")) { m_bSpamming=false; g_pMainCtrl->m_cIRC.SendMsg(pMsg->bSilent, pMsg->bNotice, \ "Stopped spamming.", pMsg->sReplyTo.Str()); return true; } return false; }
//提交 void CYMcCurvePage2::OnBnClickedButton1() { if (m_nEditIndex==-1) { AfxMessageBox("请选择要提交的曲线"); return; } if(curvearray.GetCount() < 1) { AfxMessageBox("请先添加曲线") ; return ; } UpdateData(); ymcurve_info newcurve ; strcpy(newcurve.ename ,m_ename) ; strcpy(newcurve.cname ,m_cname) ; m_stColor.GetColor(&m_nColor); newcurve.color = m_nColor ; curvearray.SetAt(m_nEditIndex,newcurve); SetList(&curvearray) ; }
/**************************************************************************** ** *F FuncLIST_SORTED_LIST( <self>, <list> ) . . . . . make a set from a list ** ** 'FuncLIST_SORTED_LIST' implements the internal function 'SetList'. ** ** 'SetList( <list> )' ** ** 'SetList' returns a new proper set, which is represented as a sorted list ** without holes or duplicates, containing the elements of the list <list>. ** ** 'SetList' returns a new list even if the list <list> is already a proper ** set, in this case it is equivalent to 'ShallowCopy' (see "ShallowCopy"). */ Obj FuncLIST_SORTED_LIST ( Obj self, Obj list ) { Obj set; /* result */ /* check the argument */ while ( ! IS_SMALL_LIST( list ) ) { list = ErrorReturnObj( "Set: <list> must be a small list (not a %s)", (Int)TNAM_OBJ(list), 0L, "you can replace <list> via 'return <list>;'" ); } /* if the list is empty create a new empty list */ if ( LEN_LIST(list) == 0 ) { set = NEW_PLIST( T_PLIST_EMPTY, 0 ); } /* if <list> is a set just shallow copy it */ else if ( /* IS_HOMOG_LIST(list) && */ IS_SSORT_LIST(list) ) { set = SHALLOW_COPY_OBJ( list ); } /* otherwise let 'SetList' do the work */ else { set = SetList( list ); } /* return the set */ return set; }
void GlooxCLEntry::addToPrivacyList (bool add) { const auto& jid = GetJID (); auto lists = Account_->GetClientConnection ()->GetPrivacyListsManager (); auto current = lists->GetCurrentList (); auto items = current.GetItems (); for (const auto& item : items) { if (item.GetType () != PrivacyListItem::TJid) continue; if (item.GetValue () != jid) continue; if ((item.GetAction () == PrivacyListItem::AAllow && !add) || (item.GetAction () == PrivacyListItem::ADeny && add)) return; if (!add) { items.removeAll (item); break; } } if (add) items.append (PrivacyListItem (jid, PrivacyListItem::TJid)); if (items.size () == current.GetItems ().size ()) return; current.SetItems (items); lists->SetList (current); }
/* * Get the AIF of the partially evaluated var of array type. * */ static AIF * X10GetPartialArrayAIF(MISession *session, char *expr, x10_var_t *var) { AIF * a = NULL; AIF * ac; int i= 0; int id; x10_var_t * child = NULL; DEBUG_PRINTF(DEBUG_LEVEL_BACKEND, "---------------------- GetPartialArrayAIF (%s, %s)\n", expr != NULL ? expr : "NULL", var->var->type_name); if (var->children == NULL || var->var->num_children <= 0) { id = X10GetArrayBaseType(session, var); ac = X10CreateSimpleAIF(id, ""); int numChildren = var->var->num_children; a = EmptyArrayToAIF(0, numChildren, ac); AIFFree(ac); } else { for (SetList(var->children); (child = (x10_var_t *)GetListElement(var->children)) != NULL;) { ac = X10GetPartialAIF(session, expr, child); int numChildren = var->var->num_children; if (ac != NULL) { if (a == NULL) { a = EmptyArrayToAIF(0, numChildren, ac); } AIFAddArrayElement(a, i, ac); AIFFree(ac); } i++; } } return a; }
//--------------------------------------------------------------------------- __fastcall TPointersViewBox::TPointersViewBox(TComponent* Owner) : TGroupBox(Owner) { Init(); NotifyDblClick=NULL; SetList(boost::shared_ptr< std::vector<PointerType> >((std::vector<PointerType>*)0)); PointersBox->OnKeyDown=KeyDown; }
BOOL WcDependencies::OnInitDialog() { CPropertyPage::OnInitDialog(); SetList(); return TRUE; // return TRUE unless you set the focus to a control }
bool ClientApp::OnProcessMessageReceived( CefRefPtr<CefBrowser> browser, CefProcessId source_process, CefRefPtr<CefProcessMessage> message) { ASSERT(source_process == PID_BROWSER); bool handled = false; RenderDelegateSet::iterator it = render_delegates_.begin(); for (; it != render_delegates_.end() && !handled; ++it) { handled = (*it)->OnProcessMessageReceived(this, browser, source_process, message); } if (handled) return true; // Execute the registered JavaScript callback if any. if (!callback_map_.empty()) { CefString message_name = message->GetName(); CallbackMap::const_iterator it = callback_map_.find( std::make_pair(message_name.ToString(), browser->GetIdentifier())); if (it != callback_map_.end()) { // Keep a local reference to the objects. The callback may remove itself // from the callback map. CefRefPtr<CefV8Context> context = it->second.first; CefRefPtr<CefV8Value> callback = it->second.second; // Enter the context. context->Enter(); CefV8ValueList arguments; // First argument is the message name. arguments.push_back(CefV8Value::CreateString(message_name)); // Second argument is the list of message arguments. CefRefPtr<CefListValue> list = message->GetArgumentList(); CefRefPtr<CefV8Value> args = CefV8Value::CreateArray(static_cast<int>(list->GetSize())); SetList(list, args); arguments.push_back(args); // Execute the callback. CefRefPtr<CefV8Value> retval = callback->ExecuteFunction(NULL, arguments); if (retval.get()) { if (retval->IsBool()) handled = retval->GetBoolValue(); } // Exit the context. context->Exit(); } } return handled; }
bool Defines::AddToList(String key, String data) { TStringList *s = GetList(key); if (s==0) return 0; s->Add(data); SetList(key,s); delete s; return 1; }
ListPaneImpl( const WinPoint& sizeMin, List* plist, ItemPainter* ppainter, ScrollPane* pscroll, bool bHorizontal ) : m_sizeMin(sizeMin), m_ppainter(ppainter), m_pscroll(pscroll), m_indexSelection(0), m_posScroll(0), m_pitemSelection(NULL), m_pitemSelectionPrevious(NULL), m_bHorizontal(bHorizontal), m_iOldSelection(-1), m_bNeedScrollUpdate(false), m_bNeedSelectionOnScreen(false) { m_peventSelection = new IItemEvent::SourceImpl(); m_peventSingleClick = new EventSourceImpl(); m_peventDoubleClick = new EventSourceImpl(); m_peventSingleRightClick = new EventSourceImpl(); m_peventDoubleRightClick = new EventSourceImpl(); if (m_ppainter == NULL) { m_ppainter = new DefaultItemPainter(); } if (m_pscroll) { m_pscroll->GetEventSource()->AddSink( m_pintegerEventSink = IIntegerEventSink::CreateDelegate(this) ); } if (plist == NULL) { SetList(new EmptyList()); } else { SetList(plist); } UpdateScrollBar(); }
static void dbg_add_strings(proxy_msg *m, List *lst) { char * s; proxy_msg_add_int(m, SizeOfList(lst)); for (SetList(lst); (s = (char *)GetListElement(lst)) != NULL; ) { proxy_msg_add_string(m, s); } }
static void dbg_add_stackframes(proxy_msg *m, List *lst) { stackframe * s; proxy_msg_add_int(m, SizeOfList(lst)); for (SetList(lst); (s = (stackframe *)GetListElement(lst)) != NULL; ) { dbg_add_stackframe(m, s); } }
static void dbg_add_signals(proxy_msg *m, List *lst) { signal_info * s; proxy_msg_add_int(m, SizeOfList(lst)); for (SetList(lst); (s = (signal_info *)GetListElement(lst)) != NULL; ) { dbg_add_signalinfo(m, s); } }
static void dbg_add_memories(proxy_msg *m, List *lst) { memory * mem; proxy_msg_add_int(m, SizeOfList(lst)); for (SetList(lst); (mem = (memory *)GetListElement(lst)) != NULL; ) { dbg_add_memory(m, mem); } }
BOOL CYMcCurvePage2::OnInitDialog() { CPropertyPage::OnInitDialog(); // TODO: 在此添加额外的初始化 DrawListTitle() ; SetList(&curvearray) ; return TRUE; // return TRUE unless you set the focus to a control // 异常:OCX 属性页应返回 FALSE }
void Defines::RemoveFromList(String keyList, String data) { TStringList *s = GetList(keyList); if (s==0) return; int i=s->IndexOf(data); if (i>=0) s->Delete(i); SetList(keyList,s); delete s; }
void __fastcall TPointersViewBox::PasteMenuItemClick(TObject*) { if(FList) if((FList->size()>0)&&(PoitersDB.size()>0)) { //FList->Clear(); boost::shared_ptr<std::vector<PointerType> > list = boost::shared_ptr<std::vector<PointerType> >(new std::vector<PointerType>()); std::vector<PointerType>& sourceList=*(PoitersDB[0]); (*list) = sourceList; SetList(list); } }
FreqWindow::FreqWindow(BPoint p) : BWindow(BRect(p.x,p.y,p.x,p.y),Language.get("FREQ_WINDOW"),B_FLOATING_WINDOW_LOOK,B_FLOATING_APP_WINDOW_FEEL, B_NOT_RESIZABLE|B_NOT_ZOOMABLE) { BRect r(0,0,180,180); ResizeTo(r.Width(), r.Height()); MoveBy(-r.Width()/2, -r.Height()/2); view = new BView(r, NULL, B_FOLLOW_ALL, B_WILL_DRAW); r.InsetBy(8,8); r.right = 70; r.top += 28; // space for the textbox list = new BListView(r,"Freq list"); BScrollView *sv = new BScrollView("scroll", list, B_FOLLOW_ALL_SIDES, B_WILL_DRAW, false, true, B_PLAIN_BORDER); sv->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); sv->MakeFocus(false); view->AddChild(sv); r.Set(4,8,85,28); text = new SpinControl(r, NULL, NULL, new BMessage(SET_TEXT), 4000, 96000, 44100, 500); view->AddChild(text); r = Bounds(); r.left = r.right - 85; r.top = r.bottom - 32; r.bottom -=8; r.right -= 8; view->AddChild(new BButton(r, NULL, Language.get("OK"), new BMessage(SET)) ); r.OffsetBy(0,-30); view->AddChild(new BButton(r, NULL, Language.get("CANCEL"), new BMessage(QUIT)) ); view->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); AddChild(view); BStringItem *it; list->AddItem(it = new BStringItem("96000")); list->AddItem(it = new BStringItem("64000")); list->AddItem(it = new BStringItem("48000")); list->AddItem(it = new BStringItem("44100")); list->AddItem(it = new BStringItem("32000")); list->AddItem(it = new BStringItem("22050")); list->AddItem(it = new BStringItem("16000")); list->AddItem(it = new BStringItem("12500")); list->AddItem(it = new BStringItem("11025")); list->AddItem(it = new BStringItem("8000")); list->SetSelectionMessage(new BMessage(SELECT)); list->SetInvocationMessage(new BMessage(SELECT)); SetList(); m_old = Pool.frequency; Run(); Show(); }
//删除曲线 void CYMcCurvePage2::OnBnClickedButton3() { // TODO: 在此添加控件通知处理程序代码 int delindex =(int) m_CurveList.GetFirstSelectedItemPosition()-1; if (delindex==-1) { AfxMessageBox("请选择要删除的曲线"); return; } curvearray.RemoveAt(delindex) ; int i = curvearray.GetCount() ; SetList(&curvearray) ; }
//------------------------------------------------------------------------------------------------- tHobartMagVarAction::tHobartMagVarAction( tMagVarSettings* pMagVarSettings, const QString& text, QObject* pParent ) : tListAction( (text.isEmpty()? tr("Magnetic variation") : text), QStringList(), 0, Action::AutoShowPopup, pParent ) , m_pMagVarSettings( pMagVarSettings ) { BuildMagVarOptions(); SetList( m_MagVarOptions ); SetValue( m_pMagVarSettings->MagVarAuto() == false ); setWhatsThis( tr("Magnetic variation can be set manually for the current location. When set to Auto, the local magnetic variation is calculated.", "'What's this' help text") ); Connect( this, SIGNAL( Activated( int ) ), this, SLOT( SetMagVar( int ) ) ); Connect( m_pMagVarSettings, SIGNAL( MagVarAutoChanged( bool ) ), this, SLOT( OnMagVarAutoChanged( bool ) ) ); Connect( m_pMagVarSettings, SIGNAL( MagVarManualValueChanged( float ) ), this, SLOT( OnMagVarManualValueChanged( float ) ) ); }
bool CNMS_DBMngt::SetSubscribersList(std::list<DevInfo>& p_rSubscList) { IDbSPHelper *pHelper = Connect(); if (pHelper == NULL) return false; if (!ClearList(pHelper)) return false; if (!SetList(pHelper, p_rSubscList)) return false; delete pHelper; return true; }
void CPertDlg::OnRestore() { for (int i=0; i<m_nc;i++){ m_cnr[i] = m_backr[i]; m_cni[i] = m_backi[i]; m_backi[i] = m_cni[i]; } SetList(); m_ctrlCnList.SetCurSel(0); m_ctrlCnr.SetValue(m_cnr[0]); m_ctrlCni.SetValue(m_cni[0]); m_ctrlCnList.SetFocus(); }
void __fastcall TPointersViewBox::LoadPointersFromFile(TObject*) { if(FList) { boost::shared_ptr<TOpenDialog> dialog=boost::shared_ptr<TOpenDialog>(new TOpenDialog(NULL)); if(dialog->Execute()) { boost::shared_ptr<std::ifstream> file=boost::shared_ptr<std::ifstream>(new std::ifstream(dialog->FileName.c_str())); boost::shared_ptr< std::vector<PointerType> > list(new std::vector<PointerType>()); ReadTListFromStream(*list,*file); SetList(list); } } }
void FreqWindow::MessageReceived(BMessage* msg){ int32 i; BStringItem *item = NULL; switch(msg->what){ case QUIT: Pool.frequency = m_old; Quit(); break; case SET: // set the freq Pool.InitBufferPlayer( Pool.frequency ); Quit(); break; case SELECT: i = list->CurrentSelection(); if(i < 0) break; // nothing selected item = (BStringItem*)list->ItemAt(i); Pool.frequency = atof( item->Text() ); text->SetValue(Pool.frequency); SetList(); list->Invalidate(); break; case SET_TEXT: Pool.frequency = text->Value(); SetList(); list->Invalidate(); break; default: BWindow::MessageReceived(msg); } }
Obj FuncIS_EQUAL_SET ( Obj self, Obj list1, Obj list2 ) { /* check the arguments, convert to sets if necessary */ while ( ! IS_SMALL_LIST(list1) ) { list1 = ErrorReturnObj( "IsEqualSet: <list1> must be a small list (not a %s)", (Int)TNAM_OBJ(list1), 0L, "you can replace <list1> via 'return <list1>;'" ); } if ( ! IsSet( list1 ) ) list1 = SetList( list1 ); while ( ! IS_SMALL_LIST(list2) ) { list2 = ErrorReturnObj( "IsEqualSet: <list2> must be a small list (not a %s)", (Int)TNAM_OBJ(list2), 0L, "you can replace <list2> via 'return <list2>;'" ); } if ( ! IsSet( list2 ) ) list2 = SetList( list2 ); /* and now compare them */ return (EqSet( list1, list2 ) ? True : False ); }