Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ease-dev] ScrollBars in View

Hi,

 

I have an JS example for you, however it is not optimal. In my case the window needs a resize to display its content. Then the scrollbar works. I guess for a clean implementation you would need some help from the UI Builder module. Please open a bug for this.

 

loadModule('/System/UI');

loadModule('/System/UI Builder');

createView("ScrollView");

 

executeUI("scrolledComposite = new org.eclipse.swt.custom.ScrolledComposite(getComposite(), org.eclipse.swt.SWT.BORDER | org.eclipse.swt.SWT.H_SCROLL | org.eclipse.swt.SWT.V_SCROLL)")

executeUI("scrolledComposite.setExpandHorizontal(true)")

executeUI("scrolledComposite.setExpandVertical(true)")

 

executeUI("innerComposite = new org.eclipse.swt.widgets.Composite(scrolledComposite, org.eclipse.swt.SWT.NONE)")

executeUI("scrolledComposite.setContent(innerComposite);")

 

addControl(scrolledComposite, "1/1  o! o!")

pushComposite(innerComposite);

 

for (x = 1; x < 10; x++)

       createLabel("This is label " + x);

 

 

 

Christian

 

From: ease-dev-bounces@xxxxxxxxxxx <ease-dev-bounces@xxxxxxxxxxx> On Behalf Of NEUMANN.Sven
Sent: Montag, 18. November 2019 09:49
To: ease developer discussions <ease-dev@xxxxxxxxxxx>
Subject: Re: [ease-dev] ScrollBars in View

 

Hi Christian,

 

thanks for the hints. Yes, I try to build a view with the UI Builder module. But I think, I have a problem to understand the SWT structure. I get never a Scrollbar, also not with _javascript_. Has you a sample with _javascript_ for me?

 

loadModule('/System/UI')

loadModule('/System/UI Builder')

 

SWT = org.eclipse.swt.SWT

ScrolledComposite = org.eclipse.swt.custom.ScrolledComposite

GridLayout = org.eclipse.swt.layout.GridLayout

Button = org.eclipse.swt.widgets.Button

 

def buildUI():

    view = createView("UI Test")

    shell = createComposite("o! o!")

 

    sc1 = ScrolledComposite(shell, SWT.BORDER | SWT.V_SCROLL)

    sc1.setAlwaysShowScrollBars(True);

    c1 = createComposite()

    sc1.setContent(c1)

 

    layout = GridLayout();

    layout.numColumns = 4;

    c1.setLayout(layout);       

 

    pushComposite(c1)

   

    createButton("second button", None, "2/2")

   

    b1 = Button (c1, SWT.PUSH);

    b1.setText("first button");

   

executeUI("buildUI()")

 

 

Best Regards

Sven

 

Von: ease-dev-bounces@xxxxxxxxxxx <ease-dev-bounces@xxxxxxxxxxx> Im Auftrag von Christian.Pontesegger@xxxxxxxxxxxx
Gesendet: Freitag, 15.
November 2019 09:41
An: ease-dev@xxxxxxxxxxx
Betreff: Re: [ease-dev] ScrollBars in View

 

Hi Sven,

 

I guess you are using the UI Builder module for this task. Currently we do not provide a nice module method to create a scrolled composite. However you could create the Java instance on your own and use addControl() to add it to your layout. Then use pushComposite(yourScrolledControl)  to set it as the active composite to be used for your UI elements.

 

HTH

Christian

 

From: ease-dev-bounces@xxxxxxxxxxx <ease-dev-bounces@xxxxxxxxxxx> On Behalf Of NEUMANN.Sven
Sent: Freitag, 15. November 2019 09:25
To:
ease-dev@xxxxxxxxxxx
Subject: [ease-dev] ScrollBars in View

 

Hello Devs,

 

I have made a big View  EASE-Script(Python) and need to set Scollbars.

How is this possible with Python or also in _javascript_.

 

Best Regards

Sven

 

 

 

Attachment: smime.p7s
Description: S/MIME cryptographic signature


Back to the top