Print Page | Close Window

Office 2007 skin + SIF_DISABLENOSCROLL

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Skin Framework
Forum Description: Topics Related to Codejock Skin Framework
URL: http://forum.codejock.com/forum_posts.asp?TID=9031
Printed Date: 24 September 2024 at 8:35pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Office 2007 skin + SIF_DISABLENOSCROLL
Posted By: Ark42
Subject: Office 2007 skin + SIF_DISABLENOSCROLL
Date 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?




Replies:
Posted By: Ark42
Date Posted: 07 December 2007 at 12:34pm
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.



Posted By: Oleg
Date Posted: 08 December 2007 at 2:55am
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


Posted By: Ark42
Date Posted: 08 December 2007 at 11:30am
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?


Posted By: Oleg
Date Posted: 08 December 2007 at 2:16pm
You are right about NC handling of resize box.
 
Please add in CXTPSkinObjectFrame::HandleNcHitTest method this code:
 
 DWORD dwStyle = GetStyle();
 
 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


Posted By: Ark42
Date Posted: 09 December 2007 at 12:15am
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.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net