##// END OF EJS Templates
Removed bug on register navigation with keyboard.
jeandet -
r16:e3a98a04d9ec default
parent child
Show More
@@ -17,6 +17,11 peripheralWidget::peripheralWidget(const
17 17 setFont(QFont("Utopia", 14,QFont::Bold));
18 18 }
19 19
20 int peripheralWidget::count()
21 {
22 return registersWdgts.count();
23 }
24
20 25 void peripheralWidget::blinkCursor()
21 26 {
22 27 if(selectedReg!=-1)
@@ -28,6 +28,7 public:
28 28 return registersWdgts.at(index);
29 29 return NULL;
30 30 }
31 int count();
31 32 signals:
32 33 void writeRegSig(qint32 address,qint32 value);
33 34 qint32 readRegSig(qint32 address);
@@ -53,30 +53,40 void socRegsViewer::periphClicked(periph
53 53
54 54 void socRegsViewer::periphUp(peripheralWidget *sender, int cursorIndex)
55 55 {
56 int index;
56 int index,senderIndex;
57 57 if(sender!=NULL)
58 58 {
59 index = p_peripherals.indexOf(sender);
60 if(index!=-1 && index!=0)
59 index =senderIndex= p_peripherals.indexOf(sender);
60 while(index!=-1 && index!=0)
61 61 {
62 p_peripherals.at(index)->leave();
62 if(p_peripherals.at(index-1)->count()>0)
63 {
64 p_peripherals.at(senderIndex)->leave();
63 65 p_peripherals.at(index-1)->enter(cursorIndex,false);
64 66 ensureWidgetVisible(p_peripherals.at(index-1));
67 break;
68 }
69 index--;
65 70 }
66 71 }
67 72 }
68 73
69 74 void socRegsViewer::periphDown(peripheralWidget *sender, int cursorIndex)
70 75 {
71 int index;
76 int index,senderIndex;
72 77 if(sender!=NULL)
73 78 {
74 index = p_peripherals.indexOf(sender);
75 if(index!=-1 && index<(p_peripherals.count()-1))
79 index=senderIndex= p_peripherals.indexOf(sender);
80 while((index!=-1) && (index<(p_peripherals.count()-1)))
76 81 {
77 p_peripherals.at(index)->leave();
82 if(p_peripherals.at(index+1)->count()>0)
83 {
84 p_peripherals.at(senderIndex)->leave();
78 85 p_peripherals.at(index+1)->enter(cursorIndex);
79 86 ensureWidgetVisible(p_peripherals.at(index+1));
87 break;
88 }
89 index++;
80 90 }
81 91 }
82 92 }
General Comments 0
You need to be logged in to leave comments. Login now