当前位置: 首页>>代码示例>>C++>>正文


C++ JXKeyModifiers类代码示例

本文整理汇总了C++中JXKeyModifiers的典型用法代码示例。如果您正苦于以下问题:C++ JXKeyModifiers类的具体用法?C++ JXKeyModifiers怎么用?C++ JXKeyModifiers使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了JXKeyModifiers类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: if

void
JXScrolltab::HandleMouseDown
	(
	const JPoint&			pt,
	const JXMouseButton		button,
	const JSize				clickCount,
	const JXButtonStates&	buttonStates,
	const JXKeyModifiers&	modifiers
	)
{
	const JBoolean shiftOn = modifiers.shift();
	const JBoolean metaOn  = modifiers.meta();

	if (button == kJXLeftButton && metaOn && shiftOn)
		{
		itsScrollbar->RemoveAllScrolltabs();
		}
	else if (button == kJXLeftButton && metaOn)
		{
		delete this;
		}
	else if (button == kJXLeftButton)
		{
		ScrollToTab();
		}
	else if (button == kJXRightButton)
		{
		OpenActionMenu(pt, buttonStates, modifiers);
		}
}
开发者ID:dllaurence,项目名称:jx_application_framework,代码行数:30,代码来源:JXScrolltab.cpp

示例2: if

void
CMLineIndexTable::AdjustBreakpoints
	(
	const JIndex			lineIndex,
	const JPoint&			pt,
	const JXButtonStates&	buttonStates,
	const JXKeyModifiers&	modifiers
	)
{
	JIndex bpIndex;
	if (!GetFirstBreakpointOnLine(lineIndex, &bpIndex))
		{
		SetBreakpoint(lineIndex, JI2B(
			modifiers.GetState(JXMenu::AdjustNMShortcutModifier(kJXMetaKeyIndex)) &&
			modifiers.shift()));
		}
	else if (HasMultipleBreakpointsOnLine(bpIndex))
		{
		OpenLineMenu(lineIndex, pt, buttonStates, modifiers, kJTrue, bpIndex);
		}
	else if (modifiers.shift())
		{
		(itsBPList->NthElement(bpIndex))->ToggleEnabled();
		}
	else
		{
		itsLink->RemoveBreakpoint(*(itsBPList->NthElement(bpIndex)));
		}
}
开发者ID:jafl,项目名称:jx_application_framework,代码行数:29,代码来源:CMLineIndexTable.cpp

示例3: if

void
GLFitParameterTable::HandleKeyPress
	(
	const int 				key,
	const JXKeyModifiers&	modifiers
	)
{
	JPoint cell;
	if (key == kJReturnKey && GetEditedCell(&cell))
		{
		if (EndEditing())
			{
			if (!modifiers.shift() && cell.y < (JCoordinate)GetRowCount())
				{
				BeginEditing(JPoint(cell.x, cell.y + 1));
				}
			else if (modifiers.shift() && cell.y > 1)
				{
				BeginEditing(JPoint(cell.x, cell.y - 1));
				}
			}
		}
	else if (key == kJTabKey)
		{
		// do nothing
		}

	else
		{
		JXEditTable::HandleKeyPress(key, modifiers);
		}
}
开发者ID:dllaurence,项目名称:jx_application_framework,代码行数:32,代码来源:GLFitParameterTable.cpp

示例4: if

void
TestWidget::AdjustCursor
	(
	const JPoint&			pt,
	const JXKeyModifiers&	modifiers
	)
{
	if (itsHomeRect.Contains(pt))
		{
		DisplayCursor(kJXDefaultCursor);
		}
	else if (its2Rect.Contains(pt))
		{
		DisplayCursor(itsGumbyCursor);
		}
	else if (its3Rect.Contains(pt))
		{
		DisplayCursor(itsBogosityCursor);
		}
	else if (modifiers.meta())
		{
		DisplayCursor(itsFleurCursor);
		}
	else
		{
		JXScrollableWidget::AdjustCursor(pt, modifiers);
		}
}
开发者ID:jafl,项目名称:jx_application_framework,代码行数:28,代码来源:TestWidget.cpp

示例5: CreateDragInsidePainter

void
JXHorizPartition::HandleMouseDown
	(
	const JPoint&			pt,
	const JXMouseButton		button,
	const JSize				clickCount,
	const JXButtonStates&	buttonStates,
	const JXKeyModifiers&	modifiers
	)
{
	itsDragType = kInvalidDrag;
	if (button != kJXLeftButton)
		{
		return;
		}

	if (modifiers.meta())
		{
		itsDragType = kDragAll;
		PrepareToDragAll(pt.x, &itsMinDragX, &itsMaxDragX);
		}
	else
		{
		itsDragType = kDragOne;
		PrepareToDrag(pt.x, &itsMinDragX, &itsMaxDragX);
		}

	JPainter* p = CreateDragInsidePainter();

	const JRect ap = GetAperture();
	p->Line(pt.x, ap.top, pt.x, ap.bottom);
	itsPrevPt = pt;
}
开发者ID:mbert,项目名称:mulberry-lib-jx,代码行数:33,代码来源:JXHorizPartition.cpp

示例6:

void
JXInputField::HandleMouseDown
	(
	const JPoint&			pt,
	const JXMouseButton		button,
	const JSize				clickCount,
	const JXButtonStates&	buttonStates,
	const JXKeyModifiers&	modifiers
	)
{
	if (button == kJXRightButton)
		{
//		if (!PointInSelection(pt))
//			{
//			JXTEBase::HandleMouseDown(pt, kJXLeftButton, 1, buttonStates, modifiers);
//			}
		CreateContextMenu();
		itsContextMenu->PopUp(this, pt, buttonStates, modifiers);
		}
	else
		{
		ShouldAllowDragAndDrop(modifiers.meta());
		JXTEBase::HandleMouseDown(pt, button, clickCount, buttonStates, modifiers);
		}
}
开发者ID:dllaurence,项目名称:jx_application_framework,代码行数:25,代码来源:JXInputField.cpp

示例7:

void
JXExprEditor::HandleKeyPress
	(
	const int				key,
	const JXKeyModifiers&	modifiers
	)
{
	if (0 < key && key <= 255 &&
		!modifiers.meta() && !modifiers.control())
		{
		EIPHandleKeyPress(key);
		}
	else
		{
		JXScrollableWidget::HandleKeyPress(key, modifiers);
		}
}
开发者ID:dllaurence,项目名称:jx_application_framework,代码行数:17,代码来源:JXExprEditor.cpp

示例8:

void
JXTreeListWidget::HandleMouseUp
	(
	const JPoint&			pt,
	const JXMouseButton		button,
	const JXButtonStates&	buttonStates,
	const JXKeyModifiers&	modifiers
	)
{
	if (itsToggleDragIndex > 0 && itsMouseInToggleFlag)
		{
		ToggleNode(itsToggleDragIndex, modifiers.shift(), modifiers.meta());
		Refresh();
		}

	itsMouseInToggleFlag = kJFalse;
	itsToggleDragIndex   = 0;
}
开发者ID:dllaurence,项目名称:jx_application_framework,代码行数:18,代码来源:JXTreeListWidget.cpp

示例9:

void
JXTable::BeginSelectionDrag
	(
	const JPoint&			cell,
	const JXMouseButton		button,
	const JXKeyModifiers&	modifiers
	)
{
	if (button != kJXMiddleButton)
		{
		const JBoolean extendSelection =
			JI2B((button == kJXLeftButton && modifiers.shift()) ||
				 button == kJXRightButton);

		const JBoolean selectDiscont = modifiers.control();

		JTable::BeginSelectionDrag(cell, extendSelection, selectDiscont);
		}
}
开发者ID:mbert,项目名称:mulberry-lib-jx,代码行数:19,代码来源:JXTable.cpp

示例10: if

void
JXTreeListWidget::HandleKeyPress
	(
	const int				key,
	const JXKeyModifiers&	modifiers
	)
{
	if (key == kJLeftArrow && !IsEditing())
		{
		CloseSelectedNodes(modifiers.shift(), modifiers.meta());
		}
	else if (key == kJRightArrow && !IsEditing())
		{
		OpenSelectedNodes(modifiers.shift(), modifiers.meta());
		}
	else
		{
		JXStyleTable::HandleKeyPress(key, modifiers);
		}
}
开发者ID:dllaurence,项目名称:jx_application_framework,代码行数:20,代码来源:JXTreeListWidget.cpp

示例11:

void
JXTable::BeginSelectionDrag
	(
	const JPoint&			cell,
	const JXMouseButton		button,
	const JXKeyModifiers&	modifiers
	)
{
	if (button != kJXMiddleButton)
		{
		const JBoolean extendSelection =
			JI2B((button == kJXLeftButton && modifiers.shift()) ||
				 button == kJXRightButton);

		const JBoolean selectDiscont =
//			GetDisplay()->IsOSX() ? modifiers.meta() :	// meta-dbl-click used in too many places
			modifiers.control();

		JTable::BeginSelectionDrag(cell, extendSelection, selectDiscont);
		}
}
开发者ID:jafl,项目名称:jx_application_framework,代码行数:21,代码来源:JXTable.cpp

示例12: GetDNDManager

Atom
GMMessageDragSource::GetDNDAction
	(
	const JXContainer*		target,
	const JXButtonStates&	buttonStates,
	const JXKeyModifiers&	modifiers
	)
{
	if (modifiers.control())
		{
		return GetDNDManager()->GetDNDActionAskXAtom();
		}
	else if (modifiers.meta())
		{
		return GetDNDManager()->GetDNDActionCopyXAtom();
		}
	else
		{
		return GetDNDManager()->GetDNDActionMoveXAtom();
		}
}
开发者ID:jafl,项目名称:jx_application_framework,代码行数:21,代码来源:GMMessageDragSource.cpp

示例13: if

void
CBFileNameDisplay::HandleKeyPress
	(
	const int				key,
	const JXKeyModifiers&	modifiers
	)
{
	if (key == kJEscapeKey)
		{
		itsTE->Focus();
		}
	else if (key == '\t' &&
			 !modifiers.GetState(kJXMetaKeyIndex)   &&
			 modifiers.GetState(kJXControlKeyIndex) &&
			 !modifiers.shift())
		{
		itsTE->Focus();
		itsTE->HandleKeyPress(key, modifiers);
		}
	else if ((key == '\r' || key == '\n') &&
			 !modifiers.GetState(JXMenu::AdjustNMShortcutModifier(kJXMetaKeyIndex)) &&
			 !modifiers.shift())
		{
		itsUnfocusAction =
			modifiers.GetState(JXMenu::AdjustNMShortcutModifier(kJXControlKeyIndex)) ?
			kRename : kSaveAs;
		itsTE->Focus();				// trigger HandleUnfocusEvent()
		itsUnfocusAction = kCancel;
		}
	else
		{
		JXFileInput::HandleKeyPress(key, modifiers);
		}
}
开发者ID:jafl,项目名称:jx_application_framework,代码行数:34,代码来源:CBFileNameDisplay.cpp

示例14: if

void
JXInputField::HandleKeyPress
	(
	const int				key,
	const JXKeyModifiers&	modifiers
	)
{
	if (itsTable != NULL && itsTable->WantsInputFieldKey(key, modifiers))
		{
		itsTable->HandleKeyPress(key, modifiers);
		return;
		}
	else if (itsTable != NULL)
		{
		JPoint cell;
		const JBoolean ok = itsTable->GetEditedCell(&cell);
		assert( ok );
		itsTable->TableScrollToCell(cell);
		}

	if (key == JXCtrl('K') && modifiers.control() && HasSelection())
		{
		Cut();
		}
	else if (key == JXCtrl('K') && modifiers.control())
		{
		JIndex i;
		const JBoolean ok = GetCaretLocation(&i);
		assert( ok );
		SetSelection(i, GetTextLength());
		Cut();
		}

	else
		{
		JXTEBase::HandleKeyPress(key, modifiers);
		}
}
开发者ID:dllaurence,项目名称:jx_application_framework,代码行数:38,代码来源:JXInputField.cpp

示例15: if

JBoolean
JX3DWidget::ZoomForWheel
	(
	const JXMouseButton		button,
	const JXKeyModifiers&	modifiers
	)
{
	JCoordinate delta;
	if (button == kJXButton4)
		{
		delta = -1;
		}
	else if (button == kJXButton5)
		{
		delta = +1;
		}
	else
		{
		return kJFalse;
		}

	const JVector& o = itsCamera->GetAttentionPt();
	const JVector& p = itsCamera->GetPosition();

	JFloat scale =
		(modifiers.shift()   ? kSmallZoomScale :
		(modifiers.control() ? kBigZoomScale   :
		kZoomScale));

#ifdef _J_OSX
	scale /= 10.0;
#endif

	itsCamera->SetPosition(o + (p - o) * (1.0 + delta * scale));
	return kJTrue;
}
开发者ID:jafl,项目名称:jx_application_framework,代码行数:36,代码来源:JX3DWidget.cpp


注:本文中的JXKeyModifiers类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。