Пример #1
0
void PolyDataObject::ObjectAboutToBeRemovedFromScene()
{
    m_referenceToPolyTransform->Identity();
    disconnect( GetManager(), SIGNAL(ReferenceObjectChanged()), this, SLOT(OnReferenceChanged()) );
    disconnect( GetManager(), SIGNAL(ReferenceTransformChanged()), this, SLOT(OnReferenceChanged()) );
    disconnect( GetManager(), SIGNAL(CursorPositionChanged()), this, SLOT(OnCursorPositionChanged()) );
    disconnect( GetManager(), SIGNAL(StartCursorInteraction()), this, SLOT(OnStartCursorInteraction()) );
    disconnect( GetManager(), SIGNAL(EndCursorInteraction()), this, SLOT(OnEndCursorInteraction()) );
}
Пример #2
0
void KEdit::search_slot()
{

    int line, col;

    if(!srchdialog)
        return;

    QString to_find_string = srchdialog->getText();
    getCursorPosition(&line, &col);

    // srchdialog->get_direction() is true if searching backward

    if(last_search != NONE && srchdialog->get_direction())
    {
        col = col - pattern.length() - 1;
    }

again:
    int result = doSearch(to_find_string, srchdialog->case_sensitive(), false, (!srchdialog->get_direction()), line, col);

    if(!result)
    {
        if(!srchdialog->get_direction())
        { // forward search

            int query = KMessageBox::questionYesNo(srchdialog, i18n("End of document reached.\n"
                                                                    "Continue from the beginning?"),
                                                   i18n("Find"), KStdGuiItem::cont(), i18n("Stop"));
            if(query == KMessageBox::Yes)
            {
                line = 0;
                col = 0;
                goto again;
            }
        }
        else
        { // backward search

            int query = KMessageBox::questionYesNo(srchdialog, i18n("Beginning of document reached.\n"
                                                                    "Continue from the end?"),
                                                   i18n("Find"), KStdGuiItem::cont(), i18n("Stop"));
            if(query == KMessageBox::Yes)
            {
                QString string = textLine(numLines() - 1);
                line = numLines() - 1;
                col = string.length();
                last_search = BACKWARD;
                goto again;
            }
        }
    }
    else
    {
        emit CursorPositionChanged();
    }
}
Пример #3
0
void PolyDataObject::ObjectAddedToScene()
{
    connect( GetManager(), SIGNAL(ReferenceObjectChanged()), this, SLOT(OnReferenceChanged()) );
    connect( GetManager(), SIGNAL(ReferenceTransformChanged()), this, SLOT(OnReferenceChanged()) );
    connect( GetManager(), SIGNAL(CursorPositionChanged()), this, SLOT(OnCursorPositionChanged()) );
    connect( GetManager(), SIGNAL(StartCursorInteraction()), this, SLOT(OnStartCursorInteraction()) );
    connect( GetManager(), SIGNAL(EndCursorInteraction()), this, SLOT(OnEndCursorInteraction()) );
    m_referenceToPolyTransform->Identity();
    m_referenceToPolyTransform->Concatenate( GetWorldTransform() );
    m_referenceToPolyTransform->Concatenate( GetManager()->GetInverseReferenceTransform() );
    UpdateCuttingPlane();
    UpdateClippingPlanes();
}
Пример #4
0
void KEdit::replace_search_slot(){

  int line, col;

  if (!replace_dialog)
    return;

  QString to_find_string = replace_dialog->getText();

  int lineFrom, lineTo, colFrom, colTo;
  getSelection(&lineFrom, &colFrom, &lineTo, &colTo);

  // replace_dialog->get_direction() is true if searching backward
  if (replace_dialog->get_direction())
  {
    if (colFrom != -1)
    {
      col = colFrom - to_find_string.length();
      line = lineFrom;
    }
    else
    {
      getCursorPosition(&line,&col);
      col--;
    }
  }
  else
  {
    if (colTo != -1)
    {
      col = colTo;
      line = lineTo;
    }
    else
    {
      getCursorPosition(&line,&col);
    }
  }

again:

  int  result = doReplace(to_find_string, replace_dialog->case_sensitive(),
			 false, (!replace_dialog->get_direction()), line, col, false );

  if(!result){
    if(!replace_dialog->get_direction()){ // forward search

     int query = KMessageBox::questionYesNo(
			replace_dialog,
                        i18n("End of document reached.\n"\
                             "Continue from the beginning?"),
                        i18n("Replace"),KStdGuiItem::cont(),i18n("Stop"));
     if (query == KMessageBox::Yes){
	line = 0;
	col = 0;
	goto again;
      }
    }
    else{ //backward search

     int query = KMessageBox::questionYesNo(
			replace_dialog,
                        i18n("Beginning of document reached.\n"\
                             "Continue from the end?"),
                        i18n("Replace"),KStdGuiItem::cont(),i18n("Stop"));
      if (query == KMessageBox::Yes){
	QString string = textLine( numLines() - 1 );
	line = numLines() - 1;
	col  = string.length();
	last_replace = BACKWARD;
	goto again;
      }
    }
  }
  else{

    emit CursorPositionChanged();
  }
}