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?

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.