@@ -17,6 +17,11 peripheralWidget::peripheralWidget(const | |||||
17 | setFont(QFont("Utopia", 14,QFont::Bold)); |
|
17 | setFont(QFont("Utopia", 14,QFont::Bold)); | |
18 | } |
|
18 | } | |
19 |
|
19 | |||
|
20 | int peripheralWidget::count() | |||
|
21 | { | |||
|
22 | return registersWdgts.count(); | |||
|
23 | } | |||
|
24 | ||||
20 | void peripheralWidget::blinkCursor() |
|
25 | void peripheralWidget::blinkCursor() | |
21 | { |
|
26 | { | |
22 | if(selectedReg!=-1) |
|
27 | if(selectedReg!=-1) |
@@ -28,6 +28,7 public: | |||||
28 | return registersWdgts.at(index); |
|
28 | return registersWdgts.at(index); | |
29 | return NULL; |
|
29 | return NULL; | |
30 | } |
|
30 | } | |
|
31 | int count(); | |||
31 | signals: |
|
32 | signals: | |
32 | void writeRegSig(qint32 address,qint32 value); |
|
33 | void writeRegSig(qint32 address,qint32 value); | |
33 | qint32 readRegSig(qint32 address); |
|
34 | qint32 readRegSig(qint32 address); |
@@ -53,30 +53,40 void socRegsViewer::periphClicked(periph | |||||
53 |
|
53 | |||
54 | void socRegsViewer::periphUp(peripheralWidget *sender, int cursorIndex) |
|
54 | void socRegsViewer::periphUp(peripheralWidget *sender, int cursorIndex) | |
55 | { |
|
55 | { | |
56 | int index; |
|
56 | int index,senderIndex; | |
57 | if(sender!=NULL) |
|
57 | if(sender!=NULL) | |
58 | { |
|
58 | { | |
59 | index = p_peripherals.indexOf(sender); |
|
59 | index =senderIndex= p_peripherals.indexOf(sender); | |
60 |
|
|
60 | while(index!=-1 && index!=0) | |
61 | { |
|
61 | { | |
62 |
p_peripherals.at(index)-> |
|
62 | if(p_peripherals.at(index-1)->count()>0) | |
63 | p_peripherals.at(index-1)->enter(cursorIndex,false); |
|
63 | { | |
64 |
|
|
64 | p_peripherals.at(senderIndex)->leave(); | |
|
65 | p_peripherals.at(index-1)->enter(cursorIndex,false); | |||
|
66 | ensureWidgetVisible(p_peripherals.at(index-1)); | |||
|
67 | break; | |||
|
68 | } | |||
|
69 | index--; | |||
65 | } |
|
70 | } | |
66 | } |
|
71 | } | |
67 | } |
|
72 | } | |
68 |
|
73 | |||
69 | void socRegsViewer::periphDown(peripheralWidget *sender, int cursorIndex) |
|
74 | void socRegsViewer::periphDown(peripheralWidget *sender, int cursorIndex) | |
70 | { |
|
75 | { | |
71 | int index; |
|
76 | int index,senderIndex; | |
72 | if(sender!=NULL) |
|
77 | if(sender!=NULL) | |
73 | { |
|
78 | { | |
74 |
index |
|
79 | index=senderIndex= p_peripherals.indexOf(sender); | |
75 |
|
|
80 | while((index!=-1) && (index<(p_peripherals.count()-1))) | |
76 | { |
|
81 | { | |
77 |
p_peripherals.at(index)-> |
|
82 | if(p_peripherals.at(index+1)->count()>0) | |
78 | p_peripherals.at(index+1)->enter(cursorIndex); |
|
83 | { | |
79 |
|
|
84 | p_peripherals.at(senderIndex)->leave(); | |
|
85 | p_peripherals.at(index+1)->enter(cursorIndex); | |||
|
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