Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] OLE Win32 - Menu issues with OleControlSite

The comment was written over 7 years ago and the person who wrote it has 
left the company a few years now.
IMO, the bug proves the comment is wrong and  OleControlSite needs the 
same code that OleClientSite has in OnUIDeactivate(int).

Please paste the results of your investigation on the bug report.

Thanks,
Felipe





From:
spwanderer-know@xxxxxxxxx
To:
platform-swt-dev@xxxxxxxxxxx
Date:
15/01/2010 04:18 AM
Subject:
[platform-swt-dev] OLE Win32 - Menu issues with OleControlSite
Sent by:
platform-swt-dev-bounces@xxxxxxxxxxx




Hi experts,
This is regarding the Bug Id. 299241 regarding menu issues with 
OleControlSite.

Opening a view with an OleControlSite and closing it wipes away the shell 
menu bar (see bugzilla for details on how to reproduce the error). We've 
observed that the same does not happen with OleClientSite. So I compared 
both the classes and was able to see the difference in the '
OnUIDeactivate(int fUndoable)' method.

The OleClientSite contains the following extra code in its OnUIDeactivate 
method:
    Menu menubar = shell.getMenuBar();
    if (menubar == null || menubar.isDisposed())
        return COM.S_OK;
 
    int /*long*/ shellHandle = shell.handle;
    OS.SetMenu(shellHandle, menubar.handle);
    return COM.OleSetMenuDescriptor(0, shellHandle, 0, 0, 0);
 
But the OnUIDeactivate method in the OleControlSite does not contain this 
(there's a comment, though)
protected int OnUIDeactivate(int fUndoable) {
    // controls don't need to do anything for
    // border space or menubars
    if (frame == null || frame.isDisposed()) return COM.S_OK;
    state = STATE_INPLACEACTIVE;
    frame.SetActiveObject(0,0);
    redraw();
    Shell shell = getShell();
    if (isFocusControl() || frame.isFocusControl()) {
        shell.traverse(SWT.TRAVERSE_TAB_NEXT);
    }
    return COM.S_OK;
}

For testing purposes, I added the missing menu bar related code to the 
OleControlSite class and tested our view. This time we did not have any 
problem; the menus stay even after closing the view. 

However, since it is clear that the SWT OLE team deliberately left out 
this menu related code in OleControlSite, we are worried if adding this in 
OleControlSite might cause other issues.
Can anyone elaborate the comment '// controls don't need to do anything 
for border space or menubars' ?

Is it ok to add the OS.SetMenu and OS.OleSetMenuDescriptor calls in the 
OleControlSite's OnUIDeactivate method?

 
Thank you
Satish


The INTERNET now has a personality. YOURS! See your Yahoo! Homepage.
_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev





Back to the top