1 /***************************************************************************
3 NList.mcc - New List MUI Custom Class
4 Registered MUI class, Serial Number: 1d51 0x9d510030 to 0x9d5100A0
5 0x9d5100C0 to 0x9d5100FF
7 Copyright (C) 1996-2001 by Gilles Masson
8 Copyright (C) 2001-2014 NList Open Source Team
10 This library is free software; you can redistribute it and/or
11 modify it under the terms of the GNU Lesser General Public
12 License as published by the Free Software Foundation; either
13 version 2.1 of the License, or (at your option) any later version.
15 This library is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 Lesser General Public License for more details.
20 NList classes Support Site: http://www.sf.net/projects/nlist-classes
24 ***************************************************************************/
28 #include <graphics/gfxmacros.h>
31 #include <clib/alib_protos.h>
32 #include <proto/muimaster.h>
33 #include <proto/graphics.h>
34 #include <proto/layers.h>
35 #include <proto/intuition.h>
39 #include "NList_func.h"
40 #include "NListviews_mcp.h"
42 void NL_SetObjInfos(struct NLData
*data
,BOOL setall
)
44 Object
*obj
= data
->this;
47 if (data
->do_draw_all
|| data
->format_chge
|| data
->do_setcols
|| (data
->rp
!= _rp(obj
)) ||
48 (data
->left
!= _left(obj
)) || (data
->top
!= _top(obj
)) || (data
->MinImageHeight
> data
->vinc
) ||
49 (data
->width
!= _width(obj
)) || (data
->height
!= _height(obj
)))
51 WORD vpos
= data
->vpos
;
52 WORD mtop
= data
->mtop
;
53 WORD mleft
= data
->mleft
;
54 WORD mheight
= data
->mheight
;
55 WORD mwidth
= data
->mwidth
;
56 WORD vtop
= data
->vtop
;
57 WORD vleft
= data
->vleft
;
58 WORD vheight
= data
->vheight
;
59 WORD vwidth
= data
->vwidth
;
60 WORD vinc
= data
->vinc
;
63 data
->font
= _font(obj
);
64 data
->pens
= _pens(obj
);
66 data
->left
= _left(obj
);
67 data
->top
= _top(obj
);
68 data
->width
= _width(obj
);
69 data
->height
= _height(obj
);
71 data
->vinc
= data
->font
->tf_YSize
+ data
->addvinc
;
72 if (data
->NList_MinLineHeight
> data
->vinc
)
73 data
->vinc
= data
->NList_MinLineHeight
;
74 if (data
->MinImageHeight
> data
->vinc
)
75 { data
->vinc
= data
->MinImageHeight
;
80 if ((vinc
> 1) && (vinc
!= data
->vinc
))
81 { DO_NOTIFY(NTF_MinMax
| NTF_LineHeight
);
84 data
->voff
= data
->font
->tf_Baseline
+ (data
->vinc
- data
->font
->tf_YSize
+ 1)/2;
92 SetSoftStyle(data
->rp
, FSF_BOLD
|FSF_ITALIC
, STYLE_MASK
);
93 TextExtent(data
->rp
, "m", 1, &te
);
94 if (data
->hinc
< te
.te_Width
)
95 data
->hinc
= te
.te_Width
;
96 SetSoftStyle(data
->rp
, FSF_BOLD
|FSF_ITALIC
, STYLE_MASK
);
97 TextExtent(data
->rp
, "M", 1, &te
);
98 if (data
->hinc
< te
.te_Width
)
99 data
->hinc
= te
.te_Width
;
100 SetSoftStyle(data
->rp
, FSF_BOLD
|FSF_ITALIC
, STYLE_MASK
);
101 TextExtent(data
->rp
, "w", 1, &te
);
102 if (data
->hinc
< te
.te_Width
)
103 data
->hinc
= te
.te_Width
;
104 SetSoftStyle(data
->rp
, FSF_BOLD
|FSF_ITALIC
, STYLE_MASK
);
105 TextExtent(data
->rp
, "W", 1, &te
);
106 if (data
->hinc
< te
.te_Width
)
107 data
->hinc
= te
.te_Width
;
108 SetSoftStyle(data
->rp
, 0, STYLE_MASK
);
109 TextExtent(data
->rp
, " ", 1, &te
);
110 data
->spacesize
= te
.te_Width
;
112 data
->tabsize
= data
->spacesize
* data
->NList_TabSize
;
113 if (data
->tabsize
< 4)
116 if (data
->NList_PartialChar
)
117 data
->NList_PartialChar
= (data
->hinc
> 0) ? data
->hinc
: 10;
119 data
->mleft
= _mleft(obj
);
120 data
->mright
= _mright(obj
);
121 data
->mwidth
= _mwidth(obj
);
122 data
->mtop
= _mtop(obj
);
123 data
->mbottom
= _mbottom(obj
);
127 Object
*o
= data
->VirtGroup
;
130 data
->vleft
= _mleft(o
);
131 data
->vright
= _mright(o
);
132 data
->vtop
= _mtop(o
);
133 data
->vbottom
= _mbottom(o
);
135 data
->vdx
= -data
->mleft
;
136 data
->vdy
= -data
->mtop
;
138 /* (mri_Flags & 0x20000000) if in a virtgroup */
139 /* (mri_Flags & 0x40000000) if it is a virtgroup */
140 o
= data
->VirtGroup2
;
141 if(o
== data
->VirtGroup
)
142 o
= (Object
*)xget(o
, MUIA_Parent
);
150 if (ocl
== data
->VirtClass
)
152 if (data
->VirtGroup2
== data
->VirtGroup
)
153 data
->VirtGroup2
= o
;
155 if (data
->vleft
< _mleft(o
)) data
->vleft
= _mleft(o
);
156 if (data
->vright
> _mright(o
)) data
->vright
= _mright(o
);
157 if (data
->vtop
< _mtop(o
)) data
->vtop
= _mtop(o
);
158 if (data
->vbottom
> _mbottom(o
)) data
->vbottom
= _mbottom(o
);
166 o
= (Object
*)xget(o
, MUIA_Parent
);
169 if (data
->VirtGroup2
== data
->VirtGroup
)
170 data
->VirtGroup2
= NULL
;
171 if (data
->vleft
< data
->mleft
) data
->vleft
= data
->mleft
;
172 if (data
->vright
> data
->mright
) data
->vright
= data
->mright
;
173 if (data
->vtop
< data
->mtop
) data
->vtop
= data
->mtop
;
174 if (data
->vbottom
> data
->mbottom
) data
->vbottom
= data
->mbottom
;
175 data
->vwidth
= data
->vright
- data
->vleft
+ 1;
176 data
->vheight
= data
->vbottom
- data
->vtop
+ 1;
180 data
->vleft
= _mleft(obj
);
181 data
->vright
= _mright(obj
);
182 data
->vtop
= _mtop(obj
);
183 data
->vbottom
= _mbottom(obj
);
184 data
->vwidth
= _mwidth(obj
);
185 data
->vheight
= _mheight(obj
);
190 data
->hpos
= data
->mleft
;
191 data
->hvisible
= data
->mright
- data
->mleft
;
192 data
->mheight
= _mheight(obj
);
193 if (data
->NList_Title
)
194 { data
->mheight
-= data
->vinc
;
195 if (data
->NList_TitleSeparator
)
199 data
->lvisible
= data
->mheight
/ data
->vinc
;
200 vdheight
= (data
->mheight
- data
->lvisible
* data
->vinc
);
202 /* Set vertical delta top, if text should be centered vertically */
203 if (data
->NList_VerticalCenteredText
)
204 data
->vdt
= vdheight
/ 2;
208 data
->vdb
= vdheight
- data
->vdt
;
209 data
->vdtpos
= data
->mtop
;
210 if (data
->NList_Title
)
212 data
->vdtitlepos
= data
->vdtpos
;
213 data
->vdtitleheight
= data
->vdt
+ data
->vinc
;
216 data
->vdtitlepos
= data
->vdtpos
+ data
->vdt
;
217 data
->vdtitleheight
= data
->vinc
/ 3;
219 data
->vdbpos
= data
->mbottom
+ 1 - data
->vdb
;
221 /* calculate the vertical top position of the first line of the list */
222 data
->vpos
= data
->mtop
+ data
->vdt
;
223 if (data
->NList_Title
)
225 data
->vpos
+= data
->vinc
;
226 if (data
->NList_TitleSeparator
)
230 data
->badrport
= FALSE
;
231 data
->NList_Visible
= data
->lvisible
;
233 if ((mwidth
!= data
->mwidth
))
234 data
->do_wwrap
= data
->force_wwrap
= TRUE
;
236 if ((mwidth
!= data
->mwidth
) || data
->format_chge
|| data
->do_draw_all
)
238 data
->do_draw_all
= data
->do_draw
= data
->do_draw_title
= data
->do_updatesb
= TRUE
;
239 data
->do_setcols
= TRUE
;
240 data
->Title_PixLen
= -1;
241 data
->ScrollBarsPos
= -2;
242 if (data
->NList_AdjustWidth
)
243 data
->NList_AdjustWidth
= -1;
244 NOWANT_NOTIFY(NTF_MinMaxNoDraw
);
248 if (WANTED_NOTIFY(NTF_MinMaxNoDraw
) && (vpos
== data
->vpos
) &&
249 (mtop
== data
->mtop
) && (mleft
== data
->mleft
) &&
250 (vtop
== data
->vtop
) && (vleft
== data
->vleft
) &&
251 (vheight
== data
->vheight
) && (vwidth
== data
->vwidth
))
254 else if (mheight
!= data
->mheight
)
256 data
->do_draw_all
= data
->do_draw
= data
->do_draw_title
= data
->do_updatesb
= TRUE
;
257 data
->Title_PixLen
= -1;
258 data
->ScrollBarsPos
= -2;
259 NOWANT_NOTIFY(NTF_MinMaxNoDraw
);
262 data
->drawall_bits
= 0;
263 data
->format_chge
= 0;
268 static void DrawAdjustBar(struct NLData
*data
,WORD draw
)
270 WORD hfirst
= data
->NList_Horiz_AffFirst
& ~1;
271 WORD hfirsthpos
= hfirst
- data
->hpos
;
273 Object
*obj
= data
->this;
277 if ((data
->adjustbar
== -2) || ((data
->adjustbar
== -3) && (draw
== 2)))
279 if (data
->NList_Title
&& (data
->adjustcolumn
< data
->numcols
) && (data
->adjustcolumn
>= 0))
281 WORD minx
= (data
->cols
[data
->adjustcolumn
].c
->minx
- hfirsthpos
);
282 WORD maxx
= (data
->cols
[data
->adjustcolumn
].c
->maxx
- hfirsthpos
);
283 WORD maxy
= data
->vdtitlepos
+ data
->vdtitleheight
;
284 BOOL draw_left
= TRUE
;
285 BOOL draw_right
= TRUE
;
287 if (!data
->NList_TitleSeparator
)
289 if (data
->adjustcolumn
> 0)
290 minx
-= (data
->cols
[data
->adjustcolumn
-1].c
->delta
- (((data
->cols
[data
->adjustcolumn
-1].c
->delta
-1) / 2) + 1));
291 maxx
+= ((data
->cols
[data
->adjustcolumn
].c
->delta
-1) / 2);
292 if (data
->adjustcolumn
== data
->numcols
-1)
294 if (minx
< data
->mleft
)
299 if (maxx
> data
->mright
)
302 if (IS_BAR(data
->adjustcolumn
,data
->cols
[data
->adjustcolumn
].c
) || (maxx
< (data
->Title_PixLen
- hfirsthpos
)))
305 if ((maxx
- minx
) >= 1)
307 SetAPen(data
->rp
,data
->pens
[MPEN_SHINE
]);
308 Move(data
->rp
, minx
, maxy
);
309 Draw(data
->rp
, maxx
, maxy
);
311 Draw(data
->rp
, maxx
, data
->vdtitlepos
+ 1);
312 SetAPen(data
->rp
,data
->pens
[MPEN_SHADOW
]);
313 Move(data
->rp
, maxx
, data
->vdtitlepos
);
314 Draw(data
->rp
, minx
, data
->vdtitlepos
);
316 Draw(data
->rp
, minx
, maxy
);
317 SetAPen(data
->rp
,data
->pens
[MPEN_SHINE
]);
318 data
->adjustbar_old
= data
->adjustbar
;
319 data
->adjustbar
= -3;
323 else if ((data
->adjustbar
>= 0) && ((data
->adjustbar_old
== -1) || (draw
== 2)))
325 adjbar
= data
->adjustbar
- hfirsthpos
;
326 if ((adjbar
< data
->mleft
) || (adjbar
>= data
->mright
))
327 data
->adjustbar_old
= -1;
330 if (data
->NList_ColWidthDrag
== MUIV_NList_ColWidthDrag_Visual
)
333 else if (data
->NList_ColWidthDrag
== MUIV_NList_ColWidthDrag_All
)
335 SetAPen(data
->rp
,data
->pens
[MPEN_SHADOW
]);
336 Move(data
->rp
, adjbar
+1, data
->vdtitlepos
);
337 Draw(data
->rp
, adjbar
+1, data
->vdbpos
- 1);
338 SetAPen(data
->rp
,data
->pens
[MPEN_SHINE
]);
339 Move(data
->rp
, adjbar
, data
->vdtitlepos
);
340 Draw(data
->rp
, adjbar
, data
->vdbpos
- 1);
342 else if (data
->NList_Title
)
344 SetAPen(data
->rp
,data
->pens
[MPEN_SHADOW
]);
345 Move(data
->rp
, adjbar
+1, data
->vdtitlepos
);
346 Draw(data
->rp
, adjbar
+1, data
->vdtitlepos
+ data
->vdtitleheight
- 1);
347 SetAPen(data
->rp
,data
->pens
[MPEN_SHINE
]);
348 Move(data
->rp
, adjbar
, data
->vdtitlepos
);
349 Draw(data
->rp
, adjbar
, data
->vdtitlepos
+ data
->vdtitleheight
- 1);
353 SetAPen(data
->rp
,data
->pens
[MPEN_SHADOW
]);
354 Move(data
->rp
, adjbar
+1, data
->vpos
);
355 Draw(data
->rp
, adjbar
+1, data
->vpos
+ data
->vinc
- 1);
356 SetAPen(data
->rp
,data
->pens
[MPEN_SHINE
]);
357 Move(data
->rp
, adjbar
, data
->vpos
);
358 Draw(data
->rp
, adjbar
, data
->vpos
+ data
->vinc
- 1);
360 data
->adjustbar_old
= data
->adjustbar
;
366 APTR clippinghandle
= NULL
;
368 if (data
->NList_Title
&& (data
->adjustbar_old
<= -2) && ((data
->adjustbar
== -1) || (data
->adjustbar
<= -4)))
370 if ((data
->adjustcolumn
< data
->numcols
) && (data
->adjustcolumn
>= 0))
372 WORD minx
= (data
->cols
[data
->adjustcolumn
].c
->minx
- hfirsthpos
);
373 WORD maxx
= (data
->cols
[data
->adjustcolumn
].c
->maxx
- hfirsthpos
);
375 if (data
->adjustcolumn
> 0)
376 minx
-= (data
->cols
[data
->adjustcolumn
-1].c
->delta
- (((data
->cols
[data
->adjustcolumn
-1].c
->delta
-1) / 2) + 1));
377 maxx
+= ((data
->cols
[data
->adjustcolumn
].c
->delta
-1) / 2);
378 if (minx
< data
->mleft
)
380 if (maxx
> data
->mright
)
382 if ((maxx
- minx
) > 0)
384 WORD height
= data
->vdtitleheight
;
387 if (data
->NList_TitleSeparator
)
389 clippinghandle
= MUI_AddClipping(muiRenderInfo(obj
),(WORD
) minx
,data
->vdtitlepos
,(WORD
) (maxx
-minx
),height
);
390 DrawTitle(data
,minx
,maxx
,hfirst
);
391 MUI_RemoveClipping(muiRenderInfo(obj
),clippinghandle
);
394 data
->adjustbar_old
= -1;
396 else if (data
->adjustbar_old
>= 0)
398 adjbar
= data
->adjustbar_old
- hfirsthpos
;
399 if (adjbar
< data
->mleft
)
401 adjbar
= data
->mleft
;
402 data
->adjustbar_old
= adjbar
+ hfirsthpos
;
404 else if (adjbar
>= data
->mright
)
406 adjbar
= data
->mright
- 1;
407 data
->adjustbar_old
= adjbar
+ hfirsthpos
;
409 if (data
->NList_ColWidthDrag
== MUIV_NList_ColWidthDrag_Visual
)
412 else if (data
->NList_ColWidthDrag
== MUIV_NList_ColWidthDrag_All
)
414 clippinghandle
= MUI_AddClipping(muiRenderInfo(obj
),(WORD
) adjbar
,data
->vdtitlepos
,(WORD
) 2,(WORD
) (data
->vdbpos
- data
->vdtitlepos
));
415 DrawLines(data
,data
->NList_AffFirst
,data
->NList_AffFirst
+data
->NList_Visible
,adjbar
,adjbar
+2,hfirst
,0,1,TRUE
,0);
416 if (data
->NList_Title
)
417 DrawTitle(data
,adjbar
,adjbar
+2,hfirst
);
418 MUI_RemoveClipping(muiRenderInfo(obj
),clippinghandle
);
420 else if (data
->NList_Title
)
422 clippinghandle
= MUI_AddClipping(muiRenderInfo(obj
),(WORD
) adjbar
,data
->vdtitlepos
,(WORD
) 2,data
->vdtitleheight
);
423 DrawTitle(data
,adjbar
,adjbar
+2,hfirst
);
424 MUI_RemoveClipping(muiRenderInfo(obj
),clippinghandle
);
428 clippinghandle
= MUI_AddClipping(muiRenderInfo(obj
),(WORD
) adjbar
,data
->vpos
,(WORD
) 2,data
->vinc
);
429 DrawLines(data
,data
->NList_AffFirst
,data
->NList_AffFirst
+1,adjbar
,adjbar
+2,hfirst
,0,1,TRUE
,0);
430 MUI_RemoveClipping(muiRenderInfo(obj
),clippinghandle
);
432 data
->adjustbar_old
= -1;
439 * struct ClipRect *cr;
440 * struct RegionRectangle *rr;
441 * struct Region *reg;
442 * LONG MinX,MinY,MaxX,MaxY;
443 * LONG mleft,mright,mtop,mbottom;
445 * mleft = data->mleft + ((LONG) _window(obj)->LeftEdge);
446 * mright = data->mright + ((LONG) _window(obj)->LeftEdge);
447 * mtop = data->mtop + ((LONG) _window(obj)->TopEdge);
448 * mbottom = data->mbottom + ((LONG) _window(obj)->TopEdge);
449 * D(bug("%lx|Object >(%ld,%ld / %ld,%ld)\n",obj,mleft,mtop,mright,mbottom));
451 * cr = _window(obj)->WLayer->ClipRect;
453 * { MinX = (LONG) cr->bounds.MinX;MinY = (LONG) cr->bounds.MinY;MaxX = (LONG) cr->bounds.MaxX;MaxY = (LONG) cr->bounds.MaxY;
454 * D(bug("%lx|CR %ld %ld,%ld / %ld,%ld\n",obj,one_more,MinX,MinY,MaxX,MaxY));
455 * one_more++;cr = cr->Next;
459 * cr = _window(obj)->WLayer->_cliprects;
461 * { MinX = (LONG) cr->bounds.MinX;MinY = (LONG) cr->bounds.MinY;MaxX = (LONG) cr->bounds.MaxX;MaxY = (LONG) cr->bounds.MaxY;
462 * D(bug("%lx|_cr %ld %ld,%ld / %ld,%ld\n",obj,one_more,MinX,MinY,MaxX,MaxY));
463 * one_more++;cr = cr->Next;
467 * cr = _window(obj)->WLayer->SuperClipRect;
469 * { MinX = (LONG) cr->bounds.MinX;MinY = (LONG) cr->bounds.MinY;MaxX = (LONG) cr->bounds.MaxX;MaxY = (LONG) cr->bounds.MaxY;
470 * D(bug("%lx|SuperClipRect %ld>%ld,%ld / %ld,%ld\n",obj,one_more,MinX,MinY,MaxX,MaxY));
471 * one_more++;cr = cr->Next;
475 * reg = _window(obj)->WLayer->ClipRegion;
477 * { MinX = (LONG) reg->bounds.MinX;MinY = (LONG) reg->bounds.MinY;MaxX = (LONG) reg->bounds.MaxX;MaxY = (LONG) reg->bounds.MaxY;
478 * D(bug("%lx|ClipRegion %ld>%ld,%ld / %ld,%ld\n",obj,one_more,MinX,MinY,MaxX,MaxY));
479 * one_more++;rr = reg->RegionRectangle;
481 * { MinX = (LONG) rr->bounds.MinX;MinY = (LONG) rr->bounds.MinY;MaxX = (LONG) rr->bounds.MaxX;MaxY = (LONG) rr->bounds.MaxY;
482 * D(bug("%lx|ClipRegion %ld>%ld,%ld / %ld,%ld\n",obj,one_more,MinX,MinY,MaxX,MaxY));
483 * one_more++;rr = rr->Next;
489 #define LayerDamaged(l) ((l)->DamageList && (l)->DamageList->RegionRectangle)
491 #define LayerCovered(l) ((!(l)->ClipRect) || ((l)->ClipRect->bounds.MaxX != (l)->bounds.MaxX) ||\
492 ((l)->ClipRect->bounds.MinX != (l)->bounds.MinX) ||\
493 ((l)->ClipRect->bounds.MaxY != (l)->bounds.MaxY) ||\
494 ((l)->ClipRect->bounds.MinY != (l)->bounds.MinY))
497 static ULONG
DrawRefresh(struct NLData
*data
)
499 Object
*obj
= data
->this;
500 APTR clippinghandle
= NULL
;
501 struct RegionRectangle
*rr
;
503 WORD sX
,sY
,MinX
,MinY
,MaxX
,MaxY
;
504 WORD mleft
,mright
,mtop
,mbottom
,mwidth
,mheight
;
505 WORD hfirst
= data
->NList_Horiz_AffFirst
& ~1;
508 * if ((data->left != _left(obj)) || (data->top != _top(obj)) ||
509 * (data->width != _width(obj)) || (data->height != _height(obj)))
511 * LONG ml = (LONG) _mleft(obj);
512 * LONG mt = (LONG) _top(obj);
513 * D(bug("%lx|ml=%ld (%ld) mt=%ld (%ld)\n",obj,ml,data->mleft,mt,data->top));
514 * NL_SetObjInfos(data,FALSE);
518 LockLayer( 0, _window(obj
)->WLayer
);
519 reg
= _window(obj
)->WLayer
->DamageList
;
521 { sX
= reg
->bounds
.MinX
;
522 sY
= reg
->bounds
.MinY
;
523 mleft
= reg
->bounds
.MaxX
;
524 mtop
= reg
->bounds
.MaxY
;
527 rr
= reg
->RegionRectangle
;
529 { MinX
= sX
+ rr
->bounds
.MinX
;
530 MinY
= sY
+ rr
->bounds
.MinY
;
531 MaxX
= sX
+ rr
->bounds
.MaxX
;
532 MaxY
= sY
+ rr
->bounds
.MaxY
;
533 if ((MinX
< data
->mright
) || (MaxX
> data
->mleft
) ||
534 (MinY
< data
->mbottom
) || (MaxY
> data
->mtop
))
536 if (MinX
< mleft
) mleft
= MinX
;
537 if (MinY
< mtop
) mtop
= MinY
;
538 if (MaxX
> mright
) mright
= MaxX
;
539 if (MaxY
> mbottom
) mbottom
= MaxY
;
543 UnlockLayer( _window(obj
)->WLayer
);
545 if ((mleft
< data
->mright
) || (mright
> data
->mleft
) ||
546 (mtop
< data
->mbottom
) || (mbottom
> data
->mtop
))
547 { if (mleft
< data
->mleft
) mleft
= data
->mleft
;
548 if (mtop
< data
->mtop
) mtop
= data
->mtop
;
549 if (mright
> data
->mright
) mright
= data
->mright
;
550 if (mbottom
> data
->mbottom
) mbottom
= data
->mbottom
;
552 if ((mleft
<= mright
) && (mtop
<= mbottom
))
554 BOOL clipped
= FALSE
;
562 mwidth
= mright
- mleft
;
563 mheight
= mbottom
- mtop
;
565 ly1
= (mtop
- data
->vpos
);
566 ly2
= (mbottom
- data
->vpos
);
569 lyl1
= ly1
/ data
->vinc
;
570 lyl2
= ly2
/ data
->vinc
;
571 if (data
->NList_PartialChar
||
572 ((data
->NList_First_Incr
) && ((lyl1
<= 0) || (lyl2
>= data
->NList_Visible
))))
573 { clippinghandle
= MUI_AddClipping(muiRenderInfo(obj
),(WORD
) data
->mleft
,mtop
,(WORD
) data
->mwidth
,mheight
);
576 if (lyl1
< 0) lyl1
= 0;
577 if (lyl2
>= data
->NList_Visible
)
578 lyl2
= data
->NList_Visible
- 1;
579 if (data
->NList_First_Incr
)
582 lyl1
+= data
->NList_First
;
583 lyl2
+= data
->NList_First
;
586 SetBackGround(data
->NList_ListBackGround
)
587 if ((data
->vdt
> 0) && !data
->NList_Title
&& (ly1
< 0))
588 DrawBackground(obj
, mleft
, data
->vdtpos
, mwidth
, data
->vdt
, data
->vdx
, data
->vdy
);
590 DrawBackground(obj
, mleft
, data
->vdbpos
, mwidth
, data
->vdb
, data
->vdx
, data
->vdy
);
591 if (data
->NList_Title
&& (ly1
< 0))
592 DrawTitle(data
,mleft
,mright
,hfirst
);
596 DrawLines(data
,lyl1
,lyl2
,mleft
,mright
,hfirst
,0,1,TRUE
,0);
599 MUI_RemoveClipping(muiRenderInfo(obj
),clippinghandle
);
600 DrawAdjustBar(data
,2);
601 SetBackGround(data
->NList_ListBackGround
);
605 * D(bug("%lx|no usable rect\n",obj));
610 UnlockLayer( _window(obj
)->WLayer
);
616 IPTR
mNL_Draw(struct IClass
*cl
,Object
*obj
,struct MUIP_Draw
*msg
)
618 struct NLData
*data
= INST_DATA(cl
,obj
);
622 struct MUIP_Draw mymsg
;
623 mymsg
.MethodID
= MUIM_Draw
;
625 /*D(bug("%lx|drawsuper1 %lx %lx %lx\n",obj,msg->flags,muiAreaData(obj)->mad_Flags,muiAreaData(data->drawsuper)->mad_Flags));*/
626 DoMethodA((Object
*)data
->drawsuper
, (Msg
)(void*)&mymsg
);
627 /*D(bug("%lx|drawsuper2 %lx %lx %lx\n",obj,msg->flags,muiAreaData(obj)->mad_Flags,muiAreaData(data->drawsuper)->mad_Flags));*/
632 if (data
->nodraw
|| !data
->SHOW
)
634 /*D(bug("%lx|nodraw \n",obj));*/
639 if (WANTED_NOTIFY(NTF_MinMaxNoDraw
) && !data
->do_draw_all
&& !data
->do_draw
)
641 NL_SetObjInfos(data
,FALSE
);
642 if (WANTED_NOTIFY(NTF_MinMaxNoDraw
))
649 /*D(bug("%lx|draw1=%ld\n",obj,data->DRAW));*/
650 if (data
->actbackground
== -1)
651 { SetBackGround(data
->NList_ListBackGround
);
654 if (data
->NList_Disabled
)
656 data
->do_draw
= FALSE
;
657 data
->do_draw_all
= FALSE
;
658 data
->do_draw_active
= FALSE
;
659 data
->do_draw_title
= FALSE
;
660 data
->first_change
= LONG_MAX
;
661 data
->last_change
= LONG_MIN
;
662 data
->minx_change_entry
= -1;
663 data
->maxx_change_entry
= -1;
664 if ((muiAreaData(obj
)->mad_Flags
& MADF_DRAWOBJECT
) ||
665 (data
->NList_Disabled
< 2))
667 NL_SetObjInfos(data
,FALSE
);
668 data
->NList_Disabled
= 2;
669 DoSuperMethodA(cl
,obj
,(Msg
)msg
);
675 if (data
->DragRPort
&& (data
->DragText
|| (data
->DragEntry
>= 0)))
677 DrawDragText(data
,TRUE
);
684 if(/*(data->refreshing != 2) && (data->DRAW > 1) &&*/
685 ((data
->refreshing
) ||
686 (muiRenderInfo(obj
)->mri_Flags
& MUIMRI_REFRESHMODE
)))
687 // || (data->rp->Layer->Flags & LAYERREFRESH)))
688 // ((data->rp->Layer->Flags & LAYERREFRESH) && !(data->do_draw_all && data->do_draw))))
690 /*D(bug("%lx|Refresh %ld %ld %ld %ld %lx %lx\n",obj,data->DRAW,data->do_draw_all,data->do_draw,(LONG)data->refreshing,(LONG)(muiRenderInfo(obj)->mri_Flags & MUIMRI_REFRESHMODE),(LONG)(data->rp->Layer->Flags & LAYERREFRESH)));*/
691 /* Avoid Superclass to draw anything *in* the object */
692 if (muiRenderInfo(obj
)->mri_Flags
& MUIMRI_REFRESHMODE
)
695 muiAreaData(obj
)->mad_Flags
&= ~0x00000001;
697 /* "AROS: FIXME: No frame drawn if doing: muiAreaData(obj)->mad_Flags &= ~0x00000001;" This is still valid 16.01.2012 */
699 DoSuperMethodA(cl
,obj
,(Msg
) msg
);
703 * data->do_draw = FALSE;
704 * data->do_draw_all = FALSE;
705 * data->do_draw_active = FALSE;
706 * data->do_draw_title = FALSE;
707 * data->first_change = LONG_MAX;
708 * data->last_change = LONG_MIN;
709 * data->minx_change_entry = -1;
710 * data->maxx_change_entry = -1;
717 *else if (data->refreshing)
718 *D(bug("%lx|Refresh rejected %ld %ld %ld %ld %lx %lx\n",obj,data->DRAW,data->do_draw_all,data->do_draw,(LONG)data->refreshing,(LONG)(muiRenderInfo(obj)->mri_Flags & MUIMRI_REFRESHMODE),(LONG)(data->rp->Layer->Flags & LAYERREFRESH)));
721 if (muiAreaData(obj
)->mad_Flags
& MADF_DRAWOBJECT
)
722 data
->do_draw_all
= TRUE
;
724 if (NL_UpdateScrollers(data
,FALSE
))
730 data
->UpdateScrollersRedrawn
= TRUE
;
733 /* Avoid Superclass to draw anything *in* the object */
735 muiAreaData(obj
)->mad_Flags
&= ~0x00000001;
737 /* "AROS: FIXME: No frame drawn if doing: muiAreaData(obj)->mad_Flags &= ~0x00000001;" This is still valid 16.01.2012 */
739 DoSuperMethodA(cl
,obj
,(Msg
) msg
);
741 /*D(bug("%lx|Draw %lx %lx\n",obj,msg->flags,muiAreaData(obj)->mad_Flags));*/
745 APTR fullclippinghandle
= NULL
;
746 APTR clippinghandle
= NULL
;
747 WORD hmax
,linelen
,hfirst
;
748 LONG LPFirst
,LPVisible
,LPEntries
;
753 BOOL need_refresh
= FALSE
;
755 BOOL fullclipped
= FALSE
;
757 if (data
->do_draw_all
)
758 draw_all_force
= TRUE
;
760 draw_all_force
= FALSE
;
762 if (!(msg
->flags
& MADF_DRAWOBJECT
) && !(msg
->flags
& MADF_DRAWUPDATE
) && !data
->do_draw_all
)
763 { if (data
->DRAW
> 1)
769 * if (muiRenderInfo(obj)->mri_Flags & MUIMRI_REFRESHMODE)
770 * D(bug("MUIMRI_REFRESHMODE (do_draw_all=%ld)\n",data->do_draw_all));
775 if (data
->do_draw_all
)
777 /*data->do_draw_all = TRUE;*/
778 data
->do_draw_title
= TRUE
;
779 data
->drawall_bits
= 0;
780 data
->NList_First_Incr
= 0;
781 data
->minx_change_entry
= -1;
782 data
->maxx_change_entry
= -1;
784 else if ((data
->rp
->Layer
->Flags
& LAYERREFRESH
) || (msg
->flags
& MADF_DRAWOBJECT
))
786 data
->do_draw_all
= TRUE
;
787 data
->do_draw_title
= TRUE
;
788 data
->drawall_bits
= 0;
789 data
->minx_change_entry
= -1;
790 data
->maxx_change_entry
= -1;
793 if ((data
->NList_First_Incr
< 0) || (data
->NList_First_Incr
>= data
->vinc
))
794 data
->NList_First_Incr
= 0;
796 LPFirst
= data
->NList_First
* data
->vinc
;
797 LPVisible
= data
->lvisible
* data
->vinc
;
798 LPEntries
= data
->NList_Entries
* data
->vinc
;
799 if (LPFirst
+ LPVisible
> LPEntries
)
800 LPEntries
= LPFirst
+ LPVisible
;
802 if (LPEntries
!= data
->NList_Prop_Entries
)
803 data
->NList_Prop_Entries
= LPEntries
;
804 if (LPVisible
!= data
->NList_Prop_Visible
)
805 data
->NList_Prop_Visible
= LPVisible
;
806 if (data
->NList_First
!= data
->NList_Prop_First
/ data
->vinc
)
807 { data
->NList_Prop_First_Real
= LPFirst
;
808 data
->NList_Prop_First_Prec
= LPFirst
;
809 data
->NList_Prop_First
= LPFirst
;
812 if (data
->NList_Horiz_First
>= data
->NList_Horiz_Entries
)
813 data
->NList_Horiz_First
= data
->NList_Horiz_Entries
;
814 else if (data
->NList_Horiz_First
< 0)
815 data
->NList_Horiz_First
= 0;
816 hfirst
= data
->NList_Horiz_First
& ~1;
818 if (!data
->do_draw_all
)
819 { if (data
->markerase
&& (data
->markerasenum
>= 0))
820 { if (data
->markerasenum
< data
->first_change
)
821 data
->first_change
= data
->markerasenum
;
822 if (data
->markerasenum
> data
->last_change
)
823 data
->last_change
= data
->markerasenum
;
825 data
->last_change
+= 1;
826 if (data
->first_change
< data
->last_change
)
827 { if ((data
->NList_First
!= data
->NList_AffFirst
) ||
828 (data
->NList_First_Incr
!= data
->NList_AffFirst_Incr
) ||
829 (hfirst
!= data
->NList_Horiz_AffFirst
))
830 { data
->do_draw_all
= TRUE
;
831 data
->NList_First_Incr
= 0;
834 else if (((data
->NList_First
!= data
->NList_AffFirst
) ||
835 (data
->NList_First_Incr
!= data
->NList_AffFirst_Incr
)) &&
836 (hfirst
!= data
->NList_Horiz_AffFirst
))
837 { data
->do_draw_all
= TRUE
;
838 data
->NList_First_Incr
= 0;
839 data
->do_draw_title
= TRUE
;
841 else if ((data
->NList_First
!= data
->NList_AffFirst
) || (data
->NList_First_Incr
!= data
->NList_AffFirst_Incr
))
842 { if (data
->NList_Prop_Visible
< 180)
843 hmax
= (data
->NList_Visible
* 7 / 8);
844 else if (data
->NList_Prop_Visible
< 360)
845 hmax
= (data
->NList_Visible
* 6 / 8);
847 hmax
= (data
->NList_Visible
* 5 / 8);
848 if (abs(data
->NList_First
- data
->NList_AffFirst
) > hmax
)
849 { data
->do_draw_all
= TRUE
;
850 data
->NList_First_Incr
= 0;
853 else if (hfirst
!= data
->NList_Horiz_AffFirst
)
854 { if (data
->NList_Horiz_Visible
< 180)
855 hmax
= (data
->NList_Horiz_Visible
* 7 / 8);
856 else if (data
->NList_Horiz_Visible
< 360)
857 hmax
= (data
->NList_Horiz_Visible
* 6 / 8);
859 hmax
= (data
->NList_Horiz_Visible
* 5 / 8);
860 if (abs(hfirst
- data
->NList_Horiz_AffFirst
) > hmax
)
861 { data
->do_draw_all
= TRUE
;
862 data
->NList_First_Incr
= 0;
863 data
->do_draw_title
= TRUE
;
868 if (data
->do_draw_all
)
869 { data
->NList_First_Incr
= 0;
870 data
->first_change
= data
->NList_First
;
871 data
->last_change
= data
->NList_First
+ data
->NList_Visible
;
874 if (data
->NList_First_Incr
)
877 NL_UpdateScrollersValues(data
);
880 * if (data->first_change < data->last_change)
881 * D(bug("NL: mNL_Draw(%ld to %ld) \n",data->first_change,data->last_change));
882 * if (data->do_draw_all)
883 * D(bug("NL: mNL_Draw(do_draw_all) \n"));
884 * else if (data->do_draw_active)
885 * D(bug("NL: mNL_Draw(do_draw_active) \n"));
886 * else if (data->do_draw_title)
887 * D(bug("NL: mNL_Draw(do_draw_title) \n"));
888 * else if (data->NList_First != data->NList_AffFirst)
889 * D(bug("NL: mNL_Draw(NList_First) \n"));
890 * else if (hfirst != data->NList_Horiz_AffFirst)
891 * D(bug("NL: mNL_Draw(NList_Horiz_First) \n"));
893 * D(bug("NL: mNL_Draw(redraw???) \n"));
896 if (data
->NList_PartialChar
)
899 fullclippinghandle
= MUI_AddClipping(muiRenderInfo(obj
),(WORD
) data
->vleft
,(WORD
) data
->vtop
,
900 (WORD
) data
->vwidth
,(WORD
) data
->vheight
);
903 if ((data
->NList_Active
!= data
->NList_AffActive
) && !data
->NList_TypeSelect
)
905 data
->do_draw_active
= TRUE
;
907 if (!(msg
->flags
& MADF_DRAWOBJECT
))
909 LONG old_one_more
= 0;
910 BOOL clipped
= FALSE
;
912 if(data
->NList_AffFirst_Incr
)
915 ent
= data
->NList_AffActive
;
916 if((ent
>= data
->NList_AffFirst
) && (ent
< data
->NList_AffFirst
+ data
->NList_Visible
+ old_one_more
))
918 if ((data
->NList_AffFirst_Incr
) && ((ent
<= data
->NList_AffFirst
) || (ent
>= data
->NList_AffFirst
+ data
->NList_Visible
)))
921 clippinghandle
= MUI_AddClipping(muiRenderInfo(obj
),
925 (WORD
) (data
->NList_Visible
*data
->vinc
));
927 DrawOldLine(data
,ent
,PMIN
,PMAX
,hfirst
);
930 MUI_RemoveClipping(muiRenderInfo(obj
),clippinghandle
);
935 if (!data
->do_draw_all
&& data
->drawall_bits
)
937 LONG tmp_hfirst
= hfirst
;
938 LONG tmp_NList_First
= data
->NList_First
;
939 LONG tmp_NList_First_Incr
= data
->NList_First_Incr
;
941 hfirst
= data
->NList_Horiz_AffFirst
& ~1;
942 data
->NList_First
= data
->NList_AffFirst
;
943 data
->NList_First_Incr
= data
->NList_AffFirst_Incr
;
944 hmax
= DrawLines(data
,data
->NList_First
,data
->NList_First
+ data
->NList_Visible
,PMIN
,PMAX
,hfirst
,0,0,FALSE
,data
->drawall_bits
);
945 data
->drawall_bits
= 0;
946 data
->drawall_dobit
= 0;
948 data
->NList_First
= tmp_NList_First
;
949 data
->NList_First_Incr
= tmp_NList_First_Incr
;
951 data
->ScrollBarsTime
= SCROLLBARSTIME
;
952 if (hmax
> data
->NList_Horiz_Entries
)
953 data
->NList_Horiz_Entries
= hmax
;
957 * vfyl = (data->vtop - data->vpos) / data->vinc;
958 * vlyl = ((data->vbottom - data->vpos) / data->vinc) + 1;
961 if (data
->do_draw_all
&& data
->do_draw_title
&& data
->NList_Title
/* && (vfyl <= 0)*/)
963 data
->Title_PixLen
= DrawTitle(data
,PMIN
,PMAX
,hfirst
);
965 if(data
->Title_PixLen
> data
->NList_Horiz_Entries
)
966 data
->NList_Horiz_Entries
= data
->Title_PixLen
;
968 data
->do_draw_title
= FALSE
;
971 * if (data->first_change < data->last_change)
972 * { if (vfyl > data->first_change)
973 * data->first_change = vfyl;
974 * if (vlyl < data->last_change)
975 * data->last_change = vlyl;
978 if (data
->first_change
< data
->last_change
)
981 BOOL clipped
= FALSE
;
983 data
->drawall_bits
= 0;
984 if(data
->do_draw_all
)
986 SetBackGround(data
->NList_ListBackGround
)
988 if((data
->vdt
> 0) && !data
->NList_Title
)
989 DrawBackground(obj
, data
->mleft
, data
->vdtpos
, data
->mwidth
, data
->vdt
, data
->vdx
, data
->vdy
);
991 DrawBackground(obj
, data
->mleft
, data
->vdbpos
, data
->mwidth
, data
->vdb
, data
->vdx
, data
->vdy
);
993 if(!data
->dropping
&& !draw_all_force
&&
994 ((abs(data
->NList_First
- data
->NList_AffFirst
) > (120 / data
->vinc
)) ||
995 (abs(hfirst
- data
->NList_Horiz_AffFirst
) > 120)))
997 if (data
->drawall_dobit
== 1)
1000 data
->drawall_dobit
= 0;
1001 data
->drawall_bits
= 1;
1003 else if (data
->drawall_dobit
== 2)
1005 not_all
= data
->drawall_dobit
= 1;
1006 data
->drawall_bits
= 2;
1012 if (data
->first_change
< data
->NList_First
)
1013 data
->first_change
= data
->NList_First
;
1015 if (data
->last_change
>= data
->NList_First
+ data
->NList_Visible
+ one_more
)
1016 data
->last_change
= data
->NList_First
+ data
->NList_Visible
+ one_more
;
1019 if ((data
->NList_First_Incr
) && ((data
->first_change
<= data
->NList_First
) || (data
->last_change
>= data
->NList_First
+ data
->NList_Visible
)))
1022 clippinghandle
= MUI_AddClipping(muiRenderInfo(obj
),
1025 (WORD
) data
->mwidth
,
1026 (WORD
) (data
->NList_Visible
*data
->vinc
));
1029 hmax
= DrawLines(data
,data
->first_change
,data
->last_change
,PMIN
,PMAX
,hfirst
,0,0,FALSE
,not_all
);
1032 MUI_RemoveClipping(muiRenderInfo(obj
),clippinghandle
);
1034 if (data
->NList_Title
&& (data
->Title_PixLen
> hmax
))
1035 hmax
= data
->Title_PixLen
;
1036 if (hfirst
+ data
->hvisible
> hmax
)
1037 hmax
= hfirst
+ data
->hvisible
;
1038 if (data
->do_draw_all
)
1040 if ((data
->drawall_bits
) && (hmax
!= data
->NList_Horiz_Entries
))
1041 { data
->NList_Horiz_Entries
= hmax
;
1042 data
->ScrollBarsTime
= SCROLLBARSTIME
;
1044 else if (hmax
!= data
->NList_Horiz_Entries
)
1045 data
->NList_Horiz_Entries
= hmax
;
1047 if (data
->hvisible
!= data
->NList_Horiz_Visible
)
1048 data
->NList_Horiz_Visible
= data
->hvisible
;
1052 if (hmax
> data
->NList_Horiz_Entries
)
1053 data
->NList_Horiz_Entries
= hmax
;
1056 data
->NList_Horiz_AffFirst
= hfirst
;
1057 data
->NList_AffFirst
= data
->NList_First
;
1058 data
->NList_AffFirst_Incr
= data
->NList_First_Incr
;
1060 else if ((data
->NList_First
!= data
->NList_AffFirst
) || (data
->NList_First_Incr
!= data
->NList_AffFirst_Incr
))
1062 /*WORD dyl,fyl,lyl,dy,yl1,yl2,vpos;*/
1063 LONG dyl
,fyl
,lyl
,dy
,y1
,y2
,vpos
,vbot
;
1065 dyl
= data
->NList_First
- data
->NList_AffFirst
;
1066 dy
= dyl
*data
->vinc
+ (data
->NList_First_Incr
- data
->NList_AffFirst_Incr
);
1068 vbot
= data
->vpos
+ (data
->NList_Visible
* data
->vinc
) - 1;
1069 if (data
->vtop
> vpos
)
1072 y1
= (vpos
+ data
->NList_First_Incr
- data
->vpos
);
1073 fyl
= y1
/ data
->vinc
;
1077 y1
= data
->NList_First_Incr
;
1081 if (data
->vbottom
< vbot
)
1083 vbot
= data
->vbottom
;
1084 y2
= (vbot
+ data
->NList_First_Incr
- data
->vpos
);
1085 lyl
= y2
/ data
->vinc
;
1089 y2
= (vbot
+ data
->NList_First_Incr
- data
->vpos
);
1090 lyl
= y2
/ data
->vinc
;
1095 lyl
= (y1
- dy
) / data
->vinc
;
1099 fyl
= (y2
- dy
) / data
->vinc
;
1102 fyl
+= data
->NList_First
;
1103 lyl
+= data
->NList_First
;
1108 * if ((_window(obj)->Flags & WFLG_REFRESHBITS) == WFLG_SIMPLE_REFRESH)
1111 ScrollVert(data
,dy
,LPVisible
);
1112 need_refresh
= TRUE
;
1114 if (data
->NList_First_Incr
|| data
->NList_AffFirst_Incr
)
1121 clippinghandle
= MUI_AddClipping(muiRenderInfo(obj
),
1124 (WORD
) data
->mwidth
,
1130 clippinghandle
= MUI_AddClipping(muiRenderInfo(obj
),
1132 (WORD
) vbot
+ 1 - dy2
,
1133 (WORD
) data
->mwidth
,
1136 DrawLines(data
,fyl
,lyl
,PMIN
,PMAX
,hfirst
,0,2,TRUE
,0);
1137 MUI_RemoveClipping(muiRenderInfo(obj
),clippinghandle
);
1140 DrawLines(data
,fyl
,lyl
,PMIN
,PMAX
,hfirst
,0,2,FALSE
,0);
1143 ent2
= data
->NList_First
+ data
->NList_Visible
;
1144 if (ent2
> data
->NList_Entries
)
1145 ent2
= data
->NList_Entries
;
1146 ent
= data
->NList_First
;
1149 linelen
= data
->EntriesArray
[ent
]->PixLen
;
1154 if (data
->NList_Title
&& (data
->Title_PixLen
> hmax
))
1155 hmax
= data
->Title_PixLen
;
1156 if (hfirst
+ data
->hvisible
> hmax
)
1157 hmax
= hfirst
+ data
->hvisible
;
1158 if (hmax
!= data
->NList_Horiz_Entries
)
1159 data
->NList_Horiz_Entries
= hmax
;
1160 if (data
->hvisible
!= data
->NList_Horiz_Visible
)
1161 data
->NList_Horiz_Visible
= data
->hvisible
;
1162 data
->NList_AffFirst
= data
->NList_First
;
1163 data
->NList_AffFirst_Incr
= data
->NList_First_Incr
;
1166 else if (hfirst
!= data
->NList_Horiz_AffFirst
)
1170 BOOL clipped
= FALSE
;
1172 dx
= hfirst
- data
->NList_Horiz_AffFirst
;
1177 if (lx
> data
->vright
+ 1) lx
= data
->vright
+ 1;
1181 lx
= data
->vright
+ 1;
1183 if (fx
< data
->vleft
) fx
= data
->vleft
;
1186 fyl
= data
->NList_First
;
1187 lyl
= data
->NList_First
+data
->NList_Visible
+one_more
;
1193 * if ((fyl < lyl) || ((data->vdtitlepos < data->vbottom) && ((data->vdtitlepos + data->vdtitleheight) > data->vtop)))
1197 * if ((_window(obj)->Flags & WFLG_REFRESHBITS) == WFLG_SIMPLE_REFRESH)
1200 ScrollHoriz(data
,dx
,LPVisible
);
1201 need_refresh
= TRUE
;
1203 if (data
->NList_Title
)
1204 data
->Title_PixLen
= DrawTitle(data
,fx
,lx
,hfirst
);
1208 if (data
->NList_First_Incr
)
1211 clippinghandle
= MUI_AddClipping(muiRenderInfo(obj
),
1214 (WORD
) data
->mwidth
,
1215 (WORD
) (data
->NList_Visible
*data
->vinc
));
1218 hmax
= DrawLines(data
,fyl
,lyl
,fx
,lx
,hfirst
,0,1,FALSE
,0);
1221 MUI_RemoveClipping(muiRenderInfo(obj
),clippinghandle
);
1223 if (data
->NList_Title
&& (data
->Title_PixLen
> hmax
))
1224 hmax
= data
->Title_PixLen
;
1225 if (hfirst
+ data
->hvisible
> hmax
)
1226 hmax
= hfirst
+ data
->hvisible
;
1227 if (hmax
!= data
->NList_Horiz_Entries
)
1228 data
->NList_Horiz_Entries
= hmax
;
1229 if (data
->hvisible
!= data
->NList_Horiz_Visible
)
1230 data
->NList_Horiz_Visible
= data
->hvisible
;
1231 data
->NList_Horiz_AffFirst
= hfirst
;
1236 if (!data
->NList_TypeSelect
&& data
->do_draw_active
)
1238 BOOL clipped
= FALSE
;
1240 ent
= data
->NList_Active
;
1241 if ((ent
>= data
->NList_First
) && (ent
< data
->NList_First
+ data
->NList_Visible
+ one_more
)/* && (vfyl <= ent) && (ent <= vlyl)*/)
1243 if ((data
->NList_First_Incr
) && ((ent
<= data
->NList_First
) || (ent
>= data
->NList_First
+ data
->NList_Visible
)))
1246 clippinghandle
= MUI_AddClipping(muiRenderInfo(obj
),
1249 (WORD
) data
->mwidth
,
1250 (WORD
) (data
->NList_Visible
*data
->vinc
));
1253 DrawLines(data
,ent
,ent
+1,PMIN
,PMAX
,hfirst
,0,0,FALSE
,0);
1256 MUI_RemoveClipping(muiRenderInfo(obj
),clippinghandle
);
1259 if (data
->do_draw_title
&& data
->NList_Title
/* && (vfyl <= 0)*/)
1261 data
->Title_PixLen
= DrawTitle(data
,PMIN
,PMAX
,hfirst
);
1262 if (data
->Title_PixLen
> data
->NList_Horiz_Entries
)
1263 data
->NList_Horiz_Entries
= data
->Title_PixLen
;
1268 MUI_RemoveClipping(muiRenderInfo(obj
),fullclippinghandle
);
1269 fullclipped
= FALSE
;
1276 data
->markerasenum
= -1;
1277 if ((data
->markdrawnum
>= data
->NList_First
) && (data
->markdrawnum
< data
->NList_First
+ data
->NList_Visible
))
1279 mdy
= data
->vpos
+ (data
->vinc
* (data
->markdrawnum
- data
->NList_First
));
1280 DoMethod(obj
,MUIM_NList_DropDraw
, data
->markdrawnum
,data
->marktype
,
1281 data
->mleft
,data
->mright
,mdy
,mdy
+data
->vinc
-1);
1282 data
->markerasenum
= data
->markdrawnum
;
1285 data
->markdraw
= FALSE
;
1286 data
->markerase
= FALSE
;
1288 data
->NList_AffFirst
= data
->NList_First
;
1289 data
->NList_AffFirst_Incr
= data
->NList_First_Incr
;
1290 data
->NList_AffActive
= data
->NList_Active
;
1292 if (!data
->refreshing
&& need_refresh
&& (data
->rp
->Layer
->Flags
& LAYERREFRESH
))
1294 SetBackGround(data
->NList_ListBackGround
);
1295 if (MUI_BeginRefresh(muiRenderInfo(obj
),0))
1297 Object
*o
= (Object
*)xget(_win(obj
), MUIA_Window_RootObject
);
1301 data
->refreshing
= TRUE
;
1302 MUI_Redraw(o
,MADF_DRAWOBJECT
); /* MADF_DRAWALL */
1303 data
->refreshing
= FALSE
;
1304 MUI_EndRefresh(muiRenderInfo(obj
),0);
1308 DrawAdjustBar(data
,0);
1309 DrawAdjustBar(data
,1);
1311 SetBackGround(data
->NList_ListBackGround
);
1313 data
->do_draw
= FALSE
;
1314 data
->do_draw_all
= FALSE
;
1315 data
->do_draw_active
= FALSE
;
1316 data
->do_draw_title
= FALSE
;
1317 data
->first_change
= LONG_MAX
;
1318 data
->last_change
= LONG_MIN
;
1319 data
->minx_change_entry
= -1;
1320 data
->maxx_change_entry
= -1;
1322 NL_UpdateScrollersValues(data
);
1323 /*do_notifies(NTF_First|NTF_Entries|NTF_MinMax);*/
1325 if (data
->drawall_dobit
!= 1)
1326 data
->drawall_dobit
= 0;
1333 /*if (msg->flags & MADF_DRAWOBJECT) D(bug("NL: mNL_Draw(MADF_DRAWOBJECT) /after \n"));*/
1340 IPTR
mNL_DropDraw(struct IClass
*cl
,Object
*obj
,struct MUIP_NList_DropDraw
*msg
)
1342 struct NLData
*data
= INST_DATA(cl
,obj
);
1344 SetABPenDrMd(data
->rp
,data
->pens
[MPEN_SHINE
],data
->pens
[MPEN_SHADOW
],JAM2
);
1345 SetDrPt(data
->rp
,0xF0F0);
1346 if ((msg
->type
& MUIV_NList_DropType_Mask
) == MUIV_NList_DropType_Above
)
1347 { Move(data
->rp
, msg
->minx
, msg
->miny
);
1348 Draw(data
->rp
, msg
->maxx
, msg
->miny
);
1350 else if ((msg
->type
& MUIV_NList_DropType_Mask
) == MUIV_NList_DropType_Below
)
1351 { Move(data
->rp
, msg
->minx
, msg
->maxy
);
1352 Draw(data
->rp
, msg
->maxx
, msg
->maxy
);
1354 else if ((msg
->type
& MUIV_NList_DropType_Mask
) == MUIV_NList_DropType_Onto
)
1355 { Move(data
->rp
, msg
->minx
, msg
->miny
);
1356 Draw(data
->rp
, msg
->maxx
, msg
->miny
);
1357 Move(data
->rp
, msg
->minx
, msg
->maxy
);
1358 Draw(data
->rp
, msg
->maxx
, msg
->maxy
);
1359 Move(data
->rp
, msg
->minx
, msg
->miny
);
1360 Draw(data
->rp
, msg
->minx
, msg
->maxy
);
1361 Move(data
->rp
, msg
->maxx
, msg
->miny
);
1362 Draw(data
->rp
, msg
->maxx
, msg
->maxy
);
1364 SetDrPt(data
->rp
,(UWORD
)~0);
1365 SetABPenDrMd(data
->rp
,data
->pens
[MPEN_TEXT
],data
->pens
[MPEN_BACKGROUND
],JAM1
);