Gerard
That's exactly what I do. I specify a maximum number of rows in Constructor
(e.g. 20 or whatever), then I calculate the height of the form and figure
out what space I have for the table. I then divide this number by the row
height to get the number of rows. It's then a simple matter of iterating
through the rows enabling the correct ones and setting the row height
appropriately.
Phil
e.g.
void DailyScheduleChangeTableHeight(FormType *frmP, RectangleType
*displayBounds) {
int availableSpace, availableRows, newHeight, newWidth;
availableSpace = displayBounds->extent.y -
DAILY_SCHEDULE_OTHER_CONTROL_SPACE;
if (availableSpace < 40) return;
availableRows = availableSpace / DAILY_SCHEDULE_ROW_HEIGHT;
newHeight = availableRows * DAILY_SCHEDULE_ROW_HEIGHT;
newWidth = displayBounds->extent.x - 12;
ResizeControlTo(frmP, DailyScheduleTasksTable, newWidth, newHeight);
SetControlHeightTo(frmP, DailyScheduleTasksScrollBar, newHeight);
DAILY_SCHEDULE_TABLE_ROWS = availableRows;
}
and then
// set number of rows - this is now dynamic due to DIAs
for (i = 0; i < MAX_DAILY_SCHEDULE_TABLE_ROWS; i++) {
if (i < DAILY_SCHEDULE_TABLE_ROWS ) {
TblSetRowUsable(table, i, true);
TblSetRowHeight(table, i, DAILY_SCHEDULE_ROW_HEIGHT);
} else {
TblSetRowUsable(table, i, false);
}
}
"Gerard Beneteau" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Phil,
>
> What is the best way to implement rezising table with the DIA.
> Do you create the tables with the maximum number of rows and at run time
> enable the suitable number of row according to the actual size ???
> Any snippet ??
>
> There was nothing specific about tables in the Recipe: Using PalmOS PinMgr
> and cross platform Dynamic Input Area support
>
> Thanks
> G�rard
>
> "Phil Hartley" <[EMAIL PROTECTED]> a �crit dans le message
de
> news:[EMAIL PROTECTED]
> > Since I found this to be a pain in the neck, I'd at least like to let
> other
> > know how it was done. The code sometimes referes to the "Applications
and
> > Dynamic Input Areas" documentation as the "DIA doc". This documentation
> is
> > provided with the Palm OS 5 SDK.
> >
>
> > Hope this helps anyone else trying to do the same thing. If anyone
knows
> of
> > anthing I've missed or messed up, please let me know.
> >
> > Phil
> >
> >
> >
>
>
>
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/