| Home » Eclipse Projects » Remote Application Platform (RAP) » Popup menu doesn't work on ToolBar in CTabFolder top-right
 Goto Forum:| 
| Popup menu doesn't work on ToolBar in CTabFolder top-right [message #92547] | Tue, 10 June 2008 10:59  |  | 
| Eclipse User  |  |  |  |  | This is a multi-part message in MIME format. --------------060209060902080300010005
 Content-Type: text/plain; charset=ISO-8859-15; format=flowed
 Content-Transfer-Encoding: 7bit
 
 Hi all,
 
 I've created a ToolBar with only one ToolItem of type SWT.DROP_DOWN,
 then I've set the ToolBar as the top-right component of a CTabFolder
 using setTopRight(...).
 
 In the widgetSelected event of the ToolItem I show a modal popup menu.
 
 When I click on the drop down arrow of ToolItem, the browser (both IE7
 and Firefox2.0) dumps a javascript error.
 It's a bug or there's another method to show popup menu from ToolItem?
 
 I attach the code snippet and the output from IE7 and Firefox2.0
 
 Thanks,
 Enrico
 
 --------------060209060902080300010005
 Content-Type: application/octet-stream;
 name="CTabFolder_setTopRight_ToolBar.zip"
 Content-Transfer-Encoding: base64
 Content-Disposition: attachment;
 filename="CTabFolder_setTopRight_ToolBar.zip"
 
 UEsDBBQAAAAIANODyjhdIC71aAIAAGQHAAAQAAAAY29kZV9zbmlwcGV0LnR4 dJ1V32/aMBB+
 r9T/4dqHymhVxHiYJk1Io6NoSIwgyIa0l8ngAyw5dhQbKNr6v8+OQ35As9Ge ULAvd9/n+3yx
 wVqyXQi+BC4NLFOkBr8PSQt+X19BbisuqYA+14mgB2DQBYn745y0PpWRsw0K AdpH+Blh1QAd
 aDQPaiuZJu17sL+Pbfv40G6fRY3oQW0NcUADLkQ+bVXjytGXiC4GSjBMwaxy +tJH9D3M5lEQ
 hROfXiYNDcZg+HufU7iIWfmUcTh+rOS4ULe4CJ8MuQ0l3jYAdi4H7JSA0V7V AE/3IFJKPFBX
 o1nkBPNB7iwYvobT4c9wHPVG8CdzDEa9qEa5yhhVMuXrjSEO7H+kvqqVrb6g PbqzfM/cn4aT
 X/1wPq6z1TRzabUaTyMpYzMUuDRcyRHXBqXdQEdZeHuMJsY68yYt7XO4wzTl DEt3pcF3ijPY
 c7ZG46GQkQLzcYe2/9FDnhhfEcCAoaFcQLebldqbTsM55OHn9g3lFmKvVTbJ VW6OzhSOj/oW
 LhKfts25xVV9BzzV5vYCps6bmCrNOsOlkqyR6mXv1MpN5VogpHYE3XzT18Wp 0AQ3Ue6ASoxf
 tZ8ShxE83UP2f4B3frBB19dNQEmNdUJTtECtwKjjgZaY15UUZ6eVWlLXRzbb Lcg+DxalOf4H
 13whkJh0i6+j22+4VY/cxAHXbslKI7Ofwt2dBV6XwK16b561tEVggT3uWU8y B0PNcmOTbMo/
 jAVaICaNm/R8fdVUM/NL9annaQ3T52p49YIQ/jqo3xoqQXl0lVoRuNF1rTJp Tr/wl+QAq8cl
 GlRWnKLZphLa9m3+5i9QSwMEFAAAAAgAXIPKOGS3j6PiAAAAkwEAABMAAABm aXJlZm94Ml9v
 dXRwdXQudHh0dZCxTgNBDET7SPmHVUQRmpUQoQmiQhFQUIBA1OZuuCza292z vXfw9ziQ6hTa
 8fiNPbe5xtalrA4jxUoK90kjScOhqGNIyUmwXS6Wi5fvgh1z5q07g9uT2Jor nAtYA+Rgydx5
 NDEUgZdJ/W5E0lcN0UuVgtT+CveU2hhStz6/HoktZHA3br76jKFC1HfQhyRK qYH5zesFehza
 8UnBa7farNwfbOpPsN5Ca5hHStSBZ8Sp922wLwWGmS6uDDTXNie0y4M2fPka fJMZxwj/Eavs
 72J+p/hUYTdawv+lWL21x7yTH1BLAwQUAAAACAChg8o4B1V9mOUAAACXAQAA DgAAAGllN19v
 dXRwdXQudHh0dZAxT8QwDIX3Sv0P1i13LJEQxwJiQggYGEBCzKExISh12thu +cn8DFy4qbqb
 orw8f895t0VzACoCOPmsXhC+/OS5q2kQqMhDIcartmmbLWnOW/iB5SxQbIrs pgQlRhQpi6nU
 6LDLaWB0PIu7m5DkVVJ2rDwghT/hwVPIieLu7Hry1WJGuIH16AuOiizO2I/E 4qlD85vXMcrh
 0dYnwbqDzX4D/7C5P8J6S8EwT558xLoizr0Lyf7JaJj5/NJAa21/RLtYtPHb aXJdqXiIcB9Z
 +fM+l3efnxVtR0s4XYoVrD2uO2mbX1BLAQIUABQAAAAIANODyjhdIC71aAIA AGQHAAAQAAAA
 AAAAAAAAIAAAAAAAAABjb2RlX3NuaXBwZXQudHh0UEsBAhQAFAAAAAgAXIPK OGS3j6PiAAAA
 kwEAABMAAAAAAAAAAAAgAAAAlgIAAGZpcmVmb3gyX291dHB1dC50eHRQSwEC FAAUAAAACACh
 g8o4B1V9mOUAAACXAQAADgAAAAAAAAAAACAAAACpAwAAaWU3X291dHB1dC50 eHRQSwUGAAAA
 AAMAAwC7AAAAugQAAAAA
 --------------060209060902080300010005--
 |  |  |  |  |  |  | 
| Re: Popup menu doesn't work on ToolBar in CTabFolder top-right [message #92873 is a reply to message #92547] | Wed, 11 June 2008 11:31   |  | 
| Eclipse User  |  |  |  |  | Originally posted by: ifurnadjiev.innoopract.com 
 Hi Enrico,
 
 first of all I can't find these too classes WFToolBar/WFToolItem, that's
 why I reworked your snippet based on ToolBar/ToolItem (see the snippet
 bellow). Hope that it's working for you.
 
 final ToolBar tftb = new ToolBar(tf, SWT.HORIZONTAL | SWT.FLAT);
 tf.setTopRight(tftb);
 
 final ToolItem tfti1 = new ToolItem(tftb, SWT.DROP_DOWN);
 tfti1.setText("Tool");
 
 tfti1.addSelectionListener(new SelectionAdapter() {
 @Override
 public void widgetSelected(SelectionEvent e) {
 if( e.detail == SWT.ARROW ) {
 Menu m = new Menu( tftb.getShell(), SWT.POP_UP );
 MenuItem mi1 = new MenuItem(m, SWT.NONE);
 mi1.setText("First");
 MenuItem mi2 = new MenuItem(m, SWT.NONE);
 mi2.setText("Second");
 
 Point point = new Point( e.x, e.y );
 m.setLocation( point );
 m.setVisible( true );
 }
 }
 });
 
 Best,
 Ivan
 
 Enrico Zanaga wrote:
 > Hi all,
 >
 > I've created a ToolBar with only one ToolItem of type SWT.DROP_DOWN,
 > then I've set the ToolBar as the top-right component of a CTabFolder
 > using setTopRight(...).
 >
 > In the widgetSelected event of the ToolItem I show a modal popup menu.
 >
 > When I click on the drop down arrow of ToolItem, the browser (both IE7
 > and Firefox2.0) dumps a javascript error.
 > It's a bug or there's another method to show popup menu from ToolItem?
 >
 > I attach the code snippet and the output from IE7 and Firefox2.0
 >
 > Thanks,
 > Enrico
 |  |  |  |  | 
| Re: Popup menu doesn't work on ToolBar in CTabFolder top-right [message #92887 is a reply to message #92873] | Wed, 11 June 2008 11:54   |  | 
| Eclipse User  |  |  |  |  | Hi Ivan, 
 sorry, it's my mistake.
 However the reworked code doesn't work for me, but it's working for you?
 If yes, can you tell me what version (RAP, Eclipse) are you using, please?
 I try the code in 1.1M3 and 1.1RC3 without success...
 
 Thanks,
 Enrico
 
 
 Ivan Furnadjiev ha scritto:
 > Hi Enrico,
 >
 > first of all I can't find these too classes WFToolBar/WFToolItem, that's
 > why I reworked your snippet based on ToolBar/ToolItem (see the snippet
 > bellow). Hope that it's working for you.
 >
 >    final ToolBar tftb = new ToolBar(tf, SWT.HORIZONTAL | SWT.FLAT);
 >    tf.setTopRight(tftb);
 >      final ToolItem tfti1 = new ToolItem(tftb, SWT.DROP_DOWN);
 >    tfti1.setText("Tool");
 >      tfti1.addSelectionListener(new SelectionAdapter() {
 >        @Override
 >        public void widgetSelected(SelectionEvent e) {
 >            if( e.detail == SWT.ARROW ) {
 >                Menu m = new Menu( tftb.getShell(), SWT.POP_UP );
 >                MenuItem mi1 = new MenuItem(m, SWT.NONE);
 >                mi1.setText("First");
 >                MenuItem mi2 = new MenuItem(m, SWT.NONE);
 >                mi2.setText("Second");
 >                              Point point = new Point( e.x, e.y );
 >                m.setLocation( point );
 >                m.setVisible( true );
 >            }
 >        }
 >    });
 >
 > Best,
 > Ivan
 >
 > Enrico Zanaga wrote:
 >> Hi all,
 >>
 >> I've created a ToolBar with only one ToolItem of type SWT.DROP_DOWN,
 >> then I've set the ToolBar as the top-right component of a CTabFolder
 >> using setTopRight(...).
 >>
 >> In the widgetSelected event of the ToolItem I show a modal popup menu.
 >>
 >> When I click on the drop down arrow of ToolItem, the browser (both IE7
 >> and Firefox2.0) dumps a javascript error.
 >> It's a bug or there's another method to show popup menu from ToolItem?
 >>
 >> I attach the code snippet and the output from IE7 and Firefox2.0
 >>
 >> Thanks,
 >> Enrico
 |  |  |  |  | 
| Re: Popup menu doesn't work on ToolBar in CTabFolder top-right [message #92901 is a reply to message #92887] | Wed, 11 June 2008 12:19   |  | 
| Eclipse User  |  |  |  |  | Originally posted by: ifurnadjiev.innoopract.com 
 Hi Enrico,
 
 I run it against 1.1RC3 in FF 2.0.0.14, IE7 and Safari 3.1.1 on Windows
 XP SP3.
 What kind of problems do you have - JavaScript error? Did you use the
 exact snippet from my previous post?
 
 Best,
 Ivan
 
 Enrico Zanaga wrote:
 > Hi Ivan,
 >
 > sorry, it's my mistake.
 > However the reworked code doesn't work for me, but it's working for you?
 > If yes, can you tell me what version (RAP, Eclipse) are you using,
 > please?
 > I try the code in 1.1M3 and 1.1RC3 without success...
 >
 > Thanks,
 > Enrico
 >
 >
 > Ivan Furnadjiev ha scritto:
 >> Hi Enrico,
 >>
 >> first of all I can't find these too classes WFToolBar/WFToolItem,
 >> that's why I reworked your snippet based on ToolBar/ToolItem (see the
 >> snippet bellow). Hope that it's working for you.
 >>
 >>    final ToolBar tftb = new ToolBar(tf, SWT.HORIZONTAL | SWT.FLAT);
 >>    tf.setTopRight(tftb);
 >>      final ToolItem tfti1 = new ToolItem(tftb, SWT.DROP_DOWN);
 >>    tfti1.setText("Tool");
 >>      tfti1.addSelectionListener(new SelectionAdapter() {
 >>        @Override
 >>        public void widgetSelected(SelectionEvent e) {
 >>            if( e.detail == SWT.ARROW ) {
 >>                Menu m = new Menu( tftb.getShell(), SWT.POP_UP );
 >>                MenuItem mi1 = new MenuItem(m, SWT.NONE);
 >>                mi1.setText("First");
 >>                MenuItem mi2 = new MenuItem(m, SWT.NONE);
 >>                mi2.setText("Second");
 >>                              Point point = new Point( e.x, e.y );
 >>                m.setLocation( point );
 >>                m.setVisible( true );
 >>            }
 >>        }
 >>    });
 >>
 >> Best,
 >> Ivan
 >>
 >> Enrico Zanaga wrote:
 >>> Hi all,
 >>>
 >>> I've created a ToolBar with only one ToolItem of type SWT.DROP_DOWN,
 >>> then I've set the ToolBar as the top-right component of a CTabFolder
 >>> using setTopRight(...).
 >>>
 >>> In the widgetSelected event of the ToolItem I show a modal popup menu.
 >>>
 >>> When I click on the drop down arrow of ToolItem, the browser (both
 >>> IE7 and Firefox2.0) dumps a javascript error.
 >>> It's a bug or there's another method to show popup menu from ToolItem?
 >>>
 >>> I attach the code snippet and the output from IE7 and Firefox2.0
 >>>
 >>> Thanks,
 >>> Enrico
 |  |  |  |  | 
| Re: Popup menu doesn't work on ToolBar in CTabFolder top-right [message #92916 is a reply to message #92901] | Wed, 11 June 2008 12:57   |  | 
| Eclipse User  |  |  |  |  | Hi Ivan, 
 running your snippet in IE7, I get the following javascript error:
 
 -------------------------------------------------------
 Could not evaluate javascript response:
 
 'null' è nullo o non è un oggetto
 
 org.eclipse.swt.EventUtil.suspendEventHandling();var req =
 org.eclipse.swt.Request.getInstance();req.setRequestCounter( "3" );var
 wm = org.eclipse.swt.WidgetManager.getInstance();wm.dispose( "w15"
 );wm.dispose( "w14" );wm.dispose( "w13"
 );qx.ui.core.Widget.flushGlobalQueues();org.eclipse.swt.Even tUtil.resumeEventHandling();
 
 -------------------------------------------------------
 
 Maybe a qooxdoo problem?
 
 In Jetty/Eclipse console nothing happen...
 
 Thanks,
 Enrico
 
 
 Ivan Furnadjiev ha scritto:
 > Hi Enrico,
 >
 > I run it against 1.1RC3 in FF 2.0.0.14, IE7 and Safari 3.1.1 on Windows
 > XP SP3.
 > What kind of problems do you have - JavaScript error? Did you use the
 > exact snippet from my previous post?
 >
 > Best,
 > Ivan
 >
 > Enrico Zanaga wrote:
 >> Hi Ivan,
 >>
 >> sorry, it's my mistake.
 >> However the reworked code doesn't work for me, but it's working for you?
 >> If yes, can you tell me what version (RAP, Eclipse) are you using,
 >> please?
 >> I try the code in 1.1M3 and 1.1RC3 without success...
 >>
 >> Thanks,
 >> Enrico
 >>
 >>
 >> Ivan Furnadjiev ha scritto:
 >>> Hi Enrico,
 >>>
 >>> first of all I can't find these too classes WFToolBar/WFToolItem,
 >>> that's why I reworked your snippet based on ToolBar/ToolItem (see the
 >>> snippet bellow). Hope that it's working for you.
 >>>
 >>>    final ToolBar tftb = new ToolBar(tf, SWT.HORIZONTAL | SWT.FLAT);
 >>>    tf.setTopRight(tftb);
 >>>      final ToolItem tfti1 = new ToolItem(tftb, SWT.DROP_DOWN);
 >>>    tfti1.setText("Tool");
 >>>      tfti1.addSelectionListener(new SelectionAdapter() {
 >>>        @Override
 >>>        public void widgetSelected(SelectionEvent e) {
 >>>            if( e.detail == SWT.ARROW ) {
 >>>                Menu m = new Menu( tftb.getShell(), SWT.POP_UP );
 >>>                MenuItem mi1 = new MenuItem(m, SWT.NONE);
 >>>                mi1.setText("First");
 >>>                MenuItem mi2 = new MenuItem(m, SWT.NONE);
 >>>                mi2.setText("Second");
 >>>                              Point point = new Point( e.x, e.y );
 >>>                m.setLocation( point );
 >>>                m.setVisible( true );
 >>>            }
 >>>        }
 >>>    });
 >>>
 >>> Best,
 >>> Ivan
 >>>
 >>> Enrico Zanaga wrote:
 >>>> Hi all,
 >>>>
 >>>> I've created a ToolBar with only one ToolItem of type SWT.DROP_DOWN,
 >>>> then I've set the ToolBar as the top-right component of a CTabFolder
 >>>> using setTopRight(...).
 >>>>
 >>>> In the widgetSelected event of the ToolItem I show a modal popup menu.
 >>>>
 >>>> When I click on the drop down arrow of ToolItem, the browser (both
 >>>> IE7 and Firefox2.0) dumps a javascript error.
 >>>> It's a bug or there's another method to show popup menu from ToolItem?
 >>>>
 >>>> I attach the code snippet and the output from IE7 and Firefox2.0
 >>>>
 >>>> Thanks,
 >>>> Enrico
 |  |  |  |  | 
| Re: Popup menu doesn't work on ToolBar in CTabFolder top-right [message #93004 is a reply to message #92916] | Thu, 12 June 2008 03:07   |  | 
| Eclipse User  |  |  |  |  | Originally posted by: ifurnadjiev.innoopract.com 
 Hi Enrico,
 
 please attach your complete file to have a look at it.
 
 Thanks,
 Ivan
 
 Enrico Zanaga wrote:
 > Hi Ivan,
 >
 > running your snippet in IE7, I get the following javascript error:
 >
 > -------------------------------------------------------
 > Could not evaluate javascript response:
 >
 > 'null' è nullo o non è un oggetto
 >
 > org.eclipse.swt.EventUtil.suspendEventHandling();var req =
 >  org.eclipse.swt.Request.getInstance();req.setRequestCounter( "3" );var
 > wm = org.eclipse.swt.WidgetManager.getInstance();wm.dispose( "w15"
 > );wm.dispose( "w14" );wm.dispose( "w13"
 >  );qx.ui.core.Widget.flushGlobalQueues();org.eclipse.swt.Even tUtil.resumeEventHandling();
 >
 >
 > -------------------------------------------------------
 >
 > Maybe a qooxdoo problem?
 >
 > In Jetty/Eclipse console nothing happen...
 >
 > Thanks,
 > Enrico
 >
 >
 > Ivan Furnadjiev ha scritto:
 >> Hi Enrico,
 >>
 >> I run it against 1.1RC3 in FF 2.0.0.14, IE7 and Safari 3.1.1 on
 >> Windows XP SP3.
 >> What kind of problems do you have - JavaScript error? Did you use the
 >> exact snippet from my previous post?
 >>
 >> Best,
 >> Ivan
 >>
 >> Enrico Zanaga wrote:
 >>> Hi Ivan,
 >>>
 >>> sorry, it's my mistake.
 >>> However the reworked code doesn't work for me, but it's working for
 >>> you?
 >>> If yes, can you tell me what version (RAP, Eclipse) are you using,
 >>> please?
 >>> I try the code in 1.1M3 and 1.1RC3 without success...
 >>>
 >>> Thanks,
 >>> Enrico
 >>>
 >>>
 >>> Ivan Furnadjiev ha scritto:
 >>>> Hi Enrico,
 >>>>
 >>>> first of all I can't find these too classes WFToolBar/WFToolItem,
 >>>> that's why I reworked your snippet based on ToolBar/ToolItem (see
 >>>> the snippet bellow). Hope that it's working for you.
 >>>>
 >>>>    final ToolBar tftb = new ToolBar(tf, SWT.HORIZONTAL | SWT.FLAT);
 >>>>    tf.setTopRight(tftb);
 >>>>      final ToolItem tfti1 = new ToolItem(tftb, SWT.DROP_DOWN);
 >>>>    tfti1.setText("Tool");
 >>>>      tfti1.addSelectionListener(new SelectionAdapter() {
 >>>>        @Override
 >>>>        public void widgetSelected(SelectionEvent e) {
 >>>>            if( e.detail == SWT.ARROW ) {
 >>>>                Menu m = new Menu( tftb.getShell(), SWT.POP_UP );
 >>>>                MenuItem mi1 = new MenuItem(m, SWT.NONE);
 >>>>                mi1.setText("First");
 >>>>                MenuItem mi2 = new MenuItem(m, SWT.NONE);
 >>>>                mi2.setText("Second");
 >>>>                              Point point = new Point( e.x, e.y );
 >>>>                m.setLocation( point );
 >>>>                m.setVisible( true );
 >>>>            }
 >>>>        }
 >>>>    });
 >>>>
 >>>> Best,
 >>>> Ivan
 >>>>
 >>>> Enrico Zanaga wrote:
 >>>>> Hi all,
 >>>>>
 >>>>> I've created a ToolBar with only one ToolItem of type SWT.DROP_DOWN,
 >>>>> then I've set the ToolBar as the top-right component of a CTabFolder
 >>>>> using setTopRight(...).
 >>>>>
 >>>>> In the widgetSelected event of the ToolItem I show a modal popup
 >>>>> menu.
 >>>>>
 >>>>> When I click on the drop down arrow of ToolItem, the browser (both
 >>>>> IE7 and Firefox2.0) dumps a javascript error.
 >>>>> It's a bug or there's another method to show popup menu from
 >>>>> ToolItem?
 >>>>>
 >>>>> I attach the code snippet and the output from IE7 and Firefox2.0
 >>>>>
 >>>>> Thanks,
 >>>>> Enrico
 |  |  |  |  |  |  |  |  | 
| Re: Popup menu doesn't work on ToolBar in CTabFolder top-right [message #93105 is a reply to message #93045] | Thu, 12 June 2008 08:19  |  | 
| Eclipse User  |  |  |  |  | Hi Ivan, 
 it works! Many thanks!
 
 The code in widgetSelected comes from an old version of SWT, and it
 continues to work in SWT 3.3 e 3.4 (RCP mode).
 
 Because my application runs both in RCP and RAP the sources are shared,
 except a little compatibility library.
 I tested the code in both two modes and it works, so this is the final
 solution.
 
 Thanks,
 Enrico
 
 
 Ivan Furnadjiev ha scritto:
 > Hi Enrico,
 >
 > here is the reworked complete code... please test it. You don't need
 > this in widgetSelected:
 > ---
 > while (!m.isDisposed() && m.getVisible()) {
 >  if (!d.readAndDispatch())
 >    d.sleep();
 >  }
 > m.dispose();
 > ---
 >
 > Hope this will help.
 > Best,
 > Ivan
 >
 >
 > Enrico Zanaga wrote:
 >> Hi Ivan,
 >>
 >> I've attached the class I use to reproduce the problem.
 >>
 >> Thanks,
 >> Enrico
 >>
 >>
 >> Ivan Furnadjiev ha scritto:
 >>> Hi Enrico,
 >>>
 >>> please attach your complete file to have a look at it.
 >>>
 >>> Thanks,
 >>> Ivan
 >>>
 >>> Enrico Zanaga wrote:
 >>>> Hi Ivan,
 >>>>
 >>>> running your snippet in IE7, I get the following javascript error:
 >>>>
 >>>> -------------------------------------------------------
 >>>> Could not evaluate javascript response:
 >>>>
 >>>> 'null' è nullo o non è un oggetto
 >>>>
 >>>> org.eclipse.swt.EventUtil.suspendEventHandling();var req =
 >>>>  org.eclipse.swt.Request.getInstance();req.setRequestCounter( "3"
 >>>> );var wm = org.eclipse.swt.WidgetManager.getInstance();wm.dispose(
 >>>> "w15" );wm.dispose( "w14" );wm.dispose( "w13"
 >>>>  );qx.ui.core.Widget.flushGlobalQueues();org.eclipse.swt.Even tUtil.resumeEventHandling();
 >>>>
 >>>>
 >>>> -------------------------------------------------------
 >>>>
 >>>> Maybe a qooxdoo problem?
 >>>>
 >>>> In Jetty/Eclipse console nothing happen...
 >>>>
 >>>> Thanks,
 >>>> Enrico
 >>>>
 >>>>
 >>>> Ivan Furnadjiev ha scritto:
 >>>>> Hi Enrico,
 >>>>>
 >>>>> I run it against 1.1RC3 in FF 2.0.0.14, IE7 and Safari 3.1.1 on
 >>>>> Windows XP SP3.
 >>>>> What kind of problems do you have - JavaScript error? Did you use
 >>>>> the exact snippet from my previous post?
 >>>>>
 >>>>> Best,
 >>>>> Ivan
 >>>>>
 >>>>> Enrico Zanaga wrote:
 >>>>>> Hi Ivan,
 >>>>>>
 >>>>>> sorry, it's my mistake.
 >>>>>> However the reworked code doesn't work for me, but it's working
 >>>>>> for you?
 >>>>>> If yes, can you tell me what version (RAP, Eclipse) are you using,
 >>>>>> please?
 >>>>>> I try the code in 1.1M3 and 1.1RC3 without success...
 >>>>>>
 >>>>>> Thanks,
 >>>>>> Enrico
 >>>>>>
 >>>>>>
 >>>>>> Ivan Furnadjiev ha scritto:
 >>>>>>> Hi Enrico,
 >>>>>>>
 >>>>>>> first of all I can't find these too classes WFToolBar/WFToolItem,
 >>>>>>> that's why I reworked your snippet based on ToolBar/ToolItem (see
 >>>>>>> the snippet bellow). Hope that it's working for you.
 >>>>>>>
 >>>>>>>    final ToolBar tftb = new ToolBar(tf, SWT.HORIZONTAL | SWT.FLAT);
 >>>>>>>    tf.setTopRight(tftb);
 >>>>>>>      final ToolItem tfti1 = new ToolItem(tftb, SWT.DROP_DOWN);
 >>>>>>>    tfti1.setText("Tool");
 >>>>>>>      tfti1.addSelectionListener(new SelectionAdapter() {
 >>>>>>>        @Override
 >>>>>>>        public void widgetSelected(SelectionEvent e) {
 >>>>>>>            if( e.detail == SWT.ARROW ) {
 >>>>>>>                Menu m = new Menu( tftb.getShell(), SWT.POP_UP );
 >>>>>>>                MenuItem mi1 = new MenuItem(m, SWT.NONE);
 >>>>>>>                mi1.setText("First");
 >>>>>>>                MenuItem mi2 = new MenuItem(m, SWT.NONE);
 >>>>>>>                mi2.setText("Second");
 >>>>>>>                              Point point = new Point( e.x, e.y );
 >>>>>>>                m.setLocation( point );
 >>>>>>>                m.setVisible( true );
 >>>>>>>            }
 >>>>>>>        }
 >>>>>>>    });
 >>>>>>>
 >>>>>>> Best,
 >>>>>>> Ivan
 >>>>>>>
 >>>>>>> Enrico Zanaga wrote:
 >>>>>>>> Hi all,
 >>>>>>>>
 >>>>>>>> I've created a ToolBar with only one ToolItem of type
 >>>>>>>> SWT.DROP_DOWN,
 >>>>>>>> then I've set the ToolBar as the top-right component of a
 >>>>>>>> CTabFolder
 >>>>>>>> using setTopRight(...).
 >>>>>>>>
 >>>>>>>> In the widgetSelected event of the ToolItem I show a modal popup
 >>>>>>>> menu.
 >>>>>>>>
 >>>>>>>> When I click on the drop down arrow of ToolItem, the browser
 >>>>>>>> (both IE7 and Firefox2.0) dumps a javascript error.
 >>>>>>>> It's a bug or there's another method to show popup menu from
 >>>>>>>> ToolItem?
 >>>>>>>>
 >>>>>>>> I attach the code snippet and the output from IE7 and Firefox2.0
 >>>>>>>>
 >>>>>>>> Thanks,
 >>>>>>>> Enrico
 >>
 |  |  |  | 
 
 
 Current Time: Fri Oct 31 17:06:22 EDT 2025 
 Powered by FUDForum . Page generated in 0.04178 seconds |