1,105,416 Community Members

CSplitter splitter definition

Member Avatar
greatman05
Light Poster
27 posts since Mar 2012
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

This is a homework assignment.

I am in a Software Engineering class and we have to implement a change request in a group project. My group chose Winmerge, and my change request is to do the following:

1.) Set the divider to reset to the middle on double-click.

2.) Allow the user to snap the divider to certain increments (10% of width) with (keyboard button)+click.

I don't understand how CSplitter works. Is there a definition of the splitter that I can work with? The application already has double click accelerators defined for the diff tool, so I'm not sure how I can implement my change request without conflicting with this definiton. I tried adding a new message to the CSplitter class and modifying the divider that way, but the application doesn't respond to my double click on the divider.

void CSplitterWndEx::OnMButtonDblClk(UINT nFlags, CPoint point)
{

    CSplitterWnd::OnMButtonDblClk(nFlags, point);
    // TODO: Add your message handler code here and/or call default
    CRect rect;
    CSplitterWnd::GetClientRect(&rect);
    SetColumnInfo(0,rect.Width()/2,rect.Width()/2);
    RecalcLayout();

}

What can I do? Any hints or tips?

Member Avatar
Ancient Dragon
Achieved Level 70
27,645 posts since Aug 2005
Reputation Points: 5,232 [?]
Q&As Helped to Solve: 3,038 [?]
Skill Endorsements: 115 [?]
Team Colleague
Featured
Sponsor
 
0
 

Do you mean CSplitter from MFC (link)? AFAIK you change the size of each pain by drag-and-drop, not by double clicking or other key combinations. That's all build into the CSplitter class, you need to do nothing.

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: