max value [message #466168] |
Wed, 04 January 2006 10:30 |
Eclipse User |
|
|
|
Originally posted by: ingo.siebertNOSPAM.cas.de
Hi,
i use a table and i wanted to know, if a user drags the bar from the
vertical scrollbar to the maximum value.
The maximum value is never reached, so i can't do a check like
int scrollBarValue = scrollBar.getSelection();
int maxScrollBarValue = scrollBar.getMaximum();
if (scrollBarValue >= maxScrollBarValue) .... // fails anytime
I think that's the same in Swing and i hoped it doesn't exist in SWT.
Any idea how to solve this problem?
Thanks,
Ingo
|
|
|
|
|
Re: max value [message #466267 is a reply to message #466252] |
Thu, 05 January 2006 16:13 |
Eclipse User |
|
|
|
Originally posted by: ingo.siebertNOSPAM.cas.de
Thank you both.
It looks very promising and i will try i soon.
Ingo
Veronika Irvine schrieb:
> Composite c = new Composite(shell, SWT.V_SCROLL | SWT.H_SCROLL);
> final ScrollBar bar = c.getVerticalBar();
> bar.addSelectionListener(new SelectionAdapter() {
> public void widgetSelected(SelectionEvent e) {
> int scrollBarValue = bar.getSelection();
> int maxScrollBarValue = bar.getMaximum();
> int thumb = bar.getThumb();
> if (scrollBarValue + thumb == maxScrollBarValue) {
> System.out.println("Max reached");
> }
> }
> });
>
>
> "Ingo Siebert" <ingo.siebertNOSPAM@cas.de> wrote in message
> news:dpg87i$4pq$1@utils.eclipse.org...
>
>>Hi,
>>
>>i use a table and i wanted to know, if a user drags the bar from the
>>vertical scrollbar to the maximum value.
>>
>>The maximum value is never reached, so i can't do a check like
>>
>>int scrollBarValue = scrollBar.getSelection();
>>int maxScrollBarValue = scrollBar.getMaximum();
>>if (scrollBarValue >= maxScrollBarValue) .... // fails anytime
>>
>>I think that's the same in Swing and i hoped it doesn't exist in SWT. Any
>>idea how to solve this problem?
>>Thanks,
>>
>>Ingo
>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03598 seconds