本文整理汇总了C++中JXKeyModifiers::shift方法的典型用法代码示例。如果您正苦于以下问题:C++ JXKeyModifiers::shift方法的具体用法?C++ JXKeyModifiers::shift怎么用?C++ JXKeyModifiers::shift使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JXKeyModifiers
的用法示例。
在下文中一共展示了JXKeyModifiers::shift方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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)));
}
}
示例2: 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);
}
}
示例3: 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);
}
}
示例4: 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);
}
}
示例5: if
void
CBSymbolTable::HandleMouseDown
(
const JPoint& pt,
const JXMouseButton button,
const JSize clickCount,
const JXButtonStates& buttonStates,
const JXKeyModifiers& modifiers
)
{
itsKeyBuffer.Clear();
JPoint cell;
if (ScrollForWheel(button, modifiers))
{
return;
}
else if (!GetCell(pt, &cell))
{
(GetTableSelection()).ClearSelection();
}
else if (button == kJXLeftButton &&
clickCount == 2 &&
!modifiers.shift() && modifiers.meta() && modifiers.control())
{
SelectSingleCell(cell, kJFalse);
DisplaySelectedSymbols();
(GetWindow())->Close();
return;
}
else if (clickCount == 2 && modifiers.meta())
{
SelectSingleCell(cell, kJFalse);
FindSelectedSymbols(button);
}
else if (button == kJXLeftButton &&
clickCount == 2 &&
!modifiers.shift() && !modifiers.control())
{
DisplaySelectedSymbols();
}
else
{
BeginSelectionDrag(cell, button, modifiers);
}
}
示例6:
JBoolean
JXTable::HandleSelectionKeyPress
(
const int key,
const JXKeyModifiers& modifiers
)
{
return JI2B(0 < key && key <= 255 &&
JTable::HandleSelectionKeyPress(key, modifiers.shift()));
}
示例7: 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);
}
}
示例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 =
// GetDisplay()->IsOSX() ? modifiers.meta() : // meta-dbl-click used in too many places
modifiers.control();
JTable::BeginSelectionDrag(cell, extendSelection, selectDiscont);
}
}
示例10: 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;
}
示例11: if
void
CBShellEditor::HandleKeyPress
(
const int key,
const JXKeyModifiers& modifiers
)
{
const JBoolean controlOn = modifiers.control();
const JBoolean metaOn = modifiers.meta();
const JBoolean shiftOn = modifiers.shift();
if ((key == kJLeftArrow && metaOn && !controlOn && !shiftOn) ||
(key == JXCtrl('A') && controlOn && !metaOn && !shiftOn))
{
const JIndex index = GetInsertionIndex();
const JRunArray<Font>& styles = GetStyles();
if (index > 1 && styles.GetElement(index-1) == GetDefaultFont())
{
JIndex runIndex, firstIndexInRun;
const JBoolean ok = styles.FindRun(index-1, &runIndex, &firstIndexInRun);
SetCaretLocation(firstIndexInRun);
return;
}
}
if (key == kJReturnKey)
{
SetCurrentFont(itsInsertFont);
}
else
{
SetCurrentFont(GetDefaultFont());
}
JBoolean sentCmd = kJFalse;
if (key == kJReturnKey && !modifiers.shift() && !HasSelection())
{
JIndex index;
JBoolean ok = GetCaretLocation(&index);
assert( ok );
JString cmd;
const JRunArray<Font>& styles = GetStyles();
if (index > 1 && styles.GetElement(index-1) == GetDefaultFont())
{
JIndex runIndex, firstIndexInRun;
ok = styles.FindRun(index-1, &runIndex, &firstIndexInRun);
const JIndex endIndex = firstIndexInRun + styles.GetRunLength(runIndex);
cmd = (GetText()).GetSubstring(firstIndexInRun, endIndex - 1);
SetCaretLocation(endIndex);
if (cmd.BeginsWith("man "))
{
cmd.ReplaceSubstring(1, 4, "jcc --man ");
}
else if (cmd.BeginsWith("apropos "))
{
cmd.ReplaceSubstring(1, 8, "jcc --apropos ");
}
else if (cmd.BeginsWith("vi "))
{
cmd.ReplaceSubstring(1, 3, "jcc ");
}
else if (cmd.BeginsWith("less ") || cmd.BeginsWith("more "))
{
cmd.ReplaceSubstring(1, 5, "jcc ");
}
else if (cmd == "more" || cmd == "less" || cmd == "vi")
{
cmd = "jcc";
}
}
cmd += "\n";
itsShellDoc->SendCommand(cmd);
sentCmd = kJTrue;
}
CBTextEditor::HandleKeyPress(key, modifiers);
if (sentCmd)
{
itsInsertIndex = GetInsertionIndex();
}
}
示例12: if
void
JXEditTable::HandleKeyPress
(
const int key,
const JXKeyModifiers& modifiers
)
{
const JBoolean shiftOn = modifiers.shift();
const JBoolean metaOn = modifiers.meta();
JXWindow* window = GetWindow();
if (key == kJReturnKey && metaOn)
{
EndEditing();
}
else if (key == kJReturnKey && shiftOn)
{
ShiftEditing(0,-1);
}
else if (key == kJReturnKey)
{
ShiftEditing(0,1);
}
else if (key == kJTabKey && shiftOn)
{
ShiftEditing(-1,0);
}
else if (key == kJTabKey)
{
ShiftEditing(1,0);
}
else if (metaOn && (key == kJUpArrow || key == '8'))
{
ShiftEditing(0,-1);
}
else if (metaOn && (key == kJDownArrow || key == '2'))
{
ShiftEditing(0,1);
}
else if (metaOn && (key == kJLeftArrow || key == '4'))
{
ShiftEditing(-1,0);
}
else if (metaOn && (key == kJRightArrow || key == '6'))
{
ShiftEditing(1,0);
}
else if (key == kJEscapeKey)
{
CancelEditing();
}
else
{
JXTable::HandleKeyPress(key, modifiers);
}
}
示例13: ZoomForWheel
JBoolean
JX3DWidget::HandleRotationKeyPress
(
const int key,
const JXKeyModifiers& modifiers
)
{
if (modifiers.meta() && key == kJUpArrow)
{
return ZoomForWheel(kJXButton4, modifiers);
}
else if (modifiers.meta() && key == kJDownArrow)
{
return ZoomForWheel(kJXButton5, modifiers);
}
const JVector& o = itsCamera->GetAttentionPt();
JVector v = itsCamera->GetPosition() - o;
const JFloat r = v.GetLength();
JFloat lat = asin(v.GetElement(3) / r);
JFloat lon = atan2(v.GetElement(2), v.GetElement(1));
const JFloat delta =
(modifiers.shift() ? kSmallDeltaAngle :
(modifiers.control() ? kBigDeltaAngle :
kDeltaAngle));
JBoolean moved = kJFalse;
if (key == kJUpArrow)
{
lat += delta;
moved = kJTrue;
}
else if (key == kJDownArrow)
{
lat -= delta;
moved = kJTrue;
}
else if (key == kJLeftArrow)
{
lon += delta;
moved = kJTrue;
}
else if (key == kJRightArrow)
{
lon -= delta;
moved = kJTrue;
}
if (moved)
{
itsCamera->SetPosition(JVector(3,
r * cos(lat) * cos(lon),
r * cos(lat) * sin(lon),
r * sin(lat)));
Redraw(); // key repeats can delay Refresh()
return kJTrue;
}
else
{
return kJFalse;
}
}
示例14: if
void
SVNListBase::HandleMouseDown
(
const JPoint& pt,
const JXMouseButton button,
const JSize clickCount,
const JXButtonStates& buttonStates,
const JXKeyModifiers& modifiers
)
{
JTableSelection& s = GetTableSelection();
itsIsDraggingFlag = kJFalse;
itsSavedSelection->CleanOut();
JPoint cell;
if (button > kJXRightButton)
{
ScrollForWheel(button, modifiers);
}
else if (!GetCell(pt, &cell))
{
s.ClearSelection();
}
else if (button == kJXLeftButton && modifiers.shift())
{
itsIsDraggingFlag = s.ExtendSelection(cell);
}
else if (button == kJXLeftButton && modifiers.control())
{
s.InvertCell(cell);
if (s.IsSelected(cell))
{
s.SetBoat(cell);
s.SetAnchor(cell);
}
else
{
s.ClearBoat();
s.ClearAnchor();
}
}
else if (button == kJXLeftButton)
{
s.ClearSelection();
s.SetBoat(cell);
s.SetAnchor(cell);
s.SelectCell(cell);
itsIsDraggingFlag = kJTrue;
if (clickCount == 2)
{
OpenSelectedItems();
}
}
else if (button == kJXRightButton && clickCount == 1)
{
if (CreateContextMenu())
{
if (!s.IsSelected(cell))
{
s.ClearSelection();
s.SetBoat(cell);
s.SetAnchor(cell);
s.SelectCell(cell);
}
itsContextMenu->PopUp(this, pt, buttonStates, modifiers);
}
}
}
示例15: if
void
TestStringTable::HandleMouseDown
(
const JPoint& pt,
const JXMouseButton button,
const JSize clickCount,
const JXButtonStates& buttonStates,
const JXKeyModifiers& modifiers
)
{
itsIsDraggingFlag = kJFalse;
if (button > kJXRightButton)
{
ScrollForWheel(button, modifiers);
return;
}
JPoint cell;
if (!GetCell(pt, &cell))
{
return;
}
JStringTableData* data = GetStringData();
JTableSelection& s = GetTableSelection();
if (button == kJXMiddleButton)
{
BeginEditing(cell);
}
else if (itsMouseAction == kSelectCells)
{
if (button == kJXLeftButton && !modifiers.shift())
{
s.ClearSelection();
s.SetBoat(cell);
s.SetAnchor(cell);
s.SelectCell(cell);
itsIsDraggingFlag = kJTrue;
}
else
{
itsIsDraggingFlag = s.ExtendSelection(cell);
}
}
else if (itsMouseAction == kSelectRows)
{
if (button == kJXLeftButton && !modifiers.shift())
{
s.ClearSelection();
}
s.SetBoat(JPoint(1, cell.y));
s.SetAnchor(JPoint(GetColCount(), cell.y));
s.SelectRow(cell.y);
}
else if (itsMouseAction == kSelectCols)
{
if (button == kJXLeftButton && !modifiers.shift())
{
s.ClearSelection();
}
s.SetBoat(JPoint(cell.x, 1));
s.SetAnchor(JPoint(cell.x, GetRowCount()));
s.SelectCol(cell.x);
}
// row manipulations
else if (button == kJXLeftButton && itsMouseAction == kInsertRow)
{
data->InsertRows(cell.y, 1);
}
else if (button == kJXRightButton && itsMouseAction == kInsertRow)
{
data->InsertRows(cell.y+1, 1);
}
else if (button == kJXLeftButton && itsMouseAction == kDuplicateRow)
{
data->DuplicateRow(cell.y, cell.y);
}
else if (button == kJXRightButton && itsMouseAction == kDuplicateRow)
{
data->DuplicateRow(cell.y, cell.y+1);
}
else if (button == kJXLeftButton && itsMouseAction == kMoveRow &&
cell.y > 1)
{
data->MoveRow(cell.y, cell.y-1);
}
else if (button == kJXRightButton && itsMouseAction == kMoveRow &&
((JIndex) cell.y) < GetRowCount())
{
data->MoveRow(cell.y, cell.y+1);
}
//.........这里部分代码省略.........