Office 2007 skin + SIF_DISABLENOSCROLL |
Post Reply |
Author | |
Ark42
Senior Member Joined: 20 October 2003 Status: Offline Points: 291 |
Post Options
Thanks(0)
Posted: 07 December 2007 at 2:09am |
I have a CView derived view with EnableScrollBar(SB_HORZ); in OnInitialUpdate() and it gains WS_HSCROLL in PreCreateWindow(). It exists in a docking pane and is created by it's own CFrameWnd class. If I call: SCROLLINFO si; si.cbSize = sizeof(SCROLLINFO); si.fMask = SIF_POS|SIF_PAGE|SIF_RANGE|SIF_DISABLENOSCROLL; si.nPage = 0; si.nMin = 0; si.nMax = 0; si.nPos = 0; SetScrollInfo(SB_HORZ, &si); The scrollbar is still enabled but the thumb is not really movable. When using Office 2003/XP/2000/etc styles instead of the skin framework, the scrollbar is disabled like it should be. Bug in the skin framework? |
|
Ark42
Senior Member Joined: 20 October 2003 Status: Offline Points: 291 |
Post Options
Thanks(0)
|
To add to this problem, why is it that with Office 2007 skin, the scrollbar's background is drawn differently for the same CView depending on if it is in a docking pane or regular CMDIChildWnd frame.
And also, the drag area in the lower right corner of the window is not clickable or dragable and does not even give the upper-left to lower-right arrows mouse cursor when you hover over it. If I go back to regular skin and Office 2003 command bars, the scrollbars are both drawn the same, and the drag area in the corner works exactly as expected. |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
There is no API to determine if SIF_DISABLENOSCROLL was set.
Use this code to disable scrollbars for both System and SkinFramework:
SCROLLINFO si;
si.cbSize = sizeof(SCROLLINFO); si.fMask = SIF_POS|SIF_PAGE|SIF_RANGE|SIF_DISABLENOSCROLL; si.nPage = 1; si.nMin = 0; si.nMax = 0; si.nPos = 0; SetScrollInfo(SB_HORZ, &si); |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
Ark42
Senior Member Joined: 20 October 2003 Status: Offline Points: 291 |
Post Options
Thanks(0)
|
Ok thanks, that work-around lets me disable the scrollbar, I have to adjust a bunch of spots to have a special case to set page to 1 instead, but that works now.
What about the resize corner area in mdi child windows? |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
You are right about NC handling of resize box.
Please add in CXTPSkinObjectFrame::HandleNcHitTest method this code:
if ((dwStyle & WS_VSCROLL) && m_spi[SB_VERT].fVisible && (dwStyle & WS_HSCROLL) && m_spi[SB_HORZ].fVisible && IsSizeBox())
{ CRect rcSizeGripper(m_spi[SB_HORZ].rc.right, m_spi[SB_VERT].rc.bottom, m_spi[SB_VERT].rc.right, m_spi[SB_HORZ].rc.bottom); if (rcSizeGripper.PtInRect(point)) return GetExStyle() & WS_EX_LAYOUTRTL ? HTBOTTOMLEFT : HTBOTTOMRIGHT; } |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
Ark42
Senior Member Joined: 20 October 2003 Status: Offline Points: 291 |
Post Options
Thanks(0)
|
I added that right after ScreenToFrame(&point);
It works, but there is a slight graphical glitch, in that if you hover over a scrollbar and then move the mouse to the resize box, the scrollbar still is drawn as if it is hovered over. You can then move the mouse over top the other scrollbar and get both scrollbars drawn as if they are being hovered over. |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |