Change width of Table scroll bars

Is there any way to change the width of the scroll bars on a Table Component? I would like to use the table in a mobile app, but I have fat fingers and it is difficult to navigate the table.

Thanks.

1 Like

You can use getVerticalScrollBar() and setPreferredSize() from Java’s ScrollPaneLayout, which is from Java Swing (which Ignition uses). An example:

[code]from java.awt import Dimension
from java.lang import Integer

create Dimension object, first parameter is width of scrollbar

new_scrollbar_width = Dimension(25, Integer.MAX_VALUE)

get component object, pass the Dimension object to setPreferredSize to change width

comp = system.gui.getWindow(‘WindowName’).getRootContainer().getComponent(“Table”)
comp.getVerticalScrollBar().setPreferredSize(new_scrollbar_width)

a hacky way of “repainting” the component, since repaint() won’t work.

manually resizing the component in the designer using the arrows would work as well

system.gui.resizeComponent(comp,comp.getWidth()+1,comp.getHeight()+1)
system.gui.resizeComponent(comp,comp.getWidth()-1,comp.getHeight()-1)[/code]

1 Like

Would this code be put on the component somewhere? Where does it need added?
I also have a similar need to increase the size of the scroll bar.
Its not on mobile but same principle.

It just depends on when or how often you want to change the scrollbar width. If you’re just making a static change to the scrollbar width in the designer, you can go to Tools -> Script Playground and put the script in there. If you want a user to change the width while using the client, you can use a button/pop-up window to prompt the user to change the value, or use a numeric text field. If you need it to dynamically change at a certain time or when a tag changes, you can use a gateway startup script. There are many different implementations that can be applied.

1 Like

Hello,

May i do it to an easychart component? To the verticalscrollbar from the tagpens?

Thank you.

If this is a touchscreen application, you can make all the scroll bars larger in a project by going to project->Properties->Client->General->Touch Screen Mode Enabled->Scrollbar Width

2 Likes

Exactly, it´s for a touch screen application.

Thank you very much.