コード例 #1
0
ファイル: llcombobox.cpp プロジェクト: Katharine/kittyviewer
void LLComboBox::onItemSelected(const LLSD& data)
{
	mLastSelectedIndex = getCurrentIndex();
	if (mLastSelectedIndex != -1)
	{
		setLabel(getSelectedItemLabel());

		if (mAllowTextEntry)
		{
			gFocusMgr.setKeyboardFocus(mTextEntry);
			mTextEntry->selectAll();
		}
	}
	// hiding the list reasserts the old value stored in the text editor/dropdown button
	hideList();

	// commit does the reverse, asserting the value in the list
	onCommit();
}
コード例 #2
0
ファイル: llcombobox.cpp プロジェクト: Katharine/kittyviewer
void LLComboBox::onTextEntry(LLLineEditor* line_editor)
{
	if (mTextEntryCallback != NULL)
	{
		(mTextEntryCallback)(line_editor, LLSD());
	}

	KEY key = gKeyboard->currentKey();
	if (key == KEY_BACKSPACE || 
		key == KEY_DELETE)
	{
		if (mList->selectItemByLabel(line_editor->getText(), FALSE))
		{
			line_editor->setTentative(FALSE);
			mLastSelectedIndex = mList->getFirstSelectedIndex();
		}
		else
		{
			line_editor->setTentative(mTextEntryTentative);
			mList->deselectAllItems();
			mLastSelectedIndex = -1;
		}
		return;
	}

	if (key == KEY_LEFT || 
		key == KEY_RIGHT)
	{
		return;
	}

	if (key == KEY_DOWN)
	{
		setCurrentByIndex(llmin(getItemCount() - 1, getCurrentIndex() + 1));
		if (!mList->getVisible())
		{
			prearrangeList();

			if (mList->getItemCount() != 0)
			{
				showList();
			}
		}
		line_editor->selectAll();
		line_editor->setTentative(FALSE);
	}
	else if (key == KEY_UP)
	{
		setCurrentByIndex(llmax(0, getCurrentIndex() - 1));
		if (!mList->getVisible())
		{
			prearrangeList();

			if (mList->getItemCount() != 0)
			{
				showList();
			}
		}
		line_editor->selectAll();
		line_editor->setTentative(FALSE);
	}
	else
	{
		// RN: presumably text entry
		updateSelection();
	}
}
コード例 #3
0
ファイル: rdotabctrl.cpp プロジェクト: aurusov/localchat
	CWnd* getItemCurrent() const            { return getItem( getCurrentIndex() ); };
コード例 #4
0
ファイル: rawdata.cpp プロジェクト: Creepinevil/fifengine
	void RawData::moveIndex(int32_t offset) {
		setIndex(getCurrentIndex() + offset);
	}
コード例 #5
0
QModelIndex MainWindow::getCurrentIndex(PModel playlistModel) {
    auto playlistTab = getPlaylistTab(playlistModel);
    if (!playlistTab)
        return QModelIndex();
    return playlistTab->getCurrentIndex();
}
コード例 #6
0
ファイル: nodeRecorder.c プロジェクト: finnianr/Eiffel-Loop
int iterateNodeRecorder(NodeRecorder *nr){
	int j, i;
	Boolean b;
	if (nr->count < nr->fib->size)
	{
		i = intAt(nr->fib,nr->count);
		b = (i >= 0);
		if (b == FALSE)
		{
			i = i & 0x7fffffff;
		}
		switch (i)
		{
		case 0xff:
			nr->vn->context[0] = -1;
			nr->vn->atTerminal = FALSE;
			nr->count++;
			break;

		case 0:
			nr->vn->context[0] = 0;
			if (b == FALSE)
			{
				nr->vn->atTerminal = TRUE;
				nr->vn->LN = intAt(nr->fib,nr->count + 1);
				nr->count += 2;
			}
			else
			{
				nr->vn->atTerminal = FALSE;
				nr->count++;
			}

			break;

		case 1:
			nr->vn->context[0] = 1;
			nr->vn->context[1] = intAt(nr->fib,nr->count + 1);
			nr->vn->l1index = intAt(nr->fib,nr->count + 2);
			if (b == FALSE)
			{
				nr->vn->atTerminal = TRUE;
				nr->vn->LN = intAt(nr->fib,nr->count + 3);
				nr->count += 4;
			}
			else
			{
				nr->vn->atTerminal = FALSE;
				nr->count += 3;
			}

			break;

		case 2:
			nr->vn->context[0] = 2;
			nr->vn->context[1] = intAt(nr->fib,nr->count + 1);
			nr->vn->context[2] = intAt(nr->fib,nr->count + 2);
			nr->vn->l1index = intAt(nr->fib,nr->count + 3);
			nr->vn->l2lower = intAt(nr->fib,nr->count + 4);
			nr->vn->l2upper = intAt(nr->fib,nr->count + 5);
			nr->vn->l2index = intAt(nr->fib,nr->count + 6);
			if (b == FALSE)
			{
				nr->vn->atTerminal = TRUE;
				nr->vn->LN = intAt(nr->fib,nr->count + 7);
				nr->count += 8;
			}
			else
			{
				nr->vn->atTerminal = FALSE;
				nr->count += 7;
			}

			break;

		case 3:
			nr->vn->context[0] = 3;
			nr->vn->context[1] = intAt(nr->fib,nr->count + 1);
			nr->vn->context[2] = intAt(nr->fib,nr->count + 2);
			nr->vn->context[3] = intAt(nr->fib,nr->count + 3);
			nr->vn->l1index = intAt(nr->fib,nr->count + 4);
			nr->vn->l2lower = intAt(nr->fib,nr->count + 5);
			nr->vn->l2upper = intAt(nr->fib,nr->count + 6);
			nr->vn->l2index = intAt(nr->fib,nr->count + 7);
			nr->vn->l3lower = intAt(nr->fib,nr->count + 8);
			nr->vn->l3upper = intAt(nr->fib,nr->count + 9);
			nr->vn->l3index = intAt(nr->fib,nr->count + 10);
			if (b == FALSE)
			{
				nr->vn->atTerminal = TRUE;
				nr->vn->LN = intAt(nr->fib,nr->count + 11);
				nr->count += 12;
			}
			else
			{
				nr->vn->atTerminal = FALSE;
				nr->count += 11;
			}

			break;

		default:
			nr->vn->context[0] = i;
			for (j = 1; j < i; j++)
			{
				nr->vn->context[j] = intAt(nr->fib,nr->count + j);
			}
			nr->vn->l1index = intAt(nr->fib,nr->count + i);
			nr->vn->l2lower = intAt(nr->fib,nr->count + i + 1);
			nr->vn->l2upper = intAt(nr->fib,nr->count + i + 2);
			nr->vn->l2index = intAt(nr->fib,nr->count + i + 3);
			nr->vn->l3lower = intAt(nr->fib,nr->count + i + 4);
			nr->vn->l3upper = intAt(nr->fib,nr->count + i + 5);
			nr->vn->l3index = intAt(nr->fib,nr->count + i + 6);
			if (b == FALSE)
			{
				nr->vn->atTerminal = TRUE;
				nr->vn->LN = intAt(nr->fib,nr->count + 11);
				nr->count += i + 8;
			}
			else
			{
				nr->vn->atTerminal = FALSE;
				nr->count += i + 7;
			}
			break;
		}
		nr->position++;
		return getCurrentIndex(nr->vn);
	}
	return -1;
}
コード例 #7
0
ファイル: Inventory.cpp プロジェクト: Hisuuu/musicraft
bool Inventory::removeCurrentCube(char &result){
	if(m_current_index >=0){
		return this->removeCube(result,	getCurrentIndex());
	}
	return false;
}
コード例 #8
0
void HLookDocsMeneger::setCurrentDocument()
{
    setDocToEditor(docsTable.value(getCurrentIndex()).getDocData());
}