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 General Discussion » CExtGridWnd vertical scroll bar (making is visible all time or setting autohide to true) Collapse All
Subject Author Date
Alex Shugai Sep 20, 2006 - 5:33 PM

I have __ESIS_STH_ITEM vertical scroll mode in CExtGridWnd grid. It works fine except vertical scroll bar appears/disappears automatically depending on the number of rows. I need it to stay permanently (just enabled when too many rows to fit or disabled if all rows are visible). I tried various calls like SiwModifyStyle(__ESIS_DISABLE_AUTOHIDE_SB_V); and/or SiwAutohideScrollBarSet(false/*horz*/, false/*autohide*/); still the scrollbar diappears. What do I need to do? Also how can I change the background color of the grid outside the cells area. Thanks!

Technical Support Sep 21, 2006 - 6:31 AM

Please create the grid window with the WS_VSCROLL standard window to let it have vertical scroll bar initially and then apply the __ESIS_DISABLE_AUTO_HIDE_SB_V style with the SiwModifyStyle() method.

Alex Shugai Sep 21, 2006 - 4:10 PM

That’s how it is created in the resources:
CONTROL "",IDC_LIST13,"ProfUIS-ScrollItemWindow",WS_TABSTOP|WS_VSCROLL,116,153,83,60

Then in OnInitDialog I do:
CExtGridWnd m_List13;
m_List13.SubclassDlgItem(IDC_LIST13, this);

then I set properties:

    const bool bFullRowMode = true; // to make copy of code easier
    const bool bFullHighlighting = false;
    m_List13.SiwModifyStyle(
        (bFullRowMode ? __ESIS_STH_PIXEL : __ESIS_STH_ITEM)
        |__ESIS_STV_ITEM
        | (bFullRowMode ? __EGBS_SFM_FULL_ROWS : __EGBS_SFM_CELLS_HV)
        |__EGBS_RESIZING_CELLS_OUTER|__EGBS_DYNAMIC_RESIZING
        |__EGBS_MULTI_AREA_SELECTION|__EGBS_NO_HIDE_SELECTION
        | __EGBS_LBEXT_SELECTION,
        0 , false);
    m_List13.SiwModifyStyleEx(__EGBS_EX_CELL_TOOLTIPS_OUTER|__EGBS_EX_CELL_EXPANDING_INNER|__EGBS_EX_HVI_EVENT_CELLS|__EGBS_EX_HVO_EVENT_CELLS,0, false);
    m_List13.BseModifyStyle(
        __EGWS_BSE_SORT_COLUMNS
        |    (( bFullRowMode && bFullHighlighting )
        ? (    __EGWS_BSE_BUTTONS_IN_FOCUSED_CELL
        |    __EGWS_BSE_BUTTONS_IN_FOCUSED_ROW
        |    __EGWS_BSE_BUTTONS_IN_HOVERED_CELL
        |    __EGWS_BSE_BUTTONS_IN_HOVERED_ROW
        |    __EGWS_BSE_BUTTONS_IN_SELECTED_CELLS
        |    __EGWS_BSE_BUTTONS_IN_SELECTED_ROW
        )
        : 0 )
        ,
        __EGWS_BSE_DEFAULT,
        false
        );
    m_List13.SiwModifyStyle(__ESIS_DISABLE_AUTOHIDE_SB_V);
    m_List13.SiwScrollTypeHSet(__ESIW_ST_NONE);

and scroll bar autohiding doesn’t work!

Please let me know why __ESIS_DISABLE_AUTOHIDE_SB_V doesn’t work as it should

Technical Support Sep 22, 2006 - 10:12 AM

We cannot agree with you that the __ESIS_DISABLE_AUTOHIDE_SB_V style doesn’t work. Here is a sample project that shows an empty grid window with scroll bars that are always visible. Here is the code that makes them always visible:

m_wndGrid.SiwModifyStyle( __ESIS_DISABLE_AUTOHIDE_SB_V );
m_wndGrid.SiwModifyStyle( __ESIS_DISABLE_AUTOHIDE_SB_H );
m_wndGrid.ModifyStyle( 0, WS_VSCROLL|WS_HSCROLL, SWP_FRAMECHANGED );