本文整理汇总了C++中ListItem类的典型用法代码示例。如果您正苦于以下问题:C++ ListItem类的具体用法?C++ ListItem怎么用?C++ ListItem使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ListItem类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: VERIFY
void TItemList::RenameItem(LPCSTR fn0, LPCSTR fn1, EItemType type)
{
if (!OnItemRenameEvent.empty()) OnItemRenameEvent(fn0,fn1,type);
if (type==TYPE_OBJECT){
TElTreeItem* item0 = FHelper.FindObject(tvItems,fn0); VERIFY(item0);
ListItem* prop = (ListItem*)item0->Tag; VERIFY(prop);
prop->SetName (fn1);
TElTreeItem* item1 = FHelper.FindObject(tvItems,fn1);
if (item1) prop->item = item1;
}
}
示例2: VERIFY
void __fastcall TfrmEditLightAnim::OnItemFocused(TElTreeItem* item)
{
if (item&&FHelper.IsObject(item)){
ListItem* prop = (ListItem*)item->Tag; VERIFY(prop);
AnsiString nm = prop->Key();
CLAItem* I = LALib.FindItem(nm.c_str());
SetCurrentItem (I,prop);
}else{
SetCurrentItem (0,0);
}
}
示例3: isNewItemCheckable
bool ListModel::isNewItemCheckable(ListItem* parent, int row)
{
if (row > 0) {
ListItem* previous = parent->child(row - 1);
if (previous)
return previous->isCheckable();
} else
return parent->isProject() || parent->isMilestone();
return false;
}
示例4: out_of_range
int &List::getNthElement(int n) {
if (currentSize >= n + 1 && n >= 0) {
ListItem* tmp = first;
for (int i = 0; i < n; i++) {
tmp = tmp->getNext();
}
return tmp->getContent();
}
else
throw std::out_of_range("List index out of range");
}
示例5: ListItem
void ListBox::CreateItems()
{
if (format_.fontPointSize() > 16.0)
format_.setFontPointSize(16.0);
for (size_t i = 0; i < data_.size(); i++)
{
ListItem* item = new ListItem(ctx_, data_[i], this);
item->setFont(format_.font());
}
setMinimumSize(minimumSize().width(), sizeHint().height());
}
示例6: getText
const std::string& ComboBox::getItemText(int itemIndex) const
{
if (itemIndex >= 0 && (size_t)itemIndex < m_items.size()) {
ListItem* item = m_items[itemIndex];
return item->getText();
}
else {
// Returns the text of the combo-box (it should be empty).
ASSERT(getText().empty());
return getText();
}
}
示例7: ListItem
void ListWidget::addItem(const std::string &content)
{
ListItem* item = new ListItem();
item->setText(content);
item->setRelativePosition(computeItemPosition(items_.size()));
item->setSize({this->getSize().x - SCROLLBAR_WIDTH, ITEM_HEIGHT});
items_.push_back(std::unique_ptr<ListItem>(item));
// If this is the first item, select it
if(items_.size() == 1)
selectItem(*item);
}
示例8: deleteLast
int List::deleteLast() {
if (currentSize != 0) {
int tmp = last->getContent();
ListItem *del = last;
last = del->getPrevious();
delete del;
currentSize--;
return tmp;
}
else
return 0;
}
示例9: addItem
int List::addItem(std::vector< std::string >* values)
{
ListItem tempItem; //Creating a tempororary item
tempItem.create(colWidth, values, x, nextItemY);
listItems->push_back(tempItem);
nextItemY = nextItemY + rowHeight;
return 0;
}
示例10: SignalStop
void C4PortraitSelDlg::LoaderThread::Execute() {
// list empty?
if (!LoadItems.size()) {
// then we're done!
SignalStop();
return;
}
// load one item at the time
ListItem *pLoadItem = LoadItems.front();
pLoadItem->Load();
LoadItems.erase(LoadItems.begin());
}
示例11: ListItem
void NotesWidget::insertNewNote(QString guid, QString noteBook, QString title)
{
ListItem* item = new ListItem(this);
item->setText(title);
item->setNoteBookGUID(noteBook);
item->setIcon(QIcon::fromTheme("basket"));
item->setGUID(guid);
signalsDisabled = true;
setCurrentItem(item);
signalsDisabled = false;
}
示例12: deleteFirst
int List::deleteFirst() {
if (currentSize != 0) {
int tmp = first->getContent();
ListItem *del = first;
first = del->getNext();
delete del;
currentSize--;
return tmp;
}
else
return 0;
}
示例13: CheckEvent
STDMETHODIMP OrxEvent::CheckEvent(LPCOLESTR Code, IDispatch **pbIDispatch)
{
ListItem *Current;
ESource *Content;
HRESULT RetCode=DISP_E_UNKNOWNNAME;
int i=0;
size_t CodeLen;
RetCode = DISP_E_UNKNOWNNAME;
if (!Code)
{
RetCode = E_POINTER;
}
else
{
CodeLen = wcslen(Code);
}
if (!pbIDispatch)
{
RetCode = E_POINTER;
}
else
{
*pbIDispatch = (IDispatch *)NULL;
}
if (RetCode == DISP_E_UNKNOWNNAME)
{
while (Current = EventSourceChain->FindItem(i++))
{
Content = (ESource *)Current->GetContent();
if (Content->EventType == ESource::ParseProcedure)
{
if (CodeLen == Content->CodeLen)
{
if (Content->Code)
{
if (wcsicmp(Code,Content->Code) == 0)
{
*pbIDispatch = (IDispatch *)Content;
RetCode = S_OK;
((IDispatch*) Content)->AddRef();
break;
}
}
}
}
}
}
FPRINTF2(logfile,"OrxEvent::CheckEvent() HRESULT %08x. \n",RetCode);
return RetCode;
}
示例14: setNoteSortType
void NotesWidget::setNoteSortType(qint8 type)
{
sortType = type;
for (int i = 0; i < count(); i++) {
ListItem* item = reinterpret_cast<ListItem*>(this->item(i));
item->setSortType(sortType);
}
sortItems();
sql::updateSyncStatus("noteSortType", sortType);
}
示例15: getNoteWithGuid
ListItem* NotesWidget::getNoteWithGuid(QString guid)
{
ListItem* item = reinterpret_cast<ListItem*>(this->currentItem());
if ((item != NULL) && (item->getGUID() == guid))
return item;
for (int i = 0; i < count(); i++) {
ListItem* item = reinterpret_cast<ListItem*>(this->item(i));
if (item->getGUID() == guid) {
return item;
}
}
return NULL;
}