Shell titlebar minimize button [message #88836] |
Tue, 20 May 2008 09:49  |
Eclipse User |
|
|
|
I have problem with minimize button in shell's title bar.
Scenario for snippet:
1. click at button "Open". Shell is correctly open and show to user.
2. click at SWT.MIN button in top right corner (titlebar) in opened
shell. Shell correctly disappear.
3. click at button "Show". Nothing happens. BUG. I analyze why shell do
not show at this moment and I think that shell have bad setting
attributes (minimize, visible and maybe others) because it was not set
in scenario step 2.
addition:
4. click at button "Hide". Nothing happens. Correct. This step I make
only for correct minimize attribute on shell.
5. click at button "Show". Shell is visible.
Snippet:
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.part.ViewPart;
public class TestView extends ViewPart{
@Override
public void createPartControl(Composite parent) {
final Shell shell = new
Shell(Display.getCurrent().getActiveShell(), SWT.SHELL_TRIM);
shell.setBounds(50, 50, 200, 200);
Button btnOpen = new Button(parent, SWT.PUSH);
btnOpen.setText("Open");
btnOpen.addSelectionListener(new SelectionAdapter(){
public void widgetSelected(SelectionEvent e) {
shell.open();
}
});
Button btnHide = new Button(parent, SWT.PUSH);
btnHide.setText("Hide");
btnHide.addSelectionListener(new SelectionAdapter(){
public void widgetSelected(SelectionEvent e) {
shell.setMinimized(true);
}
});
Button btnShow = new Button(parent, SWT.PUSH);
btnShow.setText("Show");
btnShow.addSelectionListener(new SelectionAdapter(){
public void widgetSelected(SelectionEvent e) {
shell.setMinimized(false);
}
});
}
@Override
public void setFocus() {
//nothing
}
}
|
|
|
Re: Shell titlebar minimize button [message #88917 is a reply to message #88836] |
Tue, 20 May 2008 14:55   |
Eclipse User |
|
|
|
Originally posted by: rherrmann.innoopract.com
Hi,
thanks for pointing this out, which version of RAP did you use?
Cheers,
Rüdiger
Michal NkD Nikodím wrote:
> I have problem with minimize button in shell's title bar.
>
> Scenario for snippet:
> 1. click at button "Open". Shell is correctly open and show to user.
> 2. click at SWT.MIN button in top right corner (titlebar) in opened
> shell. Shell correctly disappear.
> 3. click at button "Show". Nothing happens. BUG. I analyze why shell do
> not show at this moment and I think that shell have bad setting
> attributes (minimize, visible and maybe others) because it was not set
> in scenario step 2.
>
> addition:
>
> 4. click at button "Hide". Nothing happens. Correct. This step I make
> only for correct minimize attribute on shell.
> 5. click at button "Show". Shell is visible.
>
>
> Snippet:
>
> import org.eclipse.swt.SWT;
> import org.eclipse.swt.events.SelectionAdapter;
> import org.eclipse.swt.events.SelectionEvent;
> import org.eclipse.swt.widgets.Button;
> import org.eclipse.swt.widgets.Composite;
> import org.eclipse.swt.widgets.Display;
> import org.eclipse.swt.widgets.Shell;
> import org.eclipse.ui.part.ViewPart;
>
> public class TestView extends ViewPart{
>
> @Override
> public void createPartControl(Composite parent) {
> final Shell shell = new
> Shell(Display.getCurrent().getActiveShell(), SWT.SHELL_TRIM);
> shell.setBounds(50, 50, 200, 200);
>
> Button btnOpen = new Button(parent, SWT.PUSH);
> btnOpen.setText("Open");
> btnOpen.addSelectionListener(new SelectionAdapter(){
> public void widgetSelected(SelectionEvent e) {
> shell.open();
> }
> });
>
> Button btnHide = new Button(parent, SWT.PUSH);
> btnHide.setText("Hide");
> btnHide.addSelectionListener(new SelectionAdapter(){
> public void widgetSelected(SelectionEvent e) {
> shell.setMinimized(true);
> }
> });
>
> Button btnShow = new Button(parent, SWT.PUSH);
> btnShow.setText("Show");
> btnShow.addSelectionListener(new SelectionAdapter(){
> public void widgetSelected(SelectionEvent e) {
> shell.setMinimized(false);
> }
> });
> }
>
> @Override
> public void setFocus() {
> //nothing
> }
>
> }
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04120 seconds