This source file includes following definitions.
- DrawMove_ColsDown
- DrawMove_ColsUp
- DrawMove_ColsRight
- DrawMove_ColsLeft
- DrawMove_FullUp
- DrawMove_FullDown
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <string.h>
4
5 #include "BF_Roster.h"
6 #include "BF_Msg.h"
7 #include "BF_GUI_NodePanel.h"
8 #include "BF_GUI_DlgViews.h"
9
10
11 void
12 BF_GUI_NodePanel::DrawMove_ColsDown()
13 {
14
15
16 DrawNodeSelf(iNavCursorIndex,false,true);
17
18 BRect oFirstRect(poRender->Bounds());
19 oFirstRect.left+=4;
20 oFirstRect.right = oFirstRect.left + fColsColWidth-3;
21 oFirstRect.top += HeaderHeight() + fColTitleHeight + fNodeHeight;
22 oFirstRect.bottom = oFirstRect.top + fNodesHeight - fNodeHeight;
23
24 BRect oColRectOld( oFirstRect ),oColRectNew,oNodeTopOld,oNodeTopNew;
25 for(int32 iCol=0;iCol<(int32)iColsColCount;iCol++){
26
27 if(iCol>0){
28 oNodeTopOld = oColRectOld;
29 oNodeTopOld.top -= fNodeHeight;
30 oNodeTopOld.bottom = oNodeTopOld.top + fNodeHeight-1;
31 oNodeTopNew = oColRectOld;
32 oNodeTopNew.top = oNodeTopNew.bottom-fNodeHeight;
33 oNodeTopNew.bottom--;
34 oNodeTopNew.left -= fColsColWidth;
35 oNodeTopNew.right -= fColsColWidth;
36 poRender->CopyBits(oNodeTopOld,oNodeTopNew);
37 }
38
39 oColRectNew = oColRectOld;
40 oColRectNew.top -= fNodeHeight;
41 oColRectNew.bottom -= fNodeHeight;
42 poRender->CopyBits(oColRectOld,oColRectNew);
43
44 oColRectOld.left += fColsColWidth;
45 oColRectOld.right += fColsColWidth;
46 }
47
48 NavChangeCursor(iNavCursorIndex+1,false);
49
50 DrawNodeSelf(iNavCursorIndex,true,true);
51 }
52
53 void
54 BF_GUI_NodePanel::DrawMove_ColsUp()
55 {
56
57 DrawNodeSelf(iNavCursorIndex,false,true);
58
59 BRect oFirstRect(poRender->Bounds());
60 oFirstRect.left+=4 + fColsColWidth*(iColsColCount-1);
61 oFirstRect.right = oFirstRect.left + fColsColWidth-3;
62 oFirstRect.top += HeaderHeight() + fColTitleHeight;
63 oFirstRect.bottom = oFirstRect.top + fNodesHeight - fNodeHeight;
64
65 BRect oColRectOld( oFirstRect ),oColRectNew,oNodeTopOld,oNodeTopNew;
66
67 for(int32 iCol=iColsColCount-1;iCol>=0;iCol--){
68
69 if(iCol<((int32)iColsColCount-1)){
70 oNodeTopOld = oColRectOld;
71 oNodeTopOld.top = oNodeTopOld.bottom;
72 oNodeTopOld.bottom = oNodeTopOld.top + fNodeHeight;
73 oNodeTopNew = oColRectOld;
74 oNodeTopNew.bottom = oNodeTopNew.top + fNodeHeight -1;
75 oNodeTopNew.left += fColsColWidth;
76 oNodeTopNew.right += fColsColWidth;
77 poRender->CopyBits(oNodeTopOld,oNodeTopNew);
78 }
79
80 oColRectNew = oColRectOld;
81 oColRectNew.top += fNodeHeight;
82 oColRectNew.bottom += fNodeHeight;
83 poRender->CopyBits(oColRectOld,oColRectNew);
84
85 oColRectOld.left -= fColsColWidth;
86 oColRectOld.right -= fColsColWidth;
87 }
88
89 NavChangeCursor(iNavCursorIndex-1,false);
90
91 DrawNodeSelf(iNavCursorIndex,true,true);
92 }
93
94 void
95 BF_GUI_NodePanel::DrawMove_ColsRight()
96 {
97
98 DrawNodeSelf(iNavCursorIndex,false,true);
99
100 BRect oOldRect(poRender->Bounds());
101 oOldRect.left += 4 + fColsColWidth;
102 oOldRect.right = oOldRect.left + (iColsColCount-1) * fColsColWidth -2;
103 oOldRect.top += HeaderHeight() + fColTitleHeight;
104 oOldRect.bottom = oOldRect.top + fNodesHeight;
105
106
107 BRect oNewRect(oOldRect);
108 oNewRect.left -= fColsColWidth;
109 oNewRect.right -= fColsColWidth;
110
111
112 poRender->CopyBits(oOldRect,oNewRect);
113
114 iNavCursorIndex += iColsNodesInCol;
115 iNavFirstIndex += iColsNodesInCol;
116 NavChangeCursor(iNavCursorIndex + iColsNodesInCol,false,false);
117
118 {
119 int iNode = iNavFirstIndex + iColsNodesInCol * (iColsColCount-1);
120 for(uint i = 0;i < iColsNodesInCol;i++){
121 DrawNodeSelf(i+iNode,(i+iNode)==iNavCursorIndex,true);
122 }
123 }
124 }
125
126 void
127 BF_GUI_NodePanel::DrawMove_ColsLeft()
128 {
129
130 DrawNodeSelf(iNavCursorIndex,false,true);
131
132 BRect oOldRect(poRender->Bounds());
133 oOldRect.left += 4;
134 oOldRect.right = oOldRect.left + (iColsColCount-1) * fColsColWidth -2;
135 oOldRect.top += HeaderHeight() + fColTitleHeight;
136 oOldRect.bottom = oOldRect.top + fNodesHeight;
137
138
139 BRect oNewRect(oOldRect);
140 oNewRect.left += fColsColWidth;
141 oNewRect.right += fColsColWidth;
142
143
144 poRender->CopyBits(oOldRect,oNewRect);
145
146 iNavCursorIndex -= iColsNodesInCol;
147 iNavFirstIndex -= iColsNodesInCol;
148 NavChangeCursor(iNavCursorIndex,false,false);
149
150 {
151 for(int32 i = iNavFirstIndex;i < iNavFirstIndex+(int32)iColsNodesInCol;i++){
152 DrawNodeSelf(i,i==iNavCursorIndex,true);
153 }
154 }
155 }
156
157
158 void
159 BF_GUI_NodePanel::DrawMove_FullUp()
160 {
161
162 DrawNodeSelf(iNavCursorIndex,false,true);
163
164
165 BRect oOldRect(poRender->Bounds());
166 oOldRect.left += 4 ;
167 oOldRect.right -= 4 ;
168 oOldRect.top += HeaderHeight() + fColTitleHeight;
169 oOldRect.bottom = oOldRect.top + fNodesHeight - fNodeHeight;
170
171 BRect oNewRect(oOldRect);
172 oNewRect.top += fNodeHeight;
173 oNewRect.bottom += fNodeHeight;
174
175
176 poRender->CopyBits(oOldRect,oNewRect);
177
178
179 iNavCursorIndex --;
180 iNavFirstIndex --;
181 NavChangeCursor(iNavCursorIndex,false,false);
182
183
184 DrawNodeSelf(iNavCursorIndex,true,true);
185
186 }
187
188 void
189 BF_GUI_NodePanel::DrawMove_FullDown()
190 {
191
192 DrawNodeSelf(iNavCursorIndex,false,true);
193
194
195 BRect oOldRect(poRender->Bounds());
196 oOldRect.left += 4 ;
197 oOldRect.right -= 4 ;
198 oOldRect.top += HeaderHeight() + fColTitleHeight;
199 oOldRect.bottom = oOldRect.top + fNodesHeight;
200 oOldRect.top += fNodeHeight;
201
202 BRect oNewRect(oOldRect);
203 oNewRect.top -= fNodeHeight;
204 oNewRect.bottom -= fNodeHeight;
205
206 poRender->CopyBits(oOldRect,oNewRect);
207
208
209 iNavCursorIndex ++;
210 iNavFirstIndex ++;
211 NavChangeCursor(iNavCursorIndex + iColsNodesInCol,false,false);
212
213
214 DrawNodeSelf(iNavCursorIndex,true,true);