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

Re: 19990205: Model level widget



On Fri, 5 Feb 1999, Steve Chiswell wrote:

> 
> Steve, Dave, Jim et al,
> 
> There is a bug in Garp gui/sgribcb.c routine
> which causes the pop-up level widget to  not
> display all the model levels correctly.
> 
> The current configuration seems to be hardcoded to a 4x4
> grid of buttons (XmNfraction is set to 4). The
> Number of rows is hardcoded to 5 in the num_columns calculation.
> Many models, ETA, RUC, AVN etc have greater than 16 levels
> (eg RUC2 has 37 pressure levels)- only 16 are displayed.
> 
> The XmNfraction seems to require a MxM array of buttons,
> so I changed the columns calculation:
> /*
>  *      Create rowcolumn for level buttons.
>  */
>         /*columns = ( num_levels + 4 ) / 5;*/
>         columns = (int)sqrt(num_levels);      /* math.h included from 
> winobj.h */
>         if((num_levels % columns) > 0) columns++;
> 
> modified the level_rowcol = XtVaCreateManagedWidget() function to
> pass "columns" rather than 4 hardcoded,
> 
> and changed the i/j iteration to:
> for ( k=0; k<num_levels; k++, bo++ ) {
>                 j = k/columns;
>                 i = k - (j * columns);
> 
> I've attatched the $GARPHOME/gui/sgridcb.c routine as modified.
> Layer buttons should probably follow same line.

 Ah, yes! I'm glad you figured this bug out, Steve. I'd looked at this
problem before but didn't notice the constraint on the number of rows. 
I'll add your bug fix to our copy of the code.