本文整理汇总了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);
}
}
示例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)));
}
}
示例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);
}
}
示例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);
}
}
示例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;
}
示例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);
}
}
示例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);
}
}
示例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;
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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();
}
}
示例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);
}
}
示例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);
}
}
示例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;
}