Set Table Column Widths

This utility provides a dialog with buttons that allow you to very quickly set column widths for tables displayed in your module. Simply select any cell in the column yuo wish to modify and then click on one of the predefined width buttons in the dialog.


//  Set Table Column Widths

/*
 Tony Goodman
*/

/******************************************************************************
 doApply
******************************************************************************/
void doSetWidth(int w)
{
 if (null current Module) return
 
 Object cellObject = current Object
 
 if (null cellObject || !cell(cellObject)) return
 
 setColumnWidth(cellObject, w)
 
 refresh(current Module)
}

/******************************************************************************
 doApply
******************************************************************************/
void doSetWidth50(DBE dbe)
{
 doSetWidth(50)
}

void doSetWidth100(DBE dbe)
{
 doSetWidth(100)
}

void doSetWidth150(DBE dbe)
{
 doSetWidth(150)
}

void doSetWidth200(DBE dbe)
{
 doSetWidth(200)
}

void doSetWidth250(DBE dbe)
{
 doSetWidth(250)
}

void doSetWidth300(DBE dbe)
{
 doSetWidth(300)
}

void doSetWidth400(DBE dbe)
{
 doSetWidth(400)
}

void doSetWidth500(DBE dbe)
{
 doSetWidth(500)
}

DB dbMain = create(dbExplorer, "Set Column Width", styleFloating)

button(dbMain, "Set Column Width = 50", doSetWidth50)
button(dbMain, "Set Column Width = 100", doSetWidth100)
button(dbMain, "Set Column Width = 150", doSetWidth150)
button(dbMain, "Set Column Width = 200", doSetWidth200)
button(dbMain, "Set Column Width = 250", doSetWidth250)
button(dbMain, "Set Column Width = 300", doSetWidth300)
button(dbMain, "Set Column Width = 400", doSetWidth400)
button(dbMain, "Set Column Width = 500", doSetWidth500)

realize(dbMain)

show(dbMain)