Re: [PATCH]: copy/move/delete progress title



On Fri, 30 Aug 2002 04:07:32 -0400 (EDT)
 Pavel Roskin <proski gnu org> wrote:

> I recently spent a few hours (if not days) removing code like the one in
> your patch.  By the way, one of your patches that you send me in private
> didn't work well until this cleanup was done.
> 
> If you have more than one place when the title is drawn, you are going to
> have problems down the road.  You cannot change spacing in a uniform way
> (at least by a patch three lines long).  You cannot change the color of
> all titles without actually changing color in more than one place.  In
> fact, the color you are using is already different from all other dialogs!

  Yes, the color is differ, because imho the main function of
this window is just show the status of process. This window is
not regular dialog.

> If there is a reason why you cannot reuse the standard code that draws the
> frames and the titles, please explain.  I'd rather see a bigger
> improvement in the generic code (like introduction of DLG_COMPACT) if it's
> needed, than a little change that breaks consistency and maintainability
> of the code.

  Is the Óommon_dialog_repaint() function a statndard code?
As an example I used the DLG_DRAW message handlers in
display_callback() and dbits_refresh()/dbits_callback()
functions.

  Unfortunately, there is no single function, that draws
the title, like such:

void dlg_draw_title(Dlg_head *h, const char *title)
{
 char *t = title ? title : h->title;

 if (t)
   {
    attrset( COLOR_HOT_NORMAL );
    dlg_move( h, 1, (h->cols - strlen(t))/2 );
    addstr( t );
   }
}

  Regards,
  Andrew Borodin.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]