Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Skin Framework
  New Posts New Posts RSS Feed - Office 2007 skin + SIF_DISABLENOSCROLL
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Office 2007 skin + SIF_DISABLENOSCROLL

 Post Reply Post Reply
Author
Message
Ark42 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 20 October 2003
Status: Offline
Points: 291
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ark42 Quote  Post ReplyReply Direct Link To This Post Topic: Office 2007 skin + SIF_DISABLENOSCROLL
    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?

Back to Top
Ark42 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 20 October 2003
Status: Offline
Points: 291
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ark42 Quote  Post ReplyReply Direct Link To This Post 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.

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Ark42 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 20 October 2003
Status: Offline
Points: 291
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ark42 Quote  Post ReplyReply Direct Link To This Post 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?
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Ark42 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 20 October 2003
Status: Offline
Points: 291
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ark42 Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.188 seconds.