home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / amiga / programm / 18412 < prev    next >
Encoding:
Internet Message Format  |  1993-01-09  |  5.1 KB

  1. Path: sparky!uunet!mcsun!news.funet.fi!funic!sauna.cs.hut.fi!news.cs.hut.fi!s37732v
  2. From: s37732v@snakemail.hut.fi (Markus Juhani Aalto)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: Regions and BOOPSI gadgets?
  5. Date: 09 Jan 93 09:50:23 GMT
  6. Organization: Helsinki University of Technology, Finland
  7. Lines: 110
  8. Distribution: comp
  9. Message-ID: <S37732V.93Jan9115023@lk-hp-7.hut.fi>
  10. References: <S37732V.93Jan8183438@lk-hp-20.hut.fi> <1993Jan08.231045.25479@watson.ibm.com>
  11. NNTP-Posting-Host: lk-hp-7.hut.fi
  12. In-reply-to: dkeller@rain.fishkill.ibm.com's message of Fri, 08 Jan 93 23:10:45 GMT
  13.  
  14. In article <1993Jan08.231045.25479@watson.ibm.com> dkeller@rain.fishkill.ibm.com (Douglas Keller) writes:
  15.  
  16.    In article <S37732V.93Jan8183438@lk-hp-20.hut.fi> s37732v@snakemail.hut.fi (Markus Juhani Aalto) writes:
  17.    >to the rastport. I currently InstallClipRegion when I get GM_RENDER
  18.    >message and do my rendering after that. This works fine when I open
  19.    >the gadgets but after I size the window all clipping goes absolutely
  20.    >out of control. So is there a possible way to use Regions in BOOPSI
  21.    >gadgets? 
  22.  
  23.    I think Intuition removes all layers regions during a resize.
  24.  
  25.    doug
  26.  
  27. Hmm. I didn't know that, but it shouldn't make any difference.
  28.  
  29. I'll describe little better the problem.
  30.  
  31. ------------------
  32.  I open the window.
  33.  Create the gadgtools and boopsi gadget and install them to window.
  34.  I refresh gadgets.
  35.  
  36.  So far everything is OK, All gadgets come up nicely and I can even use my
  37.  BOOPSI listview gadget and it works OK.
  38.  
  39.  Then I size window and after I release sizing gadget only parts of the
  40.  display is drawed properly and old stuff is leaving behind even if I
  41.  called RectFill to fill the whole window interior with background color.
  42.  This worked find before I started using regions in my boopsi gadgets.
  43.  
  44. -----------------
  45.  
  46. Here is a part of my BOOPSI listview gadget routine.
  47.  
  48. -----------------
  49.         case GM_RENDER:
  50.             lvw = (struct ListViewClass *)INST_DATA( cl, o);
  51.             {
  52.                 struct gpRender *gpr = (struct gpRender *)msg;
  53.                 ULONG Count = lvw->ItemToRender;
  54.                 REND_FUNC func = lvw->ItemRenderer;
  55.                 struct Node *node = lvw->topNode;
  56.  
  57.                 if(gpr->gpr_Redraw == GREDRAW_UPDATE) {
  58.             /* Here I install clip region for my window.
  59.                        I have allocated it properly in the OM_NEW
  60.                code.
  61.             */
  62.                     InstallListViewClipRegion((struct Gadget *)o,
  63.                             gpr->gpr_GInfo,lvw);
  64.                     if(Count == 0) {
  65.                         while(Count < lvw->Visible) {
  66.                             RetVal = (*func)(node, (struct Gadget *)o,
  67.                                     gpr,Count,lvw->RenderString);
  68.                             if(node) {
  69.                                 node = NextNode(node);
  70.                                 if( IsLastNode(node) ) {
  71.                                     node = NULL;
  72.                                 }
  73.                             }
  74.                             Count += 1;
  75.                         }
  76.                     }
  77.                     else {
  78.                         node = GetTopNode(lvw->listToShow,lvw->TopVal+Count-1);
  79.                         RetVal = (*func)(node, (struct Gadget *)o,
  80.                                 gpr,Count-1,lvw->RenderString);
  81.                     }
  82.             /* Here I delete clip region if it was installed. */ 
  83.                    DeleteListViewClipRegion(gpr->gpr_GInfo,lvw);
  84.                 }
  85.                 else {
  86.                     DrawImageState( gpr->gpr_RPort,
  87.                             lvw->FrameImage,
  88.                             0, 0, IDS_NORMAL,
  89.                             gpr->gpr_GInfo->gi_DrInfo );
  90.  
  91.                     InstallListViewClipRegion((struct Gadget *)o,
  92.                             gpr->gpr_GInfo,lvw);
  93.                     Count = 0;
  94.                     while(Count < lvw->Visible) {
  95.                         RetVal = (*func)(node, (struct Gadget *)o,
  96.                                 gpr,Count,lvw->RenderString);
  97.                         if(node) {
  98.                             node = NextNode(node);
  99.                             if( IsLastNode(node) ) {
  100.                                 node = NULL;
  101.                             }
  102.                         }
  103.                         Count++;
  104.                     }
  105.                     DeleteListViewClipRegion(gpr->gpr_GInfo,lvw);
  106.                 }
  107.             }
  108.             break;
  109. -------------------------------
  110.  
  111. I hope someone can help me with this one. The function I'm calling
  112. in code is a rendering function for the listview.
  113. --
  114.  
  115.  
  116. **************************************************************************
  117. *         Markus Aalto              | Helsinki University of Technology  *
  118. *                                   |                                    *
  119. *  EMail: s37732v@vipunen.hut.fi    | Faculty of Electric Engineering    *
  120. *  Fax:   358-0-8746991 (Sometimes) |                                    *
  121. *                                   | Undergraduate in Computer Science  *
  122. **************************************************************************
  123.         
  124.