~vbursian/research-assistant/intervers

« back to all changes in this revision

Viewing changes to RAGUI/Navigator.cpp

  • Committer: Viktor Bursian
  • Date: 2013-06-06 15:10:08 UTC
  • Revision ID: vbursian@gmail.com-20130606151008-6641eh62f0lgx8jt
Tags: version_0.3.0
version 0.3.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
#include "Net.h"
11
11
#include "Environment.h"
12
12
#include "Trace.h"
13
 
#include "GeneralGUI.h"
 
13
#include "StringsAndQStrings.h"
 
14
#include "SymbolsGUI.h"
14
15
#include "AttrDlg.h"
15
16
#include <QPainter>
16
17
#include <QApplication>
19
20
//------------------------------------------------------------------------------
20
21
 
21
22
sNetViewMenuGenerators        sNavigatorViewport::MenuGenerators;
 
23
int                           sNavigator::UpdatingPeriod = 500;
22
24
 
23
25
//---------------------------------------------------------- sNavigatorItem ---
24
26
 
42
44
    S += " size=+1";
43
45
    S += " color=chocolate";
44
46
    S += ">";
45
 
    switch( TreeItem->Expansion() ){ //▹▻▷►▶▼ ◌ᐅ◆
46
 
        case sNet2TreeEvolution::NotExpandable:            S+="▹";  break;
47
 
        case sNet2TreeEvolution::FullyCollapsed:           S+="▷";  break;
48
 
        case sNet2TreeEvolution::Inline_OmitRepetitions:   S+="►";  break;
49
 
        case sNet2TreeEvolution::Inline:                   S+="▶";  break;
50
 
        case sNet2TreeEvolution::CanonicallyExpanded:      S+="▼";  break;
 
47
    switch( TreeItem->Expansion() ){
 
48
        case sNet2TreeEvolution::NotExpandable:
 
49
            S+=Symbol::NotExpandable;
 
50
            break;
 
51
        case sNet2TreeEvolution::FullyCollapsed:
 
52
            S+=Symbol::FullyCollapsed;
 
53
            break;
 
54
        case sNet2TreeEvolution::Inline_OmitRepetitions:
 
55
            S+=Symbol::Inline_OmitRepetitions;
 
56
            break;
 
57
        case sNet2TreeEvolution::Inline:
 
58
            S+=Symbol::Inline;
 
59
            break;
 
60
        case sNet2TreeEvolution::CanonicallyExpanded:
 
61
            S+=Symbol::CanonicallyExpanded;
 
62
            break;
51
63
    };
52
64
    S += "</font>";
53
65
    Expander=new QTextDocument();
54
66
    Expander->setDocumentMargin(0);
55
 
    Expander->setHtml(sString2QString(S));
 
67
    Expander->setHtml(ToQString(S));
56
68
  };
57
69
  Representation.setDocumentMargin(0);
58
70
  Representation.setDefaultStyleSheet("color: green");
59
 
  Representation.setHtml(sString2QString(TreeItem->HyperText()));
 
71
  Representation.setHtml(ToQString(TreeItem->HyperText()));
60
72
};
61
73
 
62
74
//---------------------------------------------------------- sNavigatorMenu ---
316
328
    QMimeData *                 mimeData = new QMimeData;
317
329
    QByteArray                  data;
318
330
    mimeData
319
 
        ->setData(sString2QString(sNet2TreeEvolution::sItem::MimeType), data);
 
331
        ->setData(ToQString(sNet2TreeEvolution::sItem::MimeType), data);
320
332
    drag->setMimeData(mimeData);
321
333
 
322
334
    Qt::DropAction              DropAct;
346
358
void  sNavigatorViewport::dragEnterEvent (QDragEnterEvent *  event)
347
359
{
348
360
  if( event->mimeData()
349
 
           ->hasFormat(sString2QString(sNet2TreeEvolution::sItem::MimeType)) ){
 
361
           ->hasFormat(ToQString(sNet2TreeEvolution::sItem::MimeType)) ){
350
362
    event->acceptProposedAction();
351
363
    DestinationRect->setGeometry(QRect(event->pos()
352
364
                                      ,event->pos()).normalized());
360
372
//  if( event->answerRect().intersects(dropFrame->geometry()) )
361
373
//    ;
362
374
  if( event->mimeData()
363
 
           ->hasFormat(sString2QString(sNet2TreeEvolution::sItem::MimeType)) ){
 
375
           ->hasFormat(ToQString(sNet2TreeEvolution::sItem::MimeType)) ){
364
376
    psNavigatorItem             ViewItem = FindItemAt(event->pos());
365
377
    sNet2TreeEvolution::psItem  DestinationItem = ( ViewItem
366
378
                                                  ? ViewItem->TreeItem
403
415
//    return;
404
416
  DestinationRect->hide();
405
417
  if( event->mimeData()
406
 
           ->hasFormat(sString2QString(sNet2TreeEvolution::sItem::MimeType)) ){
 
418
           ->hasFormat(ToQString(sNet2TreeEvolution::sItem::MimeType)) ){
407
419
    psNavigatorItem             ViewItem = FindItemAt(event->pos());
408
420
    sNet2TreeEvolution::psItem  DestinationItem = ( ViewItem
409
421
                                                  ? ViewItem->TreeItem
413
425
        event->acceptProposedAction();
414
426
        sAttrDlg                      D(parentWidget());
415
427
        D.setWindowTitle(tr("Link to a datanet node"));
416
 
//           "The dragged value will be linked to the destination data cluster."
 
428
//           "The dragged value will be linked to the destination object."
417
429
//           "  The newborn attribute may have the same or a different name."
418
430
        D.SetAttrName(sNet2TreeEvolution::sItem::DraggedItem->AttrName());
419
431
        if( D.exec() )
425
437
      };
426
438
    }else if( event->proposedAction() == Qt::CopyAction ){
427
439
      event->acceptProposedAction();
428
 
//            "The dragged cluster will be ascribed as a model "
429
 
//            "to the destination data cluster. "
 
440
//            "The dragged object will be ascribed as a model "
 
441
//            "to the destination object. "
430
442
         // Process the data from the event.
431
443
    }else if( event->proposedAction() == Qt::MoveAction ){
432
444
//      event->acceptProposedAction();