Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » Two column tree problem in 2.84 Collapse All
Subject Author Date
Offer Har Jan 27, 2009 - 2:22 PM

Dear Support,


I am trying to create a tree with two columns, and I want the left column to occupy 40% and the right column to occupy 60%.


This is how I initialized it:



    	SiwModifyStyle(
		(__ESIS_STH_NONE|__ESIS_STV_ITEM)		// Item scroll window styles
		| __EGBS_SFB_FULL_ROWS				// Selection/focus type - full rows
		| __EGBS_DYNAMIC_RESIZING			// Resize rows/columns on-the-fly
		| __EGBS_RESIZING_CELLS_OUTER			// enable row/column resizing
		,0, false);

	SiwModifyStyleEx(
		__EGBS_EX_CELL_TOOLTIPS_INNER
		| __EGBS_EX_CELL_EXPANDING_INNER
		| __EGWS_EX_PM_COLORS
		| __EGBS_EX_CORNER_AREAS_3D
		| __EGBS_EX_CORNER_AREAS_CURVE
		| __EGBS_EX_HVI_EVENT_CELLS
		,0, false);
    BseModifyStyleEx( __EGBS_BSE_EX_PROPORTIONAL_COLUMN_WIDTHS);

    OuterRowCountTopSet(1, false);
    OuterRowHeightSet(true, 0, 0);
    ColumnAdd(2, false);
    CExtGridCellHeader* pCellHdr = (CExtGridCellHeader*)GridCellGetOuterAtTop(0, 0, RUNTIME_CLASS(CExtGridCellHeader));
    pCellHdr->ExtentPercentSet(0.4);

    pCellHdr = (CExtGridCellHeader*)GridCellGetOuterAtTop(1, 0, RUNTIME_CLASS(CExtGridCellHeader));
    pCellHdr->ExtentPercentSet(0.6);

But it does not work - the left column for some strange reason is wider then the right column, and its size if fixed up to a certain point and then two both become wider.


What is wrong?


Thanks,


Ron.

Technical Support Jan 28, 2009 - 11:45 AM

The CExtGridCell::ExtentPercentSet() assigns proportional coefficients to grid cells. When the grid control will be resized and become 100 pixels wider, then 60 pixels will be added to one column and 40 pixels to other because you have assigned 0.6 and 0.4. The same computations will be applied when the grid window will be resized and become less wide. But initially both grid columns have the same size in pixels. So, you should assign small size in pixels to both columns using the CExtGridCell::ExtentSet() method.

Offer Har Jan 29, 2009 - 7:46 PM

Thanks! that was exactly the problem.