コード例 #1
0
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);
		}
}
コード例 #2
0
ファイル: configtree.cpp プロジェクト: perryhg/terkos
bool ecValueWindow::BeginEditing(ecConfigItem* item)
{
    if (m_configItem)
        EndEditing();
    
    m_configItem = item;
    
    m_editWindow = item->CreateEditWindow(this);
    if (m_editWindow)
    {
        m_editWindow->Show(FALSE);
        
        item->TransferDataToWindow(m_editWindow);
        
        // Position the control
        PositionEditWindow();
        
        m_editWindow->Show(TRUE);
        m_editWindow->SetFocus();
        
        return TRUE;
    }
    else
    {
        m_configItem = NULL;
        return FALSE;
    }
}
コード例 #3
0
void
CMArray2DTable::HandleKeyPress
	(
	const int				key,
	const JXKeyModifiers&	modifiers
	)
{
	if (key == kJReturnKey)
		{
		JPoint cell;
		if (!IsEditing() && (GetTableSelection()).GetSingleSelectedCell(&cell))
			{
			BeginEditing(cell);
			}
		else
			{
			EndEditing();
			}
		}

	else if (!IsEditing() && HandleSelectionKeyPress(key, modifiers))
		{
		// work has been done
		}

	else
		{
		JXStringTable::HandleKeyPress(key, modifiers);
		}
}
コード例 #4
0
void
CBCommandTable::DuplicateCommand()
{
	JPoint cell;
	if ((GetTableSelection()).GetFirstSelectedCell(&cell) && EndEditing())
		{
		itsCmdList->AppendElement((itsCmdList->GetElement(cell.y)).Copy());
		AppendRows(1);
		BeginEditing(JPoint(kCommandColumn, itsCmdList->GetElementCount()));
		}
}
コード例 #5
0
void
JXExprEditor::HandleMathMenu
	(
	const JIndex item
	)
{
	if (item > kMathMenuItemCount)
		{
		return;
		}

	const JExprEditor::CmdIndex cmd = kMathMenuItemToCmd[ item-1 ];
	if (cmd == kEvaluateSelCmd)
		{
		if (EndEditing())
			{
			EvaluateSelection();
			}
		}
	else if (cmd == kPrintEPSCmd)
		{
		itsEPSPrinter->BeginUserPrintSetup();
		}
	else if (cmd == kNegateSelCmd)
		{
		NegateSelection();
		}
	else if (cmd == kAddArgCmd)
		{
		AddArgument();
		}
	else if (cmd == kMoveArgLeftCmd)
		{
		MoveArgument(-1);
		}
	else if (cmd == kMoveArgRightCmd)
		{
		MoveArgument(+1);
		}
	else if (cmd == kGroupLeftCmd)
		{
		GroupArguments(-1);
		}
	else if (cmd == kGroupRightCmd)
		{
		GroupArguments(+1);
		}
	else if (cmd == kUngroupCmd)
		{
		UngroupArguments();
		}
}
コード例 #6
0
void
CBCommandTable::AddCommand()
{
	if (EndEditing())
		{
		CBCommandManager::CmdInfo info(new JString("./"), new JString, new JString,
									   new JString, new JString, new JString);
		assert( info.path != NULL && info.cmd != NULL && info.name != NULL &&
				info.menuText != NULL && info.menuShortcut != NULL );
		itsCmdList->AppendElement(info);
		AppendRows(1);
		BeginEditing(JPoint(kCommandColumn, itsCmdList->GetElementCount()));
		}
}
コード例 #7
0
void
JXFSBindingTable::AddPattern()
{
	if (EndEditing())
		{
		const JFSBinding* b = itsBindingList->GetDefaultCommand();
		JFSBinding::CommandType type;
		JBoolean singleFile;
		const JString& cmd = b->GetCommand(&type, &singleFile);

		const JIndex rowIndex =
			itsBindingList->AddBinding("", cmd, type, singleFile);
		InsertRows(rowIndex, 1);
		BeginEditing(JPoint(kPatternColumn, rowIndex));
		Broadcast(DataChanged());
		}
}
コード例 #8
0
void
GMFilterNameTable::HandleMouseDown
	(
	const JPoint&			pt,
	const JXMouseButton	button,
	const JSize			clickCount,
	const JXButtonStates&	buttonStates,
	const JXKeyModifiers&	modifiers
	)
{
	itsIsWaitingForDrag	= kJFalse;
	itsStartPt			= pt;
	itsDNDIsValid		= kJFalse;

	if (button > kJXRightButton)
		{
		ScrollForWheel(button, modifiers);
		return;
		}

	JPoint cell;
	if (!GetCell(pt, &cell))
		{
		return;
		}

	itsCurrentCell		= cell;

	JTableSelection& s	= GetTableSelection();

	JPoint oldCell;
	JBoolean hasSingleSel	= s.GetFirstSelectedCell(&oldCell);

	if (itsConditionTable->OKToSwitch() &&
		itsActionTable->OKToSwitch() &&
		(!IsEditing() || EndEditing()))
		{
		if ((hasSingleSel && cell.y != oldCell.y) ||
			(!hasSingleSel))
			{
			SelectFilter(cell.y);
			}
		itsIsWaitingForDrag	= kJTrue;
		}
}
コード例 #9
0
void
JXFSBindingTable::DuplicatePattern()
{
	JPoint cell;
	if ((GetTableSelection()).GetFirstSelectedCell(&cell) && EndEditing())
		{
		const JFSBinding* b = itsBindingList->GetBinding(cell.y);

		JFSBinding::CommandType type;
		JBoolean singleFile;
		const JString& cmd = b->GetCommand(&type, &singleFile);

		const JIndex rowIndex =
			itsBindingList->AddBinding("", cmd, type, singleFile);
		InsertRows(rowIndex, 1);
		BeginEditing(JPoint(kPatternColumn, rowIndex));
		Broadcast(DataChanged());
		}
}
コード例 #10
0
void
JXFSBindingTable::HandleKeyPress
	(
	const int				key,
	const JXKeyModifiers&	modifiers
	)
{
	JPoint cell;
	if (GetEditedCell(&cell) && cell.x == kPatternColumn &&
		(key == kJTabKey ||
		 (modifiers.meta() && (key == kJRightArrow || key == '6'))))
		{
		if (EndEditing() &&
			(GetTableSelection()).GetSingleSelectedCell(&cell))
			{
			BeginEditing(JPoint(kCommandColumn, cell.y));
			}
		}

	else
		{
		JXEditTable::HandleKeyPress(key, modifiers);
		}
}
コード例 #11
0
ファイル: configtree.cpp プロジェクト: perryhg/terkos
void ecValueWindow::OnExpand(wxTreeEvent& event)
{
    wxTreeCompanionWindow::OnExpand(event);
    
    EndEditing();
}
コード例 #12
0
//-------------------------------------------------------------------------
void tEditLoginPass::on_pushButton_clicked()
{
    emit EndEditing(ui->leLogin->text(), ui->lePassword->text(), row, new_user);
}
コード例 #13
0
JBoolean
JXExprEditor::OKToUnfocus()
{
	return JConvertToBoolean( JXScrollableWidget::OKToUnfocus() && EndEditing() );
}
コード例 #14
0
//-------------------------------------------------------------------------
void tEditLoginPass::OnSave()
{
    emit EndEditing(ui->leLogin->text(), ui->lePassword->text(), row, new_user);
}
コード例 #15
0
ファイル: JXEditTable.cpp プロジェクト: mbert/mulberry-lib-jx
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);
		}
}